From f16a9d29ec4b0f401338397dee7f5d24f9acffb5 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Thu, 31 May 2001 23:45:44 +0000 Subject: Development branch for TIPs 22 and 33 --- ChangeLog | 991 --- README | 401 -- changes | 4309 ------------ compat/README | 8 - compat/dirent.h | 23 - compat/dirent2.h | 59 - compat/dlfcn.h | 65 - compat/fixstrtod.c | 38 - compat/float.h | 16 - compat/gettod.c | 32 - compat/limits.h | 24 - compat/memcmp.c | 61 - compat/opendir.c | 108 - compat/stdlib.h | 45 - compat/strftime.c | 384 - compat/string.h | 70 - compat/strncasecmp.c | 142 - compat/strstr.c | 68 - compat/strtod.c | 257 - compat/strtol.c | 83 - compat/strtoul.c | 183 - compat/tclErrno.h | 100 - compat/tmpnam.c | 42 - compat/unistd.h | 84 - compat/waitpid.c | 170 - doc/AddErrInfo.3 | 174 - doc/Alloc.3 | 52 - doc/AllowExc.3 | 42 - doc/AppInit.3 | 73 - doc/AssocData.3 | 89 - doc/Async.3 | 156 - doc/BackgdErr.3 | 58 - doc/Backslash.3 | 53 - doc/BoolObj.3 | 83 - doc/ByteArrObj.3 | 91 - doc/CallDel.3 | 63 - doc/CmdCmplt.3 | 36 - doc/Concat.3 | 55 - doc/CrtChannel.3 | 592 -- doc/CrtChnlHdlr.3 | 92 - doc/CrtCloseHdlr.3 | 59 - doc/CrtCommand.3 | 143 - doc/CrtFileHdlr.3 | 100 - doc/CrtInterp.3 | 131 - doc/CrtMathFnc.3 | 93 - doc/CrtObjCmd.3 | 261 - doc/CrtSlave.3 | 230 - doc/CrtTimerHdlr.3 | 76 - doc/CrtTrace.3 | 106 - doc/DString.3 | 145 - doc/DetachPids.3 | 62 - doc/DoOneEvent.3 | 108 - doc/DoWhenIdle.3 | 86 - doc/DoubleObj.3 | 79 - doc/Encoding.3 | 484 -- doc/Eval.3 | 196 - doc/Exit.3 | 131 - doc/ExprLong.3 | 114 - doc/ExprLongObj.3 | 104 - doc/FindExec.3 | 56 - doc/GetCwd.3 | 54 - doc/GetIndex.3 | 100 - doc/GetInt.3 | 81 - doc/GetOpnFl.3 | 61 - doc/GetStdChan.3 | 73 - doc/GetVersion.3 | 49 - doc/Hash.3 | 208 - doc/IntObj.3 | 104 - doc/Interp.3 | 125 - doc/LinkVar.3 | 115 - doc/ListObj.3 | 249 - doc/Notifier.3 | 537 -- doc/Object.3 | 337 - doc/ObjectType.3 | 198 - doc/OpenFileChnl.3 | 566 -- doc/OpenTcp.3 | 179 - doc/ParseCmd.3 | 426 -- doc/PkgRequire.3 | 87 - doc/Preserve.3 | 103 - doc/PrintDbl.3 | 47 - doc/RecEvalObj.3 | 55 - doc/RecordEval.3 | 57 - doc/RegExp.3 | 131 - doc/SaveResult.3 | 65 - doc/SetErrno.3 | 48 - doc/SetRecLmt.3 | 55 - doc/SetResult.3 | 225 - doc/SetVar.3 | 261 - doc/Sleep.3 | 37 - doc/SplitList.3 | 191 - doc/SplitPath.3 | 93 - doc/StaticPkg.3 | 70 - doc/StrMatch.3 | 39 - doc/StringObj.3 | 161 - doc/Tcl.n | 195 - doc/Tcl_Main.3 | 61 - doc/Thread.3 | 100 - doc/ToUpper.3 | 90 - doc/TraceVar.3 | 366 - doc/Translate.3 | 66 - doc/UpVar.3 | 76 - doc/Utf.3 | 160 - doc/WrongNumArgs.3 | 79 - doc/after.n | 109 - doc/append.n | 32 - doc/array.n | 116 - doc/bgerror.n | 68 - doc/binary.n | 532 -- doc/break.n | 34 - doc/case.n | 59 - doc/catch.n | 70 - doc/cd.n | 28 - doc/clock.n | 188 - doc/close.n | 59 - doc/concat.n | 40 - doc/continue.n | 34 - doc/dde.n | 124 - doc/encoding.n | 79 - doc/eof.n | 27 - doc/error.n | 58 - doc/eval.n | 30 - doc/exec.n | 358 - doc/exit.n | 28 - doc/expr.n | 323 - doc/fblocked.n | 32 - doc/fconfigure.n | 200 - doc/fcopy.n | 127 - doc/file.n | 331 - doc/fileevent.n | 109 - doc/filename.n | 197 - doc/flush.n | 35 - doc/for.n | 60 - doc/foreach.n | 86 - doc/format.n | 214 - doc/gets.n | 50 - doc/glob.n | 93 - doc/global.n | 35 - doc/history.n | 104 - doc/http.n | 362 - doc/if.n | 43 - doc/incr.n | 31 - doc/info.n | 185 - doc/interp.n | 540 -- doc/join.n | 29 - doc/lappend.n | 35 - doc/library.n | 288 - doc/lindex.n | 35 - doc/linsert.n | 33 - doc/list.n | 45 - doc/llength.n | 26 - doc/load.n | 120 - doc/lrange.n | 39 - doc/lreplace.n | 43 - doc/lsearch.n | 45 - doc/lsort.n | 89 - doc/man.macros | 236 - doc/msgcat.n | 207 - doc/namespace.n | 563 -- doc/open.n | 249 - doc/package.n | 193 - doc/pid.n | 34 - doc/pkgMkIndex.n | 240 - doc/proc.n | 74 - doc/puts.n | 69 - doc/pwd.n | 25 - doc/read.n | 50 - doc/regexp.n | 1048 --- doc/registry.n | 168 - doc/regsub.n | 72 - doc/rename.n | 32 - doc/resource.n | 155 - doc/return.n | 89 - doc/safe.n | 350 - doc/scan.n | 182 - doc/seek.n | 55 - doc/set.n | 48 - doc/socket.n | 134 - doc/source.n | 44 - doc/split.n | 44 - doc/string.n | 143 - doc/subst.n | 48 - doc/switch.n | 107 - doc/tclsh.1 | 118 - doc/tclvars.n | 367 - doc/tell.n | 28 - doc/time.n | 33 - doc/trace.n | 158 - doc/unknown.n | 75 - doc/unset.n | 34 - doc/update.n | 48 - doc/uplevel.n | 80 - doc/upvar.n | 92 - doc/variable.n | 63 - doc/vwait.n | 38 - doc/while.n | 55 - generic/README | 5 - generic/regc_color.c | 742 -- generic/regc_cvec.c | 170 - generic/regc_lex.c | 1010 --- generic/regc_locale.c | 781 --- generic/regc_nfa.c | 1528 ---- generic/regcomp.c | 2124 ------ generic/regcustom.h | 85 - generic/rege_dfa.c | 627 -- generic/regerror.c | 82 - generic/regerrs.h | 18 - generic/regex.h | 308 - generic/regexec.c | 952 --- generic/regfree.c | 25 - generic/regfronts.c | 56 - generic/regguts.h | 388 -- generic/tcl.decls | 1321 ---- generic/tcl.h | 1520 ---- generic/tclAlloc.c | 717 -- generic/tclAsync.c | 280 - generic/tclBasic.c | 4220 ----------- generic/tclBinary.c | 1549 ----- generic/tclCkalloc.c | 974 --- generic/tclClock.c | 323 - generic/tclCmdAH.c | 2305 ------ generic/tclCmdIL.c | 2991 -------- generic/tclCmdMZ.c | 1935 ------ generic/tclCompCmds.c | 1980 ------ generic/tclCompExpr.c | 1048 --- generic/tclCompile.c | 3452 --------- generic/tclCompile.h | 981 --- generic/tclDate.c | 1638 ----- generic/tclDecls.h | 2995 -------- generic/tclEncoding.c | 2685 ------- generic/tclEnv.c | 669 -- generic/tclEvent.c | 1129 --- generic/tclExecute.c | 5136 -------------- generic/tclFCmd.c | 841 --- generic/tclFileName.c | 1720 ----- generic/tclGet.c | 320 - generic/tclGetDate.y | 958 --- generic/tclHash.c | 926 --- generic/tclHistory.c | 145 - generic/tclIO.c | 7603 -------------------- generic/tclIOCmd.c | 1537 ---- generic/tclIOSock.c | 109 - generic/tclIOUtil.c | 876 --- generic/tclIndexObj.c | 332 - generic/tclInitScript.h | 82 - generic/tclInt.decls | 778 --- generic/tclInt.h | 2184 ------ generic/tclIntDecls.h | 1134 --- generic/tclIntPlatDecls.h | 519 -- generic/tclInterp.c | 2355 ------- generic/tclLink.c | 430 -- generic/tclListObj.c | 1059 --- generic/tclLiteral.c | 929 --- generic/tclLoad.c | 655 -- generic/tclLoadNone.c | 82 - generic/tclMain.c | 275 - generic/tclMath.h | 27 - generic/tclNamesp.c | 3869 ----------- generic/tclNotify.c | 1046 --- generic/tclObj.c | 2088 ------ generic/tclPanic.c | 123 - generic/tclParse.c | 2224 ------ generic/tclParseExpr.c | 1826 ----- generic/tclPipe.c | 1061 --- generic/tclPkg.c | 976 --- generic/tclPlatDecls.h | 146 - generic/tclPort.h | 29 - generic/tclPosixStr.c | 1174 ---- generic/tclPreserve.c | 490 -- generic/tclProc.c | 1557 ----- generic/tclRegexp.c | 792 --- generic/tclRegexp.h | 92 - generic/tclResolve.c | 418 -- generic/tclResult.c | 1025 --- generic/tclScan.c | 1032 --- generic/tclStringObj.c | 655 -- generic/tclStubInit.c | 687 -- generic/tclStubLib.c | 113 - generic/tclStubs.c | 3267 --------- generic/tclTest.c | 4226 ----------- generic/tclTestObj.c | 1110 --- generic/tclTestProcBodyObj.c | 319 - generic/tclThread.c | 563 -- generic/tclThreadTest.c | 898 --- generic/tclTimer.c | 1128 --- generic/tclUniData.c | 621 -- generic/tclUtf.c | 1287 ---- generic/tclUtil.c | 2160 ------ generic/tclVar.c | 4655 ------------- library/auto.tcl | 553 -- library/encoding/ascii.enc | 20 - library/encoding/big5.enc | 1516 ---- library/encoding/cp1250.enc | 20 - library/encoding/cp1251.enc | 20 - library/encoding/cp1252.enc | 20 - library/encoding/cp1253.enc | 20 - library/encoding/cp1254.enc | 20 - library/encoding/cp1255.enc | 20 - library/encoding/cp1256.enc | 20 - library/encoding/cp1257.enc | 20 - library/encoding/cp1258.enc | 20 - library/encoding/cp437.enc | 20 - library/encoding/cp737.enc | 20 - library/encoding/cp775.enc | 20 - library/encoding/cp850.enc | 20 - library/encoding/cp852.enc | 20 - library/encoding/cp855.enc | 20 - library/encoding/cp857.enc | 20 - library/encoding/cp860.enc | 20 - library/encoding/cp861.enc | 20 - library/encoding/cp862.enc | 20 - library/encoding/cp863.enc | 20 - library/encoding/cp864.enc | 20 - library/encoding/cp865.enc | 20 - library/encoding/cp866.enc | 20 - library/encoding/cp869.enc | 20 - library/encoding/cp874.enc | 20 - library/encoding/cp932.enc | 785 --- library/encoding/cp936.enc | 2162 ------ library/encoding/cp949.enc | 2128 ------ library/encoding/cp950.enc | 1499 ---- library/encoding/dingbats.enc | 20 - library/encoding/euc-cn.enc | 1397 ---- library/encoding/euc-jp.enc | 1346 ---- library/encoding/euc-kr.enc | 1533 ---- library/encoding/gb12345.enc | 1414 ---- library/encoding/gb1988.enc | 20 - library/encoding/gb2312.enc | 1380 ---- library/encoding/iso2022-jp.enc | 12 - library/encoding/iso2022-kr.enc | 7 - library/encoding/iso2022.enc | 16 - library/encoding/iso8859-1.enc | 20 - library/encoding/iso8859-2.enc | 20 - library/encoding/iso8859-3.enc | 20 - library/encoding/iso8859-4.enc | 20 - library/encoding/iso8859-5.enc | 20 - library/encoding/iso8859-6.enc | 20 - library/encoding/iso8859-7.enc | 20 - library/encoding/iso8859-8.enc | 20 - library/encoding/iso8859-9.enc | 20 - library/encoding/jis0201.enc | 20 - library/encoding/jis0208.enc | 1312 ---- library/encoding/jis0212.enc | 1159 ---- library/encoding/ksc5601.enc | 1516 ---- library/encoding/macCentEuro.enc | 20 - library/encoding/macCroatian.enc | 20 - library/encoding/macCyrillic.enc | 20 - library/encoding/macDingbats.enc | 20 - library/encoding/macGreek.enc | 20 - library/encoding/macIceland.enc | 20 - library/encoding/macJapan.enc | 785 --- library/encoding/macRoman.enc | 20 - library/encoding/macRomania.enc | 20 - library/encoding/macThai.enc | 20 - library/encoding/macTurkish.enc | 20 - library/encoding/macUkraine.enc | 20 - library/encoding/shiftjis.enc | 683 -- library/encoding/symbol.enc | 20 - library/history.tcl | 369 - library/http/http.tcl | 466 -- library/http/pkgIndex.tcl | 11 - library/http1.0/http.tcl | 379 - library/http1.0/pkgIndex.tcl | 11 - library/http2.0/http.tcl | 466 -- library/http2.0/pkgIndex.tcl | 11 - library/http2.1/http.tcl | 466 -- library/http2.1/pkgIndex.tcl | 11 - library/http2.3/http.tcl | 466 -- library/http2.3/pkgIndex.tcl | 11 - library/init.tcl | 562 -- library/ldAout.tcl | 240 - library/msgcat/msgcat.tcl | 177 - library/msgcat/pkgIndex.tcl | 1 - library/msgcat1.0/msgcat.tcl | 177 - library/msgcat1.0/pkgIndex.tcl | 1 - library/opt/optparse.tcl | 1097 --- library/opt/pkgIndex.tcl | 11 - library/opt0.4/optparse.tcl | 1097 --- library/opt0.4/pkgIndex.tcl | 11 - library/package.tcl | 473 -- library/parray.tcl | 29 - library/safe.tcl | 931 --- library/tclIndex | 81 - library/word.tcl | 132 - license.terms | 39 - mac/AppleScript.html | 298 - mac/Background.doc | 92 - mac/MW_TclAppleScriptHeader.pch | 47 - mac/MW_TclHeader.pch | 47 - mac/README | 176 - mac/bugs.doc | 32 - mac/libmoto.doc | 39 - mac/morefiles.doc | 74 - mac/porting.notes | 23 - mac/tclMac.h | 38 - mac/tclMacAETE.r | 58 - mac/tclMacAlloc.c | 348 - mac/tclMacAppInit.c | 212 - mac/tclMacApplication.r | 75 - mac/tclMacBOAAppInit.c | 257 - mac/tclMacBOAMain.c | 361 - mac/tclMacChan.c | 1394 ---- mac/tclMacCommonPch.h | 88 - mac/tclMacDNR.c | 23 - mac/tclMacEnv.c | 536 -- mac/tclMacExit.c | 333 - mac/tclMacFCmd.c | 1535 ---- mac/tclMacFile.c | 832 --- mac/tclMacInit.c | 694 -- mac/tclMacInt.h | 60 - mac/tclMacInterupt.c | 289 - mac/tclMacLibrary.c | 241 - mac/tclMacLibrary.r | 221 - mac/tclMacLoad.c | 284 - mac/tclMacMSLPrefix.h | 24 - mac/tclMacMath.h | 145 - mac/tclMacNotify.c | 554 -- mac/tclMacOSA.c | 2937 -------- mac/tclMacOSA.exp | 1 - mac/tclMacOSA.r | 76 - mac/tclMacPanic.c | 235 - mac/tclMacPort.h | 283 - mac/tclMacProjects.sea.hqx | 1 - mac/tclMacResource.c | 2209 ------ mac/tclMacResource.r | 90 - mac/tclMacShLib.exp | 1066 --- mac/tclMacSock.c | 2637 ------- mac/tclMacTclCode.r | 36 - mac/tclMacTest.c | 242 - mac/tclMacThrd.c | 795 --- mac/tclMacThrd.h | 20 - mac/tclMacTime.c | 313 - mac/tclMacUnix.c | 425 -- mac/tclMacUtil.c | 441 -- tests/README | 423 -- tests/all.tcl | 76 - tests/append.test | 194 - tests/assocd.test | 77 - tests/async.test | 150 - tests/autoMkindex.tcl | 73 - tests/autoMkindex.test | 189 - tests/basic.test | 545 -- tests/binary.test | 1462 ---- tests/case.test | 102 - tests/clock.test | 225 - tests/cmdAH.test | 1484 ---- tests/cmdIL.test | 325 - tests/cmdInfo.test | 116 - tests/cmdMZ.test | 581 -- tests/compExpr-old.test | 687 -- tests/compExpr.test | 340 - tests/compile.test | 214 - tests/concat.test | 65 - tests/dcall.test | 60 - tests/defs.tcl | 990 --- tests/dstring.test | 267 - tests/encoding.test | 316 - tests/env.test | 261 - tests/error.test | 192 - tests/eval.test | 74 - tests/event.test | 589 -- tests/exec.test | 589 -- tests/execute.test | 548 -- tests/expr-old.test | 948 --- tests/expr.test | 709 -- tests/fCmd.test | 2164 ------ tests/fileName.test | 1429 ---- tests/for-old.test | 84 - tests/for.test | 752 -- tests/foreach.test | 242 - tests/format.test | 499 -- tests/get.test | 110 - tests/history.test | 230 - tests/http.test | 315 - tests/httpd | 148 - tests/httpold.test | 441 -- tests/if-old.test | 175 - tests/if.test | 1091 --- tests/incr-old.test | 106 - tests/incr.test | 513 -- tests/indexObj.test | 86 - tests/info.test | 517 -- tests/init.test | 167 - tests/interp.test | 2360 ------- tests/io.test | 6809 ------------------ tests/ioCmd.test | 528 -- tests/ioUtil.test | 318 - tests/join.test | 65 - tests/lindex.test | 93 - tests/link.test | 255 - tests/linsert.test | 123 - tests/list.test | 126 - tests/listObj.test | 199 - tests/llength.test | 54 - tests/load.test | 194 - tests/lrange.test | 102 - tests/lreplace.test | 149 - tests/lsearch.test | 105 - tests/macFCmd.test | 208 - tests/misc.test | 75 - tests/msgcat.test | 318 - tests/namespace-old.test | 863 --- tests/namespace.test | 1115 --- tests/obj.test | 546 -- tests/opt.test | 290 - tests/osa.test | 47 - tests/parse.test | 743 -- tests/parseExpr.test | 637 -- tests/parseOld.test | 546 -- tests/pid.test | 70 - tests/pkg.test | 652 -- tests/pkg/circ1.tcl | 34 - tests/pkg/circ2.tcl | 25 - tests/pkg/circ3.tcl | 25 - tests/pkg/global.tcl | 19 - tests/pkg/import.tcl | 16 - tests/pkg/pkg1.tcl | 26 - tests/pkg/pkg2_a.tcl | 22 - tests/pkg/pkg2_b.tcl | 22 - tests/pkg/pkg3.tcl | 22 - tests/pkg/pkg4.tcl | 27 - tests/pkg/pkg5.tcl | 30 - tests/pkg/pkga.tcl | 15 - tests/pkg/simple.tcl | 23 - tests/pkg/std.tcl | 28 - tests/pkg1/direct1.tcl | 23 - tests/pkg1/pkgIndex.tcl | 11 - tests/pkgMkIndex.test | 375 - tests/platform.test | 39 - tests/proc-old.test | 523 -- tests/proc.test | 312 - tests/pwd.test | 41 - tests/reg.test | 905 --- tests/regexp.test | 378 - tests/registry.test | 601 -- tests/remote.tcl | 172 - tests/rename.test | 186 - tests/resource.test | 364 - tests/result.test | 102 - tests/safe.test | 527 -- tests/scan.test | 586 -- tests/security.test | 53 - tests/set-old.test | 811 --- tests/set.test | 499 -- tests/socket.test | 1669 ----- tests/source.test | 197 - tests/split.test | 84 - tests/stack.test | 41 - tests/string.test | 403 -- tests/stringObj.test | 209 - tests/subst.test | 125 - tests/switch.test | 198 - tests/thread.test | 240 - tests/timer.test | 554 -- tests/trace.test | 984 --- tests/unixFCmd.test | 300 - tests/unixFile.test | 77 - tests/unixInit.test | 205 - tests/unixNotfy.test | 99 - tests/unknown.test | 78 - tests/uplevel.test | 128 - tests/upvar.test | 416 -- tests/utf.test | 276 - tests/util.test | 306 - tests/var.test | 610 -- tests/while-old.test | 132 - tests/while.test | 633 -- tests/winConsole.test | 51 - tests/winDde.test | 152 - tests/winFCmd.test | 978 --- tests/winFile.test | 64 - tests/winNotify.test | 173 - tests/winPipe.test | 413 -- tests/winTime.test | 49 - tools/Makefile.in | 63 - tools/README | 4 - tools/checkLibraryDoc.tcl | 242 - tools/configure.in | 34 - tools/cvtEOL.tcl | 35 - tools/encoding/Makefile | 110 - tools/encoding/README | 5 - tools/encoding/ascii.txt | 95 - tools/encoding/big5.txt | 13906 ------------------------------------- tools/encoding/cjk.inf | 4467 ------------ tools/encoding/cp1250.txt | 1 - tools/encoding/cp1251.txt | 1 - tools/encoding/cp1252.txt | 1 - tools/encoding/cp1253.txt | 1 - tools/encoding/cp1254.txt | 1 - tools/encoding/cp1255.txt | 1 - tools/encoding/cp1256.txt | 1 - tools/encoding/cp1257.txt | 1 - tools/encoding/cp1258.txt | 1 - tools/encoding/cp437.txt | 1 - tools/encoding/cp737.txt | 1 - tools/encoding/cp775.txt | 1 - tools/encoding/cp850.txt | 1 - tools/encoding/cp852.txt | 1 - tools/encoding/cp855.txt | 1 - tools/encoding/cp857.txt | 1 - tools/encoding/cp860.txt | 1 - tools/encoding/cp861.txt | 1 - tools/encoding/cp862.txt | 1 - tools/encoding/cp863.txt | 1 - tools/encoding/cp864.txt | 1 - tools/encoding/cp865.txt | 1 - tools/encoding/cp866.txt | 1 - tools/encoding/cp869.txt | 1 - tools/encoding/cp874.txt | 1 - tools/encoding/cp932.txt | 1 - tools/encoding/cp936.txt | 1 - tools/encoding/cp949.txt | 1 - tools/encoding/cp950.txt | 13775 ------------------------------------ tools/encoding/dingbats.txt | 250 - tools/encoding/gb12345.txt | 7604 -------------------- tools/encoding/gb1988.txt | 158 - tools/encoding/gb2312.txt | 7515 -------------------- tools/encoding/iso2022-jp.esc | 10 - tools/encoding/iso2022-kr.esc | 5 - tools/encoding/iso2022.esc | 14 - tools/encoding/iso8859-1.txt | 230 - tools/encoding/iso8859-2.txt | 230 - tools/encoding/iso8859-3.txt | 223 - tools/encoding/iso8859-4.txt | 230 - tools/encoding/iso8859-5.txt | 230 - tools/encoding/iso8859-6.txt | 185 - tools/encoding/iso8859-7.txt | 224 - tools/encoding/iso8859-8.txt | 192 - tools/encoding/iso8859-9.txt | 232 - tools/encoding/jis0201.txt | 202 - tools/encoding/jis0208.txt | 6940 ------------------ tools/encoding/jis0212.txt | 6141 ---------------- tools/encoding/ksc5601.txt | 8262 ---------------------- tools/encoding/macCentEuro.txt | 293 - tools/encoding/macCroatian.txt | 287 - tools/encoding/macCyrillic.txt | 287 - tools/encoding/macDingbats.txt | 260 - tools/encoding/macGreek.txt | 290 - tools/encoding/macIceland.txt | 285 - tools/encoding/macJapan.txt | 7598 -------------------- tools/encoding/macRoman.txt | 301 - tools/encoding/macRomania.txt | 285 - tools/encoding/macThai.txt | 299 - tools/encoding/macTurkish.txt | 289 - tools/encoding/macUkraine.txt | 279 - tools/encoding/shiftjis.txt | 7096 ------------------- tools/encoding/symbol.txt | 265 - tools/encoding/txt2enc.c | 244 - tools/genStubs.tcl | 877 --- tools/genWinImage.tcl | 120 - tools/index.tcl | 202 - tools/man2help.tcl | 132 - tools/man2help2.tcl | 962 --- tools/man2html.tcl | 181 - tools/man2html1.tcl | 269 - tools/man2html2.tcl | 871 --- tools/man2tcl.c | 402 -- tools/regexpTestLib.tcl | 266 - tools/str2c | 61 - tools/tcl.hpj.in | 19 - tools/tcl.wse.in | 2330 ------- tools/tcl8.1-tk8.1-man-html.tcl | 1662 ----- tools/tclSplash.bmp | Bin 162030 -> 0 bytes tools/tclmin.wse | 247 - tools/uniParse.tcl | 369 - tools/white.bmp | Bin 20522 -> 0 bytes unix/Makefile.in | 1249 ---- unix/README | 109 - unix/configure.in | 1478 ---- unix/dltest/Makefile.in | 47 - unix/dltest/README | 12 - unix/dltest/configure.in | 33 - unix/dltest/pkga.c | 133 - unix/dltest/pkgb.c | 159 - unix/dltest/pkgc.c | 159 - unix/dltest/pkgd.c | 160 - unix/dltest/pkge.c | 54 - unix/dltest/pkgf.c | 53 - unix/install-sh | 119 - unix/ldAix | 74 - unix/mkLinks | 1254 ---- unix/mkLinks.tcl | 71 - unix/porting.notes | 11 - unix/porting.old | 384 - unix/tclAppInit.c | 168 - unix/tclConfig.sh.in | 162 - unix/tclLoadAix.c | 549 -- unix/tclLoadAout.c | 507 -- unix/tclLoadDl.c | 183 - unix/tclLoadDld.c | 162 - unix/tclLoadNext.c | 142 - unix/tclLoadOSF.c | 160 - unix/tclLoadShl.c | 174 - unix/tclMtherr.c | 77 - unix/tclUnixChan.c | 2695 ------- unix/tclUnixEvent.c | 76 - unix/tclUnixFCmd.c | 1391 ---- unix/tclUnixFile.c | 598 -- unix/tclUnixInit.c | 673 -- unix/tclUnixNotfy.c | 993 --- unix/tclUnixPipe.c | 1158 --- unix/tclUnixPort.h | 502 -- unix/tclUnixSock.c | 135 - unix/tclUnixTest.c | 705 -- unix/tclUnixThrd.c | 682 -- unix/tclUnixThrd.h | 21 - unix/tclUnixTime.c | 299 - unix/tclXtNotify.c | 656 -- unix/tclXtTest.c | 113 - win/README | 188 - win/README.binary | 387 -- win/cat.c | 37 - win/makefile.vc | 577 -- win/mkd.bat | 21 - win/pkgIndex.tcl | 12 - win/rmd.bat | 25 - win/stub16.c | 198 - win/tcl.rc | 44 - win/tcl16.rc | 37 - win/tclAppInit.c | 259 - win/tclWin16.c | 347 - win/tclWin32Dll.c | 592 -- win/tclWinChan.c | 1077 --- win/tclWinConsole.c | 1272 ---- win/tclWinDde.c | 1287 ---- win/tclWinError.c | 392 -- win/tclWinFCmd.c | 1685 ----- win/tclWinFile.c | 956 --- win/tclWinInit.c | 789 --- win/tclWinInt.h | 112 - win/tclWinLoad.c | 151 - win/tclWinMtherr.c | 52 - win/tclWinNotify.c | 494 -- win/tclWinPipe.c | 3196 --------- win/tclWinPort.h | 441 -- win/tclWinReg.c | 1403 ---- win/tclWinSerial.c | 1401 ---- win/tclWinSock.c | 2279 ------ win/tclWinTest.c | 129 - win/tclWinThrd.c | 900 --- win/tclWinThrd.h | 21 - win/tclWinTime.c | 439 -- win/tclsh.rc | 38 - win/winDumpExts.c | 505 -- 743 files changed, 393637 deletions(-) delete mode 100644 ChangeLog delete mode 100644 README delete mode 100644 changes delete mode 100644 compat/README delete mode 100644 compat/dirent.h delete mode 100644 compat/dirent2.h delete mode 100644 compat/dlfcn.h delete mode 100644 compat/fixstrtod.c delete mode 100644 compat/float.h delete mode 100644 compat/gettod.c delete mode 100644 compat/limits.h delete mode 100644 compat/memcmp.c delete mode 100644 compat/opendir.c delete mode 100644 compat/stdlib.h delete mode 100644 compat/strftime.c delete mode 100644 compat/string.h delete mode 100644 compat/strncasecmp.c delete mode 100644 compat/strstr.c delete mode 100644 compat/strtod.c delete mode 100644 compat/strtol.c delete mode 100644 compat/strtoul.c delete mode 100644 compat/tclErrno.h delete mode 100644 compat/tmpnam.c delete mode 100644 compat/unistd.h delete mode 100644 compat/waitpid.c delete mode 100644 doc/AddErrInfo.3 delete mode 100644 doc/Alloc.3 delete mode 100644 doc/AllowExc.3 delete mode 100644 doc/AppInit.3 delete mode 100644 doc/AssocData.3 delete mode 100644 doc/Async.3 delete mode 100644 doc/BackgdErr.3 delete mode 100644 doc/Backslash.3 delete mode 100644 doc/BoolObj.3 delete mode 100644 doc/ByteArrObj.3 delete mode 100644 doc/CallDel.3 delete mode 100644 doc/CmdCmplt.3 delete mode 100644 doc/Concat.3 delete mode 100644 doc/CrtChannel.3 delete mode 100644 doc/CrtChnlHdlr.3 delete mode 100644 doc/CrtCloseHdlr.3 delete mode 100644 doc/CrtCommand.3 delete mode 100644 doc/CrtFileHdlr.3 delete mode 100644 doc/CrtInterp.3 delete mode 100644 doc/CrtMathFnc.3 delete mode 100644 doc/CrtObjCmd.3 delete mode 100644 doc/CrtSlave.3 delete mode 100644 doc/CrtTimerHdlr.3 delete mode 100644 doc/CrtTrace.3 delete mode 100644 doc/DString.3 delete mode 100644 doc/DetachPids.3 delete mode 100644 doc/DoOneEvent.3 delete mode 100644 doc/DoWhenIdle.3 delete mode 100644 doc/DoubleObj.3 delete mode 100644 doc/Encoding.3 delete mode 100644 doc/Eval.3 delete mode 100644 doc/Exit.3 delete mode 100644 doc/ExprLong.3 delete mode 100644 doc/ExprLongObj.3 delete mode 100644 doc/FindExec.3 delete mode 100755 doc/GetCwd.3 delete mode 100644 doc/GetIndex.3 delete mode 100644 doc/GetInt.3 delete mode 100644 doc/GetOpnFl.3 delete mode 100644 doc/GetStdChan.3 delete mode 100755 doc/GetVersion.3 delete mode 100644 doc/Hash.3 delete mode 100644 doc/IntObj.3 delete mode 100644 doc/Interp.3 delete mode 100644 doc/LinkVar.3 delete mode 100644 doc/ListObj.3 delete mode 100644 doc/Notifier.3 delete mode 100644 doc/Object.3 delete mode 100644 doc/ObjectType.3 delete mode 100644 doc/OpenFileChnl.3 delete mode 100644 doc/OpenTcp.3 delete mode 100644 doc/ParseCmd.3 delete mode 100644 doc/PkgRequire.3 delete mode 100644 doc/Preserve.3 delete mode 100644 doc/PrintDbl.3 delete mode 100644 doc/RecEvalObj.3 delete mode 100644 doc/RecordEval.3 delete mode 100644 doc/RegExp.3 delete mode 100644 doc/SaveResult.3 delete mode 100644 doc/SetErrno.3 delete mode 100644 doc/SetRecLmt.3 delete mode 100644 doc/SetResult.3 delete mode 100644 doc/SetVar.3 delete mode 100644 doc/Sleep.3 delete mode 100644 doc/SplitList.3 delete mode 100644 doc/SplitPath.3 delete mode 100644 doc/StaticPkg.3 delete mode 100644 doc/StrMatch.3 delete mode 100644 doc/StringObj.3 delete mode 100644 doc/Tcl.n delete mode 100644 doc/Tcl_Main.3 delete mode 100644 doc/Thread.3 delete mode 100644 doc/ToUpper.3 delete mode 100644 doc/TraceVar.3 delete mode 100644 doc/Translate.3 delete mode 100644 doc/UpVar.3 delete mode 100644 doc/Utf.3 delete mode 100644 doc/WrongNumArgs.3 delete mode 100644 doc/after.n delete mode 100644 doc/append.n delete mode 100644 doc/array.n delete mode 100644 doc/bgerror.n delete mode 100644 doc/binary.n delete mode 100644 doc/break.n delete mode 100644 doc/case.n delete mode 100644 doc/catch.n delete mode 100644 doc/cd.n delete mode 100644 doc/clock.n delete mode 100644 doc/close.n delete mode 100644 doc/concat.n delete mode 100644 doc/continue.n delete mode 100644 doc/dde.n delete mode 100644 doc/encoding.n delete mode 100644 doc/eof.n delete mode 100644 doc/error.n delete mode 100644 doc/eval.n delete mode 100644 doc/exec.n delete mode 100644 doc/exit.n delete mode 100644 doc/expr.n delete mode 100644 doc/fblocked.n delete mode 100644 doc/fconfigure.n delete mode 100644 doc/fcopy.n delete mode 100644 doc/file.n delete mode 100644 doc/fileevent.n delete mode 100644 doc/filename.n delete mode 100644 doc/flush.n delete mode 100644 doc/for.n delete mode 100644 doc/foreach.n delete mode 100644 doc/format.n delete mode 100644 doc/gets.n delete mode 100644 doc/glob.n delete mode 100644 doc/global.n delete mode 100644 doc/history.n delete mode 100644 doc/http.n delete mode 100644 doc/if.n delete mode 100644 doc/incr.n delete mode 100644 doc/info.n delete mode 100644 doc/interp.n delete mode 100644 doc/join.n delete mode 100644 doc/lappend.n delete mode 100644 doc/library.n delete mode 100644 doc/lindex.n delete mode 100644 doc/linsert.n delete mode 100644 doc/list.n delete mode 100644 doc/llength.n delete mode 100644 doc/load.n delete mode 100644 doc/lrange.n delete mode 100644 doc/lreplace.n delete mode 100644 doc/lsearch.n delete mode 100644 doc/lsort.n delete mode 100644 doc/man.macros delete mode 100644 doc/msgcat.n delete mode 100644 doc/namespace.n delete mode 100644 doc/open.n delete mode 100644 doc/package.n delete mode 100644 doc/pid.n delete mode 100644 doc/pkgMkIndex.n delete mode 100644 doc/proc.n delete mode 100644 doc/puts.n delete mode 100644 doc/pwd.n delete mode 100644 doc/read.n delete mode 100644 doc/regexp.n delete mode 100644 doc/registry.n delete mode 100644 doc/regsub.n delete mode 100644 doc/rename.n delete mode 100644 doc/resource.n delete mode 100644 doc/return.n delete mode 100644 doc/safe.n delete mode 100644 doc/scan.n delete mode 100644 doc/seek.n delete mode 100644 doc/set.n delete mode 100644 doc/socket.n delete mode 100644 doc/source.n delete mode 100644 doc/split.n delete mode 100644 doc/string.n delete mode 100644 doc/subst.n delete mode 100644 doc/switch.n delete mode 100644 doc/tclsh.1 delete mode 100644 doc/tclvars.n delete mode 100644 doc/tell.n delete mode 100644 doc/time.n delete mode 100644 doc/trace.n delete mode 100644 doc/unknown.n delete mode 100644 doc/unset.n delete mode 100644 doc/update.n delete mode 100644 doc/uplevel.n delete mode 100644 doc/upvar.n delete mode 100644 doc/variable.n delete mode 100644 doc/vwait.n delete mode 100644 doc/while.n delete mode 100644 generic/README delete mode 100644 generic/regc_color.c delete mode 100644 generic/regc_cvec.c delete mode 100644 generic/regc_lex.c delete mode 100644 generic/regc_locale.c delete mode 100644 generic/regc_nfa.c delete mode 100644 generic/regcomp.c delete mode 100644 generic/regcustom.h delete mode 100644 generic/rege_dfa.c delete mode 100644 generic/regerror.c delete mode 100644 generic/regerrs.h delete mode 100644 generic/regex.h delete mode 100644 generic/regexec.c delete mode 100644 generic/regfree.c delete mode 100644 generic/regfronts.c delete mode 100644 generic/regguts.h delete mode 100644 generic/tcl.decls delete mode 100644 generic/tcl.h delete mode 100644 generic/tclAlloc.c delete mode 100644 generic/tclAsync.c delete mode 100644 generic/tclBasic.c delete mode 100644 generic/tclBinary.c delete mode 100644 generic/tclCkalloc.c delete mode 100644 generic/tclClock.c delete mode 100644 generic/tclCmdAH.c delete mode 100644 generic/tclCmdIL.c delete mode 100644 generic/tclCmdMZ.c delete mode 100644 generic/tclCompCmds.c delete mode 100644 generic/tclCompExpr.c delete mode 100644 generic/tclCompile.c delete mode 100644 generic/tclCompile.h delete mode 100644 generic/tclDate.c delete mode 100644 generic/tclDecls.h delete mode 100644 generic/tclEncoding.c delete mode 100644 generic/tclEnv.c delete mode 100644 generic/tclEvent.c delete mode 100644 generic/tclExecute.c delete mode 100644 generic/tclFCmd.c delete mode 100644 generic/tclFileName.c delete mode 100644 generic/tclGet.c delete mode 100644 generic/tclGetDate.y delete mode 100644 generic/tclHash.c delete mode 100644 generic/tclHistory.c delete mode 100644 generic/tclIO.c delete mode 100644 generic/tclIOCmd.c delete mode 100644 generic/tclIOSock.c delete mode 100644 generic/tclIOUtil.c delete mode 100644 generic/tclIndexObj.c delete mode 100644 generic/tclInitScript.h delete mode 100644 generic/tclInt.decls delete mode 100644 generic/tclInt.h delete mode 100644 generic/tclIntDecls.h delete mode 100644 generic/tclIntPlatDecls.h delete mode 100644 generic/tclInterp.c delete mode 100644 generic/tclLink.c delete mode 100644 generic/tclListObj.c delete mode 100644 generic/tclLiteral.c delete mode 100644 generic/tclLoad.c delete mode 100644 generic/tclLoadNone.c delete mode 100644 generic/tclMain.c delete mode 100644 generic/tclMath.h delete mode 100644 generic/tclNamesp.c delete mode 100644 generic/tclNotify.c delete mode 100644 generic/tclObj.c delete mode 100644 generic/tclPanic.c delete mode 100644 generic/tclParse.c delete mode 100644 generic/tclParseExpr.c delete mode 100644 generic/tclPipe.c delete mode 100644 generic/tclPkg.c delete mode 100644 generic/tclPlatDecls.h delete mode 100644 generic/tclPort.h delete mode 100644 generic/tclPosixStr.c delete mode 100644 generic/tclPreserve.c delete mode 100644 generic/tclProc.c delete mode 100644 generic/tclRegexp.c delete mode 100644 generic/tclRegexp.h delete mode 100644 generic/tclResolve.c delete mode 100644 generic/tclResult.c delete mode 100644 generic/tclScan.c delete mode 100644 generic/tclStringObj.c delete mode 100644 generic/tclStubInit.c delete mode 100644 generic/tclStubLib.c delete mode 100644 generic/tclStubs.c delete mode 100644 generic/tclTest.c delete mode 100644 generic/tclTestObj.c delete mode 100644 generic/tclTestProcBodyObj.c delete mode 100644 generic/tclThread.c delete mode 100644 generic/tclThreadTest.c delete mode 100644 generic/tclTimer.c delete mode 100644 generic/tclUniData.c delete mode 100644 generic/tclUtf.c delete mode 100644 generic/tclUtil.c delete mode 100644 generic/tclVar.c delete mode 100644 library/auto.tcl delete mode 100644 library/encoding/ascii.enc delete mode 100644 library/encoding/big5.enc delete mode 100644 library/encoding/cp1250.enc delete mode 100644 library/encoding/cp1251.enc delete mode 100644 library/encoding/cp1252.enc delete mode 100644 library/encoding/cp1253.enc delete mode 100644 library/encoding/cp1254.enc delete mode 100644 library/encoding/cp1255.enc delete mode 100644 library/encoding/cp1256.enc delete mode 100644 library/encoding/cp1257.enc delete mode 100644 library/encoding/cp1258.enc delete mode 100644 library/encoding/cp437.enc delete mode 100644 library/encoding/cp737.enc delete mode 100644 library/encoding/cp775.enc delete mode 100644 library/encoding/cp850.enc delete mode 100644 library/encoding/cp852.enc delete mode 100644 library/encoding/cp855.enc delete mode 100644 library/encoding/cp857.enc delete mode 100644 library/encoding/cp860.enc delete mode 100644 library/encoding/cp861.enc delete mode 100644 library/encoding/cp862.enc delete mode 100644 library/encoding/cp863.enc delete mode 100644 library/encoding/cp864.enc delete mode 100644 library/encoding/cp865.enc delete mode 100644 library/encoding/cp866.enc delete mode 100644 library/encoding/cp869.enc delete mode 100644 library/encoding/cp874.enc delete mode 100644 library/encoding/cp932.enc delete mode 100644 library/encoding/cp936.enc delete mode 100644 library/encoding/cp949.enc delete mode 100644 library/encoding/cp950.enc delete mode 100644 library/encoding/dingbats.enc delete mode 100644 library/encoding/euc-cn.enc delete mode 100644 library/encoding/euc-jp.enc delete mode 100644 library/encoding/euc-kr.enc delete mode 100644 library/encoding/gb12345.enc delete mode 100644 library/encoding/gb1988.enc delete mode 100644 library/encoding/gb2312.enc delete mode 100644 library/encoding/iso2022-jp.enc delete mode 100644 library/encoding/iso2022-kr.enc delete mode 100644 library/encoding/iso2022.enc delete mode 100644 library/encoding/iso8859-1.enc delete mode 100644 library/encoding/iso8859-2.enc delete mode 100644 library/encoding/iso8859-3.enc delete mode 100644 library/encoding/iso8859-4.enc delete mode 100644 library/encoding/iso8859-5.enc delete mode 100644 library/encoding/iso8859-6.enc delete mode 100644 library/encoding/iso8859-7.enc delete mode 100644 library/encoding/iso8859-8.enc delete mode 100644 library/encoding/iso8859-9.enc delete mode 100644 library/encoding/jis0201.enc delete mode 100644 library/encoding/jis0208.enc delete mode 100644 library/encoding/jis0212.enc delete mode 100644 library/encoding/ksc5601.enc delete mode 100644 library/encoding/macCentEuro.enc delete mode 100644 library/encoding/macCroatian.enc delete mode 100644 library/encoding/macCyrillic.enc delete mode 100644 library/encoding/macDingbats.enc delete mode 100644 library/encoding/macGreek.enc delete mode 100644 library/encoding/macIceland.enc delete mode 100644 library/encoding/macJapan.enc delete mode 100644 library/encoding/macRoman.enc delete mode 100644 library/encoding/macRomania.enc delete mode 100644 library/encoding/macThai.enc delete mode 100644 library/encoding/macTurkish.enc delete mode 100644 library/encoding/macUkraine.enc delete mode 100644 library/encoding/shiftjis.enc delete mode 100644 library/encoding/symbol.enc delete mode 100644 library/history.tcl delete mode 100644 library/http/http.tcl delete mode 100644 library/http/pkgIndex.tcl delete mode 100644 library/http1.0/http.tcl delete mode 100644 library/http1.0/pkgIndex.tcl delete mode 100644 library/http2.0/http.tcl delete mode 100644 library/http2.0/pkgIndex.tcl delete mode 100644 library/http2.1/http.tcl delete mode 100644 library/http2.1/pkgIndex.tcl delete mode 100644 library/http2.3/http.tcl delete mode 100644 library/http2.3/pkgIndex.tcl delete mode 100644 library/init.tcl delete mode 100644 library/ldAout.tcl delete mode 100644 library/msgcat/msgcat.tcl delete mode 100644 library/msgcat/pkgIndex.tcl delete mode 100644 library/msgcat1.0/msgcat.tcl delete mode 100644 library/msgcat1.0/pkgIndex.tcl delete mode 100644 library/opt/optparse.tcl delete mode 100644 library/opt/pkgIndex.tcl delete mode 100644 library/opt0.4/optparse.tcl delete mode 100644 library/opt0.4/pkgIndex.tcl delete mode 100644 library/package.tcl delete mode 100644 library/parray.tcl delete mode 100644 library/safe.tcl delete mode 100644 library/tclIndex delete mode 100644 library/word.tcl delete mode 100644 license.terms delete mode 100644 mac/AppleScript.html delete mode 100644 mac/Background.doc delete mode 100644 mac/MW_TclAppleScriptHeader.pch delete mode 100644 mac/MW_TclHeader.pch delete mode 100644 mac/README delete mode 100644 mac/bugs.doc delete mode 100644 mac/libmoto.doc delete mode 100644 mac/morefiles.doc delete mode 100644 mac/porting.notes delete mode 100644 mac/tclMac.h delete mode 100644 mac/tclMacAETE.r delete mode 100644 mac/tclMacAlloc.c delete mode 100644 mac/tclMacAppInit.c delete mode 100644 mac/tclMacApplication.r delete mode 100644 mac/tclMacBOAAppInit.c delete mode 100644 mac/tclMacBOAMain.c delete mode 100644 mac/tclMacChan.c delete mode 100755 mac/tclMacCommonPch.h delete mode 100644 mac/tclMacDNR.c delete mode 100644 mac/tclMacEnv.c delete mode 100644 mac/tclMacExit.c delete mode 100644 mac/tclMacFCmd.c delete mode 100644 mac/tclMacFile.c delete mode 100644 mac/tclMacInit.c delete mode 100644 mac/tclMacInt.h delete mode 100644 mac/tclMacInterupt.c delete mode 100644 mac/tclMacLibrary.c delete mode 100644 mac/tclMacLibrary.r delete mode 100644 mac/tclMacLoad.c delete mode 100644 mac/tclMacMSLPrefix.h delete mode 100644 mac/tclMacMath.h delete mode 100644 mac/tclMacNotify.c delete mode 100644 mac/tclMacOSA.c delete mode 100644 mac/tclMacOSA.exp delete mode 100644 mac/tclMacOSA.r delete mode 100644 mac/tclMacPanic.c delete mode 100644 mac/tclMacPort.h delete mode 100644 mac/tclMacProjects.sea.hqx delete mode 100644 mac/tclMacResource.c delete mode 100644 mac/tclMacResource.r delete mode 100644 mac/tclMacShLib.exp delete mode 100644 mac/tclMacSock.c delete mode 100644 mac/tclMacTclCode.r delete mode 100644 mac/tclMacTest.c delete mode 100644 mac/tclMacThrd.c delete mode 100644 mac/tclMacThrd.h delete mode 100644 mac/tclMacTime.c delete mode 100644 mac/tclMacUnix.c delete mode 100644 mac/tclMacUtil.c delete mode 100644 tests/README delete mode 100644 tests/all.tcl delete mode 100644 tests/append.test delete mode 100644 tests/assocd.test delete mode 100644 tests/async.test delete mode 100644 tests/autoMkindex.tcl delete mode 100644 tests/autoMkindex.test delete mode 100644 tests/basic.test delete mode 100644 tests/binary.test delete mode 100644 tests/case.test delete mode 100644 tests/clock.test delete mode 100644 tests/cmdAH.test delete mode 100644 tests/cmdIL.test delete mode 100644 tests/cmdInfo.test delete mode 100644 tests/cmdMZ.test delete mode 100644 tests/compExpr-old.test delete mode 100644 tests/compExpr.test delete mode 100644 tests/compile.test delete mode 100644 tests/concat.test delete mode 100644 tests/dcall.test delete mode 100644 tests/defs.tcl delete mode 100644 tests/dstring.test delete mode 100644 tests/encoding.test delete mode 100644 tests/env.test delete mode 100644 tests/error.test delete mode 100644 tests/eval.test delete mode 100644 tests/event.test delete mode 100644 tests/exec.test delete mode 100644 tests/execute.test delete mode 100644 tests/expr-old.test delete mode 100644 tests/expr.test delete mode 100644 tests/fCmd.test delete mode 100644 tests/fileName.test delete mode 100644 tests/for-old.test delete mode 100644 tests/for.test delete mode 100644 tests/foreach.test delete mode 100644 tests/format.test delete mode 100644 tests/get.test delete mode 100644 tests/history.test delete mode 100644 tests/http.test delete mode 100644 tests/httpd delete mode 100644 tests/httpold.test delete mode 100644 tests/if-old.test delete mode 100644 tests/if.test delete mode 100644 tests/incr-old.test delete mode 100644 tests/incr.test delete mode 100644 tests/indexObj.test delete mode 100644 tests/info.test delete mode 100644 tests/init.test delete mode 100644 tests/interp.test delete mode 100644 tests/io.test delete mode 100644 tests/ioCmd.test delete mode 100644 tests/ioUtil.test delete mode 100644 tests/join.test delete mode 100644 tests/lindex.test delete mode 100644 tests/link.test delete mode 100644 tests/linsert.test delete mode 100644 tests/list.test delete mode 100644 tests/listObj.test delete mode 100644 tests/llength.test delete mode 100644 tests/load.test delete mode 100644 tests/lrange.test delete mode 100644 tests/lreplace.test delete mode 100644 tests/lsearch.test delete mode 100644 tests/macFCmd.test delete mode 100644 tests/misc.test delete mode 100644 tests/msgcat.test delete mode 100644 tests/namespace-old.test delete mode 100644 tests/namespace.test delete mode 100644 tests/obj.test delete mode 100644 tests/opt.test delete mode 100644 tests/osa.test delete mode 100644 tests/parse.test delete mode 100644 tests/parseExpr.test delete mode 100644 tests/parseOld.test delete mode 100644 tests/pid.test delete mode 100644 tests/pkg.test delete mode 100644 tests/pkg/circ1.tcl delete mode 100644 tests/pkg/circ2.tcl delete mode 100644 tests/pkg/circ3.tcl delete mode 100644 tests/pkg/global.tcl delete mode 100644 tests/pkg/import.tcl delete mode 100644 tests/pkg/pkg1.tcl delete mode 100644 tests/pkg/pkg2_a.tcl delete mode 100644 tests/pkg/pkg2_b.tcl delete mode 100644 tests/pkg/pkg3.tcl delete mode 100644 tests/pkg/pkg4.tcl delete mode 100644 tests/pkg/pkg5.tcl delete mode 100644 tests/pkg/pkga.tcl delete mode 100644 tests/pkg/simple.tcl delete mode 100644 tests/pkg/std.tcl delete mode 100644 tests/pkg1/direct1.tcl delete mode 100644 tests/pkg1/pkgIndex.tcl delete mode 100644 tests/pkgMkIndex.test delete mode 100644 tests/platform.test delete mode 100644 tests/proc-old.test delete mode 100644 tests/proc.test delete mode 100644 tests/pwd.test delete mode 100644 tests/reg.test delete mode 100644 tests/regexp.test delete mode 100644 tests/registry.test delete mode 100644 tests/remote.tcl delete mode 100644 tests/rename.test delete mode 100644 tests/resource.test delete mode 100644 tests/result.test delete mode 100644 tests/safe.test delete mode 100644 tests/scan.test delete mode 100644 tests/security.test delete mode 100644 tests/set-old.test delete mode 100644 tests/set.test delete mode 100644 tests/socket.test delete mode 100644 tests/source.test delete mode 100644 tests/split.test delete mode 100644 tests/stack.test delete mode 100644 tests/string.test delete mode 100644 tests/stringObj.test delete mode 100644 tests/subst.test delete mode 100644 tests/switch.test delete mode 100644 tests/thread.test delete mode 100644 tests/timer.test delete mode 100644 tests/trace.test delete mode 100644 tests/unixFCmd.test delete mode 100644 tests/unixFile.test delete mode 100644 tests/unixInit.test delete mode 100644 tests/unixNotfy.test delete mode 100644 tests/unknown.test delete mode 100644 tests/uplevel.test delete mode 100644 tests/upvar.test delete mode 100644 tests/utf.test delete mode 100644 tests/util.test delete mode 100644 tests/var.test delete mode 100644 tests/while-old.test delete mode 100644 tests/while.test delete mode 100644 tests/winConsole.test delete mode 100644 tests/winDde.test delete mode 100644 tests/winFCmd.test delete mode 100644 tests/winFile.test delete mode 100644 tests/winNotify.test delete mode 100644 tests/winPipe.test delete mode 100644 tests/winTime.test delete mode 100644 tools/Makefile.in delete mode 100644 tools/README delete mode 100755 tools/checkLibraryDoc.tcl delete mode 100644 tools/configure.in delete mode 100644 tools/cvtEOL.tcl delete mode 100644 tools/encoding/Makefile delete mode 100644 tools/encoding/README delete mode 100644 tools/encoding/ascii.txt delete mode 100644 tools/encoding/big5.txt delete mode 100644 tools/encoding/cjk.inf delete mode 100644 tools/encoding/cp950.txt delete mode 100644 tools/encoding/dingbats.txt delete mode 100644 tools/encoding/gb12345.txt delete mode 100644 tools/encoding/gb1988.txt delete mode 100644 tools/encoding/gb2312.txt delete mode 100644 tools/encoding/iso2022-jp.esc delete mode 100644 tools/encoding/iso2022-kr.esc delete mode 100644 tools/encoding/iso2022.esc delete mode 100644 tools/encoding/iso8859-1.txt delete mode 100644 tools/encoding/iso8859-2.txt delete mode 100644 tools/encoding/iso8859-3.txt delete mode 100644 tools/encoding/iso8859-4.txt delete mode 100644 tools/encoding/iso8859-5.txt delete mode 100644 tools/encoding/iso8859-6.txt delete mode 100644 tools/encoding/iso8859-7.txt delete mode 100644 tools/encoding/iso8859-8.txt delete mode 100644 tools/encoding/iso8859-9.txt delete mode 100644 tools/encoding/jis0201.txt delete mode 100644 tools/encoding/jis0208.txt delete mode 100644 tools/encoding/jis0212.txt delete mode 100644 tools/encoding/ksc5601.txt delete mode 100644 tools/encoding/macCentEuro.txt delete mode 100644 tools/encoding/macCroatian.txt delete mode 100644 tools/encoding/macCyrillic.txt delete mode 100644 tools/encoding/macDingbats.txt delete mode 100644 tools/encoding/macGreek.txt delete mode 100644 tools/encoding/macIceland.txt delete mode 100644 tools/encoding/macJapan.txt delete mode 100644 tools/encoding/macRoman.txt delete mode 100644 tools/encoding/macRomania.txt delete mode 100644 tools/encoding/macThai.txt delete mode 100644 tools/encoding/macTurkish.txt delete mode 100644 tools/encoding/macUkraine.txt delete mode 100644 tools/encoding/shiftjis.txt delete mode 100644 tools/encoding/symbol.txt delete mode 100644 tools/encoding/txt2enc.c delete mode 100644 tools/genStubs.tcl delete mode 100644 tools/genWinImage.tcl delete mode 100644 tools/index.tcl delete mode 100644 tools/man2help.tcl delete mode 100644 tools/man2help2.tcl delete mode 100644 tools/man2html.tcl delete mode 100644 tools/man2html1.tcl delete mode 100644 tools/man2html2.tcl delete mode 100644 tools/man2tcl.c delete mode 100644 tools/regexpTestLib.tcl delete mode 100644 tools/str2c delete mode 100644 tools/tcl.hpj.in delete mode 100644 tools/tcl.wse.in delete mode 100644 tools/tcl8.1-tk8.1-man-html.tcl delete mode 100644 tools/tclSplash.bmp delete mode 100644 tools/tclmin.wse delete mode 100644 tools/uniParse.tcl delete mode 100644 tools/white.bmp delete mode 100644 unix/Makefile.in delete mode 100644 unix/README delete mode 100644 unix/configure.in delete mode 100644 unix/dltest/Makefile.in delete mode 100644 unix/dltest/README delete mode 100644 unix/dltest/configure.in delete mode 100644 unix/dltest/pkga.c delete mode 100644 unix/dltest/pkgb.c delete mode 100644 unix/dltest/pkgc.c delete mode 100644 unix/dltest/pkgd.c delete mode 100644 unix/dltest/pkge.c delete mode 100644 unix/dltest/pkgf.c delete mode 100755 unix/install-sh delete mode 100755 unix/ldAix delete mode 100644 unix/mkLinks delete mode 100644 unix/mkLinks.tcl delete mode 100644 unix/porting.notes delete mode 100644 unix/porting.old delete mode 100644 unix/tclAppInit.c delete mode 100644 unix/tclConfig.sh.in delete mode 100644 unix/tclLoadAix.c delete mode 100644 unix/tclLoadAout.c delete mode 100644 unix/tclLoadDl.c delete mode 100644 unix/tclLoadDld.c delete mode 100644 unix/tclLoadNext.c delete mode 100644 unix/tclLoadOSF.c delete mode 100644 unix/tclLoadShl.c delete mode 100644 unix/tclMtherr.c delete mode 100644 unix/tclUnixChan.c delete mode 100644 unix/tclUnixEvent.c delete mode 100644 unix/tclUnixFCmd.c delete mode 100644 unix/tclUnixFile.c delete mode 100644 unix/tclUnixInit.c delete mode 100644 unix/tclUnixNotfy.c delete mode 100644 unix/tclUnixPipe.c delete mode 100644 unix/tclUnixPort.h delete mode 100644 unix/tclUnixSock.c delete mode 100644 unix/tclUnixTest.c delete mode 100644 unix/tclUnixThrd.c delete mode 100644 unix/tclUnixThrd.h delete mode 100644 unix/tclUnixTime.c delete mode 100644 unix/tclXtNotify.c delete mode 100644 unix/tclXtTest.c delete mode 100644 win/README delete mode 100644 win/README.binary delete mode 100644 win/cat.c delete mode 100644 win/makefile.vc delete mode 100644 win/mkd.bat delete mode 100644 win/pkgIndex.tcl delete mode 100644 win/rmd.bat delete mode 100644 win/stub16.c delete mode 100644 win/tcl.rc delete mode 100644 win/tcl16.rc delete mode 100644 win/tclAppInit.c delete mode 100644 win/tclWin16.c delete mode 100644 win/tclWin32Dll.c delete mode 100644 win/tclWinChan.c delete mode 100644 win/tclWinConsole.c delete mode 100644 win/tclWinDde.c delete mode 100644 win/tclWinError.c delete mode 100644 win/tclWinFCmd.c delete mode 100644 win/tclWinFile.c delete mode 100644 win/tclWinInit.c delete mode 100644 win/tclWinInt.h delete mode 100644 win/tclWinLoad.c delete mode 100644 win/tclWinMtherr.c delete mode 100644 win/tclWinNotify.c delete mode 100644 win/tclWinPipe.c delete mode 100644 win/tclWinPort.h delete mode 100644 win/tclWinReg.c delete mode 100644 win/tclWinSerial.c delete mode 100644 win/tclWinSock.c delete mode 100644 win/tclWinTest.c delete mode 100644 win/tclWinThrd.c delete mode 100644 win/tclWinThrd.h delete mode 100644 win/tclWinTime.c delete mode 100644 win/tclsh.rc delete mode 100644 win/winDumpExts.c diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index b9d5dc4..0000000 --- a/ChangeLog +++ /dev/null @@ -1,991 +0,0 @@ -1999-04-15 - - * Merged 8.1 back into the main trunk - -1999-04-13 - - * library/encoding/gb2312.enc: - * library/encoding/euc-cn.enc: - * tools/encoding/gb2312.txt: - * tools/encoding/cp950.txt: - * tools/encoding/Makefile: Restored the double byte definition of - GB2312 and added the EUC-CN encoding. EUC-CN is a variant of - GB2312 that shifts the characters into bytes with the high bit set - and includes ASCII as a subset. [Bug: 632] - -1999-04-13 - - * win/tclWinSock.c: Apply patch to allow write access to a socket - if FD_WRITE is sent but FD_CONNECT is not. Some strange problem - with either Win32 or a socket driver. [Bug: 1664 1776] - -1999-04-09 - - * unix/tclUnixNotfy.c: Fixed notifier deadlock situation when the - pipe used to talk back notifier thread is filled with data. When - calling the write() function to feed data down that pipe, unlock - the notifierMutex to allow the notifier to wake up again. Found - as a result of the focus.test for Tk hanging. [Bug: 1700] - -1999-04-06 - - * tests/unixNotfy.test: Fixed hang in tests when built with thread - support. - - * tests/httpold.test: Fixed broken test that didn't wait long - enough for events to arrive. - - * tests/unixInit.test: Fixed race condition in test. - - * tests/unixInit.test: - * tests/fileName.test: Minor test nits. - - * unix/tclUnixInit.c (TclpSetInitialEncodings): Fixed bad initial - encoding string. - -1999-04-06 - - * generic/tclVar.c: - * generic/tclEnv.c: Moved the "array set" C level code into a - common routine (TclArraySet). The TclSetupEnv routine now uses - this API to create an env array w/ no elements. - - * generic/tclEnv.c: - * generic/tclWinInit.h: - * generic/tclUnixInit.h: - * generic/tclInt.h: Made the Env module I18N compliant. Changed the - FindVariable routine to TclpFindVariable, that now does a case - insensitive string comparison on Windows, and not on UNIX. [Bug: - 1299, 1500] - -1999-04-05 - - * tests/io.test: Minor test cleanup. - - * generic/tclEncoding.c (Tcl_CreateEncoding): Minor lint to make - it easier to compile on Digital-unix. [Bug: 1659] - - * unix/configure.in: - * unix/tclUnixPort.h: Applied patch for OS/390 to handle lack of - sys/param.h. [Bug: 1725] - - * unix/configure.in: Fixed BSD/OS 4.* configuration to support - shared libraries properly. [Bug: 1730] - -1999-04-05 - - * win/tclWinDde.c: decrease timeout value for DDE calls to 30k - [Bug: 1639] - - * generic/tcl.decls: - * generic/tcl.h: - * generic/tclDecls.h: - * generic/tclInt.decls: - * generic/tclInt.h: - * generic/tclIntDecls.h: - * generic/tclStubInit.c: - * generic/tclUtil.c: Added more functions to the Tcl stubs table, - including all Tcl_ functions not already in it (except Cmd - functions) and Tcl_GetCwd() and Tcl_Chdir() (new functions). - - * tests/safe.test: - * doc/safe.n: - * generic/tclBasic.c: - * library/safe.tcl: The encoding command is not safe as-is, so - create a safe alias to mask out the "encoding system " but - allow all other uses including "encoding system". Added test cases - and updated the man page for Safe Tcl. - -1999-04-05 - - * tests/winTime.test: - * win/tclWinTime.c: Fixed crash in clock command that occurred - when manipulating negative time values in timezones east of - GMT. [Bug: 1142, 1458] - - * tests/platform.test: - * tests/fileName.test: Fixed broken tests. - - * generic/tclFileName.c: Moved global regexps into thread local - storage. - - * tests/socket.test: Changed so tests don't reuse sockets, - since Windows is slow to release sockets. - - * win/tclWinConsole.c: - * win/tclWinPipe.c: - * win/tclWinSerial.c: Fixed race condition where background - threads were terminated while they still held a lock in the - notifier. - -1999-04-02 - - * tests/http.test: Fixed bad test initialization code. - - * generic/tclThreadTest.c (ThreadExitProc): Fixed bug where static - memory was being returned instead of a dynamically allocated - result in error cases. - -1999-04-02 - - * doc/dde.n: - * tools/tcl.wse.in: - * win/makefile.vc: - * win/pkgIndex.tcl: - * win/tclWinDde.c: Add new DDE package, code removed from Tk now - separated into its own package. Changed DDE-based send code into - "dde eval" command. Can be loaded into tclsh (not just wish). - Windows only. - -1999-04-02 - - * tests/expr.test: - * tests/for-old.test: - * tests/for.test: - * tests/foreach.test: - * tests/format.test: - * tests/httpold.test: - * tests/if.test: - * tests/init.test: - * tests/interp.test: - * tests/while.test: Added some tests for known bugs (marked with - knownBug constraint), and cleaned up a few bad tests. - - * generic/regc_locale.c: - * generic/regcustom.h: - * generic/tcl.decls: - * generic/tclCmdIL.c: - * generic/tclCmdMZ.c: - * generic/tclInt.h: - * generic/tclRegexp.c: - * generic/tclScan.c: - * generic/tclTest.c: - * generic/tclUtf.c: - * win/tclWinFCmd.c: - * win/tclWinFile.c: Made various Unicode utility functions - public. The following functions were made public and added to the - stubs table: - Tcl_UtfToUniCharDString, Tcl_UniCharToUtfDString, - Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharIsAlnum, - Tcl_UniCharIsAlpha, Tcl_UniCharIsDigit, Tcl_UniCharIsLower, - Tcl_UniCharIsSpace, Tcl_UniCharIsUpper, Tcl_UniCharIsWordChar - -1999-04-01 - - * tests/registry.test: - * win/tclWinReg.c: Internationalized the registry code. It now - uses Unicode interfaces on NT. [Bug: 1197] - - * tests/parse.test: - * generic/tclParse.c: Fixed crash due to multiple frees in parser - during error cleanup when parsing commands with more tokens than - will fit in the static area of the parse structure. [Bug: 1681] - - * generic/tclInt.h: Removed duplicate declarations. - - * generic/tclInt.decls: - * generic/tcl.decls: Added Tcl_WinUtfToTChar and Tcl_WinTCharToUtf - to the tclPlat table. - -1999-04-01 - - * generic/tcl.decls: - * generic/tcl.h: - * generic/tclBasic.c: - * generic/tclDecls.h: - * generic/StubInit.c: - * tools/genStubs.tcl: - * unix/Makefile.in: - * win/makefile.vc: Applied patch from Jan Nijtmans to fix Ultrix - multiple symbol definition problem. Now, even Tcl includes a copy - of the Tcl stub library. Also fixed TCL_MEM_DEBUG mode (for Tk). - -1999-03-31 - - * win/tclWinConsole.c: WinNT has a bug when reading a single - character from the console. Rewrote the code for the console to - read an entire line at a time using the reader thread. - -1999-03-30 - - * unix/Makefile.in: Removed trailing backslash that broke the - "depend" target. - - * unix/tclUnixInit.c (TclpSetInitialEncodings): Changed to avoid - calling setlocale(). We now look directly at env(LANG) and - env(LC_CTYPE) instead. [Bug: 1636] - - * generic/tclFileName.c: - * generic/tclDecls.h: - * generic/tcl.decls: Removed CONST from Tcl_JoinPath and - Tcl_TranslateFileName because it changes the signature of - Tcl_JoinPath in an incompatible manner. - - * generic/tclInt.h: - * generic/tclLoad.c (TclFinalizeLoad): - * generic/tclEvent.c (Tcl_Finalize): Defer unloading of loadable - modules until all exit handlers have been invoked. - [Bug: 998, 1273, 1573, 1593] - -1999-03-29 - - * generic/tclFileName.c: - * generic/tclDecls.h: - * generic/tcl.decls: Added CONST to Tcl_JoinPath and - Tcl_TranslateFileName. - -1999-03-29 - - * tools/genStubs.tcl: - * unix/configure.in: - * unix/Makefile.in: - * win/makefile.vc: - * generic/tcl.h: - * generic/tclBasic.c: - * generic/tclDecls.h: - * generic/tclIntDecls.h: - * generic/tclPlatDecls.h: - * generic/tclIntPlatDecls.h: Removed the stub functions and - changed the stub macros to just use the name without params. Pass - &tclStubs into the interp (don't use tclStubsPtr because of - collisions with the stubs on Solaris). - -1999-03-27 - - * win/makefile.bc: Removed makefile for Borland compiler, no - longer supported. - -1999-03-26 - - * win/tclWinSerial.c: - * win/tclWinConsole.c: - * win/tclWinPipe.c: Don't close the Win32 handle for a channel if - it's a stdio handle (GetStdHandle()) during shutdown of a thread - to prevent it from destroying the stdio of other threads. - -1999-03-26 - - * unix/configure.in - --nameble-shared is now the default and build Tcl as a shared - library; specify --disable-shared to build a static Tcl library - and shell. - -1999-03-25 - - * tests/interp.test: - * generic/tclInterp.c (AliasObjCmd): Changed so aliases are - invoked at current scope in the target interpreter instead of at - the global scope. This was an incompatibility introduced in 8.1 - that is being removed. [Bug: 1153, 1556] - - * library/encoding/big5.enc: - * library/encoding/gb2312.enc: - * tools/encoding/big5.enc: - * tools/encoding/gb2312.enc: Added ASCII to big5 and gb2312 - encodings. [Bug: 632] - - * generic/tclPkg.c (Tcl_PkgRequireEx): Fixed broken clientData - initialization in package code. - - * unix/Makefile.in (dist): Added tcl.decls and tclInt.decls to - source distribution. [Bug: 1571] - - * doc/Thread.3: Updated documentation of Tcl_MutexLock to indicate - that the recursive locking behavior is undefined. On Windows, it - does not block, on Unix it deadlocks. [Bug: 1275] - -1999-03-24 - - * tests/execute.test: - * generic/tclExecute.c (TclExecuteByteCode): Fixed expression code - that incorrectly returned floating point values for integers if - the internal rep happened to be a double. Now we check to see if - the object has a string rep that looks like an integer before - using the double internal rep. [Bug: 1516] - -1999-03-24 - - * generic/tclAlloc.c: - * generic/tclEncoding.c: - * generic/tclProc.c: - * unix/tclUnixTime.c: - * win/tclWinSerial.c: Fixed compilation warnings/errors for VC++ - 5.0 and 6.0 and HP-UX native compiler without -Aa or -Ae. - [Bug: 1323 1518 1324 1583 1585 1586] - - * win/tclWinSock.c: Make sockets thread-safe on Windows. The - current implementation uses windows to handle events on the - socket, one for each thread (thread local storage). Previously, - there was only one window shared between threads, which didn't - work. [Bug: 1326] - -1999-03-23 - - * tools/tcl.wse: Fixed file association to look in the right place - for the wish icon. [Bug: 1544] - - * tests/winNotify.test: - * tests/ioCmd.test: - * tests/event.test: Changed to use new style conditionals. - - * tests/encoding.test: Fixed nonportable test. - - * unix/dltest/configure.in: - * unix/dltest/Makefile.in: Added missing DBGX macros. [Bug: 1564] - - * tests/winNotify.test: - * mac/tclMacNotify.c: - * win/tclWinNotify.c: - * unix/tclUnixNotfy.c: - * generic/tclNotify.c: Added a new Tcl_ServiceModeHook interface - that is invoked whenever the service mode changes. This is needed - to allow the Windows notifier to create a communication window the - first time Tcl is about to enter an external modal event loop - instead of at startup time. This will avoid the various problems - that people have been seeing where the system hangs when tclsh - is running outside of the event loop. [Bug: 783] - - * generic/tclInt.h: - * generic/tcl.decls: Renamed TclpAlertNotifier back to - Tcl_AlertNotifier since it is part of the public notifier driver - API. - -1999-03-23 - - * win/tclWinSerial.c: Fixed problem with fileevent on the serial - port and nonblocking mode. Gets no longer hangs, fileevents fire - whenever there is any character data on the port. - - * tests/winConsole.test: - * win/tclWinConsole.c: Fixed problem with fileevents and gets from - a console stdin. Previously, fileevents were firing before an - entire line was available for reading, which meant that when you - did a gets or read, it blocked (even in nonblocking mode). Now, it - should work the same as Unix: fileevents fire when an entire line - is ready, and gets and read do not block in non-blocking mode. - Added an interactive test case to check for this. - -1999-03-22 - - * tests/reg.test: - * generic/regc_color.c: Applied regexp bug fix from Henry Spencer. - -1999-03-19 - - * generic/tclCmdIL.c: Fixed the initialization of an array so that - the Sun 5.0 C compiler wouldn't complain. - - * unix/configure.in: Added support for --enable-64bit. For now, - this is only supported on Solaris 7 64bit (SunOS 5.7) using the Sun - compiler (not gcc). - -1999-03-18 - - * win/tclWinChan.c (TclpOpenFileChannel, Tcl_MakeFileChannel): - Changed to only test for console or comm handles when the type is - FILE_TYPE_CHAR to avoid useless tests on simple files. Also - reordered tests so consoles are tested first as this is more - common. - - * win/makefile.vc: Regularized usage of mkd and rmd and rm. - - * library/encoding/shiftjis.enc: - * tools/encoding/shiftjis.txt: Missing/incorrect characters in - shift-jis table. [Bug: 1008, 1526] - - * generic/tclInt.decls: - * generic/tcl.decls: Eliminated use of "string" and "list" from - argument lists to avoid conflicts with C++ STL. [Bug: 1181] - - * win/tclWinFile.c (TclpMatchFiles): Changed to ignore the - FS_CASE_IS_PRESERVED bit and always return exactly what we get - from the system. - -1999-03-17 - - * win/README.binary: - * win/README: - * unix/configure.in: - * generic/tcl.h: - * README: Updated version to 8.1b3. - -1999-03-14 - - * win/tclWinConsole.c: - * win/tclWinPipe.c: - * win/tclWinSerial.c: Changed so channel drivers wait for the - reader/writer threads to exit before returning during a close - operation. This ensures that the main thread is the last thread - to exit, so the process return value is set properly. - - * generic/tclIntDecls.h: - * generic/tclIntPlatDecls.h: - * generic/tclIntPlatStubs.c: - * generic/tclIntStubs.c: - * generic/tclPlatDecls.h: - * generic/tclPlatStubs.c: - * generic/tclStubInit.c: - * generic/tclStubs.c: Fixed bad eol characters. - - * generic/tclInt.decls: Changed "const" to "CONST" in - declarations for better portability. - - * generic/tcl.decls: Renamed panic and panicVA to Tcl_Panic and - Tcl_PanicVA in the stub files. - - * generic/tclInterp.c (Tcl_MakeSafe): Remove tcl_platform(user) - from safe interps. - -1999-03-11 - - * unix/Makefile.in: - * unix/configure.in: Include compat files in the stub library in - addition to the main library. Compat files are now built for - dynamic use in all cases. - - * generic/tcl.h: Changed magic number so it doesn't match the plus - patch, at Jan's request. - - * unix/tclConfig.sh.in: - * unix/dltest/Makefile.in: - * unix/dltest/configure.in: - * unix/dltest/pkga.c: - * unix/dltest/pkgb.c: - * unix/dltest/pkgc.c: - * unix/dltest/pkgd.c: - * unix/dltest/pkge.c: - * unix/dltest/pkgf.c: Changed package tests to build against the - stubs library. - -1999-03-10 - - * generic/tcl.h: - * generic/tcl.decls: Changed Tcl_ReleaseType from an enum to - macros so it can be used in .rc files. - Added Tcl_GetString. - - * mac/tclMacNotify.c: - * generic/tclNotify.c: - * generic/tclInt.h: - * win/tclWinNotify.c: - * generic/tcl.h: Renamed Tcl_AlertNotifier to TclpAlertNotifier. - - * generic/tclInt.decls: Added TclWinAddProcess to make it possible - for expect to use Tcl_WaitForPid(). This patch is from Gordon - Chaffee. - - * mac/tclMacPort.h: - * win/tclWinInit.c: - * unix/tclUnixPort.h: - * generic/tclAsync.c: Added TclpAsyncMark to fix bug in async - handling on Windows where async events don't wake up the event - loop. This patch comes from Gordon Chaffee. - - * generic/tcl.decls: Fixed declarations of reserved slots. - -1999-03-10 - - * generic/tclCompile.h: Ensure that the ByteCode struct is binary - compatible with the version in 8.0.6. - - * generic/tcl.h: - * generic/tclBasic.c: Add Tcl_GetVersion() function to the public - C API to allow programs to check the version number of the Tcl - library at runtime. Also added an enum to clarify the release - level (alpha, beta, final). - -1999-03-09 - - * Integrated changes from Tcl 8.0 including: - stubs mechanism - configure patches from Jan Nijtmans - rename of panic to Tcl_Panic - -1999-03-08 - - * win/tclWin32Dll.c: Removed Dll instance from thread-local - storage. - -1999-03-08 - - * generic/tcl.h: Moved Tcl_Mutex, etc. macros above the inclusion - of tclDecls.h to avoid macro conflicts. - - * generic/tclInt.h: - * generic/regc_color.c: - * generic/regcomp.c: - * generic/tclCmdIL.c: - * generic/tclCmdAH.c: - * generic/tclIOCmd.c: - * generic/tclParse.c: - * generic/tclStringObj.c: - * unix/tclUnixNotfy.c: Cleaned up various compiler warnings, - eliminated UCHAR bugs. - - * unix/tclUnixNotfy.c: - * unix/tclUnixThrd.c: - * generic/tclThreadTest.c: - * mac/tclMacThrd.c: Changed TclpCondition*() to Tcl_Condition*(). - - * INTEGRATED PATCHES FROM 8.0.6: - - * generic/tcl.decls: - * generic/tcl.h: - * generic/tclBasic.c: - * generic/tclDecls.h: - * generic/tclInt.decls: - * generic/tclInt.h: - * generic/tclIntDecls.h: - * generic/tclIntPlatDecls.h: - * generic/tclIntPlatStubs.c: - * generic/tclIntStubs.c: - * generic/tclPlatDecls.h: - * generic/tclPlatStubs.c: - * generic/tclStubInit.c: - * generic/tclStubLib.c: - * generic/tclStubs.c: - * tools/genStubs.tcl: - * unix/configure.in: - * unix/Makefile.in: - * unix/tclConfig.sh.in: - * win/makefile.vc: - * win/tclWinPort.h: Added Tcl stubs implementation. There are - now two new macros USE_TCL_STUBS and USE_TCL_STUB_PROCS that - enable use of stubs and disable stub macros respectively. All of - the public and private function declarations from tcl.h and - tclInt.h have moved into the *.decls files and the *Stubs.c and - *Decls.h files are generated using the genStubs.tcl script. - - * unix/Makefile.in: - * unix/configure.in: - * unix/ldAix: Enhanced AIX shared library support. - - * win/tclWinSock.c: Removed a bunch of extraneous PASCAL FAR - attributes from internal functions. - - * win/tclWinReg.c: Changed registry package to use stubs mechanism - so it no longer depends on the specific version of Tcl. - - * doc/AddErrInfo.3: - * doc/Eval.3: - * doc/PkgRequire.3: - * doc/SetResult.3: - * doc/StringObj.3: - * generic/tcl.h: - * generic/tclBasic.c: - * generic/tclPanic.c: - * generic/tclStringObj.c: - * generic/tclUtil.c: - * unix/mkLinks: Added va_list versions of all VARARGS - functions so they can be invoked from the stub functions. - - * doc/package.n: - * doc/PkgRequire.3: - * generic/tclPkg.c: Added Tcl_PkgProvideEx, Tcl_RequireEx, - Tcl_PresentEx, and Tcl_PkgPresent. Added "package present" - command. - - * generic/tclFileName.c: - * mac/tclMacFile.c: - * mac/tclMacShLib.exp: - * unix/tclUnixFile.c: - * win/tclWinFile.c: Changed so TclGetUserHome is defined on - all platforms, even though it is currently a noop on mac and - windows, and renamed it to TclpGetUserHome. - - * generic/tclPanic.c: - * generic/panic.c: Renamed panic to Tcl_Panic. - -1999-02-25 - - * win/makefile.vc: Added tclWinConsole.c and tclWinSerial.c - - * win/tclWinConsole.c: New code to properly deal with fileevents - and nonblocking mode on consoles. - - * win/tclWinSerial.c: New code to properly deal with fileevents - and nonblocking mode on serial ports. - - * win/tclWinPipe.c: - * win/tclWinPort.h: Exported functions to allow creation of pipe - channels from tclWinChan.c - - * win/tclWinChan.c: Check the type of a channel, including for the - standard (stdin/stdout/stderr), and use the correct channel type - to create the channel (file, serial, console, or pipe). - -1999-02-11 - - * README: - * generic/tcl.h: - * win/README.binary: - * win/README: - * unix/configure.in: - * mac/README: Updated version numbers to 8.1b2. - -1999-02-10 - - * library/auto.tcl: Fixed auto_mkindex so it handles .tbc files. - Did some general cleanup to handle bad eval statements that didn't - use "list". - - * unix/mkLinks: - * doc/SetVar.3: - * generic/tcl.h: - * generic/tclVar.c: Restored Tcl_ObjGetVar2 and Tcl_ObjSetVar2 - from 8.0. Renamed Tcl_Get/SetObjVar2 to Tcl_GetVar2Ex and - Tcl_SetVar2Ex. - -1999-02-10 - - INTEGRATED PATCHES FROM 8.0.5b2: - - * test/winPipe.test: Changed to remove echoArgs.tcl temporary file - when done. - - * tests/cmdAH.test: - * generic/tclFileName.c (TclGetExtension): Changed behavior so the - split happens at the last period in the name instead of the first - period of the last run of periods. So, "foo..o" is split into - "foo." and ".o" now. [Bug: 1126] - - * win/makefile.vc: Added better support for paths with spaces in - the name. Added .lib and support .dlls to the install-binaries - target. Added generate of a pkgIndex.tcl script to the - install-libraries target. - - * win/tclAppInit.c: - * unix/tclAppInit.c: - * mac/tclMacAppInit.c: - * generic/tclTest.c: Changed some EXTERN declarations to extern - since they are not defining exported interfaces. This avoids - generating useless declspec() attributes and makes the windows - makefile simpler. - - * generic/tcl.h: Moved Tcl_AppInit declaration to end and cleared - out TCL_STORAGE_CLASS so it is not declared with a declspec(). - - * tests/interp.test: - * generic/tclInterp.c (DeleteAlias): Changed to use - Tcl_DeleteCommandFromToken so we handle renames properly. This - avoids senseless panic. [Bug: 736] - - * unix/tclUnixChan.c: - * win/tclWinSock.c: - * doc/socket.n: Applied Gordon Chaffee's patch to handle failures - during asynchronous socket connection operations. This adds a new - "-error" fconfgure option to socket channels. [Bug: 893] - - * generic/tclProc.c: - * generic/tclNamesp.c: - * generic/tclInt.h: - * generic/tclCmdIL.c: - * generic/tclBasic.c: - * generic/tclVar.c: Applied patch from Viktor Dukhovni to - rationalize TCL_LEAVE_ERR_MSG behavior when creating variables. - - * generic/tclVar.c: Fixed bug in namespace tail computation. - Fixed bug where upvar could resurrect a namespace variable whose - namespace had been deleted. - - * generic/tclCompile.c (TclCompileExprCmd): Eliminated yet another - bogus optimization in expression compilation. - - * unix/configure.in: Added branch for BSD/OS-4* to shared library - case statement. [Bug: 975] - Fixed to correctly handle IRIX 6.5 n32 library support. [Bug: 1117] - - * win/winDumpExts.c: Patched to be pickier about stripping - @'s. [Bug: 920] - - * library/http2.0/http.tcl: Added catch around eof test in - CopyDone since the user may have already called http::reset. - [Bug: 1108] - - * unix/configure.in: Changed Linux and IRIX to set SHLIB_LIBS to - LIBS so shared libraries are linked with the system - libraries. [Bug: 1018] - - * generic/tclCompile.c (CompileExprWord): Fixed exception stack - overflow bug caused by missing statement. [Bug: 928] - - * generic/tclIOCmd.c: - * generic/tclBasic.c: Objectified the "open" command. [Bug: 1113] - - * generic/tclPosixStr.c (Tcl_ErrnoId, Tcl_ErrnoMsg): When using - egcs, ENOTSUP and EOPNOTSUPP are the same, so now we handle that - case. [Bug: 1137] - - * library/init.tcl: Various small changes requested by Jan Nijtmans. - - If the variable $tcl_library contains the empty string, this - empty string will be put in $auto_path. This is not useful at all, - it only slows down later package processing. - - If the variable tcl_pkgPath is not set, the "unset __dir" - fails. Thich makes init.tcl totally unusable. Better put a "catch" - around it. - - In the function tcl_findLibraries, the "string match" function - only works correctly if $tcl_patchLevel is in one of the forms - "?.?a?", "?.?b?" or "?.?.?". Could a "regexp" be used instead, - then it allows anything to be appended to the patchLevel - string. And it is more efficient. - - The tclPkgSetup function assumes that if $type != "load" then - the type must be "source". This needn't be true. Some users want - to add their own setup types. - [RFE: 1138] [Bug: 978] - - * win/tclWinReg.c: - * doc/registry.n: Added support for HKEY_PERFORMANCE_DATA and - HKEY_DYN_DATA keys. [Bug: 1109] - - * win/tclWinInit.c (TclPlatformInit): Added code to ensure - tcl_pkgPath is set to "" when no registry entry is found. [Bug: 978] - -1999-02-01 - - * generic/tclBasic.c: - * generic/tclCmdAH.c: - * generic/tclCmdIL.c: - * generic/tclCmdMZ.c: - * generic/tclExecute.c: - * generic/tclHistory.c: - * generic/tclIO.c: - * generic/tclIOUtil.c: - * generic/tclInterp.c: - * generic/tclMain.c: - * generic/tclNamesp.c: - * generic/tclParse.c: - * generic/tclProc.c: - * generic/tclTest.c: - * generic/tclTimer.c: - * generic/tcl.h: Made eval interfaces compatible with 8.0 by - renaming Tcl_EvalObj to Tcl_EvalObjEx, renaming Tcl_Eval2 to - Tcl_EvalEx and restoring Tcl_EvalObj and Tcl_GlobalEvalObj - interfaces so they match Tcl 8.0. - -1999-01-28 - - * Merged Tcl 8.0.5b1 changes. - - * generic/tclUtil.c (Tcl_DStringSetLength): Changed so the buffer - overallocates in a manner similar to Tcl_DStringAppend. This - should improve performance for TclUniCharToUtfDString. - -1998-12-11 === Tcl 8.1b1 Release === - -1998-12-10 - - * Fixed lots of files that used TCL_THREAD instead of TCL_THREADS. - - * generic/tclEncoding.c (Tcl_FreeEncoding): Moved most of the code - into a static FreeEncoding routine that does not grab the - encodingMutex to avoid deadlocks/races when called from other - routines that already have the mutex. - -1998-12-09 - - * library/msgcat1.0/msgcat.tcl: Fixed bad export list, fixed so - all locale strings are converted to lower case, including file - names. - - * generic/regcomp.c (makescan): Fixed bug in longest match case - that caused anchored patterns to fail. [Bug: 897] - -1998-12-08 - - * library/msgcat1.0/msgcat.tcl: changed mc to invoke mcunknown in - the calling context, changed locale lookups to be case insensitive - -1998-12-07 - - * generic/tclAlloc.c (TclpRealloc): Fixed a memory allocation bug - where big blocks that were reallocated into a different heap - location were not being placed into the bigBlocks list. [Bug: 933] - - * tests/msgcat.test: Added message catalog test suite. - - * library/msgcat1.0/msgcat.tcl: minor bug fixes, integrated latest - changes from Mark Harrison. - -1998-12-04 - - * library/msgcat1.0/msgcat.tcl: Changed code to conform to Tcl - coding standards. Changed to use file join for portability. - - * library/msgcat1.0: Added initial implementaion of Tcl message - catalog package contributed by Mark Harrison. - -1998-12-03 - - * win/tclWinPipe.c (BuildCommandLine): Fixed bug that kept - arguments containing spaces from being properly quoted. - - * tests/defs: Changed so auto_path is set to only contain the Tcl - library directory. This keeps the tests from accidentally picking - up stuff in installed packages. - - * generic/tclUtil.c (Tcl_StringMatch): Changed to match 8.0 - behavior in corner case where there is no closing bracket. - -1998-12-02 - - * win/tclWinPipe.c (TclpCreateCommandChannel): Changed - reader/writer threads to have THREAD_PRIORITY_HIGHEST so they will - have a chance to run whenever there is something to do. - - * generic/tclIO.c (WriteBytes, WriteChars): Fixed so extraneous - flushes do not happen in line mode. - (TranslateOutputEOL): Made translation more efficient in line mode - and fixed a buffer overflow bug in CRLF translation. [Bug: 887] - -1998-12-02 - - * Updated patchlevel to 8.1b1 - -1998-12-02 - - * generic/regc_color.c (subcolor): Added check for error case to - avoid an out of bounds array reference. - - * generic/tclCmdAH.c (Tcl_EncodingObjCmd): Changed to avoid using - Tcl_DStringResult because it is not binary clean. - - * generic/tclParse.c (Tcl_ParseCommand): Fixed bug in comment - parsing where a trailing comment looked like an incomplete - command. - -1998-12-02 - - * Merged changes from 8.0.4, especially the new pkg_mkIndex - -1998-12-01 - - * generic/tclIO.c (Tcl_ReadChars): Added a call to UpdateInterest - so we don't block when there is data sitting in the buffers. - - * generic/tclTest.c (TestevalobjvObjCmd): Updated for EvalObjv - change. - - * tests/parse.test: Updated tests for EvalObjv change. - - * generic/tclParse.c (EvalObjv, Tcl_EvalObjv): Changed - Tcl_EvalObjv interface to remove string and length arguments, - preserved original interface as EvalObjv for internal use. - - * generic/tcl.h: Changed Tcl_EvalObjv interface to remove string - and length arguments. - - * doc/Eval.3: Updated documentation for Tcl_EvalObjv to remove - string and length arguments. - - * generic/tclCompCmds.c (TclCompileForeachCmd): Fixed code that - corrupted the exceptDepth value in the compile environment when - foreach failed to compile inline. [Bug: 884] - - * library/encoding/euc-kr.enc: - * library/encoding/ksc5601.enc: - * tools/encoding/ksc5601.txt: - * unix/tclUnixInit.c: Added support for Korean EUC. - - * win/tclWinChan.c (TclpGetDefaultStdChannel): added check for a - failure during Tcl_MakeFileChannel. - -1998-11-30 - - * unix/tclUnixNotfy.c (Tcl_WaitForEvent): Fixed hang that occurs - when trying to close a pipe that is currently being waited on by - the notifier thread. [Bug: 607] - - * unix/tclUnixFCmd.c (GetPermissionsAttribute): Increase size of - returnString buffer to avoid overflow. [Bug: 584] - - * generic/tclThreadTest.c (TclThreadSend): Fixed memory leak due - to use of TCL_VOLATILE instead of TCL_DYNAMIC. - - * generic/tclThread.c (TclRememberSyncObject): Fixed memory leak - caused by failure to reuse condition variables. - - * unix/tclUnixNotfy.c: (Tcl_AlertNotifier, Tcl_WaitForEvent, - NotifierThreadProc, Tcl_InitNotifier): Fixed race condition caused - by incorrect use of condition variables when sending messages - between threads.. [Bug: 607] - - * generic/tclTestObj.c (TeststringobjCmd): MAX_STRINGS was off by one - so the strings array was too small. - - * generic/tclCkalloc.c (Tcl_DbCkfree): Moved mutex lock so - ValidateMemory is done inside the mutex to avoid a race condition - when validate_memory is enabled. [Bug: 880] - -1998-11-23 - - * regexec.c: more performance tuning from Henry Spencer. - -1998-11-17 - - * tclScan.c: moved "scan" implementation out of tclCmdMZ.c and - added Unicode support. This required a complete reimplementation - of the command to avoid using scanf(), which isn't Unicode aware. - Two new features were added in the process: %n to return the - current number of characters consumed, and XPG3-style %n$ argument - order specifiers similar to those provided by the "format" - command. [Bug: 833] - - * tclAlloc.c: changed so allocated memory is always 8-byte aligned - to improve memory performance and to ensure that it will work on - systems that don't like accessing 4-byte aligned values - (e.g. Solaris and HP-UX). [Bug: 834] - -1998-11-06 - - * tclVar.c (TclGetIndexedScalar): Fixed bug 796, var name was - getting lost before being passed to CallTraces. - -1998-10-21 - - * added "encoding" command - - * Moved internal regexp declarations from tclInt.h to tclRegexp.h - - * integrated regexp updates from Henry Spencer - -1998-10-15 - - * tclUtf.c: added Unicode character table support - - * tclInt.h: added TclUniCharIsWordChar - - * tclCmdMZ.c (Tcl_StringObjCmd): added "totitle" subcommand, - changed "wordend" and "wordstart" to properly handle Unicode word - characters and connector punctuation - -1998-10-05 - - * auto.tcl, package.tcl: fixed SCCS strings - - * tclIndex: updated index to reflect 8.1 files - - * tclCompile.c (TclCompileScript): changed to avoid modifying the - input string in place because name lookup operations could have - arbitrary side effects - - * tclInterp.c: added guard against deleting current interpreter - - * tclMacFile.c, tclUnixFile.c, tclWinFile.c, tclFileName.c: added - warnings around code that modifies strings in place - - * tclExecute.c: fixed off-by-one copying error, fixed merge bugs - - * tclEvent.c: changed so USE_TCLALLOC is tested for value instead - of definition - - * tclCompCmds.c: replaced SCCS strings, added warnings around code - that modifies strings in place - - * interp.test: added test for interp deleting itself - -1998-09-30 - - * makefile.vc: fixed so TCL_LIBRARY is set before running tcltest - - * tclWin32Dll.c: removed TclpFinalize, cleanup of merges - diff --git a/README b/README deleted file mode 100644 index 00e549d..0000000 --- a/README +++ /dev/null @@ -1,401 +0,0 @@ -README: Tcl - - Tcl is maintained, enhanced, and distributed freely as a - service to the Tcl community by Scriptics Corporation. - -RCS: @(#) $Id: README,v 1.16 1999/04/16 00:46:29 stanton Exp $ - -Contents --------- - 1. Introduction - 2. Documentation - 3. Compiling and installing Tcl - 4. Summary of changes in Tcl 8.1 - 5. Development tools - 6. Tcl newsgroup - 7. Tcl contributed archive - 8. Tcl Resource Center - 9. Mailing lists - 10. Support and bug fixes - 11. Tcl version numbers - -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 the Macintosh. Tcl can also be used for a -variety of web-related tasks and for creating powerful command -languages for applications. - -This directory contains the sources and documentation for Tcl. The -information here corresponds to release 8.1b3, which is the third -beta release for Tcl 8.1. This release is mostly feature complete but -may have bugs and be missing some minor features. This release is for -early adopters who are willing to help us find and fix problems. -Please let us know about any problems you uncover. - -Tcl 8.1 includes four major new features: Unicode support (all internal -strings are now stored in UTF-8 form), a new regular expression matcher -with most of the Perl features, support for multithreading, and a new -message catalog package. For details on features, incompatibilities, and -potential problems with this release, see the Tcl/Tk 8.1 Web page at -http://www.scriptics.com/software/8.1.html or refer to the "changes" file -in this directory, which contains a historical record of all changes to -Tcl. - -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 ----------------- - -The best way to get started with Tcl is to read about Tcl on the -Scriptics Web site at: - - http://www.scriptics.com/scripting - -Another good way to get started with Tcl is to read one of the -introductory books on Tcl: - - Practical Programming in Tcl and Tk, 2nd Edition, by Brent Welch, - Prentice-Hall, 1997, ISBN 0-13-616830-2 - - Tcl and the Tk Toolkit, by John Ousterhout, - Addison-Wesley, 1994, ISBN 0-201-63337-X - - Exploring Expect, by Don Libes, - O'Reilly and Associates, 1995, ISBN 1-56592-090-2 - -Other books are listed at -http://www.scriptics.com/resource/doc/books/ - -There is also an official home for Tcl and Tk on the Scriptics Web site: - - http://www.scriptics.com - -These Web pages include information about the latest releases, products -related to Tcl and Tk, reports on bug fixes and porting issues, HTML -versions of the manual pages, and pointers to many other Tcl/Tk Web -pages at other sites. Check them out! - -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 - - ditroff -man Tcl.n - -to print Tcl.n. 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/help" subdirectory in this release contains a complete set of -Windows help files for TclPro. 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 -------------------------------- - -This release contains everything you should need to compile and run -Tcl under UNIX, PCs (either Windows NT, Windows 95, or Win 3.1 with -Win32s), and Macintoshes. - -Before trying to compile Tcl you should do the following things: - - (a) Check for a binary release. Pre-compiled binary releases are - available now for PCs, Macintoshes, and several flavors of UNIX. - Binary releases are much easier to install than source releases. - To find out whether a binary release is available for your - platform, check the Scriptics Tcl Resource Center - (http://www.scriptics.com/resource). Also, check in - the FTP directory from which you retrieved the base - distribution. - - (b) Make sure you have the most recent patch release. Look in the - FTP directory from which you retrieved this distribution to see - if it has been updated with patches. Patch releases fix bugs - without changing any features, so you should normally use the - latest patch release for the version of Tcl that you want. - -Once you've done this, change to the "unix" subdirectory if you're -compiling under UNIX, "win" if you're compiling under Windows, or -"mac" if you're compiling on a Macintosh. Then follow the instructions -in the README file in that directory for compiling Tcl, installing it, -and running the test suite. - -4. Summary of changes in Tcl 8.1 --------------------------------- - -Here are the most significant changes in Tcl 8.1. In addition to these -changes, there are several smaller changes and bug fixes. See the file -"changes" for a complete list of all changes. - - 1. Internationalization. Tcl has undergone a major revision to - support international character sets: - - All strings in Tcl are now represented in UTF-8 instead of ASCII, - so that Tcl now supports the full Unicode character set. The - representation of ASCII characters is unchanged (in UTF-8 anything - that looks like an ASCII character is an ASCII character), but - characters with the high-order bit set, such as those in ISO-8859, - are represented with multi-byte sequences, as are all Unicode - characters with values greater than 127. This change does not - affect Tcl scripts but it does affect C code that parses strings. - Tcl automatically translates between UTF-8 and the normal encoding - for the platform during interactions with the system. - - In Tcl scripts the backslash sequence \u can be used to enter - 16-bit Unicode characters. \o and \x generate only 8-bit - characters as before. - - There is a new "encoding" command that allows scripts to determine - what encodings are available as well as to convert strings between - different encodings. The fconfigure command now supports a - -encoding option for specifying the encoding of an open file or - socket. Tcl will automatically translate between the specified - encoding and UTF-8 during I/O. - - There are several new C APIs that support UTF-8 and various - encodings. See the manual entry Utf.3 for procedures that - translate between Unicode and UTF-8 and manipulate UTF-8 strings. - See Encoding.3 for procedures that create new encodings and - translate between encodings. See ToUpper.3 for procedures that - perform case conversions on UTF-8 strings. - - 2. Binary data. Binary data is handled differently in Tcl 8.1 - than in Tcl 8.0. Tcl 8.1 uses the UTF-8 facilities to represent - binary data: the character value zero is represented with a - multi-byte sequence, so that (once again) strings in Tcl 8.1 never - contain null bytes. This means that binary data is now accepted - everywhere in Tcl and Tk (in Tcl 8.0 the support for binary data - was incomplete). If you have C code that needs to manipulate the - bytes of binary data (as opposed to just passing the data through) - you should use a new object type called "byte array". See the - manual entry ByteArrObj.3 for information about procedures such as - Tcl_GetByteArrayFromObj. - - 3. Regular expressions. Tcl 8.1 contains a brand new - implementation of regular expressions from Henry Spencer. The - regular expression syntax has been greatly expanded to include - most of the features in Perl. In addition, the regexp engine - supports Unicode and binary data. See the doc/regexp.n manual - entry for more details. - - 4. Threads. If configured with the --enable-threads flag, Tcl can - now be compiled for use in a multi-threaded application. - Individual threads are allowed to use one or more interpreters as - long as each interpreter (and any slave interpreters) is only - accessed by one thread. Each thread runs its own event loop, and - you can post events to other threads. There are new C APIs for - mutexes, condition variables, and thread local storage. See the - doc/Thread.3 manual entry for more details. Tk 8.1 is not yet - multi-thread safe. There is not yet support for tcl level use of - threading except for a test command. (Compile tcltest and try - testthread.) - - 5. Message catalog. There is a new message catalog package which makes - it easy to localize the strings in a script. See the doc/msgcat.n - manual entry for more details. - - 6. Stubbs library for building extensions. There is now a new - way to build extensions for Tcl. Instead of linking with the - tcl shared library you can now link to a stubs library that gets - built in this release. By linking with the stubs library it - is possible to use dynamically loaded extensions in staticlly - built applications. It will also be possible for some extensions - to work for both Tcl 8.0 & 8.1 with out having to recompile. - -5. Development tools --------------------- - -A high quality set of commercial development tools is now available to -accelerate your Tcl application development. Scriptics' TclPro -product provides a debugger, static code checker, packaging utility, -and bytecode compiler. Visit the Scriptics Web site at: - - http://www.scriptics.com/tclpro - -for more information on TclPro and for a free 30-day evaluation -download. - -6. Tcl newsgroup ----------------- - -There is a network news group "comp.lang.tcl" intended for the -exchange of information about Tcl, Tk, and related applications. The -newsgroup is a greata place to ask general information questions. For -bug reports, please see the "Support and bug fixes" section below. - -7. Tcl contributed archive --------------------------- - -Many people have created exciting packages and applications based on Tcl -and/or Tk and made them freely available to the Tcl community. An archive -of these contributions is kept on the machine ftp.neosoft.com. You -can access the archive using anonymous FTP; the Tcl contributed archive is -in the directory "/pub/tcl". The archive also contains several FAQ -("frequently asked questions") documents that provide solutions to problems -that are commonly encountered by TCL newcomers. - -8. Tcl Resource Center ----------------------- - -Visit http://www.scriptics.com/resource/ to see an annotated index of -many Tcl resources available on the World Wide Web. This includes -papers, books, and FAQs, as well as development tools, extensions, -applications, binary releases, and patches. You can also recommend -additional URLs for the resource center using the forms labeled "Add a -Resource". - -9. Mailing lists ----------------- - -A couple of Mailing List have been set up to discuss Macintosh or -Windows related Tcl issues. To subscribe send a message to: - - wintcl-request@tclconsortium.org - mactcl-request@tclconsortium.org - -In the body of the message (the subject will be ignored) put: - - subscribe mactcl Joe Smith - -Replacing Joe Smith with your real name, of course. (Use wintcl -instead of mactcl if your interested in the Windows list.) If you -would just like to receive more information about the list without -subscribing put the line: - - information mactcl - -in the body instead (or wintcl). - -10. Support and bug fixes -------------------------- - -Scriptics is very interested in receiving bug reports, patches, and -suggestions for improvements. We prefer that you send this -information to us via the bug form on the Scriptics Web site, rather -than emailing us directly. The bug form is at: - - http://www.scriptics.com/support/bugForm.html - -The bug form was designed to give uniform structure to bug reports as -well as to solicit enough information to minimize followup questions. -The bug form also includes an option to automatically post your report -on comp.lang.tcl. We strongly recommend that you select this option -because someone else who reads comp.lang.tcl may be able to offer a -solution. - -When reporting bugs, please provide full information about the Tcl/Tk -version and the platform on which you are running Tcl/Tk. Also, -please include a short tclsh script that we can use to reproduce the -bug. Make sure that the script runs with a bare-bones tclsh and -doesn't depend on any extensions or other programs, particularly those -that exist only at your site. Also, please include three additional -pieces of information with the script: - - (a) how do we use the script to make the problem happen (e.g. - what things do we click on, in what order)? - (b) what happens when you do these things (presumably this is - undesirable)? - (c) what did you expect to happen instead? - -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. We read the newsgroup and will attempt to -answer esoteric questions for which no-one else is likely to know the -answer. In addition, Tcl/Tk support and training are available -commercially from Scriptics at: - - http://www.scriptics.com/training - -Also see the following Web site for links to other organizations that -offer Tcl/Tk training: - - http://www.scriptics.com/resource/commercial/training - -11. Tcl version numbers ------------------------ - -You can test the current version of Tcl by examining the -tcl_version and tcl_patchLevel variables. The tcl_patchLevel -variable follows the naming rules outlined below (e.g., 8.0.5). -The tcl_version just has the major.minor numbers in it (e.g., 8.0) - -Each Tcl release is identified by two numbers separated by a dot, e.g. -6.7 or 7.0. If a new release contains changes that are likely to break -existing C code or Tcl scripts then the major release number increments -and the minor number resets to zero: 6.0, 7.0, etc. If a new release -contains only bug fixes and compatible changes, then the minor number -increments without changing the major number, e.g. 7.1, 7.2, etc. If -you have C code or Tcl scripts that work with release X.Y, then they -should also work with any release X.Z as long as Z > Y. - -Alpha and beta releases have an additional suffix of the form a2 or b1. -For example, Tcl 7.0b1 is the first beta release of Tcl version 7.0, -Tcl 7.0b2 is the second beta release, and so on. A beta release is an -initial version of a new release, used to fix bugs and bad features before -declaring the release stable. An alpha release is like a beta release, -except it's likely to need even more work before it's "ready for prime -time". New releases are normally preceded by one or more alpha and beta -releases. We hope that lots of people will try out the alpha and beta -releases and report problems. We'll make new alpha/beta releases to fix -the problems, until eventually there is a beta release that appears to -be stable. Once this occurs we'll make the final release. - -We can't promise to maintain compatibility among alpha and beta releases. -For example, release 7.1b2 may not be backward compatible with 7.1b1, even -though the final 7.1 release will be backward compatible with 7.0. This -allows us to change new features as we find problems during beta testing. -We'll try to minimize incompatibilities between beta releases, but if -a major problem turns up then we'll fix it even if it introduces an -incompatibility. Once the official release is made then there won't -be any more incompatibilities until the next release with a new major -version number. - -(Note: This compatibility is true for Tcl scripts, but historically -the Tcl C APIs have changed enough between releases that you may need -to work a bit to upgrade extensions.) - -Patch releases now have a suffix such as ".4" or ".5". Prior to -version 8.0.3, patch releases had the suffix "p1" or "p2". So, the -8.0 release went to 8.0p1, 8.0p2, 8.0.3, 8.0.4, and 8.0.5. The alphas -and betas continue to use the 'a' and 'b' letters in their -tcl_patchLevel. Patch releases normally contain bug fixes only. A -patch release (e.g Tcl 8.0.5) should be completely compatible with the -base release from which it is derived (e.g. Tcl 8.0), and you should -normally use the highest available patch release. - -12. 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. diff --git a/changes b/changes deleted file mode 100644 index 7ee8d72..0000000 --- a/changes +++ /dev/null @@ -1,4309 +0,0 @@ -Recent user-visible changes to Tcl: - -RCS: @(#) $Id: changes,v 1.43 1999/04/16 00:46:29 stanton Exp $ - -1. No more [command1] [command2] construct for grouping multiple -commands on a single command line. - -2. Semi-colon now available for grouping commands on a line. - -3. For a command to span multiple lines, must now use backslash-return -at the end of each line but the last. - -4. "Var" command has been changed to "set". - -5. Double-quotes now available as an argument grouping character. - -6. "Return" may be used at top-level. - -7. More backslash sequences available now. In particular, backslash-newline -may be used to join lines in command files. - -8. New or modified built-in commands: case, return, for, glob, info, -print, return, set, source, string, uplevel. - -9. After an error, the variable "errorInfo" is filled with a stack -trace showing what was being executed when the error occurred. - -10. Command abbreviations are accepted when parsing commands, but -are not recommended except for purely-interactive commands. - -11. $, set, and expr all complain now if a non-existent variable is -referenced. - -12. History facilities exist now. See Tcl.man and Tcl_RecordAndEval.man. - -13. Changed to distinguish between empty variables and those that don't -exist at all. Interfaces to Tcl_GetVar and Tcl_ParseVar have changed -(NULL return value is now possible). *** POTENTIAL INCOMPATIBILITY *** - -14. Changed meaning of "level" argument to "uplevel" command (1 now means -"go up one level", not "go to level 1"; "#1" means "go to level 1"). -*** POTENTIAL INCOMPATIBILITY *** - -15. 3/19/90 Added "info exists" option to see if variable exists. - -16. 3/19/90 Added "noAbbrev" variable to prohibit command abbreviations. - -17. 3/19/90 Added extra errorInfo option to "error" command. - -18. 3/21/90 Double-quotes now only affect space: command, variable, -and backslash substitutions still occur inside double-quotes. -*** POTENTIAL INCOMPATIBILITY *** - -19. 3/21/90 Added support for \r. - -20. 3/21/90 List, concat, eval, and glob commands all expect at least -one argument now. *** POTENTIAL INCOMPATIBILITY *** - -21. 3/22/90 Added "?:" operators to expressions. - -22. 3/25/90 Fixed bug in Tcl_Result that caused memory to get trashed. - -------------------- Released version 3.1 --------------------- - -23. 3/29/90 Fixed bug that caused "file a.b/c ext" to return ".b/c". - -24. 3/29/90 Semi-colon is not treated specially when enclosed in -double-quotes. - -------------------- Released version 3.2 --------------------- - -25. 4/16/90 Rewrote "exec" not to use select or signals anymore. -Should be more Sys-V compatible, and no slower in the normal case. - -26. 4/18/90 Rewrote "glob" to eliminate GNU code (there's no GNU code -left in Tcl, now), and added Tcl_TildeSubst procedure. Added automatic -tilde-substitution in many commands, including "glob". - -------------------- Released version 3.3 --------------------- - -27. 7/11/90 Added "Tcl_AppendResult" procedure. - -28. 7/20/90 "History" with no options now defaults to "history info" -rather than to "history redo". Although this is a backward incompatibility, -it should only be used interactively and thus shouldn't present any -compatibility problems with scripts. - -29. 7/20/90 Added "Tcl_GetInteger", "Tcl_GetDouble", and "Tcl_GetBoolean" -procedures. - -30. 7/22/90 Removed "Tcl_WatchInterp" procedure: doesn't seem to be -necessary, since the same effect can be achieved with the deletion -callbacks on individual commands. *** POTENTIAL INCOMPATIBILITY *** - -31. 7/23/90 Added variable tracing: Tcl_TraceVar, Tcl_UnTraceVar, -and Tcl_VarTraceInfo procedures, "trace" command. - -32. 8/9/90 Mailed out list of all bug fixes since 3.3 release. - -33. 8/29/90 Fixed bugs in Tcl_Merge relating to backslashes and -semi-colons. Mailed out patch. - -34. 9/3/90 Fixed bug in tclBasic.c: quotes weren't quoting ]'s. -Mailed out patch. - -35. 9/19/90 Rewrote exec to always use files both for input and -output to the process. The old pipe-based version didn't work if -the exec'ed process forked a child and then exited: Tcl waited -around for stdout to get closed, which didn't happen until the -grandchild exited. - -36. 11/5/90 ERR_IN_PROGRESS flag wasn't being cleared soon enough -in Tcl_Eval, allowing error messages from different commands to -pile up in $errorInfo. Fixed by re-arranging code in Tcl_Eval that -re-initializes result and ERR_IN_PROGRESS flag. Didn't mail out -patch: changes too complicated to describe. - -37. 12/19/90 Added Tcl_VarEval procedure as a convenience for -assembling and executing Tcl commands. - -38. 1/29/91 Fixed core leak in Tcl_AddErrorInfo. Also changed procedure -and Tcl_Eval so that first call to Tcl_AddErrorInfo need not come from -Tcl_Eval. - ------------------ Released version 5.0 with Tk ------------------ - -39. 4/3/91 Removed change bars from manual entries, leaving only those -that came after version 3.3 was released. - -40. 5/17/91 Changed tests to conform to Mary Ann May-Pumphrey's approach. - -41. 5/23/91 Massive revision to Tcl parser to simplify the implementation -of string and floating-point support in expressions. Newlines inside -[] are now treated as command separators rather than word separators -(this makes newline treatment consistent throughout Tcl). -*** POTENTIAL INCOMPATIBILITY *** - -42. 5/23/91 Massive rewrite of expression code to support floating-point -values and simple string comparisons. The C interfaces to expression -routines have changed (Tcl_Expr is replaced by Tcl_ExprLong, Tcl_ExprDouble, -etc.), but all old Tcl expression strings should be accepted by the new -expression code. -*** POTENTIAL INCOMPATIBILITY *** - -43. 5/23/91 Modified tclHistory.c to check for negative "keep" value. - -44. 5/23/91 Modified Tcl_Backslash to handle backslash-newline. It now -returns 0 to indicate that a backslash sequence should be replaced by -no character at all. -*** POTENTIAL INCOMPATIBILITY *** - -45. 5/29/91 Modified to use ANSI C function prototypes. Must set -"USE_ANSI" switch when compiling to get prototypes. - -46. 5/29/91 Completed test suite by providing tests for all of the -built-in Tcl commands. - -47. 5/29/91 Changed Tcl_Concat to eliminate leading and trailing -white-space in each of the things it concatenates and to ignore -elements that are empty or have only white space in them. This -produces cleaner output from the "concat" command. -*** POTENTIAL INCOMPATIBILITY *** - -48. 5/31/91 Changed "set" command and Tcl_SetVar procedure to return -new value of variable. - -49. 6/1/91 Added "while" and "cd" commands. - -50. 6/1/91 Changed "exec" to delete the last character of program -output if it is a newline. In most cases this makes it easier to -process program-generated output. -*** POTENTIAL INCOMPATIBILITY *** - -51. 6/1/91 Made sure that pointers are never used after freeing them. - -52. 6/1/91 Fixed bug in TclWordEnd where it wasn't dealing with -[] inside quotes correctly. - -53. 6/8/91 Fixed exec.test to accept return values of either 1 or -255 from "false" command. - -54. 7/6/91 Massive overhaul of variable management. Associative -arrays now available, along with "unset" command (and Tcl_UnsetVar -procedure). Variable traces have been completely reworked: -interfaces different both from Tcl and C, and multiple traces may -exist on same variable. Can no longer redefine existing local -variable to be global. Calling sequences have changed slightly -for Tcl_GetVar and Tcl_SetVar ("global" is now "flags"). Tcl_SetVar -can fail and return a NULL result. New forms of variable-manipulation -procedures: Tcl_GetVar2, Tcl_SetVar2, etc. Syntax of variable -$-notation changed to support array indexing. -*** POTENTIAL INCOMPATIBILITY *** - -55. 7/6/91 Added new list-manipulation procedures: Tcl_ScanElement, -Tcl_ConvertElement, Tcl_AppendElement. - -56. 7/12/91 Created new procedure Tcl_EvalFile, which does most of the -work of the "source" command. - -57. 7/20/91 Major reworking of "exec" command to allow pipelines, -more redirection, background. Added new procedures Tcl_Fork, -Tcl_WaitPids, Tcl_DetachPids, and Tcl_CreatePipeline. The old -"< input" notation has been replaced by "<< input" ("<" is for -redirection from a file). Also handles error returns and abnormal -terminations (e.g. signals) differently. -*** POTENTIAL INCOMPATIBILITY *** - -58. 7/21/91 Added "append" and "lappend" commands. - -59. 7/22/91 Reworked error messages and manual entries to use -?x? as the notation for an optional argument x, instead of [x]. The -bracket notation was often confused with the use of brackets for -command substitution. Also modified error messages to be more -consistent. - -60. 7/23/91 Tcl_DeleteCommand now returns an indication of whether -or not the command actually existed, and the "rename" command uses -this information to return an error if an attempt is made to delete -a non-existent command. -*** POTENTIAL INCOMPATIBILITY *** - -61. 7/25/91 Added new "errorCode" mechanism, along with procedures -Tcl_SetErrorCode, Tcl_UnixError, and Tcl_ResetResult. Renamed -Tcl_Return to Tcl_SetResult, but left a #define for Tcl_Return to -avoid compatibility problems. - -62. 7/26/91 Extended "case" command with alternate syntax where all -patterns and commands are together in a single list argument: makes -it easier to write multi-line case statements. - -63. 7/27/91 Changed "print" command to perform tilde-substitution on -the file name. - -64. 7/27/91 Added "tolower", "toupper", "trim", "trimleft", and "trimright" -options to "string" command. - -65. 7/29/91 Added "atime", "mtime", "size", and "stat" options to "file" -command. - -66. 8/1/91 Added "split" and "join" commands. - -67. 8/11/91 Added commands for file I/O, including "open", "close", -"read", "gets", "puts", "flush", "eof", "seek", and "tell". - -68. 8/14/91 Switched to use a hash table for command lookups. Command -abbreviations no longer have direct support in the Tcl interpreter, but -it should be possible to simulate them with the auto-load features -described below. The "noAbbrev" variable is no longer used by Tcl. -*** POTENTIAL INCOMPATIBILITY *** - -68.5 8/15/91 Added support for "unknown" command, which can be used to -complete abbreviations, auto-load library files, auto-exec shell -commands, etc. - -69. 8/15/91 Added -nocomplain switch to "glob" command. - -70. 8/20/91 Added "info library" option and TCL_LIBRARY #define. Also -added "info script" option. - -71. 8/20/91 Changed "file" command to take "option" argument as first -argument (before file name), for consistency with other Tcl commands. -*** POTENTIAL INCOMPATIBILITY *** - -72. 8/20/91 Changed format of information in $errorInfo variable: -comments such as - ("while" body line 1) -are now on separate lines from commands being executed. -*** POTENTIAL INCOMPATIBILITY *** - -73. 8/20/91 Changed Tcl_AppendResult so that it (eventually) frees -large buffers that it allocates. - -74. 8/21/91 Added "linsert", "lreplace", "lsearch", and "lsort" -commands. - -75. 8/28/91 Added "incr" and "exit" commands. - -76. 8/30/91 Added "regexp" and "regsub" commands. - -77. 9/4/91 Changed "dynamic" field in interpreters to "freeProc" (procedure -address). This allows for alternative storage managers. -*** POTENTIAL INCOMPATIBILITY *** - -78. 9/6/91 Added "index", "length", and "range" options to "string" -command. Added "lindex", "llength", and "lrange" commands. - -79. 9/8/91 Removed "index", "length", "print" and "range" commands. -"Print" is redundant with "puts", but less general, and the other -commands are replaced with the new commands described in change 78 -above. -*** POTENTIAL INCOMPATIBILITY *** - -80. 9/8/91 Changed history revision to occur even when history command -is nested; needed in order to allow "history" to be invoked from -"unknown" procedure. - -81. 9/13/91 Changed "panic" not to use vfprintf (it's uglier and less -general now, but makes it easier to run Tcl on systems that don't -have vfprintf). Also changed "strerror" not to redeclare sys_errlist. - -82. 9/19/91 Lots of changes to improve portability to different UNIX -systems, including addition of "config" script to adapt Tcl to the -configuration of the system it's being compiled on. - -83. 9/22/91 Added "pwd" command. - -84. 9/22/91 Renamed manual pages so that their filenames are no more -than 14 characters in length, moved to "doc" subdirectory. - -85. 9/24/91 Redid manual entries so they contain the supplemental -macros that they need; can just print with "troff -man" or "man" -now. - -86. 9/26/91 Created initial version of script library, including -a version of "unknown" that does auto-loading, auto-execution, and -abbreviation expansion. This library is used by tclTest -automatically. See the "library" manual entry for details. - ------------------ Released version 6.0, 9/26/91 ------------------ - -87. 9/30/91 Made "string tolower" and "string toupper" check case -before converting: on some systems, "tolower" and "toupper" assume -that character already has particular case. - -88. 9/30/91 Fixed bug in Tcl_SetResult: wasn't always setting freeProc -correctly when called with NULL value. This tended to cause memory -allocation errors later. - -89. 10/3/91 Added "upvar" command. - -90. 10/4/91 Changed "format" so that internally it converts %D to %ld, -%U to %lu, %O to %lo, and %F to %f. This eliminates some compatibility -problems on some machines without affecting behavior. - -91. 10/10/91 Fixed bug in "regsub" that caused core dumps with the -all -option when the last match wasn't at the end of the string. - -92. 10/17/91 Fixed problems with backslash sequences: \r support was -incomplete and \f and \v weren't supported at all. - -93. 10/24/91 Added Tcl_InitHistory procedure. - -94. 10/24/91 Changed "regexp" to store "-1 -1" in subMatchVars that -don't match, rather than returning an error. - -95. 10/27/91 Modified "regexp" to return actual strings in matchVar -and subMatchVars instead of indices. Added "-indices" switch to cause -indices to be returned. -*** POTENTIAL INCOMPATIBILITY *** - -96. 10/27/91 Fixed bug in "scan" where it used hardwired constants for -sizes of floats and doubles instead of using "sizeof". - -97. 10/31/91 Fixed bug in tclParse.c where parse-related error messages -weren't being storage-managed correctly, causing spurious free's. - -98. 10/31/91 Form feed and vertical tab characters are now considered -to be space characters by the parser. - -99. 10/31/91 Added TCL_LEAVE_ERR_MSG flag to procedures like Tcl_SetVar. - -100. 11/7/91 Fixed bug in "case" where "in" argument couldn't be omitted -if all case branches were embedded in a single list. - -101. 11/7/91 Switched to use "pid_t" and "uid_t" and other official -POSIC types and function prototypes. - ------------------ Released version 6.1, 11/7/91 ------------------ - -102. 12/2/91 Modified Tcl_ScanElement and Tcl_ConvertElement in several -ways. First, allowed caller to request that only backslashes be used -(no braces). Second, made Tcl_ConvertElement more aggressive in using -backslashes for braces and quotes. - -103. 12/5/91 Added "type", "lstat", and "readlink" options to "file" -command, plus added new "type" element to output of "stat" and "lstat" -options. - -104. 12/10/91 Manual entries had first lines that caused "man" program -to try weird preprocessor. Added blank comment lines to fix problem. - -105. 12/16/91 Fixed a few bugs in auto_mkindex proc: wasn't handling -errors properly, and hadn't been upgraded for new "regexp" syntax. - -106. 1/2/92 Fixed bug in "file" command where it didn't properly handle -a file names containing tildes where the indicated user doesn't exist. - -107. 1/2/92 Fixed lots of cases in tclUnixStr.c where two different -errno symbols (e.g. EWOULDBLOCK and EAGAIN) have the same number; Tcl -will only use one of them. - -108. 1/2/92 Lots of changes to configuration script to handle many more -systems more gracefully. E.g. should now detect the bogus strtoul that -comes with AIX and substitute Tcl's own version instead. - ------------------ Released version 6.2, 1/10/92 ------------------ - -109. 1/20/92 Config didn't have code to actually use "uid_t" variable -to set TCL_UIT_T #define. - -110. 2/10/92 Tcl_Eval didn't properly reset "numLevels" variable when -too-deep recursion occurred. - -111. 2/29/92 Added "on" and "off" to keywords accepted by Tcl_GetBoolean. - -112. 3/19/92 Config wasn't installing default version of strtod.c for -systems that don't have one in libc.a. - -113. 3/23/92 Fixed bug in tclExpr.c where numbers with leading "."s, -like 0.75, couldn't be properly substituted into expressions with -variable or command substitution. - -114. 3/25/92 Fixed bug in tclUnixAZ.c where "gets" command wasn't -checking to make sure that it was able to write the variable OK. - -115. 4/16/92 Fixed bug in tclUnixAZ.c where "read" command didn't -compute file size right for device files. - -116. 4/23/92 Fixed but in tclCmdMZ.c where "trace vinfo" was overwriting -the trace command. - ------------------ Released version 6.3, 5/1/92 ------------------ - -117. 5/1/92 Added Tcl_GlobalEval. - -118. 6/1/92 Changed auto-load facility to source files at global level. - -119. 6/8/92 Tcl_ParseVar wasn't always setting termPtr after errors, which -sometimes caused core dumps. - -120. 6/21/92 Fixed bug in initialization of regexp pattern cache. This -bug caused segmentation violations in regexp commands under some conditions. - -121. 6/22/92 Changed implementation of "glob" command to eliminate -trailing slashes on directory names: they confuse some systems. There -shouldn't be any user-visible changes in functionality except for names -in error messages not having trailing slashes. - -122. 7/2/92 Fixed bug that caused 'string match ** ""' to return 0. - -123. 7/2/92 Fixed bug in Tcl_CreateCmdBuf where it wasn't initializing -the buffer to an empty string. - -124. 7/6/92 Fixed bug in "case" command where it used NULL pattern string -after errors in the "default" clause. - -125. 7/25/92 Speeded up auto_load procedure: don't reread all the index -files unless the path has changed. - -126. 8/3/92 Changed tclUnix.h to define MAXPATHLEN from PATH_MAX, not -_POSIX_PATH_MAX. - ------------------ Released version 6.4, 8/7/92 ------------------ - -127. 8/10/92 Changed tclBasic.c so that comment lines can be continued by -putting a backslash before the newline. - -128. 8/21/92 Modified "unknown" to allow the source-ing of a file for -an auto-load to trigger other nested auto-loads, as long as there isn't -any recursion on the same command name. - -129. 8/25/92 Modified "format" command to allow " " and "+" flags, and -allow flags in any order. - -130. 9/14/92 Modified Tcl_ParseVar so that it doesn't actually attempt -to look up the variable if "noEval" mode is in effect in the interpreter -(it just parses the name). This avoids the errors that used to occur -in statements like "expr {[info exists foo] && $foo}". - -131. 9/14/92 Fixed bug in "uplevel" command where it didn't output the -correct error message if a level was specified but no command. - -132. 9/14/92 Renamed manual entries to have extensions like .3 and .n, -and added "install" target to Makefile. - -133. 9/18/92 Modified "unknown" command to emulate !!, !, and -^^ csh history substitutions. - -134. 9/21/92 Made the config script cleverer about figuring out which -switches to pass to "nm". - -135. 9/23/92 Fixed tclVar.c to be sure to copy flags when growing variables. -Used to forget about traces in progress and make extra recursive calls -on trace procs. - -136. 9/28/92 Fixed bug in auto_reset where it was unsetting variables -that might not exist. - -137. 10/7/92 Changed "parray" library procedure to print any array -accessible to caller, local or global. - -138. 10/15/92 Fixed bug where propagation of new environment variable -values among interpreters took N! time if there exist N interpreters. - -139. 10/16/92 Changed auto_reset procedure so that it also deletes any -existing procedures that are in the auto_load index (the assumption is -that they should be re-loaded to get the latest versions). - -140. 10/21/92 Fixed bug that caused lists to be incorrectly generated -for elements that contained backslash-newline sequences. - -141. 12/9/92 Added support for TCL_LIBRARY environment variable: use -it as library location if it's present. - -142. 12/9/92 Added "info complete" command, Tcl_CommandComplete procedure. - -143. 12/16/92 Changed the Makefile to check to make sure "config" has been -run (can't run config directly from the Makefile because it modifies the -Makefile; thus make has to be run again after running config). - ------------------ Released version 6.5, 12/17/92 ------------------ - -144. 12/21/92 Changed config to look in several places for libc file. - -145. 12/23/92 Added "elseif" support to if. Also, "then", "else", and -"elseif" may no longer be abbreviated. -*** POTENTIAL INCOMPATIBILITY *** - -146. 12/28/92 Changed "puts" and "read" to support initial "-nonewline" -switch instead of additional "nonewline" argument. The old form is -still supported, but it is discouraged and is no longer documented. -Also changed "puts" to make the file argument default to stdout: e.g. -"puts foo" will print foo on standard output. - -147. 1/6/93 Fixed bug whereby backslash-newline wasn't working when -typed interactively, or in "info complete". - -148. 1/22/93 Fixed bugs in "lreplace" and "linsert" where close -quotes were being lost from last element before replacement or -insertion. - -149. 1/29/93 Fixed bug in Tcl_AssembleCmd where it wasn't requiring -a newline at the end of a line before considering a command to be -complete. The bug caused some very long lines in script files to -be processed as multiple separate commands. - -150. 1/29/93 Various changes in Makefile to add more configuration -options, simplify installation, fix bugs (e.g. don't use -f switch -for cp), etc. - -151. 1/29/93 Changed "name1" and "name2" identifiers to "part1" and -"part2" to avoid name conflicts with stupid C++ implementations that -use "name1" and "name2" in a reserved way. - -152. 2/1/93 Added "putenv" procedure to replace the standard system -version so that it will work correctly with Tcl's environment handling. - ------------------ Released version 6.6, 2/5/93 ------------------ - -153. 2/10/93 Fixed bugs in config script: missing "endif" in libc loop, -and tried to use strncasecmp.c instead of strcasecmp.c. - -154. 2/10/93 Makefile improvements: added RANLIB variable for easier -Sys-V configuration, added SHELL variable for SGI systems. - ------------------ Released version 6.7, 2/11/93 ------------------ - -153. 2/6/93 Changes in backslash processing: - - \Cx, \Mx, \CMx, \e sequences no longer special - - \ also eats up any space after the newline, replacing - the whole sequence with a single space character - - Hex sequences like \x24 are now supported, along with ANSI C's \a. - - "format" no longer does backslash processing on its format string - - there is no longer any special meaning to a 0 return value from - Tcl_Backslash - - unknown backslash sequences, like (e.g. \*), are replaced with - the following character (e.g. *), instead of just treating the - backslash as an ordinary character. -*** POTENTIAL INCOMPATIBILITY *** - -154. 2/6/93 Updated all copyright notices. The meaning hasn't changed -at all but the wording does a better job of protecting U.C. from -liability (according to U.C. lawyers, anyway). - -155. 2/6/93 Changed "regsub" so that it overwrites the result variable -in all cases, even if there is no match. -*** POTENTIAL INCOMPATIBILITY *** - -156. 2/8/93 Added support for XPG3 %n$ conversion specifiers to "format" -command. - -157. 2/17/93 Fixed bug in Tcl_Eval where errors due to infinite -recursion could result in core dumps. - -158. 2/17/93 Improved the auto-load mechanism to deal gracefully (i.e. -return an error) with a situation where a library file that supposedly -defines a procedure doesn't actually define it. - -159. 2/17/93 Renamed Tcl_UnixError procedure to Tcl_PosixError, and -changed errorCode variable usage to use POSIX as keyword instead of -UNIX. -*** POTENTIAL INCOMPATIBILITY *** - -160. 2/19/93 Changes to exec and process control: - - Added support for >>, >&, >>&, |&, <@, >@, and >&@ forms of redirection. - - When exec puts processes into background, it returns a list of - their pids as result. - - Added support for file, etc. (i.e. no space between - ">" and file name. - - Added -keepnewline option. - - Deleted Tcl_Fork and Tcl_WaitPids procedures (just use fork and - waitpid instead). - - Added waitpid compatibility procedure for systems that don't have - it. - - Added Tcl_ReapDetachedProcs procedure. - - Changed "exec" to return an error if there is stderr output, even - if the command returns a 0 exit status (it's always been documented - this way, but the implementation wasn't correct). - - If a process returns a non-zero exit status but doesn't generate - any diagnostic output, then Tcl generates an error message for it. -*** POTENTIAL INCOMPATIBILITY *** - -161. 2/25/93 Fixed two memory-management problems having to do with -managing the old result during variable trace callbacks. - -162. 3/1/93 Added dynamic string library: Tcl_DStringInit, Tcl_DStringAppend, -Tcl_DStringFree, Tcl_DStringResult, etc. - -163. 3/1/93 Modified glob command to only return the names of files that -exist, and to only return names ending in "/" if the file is a directory. -*** POTENTIAL INCOMPATIBILITY *** - -164. 3/19/93 Modified not to use system calls like "read" directly, -but instead to use special Tcl procedures that retry automatically -if interrupted by signals. - -165. 4/3/93 Eliminated "noSep" argument to Tcl_AppendElement, plus -TCL_NO_SPACE flag for Tcl_SetVar and Tcl_SetVar2. -*** POTENTIAL INCOMPATIBILITY *** - -166. 4/3/93 Eliminated "flags" and "termPtr" arguments to Tcl_Eval. -*** POTENTIAL INCOMPATIBILITY *** - -167. 4/3/93 Changes to expressions: - - The "expr" command now accepts multiple arguments, which are - concatenated together with space separators. - - Integers aren't automatically promoted to floating-point if they - overflow the word size: errors are generated instead. - - Tcl can now handle "NaN" and other special values if the underlying - library procedures handle them. - - When printing floating-point numbers, Tcl ensures that there is a "." - or "e" in the number, so it can't be treated as an integer accidentally. - The procedure Tcl_PrintDouble is available to provide this function - in other contexts. Also, the variable "tcl_precision" can be used - to set the precision for printing (must be a decimal number giving - digits of precision). - - Expressions now support transcendental and other functions, e.g. sin, - acos, hypot, ceil, and round. Can add new math functions with - Tcl_CreateMathFunc(). - - Boolean expressions can now have any of the string values accepted - by Tcl_GetBoolean, such as "yes" or "no". -*** POTENTIAL INCOMPATIBILITY *** - -168. 4/5/93 Changed Tcl_UnsetVar and Tcl_UnsetVar2 to return TCL_OK -or TCL_ERROR instead of 0 or -1. -*** POTENTIAL INCOMPATIBILITY *** - -169. 4/5/93 Eliminated Tcl_CmdBuf structure and associated procedures; -can use Tcl_DStrings instead. -*** POTENTIAL INCOMPATIBILITY *** - -170. 4/8/93 Changed interface to Tcl_TildeSubst to use a dynamic -string for buffer space. This makes the procedure re-entrant and -thread-safe, whereas it wasn't before. -*** POTENTIAL INCOMPATIBILITY *** - -171. 4/14/93 Eliminated tclHash.h, and moved everything from it to -tcl.h -*** POTENTIAL INCOMPATIBILITY *** - -172. 4/15/93 Eliminated Tcl_InitHistory, made "history" command always -be part of interpreter. -*** POTENTIAL INCOMPATIBILITY *** - -173. 4/16/93 Modified "file" command so that "readable" option always -exists, even on machines that don't support symbolic links (always returns -same error as if the file wasn't a symbolic link). - -174. 4/26/93 Fixed bugs in "regsub" where ^ patterns didn't get handled -right (pretended not to match when it really did, and looped infinitely -if -all was specified). - -175. 4/29/93 Various improvements in the handling of variables: - - Can create variables and array elements during a read trace. - - Can delete variables during traces (note: unset traces will be - invoked when this happens). - - Can upvar to array elements. - - Can retarget an upvar to another variable by re-issuing the - upvar command with a different "other" variable. - -176. 5/3/93 Added Tcl_GetCommandInfo, which returns info about a Tcl -command such as whether it exists and its ClientData. Also added -Tcl_SetCommandInfo, which allows any of this information to be modified -and also allows a command's delete procedure to have a different -ClientData value than its command procedure. - -177. 5/5/93 Added Tcl_RegExpMatch procedure. - -178. 5/6/93 Fixed bug in "scan" where it didn't properly handle -%% conversion specifiers. Also changed "scan" to use Tcl_PrintDouble -for printing real values. - -179. 5/7/93 Added "-exact", "-glob", and "-regexp" options to "lsearch" -command to allow different kinds of pattern matching. - -180. 5/7/93 Added many new switches to "lsort" to control the sorting -process: "-ascii", "-integer", "-real", "-command", "-increasing", -and "-decreasing". - -181. 5/10/93 Changes to file I/O: - - Modified "open" command to support a list of POSIX access flags - like {WRONLY CREAT TRUNC} in addition to current fopen-style - access modes. Also added "permissions" argument to set permissions - of newly-created files. - - Fixed Scott Bolte's bug (can close stdin etc. in application and - then re-open them with Tcl commands). - - Exported access to Tcl's file table with new procedures Tcl_EnterFile - and Tcl_GetOpenFile. - -182. 5/15/93 Added new "pid" command, which can be used to retrieve -either the current process id or a list of the process ids in a -pipeline opened with "open |..." - -183. 6/3/93 Changed to use GNU autoconfig for configuration instead of -the home-brew "config" script. Also made many other configuration-related -changes, such as using instead of explicitly declaring system -calls in tclUnix.h. - -184. 6/4/93 Fixed bug where core-dumps could occur if a procedure -redefined itself (the memory for the procedure's body could get -reallocated in the middle of evaluating the body); implemented -simple reference count mechanism. - -185. 6/5/93 Changed tclIndex file format in two ways: (a) it's now -eval-ed instead of parsed, which makes it 3-4x faster; (b) the entries -in auto_index are now commands to evaluate, which allows commands to -be loaded in different ways such as dynamic-loading of C code. The -old tclIndex file format is still supported. - -186. 6/7/93 Eliminated tclTest program, added new "tclsh" program -that is more like wish (allows script files to be invoked automatically -using "#!/usr/local/bin/tclsh", makes arguments available to script, -etc.). Added support for Tcl_AppInit plus default version; this -allows new Tcl applications to be created without modifying the -main program for tclsh. - -187. 6/7/93 Fixed bug in TclWordEnd that kept backslash-newline from -working correctly in some cases during interactive input. - -188. 6/9/93 Added Tcl_LinkVar and related procedures, which automatically -keep a Tcl variable in sync with a C variable. - -189. 6/16/93 Increased maximum nesting depth from 100 to 1000. - -190. 6/16/93 Modified "trace var" command so that error messages from -within traces are returned properly as the result of the variable -access, instead of the generic "access disallowed by trace command" -message. - -191. 6/16/93 Added Tcl_CallWhenDeleted to provide callbacks when an -interpreter is deleted (same functionality as Tcl_WatchInterp, which -used to exist in versions before 6.0). - -193. 6/16/93 Added "-code" argument to "return" command; it's there -primarily for completeness, so that procedures implementing control -constructs can reflect exceptional conditions back to their callers. - -194. 6/16/93 Split up Tcl.n to make separate manual entries for each -Tcl command. Tcl.n now contains a summary of the language syntax. - -195. 6/17/93 Added new "switch" command to replace "case": allows -alternate forms of pattern matching (exact, glob, regexp), replaces -pattern lists with single patterns (but you can use "-" bodies to -share one body among several patterns), eliminates "in" noise word. -"Case" command is now obsolete. - -196. 6/17/93 Changed the "exec", "glob", "regexp", and "regsub" commands -to include a "--" switch. All initial arguments starting with "-" are now -treated as switches unless a "--" switch is present to end the list. -*** POTENTIAL INCOMPATIBILITY *** - -197. 6/17/93 Changed auto-exec so that the subprocess gets stdin, stdout, -and stderr from the parent. This allows truly interactive sub-processes -(e.g. vi) to be auto-exec'ed from a tcl shell command line. - -198. 6/18/93 Added patchlevel.h, for use in coordinating future patch -releases, and also added "info patchlevel" command to make the patch -level available to Tcl scripts. - -199. 6/19/93 Modified "glob" command so that a leading "//" in a name -gets left as is (this is needed for systems like Apollos where "//" is -the super-root; Tcl used to collapse the two slashes into a single -slash). - -200. 7/7/93 Added Tcl_SetRecursionLimit procedure so that the maximum -allowable nesting depth can be controlled for an interpreter from C. - ------------------ Released version 7.0 Beta 1, 7/9/93 ------------------ - -201. 7/12/93 Modified Tcl_GetInt and tclExpr.c so that full-precision -unsigned integers can be specified without overflow errors. - -202. 7/12/93 Configuration changes: eliminate leading blank line in -configure script; provide separate targets in Makefile for installing -binary and non-binary information; check for size_t and a few other -potentially missing typedefs; don't put tclAppInit.o into libtcl.a; -better checks for matherr support. - -203. 7/14/93 Changed tclExpr.c to check the termination pointer before -errno after strtod calls, to avoid problems with some versions of -strtod that set errno in unexpected ways. - -204. 7/16/93 Changed "scan" command to be more ANSI-conformant: -eliminated %F, %D, etc., added code to ignore "l", "h", and "L" -modifiers but always convert %e, %f, and %g with implicit "l"; -also added support for %u and %i. Also changed "format" command -to eliminate %D, %U, %O, and add %i. -*** POTENTIAL INCOMPATIBILITY *** - -205. 7/17/93 Changed "uplevel" and "upvar" so that they can be used -from global level to global level: this used to generate an error. - -206. 7/19/93 Renamed "setenv", "putenv", and "unsetenv" procedures -to avoid conflicts with system procedures with the same names. If -you want Tcl's procedures to override the system procedures, do it -in the Makefile (instructions are in the Makefile). -*** POTENTIAL INCOMPATIBILITY *** - ------------------ Released version 7.0 Beta 2, 7/21/93 ------------------ - -207. 7/21/93 Fixed bug in tclVar.c where freed memory was accidentally -used if a procedure returned an element of a local array. - -208. 7/22/93 Fixed bug in "unknown" where it didn't properly handle -errors occurring in the "auto_load" procedure, leaving its state -inconsistent. - -209. 7/23/93 Changed exec's ">2" redirection operator to "2>" for -consistency with sh. This is incompatible with earlier beta releases -of 7.0 but not with pre-7.0 releases, which didn't support either -operator. - -210. 7/28/93 Changed backslash-newline handling so that the resulting -space character *is* treated as a word separator unless the backslash -sequence is in quotes or braces. This is incompatible with 7.0b1 -and 7.0b2 but is more compatible with pre-7.0 versions that the b1 -and b2 releases were. - -211. 7/28/93 Eliminated Tcl_LinkedVarWritable, added TCL_LINK_READ_ONLY to -Tcl_LinkVar to accomplish same purpose. This change is incompatible -with earlier beta releases, but not with releases before Tcl 7.0. - -212. 7/29/93 Renamed regexp C functions so they won't clash with POSIX -regexp functions that use the same name. - -213. 8/3/93 Added "-errorinfo" and "-errorcode" options to "return" -command: these allow for much better handling of the errorInfo -and errorCode variables in some cases. - -214. 8/12/93 Changed "expr" so that % always returns a remainder with -the same sign as the divisor and absolute value smaller than the -divisor. - -215. 8/14/93 Turned off auto-exec in "unknown" unless the command -was typed interactively. This means you must use "exec" when -invoking subprocesses, unless it's a command that's typed interactively. -*** POTENTIAL INCOMPATIBILITY *** - -216. 8/14/93 Added support for tcl_prompt1 and tcl_prompt2 variables -to tclMain.c: makes prompts user-settable. - -217. 8/14/93 Added asynchronous handlers (Tcl_AsyncCreate etc.) so -that signals can be taken cleanly by Tcl applications. - -218. 8/16/93 Moved information about open files from the interpreter -structure to global variables so that a file can be opened in one -interpreter and read or written in another. - -219. 8/16/93 Removed ENV_FLAGS from Makefile, so that there's no -official support for overriding setenv, unsetenv, and putenv. - -220. 8/20/93 Various configuration improvements: coerce chars -to unsigned chars before using macros like isspace; source ~/.tclshrc -file during initialization if it exists and program is running -interactively; allow there to be directories in auto_path that don't -exist or don't have tclIndex files (ignore them); added Tcl_Init -procedure and changed Tcl_AppInit to call it. - -221. 8/21/93 Fixed bug in expr where "+", "-", and " " were all -getting treated as integers with value 0. - -222. 8/26/93 Added "tcl_interactive" variable to tclsh. - -223. 8/27/93 Added procedure Tcl_FilePermissions to return whether a -given file can be read or written or both. Modified Tcl_EnterFile -to take a permissions mask rather than separate read and write arguments. - -224. 8/28/93 Fixed performance bug in "glob" command (unnecessary call -to "access" for each file caused a 5-10x slow-down for big directories). - ------------------ Released version 7.0 Beta 3, 8/28/93 ------------------ - -225. 9/9/93 Renamed regexp.h to tclRegexp.h to avoid conflicts with system -include file by same name. - -226. 9/9/93 Added Tcl_DontCallWhenDeleted. - -227. 9/16/93 Changed not to call exit C procedure directly; instead -always invoke "exit" Tcl command so that application can redefine the -command to do additional cleanup. - -228. 9/17/93 Changed auto-exec to handle names that contain slashes -(i.e. don't use PATH for them). - -229. 9/23/93 Fixed bug in "read" and "gets" commands where they didn't -clear EOF conditions. - ------------------ Released version 7.0, 9/29/93 ------------------ - -230. 10/7/93 "Scan" command wasn't properly aligning things in memory, -so segmentation faults could arise under some circumstances. - -231. 10/7/93 Fixed bug in Tcl_ConvertElement where it forgot to -backslash leading curly brace when creating lists. - -232. 10/7/93 Eliminated dependency of tclMain.c on tclInt.h and -tclUnix.h, so that people can copy the file out of the Tcl source -directory to make modified private versions. - -233. 10/8/93 Fixed bug in auto-loader that reversed the priority order -of entries in auto_path for new-style index files. Now things are -back to the way they were before 3.0: first in auto_path is always -highest priority. - -234. 10/13/93 Fixed bug where Tcl_CommandComplete didn't recognize -comments and treat them as such. Thus if you typed the line - # { -interactively, Tcl would think that the command wasn't complete and -wait for more input before evaluating the script. - -235. 10/14/93 Fixed bug where "regsub" didn't set the output variable -if the input string was empty. - -236. 10/23/93 Fixed bug where Tcl_CreatePipeline didn't close off enough -file descriptors in child processes, causing children not to exit -properly in some cases. - -237. 10/28/93 Changed "list" and "concat" commands not to generate -errors if given zero arguments, but instead to just return an empty -string. - ------------------ Released version 7.1, 11/4/93 ------------------ - -Note: there is no 7.2 release. It was flawed and was thus withdrawn -shortly after it was released. - -238. 11/10/93 TclMain.c didn't compile on some systems because of -R_OK in call to "access". Changed to eliminate call to "access". - ------------------ Released version 7.3, 11/26/93 ------------------ - -239. 11/6/93 Modified "lindex", "linsert", "lrange", and "lreplace" -so that "end" can be specified as an index. - -240. 11/6/93 Modified "append" and "lappend" to allow only two -words total (i.e., nothing to append) without generating an error. - -241. 12/2/93 Changed to use EAGAIN as the errno for non-blocking -I/O instead of EWOULDBLOCK: this should fix problem where non-blocking -I/O didn't work correctly on System-V systems. - -242. 12/22/93 Fixed bug in expressions where cancelled evaluation -wasn't always working correctly (e.g. "set one 1; eval {1 || 1/$one}" -failed with a divide by zero error). - -243. 1/6/94 Changed TCL_VOLATILE definition from -1 to the address of -a dummy procedure Tcl_Volatile, since -1 causes portability problems on -some machines (e.g., Crays). - -244. 2/4/94 Added support for unary plus. - -245. 2/17/94 Changed Tcl_RecordAndEval and "history" command to -call Tcl_GlobalEval instead of Tcl_Eval. Otherwise, invocation of -these facilities in nested procedures can cause unwanted results. - -246. 2/17/94 Fixed bug in tclExpr.c where an expression such as -"expr {"12398712938788234-1298379" != ""}" triggers an integer -overflow error for the number in quotes, even though it isn't really -a proper integer anyway. - -247. 2/19/94 Added new procedure Tcl_DStringGetResult to move result -from interpreter to a dynamic string. - -248. 2/19/94 Fixed bug in Tcl_DStringResult that caused it to overwrite -the contents of a static result in some situations. This can cause -bizarre errors such as variables suddenly having empty values. - -249. 2/21/94 Fixed bug in Tcl_AppendElement, Tcl_DStringAppendElement, -and the "lappend" command that caused improper omission of a separator -space in some cases. For example, the script - set x "abc{"; lappend x "def" -used to return the result "abc{def" instead of "abc{ def". - -250. 3/3/94 Tcl_ConvertElement was outputting empty elements as \0 if -TCL_DONT_USE_BRACES was set. This depends on old pre-7.0 meaning of -\0, which is no longer in effect, so it didn't really work. Changed -to output empty elements as {} always. - -251. 3/3/94 Renamed Tcl_DStringTrunc to Tcl_DStringSetLength and extended -it so that it can be used to lengthen a string as well as shorten it. -Tcl_DStringTrunc is defined as a macro for backward compatibility, but -it is deprecated. - -252. 3/3/94 Added Tcl_AllowExceptions procedure. - -253. 3/13/94 Fixed bug in Tcl_FormatCmd that could cause "format" -to mis-behave on 64-bit Big-Endian machines. - -254. 3/13/94 Changed to use vfork instead of fork on systems where -vfork exists. - -255. 3/23/94 Fixed bug in expressions where ?: didn't associate -right-to-left as they should. - -256. 4/3/94 Fixed "exec" to flush any files used in >@ or >&@ -redirection in exec, so that data buffered for them is written -before any new data added by the subprocess. - -257. 4/3/94 Added "subst" command. - -258. 5/20/94 The tclsh main program is now called Tcl_Main; tclAppInit.c -has a "main" procedure that calls Tcl_Main. This makes it easier to use -Tcl with C++ programs, which need their own main programs, and it also -allows an application to prefilter the argument list before calling -Tcl_Main. -*** POTENTIAL INCOMPATIBILITY *** - -259. 6/6/94 Fixed bug in procedure returns where the errorInfo variable -could get truncated if an unset trace was invoked as part of returning -from the procedure. - -260. 6/13/94 Added "wordstart" and "wordend" options to "string" command. - -261. 6/27/94 Fixed bug in expressions where they didn't properly cancel -the evaluation of math functions in &&, ||, and ?:. - -262. 7/11/94 Incorrect boolean values, like "ogle", weren't being -handled properly. - -263. 7/15/94 Added Tcl_RegExpCompile, Tcl_RegExpExec, and Tcl_RegExpRange, -which provide lower-level access to regular expression pattern matching. - -264. 7/22/94 Fixed bug in "glob" command where "glob -nocomplain ~bad_user" -would complain about a missing user. Now it doesn't complain anymore. - -265. 8/4/94 Fixed bug with linked variables where they didn't behave -correctly when accessed via upvars. - -266. 8/17/94 Fixed bug in Tcl_EvalFile where it didn't clear interp->result. - -267. 8/31/94 Modified "open" command so that errors in exec-ing -subprocesses are returned by the open immediately, rather than -being delayed until the "close" is executed. - -268. 9/9/94 Modified "expr" command to generate errors for integer -overflow (includes addition, subtraction, negation, multiplication, -division). - -269. 9/23/94 Modified "regsub" to return a count of the number of -matches and replacements, rather than 0/1. - -279. 10/4/94 Added new features to "array" command: - - added "get" and "set" commands for easy conversion between arrays - and lists. - - added "exists" command to see if a variable is an array, changed - "names" and "size" commands to treat a non-existent array (or scalar - variable) just like an empty one. - - added pattern option to "names" command. - -280. 10/6/94 Modified Tcl_SetVar2 so that read traces on variables get -called during append operations. - -281. 10/20/94 Fixed bug in "read" command where reading from stdin -required two control-D's to stop the reading. - -282. 11/3/94 Changed "expr" command to use longs for division just like -all other expr operators; it previously used ints for division. - -283. 11/4/94 Fixed bugs in "unknown" procedure: it wasn't properly -handling exception returns from commands that were executed after -being auto-loaded. - ------------------ Released version 7.4b1, 12/23/94 ------------------ - -284. 12/26/94 Fixed "install" target in Makefile (couldn't always -find install program). - -285. 12/26/94 Added strcncasecmp procedure to compat directory. - -286. 1/3/95 Fixed all procedure calls to explicitly cast arguments: -implicit conversions from prototypes (especially integer->double) -don't work when compiling under non-ANSI compilers. Tcl is now clean -under gcc -Wconversion. - -287. 1/4/95 Fixed problem in Tcl_ArrayCmd where same name was used for -both a label and a variable; caused problems on several older compilers, -making array command misbehave and causing many errors in Tcl test suite. - ------------------ Released version 7.4b2, 1/12/95 ------------------ - -288. 2/9/95 Modified Tcl_CreateCommand to return a token, and added -Tcl_GetCommandName procedure. Together, these procedures make it possible -to track renames of a command. - -289. 2/13/95 Fixed bug in expr where "089" was interpreted as a -floating-point number rather than a bogus octal number. -*** POTENTIAL INCOMPATIBILITY *** - -290. 2/14/95 Added code to Tcl_GetInt and Tcl_GetDouble to check for -overflows when reading in numbers. - -291. 2/18/95 Changed "array set" to stop after first error, rather than -continuing after error. - -292. 2/20/95 Upgraded to use autoconf version 2.2. - -293. 2/20/95 Fixed core dump that could occur in "scan" command if a -close bracket was omitted. - -294. 2/27/95 Changed Makefile to always use install-sh for installations: -there's just too much variation among "install" system programs, which -makes installation flakey. - ------------------ Released version 7.4b3, 3/24/95 ------------------ - -3/25/95 (bug fix) Changed "install" to "./install" in Makefile so that -"make install" will work even when "." isn't in the search path. - -3/29/95 (bug fix) Fixed bug where the auto-loading mechanism wasn't -protecting the values of the errorCode and errorInfo variables. - -3/29/95 (new feature) Added optional pattern argument to "parray" procedure. - -3/29/95 (bug fix) Made the full functionality of - "return -code ... -errorcode ..." -work not just inside procedures, but also in sourced files and at -top level. - -4/6/95 (new feature) Added "pattern" option to "array names" command. - -4/18/95 (bug fix) Fixed bug in parser where it didn't allow backslash-newline -immediately after an argument in braces or quotes. - -4/19/95 (new feature) Added tcl_library variable, which application can -set to override default library directory. - -4/30/95 (bug fix) During trace callbacks for array elements, the variable -name used in the original reference would be temporarily modified to -separate the array name and element name; if the trace callback used -the same name string, it would get the wrong name (the array name without -element). Fixed to restore the variable name before making trace -callbacks. - -4/30/95 (new feature) Added -nobackslashes, -nocommands, and -novariables -switches to "subst" command. - -5/4/95 (new feature) Added TCL_EVAL_GLOBAL flag to Tcl_RecordAndEval. - -5/5/95 (bug fix) Format command would overrun memory when printing -integers with very large precision, as in "format %.1000d 0". - -5/5/95 (portability improvement) Changed to use BSDgettimeofday on -IRIX machines, to avoid compilation problems with the gettimeofday -declaration. - -5/6/95 (bug fix) Changed manual entries to use the standard .TH -macro instead of a custom .HS macro; the .HS macro confuses index -generators like makewhatis. - -5/9/95 (bug fix) Modified configure script to check for Solaris bug -that makes vfork unreliable (core dumps result if vforked child -changes a signal handler); will use fork instead of vfork if the -bug is present. - -6/5/95 (bug fix) Modified "lsort" command to disallow recursive calls -to lsort from a comparison function. This is needed because qsort -is not reentrant. - -6/5/95 (bug fix) Undid change 243 above: changed TCL_VOLATILE and -TCL_DYNAMIC back to integer constants rather than procedure addresses. -This was needed because procedure addresses can have multiple values -under some dynamic loading systems (e.g. SunOS 4.1 and Windows). - -6/8/95 (feature change) Modified interface to Tcl_Main to pass in the -address of the application-specific initialization procedure. -Tcl_AppInit is no longer hardwired into Tcl_Main. This is needed -in order to make Tcl a shared library. - -6/8/95 (feature change) Modified Makefile so that the installed versions -of tclsh and libtcl.a have version number in them (e.g. tclsh7.4 and -libtcl7.4.a) and the library directory name also has an embedded version -number (e.g., /usr/local/lib/tcl7.4). This should make it easier for -Tcl 7.4 to coexist with earlier versions. - ------------------ Released version 7.4b4, 6/16/95 ------------------ - -6/19/95 (bug fix) Fixed bugs in tclCkalloc.c that caused core dumps -if TCL_MEM_DEBUG was enabled on word-addressed machines such as Crays. - -6/21/95 (feature removal) Removed overflow checks for integer arithmetic: -they just cause too much trouble (e.g. for random number generators). - -6/28/95 (new features) Added tcl_patchLevel and tcl_version variables, -for consistency with Tk. - -6/29/95 (bug fix) Fixed problem in Tcl_Eval where it didn't record -the right termination character if a script ended with a comment. This -caused erroneous output for the following command, among others: -puts "[ -expr 1+1 -# duh! -]" - -6/29/95 (message change) Changed the error message for ECHILD slightly -to provide a hint about why the problem is occurring. - ------------------ Released version 7.4, 7/1/95 ------------------ - -7/18/95 (bug fix) Changed "lreplace" so that nothing is deleted if -the last index is less than the first index or if the last index -is < 0. - -7/18/95 (bug fix) Fixed bugs with backslashes in comments: -Tcl_CommandComplete (and "info complete") didn't properly handle -strings ending in backslash-newline, and neither Tcl_CommandComplete -nor the Tcl parser handled other backslash sequences right, such -as two backslashes before a newline. - -7/19/95 (bug fix) Modified Tcl_DeleteCommand to delete the hash table -entry for the command before invoking its callback. This is needed in -order to deal with reentrancy. - -7/22/95 (bug fix) "exec" wasn't reaping processes correctly after -certain errors (e.g. if the name of the executable was bogus, as -in "exec foobar"). - -7/27/95 (bug fix) Makefile.in wasn't using the LIBS variable provided -by the "configure" script. This caused problems on some SCO systems. - -7/27/95 (bug fix) The version of strtod in fixstrtod.c didn't properly -handle the case where endPtr == NULL. - ------------------ Released patch 7.4p1, 7/29/95 ----------------------- - -8/4/95 (bug fix) C-level trace callbacks for variables were sometimes -receiving the PART1_NOT_PARSED flag, which could cause errors in -subsequent Tcl library calls using the flags. (JO) - -8/4/95 (bug fix) Calls to toupper and tolower weren't using the -UCHAR macros, which caused trouble in non-U.S. locales. (JO) - -8/10/95 (new feature) Added the "load" command for dynamic loading of -binary packages, and the Tcl_PackageInitProc prototype for package -initialization procedures. (JO) - -8/23/95 (new features) Added "info sharedlibextension" and -"info nameofexecutable" commands, plus Tcl_FindExtension procedure. (JO) - -8/25/95 (bug fix) If the target of an "upvar" was non-existent but -had traces set, the traces were silently lost. Change to generate -an error instead. (JO) - -8/25/95 (bug fix) Undid change from 7/19, so that commands can stay -around while their deletion callbacks execute. Added lots of code to -handle all of the reentrancy problems that this opens up. (JO) - -8/25/95 (bug fix) Fixed core dump that could occur in TclDeleteVars -if there was an upvar from one entry in the table to the next entry -in the same table. (JO) - -8/28/95 (bug fix) Exec wasn't handling bad user names properly, as -in "exec ~bogus_user/foo". (JO) - -8/29/95 (bug fixes) Changed backslash-newline handling to correct two -problems: - - Only spaces and tabs following the backslash-newline are now - absorbed as part of the backslash-newline. Newlinew are no - longer absorbed (add another backslash if you want to absorb - another newline). - - TclWordEnd returns the character just before the backslash in - the sequence as the end of the sequence; it used to not consider - the backslash-newline as a word separator. (JO) - -8/31/95 (new feature) Changed man page installation (with "mkLinks" -script) to create additional links for manual pages corresponding to -each of the procedure and command names described in the pages. (JO) - -9/10/95 Reorganized Tcl sources for Windows and Mac ports. All sources -are now in subdirectories: "generic" contains sources that work on all -platforms, "windows", "mac", and "unix" directories contain platform- -specific sources. Some UNIX sources are also used on other platforms. (SS) - -9/10/95 (feature change) Eliminated exported global variables (they -don't work with Windows DLLs). Replaced tcl_AsyncReady and -tcl_FileCloseProc with procedures Tcl_AsyncReady() and -Tcl_SetFileCloseProc(). Replaced C variable tcl_RcFileName with -a Tcl variable tcl_rcFileName. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -9/11/95 (new feature) Added procedure Tcl_SetPanicProc to override -the default implementation of "panic". (SS) - -9/11/95 (new feature) Added "interp" command to allow creation of -new interpreters and execution of untrusted scripts. Added many new -procedures, such as Tcl_CreateSlave, Tcl_CreateAlias,and Tcl_MakeSafe, -to provide C-level access to the interpreter facility. This mechanism -now provides almost all of the generic functions of Borenstein's and -Rose's Safe-Tcl (but not any Tk or email-related stuff). (JL) - -9/11/95 (feature change) Changed file management so that files are -no longer shared between interpreters: a file cannot normally be -referenced in one interpreter if it was opened in another. This -feature is needed to support safe interpreters. Added Tcl_ShareHandle() -procedure for allowing files to be shared, and added "interp" argument -to Tcl_FilePermissions procedure. (JL) -*** POTENTIAL INCOMPATIBILITY *** - -9/11/95 (new feature) Added "AssocData" mechanism, whereby extensions -can associate their own data with an interpreter and get called back -when the interpreter is deleted. This is visible at C level via the -procedures Tcl_SetAssocData and Tcl_GetAssocData. (JL) - -9/11/95 (new feature) Added Tcl_ErrnoMsg to translate an errno value -into a human-readable string. This is now used instead of calling -strerror because strerror mesages vary dramatically from platform -to platform, which messes up Tcl tests. Tcl_ErrnoMsg uses the standard -POSIX messages for all the common signals, and calls strerror for -signals it doesn't understand. - ------------------ Released patch 7.5p2, 9/15/95 ----------------------- - ------------------ Released 7.5a1, 9/15/95 ----------------------- - -9/22/95 (bug fix) Changed auto_mkindex to create tclIndex files that -handle directories whose paths might contain spaces. (RJ) - -9/27/95 (bug fix) The "format" command didn't check for huge or negative -width specifiers, which could cause core dumps. (JO) - -9/27/95 (bug fix) Core dumps could occur if an interactive command typed -to tclsh returned a very long result for tclsh to print out. The bug is -actually in printf (in Solaris 2.3 and 2.4, at least); switched to use -puts instead. (JO) - -9/28/95 (bug fix) Changed makefile.bc to eliminate a false dependency -for tcl1675.dll on the Borland run time library. (SS) - -9/28/95 (bug fix) Fixed tcl75.dll so it looks for tcl1675.dll instead -of tcl16.dll. (SS) - -9/28/95 (bug fix) Tcl was not correctly detecting the difference -between Win32s and Windows '95. (SS) - -9/28/95 (bug fix) "exec" was not passing environment changes to child -processes under Windows. (SS) - -9/28/95 (bug fix) Changed Tcl to ensure that open files are not passed -to child processes under Windows. (SS) - -9/28/95 (bug fix) Fixed Windows '95 and NT versions of exec so it can -handle both console and windows apps. (SS) - -9/28/95 (bug fix) Fixed Windows version of exec so it no longer leaves -temp files lying around. Also changed it so the temp files are -created in the appropriate system dependent temp directory. (SS) - -9/28/95 (bug fix) Eliminated source dependency on the Win32s Universal -Thunk header file, since it is not bundled with VC++. (SS) - -9/28/95 (bug fix) Under Windows, Tcl now constructs the HOME -environment variable from HOMEPATH and HOMEDRIVE when HOME is not -already set. (SS) - -9/28/95 (bug fix) Added support for "info nameofexecutable" and "info -sharedlibextension" to the Windows version. (SS) - -9/28/95 (bug fix) Changed tclsh to correctly parse command line -arguments so that backslashes are preserved under Windows. (SS) - -9/29/95 (bug fix) Tcl 7.5a1 treated either return or newline as end -of line in "gets", which caused lines ending in CRLF to be treated as -two separate lines. Changed to allow only character as end-of-line: -carriage return on Macs, newline elsewhere. (JO) - -9/29/95 (new feature) Changed to install "configInfo" file in same -directory as library scripts. It didn't used to get installed. (JO) - -9/29/95 (bug fix) Tcl was not converting Win32 errors into POSIX -errors under some circumstances. (SS) - -10/2/95 (bug fix) Safe interpreters no longer get initialized with -a call to Tcl_Init(). (JL) - -10/1/95 (new feature) Added "tcl_platform" global variable to provide -environment information such as the instruction set and operating -system. (JO) - -10/1/95 (bug fix) "exec" command wasn't always generating the -"child process exited abnormally" message when it should have. (JO) - -10/2/95 (bug fix) Changed "mkLinks.tcl" so that the scripts it generates -won't create links that overwrite original manual entries (there was -a problem where pack-old.n was overwriting pack.n). (JO) - -10/2/95 (feature change) Changed to use -ldl for dynamic loading under -Linux if it is available, but fall back to -ldld if it isn't. (JO) - -10/2/95 (bug fix) File sharing was causing refcounts to reach 0 -prematurely for stdin, stdout and stderr, under some circumstances. (JL) - -10/2/95 (platform support) Added support for Visual C++ compiler on -Windows, Windows '95 and Windows NT, code donated by Gordon Chaffee. (JL) - -10/3/95 (bug fix) Tcl now frees any libraries that it loads before it -exits. (SS) - -10/03/95 (bug fix) Fixed bug in Macintosh ls command where the -l -and -C options would fail in anything but the HOME directory. (RJ) - ------------------ Released 7.5a2, 10/6/95 ----------------------- - -10/10/95 (bug fix) "file dirnam /." was returning ":" on UNIX instead -of "/". (JO) - -10/13/95 (bug fix) Eliminated dependency on MKS toolkit for generating -the tcl.def file from Borland object files. (SS) - -10/17/95 (new features) Moved the event loop from Tcl to Tk, made major -revisions along the way: - - New Tcl commands: after, update, vwait (replaces "tkwait variable"). - - "tkerror" is now replaced with "bgerror". - - The following procedures are similar to their old Tk counterparts: - Tcl_DoOneEvent, Tcl_Sleep, Tcl_DoWhenIdle, Tcl_CancelIdleCall, - Tcl_CreateFileHandler, Tcl_DeleteFileHandler, Tcl_CreateTimerHandler, - Tcl_DeleteTimerHandler, Tcl_BackgroundError. - - Revised notifier, add new concept of "event source" with the following - procedures: Tcl_CreateEventSource, Tcl_DeleteEventSource, - Tcl_WatchFile, Tcl_SetMaxBlockTime, Tcl_FileReady, Tcl_QueueEvent, - Tcl_WaitForEvent. (JO) - -10/31/95 (new features) Implemented cross platform file name support to make -it easier to write cross platform scripts. Tcl now understands 4 file naming -conventions: Windows (both DOS and UNC), Mac, Unix, and Network. The network -convention is a new naming mechanism that can be used to paths in a platform -independent fashion. See the "file" command manual page for more details. -The primary interfaces changes are: - - All Tcl commands that expect a file name now accept both network and - native form. - - Two new "file" subcommands, "nativename" and "networkname", provide a - way to convert between network and native form. - - Renamed Tcl_TildeSubst to Tcl_TranslateFileName, and changed it so that - it always returns a filename in native form. Tcl_TildeSubst is defined - as a macro for backward compatibility, but it is deprecated. (SS) - -11/5/95 (new feature) Made "tkerror" and "bgerror" synonyms, so that -either name can be used to manipulate the command (provides temporary -backward compatibility for existing scripts that use tkerror). (JO) - -11/5/95 (new feature) Added exit handlers and new C procedures -Tcl_CreateExitHandler, Tcl_DeleteExitHandler, and Tcl_Exit. (JO) - -11/6/95 (new feature) Added pid command for Macintosh version of -Tcl (it didn't previously exist on the Mac). (RJ) - -11/7/95 (new feature) New generic IO facility and support for IO to -files, pipes and sockets based on a common buffering scheme. Support -for asynchronous (non-blocking) IO and for event driver IO. Support -for automatic (background) asynchronous flushing and asynchronous -closing of channels. (JL) - -11/7/95 (new feature) Added new commands "fconfigure" and "fblocked" -to support new I/O features such as nonblocking I/O. Added "socket" -command for creating TCP client and server sockets. (JL). - -11/7/95 (new feature) Complete set of C APIs to the new generic IO -facility: - - Opening channels: Tcl_OpenFileChannel, Tcl_OpenCommandChannel, - Tcl_OpenTcpClient, Tcl_OpenTcpServer. - - I/O procedures on channels, which roughly mirror the ANSI C stdio - library: Tcl_Read, Tcl_Gets, Tcl_Write, Tcl_Flush, Tcl_Seek, - Tcl_Tell, Tcl_Close, Tcl_Eof, Tcl_InputBlocked, Tcl_GetChannelOption, - Tcl_SetChannelOption. - - Extension mechanism for creating new kinds of channels: - Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, - Tcl_GetChannelName, Tcl_GetChannelFile, Tcl_RegisterChannel, - Tcl_UnregisterChannel, Tcl_GetChannel. - - Event-driven I/O on channels: Tcl_CreateChannelHandler, - Tcl_DeleteChannelHandler. (JL) - -11/7/95 (new feature) Channel driver interface specification to allow -new types of channels to be added easily to Tcl. Currently being used -in three drivers - for files, pipes and TCP-based sockets. (JL). - -11/7/95 (new feature) interp delete now takes any number of path -names of interpreters to delete, including zero. (JL). - -11/8/95 (new feature) implemented 'info hostname' and Tcl_GetHostName -command to get host name of machine on which the Tcl process is running. (JL) - -11/9/95 (new feature) Implemented file APIs for access to low level files -on each system. The APIs are: Tcl_CloseFile, Tcl_OpenFile, Tcl_ReadFile, -Tcl_WriteFile and Tcl_SeekFile. Also implemented Tcl_WaitPid which waits -in a system dependent manner for a child process. (JL) - -11/9/95 (new feature) Added Tcl_UpdateLinkedVar procedure to force a -Tcl variable to be updated after its C variable changes. (JO) - -11/9/95 (bug fix) The glob command has been totally reimplemented so -that it can support different file name conventions. It now handles -Windows file names (both UNC and drive-relative) properly. It also -supports nested braces correctly now. (SS) - -11/13/95 (bug fix) Fixed Makefile.in so that configure can be run -from a clean directory separate from the Tcl source tree, and compilations -can be performed there. (JO) - -11/14/95 (bug fix) Fixed file sharing between interpreters and file -transferring between interpreters to correctly manage the refcount so that -files are closed when the last reference to them is discarded. (JL) - -11/14/95 (bug fix) Fixed gettimeofday implementation for the -Macintosh. This fixes several timing related bugs. (RJ) - -11/17/95 (new feature) Added missing support for info nameofexecutable -on the Macintosh. (RJ) - -11/17/95 (bug fix) The Tcl variables argc argv and argv0 now return -something reasonable on the Mac. (RJ) - -11/22/95 (new feature) Implemented "auto-detect" mode for end of line -translations. On input, standalone "\r" mean MAC mode, standalone "\n" -mean Unix mode and "\r\n" means Windows mode. On output, the mode is -modified to whatever the platform specific mode for that platform is. (JL) - -11/24/95 (feature change) Replaced "configInfo" file with tclConfig.sh, -which is more complete and uses slightly different names. Also -arranged for tclConfig.sh to be installed in the platform-specific -library directory instead of Tcl's script library directory. (JO) -*** POTENTIAL INCOMPATIBILITY with Tcl 7.5a2, but not with Tcl 7.4 *** - ------------------ Released patch 7.4p3, 11/28/95 ----------------------- - -12/5/95 (new feature) Added Tcl_File facility to support platform- -independent file handles. Changed all interfaces that used Unix- -style integer fd's to use Tcl_File's instead. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -12/5/95 (new feature) Added a new "clock" command to Tcl. The command -allows you to get the current "clicks" or seconds & allows you to -format or scan human readable time/date strings. (RJ) - -12/18/95 (new feature) Moved Tk_Preserve, Tk_Release, and Tk_EventuallyFree -to Tcl, renamed to Tcl_Preserve, Tcl_Release, and Tcl_EventuallyFree. (JO) - -12/18/95 (new feature) Added new "package" command and associated -procedures Tcl_PkgRequire and Tcl_PkgProvide. Also wrote -pkg_mkIndex library procedure to create index files from binaries -and scripts. (JO) - -12/20/95 (new feature) Added Tcl_WaitForFile procedure. (JO) - -12/21/95 (new features) Made package name argument to "load" optional -(Tcl will now attempt to guess the package name if necessary). Also -added Tcl_StaticPackage and support in "load" for statically linked -packages. (JO) - -12/22/95 (new feature) Upgraded the foreach command to accept multiple -loop variables and multiple value lists. This lets you iterate over -multiple lists in parallel, and/or assign multiple loop variables from -one value list during each iteration. The only potential compatibility -problem is with scripts that used loop variables with a name that could be -construed to be a list of variable names (i.e. contained spaces). (BW) - -1/5/96 (new feature) Changed tclsh so it builds as a console mode -application under Windows. Now tclsh can be used from the command -line with pipes or interactively. Note that this only works under -Windows 95 or NT. (SS) - -1/17/96 (new feature) Modified Makefile and configure script to allow -Tcl to be compiled as a shared library: use the --enable-shared option -when configuing. (JO) - -1/17/96 (removed obsolete features) Removed the procedures Tcl_EnterFile -and Tcl_GetOpenFile: these no longer make sense with the new I/O system. (JL) -*** POTENTIAL INCOMPATIBILITY *** - -1/19/96 (bug fixes) Prevented formation of circular aliases, through the -Tcl 'interp alias' command and through the 'rename' command, as well as -through the C API Tcl_CreateAlias. (JL) - -1/19/96 (bug fixes) Fixed several bugs in direct deletion of interpreters -with Tcl_DeleteInterp when the interpreter is a slave; fixes based on a -patch received from Viktor Dukhovni of ESM. (JL) - -1/19/96 (new feature) Implemented on-close handlers for channels; added -the C APIs Tcl_CreateCloseHandler and Tcl_DeleteCloseHandler. (JL) - -1/19/96 (new feature) Implemented portable error reporting mechanism; added -the C APIs Tcl_SetErrno and Tcl_GetErrno. (JL) - -1/24/96 (bug fix) Unknown command processing properly invokes external -commands under Windows NT and Windows '95 now. (SS) - -1/23/96 (bug fix) Eliminated extremely long startup times under Windows '95. -The problem was a result of the option database initialization code that -concatenated $HOME with /.Xdefaults, resulting in a // in the middle of the -file name. Under Windows '95, this is incorrectly interpreted as a UNC -path. They delays came from the network timeouts needed to determine that -the file name was invalid. Tcl_TranslateFileName now suppresses duplicate -slashes that aren't at the beginning of the file name. (SS) - -1/25/96 (bug fix) Changed exec and open to create children so they are -attached to the application's console if it exists. (SS) - -1/31/96 (bug fix) Fixed command line parsing to handle embedded -spaces under Windows. (SS) - ------------------ Released 7.5b1, 2/1/96 ----------------------- - -2/7/96 (bug fix) Fixed off by one error in argument parsing code under -Windows. (SS) - -2/7/96 (bug fix) Fixed bugs in VC++ makefile that improperly -initialized the tcl75.dll. Fixed bugs in Borland makefile that caused -build failures under Windows NT. (SS) - -2/9/96 (bug fix) Fixed deadlock problem in AUTO end of line translation -mode which would cause a socket server with several concurrent clients -writing in CRLF mode to hang. (JL) - -2/9/96 (API change) Replaced -linemode option to fconfigure with a -new -buffering option, added "none" setting to enable immediate write. (JL) -*** INCOMPATIBILITY with b1 *** - -2/9/96 (new feature) Added C API Tcl_InputBuffered which returns the count -of bytes currently buffered in the input buffer of a channel, and o for -output only channels. (JL) - -2/9/96 (new feature) Implemented asynchronous connect for sockets. (JL) - -2/9/96 (new feature) Added C API Tcl_SetDefaultTranslation to set (per -channel) the default end of line translation mode. This is the mode that -will be installed if an output operation is done on the channel while it is -still in AUTO mode. (JL) - -2/9/96 (bug fix) Changed Tcl_OpenCommandChannel interface to properly -handle all of the combinations of stdio inheritance in background -pipelines. See the Tcl_OpenFileChannel(3) man page for more -info. This change fixes the bug where exec of a background pipeline -was not getting passed the stdio handles properly. (SS) - -2/9/96 (bug fix) Removed the new Tcl_CreatePipeline interface, and -restored the old version for Unix platforms only. All new code should -use Tcl_CreateCommandChannel instead. (SS) - -2/9/96 (bug fix) Changed Makefile.in to use -L and -ltcl7.5 for Tcl -library so that shared libraries are more likely to be found correctly -on more platforms. (JO) - -2/13/96 (new feature) Added C API Tcl_SetNotifierData and -Tcl_GetNotifierData to allow notifier and channel driver writers to -associate data with a Tcl_File. The result of this change is that -Tcl_GetFileInfo now always returns an OS file handle, and Tcl_GetFile -can be used to construct a Tcl_File for an externally constructed OS -handle. (SS) - -2/13/96 (bug fix) Changed Windows socket implementation so it doesn't -set SO_REUSEADDR on server sockets. Now attempts to create a server -socket on a port that is already in use will be properly identified -and an error will be generated. (SS) - -2/13/96 (bug fix) Fixed problems with DLL initialization under Visual -C++ that left the C run time library uninitialized. (SS) - -2/13/96 (bug fix) Fixed Windows socket initialization so it loads -winsock the first time it is used, rather than at the time tcl75.dll -is loaded. This should fix the bug where the modem immediately starts -trying to connect to a service provider when wish or tclsh are -started. (SS) - -2/13/96 (new feature) Added C APIs Tcl_MakeFileChannel and -Tcl_MakeTcpClientChannel to wrap up existing fds and sockets into -channels. Provided implementations on Unix and Windows. (JL) - -2/13/96 (bug fix) Fixed bug with seek leaving EOF and BLOCKING set. (JL) - -2/14/96 (bug fix) Fixed reentrancy problem in fileevent handling -and made it more robust in the face of errors. (JL) - -2/14/96 (feature change) Made generic IO level emulate blocking mode if the -channel driver is unable to provide it, e.g. if the low level device is -always nonblocking. Thus, now blocking behavior is an advisory setting for -channel drivers and can be ignored safely if the channel driver is unable -to provide it. (JL) - -2/15/96 (new feature) Added "binary" end of line translation mode, which is -a synonym of "lf" mode. (JL) - -2/15/96 (bug fix) Fixed reentrancy problem in fileevent handling vs -deletion of channel event handlers. (JL) - -2/15/96 (bug fix) Fixed bug in event handling which would cause a -nonblocking channel to not see further readable events after the first -readable event that had insufficient input. (JL) - -2/17/96 (bug fix) "info complete" didn't properly handle comments -in nested commands. (JO) - -2/21/96 (bug fix) "exec" under Windows NT/95 did not properly handle -very long command lines (>200 chars). (SS) - -2/21/96 (bug fix) Sockets could get into an infinite loop if a read -event arrived after all of the available data had been read. (SS) - -2/22/96 (bug fix) Added cast of st_size elements to (long) before -sprintf-ing in "file size" command. This is needed to handle systems -like NetBSD with 64-bit file offsets. (JO) - ------------------ Released 7.5b2, 2/23/96 ----------------------- - -2/23/96 (bug fix) TCL_VARARGS macro in tcl.h wasn't defined properly -when compiling with C++. (JO) - -2/24/96 (bug fix) Removed dependencies on Makefile in the UNIX Makefile: -this caused problems on some platforms (like Linux?). (JO) - -2/24/96 (bug fix) Fixed configuration bug that made Tcl not compile -correctly on Linux machines with neither -ldl or -ldld. (JO) - -2/24/96 (new feature) Added a block of comments and definitions to -Makefile.in to make it easier to have Tcl's TclSetEnv etc. replace -the library procedures setenv etc, so that calls to setenv etc. in -the application automatically update the Tcl "env" variable. (JO) - -2/27/96 (feature change) Added optional Tcl_Interp * argument (may be NULL) -to C API Tcl_Close and simplified closing of command channels. (JL) -*** INCOMPATIBILITY with Tcl 7.5b2, but not with Tcl 7.4 *** - -2/27/96 (feature change) Added optional Tcl_Interp * argument (may be NULL) -to C type definition Tcl_DriverCloseProc; modified all channel drivers to -implement close procedures that accept the additional argument. (JL) -*** INCOMPATIBILITY with Tcl 7.5b2, but not with Tcl 7.4 *** - -2/28/96 (bug fix) Fixed memory leak that could occur if an upvar -referred to an element of an array in the same stack frame as the -upvar. (JO) - -2/29/96 (feature change) Modified both Tcl_DoOneEvent and Tcl_WaitForEvent -so that they return immediately in cases where they would otherwise -block forever (e.g. if there are no event handlers of any sort). (JO) - -2/29/96 (new feature) Added C APIs Tcl_GetChannelBufferSize and -Tcl_SetChannelBufferSize to set and retrieve the size, in bytes, for -buffers allocated to store input or output in a channel. (JL) - -2/29/96 (new feature) Added option -buffersize to Tcl fconfigure command -to allow Tcl scripts to query and set the size of channel buffers. (JL) - -2/29/96 (feature removed) Removed channel driver function to specify -the buffer size to use when allocating a buffer. Removed the C typedef -for Tcl_DriverBufferSizeProc. Channels are now created with a default -buffer size of 4K. (JL) -*** INCOMPATIBILITY with Tcl 7.5b2, but not with Tcl 7.4 *** - -2/29/96 (feature change) The channel driver function for setting blocking -mode on the device may now be NULL. If the generic code detects that the -function is NULL, operations that set the blocking mode on the channel -simply succeed. (JL) - -3/2/96 (bug fix) Fixed core dump that could occur if a syntax error -(such as missing close paren) occurred in an array reference with a -very long array name. (JO) - -3/4/96 (bug fix) Removed code in the "auto_load" procedure that deletes -all existing auto-load information whenever the "auto_path" variable -is changed. Instead, new information adds to what was already there. -Otherwise, changing the "auto_path" variable causes all package- -related information to be lost. If you really want to get rid of -existing auto-load information, use auto_reset before setting auto_path. (JO) - -3/5/96 (new feature) Added version suffix to shared library names so that -Tcl will compile under NetBSD and FreeBSD (I hope). (JO) - -3/6/96 (bug fix) Cleaned up error messages in new I/O system to correspond -more closely to old I/O system. (JO) - -3/6/96 (new feature) Added -myaddr and -myport options to the socket -command, removed -tcp and -- options. This lets clients and servers -choose a particular interface. Also changed the default server address -from the hostname to INADDR_ANY. The server accept callback now gets -passed the client's port as well as IP address. The C interfaces for -Tcl_OpenTcpClient and Tcl_OpenTcpServer have changed to support the -above changes. (BW) -*** POTENTIAL INCOMPATIBILITY with Tcl 7.5b2, but not with Tcl 7.4 *** - -3/6/96 (changed feature) The library function auto_mkindex will now -default to using the pattern "*.tcl" if no pattern is given. (RJ) - -3/6/96 (bug fix) The socket channel code for the Macintosh has been -rewritten to use native MacTcp. (RJ) - -3/7/96 (new feature) Added Tcl_SetStdChannel and Tcl_GetStdChannel -interfaces to allow applications to explicitly set and get the global -standard channels. (SS) - -3/7/96 (bug fix) Tcl did close not the file descriptors associated -with "stdout", etc. when the corresponding channels were closed. (SS) - -3/7/96 (bug fix) Reworked shared library and dynamic loading stuff to -try to get it working under AIX. Added new @SHLIB_LD_LIBS@ autoconf -symbol as part of this. AIX probably doesn't work yet, but it should -be a lot closer. (JO) - -3/7/96 (feature change) Added Tcl_ChannelProc typedef and changed the -signature of Tcl_CreateChannelHandler and Tcl_DeleteChannelHandler to take -Tcl_ChannelProc arguments instead of Tcl_FileProc arguments. This change -should not affect any code outside Tcl because the signatures of -Tcl_ChannelProc and Tcl_FileProc are compatible. (JL) - -3/7/96 (API change) Modified signature of Tcl_GetChannelOption to return -an int instead of char *, and to take a Tcl_DString * argument. Modified -the implementation so that the option name can be NULL, to mean that the -call should retrieve a list of alternating option names and values. (JL) -*** INCOMPATIBILITY with Tcl 7.5b2, but not with Tcl 7.4 *** - -3/7/96 (API change) Added Tcl_DriverSetOptionProc, Tcl_DriverGetOptionProc -typedefs, added two slots setOptionProc and getOptionProc to the channel -type structure. These may be NULL to indicate that the channel type does -not support any options. (JL) -*** INCOMPATIBILITY with Tcl 7.5b2, but not with Tcl 7.4 *** - -3/7/96 (feature change) stdin, stdout and stderr can now be put into -nonblocking mode. (JL) - -3/8/96 (feature change) Eliminated dependence on the registry for -finding the Tcl library files. (SS) - ------------------ Released 7.5b3, 3/8/96 ----------------------- - -3/12/96 (feature improvement) Modified startup script to look in several -different places for the Tcl library directory. This should allow Tcl -to find the libraries under all but the weirdest conditions, even without -the TCL_LIBRARY environment variable being set. (JO) - -3/13/96 (bug fix) Eliminated use of the "linger" option from the Windows -socket implementation. (JL) - -3/13/96 (new feature) Added -peername and -sockname options for fconfigure -for socket channels. Code contributed by John Haxby of HP. (JL) - -3/13/96 (bug fix) Fixed panic and core dump that would occur if the accept -callback script on a server socket encountered an error. (JL) - -3/13/96 (feature change) Added -async option to the Tcl socket command. -If the command is creating a client socket and the flag is present, the -client is connected asynchronously. If the option is absent (the default), -the client socket is connected synchronously, and the command returns only -when the connection has been completed or failed. This change was suggested -by Mark Diekhans. (JL) - -3/13/96 (feature change) Modified the signature of Tcl_OpenTcpClient to -take an additional int argument, async. If nonzero, the client is connected -to the server asynchronously. If the value is zero, the connection is made -synchronously, and the call to Tcl_OpenTcpClient returns only when the -connection fails or succeeds. This change was suggested by Mark Diekhans. (JL) -*** INCOMPATIBILITY with Tcl 7.5b3, but not with Tcl 7.4 *** - -3/14/96 (bug fix) "tclsh bogus_file_name" didn't print an error message. (JO) - -3/14/96 (bug fix) Added new procedures to tclCkalloc.c so that libraries -and applications can be compiled with TCL_MEM_DEBUG even if Tcl isn't -(however, the converse is still not true). Patches provided by Jan -Nijtmans. (JO) - -3/15/96 (bug fix) Marked standard IO handles of a process as close-on-exec -to fix bug in Ultrix where exec was not sharing standard IO handles with -subprocesses. Fix suggested by Mark Diekhans. (JL) - -3/15/96 (bug fix) Fixed asynchronous close mechanism so that it closes the -channel instead of leaking system resources. The manifestation was that Tcl -would eventually run out of file descriptors if it was handling a large -number of nonblocking sockets or pipes with high congestion. (JL) - -3/15/96 (bug fix) Fixed tests so that they no longer leak file descriptors. -The manifestation was that Tcl would eventually run out of file descriptors -if the tests were rerun many times (> a hundred times on Solaris). (JL) - -3/15/96 (bug fix) Fixed channel creation code so that it never creates -unnamed channels. This would cause a panic and core dump when the channel -was closed. (JL) - -3/16/96 (bug fixes) Made lots of changes in configuration stuff to get -Tcl working under AIX (finally). Tcl should now support the "load" -command under AIX and should work either with or without shared -libraries for Tcl and Tk. (JO) - -3/21/96 (configuration improvement) Changed configure script so it -doesn't use version numbers (as in -ltcl7.5 and libtcl7.5.so) under -SunOS 4.1, where they don't work anyway. (JO) - -3/22/96 (new feature) Added C API Tcl_InterpDeleted that allows extension -writers to discover when an interpreter is being deleted. (JL) - -3/22/96 (bug fix) The standard IO channels are now added to each -trusted interpreter as soon as the interpreter is created. This ensures -against the bug where a child would do IO before the master had done any, -and then the child is destroyed - the standard IO channels would be then -closed and the master would be unable to do any IO. (JL) - -3/22/96 (bug fix) Made Tcl more robust against interpreter deletion, by -using Tcl_Preserve, Tcl_Release and Tcl_EventuallyFree to split the process -of interpreter deletion into two distinct phases. Also went through all of -Tcl and added calls to Tcl_Preserve and Tcl_Delete where needed. (JL) - -3/22/96 (bug fix) Fixed several places where C code was reading and writing -into freed memory, especially during interpreter deletion. (JL) - -3/22/96 (bug fix) Fixed very deep bug in Tcl_Release that caused memory to -be freed twice if the release callback did Tcl_Preserve and Tcl_Release on -the same memory as the chunk currently being freed. (JL) - -3/22/96 (bug fix) Removed several memory leaks that would cause memory -buildup on half-K chunks in the generic IO level. (JL) - -3/22/96 (bug fix) Fixed several core dumps which occurred when new -AssocData was being created during the cleanups in interpreter deletion. -The solution implemented now is to loop repeatedly over the AssocData until -none is left to clean up. (JL) - -3/22/96 (bug fix) Fixed a bug in event handling which caused an infinite -loop if there were no files being watched and no timer. Fix suggested by -Jan Nijtmans. (JL) - -3/22/96 (bug fix) Fixed Tcl_CreateCommand, Tcl_DeleteCommand to be more -robust if the interpreter is being deleted. Also fixed several order -dependency bugs in Tcl_DeleteCommand which kicked in when an interpreter -was being deleted. (JL) - -3/26/96 (bug fix) Upon a "short read", the generic code no longer calls -the driver for more input. Doing this caused blocking on some platforms -even on nonblocking channels. Bug and fix courtesy Mark Roseman. (JL) - -3/26/96 (new feature) Added 'package Tcltest' which is present only in -test versions of Tcl; this allows the testing commands to be loaded into -new interpreters besides the main one. (JL) - -3/26/96 (restored feature) Recreated the Tcl_GetOpenFile C API. You can -now get a FILE * from a registered channel; Unix only. (JL) - -3/27/96 (bug fix) The regular expression code did not support more -than 9 subexpressions. It now supports up to 20. (SS) - -4/1/96 (bug fixes) The CHANNEL_BLOCKED bit was being left on on a short -read, so that fileevents wouldn't fire correctly. Bug reported by Mark -Roseman.(JL, RJ) - -4/1/96 (bug fix) Moved Tcl_Release to match Tcl_Preserve exactly, in -tclInterp.c; previously interpreters were being freed only conditionally -and sometimes not at all. (JL) - -4/1/96 (bug fix) Fixed error reporting in slave interpreters when the -error message was being generated directly by C code. Fix suggested by -Viktor Dukhovni of ESM. (JL) - -4/2/96 (bug fixes) Fixed a series of bugs in Windows sockets that caused -events to variously get lost, to get sent multiple times, or to be ignored -by the driver. The manifestation was blocking if the channel is blocking, -and either getting EAGAIN or infinite loops if the channel is nonblocking. -This series of bugs was found by Ian Wallis of Cisco. Now all tests (also -those that were previously commented out) in socket.test pass. (JL, SS) - -4/2/96 (feature change/bug fix) Eliminated network name support in -favor of better native name support. Added "file split", "file join", -and "file pathtype" commands. See the "file" man page for more -details. (SS) -*** INCOMPATIBILITY with Tcl 7.5b3, but not with Tcl 7.4 *** - -4/2/96 (bug fix) Changed implementation of auto_mkindex so tclIndex -files will properly handle path names in a cross platform context. (SS) - -4/5/96 (bug fix) Fixed Tcl_ReadCmd to use the channel buffer size as the -chunk size it reads, instead of a fixed 4K size. Thus, on large reads, the -user can set the channel buffer size to a large size and the read will -occur orders of magnitude faster. For example, on a 2MB file, reading in 4K -chunks took 34 seconds, while reading in 1MB chunks took 1.5 seconds (on a -SS-20). Problem identified and fix suggested by John Haxby of HP. (JL) - -4/5/96 (bug fix) Fixed socket creation code to invoke gethostbyname only if -inet_addr failed (very unlikely). Before this change the order was reversed -and this made things much slower than they needed to be (gethostbyname -generally requires an RPC, which is slow). Problem identified and fix -suggested by John Loverso of OSF. (JL) - -4/9/96 (feature change) Modified "auto" translation mode so that it -recognizes any of "\n", "\r" and "\r\n" in input as end of line, so -that a file can have mixed end-of-line sequences. It now outputs -the platform specific end of line sequence on each platform for files and -pipes, and for sockets it produces crlf in output on all platforms. (JL) -*** INCOMPATIBILITY with Tcl 7.5b3, but not with Tcl 7.4 *** - -4/11/96 (new feature) Added -eofchar option to Tcl_SetChannelOption to allow -setting of an end of file character for input and output. If an input eof -char is set, it is recognized as EOF and further input from the channel is -not presented to the caller. If an output eof char is set, on output, that -byte is appended to the channel when it is closed. On Unix and Macintosh, -all channels start with no eof char set for input or output. On Windows, -files and pipes start with input and output eof chars set to Crlt-Z (ascii -26), and sockets start with no input or output eof char. (JL) -*** INCOMPATIBILITY with Tcl 7.5b3, but not with Tcl 7.4 *** - -4/17/96 (bug fix) Fixed series of bugs with handling of crlf sequence split -across buffer boundaries in input, in AUTO mode. (JL, BW) - -4/17/96 (test suite improvement) Fixed test suite so that tests that -depend on the availability of Unix commands such as echo, cat and others -are not run if these commands are not present. (JL) - -4/17/96 (test suite improvement) The socket test now automatically starts, -on platformst that support exec, a separate process for remote testsing. (JL) - ------------------ Released 7.5, 4/21/96 ----------------------- - -5/1/96 (bug fix) "file tail ~" did not correctly return the tail -portion of the user's home directory. (SS) - -5/1/96 (bug fix) Fixed bug in TclGetEnv where it didn't lookup environment -variables correctly: could confuse "H" and "HOME", for example. (JO) - -5/1/96 (bug fix) Changed to install tclConfig.sh under "make install-binaries", -not "make install-libraries". (JO) - -5/2/96 (bug fix) Changed pkg_mkIndex not to attempt to "load" a file unless -it has the standard shared library extension. On SunOS, attempts to load -Tcl scripts cause the whole application to be aborted (there's no way to -get the error back into Tcl). (JO) - -5/7/96 (bug fix) Moved initScript in tclUnixInit.c to writable memory to -avoid potential core dumps. (JO) - -5/7/96 (bug fix) Auto_reset procedure was removing procedure from init.tcl, -such as pkg_mkIndex. (JO) - -5/7/96 (bug fix) Fixed cast on socket address resolution code that -would cause a failure to connect on Dec Alphas. (JL) - -5/7/96 (bug fix) Added "time", "subst" and "fileevent" commands to set of -commands available in a safe interpreter. (JL) - -5/13/96 (bug fix) Preventing OS level handles for stdin, stdout and stderr -from being implicitly closed when the last reference to the standard -channel containing that handle is discarded when an interpreter is deleted. -Explicitly closing standard channels by using "close" still works. (JL) - -5/21/96 (bug fix) Do not create channels for stdin, stdout and stderr on -Unix if the devices are closed. This prevents a duplicate channel name -panic later on when the fd is used to open a channel and the channel is -registered in an interpreter. (JL) - -5/23/96 (bug fix) Fixed bug that prevented the use of standard channels in -interpreters created after the last interpreter was destroyed. In the sequence - - interp = Tcl_CreateInterp(); - Tcl_DeleteInterp(interp); - interp = Tcl_CreateInterp(); - -channels for stdio would not be available in the second interpreter. (JL) - -5/23/96 (bug fix) Fixed bug that allowed Tcl_MakeFileChannel to create new -channels with Tcl_Files in them that are already used by another channel. -This would cause core dumps when the Tcl_Files were being freed twice. (JL) - -5/23/96 (bug fix) Fixed a logical timing bug that caused a standard channel -to be removed from the standard channel table too early when the channel -was being closed. If the channel was being flushed asynchronously, it could -get recreated before being actually destroyed, and the recreated channel -would contain the same Tcl_File as the one being closed, leading to -dangling pointers and core dumps. (JL) - -5/27/96 (bug fix) Fixed a bug in Tcl_GetChannelOption which caused it to -always return a list of one element, a list of the settings, for --translation and -eofchar options. Now correctly returns the value -described by the documentation (Mark Diekhans found this, thanks!). (JL) - -5/30/96 (bug fix) Fixed a couple of syntax errors in io.test. (JL) - -5/30/96 (bug fix) If a fileevent scripts gets an error, delete it before -causing a background error. This is to allow the error handler to reinstall -the fileevent and to prevent infinite loops if the event loop is reentered -in the error handler. (JL) - -5/31/96 (bug fix) Channels now will get properly flushed on exit. (JL) - -6/5/96 (bug fix) Changed Tcl_Ckalloc, Tcl_Ckfree, and Tcl_Ckrealloc to -Tcl_Alloc, Tcl_Free, and Tcl_Realloc. Added documentation for these -routines now that they are officially supported. Extension writers -should use these routines instead of free() and malloc(). (SS) - -6/10/96 (bug fix) Changes the Tcl close command so that it no longer -waits on nonblocking pipes for the piped processes to exit; instead it -reaps them in the background. (JL) - -6/11/96 (bug fix) Increased the length of the listen queue for server -sockets on Unix from 5 to 100. Some OSes will disregard this and reset it -to 5, but we should try to get as long a queue as we can, for performance -reasons. (JL) - -6/11/96 (bug fix) Fixed windows sockets bug that caused a cascade of events -if the fileevent script read less than was available. Now reading less than -is available does not cause a flood of Tcl events. (JL, SS) - -6/11/96 (bug fix) Fixed bug in background flushing on closed channels that -would prevent the last buffer from getting flushed. (JL) - -6/13/96 (bug fix) Fixed bug in Windows sockets that caused a core dump if -a DLL linked with tcl.dll and referred to e.g. ntohs() without opening a -Tcl socket. The problem was that the indirection table was not being -initialized. (JL) - -6/13/96 (bug fix) Fixed OS level resource leak that would occur when a -Tcl channel was still registered in some interpreter when the process -exits. Previously the channel was not being closed and the OS level handles -were not being released; the output was being flushed but the device was -not being closed. Now the device is properly closed. This was only a -problem on Win3.1 and MacOS. (JL, SS) - -6/28/96 (bug fix) Fixed bug where transient errors were leaving an error -code around, so that it would erroneously get reported later. This bug was -exercised intermittently by closing a channel to a file on a very loaded -NFS server, or to a socket whose other end blocked. (JL, BW) - -7/3/96 (bug fix) Fileevents declared in an interpreter are now deleted -when the channel is closed in that interpreter. Before this fix, the -fileevent would hang around until the channel is completely closed, and -would cause errors if events happened before the channel was closed. This -could happen in two cases: first if the channel is shared between several -interpreters, and second if an async flush is in progress that prevents the -channel from being closed until the flush finishes. (JL) - -7/10/96 (bug fix) Fixed bugs in both "lrange" and "lreplace" commands -where too much white space was being removed. For example, the command - lreplace {\}\ hello} end end -was returning "\}\", losing the significant space in the first list -element and corrupting the list. (JO) - -7/20/96 (bug fix) The procedure pkg_mkIndex didn't work properly for -extensions that depend on Tk, because it didn't load Tk into the child -interpreter before loading the extension. Now it loads Tk if Tk is -present in the parent. (JO) - -7/23/96 (bug fix) Added compat version of strftime to fix crashes -resulting from bad implementations under Windows. (SS) - -7/23/96 (bug fix) Standard implementations of gmtime() and localtime() -under Windows did not handle dates before 1970, so they were replaced -with a revised implementation. (SS) - -7/23/96 (bug fix) Tcl would crash on exit under Borland 5.0 because -the global environ pointer was left pointing to freed memory. (SS) - -7/29/96 (bug fix) Fixed memory leak in Tcl_LoadCmd that could occur if -a package's AppInit procedure called Tcl_StaticPackage to register -static packages. (JO) - -8/1/96 (bug fix) Fixed a series of bugs in Windows sockets so that async -writebehind in the presence of read event handlers now works, and so that -async writebehind also works on sockets for which a read event handler was -declared and whose channels were then closed before the async write -finished. The bug was reported by John Loverso and Steven Wahl, -independently, test case supplied by John Loverso. (JL) - ------------------ Released patch 7.5p1, 8/2/96 ----------------------- - -5/8/96 (new feature) Added Tcl_GetChannelMode C API for retrieving whether -a channel is open for reading and writing. (JL) - -5/8/96 (API changes) Revised C APIs for channel drivers: - - Removed all Tcl_Files from channel driver interface; you can now have - channels that are not based on Tcl_Files. - - Added channelReadyProc and watchChannelProc procedures to interface; - these are used to implement event notification for channels. - - Added getFileProc to channel driver, to allow the generic IO code - to retrieve a Tcl_File from a channel (presumably if the channel - uses Tcl_Files they will be stored inside its instanceData). (JL) -*** INCOMPATIBILITY with Tcl 7.5 *** - -5/8/96 (API change) The Tcl_CreateChannel C API was modified to not take -Tcl_File arguments, and instead to take a mask specifying whether the -channel is readable and/or writable. (JL) -*** INCOMPATIBILITY with Tcl 7.5 *** - -6/3/96 (bug fix) Made Tcl_SetVar2 robust against the case where the value -of the variable is a NULL pointer instead of "". (JL) - -6/17/96 (bug fix) Fixed "reading uninitialized memory" error reported by -Purify, in Tcl_Preserve/Tcl_Release. (JL) - -8/9/96 (bug fix) Fixed bug in init.tcl that caused incorrect error message -if the act of autoloading a procedure caused the procedure to be invoked -again. (JO) - -8/9/96 (bug fix) Configure script produced bad library names and extensions -under SunOS and a few other platforms if the --disable-load switch was used. -(JO) - -8/9/96 (bug fix) Tcl_UpdateLinkedVar generated an error if the variable -being updated was read-only. (JO) - -8/14/96 (bug fix) The macintosh now supports synchronous socket -connections. Other minor bugs were also fixed. (RJ) - -8/15/96 (configuration improvement) Changed the file patchlevel.h -to be tclPatch.h. This avoids conflict with the Tk file and is now -in 8.3 format on the Windows platform. (RJ) - -8/20/96 (bug fix) Fixed core dump in interp alias command for interpreters -created with Tcl_CreateInterp (as opposed to with Tcl_CreateSlave). (JL) - -8/20/96 (bug fix) No longer masking ECONNRESET on Windows sockets so -that the higher level of the IO mechanism sees the error instead of -entering an infinite loop. (JL) - -8/20/96 (bug fix) Destroying the last interpreter no longer closes the -standard channels. (JL) - -8/20/96 (bug fix) Closing one of the stdin, stdout or stderr channels and -then opening a new channel now correctly assigns the new channel as the -standard channel that was closed. (JL) - -8/20/96 (bug fix) Added code to unix/tclUnixChan.c for using ioctl with -FIONBIO instead of fcntl with O_NONBLOCK, for those versions of Unix where -either O_NONBLOCK is not supported or implemented incorrectly. (JL) - -8/21/96 (bug fix) Fixed "file extension" so it correctly returns the -extension on files like "foo..c" as "..c" instead of ".c". (SS) - -8/22/96 (bug fix) If environ[] contains static strings, Tcl would core -dump in TclSetupEnv because it was trying to write NULLs into the actual -data in environ[]. Now we instead copy as appropriate. (JL) - -8/22/96 (added impl) Added missing implementation of Tcl_MakeTcpClientChannel -for Windows platform. Code contributed by Mark Diekhans. (JL) - -8/22/96 (new feature) Added a new memory allocator for the Macintosh -version of Tcl. It's quite a bit faster than MetroWerk's version. (RJ) - -8/26/96 (documentation update) Removed old change bars (for all changes -in Tcl 7.5 and earlier releases) from manual entries. (JO) - -8/27/96 (enhancement) The exec and open commands behave better and work in -more situations under Windows NT and Windows 95. Documentation describes -what is still lacking. (CS) - -8/27/96 (enhancement) The Windows makefiles will now compile even if the -compiler is not in the path and/or the compiler's environment variables -have not been set up. (CS) - -8/27/96 (configuration improvement) The Windows resource files are -automatically updated when the version/patch level changes. The header file -now has a comment that reminds the user which other files must be manually -updated when the version/patch level changes. (CS) - -8/28/96 (new feature) Added file manipulation features (copy, rename, delete, -mkdir) that are supported on all platforms. They are implemented as -subcommands to the "file" command. See the documentation for the "file" -command for more information. (JH) - ------------------ Released 7.6b1, 8/30/96 ----------------------- - -9/3/96 (bug fix) Simplified code so that standard channels are created -lazily, they are added to an interpreter lazily, and they are never added -to a safe interpreter. (JL) - -9/3/96 (bug fix) Closing a channel after closing a standard channel, e.g. -stdout, would cause the implicit recreation of that standard channel. (JL) - -9/3/96 (new feature) Now calling Tcl_RegisterChannel with a NULL -interpreter increments the refcount so that code outside any interpreter -can use channels that are also registered in interpreters, without worrying -that the channel may turn into a dangling pointer at any time. Calling -Tcl_UnregisterChannel with a NULL interpreter only decrements the recount -so that code outside any interpreter can safely declare it is no longer -interested in a channel. (JL) - -9/4/96 (new features) Two changes to dynamic loading: - - If the file name is empty in the "load" command and there is no - statically loaded version of the package, a dynamically loaded - version will be used if there is one. - - Tcl_StaticPackage ignores redundant calls for the same package. (JO) - -9/6/96 (bug fix) Platform specific procedures for manipulating files are -no longer macros and have been prefixed with "Tclp", such as TclpRenameFile. -Unix file code now handles symbolic links and other special files correctly. -The semantics of file copy and file rename has been changed so that if -a target directory exists, the source files will NOT be merged with the -existing files. (JH) - -9/6/96 (bug fix) If standard channel is NULL, because Tcl cannot connect -to the standard channel, do not increment the refcount. The channel can -be NULL if there is for example no standard input. (JL) - -9/6/96 (portability improvement) Changed parsing of backslash sequences -like \n to translate directly to absolute values like 0xa instead of -letting the compiler do the translation. This guarantees that the -translation is done the same everywhere. (JO) - -9/9/96 (bug fix) If channel is opened and not associated with any -interpreter, but Tcl decides to use it as one of the standard channels, it -became impossible to close the channel with Tcl_Close -- instead you had -to call Tcl_UnregisterChannel. Fixed now so that it's safe to call -Tcl_Close even when Tcl is using the channel as one of the standard ones. (JL) - -9/11/96 (feature change) The Tcl library is now placed in the Tcl -shared libraries resource. You no longer need to place the Tcl files -in your applications explicitly. (RJ) - -9/11/96 (feature change) Extensions no longer automatically have the -resource fork of the extension opened for it. Instead you need to -use the tclMacLibrary.c file in your extension. (RJ) -*** POTENTIAL INCOMPATIBILITY *** - -9/12/96 (bug fix) The extension loading mechanism on the Macintosh now -looks at the 'cfrg' resource to determine where to load the code -fragment from. This means FAT fragments should now work. (RJ) - -9/18/96 (enhancement) The exec and open commands behave better and work in -more situations under Windows 3.X. Documentation describes what is still -lacking. (CS) - -9/19/96 (bug fix) Fixed a panic which would occur if you delete a -non-existent alias before any aliases are created. Now instead correctly -returns an error that the alias is not found. (JL) - -9/19/96 (bug fix) Slave interpreters could rename aliases and they would -not get deleted when the alias was being redefined. This led to dangling -pointers etc. (JL) - -9/19/96 (bug fix) Fixed a panic where a hash table entry was being deleted -twice during alias management operations. (JL) - -9/19/96 (bug fix) Fixed bug in event loop that could cause the input focus -in Tk to get confused during menu traversal, among other problems. The -problem was related to handling of the "marker" when its event was -deleted. (JO) - -9/26/96 (bug fix) Windows was losing EOF on a socket if the FD_CLOSE event -happened to precede any left over FD_READ events. Now correctly remembers -seeing FD_CLOSE, so that trailing FD_READ events are not discarded if they -do not contain any data. This allows Tcl to correctly get a zero read and -notice EOF. (JL) - -9/26/96 (bug fix) Was not resetting READABLE state properly on sockets -under Windows if the driver discarded an FD_READ event because no data was -present. Now correctly resets the state. (JL) - -9/30/96 (bug fix) Made EOF sticky on Windows sockets, so that fileevent -readable will fire repeatedly until the socket is closed. Previously the -fileevent fired only once. This could lead to never-closed connections if -the Tcl script in the fileevent wasn't closing the socket immediately. (JL) - -10/2/96 (new feature) Improved the package loader: - - Added new variable tcl_pkgPath, which holds the default - directories under which packages are normally installed (each - package goes in a separate subdirectory of a directory in - $tcl_pkgPath). These directories are included in auto_path by - default. - - Changed the package auto-loader to look for pkgIndex.tcl files - not only in the auto_path directories but also in their immediate - children. This should make it easier to install and uninstall - packages (don't have to change auto_path or merge pkgIndex.tcl - files). (JO) - -10/3/96 (bug fix) Changed tclsh to look for tclshrc.tcl instead of -tclsh.rc on startup under Windows. This is more consistent with wish and -uses the right extension. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -10/8/96 (bug fix) Convertclock does not parse 24-hour times of the -form "hhmm" correctly when hour = 00. In the parse code, hour must be ->= 100 for minutes to be non-zero. Thanks to Lint LaCour for this -bug fix. (RJ) - -10/11/96 (bug fix) Under Windows, the pid command returned the process -handle instead of the process id. (SS) - ------------------ Released 7.6, 10/16/96 ----------------------- - -10/29/96 (bug fix) Under Windows, sockets would consume 100% CPU time after -the first accept(), due to a typo. (JL) - -10/29/96 (bug fix) Incorrect refcount management caused standard channels -not to get deleted at process exit or DLL unload time, causing a memory -leak of upwards of 20K each time. (JL) - -11/7/96 (bug fix) Auto-exec didn't work on file names that contained -spaces. (JO) - -11/8/96 (bug fix) Fixed core dump that would occur if more than one call -to Tcl_DeleteChannelHandler was made to delete a given channel handler. (JL) - -11/8/96 (bug fix) Fixed test for return value in Tcl_Seek and Tcl_SeekCmd -to only treat -1 as error, instead of all negative numbers. (JL) - -11/12/96 (bug fix) Do not blocking waiting for processes at the end of a -pipe during exit cleanup. (JL) - -11/12/96 (bug fix) If we are in exit cleanup, do not close the system level -file descriptors 0, 1 and 2. Previously they were being closed which is -incorrect, in the embedded case. This led to weird behavior for programs -that want to interpose on I/O through the standard file descriptors (e.g. -Netscape Navigator). (JL) - -11/15/96 (bug fix) Fixed core dump on Windows sockets due to dependency on -deletion order at exit. Now all socket functions check to see if sockets -are (still) initialized, before calling through function pointers. Before, -they would call and might end up calling unloaded object code. (JL) - -11/15/96 (bug fix) Fixed core dump in Windows socket initialization routine -if sockets were not installed on the system. Before, it was not properly -checking the result of attempting to load the socket DLL, so it would call -through uninitialized function pointers. (JL) - -11/15/96 (bug fix) Fixed memory leak in Windows sockets which left socket -DLL handle open and could hold the socket DLL in memory uneccessarily, -until a reboot. (JL) - -12/4/96 (bug fix) Fixed bug in Macintosh socket code that could result -in lost data if a client was closed too soon after sending data. (RJ) - -12/17/96 (bug fix) Fixed deadlock bug in Windows sockets due to losing an -event. This was happening because of an interaction between buffering and -nonblocking mode on sockets. Now switched to sockets being blocking by -default, so we are also no longer emulating blocking through a private -event loop. (JL) - -1/21/97 (performance bug fix) Client TCP connections were slow to create -because getservbyname was always called on the port. Now this is only -done if Tcl_GetInt fails. (BW) - -1/21/97 (configuration fix) Made it possible to override TCL_PACKAGE_PATH -during make. Previously it was only set during autoconf process. - -1/29/97 (bug fix) Fixed some problems with the clock command that -impacted how dates were scaned after the year 2000. (RJ) - ------------------ Released 7.6p2, 1/31/97 ----------------------- - -2/5/97 (bug fix) Fixed a bug where in CR-LF translation mode, \r bytes -in the input stream were not being handled correctly. (JL) - -2/24/97 (bug fix) Fix bug with exec under Win32s not being able to create -stderr file which caused all execs to fail. Fixed temp file leak under -Win32s. Fixed optional parameter bug with SearchPath that only happened -under Win32s 1.25. (CCS) - ----------------------------------------------------------- -Changes for Tcl 7.6 go above this line. -Changes for Tcl 7.7 go below this line. ----------------------------------------------------------- - -5/8/96 (new feature) Added Tcl_Ungets C API for putting a sequence of bytes -into a channel's input buffer. This can be used for "push" model channels -where the input is obtained via callbacks instead of by request of the -generic IO code. No Tcl procedure yet. (JL) - -11/15/96 (new feature) Implemented hidden commands. New C APIs: - Tcl_HideCommand -- hides an existing exposed command. - Tcl_ExposeCommand -- exposes an existing hidden command. -New tcl APIs: - interp invokehidden -- invokes a hidden command in a slave. - interp hide -- hides an existing exposed command. - interp expose -- exposes an existing hidden command. - interp hidden -- returns a list of hidden commands. -The implementation of Safe Tcl now uses the new hidden commands facility -to implement the safe base, instead of deleting the commands from a safe -interpreter. (JL) - -11/15/96 (new feature) Implemented the safe base, a mechanism for -installing and requesting security policies, purely in Tcl code. Overloads -the package command to also allow an interpreter to "require" a policy. The -following new library commands are provided: - tcl_safeCreateInterp -- creates a slave an initializes the - policy mechanism. - tcl_safeInitInterp -- initializes an existing slave with the - policy mechanism. - tcl_safeDeleteInterp -- deletes a slave and deinitializes the - policy mechanism. -Added a new file to the library, safeinit.tcl, to hold implementation. (JL) -On 7/9/97, removed the policy loading mechanism from the Safe Base. Left -only the Safe Base aliases dealing with auto-loading and source. (JL) - -12/6/96 (new feature) Implemented Tcl_Finalize, an API that should be -called by a process when it is done using Tcl. This API runs all the exit -handlers to allow them to clean up resources etc. (JL) - -12/17/96 (new feature) Add an http Tcl script package to the Tcl library. -This package implements the client side of HTTP/1.0; the GET, HEAD, -and POST requests. (BW) - -1/21/97 (new feature) Added a "marktrusted" subcommand to the "interp" and -to the interpreter object command. It removes the "safe" mark on an -interpreter and disables hard-wired checks for safety in the C sources. (JL) - -1/21/97 (removed feature) Removed "vwait" from set of commands available in -a safe interpreter. (JL) - -2/11/97 (new feature, bug fix) http package. Added -accept to http_config -so you can set the Accept header. Added -handler option to http_get so -you can supply your own data handler. Also fixed POST operation to -set the correct MIME type on the request. (BW) - ----------------------------------------------------------- -Changes for Tcl 7.7 go above this line. -Changes for Tcl 8.0 go below this line. ----------------------------------------------------------- - -9/17/96 (bug fix) Using "upvar" it was possible to turn an array element -into an array itself. Changed to disallow this; it was quirky and didn't -really work correctly anyway. (JO) - -10/21/96 (new feature) The core of the Tcl interpreter has been replaced -with an on-the-fly compiler that translates Tcl scripts to bytecoded -instructions; a new interpreter then executes the bytecodes. The compiler -introduces only a few minor changes at the level of Tcl scripts. The biggest -changes are to expressions and lists. - - A second level of substitutions is no longer done for expressions. - This substantially improves their execution time. This means that - the expression "$x*4" produces a different result than in the past - if x is "$y+2". Fortunately, not much code depends on the old - two-level semantics. Some expressions that do, such as - "expr [join $list +]" can be recoded to work in Tcl8.0 by adding - an eval: e.g., "eval expr [join $list +]". - - Lists are now completely parsed on the first list operation to - create a faster internal representation. In the past, if you had a - misformed list but the erroneous part was after the point you - inserted or extracted an element, then you never saw an error. - In Tcl8.0 an error will be reported. This should only effect - incorrect programs that took advantage of behavior of the old - implementation that was not documented in the man pages. -Other changes to Tcl scripts are discussed in the web page at -http://www.scriptics.com/doc/compiler.html. (BL) -*** POTENTIAL INCOMPATIBILITY *** - -10/21/96 (new feature) In earlier versions of Tcl, strings were used as a -universal representation; in Tcl 8.0 strings are replaced with Tcl_Obj -structures ("objects") that can hold both a string value and an internal -form such as a binary integer or compiled bytecodes. The new objects make it -possible to store information in efficient internal forms and avoid the -constant translations to and from strings that occurred with the old -interpreter. There are new many new C APIs for managing objects. Some of the -new library procedures for objects (such as Tcl_EvalObj) resemble existing -string-based procedures (such as Tcl_Eval) but take advantage of the -internal form stored in Tcl objects for greater speed. Other new procedures -manage objects and allow extension writers to define new kinds of objects. -See the manual entries doc/*Obj*.3 (BL) - -10/24/96 (bug fix) Fixed memory leak on exit caused by some IO related -data structures not being deallocated on exit because their refcount was -artificially boosted. (JL) - -10/24/96 (bug fix) Fixed core dump in Tcl_Close if called with NULL -Tcl_Channel. (JL) - -11/19/96 (new feature) Added library procedures for finding word -breaks in strings in a platform specific manner. See the library.n -manual entry for more information. (SS) - -11/22/96 (feature improvements) Added support for different levels of -tracing during bytecode compilation and execution. This should help in -tracking down suspected problems with the compiler or with converting -existing code to use Tcl8.0. Two global Tcl variables, traceCompile -and traceExec, can be set to generate tracing information in stdout: - - traceCompile: 0 no tracing (default) - 1 trace compilations of top level commands and procs - 2 trace and display instructions for all compilations - - traceExec: 0 no tracing - 1 trace only calls to Tcl procs - 2 trace invocations of all commands including procs - 3 detailed trace showing the result of each instruction -traceExec >= 2 provides a one line summary of each called command and -its arguments. Commands that have been "compiled away" such as set are -not shown. (BL) - -11/30/96 (bug fix) The command "info nameofexecutable" could sometimes -return the name of a directory. (JO) - -11/30/96 (feature improvements) Changed the code in library/init.tcl -that reads in pkgIndex.tcl so that (a) it reads the files from child -directories before those in the parent, so that the parent gets -precedence, and (b) it doesn't quit if there is an error in a -pkgIndex.tcl file; instead, it prints an error message on standard -error and continues. (JO) - -10/5/96 (feature improvements) Partial implementation of binary string -support: the ability for Tcl string values to contain embedded null bytes. -Changed the Tcl object-based APIs to take a byte pointer and length pair -instead of a null-terminated C string. Modified several object type managers -to support binary strings but not, for example, the list type manager. -Existing string-based C APIs are unchanged and will truncate binary -strings. Compiled scripts containing nulls are also truncated. (BL) - -12/12/96 (feature change) Removed the commands "cp", "mkdir", "mv", -"rm", and "rmdir" from the Macintosh version of Tcl. They were never -officially supported and their functionality is now available via -the file command. (RJ) - ------------------ Released 8.0a1, 12/20/96 ----------------------- - -1/7/97 (bug fix) Under Windows, "file stat c:" was returning error instead -of stat for current dir on c: drive. - -1/10/97 (new feature) Added Tcl_GetIndexFromObj procedure for quick -lookups of keyword arguments. (JO) - -1/12/97 (new feature) Serial IO channel drivers for Windows and Unix, -available by using Tcl open command to open pseudo-files like "com1:" or -"/dev/ttya". New option to Tcl fconfigure command for serial files: -"-mode baud,parity,data,stop" to specify baud rate, parity, data bits, and -stop bits. Serial IO is not yet available on Mac. - -1/16/97 (feature change) Restored the Tcl7.x "two level substitution -semantics" for expressions. Expressions not enclosed in braces are -implemented, in general, by calling the expr command procedure -(Tcl_ExprObjCmd) at runtime after the Tcl interpreter has already done a -first round of substitutions. This is slow (about Tcl7.x speed) because new -code for the expression is generally compiled each time. However, if the -expression has only variable substitutions (and not command substitutions), -"optimistic" fast code is generated inline. This inline code will fail if a -second round of substitutions is needed (i.e., if the value of a substituted -variable itself requires more substitutions). The optimistic code will -catch the error and back off to call the slower but guaranteed correct -expr command procedure. (BL) - -1/16/97 (feature improvements) Added Tcl_ExprLongObj and Tcl_ExprDoubleObj -to round out expression-related procedures. (BL) - -1/16/97 (feature change) Under Windows, at startup the environment variables -"path", "comspec", and "windir" in any capitalization are converted -automatically to upper case. The PATH variable could be spelled as path, -Path, PaTh, etc. and it makes programming rather annoying. All other -environment variables are left alone. (CS) - -1/20/97 (new features) Rewrote the "lsort" command: - - The new version is based on reentrant merge sort code provided - by Richard Hipp, so it eliminates the reentrancy and stability - problems with the old qsort-based implementation. - - The new version supports a -dictionary option for sorting, and - it also supports a -index option for sorting lists using one - element for comparison. - - The new version is an object command, so it works well with the - Tcl compiler, especially in conjunction with the new -index - option. When the -index option is used, this version of lsort - is more than 100 times faster than the Tcl 7.6 lsort, which had - to use the -command option to get the same effect. (JO) - -1/20/97 (feature improvements) Added the improved debugging support for Tcl -objects prototyped by Karl Lehenbauer . -If TCL_MEM_DEBUG is defined, the object creation calls use Tcl_DbCkalloc -directly in order to record the caller's source file name and line -number. (BL) - -1/21/97 (removed feature) Desupported the tcl_precision variable: if -set, it is ignored. Tcl now uses the full 17 digits of precision when -converting real numbers to strings (with the new object system real -numbers are rarely converted to strings so there is no efficiency -disadvantage to printing all 17 digits; the new scheme improves -accuracy and simplifies several APIs). (JO) -*** POTENTIAL INCOMPATIBILITY *** - -1/21/97 (feature change) Removed the "interp" argument for the -procedures Tcl_GetStringFromObj, Tcl_StringObjAppend, and -Tcl_StringObjAppendObj. Also removed the "interp" argument for -the updateStringProc procedure in Tcl_ObjType structures. With -the tcl_precision changes above, these are no longer needed. (JO) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0a1, but not with Tcl 7.6 *** - -1/22/97 (bug fix) Fixed http.tcl so that http_reset does not result in -an extra call to the command callback. In addition, if the transaction -gets a premature eof, the state(status) is "eof", not "ok". (BW) - ------------------ Released 8.0a2, 1/24/97 ----------------------- - -1/29/97 (feature change) Changed how two digit years are parsed in the -clock command. The old interface just added 1900 which will seem -broken by the year 2000. The new scheme follows the POSIX standard -and treats dates 70-99 as 1970-1999 and dates 00-38 as 2000-2038. All -other two digit dates are undefined. (RJ) -*** POTENTIAL INCOMPATIBILITY *** - -2/4/97 (bug fix) Fixed bug in clock code that dealt with relative -dates. Using the relative month code you could get an invalid date -because it jumped into a non-existant day. (For example, Jan 31 -to Feb 31.) The code now will return the last valid day of the -month in these situations. Thanks to Hume Smith for sending in -this bug fix. (RJ) - -2/10/97 (feature change) Eliminated Tcl_StringObjAppend and -Tcl_StringObjAppendObj procedures, replaced them with Tcl_AppendToObj -and Tcl_AppendStringsToObj procedures. Added new procedure -Tcl_SetObjLength. (JO) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0a2, but not with Tcl 7.6 *** - -2/10/97 (new feature) Added Tcl_WrongNumArgs procedure for generating -error messages about incorrect number of arguments. (JO) - -2/11/97 (new feature, bug fix) http package. Added -accept to http_config -so you can set the Accept header. Added -handler option to http_get so -you can supply your own data handler. Also fixed POST operation to -set the correct MIME type on the request. (BW) - -2/22/97 (bug fix) Fixed bug that caused $tcl_platform(osVersion) to be -computed incorrectly under AIX. (JO) - -2/25/97 (new feature, feature change) Added support for both int and long -integer objects. Added Tcl_NewLongObj/Tcl_GetLongFromObj/Tcl_SetLongFromObj -procedures and renamed the Tcl_Obj internalRep intValue member to -longValue. Tcl_GetIntFromObj now checks for integer values too large to -represent as non-long integers. Changed Tcl_GetAllObjTypes to -Tcl_AppendAllObjTypes. (BL) - -3/5/97 (new feature) Added new Tcl_SetListObj procedure to round out -collection of procedures that set the type and value of existing Tcl -objects. (BL) - -3/6/97 (new feature) Added -global flag for interp invokehidden. (JL) - -3/6/97 (new feature, feature change) Added isNativeObjectProc field to the -Tcl_CmdInfo structure to indicate (when 1) if the command has an -object-based command procedure. Removed the nameLength arg from -Tcl_CreateObjCommand since command names can't contain null characters. (BL) - -3/6/97 (bug fix) Fixed bug in "unknown" procedure that caused auto- -loading to fail on commands whose names begin with digits. (JO) - -3/7/97 (bug fix) Auto-loading now works in Safe Base. Safe interpreters -only accept the Version 2 and onwards tclIndex files. (JL) - -3/13/97 (bug fix) Fixed core dump due to interaction between aliases and -hidden commands. Bug found by Lindsay Marshall. (JL) - -3/14/97 (bug fix) Fixed mac bugs relating to time. The -gmt option -now adjusts the time in the correct direction. (Thanks to Ed Hume for -reporting a fix to this problem.) Also fixed file "mtime" etc. to -return times from GMT rather than local time zone. (RJ) - -3/18/97 (feature change) Declaration of objv in Tcl_ObjCmdProc function -changed from "Tcl_Obj *objv[]" to "Tcl_Obj *CONST objv[]". All Tcl object -commands changed to use new declaration of objv. Naive translation of -string-based command procs to object-based command procs could very easily -have yielded code where the contents of the objv array were changed. This -is not a problem with string-based command procs, but doing something as -simple as objv[2] = objv[3] would corrupt the runtime stack and cause Tcl to -crash. Introduced CONST in declaration of objv so that attempted assignment -of new pointer values to elements of the objv array will be caught by the -compiler. (CCS) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0a2 *** - -3/19/97 (bug fix) Fixed panic due to object sharing. The root cause was -that old code was using Tcl_ResetResult instead of Tcl_ResetObjResult. (JL) - -3/20/97 (new feature) Added a new subcommand for the file -command. file attributes filename can give a list of platform-specific -options (such as file/creator type on the Mac, permissions on Unix) or -set the values of them. Added a new subcommand for the file -command. file nativename name gives back the platform-specific form -for the file. This is useful when the filename is needed to pass to -the OS, such as exec under Windows 95 or AppleScript on the Mac. For -more info, see file.n. (SRP) - -3/24/97 (removed feature) Removed the tcl_safePolicyPath procedure. Now -the policy path is computed from the auto_path by appending the directory -'policies' to each element. Also fixed several bugs in automatic tracking -of auto_path by computed policy path. (JL) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0a2 but not with Tcl 7.6 *** - -4/8/97 (new feature) If the variable whose name is passed to lappend doesn't -already exist, and there are no value arguments, lappend now creates the -variable with an empty value instead of returning an error. Change suggested -by Tom Tromey. (BL) - -4/9/97 (feature change) Changed the name of the TCL_PART1_NOT_PARSED flag to -TCL_PARSE_PART1. (BL) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0a2 but not with Tcl 7.6 *** - -4/10/97 (bug fixes) Fixed various compilation-related bugs: - - "UpdateStringOfCmdName should never be invoked" panic. - - Bad code generated for expressions not in {}'s inside catch commands. - - Segmentation fault in some command procedures when two argument - object pointers refer to the same object. - - Second level of substitutions were never done for expressions not - in {}'s that consist of a single variable reference: e.g., - "set x 27; set bool {$x}; if $bool {puts foo}" would fail with error. - - Bad code generated when code storage was grown while compiling some - expressions: ones with compilation errors or consisting of only a - variable reference. - - Bugs involving multiple interpreters: wasn't checking that a - procedure's code was compiled for the same interpreter as the one - executing it, and didn't invalidate code on hidden-exposed command - transitions. - - "Bad stack top" panic when executing scripts that require a huge - amount of stack space. - - Incorrect sharing of code for procedure bodies, and procedure code - deallocated before last execution of the procedure finished. - - Fixed compilation of expression words in quotes. For example, - if "0 < 3" {puts foo}. - - Fixed performance bug in array set command with large assignments. - - Tcl_SetObjLength segmentation fault setting length of empty object. - - If Tcl_SetObjectResult was passed the same object as the interpreter's - result object, it freed the object instead of doing nothing. Bug fix - by Michael J. McLennan. - - Tcl_ListObjAppendList inserted elements from the wrong list. Bug fix - by Michael J. McLennan. - - Segmentation fault if empty variable list was specified in a foreach - command. Bug fix by Jan Nijtmans. - - NULL command name was always passed to Tcl_CreateTrace callback - procedure. - - Wrong string representation generated for the value LONG_MIN. - For example, expr 1<<31 printed incorrectly on a 32 bit machine. - - "set {a($x)} 1" stored value in wrong variable. - - Tcl_GetBooleanFromObj was not checking for garbage after a numeric - value. - - Garbled "bad operand type" error message when evaluating expressions - not surrounded by {}'s. (BL) - -4/16/97 (new feature) The expr command now has the "rand()" and -"srand()" functions for getting random numbers in expr. (RJ) - -4/23/97 (bug fix) Fixed core dump in bgerror when the error handler command -deletes the current interpreter. Found by Juergen Schoenwald. (JL) - -4/23/97 (feature change) The notifier interfaces have been redesigned -to make embedding in applications with external event loops possible. -A number of interfaces in the notifier and the channel drivers have -changed. Refer to the Notifier.3 and CrtChannel.3 manual entries for -more details. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -4/23/97 (removed feature) The Tcl_File interfaces have been removed. -The Tcl_CreateFileHandler/Tcl_DeleteFileHandler interfaces now take -Unix fd's and are only supported on the Unix platform. -Tcl_GetChannelFile has been replaced with Tcl_GetChannelHandle. -Tcl_MakeFileChannel now takes a platform specific file handle. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -4/23/97 (removed feature) The modal timeout interface has been -removed (Tcl_CreateModalTimeout/Tcl_DeleteModalTimeout) (SS) -*** POTENTIAL INCOMPATIBILITY *** - -4/23/97 (feature change) Channel drivers are now required to correctly -implement blocking behavior when they are in blocking mode. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -4/23/97 (new feature) Added the "binary" command for manipulating -binary strings. Also, changed the "puts", "gets", and "read" commands -to preserve embedded nulls. (SS) - -4/23/97 (new feature) Added tcl_platform(byteOrder) element to the -tcl_platform array to identify the native byte order for the current -host. (SS) - -4/23/97 (bug fix) Fixed bug in date parsing around year boundaries. (SS) - -4/24/97 (bug fix) In the process of copying a file owned by another user, -Tcl was changing the owner of the copy back to the owner of the original -file, therefore causing further file operations to fail because the current -user didn't own the copy anymore. The owner of the copy is now left as the -current user. (CCS) - -4/24/97 (feature change) Under Windows, don't automatically uppercase the -environment variable "windir" -- it's supposed to be lower case. (CCS) - -4/29/97 (new feature) Added namespace support based on a namespace -implementation by Michael J. McLennan of Lucent Technologies. A namespace -encapsulates a collection of commands and variables to ensure that they -won't interfere the commands and variables of other namespaces. The global -namespace holds all global variables and commands. Additional namespaces are -created with the new namespace command. The new variable command lets you -create Tcl variables inside a namespace. The names of Tcl variables and -commands may now be qualified by the name of the namespace containing them. -The key namespace-related commands are summarized below: - - namespace ?eval? name arg ?arg...? - Used to define the commands and variables in a namespace. - Optionally creates the namespace. - - namespace export ?-clear? ?pattern pattern...? - Specifies which commands are exported from a namespace. These - are the ones that can be imported into another namespace. - - namespace import ?-force? ?pattern pattern...? - Makes the specified commands accessible in the current namespace. - - namespace current - Returns the name of the current namespace. - - variable name ?value? ?name ?value?...? - Creates one or more namespace variables. (BTL) - -5/1/97 (bug fix) Under Windows, file times were reported in GMT. Should be -reported in local time. (CCS) - -5/2/97 (feature change) Changed the name of the two Tcl variables used for -tracing bytecode compilation and execution to tcl_traceCompile and -tcl_traceExec respectively. These variables are now documented in the -tclvars man page. (BL) - -5/5/97 (new feature) Support "end" as the index for "lsort -index". (BW) - -5/5/97 (bug fixes) Cleaned up the way the http package resets connections (BW) - -5/8/97 (feature change) Newly created Tcl objects now have a reference count -of zero instead of one. This simplifies C code that stores newly created -objects in Tcl variables or in data structures such as list objects. That C -code must increment the new object's reference count since the variable or -data structure will contain a long-term reference to the object. Formerly, -when new objects started out with reference count one, it was necessary to -decrement the new object's reference count after the store to make sure it -was left with the correct value; this is no longer necessary. (BL) - -5/9/97 (new feature) Added the Tcl_GetsObj interface that takes an -object reference instead of a dynamic string (as in Tcl_Gets). (SS) - -5/12/97 (new feature) Added Tcl_CreateAliasObj and Tcl_GetAliasObj C APIs -to allow an alias command to be created with a vector of Tcl_Obj structures -and to get the vector back later. (JL) - -5/12/97 (feature change) Changed Tcl_ExposeCommand and Tcl_HideCommand to -leave an object result instead of a string result. (JL) - -5/14/97 (feature change) Improved the handling of the interpreter result. -This is still either an object or a string, but the two values are now kept -consistent unless some C code reads or writes interp->result directly. See -the SetResult man page for details. Removed the Tcl_ResetObjResult -procedure. (BL) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0a2 *** - -5/16/97 (new feature) Added "fcopy" command to move data between -channels. Refer to the manual page for more information. Removed the -"unsupported0" command since it is obsolete now. (SS) - -5/16/97 (new feature) Added Tcl_GetStringResult procedure to allow programs -to get an interpreter's result as a string. If the result was previously set -to an object, this procedure will convert the object to a string. Use of -Tcl_GetStringResult is intended to replace direct access to interp->result, -which is not safe. (BL) - -5/20/97 (new features) Fixed "fcopy" to return the number of bytes -transferred in the blocking case. Updated the http package to use -fcopy instead of unsupported0. Added -timeout and -handler options to -http_get. http_get is now blocking by default. It is only non-blocking -if you supply a -command argument. (BW) - -5/22/97 (bug fix) Fixed several bugs in the "lsort" command having to do -with the -dictionary option and the presence of numbers embedded in the -strings. (JO) - ------------------ Released 8.0b1, 5/27/97 ----------------------- - -6/2/97 (bug fix) Fixed bug in startup code that caused a problem in -finding the library files when they are installed in a directory -containing a space in the name. (SS) - -6/2/97 (bug fix) Fixed bug in Unix notifier where the select mask was -not being cleared under some circumstances. (SS) - -6/4/97 (bug fix) Fixed bug that prevented creation of Tk widgets in -namespaces. Tcl_CreateObjCommand and Tcl_CreateCommand now always create -commands in the global namespace unless the command names are qualified. Tcl -procedures continue to be created in the current namespace by default. (BL) - -6/6/97 (new features) Added new namespace API procedures -Tcl_AppendExportList and Tcl_Export to allow C code to get and set a -namespace's export list. (BL) - -6/11/97 (new feature) Added Tcl_ConcatObj. This object-based routine -parallels the string-based routine Tcl_Concat. (SRP) - -6/11/97 (new feature) Added Tcl_SetObjErrorCode. This object-based -routines parallels the string-based routine Tcl_SetErrorCode. (SRP) - -6/12/97 (bug fix) Fix the "unknown" procedure so that wish under Windows -will exec an external program, instead of always complaining "console1 not -opened for writing". (CCS) - -6/12/97 (bug fix) Fixed core dump experienced by the following simple -script: - interp create x - x alias exec exec - interp delete x -This panic was caused by not installing the new CmdDeleteProc when exec -got redefined by the alias creation step. Reported by Lindsay Marshal (JL) - -6/13/97 (new features) Tcl objects newly created by Tcl_NewObj now have a -string representation that points to a shared heap string of length 1. (They -used to have NULL bytes and typePtr fields. This was treated as a special -case to indicate an empty string, but made type manager implementations -complex and error prone.) The new procedure Tcl_InvalidateStringRep is used -to mark an object's string representation invalid and to free any storage -associated with the old string representation. (BL) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0b1, but not with Tcl7.6 *** - -6/16/97 (bug fix) Tcl_ScanCountedElement could leave braces unmatched -if the string ended with a backslash. (JO) - -6/17/97 (bug fix) Fixed channel event bug where readable events would be -lost during recursive events loops if the input buffers contained -data. (SS) - -6/17/97 (bug fix) Fixed bug in Windows socket code that didn't -reenable read events in the case where an external entity is also -reading from the socket. (SS) - -6/18/97 (bug fix) Changed initial setting of the notifier service mode -to TCL_SERVICE_NONE to avoid unexpected event handling during -initialization. (SS) - -6/19/97 (bug fix/feature change) The command callback to fcopy is now -called in case of errors during the background copy. This adds a second, -optional argument to the callback that is the error string. The callback -in case of errors is required for proper cleanup by the user of fcopy. (BW) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0b1, but not with Tcl 7.6 *** - -6/19/97 (bug fix) Fixed a panic due to the following four line script: - interp create x - x alias foo bar - x eval rename foo blotz - x alias foo {} -The problem was that the interp code was not using the actual current name -of the command to be deleted as a result of un-aliasing foo. (JL) - -6/19/97 (feature change) Pass interp down to the ChannelOption and -driver specific calls so system errors can be differentiated from syntax -ones. Changed Tcl_DriverGetOptionProc type. Affects Tcl_GetChannelOption, -TcpGetOptionProc, TtyGetOptionProc, etc. (DL) -*** POTENTIAL INCOMPATIBILITY *** - -6/19/97 (new feature) Added Tcl_BadChannelOption for use by by driver -specific option procedures (Set and Get) to return a complete and -meaningful error message. (DL) - -6/19/97 (bug fixes) If a system call error occurs while doing an -fconfigure on tcp or tty/com channel: return the appropriate error -message (instead of the syntax error one or none). (Fixed for Unix and -most of the Win and Mac drivers). (DL) - -6/20/97 (feature change) Eval is no longer assumed as the subcommand name -in namespace commands: you must now write "namespace eval nsName {...}". -Abbreviations of namespace subcommand names are now allowed. (BL) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0b1, but not with Tcl7.6 *** - -6/20/97 (feature change) Changed the errorInfo traceback message for -compilation errors from "invoked from within" to "while compiling". (BL) - -6/20/97 (bug fixes) Fixed various compilation-related bugs: - - "UpdateStringOfCmdName should never be called" and - "UpdateStringOfByteCode should never be called" panics. - - Segfault in TclObjInterpProc getting procedure name after evaluation - stack is reallocated (grown). - - Could not use ":" at end of variable and command names. - - Bad code generated for while and for commands with test expressions - enclosed in quotes: e.g., "set i 0; while "$i > 5" {}". - - Command trace procedures would crash if they did a Tcl_EvalObj that - reallocated the evaluation stack. - - Break and continue commands did not reset the interpreter result. - - The Tcl_ExprXXX routines, both string- or object-based, always - modified the interpreter result even if there was no error. - - The argument parsing procedure used by several compile procedures - always treated "]" as end of a command: e.g., "set a ]" would fail. - - Changed errorInfo traceback message for compilation errors from - "invoked from within" to "while compiling". - - Problem initializing Tcl object managers during interpreter creation. - - Added check and error message if formal parameter to a procedure is - an array element. (BL) - -6/23/97 (new feature) Added "registry" package to allow manipulation -of the Windows system registry. See manual entry for details. (SS) - -6/24/97 (feature change) Converted http to a package and added the -http1.0 subdirectory of the Tcl script library. This means you have -to do a "package require http" to use this, as advertised in the man page. (BW) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0b1, but not with Tcl 7.6 *** - -6/24/97 (bug fix) Ensure that Tcl_Set/GetVar C APIs, when called without -TCL_LEAVE_ERR_MSG, don't touch the interp result. (DL) - -6/26/97 (feature change) Changed name of Tcl_ExprStringObj to -Tcl_ExprObj. (BL) -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0b1, but not with Tcl 7.6 *** - ------------------ Released 8.0b2, 6/30/97 ----------------------- - -7/1/97 (new feature) TCL_BUILD_SHARED flag set in tclConfig.sh -when Tcl has been built with --enable-shared. A new tclLibObjs -make target, echoing the list of the .o's needed to build a tcl -library, is now provided. (DL) - -7/1/97 (feature change) compat/getcwd.c removed and changed the -only place where getcwd is used so a new USEGETWD flag selects -the use of the replacement "getwd". Adding this flag is recommended -for SunOS 4 (because getcwd on SunOS 4 uses a pipe to pwd(1)!). (DL) - -7/7/97 (feature change) The split command now supports binary data (i.e., -null characters in strings). (BL) - -7/7/97 (bug fix) string first returned the wrong result if the first -argument string was empty. (BL) - -7/8/97 (bug fix) Fixed core dump in fcopy that could occur when a command -callback was supplied and an error or eof condition caused no background -activity. A refcount bug triggered a panic in Tcl_ListObjAppendElement. (BW) - -7/8/97 (bug fix) Relaxed the pattern matching on http_get so you do not -need a trailing path component. You can now get away with just -http_get www.scriptics.com (BW) - -7/9/97 (bug fix) Creating anonymous interpreters no longer smashes existing -commands with names similar to the generated name. Previously creating an -anonymous interpreter could smash an existing command, now it skips until -it finds a command name that isn't being used. (JL) - -7/9/97 (feature change) Removed the policy management mechanism from the -Safe Base; left the aliases to source and load modules, and to do a limited -form of the "file" command. See entry of 11/15/96. (JL) - -7/9/97 (bug fixes) Fixed various compilation-related bugs: - - Line numbers in errorInfo now are the same as those in Tcl7.6 unless -there are compilation errors. Compilation error messages now include the -entire command in error. - - Trailing ::s after namespace names weren't being ignored. - - Could not refer to an namespace variable with an empty name using a -name of the form "n::". (BL) - -7/9/97 (bug fix) Fixed bug in Tcl_Export that prevented you from exporting -from other than the current namespace. (BL) - -7/9/97 (bug fix) env.test was removing env var needed for proper finding -of libraries in child process. (DL) - -7/10/97 (bug fixes/new feature) Cleanup in Tcl_MakeSafe. Less information -is leaked to safe interps. Error message fixes for interp sub commands. -Likewise changes in safealias.tcl; tcl_safeCreateInterp can now be called -without argument to generate the slave name (like in interp create). (DL) - -7/10/97 (bug fixes) Bytecode compiler now generates more detailed -command location information: subcommands as well as commands now have -location information. This means command trace procedures now get the -correct source string for each command in their command parameter. (BL) - -7/22/97 (bug fixes) Performance improvement in Safe interpreters -handling. Added new mask value to (tclInt.h) Interp.flags record. (DL) - -7/22/97 (bug fix) Fixed panic in 'interp target {} foo'. This bug -was present since Tcl 7.6. (JL) - -7/22/97 (bug fix) Fixed bug in compilation of procedures in namespaces: the -procedure's namespace must be used to look up compile procedures, not the -current namespace. (BL) - -7/22/97 (bug fix) Use of the -channel option of http_get was not setting -the end of line translations mode on the channel, so copying binary data -with the -channel option was corrupting the result on non-unix platforms. (BW) - -7/22/97 (bug fixes) file commands and ~user (seg fault and other -improper returns). (DL) - -7/23/97 (feature change) Reenabled "vwait" in Safe Base. (JL) - -7/23/97 (bug fixes) Fixed two bugs involving read traces on array variables -in procedures: trace procedures were sometimes not called, and reading -nonexistant array elements didn't create undefined element variables that -could later be defined by trace procedures. (BL) - -7/24/97 (bug fix) Windows memory allocation performance was -superlinear in some cases. Made the Mac allocator generic and changed -both the Mac and Windows platforms to use the new allocator instead of -malloc and free. (SS) - -7/24/97 - 8/12/97 (bug fixes/change of features) Completely revamped safe -sourcing/loading (see safe.n) to hide pathnames, use virtual -paths tokens instead, improved security in several respects and made it -more tunable. Multi level interp loading can work too now. Package auto -loading now works in safe interps as long as the package directory is in -the auto_path (no deep crawling allowed in safe interps). (DL) -*** POTENTIAL INCOMPATIBILITY with previous alpha and beta releases *** - -7/24/97 (bug fixes) Made Tcl_SetVar* and Tcl_NewString* treat a NULL value -as an empty string. (This fixes hairy crash case where you would crash -because load command for other interps assumed presence of -errorInfo...). (DL) - -7/28/97 (bug fix) Fixed pkg_mkIndex to understand namespaces. It will -use the export list of a namespace and create auto_index entries for -all export commands. Those names are in their fully qualified form in the -auto_index. Therefore, I tweaked unknown to try both $cmd and ::$cmd. -Also fixed pkg_mkIndex so you can have "package require" commands inside -your packages. These commands are ignored, which is mostly ok except -when you must load another package before loading yours because of -linking dependencies. (BW) - -7/28/97 (bug fix) A variable created by the variable command now persists -until the namespace is destroyed or the variable is unset. This is true even -if the variable has not been initialized; these variables used to be -destroyed if an error occurred when accessing them. In addition, the "info -vars" command lists uninitialized namespace variables, while the "info -exists" command returns 0 for them. (BL) - -7/29/97 (feature change) Changed the http package to use the ::http -namespace. http_get renamed to http::geturl, http_config renamed to -http::config, http_formatQuery renamed to http::formatQuery. -It now provides the 2.0 version of the package. -The 1.0 version is still available with the old names. -*** POTENTIAL INCOMPATIBILITY with Tcl 8.0b2 but not with Tcl 7.6 *** - -7/29/97 (bug fix, new feature) Tcl_Main now uses Tcl objects internally to -preserve NULLs in commands and command output. Added new API procedure -Tcl_RecordAndEvalObj that resembles Tcl_RecordAndEval but takes an object -containing a command. (BL) - -7/30/97 (bug fix) Tcl freed strings in the environ array even if it -did not allocate them. (SS) - -7/30/97 (bug fix) If a procedure is renamed into a different namespace, it -now executes in the context of that namespace. (BL) - -7/30/97 (bug fix) Prevent renaming of commands into and from namespaces as -part of hiding them. (JL) - -7/31/97 (feature change) Moved the history command from C to tcl. -This uses the ::history namespace. The "words" and "substitute" options -are no longer supported. In addition, the "keep" option without a value -returns the current keep limit. There is a new "clear" option. -The unknown command now supports !! again. (BW) -*** POTENTIAL INCOMPATIBILTY *** - -7/30/97 (bug fix) Made sure that a slave can not fool the master into -hiding the wrong command. Made sure we don't crash in hiding + namespaces -issues. (DL) - -8/4/97 (bug fix) Concat, eval, uplevel, and similar commands were -incorrectly trimming trailing space characters from their arguments -even when the space characters were preceded by a backslash. (JO) - -8/4/97 (bug fix) Removed the hard link between bgerror and tkerror. -Only bgerror is supported in tcl core. Tk will still look for a -tkerror but using regular tcl code for that feature. (DL) -*** POTENTIAL INCOMPATIBILTY with code relying on the hard link *** - -8/6/97 (bug fix) Reduced size required for compiled bytecodes by using a -more compact encoding for the command pc-to-source map. (BL) - -8/6/97 (new feature) Added support for additional compilation and execution -statistics when Tcl is compiled with the TCL_COMPILE_STATS flag. (BL) - -8/7/97 (bug fix) Expressions not in {}s that have a comparison operator as -the topmost operator must be compiled out-of-line (call the expr cmd at -runtime) to properly support expr's two-level substitution semantics. An -example is "set a 2; set b {$a}; puts [expr $b == 2]". (BL) - -8/11/97 (bug fix) The catch command would sometimes crash if a variable name -was given and the bytecode evaluation stack was grown when executing the -argument script. (BL) - -8/12/97 (feature change) Reinstated the variable tcl_precision to control -the number of digits used when floating-point values are converted to -strings, with default of 12 digits. However, had to make tcl_precision -shared among all interpreters (except that safe interpreters can't -modify it). This makes the Tcl 8.0 behavior almost identical to 7.6 -except that the default precision is 12 instead of 6. (JO) -*** POTENTIAL INCOMPATIBILITY *** - ------------------ Released 8.0, 8/18/97 ----------------------- - -8/19/97 (bug fix) Minimal fix for glob -nocomplain bugs: -"glob -nocomplain unreadableDir/*" was generating an anonymous -error. More in depth fixes will come with 8.1. (DL). - -8/20/97 (bug fix) Removed check for FLT_MIN in binary command so -underflow conditions are handled by the compiler automatic -conversions. (SS) - -8/20/97 (bug fixes) Fixed several compilation-related bugs: - - Array cmd wasn't detecting arrays that, while compiled, do not yet - exist (e.g., are marked undefined since they haven't been assigned - to yet). - - The GetToken procedure in tclCompExpr.c wasn't recognizing properly - whether an integer token was invalid. For example, "0x$" is not - a valid integer. - - Performance bug in TclExecuteByteCode: the size of its stack frame - was reduced by over 20% by moving errorInfo code elsewhere. - - Uninitialized memory read error in tclCompile.c. (BL) - -8/21/97 (bug fix) safe::interpConfigure now behave like Tk widget's -configure : it changes only the options you provide and you can get -the current value of any single option. New ?-nested boolean? and -?-statics boolean? for all safe::interp* commands but we still -accept (upward compatibility) the previously defined non valued -flags ?-noStatics? and ?-nestedLoadOk?. Improved the documentation. (DL). - -8/22/97 (bug fix) Updated PrintDbl.3 to reflect the fact that the -tcl_precision variable is still used and that it is now shared by all -interpreters. (BL) - -8/25/97 (bug fix) Fixed array access bug in IllegalExprOperandType -procedure in tclExecute.c: it was not properly supporting the || and && -operators. (BL) - -8/27/97 (bug fix) In cases where a channel handler was created with an -empty event mask while data was still buffered in the channel, the -channel code would get stuck spinning on a timer that would starve -idle handlers. This mostly happened in Tk when reading from stdin. (SS) - -9/4/97 (bug fix) Slave interps now inherit the maximum recursion limit -of their parent instead of starting back at the default. {nb: this still -does not prevent stack overflow by multi-interps recursion or aliasing} (DL) - -9/11/97 (bug fix) An uninitialized variable in Tcl_WaitPid caused -pipes to fail to report eof properly under Windows. (SS) - -9/12/97 (bug fix) "exec" was misidentifying some DOS executables as not -executable. (CCS) - -9/14/97 (bug fix) Was using the wrong structure in sizeof operation in -tclUnixChan.c. (JL) - -9/15/97 (bug fix) Fixed notifier to break out of do-one-event loop if -Tcl_WaitForEvent returns 1, so that callers of Tcl_DoOneEvent will get -a chance to check whether the event just handled is significant. This -affected mainly recursive calls to Tcl_VWaitCmd; these did not get a -chance to notice that the variable they were waiting for has been set -and thus they didn't terminate the vwait. (JL, DL, SS) - -9/15/97 (bug fix) Alignment problems in "binary format" would cause a -crash on some platforms when formatting floating point numbers. (SS) - -9/15/97 (bug fix) Fixed bug in Macintosh socket code. Now passes all -tests in socket.test that are not platform specific. (Thanks to Mark -Roseman for the pointer on the fix.) (RJ) - -9/18/97 (bug fix) Fixed bug -dictionary option of lsort that could -cause the compare function to run off the end of an array if the -number only contained 0's. (Thanks to Greg Couch for the report.) (RJ) - -9/18/97 (bug fix) TclFinalizeEnvironment was not cleaning up -properly. (DL, JI) - -9/18/97 (bug fix) Fixed long-standing bug where an "array get" command -did not trigger traces on the array or its elements. (BL) - -9/18/97 (bug fixes) Fixed compilation-related bugs: - - Fixed errorInfo traceback information for toplevel coomands that - contain nested commands. - - In the expr command, && and || now accept boolean operands as well - as numeric ones. (BL) - -9/22/97 (bug fix) Fixed bug that prevented translation modes from being -set independently for input and output on sockets if input was "auto". (JL) - -9/24/97 (bug fix) Tcl_EvalFile(3) and thus source(n) now works fine on -files containing NUL chars. (DL) - -9/26/97 (bug fix) Fixed use of uninitialized memory in the environ array -that later could cause random core dumps. Applies to all platforms. (JL) - -9/26/97 (bug fix) Fixed use of uninitialized memory in socket address data -structure under some circumstances. This could cause random core dumps. -This applies only to Unix. (JL) - -9/26/97 (bug fix) Opening files on PC-NFS volumes would cause a hang -until the system timed after the file was closed. (SS) - -10/6/97 (bug fix) The join(n) command, though objectified, was loosing -NULs in the joinString and in list elements after the 2nd one. -Now you can "join $list \0" for instance. (DL) - -10/9/97 (bug fix) Under windows, if env(TMP) or env(TEMP) referred to a -non-existent directory, exec would fail when trying to create its temporary -files. (CCS) - -10/9/97 (bug fix) Under mac and windows, "info hostname" would crash if -sockets were installed but the hostname could not be determined anyhow. -Tcl_GetHostName() was returning NULL when it should have been returning -an empty string. (CCS) - -10/10/97 (bug fix) "file attribute /" returned error on windows. (CCS) - -10/10/97 (bug fix) Fixed the auto_load procedure to handle procedures -defined in namespaces better. Also fixed pgk_mkIndex so it sees procedures -defined in nested namespaces. Index entries are still only made for -exported procedures. (BW) - -10/13/97 (bug fix) On unix, for files with unknown group or owner -attributes, querying the "file attributes" would return an error rather than -returning the group's or owner's id number, although tha command accepts -numbers when setting the file's group or owner. (CCS) - -10/22/97 (bug fix) "fcopy" did not eval the callback script at the -global scope. (SS) - -10/22/97 (bug fix) Fixed the signature of the CopyDone callback used in -the http package(s) so they can handle error cases properly. (BW) - -10/28/97 (bug fixes) Fixed a problem where lappend would free the Tcl object -in a variable if a Tcl_ObjSetVar2 failed because of an error calling a trace -on the variable. (BL) - -10/28/97 (bug fix) Changed binary scan to properly handle sign -extension of integers on 64-bit or larger machines. (SS) - -11/3/97 (bug fixes) Fixed several bugs: - - expressions such as "expr ($x)" must be compiled out-of-line - (call the expr command procedure at runtime) to ensure the correct - behavior when "$x" is an expression such as "5+10". - - "array set a {}" now creates a new array var with an empty array - value if the var didn't already exist. - - "lreplace $foo end end" no longer returns an error (just an empty - list) if foo is empty. - - upvar will no longer create a variable in a namespace that refers - to a variable in a procedure. - - deleting a command trace within a command trace callback would - make the code that calls traces to reference freed memory. - - significantly sped up "string first" and "string last" (fix from - darrel@gemstone.com). - - seg fault in Tcl_NewStringObj() when a NULL is passed as the byte - pointer argument and Tcl is compiled with -DTCL_MEM_DEBUG. - - documentation and error msg fixes. (BL) - -11/3/97 (bug fix) Fixed a number of I/O bugs related to word sizes on -64-bit machines. (SS) - -11/6/97 (bug fix) The exit code of the first process created by Tcl -on Windows was not properly reported due to an initialization -problem. (SS) - ------------------ Released 8.0p1, 11/7/97 ----------------------- - -11/19/97 (bug fix) Fixed bug in linsert where it sometimes accidently -cleared out a shared argument list object. (BL). - -11/19/97 (bug fix) Autoloading in namespaces was not working properly. -auto_mkindex is still not really namespace aware but most common -cases should now be handled properly (see init.test). (BW, DL) - -11/20/97 (enhancement) Made the changes required by the new Apple -Universal Headers V.3.0, so that Tcl will compile with CW Pro 2. - -11/24/97 (bug fix) Fixed tests in clock test suite that needed the --gmt flag set. Thanks to Jan Nijtmans for reporting the problem. (RJ) - ------------------ Released 8.0p2, 11/25/97 ----------------------- - -12/3/97 (bug fix/optimization) Removed uneeded and potentially dangerous -instances of double evaluations if "if" and "expr" statements from -the library files. It is recommended that unless you need a double -evaluation you always use "expr {...}" instead of "expr ..." and -"if {...} ..." instead of "if ... ...". It will also be faster -thanks to the byte compiler. (DL) - ----- Shipped as part of the plugin2.0b5 as 8.0p2Plugin1, Dec 8th 97 ---- - -12/8/97 (bug fix) Need to protect the newly accepted channel in an -accept callback on a socket, otherwise the callback may close it and -cause an error, which would cause the C code to attempt to close the -now deleted channel. Bumping the refcount assures that the channel sticks -around to be really closed in this case. (JL) - -12/8/97 (bug fix) Need to protect the channel in a fileevent so that it -is not deleted before the fileevent handler returns. (CS, JL) - -12/18/97 (bug fix) In the opt argument parsing package: if the description -had only flags, the "too many arguments" case was not detected. The default -value was not used for the special "args" ending argument. (DL) - -1/15/98 (improvement) Moved common part of initScript in common file. -Moved windows specific initialization to init.tcl so you can initialize -Tcl in windows without having to call Tcl_Init which is now only -searching for init.tcl {back ported from 8.1}. (DL) - ----- Shipped as part of the plugin as 8.0p2Plugin2, Jan 15th 98 ---- - -5/27/98 (bug fix) Windows socket driver did not notice new data arriving -on nonblocking sockets until the event loop was entered. (SS) - -5/27/98 (bug fix) Windows socket driver used FIONREAD, which is not -supported correctly by WinSock. (SS) - -6/9/98 (bug fix) Generic channel code failed to report readable file -events on buffered data that was left behind by a gets or read that -did not consume all available data. (SS) - -6/18/98 (bug fix) Compilation of loop expressions was too aggressive -and incorrectly inlined non-literal expressions. (SS) - -6/18/98 (bug fix) "info var" and "info locals" incorrectly reported -the existence of compiler temporary variables. (SS) - -6/18/98 (bug fix) Dictionary sorting used signed character -comparisons. (SS) - -6/18/98 (bug fix) Compile procs corrupted the exception stack in some -cases. (SS) - -6/18/98 (bug fix) Array set had erratic behavior when initializing a -variable from an empty value list. (SS) - -6/18/98 (bug fix) The Windows registry package had a bad bounds check -that could lead to a crash. (SS) - -6/18/98 (bug fix) The foreach compile proc did not correctly handle -non-local variable references. (SS) - -6/25/98 (new features) Added name resolution hooks to support [incr Tcl]. -There are new internal Tcl_*Resolver* APIs to add, query and remove the hooks. -With this changes it should be possible to dynamically load [incr Tcl] -as an extension. (MM) - -7/1/97 (bug fix) The commands "info args, body, default, procs" did -not correctly handle imported procedures. (RJ) - -7/6/98 (improvement) pkg_mkIndex now implements the "package require" -command. This makes it possible to create index files for packages -that require another package and then execute code from that package in -their file. Previously, this would throw an error because the required -package had not been loaded. The -nopkgrequied flag is provided to -revert back to the old functionality. (EMS) - -7/6/98 (improvement) back-ported the -direct flag from 8.1 into -pkg_mkIndex. This results in pkgIndex.tcl files that contain direct -source or load commands instead of tclPkgSetup commands. (EMS) - -7/6/98 (improvement) made changes to the AuxData items structures to support -storage of compiled scripts on disk. Also some related minor changes in -the compilation and execution engine. (EMS) - -6/4/98 (enhancement) Added new internal routines to support inserting -and deleting from the stat, access, and open-file-channel mechanisms. -TclAccessInsertProc, TclStatInsertProc, & TclOpenFileChannelInsertProc -insert pointers to such routines; TclAccessDeleteProc, TclStatDeleteProc, -& TclOpenFileChannelDeleteProc delete pointers to such routines. See -the file generic/tclIOUtils.c for more details. (SKS) - -7/1/98 (enhancement) Added a new internal C variable -tclPreInitScript. This is a pointer to a string that may hold an -initialization script; If this pointer is non-NULL it is evaluated in -Tcl_Init() prior to the built-in initialization script defined in the -file generic/tclInitScript.h. (SKS) - -7/6/98 (bug fix) Removed dead code in PlatformInitExitHandler so that -the TCL_LIBRARY value can be safely patched in binaries. (BW) - -7/24/98 (enhancement) Incorporated a new version of auto_mkindex that -can support the [incr Tcl] class structures. This version will index -all procedures in a source file, not just those where "proc" starts -at the beginning of the line. If you want the old behavior, use the -auto_mkindex_old procedure. (MM) - -7/24/98 (feature change) Changed the Windows registry key to be -HKEY_LOCAL_MACHINE\Software\Scriptics\Tcl\8.0, and to store the path -in the default value instead of "Root". Also, this key can be -specified at compile time in case Tcl is being used in a different -context where it needs an alternate library path from the standard Tcl -installation. (SS) - -7/24/98 (feature change) Changed the search order for init.tcl. The -tcl_library variable can now be set before calling Tcl_Init to avoid -doing any searches. If it isn't set, then Tcl checks -env(TCL_LIBRARY), the static value set at compile time, an install -directory relative to the executable, a source directory relative to -the executable, and a tcl directory relative to the source heirarchy -containing the executable. See the comment at the top of -generic/tclInitScript.h for more details. (SS) - -7/27/98 (config change) Changed the use of the DBGX flag in configure.in -and the makefile to be TCL_DBGX. Users of tclConfig.sh may need to pass -this through their configure files with AC_SUBST. (BW) - -729/98 (bug fix) Changed [info body] to return a copy of the body of a -compiled procedure instead of the body itself, to avoid invalidation -of the internal rep and loss of the byte-codes. (EMS) - -8/5/98 (bug fix) The platform init code could walk off the end of a -buffer when reading the PkgPath registry value on Windows. (SS) - -8/5/98 (Windows makefile change) Introduced a set of macros to deal with -exporting symbols when compiling DLLS on Windows. See win/README for -details. (EMS) - -8/5/98 (addendum) Added a second Windows registry key under -HKEY_LOCAL_MACHINE\Software\Scriptics\Tcl\8.0, named "pkgPath". -This is a multi-string value used to initialize the tcl_pkgPath -variable. This is required if extension DLLs are in architecture specific -subdirectories. (SS) - -8/6/98 (new feature) Added tcl_findLibrary to init.tcl for use by -extensions, including Tk. This searches in a canonical way for -an extensions library directory and initialization file. (BW) - -8/10/98 (bug fix) Imported commands used to get lost if the target -of the import was redefined. Tcl_CreateCommand and Tcl_CreateObjCommand -were updated to restore import links. (Note that if you rename a command, -the import links move to the new name, and if you delete a command then -the import links get lost. These semantics have not changed.) (MC) - --------- Released 8.0.3 to the Tcl Consortium CD-ROM project, 8/10/98 ------ - -9/3/98 (bug fix) Tcl_Realloc was failing under Windows because the -GlobalReAlloc API was not correctly re-allocating blocks that were -32k+. The fix was to use newer Win32 APIs (HeapAlloc, HeapFree, and -HeapReAlloc.) (BS) - -10/5/98 (bug fix) Fixed bug in pkg_mkIndex that caused some files that do -a "package require" of packages in the Tcl libraries to give a warning like - warning: "xx.tcl" provides more than one package ({xx 2.0} {yy 0.3}) -and generate a broken pkgIndex.tcl file. (EMS) - -10/5/98 (bug fix) Pkg_mkIndex was not doing a case-insensitive comparison -of extensions to determine whether to load or source a file. Thus, under -Windows, MYDLLNAME.DLL was sourced, and mydllname.dll loaded. (EMS) - -10/5/98 (new feature) Created a new Tcl_Obj type, "procbody". This object's -internal representation holds a pointer to a Proc structure. Extended -TclCreateProc to take both strings and "procbody". (EMS) - -10/13/98 (bug fix) The "info complete" command can now handle strings -with NULLs embedded. Thanks to colin@field.medicine.adelaide.edu.au -for providing this fix. (RJ) - -10/13/98 (bug fix) The "lsort -dictionary" command did not properly -handle some numbers starting with 0. Thanks to Richard Hipp - for submitting the fix to Scriptics. (RJ) - -10/13/98 (bug fix) The function Tcl_SetListObj was creating an invalid -Tcl_Obj if the list had zero elements (despite what the comments said -it would do). Thanks to Sebastian Wangnick for reporting the -problem. (RJ) - -10/20/98 (new feature) Added tcl_platform(debug) element to the -tcl_platform array on Windows platform. The existence of the debug -element of the tcl_platform array indicates that the particular Tcl -shell has been compiled with debug information. Using -"info exists tcl_platform(debug)" a Tcl script can direct the -interpreter to load debug versions of DLLs with the load -command. (SKS) - -10/20/98 (feature change) The Makefile and configure scripts have been -changed for IRIX to build n32 binaries instead of the old 32 abi -format. If you have extensions built with the o32 abi's you will need -to update them to n32 for them to work with Tcl. (RJ) -*** POTENTIAL INCOMPATIBILITY *** - -10/23/98 (bug fix) tcl_findLibrary had a stray ] in one of the -pathnames it searched for the initialization script. tclInitScript.h -was incorrectly adding the parent of tcl_library to tcl_pkgPath. This -logic was moved into init.tcl, and the initialization of auto_path was -documented. Thanks to Donald Porter and Tom Silva for related -patches. (BW) - -10/29/98 (bug fix) Fixed Tcl_NotifyChannel to use Tcl_Preserve instead -of Tcl_RegisterChannel so that 1) unregistered channels do not get -closed after their first fileevent, and 2) errors that occur during -close in a fileevent script are actually reflected by the close -command. (BW) - -10/30/98 (bug fix) Overhaul of pkg_mkIndex to deal with transitive -package requires and packages split among scripts and binary files. -Also fixed ommision of global for errorInfo in tcl_findLibrary. (BW) - -11/08/98 (bug fix) Fixed the resource command to always detect -the case where a file is opened a second time with the same -permissions. IM claims that this will always cause the same -FileRef to be returned, but in MacOS 8.1+, this is no longer the case, -so we have to test for this explicitly. (JI) - -11/10/98 (feature change) When compiling with Metrowerk's MSL, use the -exit function from MSL rather than ExitToShell. This allows MSL to -clean up its temporary files. Thanks to Vince Darley for this -improvement. (JI) - ------------------ Released 8.0.4, 11/19/98 ------------------------- - -11/20/98 (bug fix) Handle possible NULL return in TclGetStdFiles. (RJ) - -11/20/98 (bug fix) The dltests would not build on SGI. They reported -that you could not mix n32 with 032 binaries. The configure script -has been modified to get the EXTRA_CFLAGS from the tcl configure -script. [Bug id: 840] (RJ) - -12/3/98 (bug fix) Windows NT creates sockets so they are inheritable -by default. Fixed socket code so it turns off this bit right after -creation so sockets aren't kept open by exec'ed processes. [Bug: 892] -Thanks to Kevin Kenny for this fix. (SS) - -1/11/98 (bug fix) On HP, "info sharedlibextension" was returning -empty string on static apps. It now always returns ".sl". (RJ) - -1/28/99 (configure change) Now support -pipe option on gcc. (RJ) - -2/2/99 (bug fix) Fixed initialization problem on Windows where no -searching for init.tcl would be performed if the registry keys were -missing. (stanton) - -2/2/99 (bug fix) Added support for HKEY_PERFORMANCE_DATA and -HKEY_DYN_DATA keys in the "registry" command. (stanton) - -2/2/99 (bug fix) ENOTSUP and EOPNOTSUPP clashed on some Linux -variants. (stanton) - -2/2/99 (enhancement) The "open" command has been changed to use the -object interfaces. (stanton) - -2/2/99 (bug fix) In some cases Tcl would crash due to an overflow of -the exception stack resulting from a missing byte code in some -expressions. (stanton) - -2/2/99 (bug fix) Changed configure so Linux and IRIX shared libraries -are linked with the system libraries. (stanton) - -2/2/99 (bug fix) Added support for BSDI 4.x (BSD/OS-4*) to the -configure script. (stanton) - -2/2/99 (bug fix) Fixed bug where upvar could resurrect a namespace -variable after the namespace had been deleted. (stanton) - -2/2/99 (bug fix) In some cases when creating variables, the -interpreter result was being modified even if the TCL_LEAVE_ERR_MSG -flag was set. (stanton) - -2/2/99 (bug fix & new feature) Changed the socket drivers to properly -handle failures during an async socket connection. Added a new -fconfigure option "-error" to retrieve the failure message. See the -socket.n manual entry for details. (stanton) - -2/2/99 (bug fix) Deleting a renamed interp alias could result in a -panic. (stanton) - -2/2/99 (feature change/bug fix) Changed the behavior of "file -extension" so that it splits at the last period. Now the extension of -a file like "foo..o" is ".o" instead of "..o" as in previous versions. -*** POTENTIAL INCOMPATIBILITY *** - ------------------ Released 8.0.5, 3/9/99 ------------------------- - -======== Changes for 8.0 go above this line ======== -======== Changes for 8.1 go below this line ======== - -6/18/97 (new feature) Tcl now supports international character sets: - - All C APIs now accept UTF-8 strings instead of iso8859-1 strings, - wherever you see "char *", unless explicitly noted otherwise. - - All Tcl strings represented in UTF-8, which is a convenient - multi-byte encoding of Unicode. Variable names, procedure names, - and all other values in Tcl may include arbitrary Unicode characters. - For example, the Tcl command "string length" returns how many - Unicode characters are in the argument string. - - For Java compatibility, embedded null bytes in C strings are - represented as \xC080 in UTF-8 strings, but the null byte at the end - of a UTF-8 string remains \0. Thus Tcl strings once again do not - contain null bytes, except for termination bytes. - - For Java compatibility, "\uXXXX" is used in Tcl to enter a Unicode - character. "\u0000" through "\uffff" are acceptable Unicode - characters. - - "\xXX" is used to enter a small Unicode character (between 0 and 255) - in Tcl. - - Tcl automatically translates between UTF-8 and the normal encoding for - the platform during interactions with the system. - - The fconfigure command now supports a -encoding option for specifying - the encoding of an open file or socket. Tcl will automatically - translate between the specified encoding and UTF-8 during I/O. - See the directory library/encoding to find out what encodings are - supported (eventually there will be an "encoding" command that - makes this information more accessible). - - There are several new C APIs that support UTF-8 and various encodings. - See Utf.3 for procedures that translate between Unicode and UTF-8 - and manipulate UTF-8 strings. See Encoding.3 for procedures that - create new encodings and translate between encodings. See - ToUpper.3 for procedures that perform case conversions on UTF-8 - strings. - -9/18/97 (enhancement) Literal objects are now shared by the ByteCode -structures created when compiled different scripts. This saves up to 45% -of the total memory needed for all literals. (BL) - -9/24/97 (bug fixes) Fixed Tcl_ParseCommand parsing of backslash-newline -sequences at start of command words. Suppressed Tcl_EvalDirect error logging -if non-TCL_OK result wasn't an error. (BL) - -10/17/97 (feature enhancement) "~username" now refers to the users' home -directory on Windows (previously always returned failure). (CCS) - -10/20/97 (implementation change) The Tcl parser has been completely rewritten -to make it more modular. It can now be used to parse a script without actually -executing it. The APIs for the new parser are not correctly exported, but -they will eventually be exported and augmented with Tcl commands so that -Tcl scripts can parse other Tcl scripts. (JO) - -10/21/97 (API change) Added "flags" argument to Tcl_EvalObj, removed -Tcl_GlobalEvalObj procedure. Added new procedures Tcl_Eval2 and -Tcl_EvalObjv. (JO) -*** POTENTIAL INCOMPATIBILITY *** - -10/22/97 (API change) Renamed Tcl_ObjSetVar2 and Tcl_ObjGetVar2 to -Tcl_SetObjVar2 and Tcl_GetObjVar2 (for consistency with other C APIs) -and changed the name arguments to be strings instead of objects. (JO) -*** POTENTIAL INCOMPATIBILITY *** - -10/27/97 (enhancement) Bytecode compiler rewritten to use the new Tcl -parser. (BL) - -11/3/97 (New routines) Added Tcl_AppendObjToObj, which appends the -string rep of one Tcl_Obj to another. Added Tcl_GetIndexFromObjStruct, -which is similar to Tcl_GetIndexFromObj, except that you can give an -offset between strings. This allows Tcl_GetIndexFromObjStruct to be -called with a table of records which have strings in them. (SRP) - -12/4/97 (enhancement) New Tcl expression parser added. Added new procedure -Tcl_ParseExpr and new token types TCL_TOKEN_SUB_EXPR and -TCL_TOKEN_OPERATOR. Expression compiler is reimplemented to use this -parser. (BL) - -12/9/97 (bug fix) Tcl_EvalObj() increments/decrements the refcount of the -script object to prevent the object from deleting itself while in the -middle of being evaluated. (CCS) - -12/9/97 (bug fix) Memory leak in Tcl_GetsObjCmd(). (CCS) - -12/11/97 (bug fix) Environment array leaked memory when compiled with -Visual C++. (SS) - -12/11/97 (bug fix) File events and non-blocking I/O did not work on -pipes under Windows. Changed to use threads to achieve non-blocking -behavior. (SS) - -12/18/97 (bug fixes) Fixed segfault in "namespace import"; importing a -procedure that causes a cycle now returns an error. Modified "info procs", -"info args", "info body", and "info default" to return information about -imported procedures as well as procedures defined in a namespace. (BL) - -12/19/97 (enhancement) Added new Tcl_GetString() procedure that can be used -in place of Tcl_GetStringFromObj() if the string representation's length -isn't needed. (BL) - -12/18/97 (bug fix) In the opt argument parsing package: if the description -had only flags, the "too many arguments" case was not detected. The default -value was not used for the special "args" ending argument. (DL) - -1/7/98 (clean up) Moved everything not absolutly necessary out of init.tcl -procs now in auto.tcl and package.tcl can be autoloaded if needed. (DL) - -1/7/98 (enhancement) tcltest made at install time will search for it's -init.tcl where it is, even when using virtual path compilation. (DL) - -1/8/98 (os bug workaround) when needed, using a replacement for memcmp so -string compare "char with high bit set" "char w/o high bit set" returns -the expected value on all platforms. (DL) - -1/8/98 (unix portability/configure) building from .../unix/targetName/ -subdirectories and simply using "../configure" should now work fine. (DL) - -1/14/98 (enhancement) Added new regular expression package that -supports AREs, EREs, and BREs. The new package includes new escape -characters, meta-syntax, and character classes inside brackets. -Regexps involving backslashes may behave differently. (MH) -*** POTENTIAL INCOMPATIBILITY *** - -1/16/98 (os workaround) Under windows, "file volume" was causing chatter -and/or several seconds of hanging when querying empty floppy drives. -Changed implementation to call an empirically-derived function that doesn't -cause this. (CCS) - -1/16/98 (enhancement) Converted regular expressions to a Tcl_Obj type so -their compiled form gets cached automatically. Reduced NSUBEXP from 100 -to 20. (BW) - -1/16/98 (documentation) Change unclear documentation and comments for -functions like Tcl_TranslateFileName() and Tcl_ExternalToUtfDString(). Now -it explicitly says they take an uninitialized or free DString. A DString -that is "empty" or "not holding anything" could have been interpreted as one -currently with a zero length, but with a large dynamically allocated buffer. -(CCS) - ------------------ Released 8.1a1, 1/22/98 ----------------------- - -1/28/98 (new feature) Added a "-direct" optional flag to pkg_mkIndex -to generate direct loading package indexes (such those you need -if you use namespaces and plan on using namespace import just after -package require). pkg_mkIndex still has limitations regarding -package dependencies but errors are now ignored and with -direct, correct -package indexes can be generated even if there are dependencies as long -as the "package provide" are done early enough in the files. (DL) - -1/28/98 (enhancement) Performance tuning of regexp and regsub. (CCS) - -1/28/98 (bug fix) regexp and regsub with "-indices" returned the byte-offsets -of the characters in the UTF-8 representation, not the character offsets -themselves. (CCS) - -1/28/98 (bug fix) "clock format 0 -format %Z -gmt 1" would return the local -timezone string instead of "GMT" on Solaris and Windows. - -1/28/98 (bug fix) Restore tty settings when closing serial device on Unix. -This is good behavior when closing real serial devices, essential when -closing the pseudo-device /dev/tty because the user's terminal settings -would be left useless, in raw mode, when tcl quit. (CCS) - -1/28/98 (bug fix) Tcl_OpenCommandChannel() was modifying the contents of the -argv array passed to it, causing problems for any caller that wanted to -continue to use the argv array after calling Tcl_OpenCommandChannel(). (CCS) - -2/1/98 (bug fix) More bugs with %Z in format string argument to strftime(): -1. Borland always returned empty string. -2. MSVC always returned the timezone string for the current time, not the - timezone string for the specified time. -3. With MSVC, "clock format 0 -format %Z -gmt 1" would return "GMT" the first - time it was called, but would return the current timezone string on all - subsequent calls. (CCS) - -2/1/98 (bug fix) "file stat" was broken on Windows. -1. "file stat" of a root directory (local or network) or a relative path that - resolved to a root directory (c:. when in pwd was c:/) was returning error. -2. "file stat" on a regular file (S_IFREG), the st_mode was sign extended to - a negative int if the platform-dependant type "mode_t" was declared as a - short instead of an unsigned short. -3. "file stat" of a network directory, the st_dev was incorrectly reported - as the id of the last accessed local drive rather than the id of the - network drive. (CCS) - -2/1/98 (bug fix) "file attributes" of a relative path that resolved to a -root directory was returning error. (CCS) - -2/1/98 (bug fix) Change error message when "file attribute" could not -determine the attributes for a file. Previously it would return different -error messages on Unix vs. Windows vs. Mac. (CCS) - -2/4/98 (bug fixes) Fixed several instances of bugs where the parser/compiler -would reach outside the range of allocated memory. Improved the array -lookup algorithm in set compilation. (DL) - -2/5/98 (change) The TCL_PARSE_PART1 flag for Set/Get(Obj)Var2 C APIs is now -deprecated and ignored. The part1 is always parsed when the part2 argument -is NULL. This is to avoid a pattern of errors for extension writers converting -from string based Tcl_SetVar() to new Tcl_SetObjVar2() and who could easily -forget to provide the flag and thus get code working for normal variables -but not for array elements. The performance hit is minimal. A side effect -of that change is that is is no longer possible to create scalar variables -that can't be accessed by tcl scripts because of their invalid name -(ending with parenthesis). Likewise it is also parsed and checked to -ensure that you don't create array elements of array whose name is a valid -array element because they would not be accessible from scripts anyway. -Note: There is still duplicate array elements parsing code. (DL) -*** POTENTIAL INCOMPATIBILITY *** - -2/11/98 (bug fix) Sharing objects between interps, such as by "interp -eval" or "send" could cause a crash later when dereferencing an interp -that had been deleted, given code such as: - set a {set x y} - interp create foo - interp eval foo $a - interp delete foo - unset a -Interp "foo" was gone, but "a" had a internal rep consisting of bytecodes -containing a dangling pointer to "foo". Unsetting "a" would attempt to -return resources back to "foo", causing a crash as random memory was -accessed. The lesson is that that if an object's internal rep depends on -an interp (or any other data structure) it must preserve that data in -some fashion. (CCS) - -2/11/98 (enhancement) The "interp" command was returning inconsistent error -messages when the specified slave interp could not be found. (CCS) - -2/11/98 (bug fix) Result codes like TCL_BREAK and TCL_CONTINUE were not -propagating through the master/slave interp boundaries, such as "interp -eval" and "interp alias". TCL_OK, TCL_ERROR, and non-standard codes like -teh integer 57 work. There is still a question as to whether TCL_RETURN -can/should propagate. (CCS) - -2/11/98 (bug fix) TclCompileScript() was derefering memory 1 byte before -start of the string to compile, looking for ']'. (CCS,DL) - -2/11/98 (bug fix) Tcl_Eval2() was derefering memory 1 byte before start -of the string to eval, looking for ']'. (CCS,DL) - -2/11/98 (bug fix) Compiling "set a(b" was running off end of string. (CCS,DL) - -2/11/98 (bug fix) Windows initialization code was dereferencing -uninitialized memory if TCL_LIBRARY environment didn't exist. (CCS) - -2/11/98 (bug fix) Windows "registry" command was dereferencing -uninitialized memory when constructing the $errorCode for a failed -registry call. (CCS) - -2/11/98 (enhancement) Eliminate the TCL_USE_TIMEZONE_VAR definition from -configure.in, because it was the same information as the already existing -HAVE_TM_ZONE definition. The lack of HAVE_TM_ZONE is used to work around a -Solaris and Windows bug where "clock format [clock sec] -format %Z -gmt 1" -produces the local timezone string instead of "GMT". (CCS) - -2/11/98 (bug fix) Memleaks and dereferencing of uninitialized memory in -regexp if an error occurred while compiling a regular expression. (CCS). - -2/18/98 (new feature) Added mutexes and thread local storage in order -to make Tcl thread safe. For testing purposes, there is a testthread -command that creates a new thread and an interpreter inside it. See -thread.test for examples, but this script-level interface is not fixed. -Each thread has its own notifier instance to manage its own events, -and threads can post messages to each other's message queue. -This uses pthreads on UNIX, and native thread support on other platforms. -You enable this by configuring with --enable-threads. Note that at -this time *Tk* is still not thread safe. Special thanks to -Richard Hipp: his earlier implementation inspired this work. (BW, SS, JI) - -2/18/98 (hidden feature change) The way the env() array is shared among -interpreters changed. Updates to env used to trigger write traces in -other interpreters. This undocumented feature is no longer implemented. -Instead, variable tracing is used to keep the C-level environ array in sync -with the Tcl-level env array. This required adding TCL_TRACE_ARRAY support -to Tcl_TraceVar2 so that array names works properly. (BW) -*** POTENTIAL INCOMPATIBILITY *** - -2/18/98 (enhancement) Conditional compilation for unix systems (e.g., -IRIX, SCO) that use f_bsize instead of st_blksize to determine disk block -size. (CCS) - -2/23/98 (bug fix) Fixed the emulation of polling selects in the threaded -version of the Unix notifier. The bug was showing up on a multiprocessor -as starvation of the notifier thread. (BW) - ------------------ Released 8.1a2, Feb 23 1998 ----------------------- - -9/22/98 (bug fix) Changed the value of TCL_TRACE_ARRAY so it no longer -conflicts with the deprecated TCL_PARSE_PART1 flag. This should -improve portability of C code. (stanton) - -10/6/98 (bug fix) The compile procedure for "if" incorrectly attempted -to match against the literal string "if", resulting in a stack -overflow when "::if" was compiled. It also would incorrectly accept -"if" instead of "elsif" in later clauses. (stanton) - -10/15/98 (new feature) Added a "totitle" subcommand to the "string" -command to convert strings to capitalize the first character of a string -and lowercase all of the other characters. (stanton) - -10/15/98 (bug fix) Changed regexp and string commands to properly -handle case folding according to the Unicode character -tables. (stanton) - -10/21/98 (new feature) Added an "encoding" command to facilitate -translations of strings between different character encodings. See -the encoding.n manual entry for more details. (stanton) - -11/3/98 (bug fix) The regular expression character classification -syntax now includes Unicode characters in the supported -classes. (stanton) - -11/6/98 (bug fix) Variable traces were causing crashes when upvar -variables went out of scope. [Bug: 796] (stanton) - -11/9/98 (bug fix) "format" now correctly handles multibyte characters -in %s format strings. (stanton) - -11/10/98 (new feature) "regexp" now accepts three new switches -("-line", "-lineanchor", and "-linestop") that control how regular -expressions treat line breaks. See the regexp manual entry for more -details. (stanton) - -11/17/98 (bug fix) "scan" now correctly handles Unicode -characters. (stanton) - -11/17/98 (new feature) "scan" now supports XPG3 position specifiers -and the "%n" conversion character. See the "scan" manual entry for -more details. (stanton) - -11/17/98 (bug fix) The Tcl memory allocator now returns 8-byte aligned -chunks of memory which improves performance on Windows and avoids -crashes on other platforms. [Bug: 834] (stanton) - -11/23/98 (bug fix) Applied various regular expression performance bug -fixes supplied by Henry Spencer. (stanton) - -11/30/98 (bug fix) Fixed various thread related race conditions. [Bug: -880 & 607] (stanton) - -11/30/98 (bug fix) Fixed a number of memory overflow and leak -bugs. [Bug: 584] (stanton) - -12/1/98 (new feaure) Added support for Korean encodings. (stanton) - -12/1/98 (feature change) Changed the Tcl_EvalObjv interface to remove -the string and length arguments. -*** POTENTIAL INCOMPATIBILITY with previous alpha releases *** - -12/2/98 (bug fix) Fixed various bugs related to line feed -translation. [Bug: 887] (stanton) - -12/4/98 (new feature) Added a message catalog facility to help with -localizing Tcl scripts. Thanks to Mark Harrison for contributing the -initial implementation of the "msgcat" package. (stanton) - -12/7/98 (bug fix) The memory allocator was failing to update the -block list for large memory blocks that were reallocated into a -different address. [Bug: 933] (stanton) - ------------------ Released 8.1b1, Dec 10 1998 ----------------------- - -12/22/98 (performance improvement) Improved the -command option of the -lsort command to better use the object system for improved -performance (about 5x speed up). Thanks to Syd Polk for suppling the -patch. [RFE: 726] (rjohnson) - -2/10/99 (bug fix) Restored the Tcl_ObjSetVar2/Tcl_ObjGetVar2 -interfaces from 8.0 and renamed the Tcl_GetObjVar2/Tcl_SetObjVar2 -interfaces to Tcl_GetVar2Ex and Tcl_SetVar2Ex. This should provide -better compatibility with 8.0. (stanton) -*** POTENTIAL INCOMPATIBILITY with previous alpha/beta releases *** - -2/10/99 (bug fix) Made the eval interfaces compatible with 8.0 by -renaming Tcl_EvalObj to Tcl_EvalObjEx, renaming Tcl_Eval2 to -Tcl_EvalEx and restoring Tcl_EvalObj and Tcl_GlobalEvalObj interfaces -so they match Tcl 8.0. (stanton) -*** POTENTIAL INCOMPATIBILITY with previous alpha/beta releases *** - -2/25/99 (bug fix/new feature) On Windows, the channel drivers for -consoles and serial ports now completely support file events. (redman) - -3/5/99 (bug fix) Integrated patches to fix various configure problems -that affected HP-UX-11, 64-bit IRIX, Linux, and Solaris. (stanton) - -3/9/99 (bug fix) Integrated various AIX related patches to improve -support for shared libraries. (stanton) - -3/9/99 (new feature) Added tcl_platform(user) to provide a portable -way to get the name of the current user. (welch) - -3/9/99 (new feature) Integrated the stub library mechanism contributed -by Jan Nijtmans, Paul Duffin, and Jean-Claude Wippler. This feature -should make it possible to write extensions that support multiple -versions of Tcl simultaneously. It also makes it possible to -dynamically load extensions into statically linked interpreters. This -patch includes the following changes: - - Added a Tcl_InitStubs() interface - - Added Tcl_PkgProvideEx, Tcl_PkgRequireEx, Tcl_PkgPresentEx, - and Tcl_PkgPresent. - - Added va_list versions of all VARARGS functions so they can be - invoked from wrapper functions. -See the manual for more information. (stanton) - - -3/10/99 (feature change) Replaced Tcl_AlertNotifier with -Tcl_ThreadAlert since the Tcl_AlertNotifier function relied on passing -internal data structures. (stanton) -*** POTENTIAL INCOMPATIBILITY with previous alpha/beta releases *** - -3/10/99 (new feature) Added a Tcl_GetVersion API to make it easier to -check the Tcl version and patch level from C. (redman) - -3/14/99 (feature change) Tried to unify the TclpInitLibrary path -routines to look in similar places from Windows to UNIX. The new -library search path is: TCL_LIBRARY, TCL_LIBRARY/../tcl8.1, relative -to DLL (Windows Only) relative to installed executable, relative to -develop executable, and relative to compiled-in in location (UNIX -Only.) This fix included: - - Defining a TclpFindExecutable - - Moving Tcl_FindExecutable to a common area in tclEncoding.c - - Modifying the TclpInitLibraryPath routines. -(surles) - -3/14/99 (feature change) Added hooks for TclPro Wrapper to initialize -the location of the encoding files and libraries. This fix included: - - Adding the TclSetPerInitScript routine. - - Modifying the Tcl_Init routines to evaluate the non-NULL - pre-init script. - - Adding the Tcl_SetdefaultEncodingDir and Tcl_GetDefaultEncodingDir - routines. - - Modifying the TclpInitLibrary routines to append the default - encoding dir. -(surles) - -3/14/99 (feature change) Test suite now uses "test" namespace to -define the test procedure and other auxiliary procedures as well as -global variables. - - Global array testConfige is now called ::test::testConfig. - - Global variable VERBOSE is now called ::test::verbose, and - ::test::verbose no longer works with numerical values. We've - switched to a bitwise character string. You can set - ::test::verbose by using the -verbose option on the Tcl command - line. - - Global variable TESTS is now called ::test::matchingTests, and - can be set on the Tcl command line via the -match option. - - There is now a ::test::skipTests variable (works similarly to - ::test::matchTests) that can be set on the Tcl command line via - the -match option. - - The test suite can now be run in any working directory. When - you run "make test", the working directory is nolonger switched - to ../tests. -(hirschl) -*** POTENTIAL INCOMPATIBILITY *** - ---------------- Released 8.1b2, March 16, 1999 ---------------------- - -3/18/99 (bug fix) Fixed missing/incorrect characters in shift-jis table -(stanton) - -3/18/99 (feature change) The glob command ignores the -FS_CASE_IS_PRESERVED bit on file systesm and always returns -exactly what it gets from the system. (stanton) -*** POTENTIAL INCOMPATIBILITY *** - -3/19/99 (new feature) Added support for --enable-64bit. For now, -this is only supported on Solaris 7 64bit (SunOS 5.7) using the Sun -compiler. (redman) - -3/23/99 (bug fix) Fixed fileevents and gets on Windows consoles and -serial devices so that non-blocking channels do not block on partial -input lines. (redman) - -3/23/99 (bug fix) Added a new Tcl_ServiceModeHook interface. -This is used on Windows to avoid the various problems that people -have been seeing where the system hangs when tclsh is running -outside of the event loop. As part of this, renamed -TclpAlertNotifier back to Tcl_AlertNotifier since it is public. -(stanton) - -3/23/99 (feature change) Test suite now uses "tcltest" namespace to -define the test procedure and other auxiliary procedures as well as -global variables. The previously chosen "test" namespace was thought -to be too generic and likely to create conflits. -(hirschl) -*** POTENTIAL INCOMPATIBILITY *** - -3/24/99 (bug fix) Make sockets thread safe on Windows. -(redman) - -3/24/99 (bug fix) Fix cases where expr would incorrect return -a floating point value instead of an integer. (stanton) - -3/25/99 (bug fix) Added ASCII to big5 and gb2312 encodings. -(stanton) - -3/25/99 (feature change) Changed so aliases are invoked at current -scope in the target interpreter instead of at the global scope. This -was an incompatibility introduced in 8.1 that is being removed. -(stanton) -*** POTENTIAL INCOMPATIBILITY with previous beta releases *** - -3/26/99 (feature change) --nameble-shared is now the default and build -Tcl as a shared library; specify --disable-shared to build a static Tcl -library and shell. -*** POTENTIAL INCOMPATIBILITY *** - -3/29/99 (bug fix) Removed the stub functions and changed the stub -macros to just use the name without params. Pass &tclStubs into the -interp (don't use tclStubsPtr because of collisions with the stubs on -Solaris). (redman) - -3/30/99 (bug fix) Loadable modules are now unloaded at the last -possible moment during Tcl_Finalize to fix various exit-time crashes. -(welch) - -3/30/99 (bug fix) Tcl no longer calls setlocale(). It looks at -env(LANG) and env(LC_TYPE) instead. (stanton) - -4/1/99 (bug fix) Fixed the Ultrix multiple symbol definition problem. -Now, even Tcl includes a copy of the Tcl stub library. (redman) - -4/1/99 (bug fix) Internationalized the registry package. - -4/1/99 (bug fix) Changed the implemenation of Tcl_ConditionWait and -Tcl_ConditionNotify on Windows. The new algorithm eliminates a race -condition and was suggested by Jim Davidson. (welch) - -4/2/99 (new apis) Made various Unicode utility functions public. -Tcl_UtfToUniCharDString, Tcl_UniCharToUtfDString, Tcl_UniCharLen, -Tcl_UniCharNcmp, Tcl_UniCharIsAlnum, Tcl_UniCharIsAlpha, -Tcl_UniCharIsDigit, Tcl_UniCharIsLower, Tcl_UniCharIsSpace, -Tcl_UniCharIsUpper, Tcl_UniCharIsWordChar, Tcl_WinUtfToTChar, -Tcl_WinTCharToUtf (stanton) - -4/2/99 (feature change) Add new DDE package and removed the Tk -send command from the Windows version. Changed DDE-based send -code into "dde eval" command. The DDE package can be loaded -into tclsh, not just wish. Windows only. (redman) - -4/5/99 (bug fix) Changed safe-tcl so that the encoding command -is an alias that masks out the "encoding system" subcommand. -(redman) - -4/5/99 (bug fix) Configure patches to improve support for -OS/390 and BSD/OS 4.*. (stanton) - -4/5/99 (bug fix) Fixed crash in the clock command that occurred -with negative time values in timezones east of GMT. (stanton) - -4/6/99 (bug fix) Moved the "array set" C level code into a common -routine (TclArraySet). The TclSetupEnv routine now uses this API to -create an env array w/ no elements. This fixes the bug caused when -every environ varaible is removed, and the Tcl env variable is -synched. If no environ vars existed, the Tcl env var would never be -created. (surles) - -4/6/99 (bug fix) Made the Env module I18N compliant. (surles) - -4/6/99 (bug fix) Changed the FindVariable routine to TclpFindVariable, -that now does a case insensitive string comparison on Windows, and not -on UNIX. (surles) - - ---------------- Released 8.1b3, April 6, 1999 ---------------------- - diff --git a/compat/README b/compat/README deleted file mode 100644 index 38b9b05..0000000 --- a/compat/README +++ /dev/null @@ -1,8 +0,0 @@ -This directory contains various header and code files that are -used make Tcl compatible with various releases of UNIX and UNIX-like -systems. Typically, files from this directory are used to compile -Tcl when a system doesn't contain the corresponding files or when -they are known to be incorrect. When the whole world becomes POSIX- -compliant this directory should be unnecessary. - -RCS: @(#) $Id: README,v 1.2 1998/09/14 18:39:44 stanton Exp $ diff --git a/compat/dirent.h b/compat/dirent.h deleted file mode 100644 index 1368018..0000000 --- a/compat/dirent.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * dirent.h -- - * - * This file is a replacement for in systems that - * support the old BSD-style with a "struct direct". - * - * Copyright (c) 1991 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: dirent.h,v 1.2 1998/09/14 18:39:44 stanton Exp $ - */ - -#ifndef _DIRENT -#define _DIRENT - -#include - -#define dirent direct - -#endif /* _DIRENT */ diff --git a/compat/dirent2.h b/compat/dirent2.h deleted file mode 100644 index 7c2406c..0000000 --- a/compat/dirent2.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * dirent.h -- - * - * Declarations of a library of directory-reading procedures - * in the POSIX style ("struct dirent"). - * - * Copyright (c) 1991 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: dirent2.h,v 1.2 1998/09/14 18:39:44 stanton Exp $ - */ - -#ifndef _DIRENT -#define _DIRENT - -#ifndef _TCL -#include -#endif - -/* - * Dirent structure, which holds information about a single - * directory entry. - */ - -#define MAXNAMLEN 255 -#define DIRBLKSIZ 512 - -struct dirent { - long d_ino; /* Inode number of entry */ - short d_reclen; /* Length of this record */ - short d_namlen; /* Length of string in d_name */ - char d_name[MAXNAMLEN + 1]; /* Name must be no longer than this */ -}; - -/* - * State that keeps track of the reading of a directory (clients - * should never look inside this structure; the fields should - * only be accessed by the library procedures). - */ - -typedef struct _dirdesc { - int dd_fd; - long dd_loc; - long dd_size; - char dd_buf[DIRBLKSIZ]; -} DIR; - -/* - * Procedures defined for reading directories: - */ - -extern void closedir _ANSI_ARGS_((DIR *dirp)); -extern DIR * opendir _ANSI_ARGS_((char *name)); -extern struct dirent * readdir _ANSI_ARGS_((DIR *dirp)); - -#endif /* _DIRENT */ diff --git a/compat/dlfcn.h b/compat/dlfcn.h deleted file mode 100644 index 1dee078..0000000 --- a/compat/dlfcn.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * dlfcn.h -- - * - * This file provides a replacement for the header file "dlfcn.h" - * on systems where dlfcn.h is missing. It's primary use is for - * AIX, where Tcl emulates the dl library. - * - * This file is subject to the following copyright notice, which is - * different from the notice used elsewhere in Tcl but rougly - * equivalent in meaning. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: dlfcn.h,v 1.2 1998/09/14 18:39:44 stanton Exp $ - */ - -/* - * @(#)dlfcn.h 1.4 revision of 95/04/25 09:36:52 - * This is an unpublished work copyright (c) 1992 HELIOS Software GmbH - * 30159 Hannover, Germany - */ - -#ifndef __dlfcn_h__ -#define __dlfcn_h__ - -#ifndef _TCL -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Mode flags for the dlopen routine. - */ -#define RTLD_LAZY 1 /* lazy function call binding */ -#define RTLD_NOW 2 /* immediate function call binding */ -#define RTLD_GLOBAL 0x100 /* allow symbols to be global */ - -/* - * To be able to intialize, a library may provide a dl_info structure - * that contains functions to be called to initialize and terminate. - */ -struct dl_info { - void (*init) _ANSI_ARGS_((void)); - void (*fini) _ANSI_ARGS_((void)); -}; - -VOID *dlopen _ANSI_ARGS_((const char *path, int mode)); -VOID *dlsym _ANSI_ARGS_((void *handle, const char *symbol)); -char *dlerror _ANSI_ARGS_((void)); -int dlclose _ANSI_ARGS_((void *handle)); - -#ifdef __cplusplus -} -#endif - -#endif /* __dlfcn_h__ */ diff --git a/compat/fixstrtod.c b/compat/fixstrtod.c deleted file mode 100644 index 165b7d1..0000000 --- a/compat/fixstrtod.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * fixstrtod.c -- - * - * Source code for the "fixstrtod" procedure. This procedure is - * used in place of strtod under Solaris 2.4, in order to fix - * a bug where the "end" pointer gets set incorrectly. - * - * Copyright (c) 1995 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: fixstrtod.c,v 1.2 1998/09/14 18:39:44 stanton Exp $ - */ - -#include - -#undef strtod - -/* - * Declare strtod explicitly rather than including stdlib.h, since in - * somes systems (e.g. SunOS 4.1.4) stdlib.h doesn't declare strtod. - */ - -extern double strtod(); - -double -fixstrtod(string, endPtr) - char *string; - char **endPtr; -{ - double d; - d = strtod(string, endPtr); - if ((endPtr != NULL) && (*endPtr != string) && ((*endPtr)[-1] == 0)) { - *endPtr -= 1; - } - return d; -} diff --git a/compat/float.h b/compat/float.h deleted file mode 100644 index 049f4a8..0000000 --- a/compat/float.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * float.h -- - * - * This is a dummy header file to #include in Tcl when there - * is no float.h in /usr/include. Right now this file is empty: - * Tcl contains #ifdefs to deal with the lack of definitions; - * all it needs is for the #include statement to work. - * - * Copyright (c) 1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: float.h,v 1.2 1998/09/14 18:39:44 stanton Exp $ - */ diff --git a/compat/gettod.c b/compat/gettod.c deleted file mode 100644 index 9fc0ca5..0000000 --- a/compat/gettod.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gettod.c -- - * - * This file provides the gettimeofday function on systems - * that only have the System V ftime function. - * - * Copyright (c) 1995 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: gettod.c,v 1.2 1998/09/14 18:39:44 stanton Exp $ - */ - -#include "tcl.h" -#include "tclPort.h" -#include - -#undef timezone - -int -gettimeofday(tp, tz) -struct timeval *tp; -struct timezone *tz; -{ - struct timeb t; - ftime(&t); - tp->tv_sec = t.time; - tp->tv_usec = t. millitm * 1000; - return 0; -} - diff --git a/compat/limits.h b/compat/limits.h deleted file mode 100644 index 96b0b50..0000000 --- a/compat/limits.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * limits.h -- - * - * This is a dummy header file to #include in Tcl when there - * is no limits.h in /usr/include. There are only a few - * definitions here; also see tclPort.h, which already - * #defines some of the things here if they're not arleady - * defined. - * - * Copyright (c) 1991 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: limits.h,v 1.2 1998/09/14 18:39:44 stanton Exp $ - */ - -#define LONG_MIN 0x80000000 -#define LONG_MAX 0x7fffffff -#define INT_MIN 0x80000000 -#define INT_MAX 0x7fffffff -#define SHRT_MIN 0x8000 -#define SHRT_MAX 0x7fff diff --git a/compat/memcmp.c b/compat/memcmp.c deleted file mode 100644 index 09a5724..0000000 --- a/compat/memcmp.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * memcmp.c -- - * - * Source code for the "memcmp" library routine. - * - * Copyright (c) 1998 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) memcmp.c 1.2 98/01/19 10:48:58 - */ - -#include "tcl.h" -#include "tclPort.h" - -/* - * Here is the prototype just in case it is not included - * in tclPort.h. - */ - -int memcmp _ANSI_ARGS_((CONST VOID *s1, - CONST VOID *s2, size_t n)); - -/* - *---------------------------------------------------------------------- - * - * memcmp -- - * - * Compares two bytes sequences. - * - * Results: - * compares its arguments, looking at the first n - * bytes (each interpreted as an unsigned char), and returns - * an integer less than, equal to, or greater than 0, accord- - * ing as s1 is less than, equal to, or - * greater than s2 when taken to be unsigned 8 bit numbers. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -memcmp(s1, s2, n) - CONST VOID *s1; /* First string. */ - CONST VOID *s2; /* Second string. */ - size_t n; /* Length to compare. */ -{ - unsigned char u1, u2; - - for ( ; n-- ; s1++, s2++) { - u1 = * (unsigned char *) s1; - u2 = * (unsigned char *) s2; - if ( u1 != u2) { - return (u1-u2); - } - } - return 0; -} diff --git a/compat/opendir.c b/compat/opendir.c deleted file mode 100644 index 8eec7db..0000000 --- a/compat/opendir.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * opendir.c -- - * - * This file provides dirent-style directory-reading procedures - * for V7 Unix systems that don't have such procedures. The - * origin of this code is unclear, but it seems to have come - * originally from Larry Wall. - * - * - * RCS: @(#) $Id: opendir.c,v 1.2 1998/09/14 18:39:44 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -#undef DIRSIZ -#define DIRSIZ(dp) \ - ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) - -/* - * open a directory. - */ -DIR * -opendir(name) -char *name; -{ - register DIR *dirp; - register int fd; - char *myname; - - myname = ((*name == '\0') ? "." : name); - if ((fd = open(myname, 0, 0)) == -1) - return NULL; - if ((dirp = (DIR *)ckalloc(sizeof(DIR))) == NULL) { - close (fd); - return NULL; - } - dirp->dd_fd = fd; - dirp->dd_loc = 0; - return dirp; -} - -/* - * read an old style directory entry and present it as a new one - */ -#ifndef pyr -#define ODIRSIZ 14 - -struct olddirect { - ino_t od_ino; - char od_name[ODIRSIZ]; -}; -#else /* a Pyramid in the ATT universe */ -#define ODIRSIZ 248 - -struct olddirect { - long od_ino; - short od_fill1, od_fill2; - char od_name[ODIRSIZ]; -}; -#endif - -/* - * get next entry in a directory. - */ -struct dirent * -readdir(dirp) -register DIR *dirp; -{ - register struct olddirect *dp; - static struct dirent dir; - - for (;;) { - if (dirp->dd_loc == 0) { - dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, - DIRBLKSIZ); - if (dirp->dd_size <= 0) - return NULL; - } - if (dirp->dd_loc >= dirp->dd_size) { - dirp->dd_loc = 0; - continue; - } - dp = (struct olddirect *)(dirp->dd_buf + dirp->dd_loc); - dirp->dd_loc += sizeof(struct olddirect); - if (dp->od_ino == 0) - continue; - dir.d_ino = dp->od_ino; - strncpy(dir.d_name, dp->od_name, ODIRSIZ); - dir.d_name[ODIRSIZ] = '\0'; /* insure null termination */ - dir.d_namlen = strlen(dir.d_name); - dir.d_reclen = DIRSIZ(&dir); - return (&dir); - } -} - -/* - * close a directory. - */ -void -closedir(dirp) -register DIR *dirp; -{ - close(dirp->dd_fd); - dirp->dd_fd = -1; - dirp->dd_loc = 0; - ckfree((char *) dirp); -} diff --git a/compat/stdlib.h b/compat/stdlib.h deleted file mode 100644 index 6edeeae..0000000 --- a/compat/stdlib.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * stdlib.h -- - * - * Declares facilities exported by the "stdlib" portion of - * the C library. This file isn't complete in the ANSI-C - * sense; it only declares things that are needed by Tcl. - * This file is needed even on many systems with their own - * stdlib.h (e.g. SunOS) because not all stdlib.h files - * declare all the procedures needed here (such as strtod). - * - * Copyright (c) 1991 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: stdlib.h,v 1.3 1999/04/16 00:46:30 stanton Exp $ - */ - -#ifndef _STDLIB -#define _STDLIB - -#include - -extern void abort _ANSI_ARGS_((void)); -extern double atof _ANSI_ARGS_((CONST char *string)); -extern int atoi _ANSI_ARGS_((CONST char *string)); -extern long atol _ANSI_ARGS_((CONST char *string)); -extern char * calloc _ANSI_ARGS_((unsigned int numElements, - unsigned int size)); -extern void exit _ANSI_ARGS_((int status)); -extern int free _ANSI_ARGS_((char *blockPtr)); -extern char * getenv _ANSI_ARGS_((CONST char *name)); -extern char * malloc _ANSI_ARGS_((unsigned int numBytes)); -extern void qsort _ANSI_ARGS_((VOID *base, int n, int size, - int (*compar)(CONST VOID *element1, CONST VOID - *element2))); -extern char * realloc _ANSI_ARGS_((char *ptr, unsigned int numBytes)); -extern double strtod _ANSI_ARGS_((CONST char *string, char **endPtr)); -extern long strtol _ANSI_ARGS_((CONST char *string, char **endPtr, - int base)); -extern unsigned long strtoul _ANSI_ARGS_((CONST char *string, - char **endPtr, int base)); - -#endif /* _STDLIB */ diff --git a/compat/strftime.c b/compat/strftime.c deleted file mode 100644 index d588433..0000000 --- a/compat/strftime.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - * strftime.c -- - * - * This file contains a modified version of the BSD 4.4 strftime - * function. - * - * This file is a modified version of the strftime.c file from the BSD 4.4 - * source. See the copyright notice below for details on redistribution - * restrictions. The "license.terms" file does not apply to this file. - * - * RCS: @(#) $Id: strftime.c,v 1.3 1999/04/16 00:46:30 stanton Exp $ - */ - -/* - * Copyright (c) 1989 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. 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. - */ - -#if defined(LIBC_SCCS) -static char *rcsid = "$Id: strftime.c,v 1.3 1999/04/16 00:46:30 stanton Exp $"; -#endif /* LIBC_SCCS */ - -#include -#include -#include -#include "tclInt.h" -#include "tclPort.h" - -#define TM_YEAR_BASE 1900 - -typedef struct { - const char *abday[7]; - const char *day[7]; - const char *abmon[12]; - const char *mon[12]; - const char *am_pm[2]; - const char *d_t_fmt; - const char *d_fmt; - const char *t_fmt; - const char *t_fmt_ampm; -} _TimeLocale; - -static const _TimeLocale _DefaultTimeLocale = -{ - { - "Sun","Mon","Tue","Wed","Thu","Fri","Sat", - }, - { - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", - "Friday", "Saturday" - }, - { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }, - { - "January", "February", "March", "April", "May", "June", "July", - "August", "September", "October", "November", "December" - }, - { - "AM", "PM" - }, - "%a %b %d %H:%M:%S %Y", - "%m/%d/%y", - "%H:%M:%S", - "%I:%M:%S %p" -}; - -static const _TimeLocale *_CurrentTimeLocale = &_DefaultTimeLocale; - -static size_t gsize; -static char *pt; -static int _add _ANSI_ARGS_((const char* str)); -static int _conv _ANSI_ARGS_((int n, int digits, int pad)); -static int _secs _ANSI_ARGS_((const struct tm *t)); -static size_t _fmt _ANSI_ARGS_((const char *format, - const struct tm *t)); - -size_t -TclpStrftime(s, maxsize, format, t) - char *s; - size_t maxsize; - const char *format; - const struct tm *t; -{ - tzset(); - - pt = s; - if ((gsize = maxsize) < 1) - return(0); - if (_fmt(format, t)) { - *pt = '\0'; - return(maxsize - gsize); - } - return(0); -} - -#define SUN_WEEK(t) (((t)->tm_yday + 7 - \ - ((t)->tm_wday)) / 7) -#define MON_WEEK(t) (((t)->tm_yday + 7 - \ - ((t)->tm_wday ? (t)->tm_wday - 1 : 6)) / 7) - -static size_t -_fmt(format, t) - const char *format; - const struct tm *t; -{ - for (; *format; ++format) { - if (*format == '%') { - ++format; - if (*format == 'E') { - /* Alternate Era */ - ++format; - } else if (*format == 'O') { - /* Alternate numeric symbols */ - ++format; - } - switch(*format) { - case '\0': - --format; - break; - case 'A': - if (t->tm_wday < 0 || t->tm_wday > 6) - return(0); - if (!_add(_CurrentTimeLocale->day[t->tm_wday])) - return(0); - continue; - case 'a': - if (t->tm_wday < 0 || t->tm_wday > 6) - return(0); - if (!_add(_CurrentTimeLocale->abday[t->tm_wday])) - return(0); - continue; - case 'B': - if (t->tm_mon < 0 || t->tm_mon > 11) - return(0); - if (!_add(_CurrentTimeLocale->mon[t->tm_mon])) - return(0); - continue; - case 'b': - case 'h': - if (t->tm_mon < 0 || t->tm_mon > 11) - return(0); - if (!_add(_CurrentTimeLocale->abmon[t->tm_mon])) - return(0); - continue; - case 'C': - if (!_conv((t->tm_year + TM_YEAR_BASE) / 100, - 2, '0')) - return(0); - continue; - case 'c': - if (!_fmt(_CurrentTimeLocale->d_t_fmt, t)) - return(0); - continue; - case 'D': - if (!_fmt("%m/%d/%y", t)) - return(0); - continue; - case 'd': - if (!_conv(t->tm_mday, 2, '0')) - return(0); - continue; - case 'e': - if (!_conv(t->tm_mday, 2, ' ')) - return(0); - continue; - case 'H': - if (!_conv(t->tm_hour, 2, '0')) - return(0); - continue; - case 'I': - if (!_conv(t->tm_hour % 12 ? - t->tm_hour % 12 : 12, 2, '0')) - return(0); - continue; - case 'j': - if (!_conv(t->tm_yday + 1, 3, '0')) - return(0); - continue; - case 'k': - if (!_conv(t->tm_hour, 2, ' ')) - return(0); - continue; - case 'l': - if (!_conv(t->tm_hour % 12 ? - t->tm_hour % 12: 12, 2, ' ')) - return(0); - continue; - case 'M': - if (!_conv(t->tm_min, 2, '0')) - return(0); - continue; - case 'm': - if (!_conv(t->tm_mon + 1, 2, '0')) - return(0); - continue; - case 'n': - if (!_add("\n")) - return(0); - continue; - case 'p': - if (!_add(_CurrentTimeLocale->am_pm[t->tm_hour >= 12])) - return(0); - continue; - case 'R': - if (!_fmt("%H:%M", t)) - return(0); - continue; - case 'r': - if (!_fmt(_CurrentTimeLocale->t_fmt_ampm, t)) - return(0); - continue; - case 'S': - if (!_conv(t->tm_sec, 2, '0')) - return(0); - continue; - case 's': - if (!_secs(t)) - return(0); - continue; - case 'T': - if (!_fmt("%H:%M:%S", t)) - return(0); - continue; - case 't': - if (!_add("\t")) - return(0); - continue; - case 'U': - if (!_conv(SUN_WEEK(t), 2, '0')) - return(0); - continue; - case 'u': - if (!_conv(t->tm_wday ? t->tm_wday : 7, 1, '0')) - return(0); - continue; - case 'V': - { - /* ISO 8601 Week Of Year: - If the week (Monday - Sunday) containing - January 1 has four or more days in the new - year, then it is week 1; otherwise it is - week 53 of the previous year and the next - week is week one. */ - - int week = MON_WEEK(t); - - int days = (((t)->tm_yday + 7 - \ - ((t)->tm_wday ? (t)->tm_wday - 1 : 6)) % 7); - - - if (days >= 4) { - week++; - } else if (week == 0) { - week = 53; - } - - if (!_conv(week, 2, '0')) - return(0); - continue; - } - case 'W': - if (!_conv(MON_WEEK(t), 2, '0')) - return(0); - continue; - case 'w': - if (!_conv(t->tm_wday, 1, '0')) - return(0); - continue; - case 'x': - if (!_fmt(_CurrentTimeLocale->d_fmt, t)) - return(0); - continue; - case 'X': - if (!_fmt(_CurrentTimeLocale->t_fmt, t)) - return(0); - continue; - case 'y': - if (!_conv((t->tm_year + TM_YEAR_BASE) % 100, - 2, '0')) - return(0); - continue; - case 'Y': - if (!_conv((t->tm_year + TM_YEAR_BASE), 4, '0')) - return(0); - continue; -#ifndef MAC_TCL - case 'Z': { - char *name = TclpGetTZName(t->tm_isdst); - if (name && !_add(name)) { - return 0; - } - continue; - } -#endif - case '%': - /* - * X311J/88-090 (4.12.3.5): if conversion char is - * undefined, behavior is undefined. Print out the - * character itself as printf(3) does. - */ - default: - break; - } - } - if (!gsize--) - return(0); - *pt++ = *format; - } - return(gsize); -} - -static int -_secs(t) - const struct tm *t; -{ - static char buf[15]; - register time_t s; - register char *p; - struct tm tmp; - - /* Make a copy, mktime(3) modifies the tm struct. */ - tmp = *t; - s = mktime(&tmp); - for (p = buf + sizeof(buf) - 2; s > 0 && p > buf; s /= 10) - *p-- = (char)(s % 10 + '0'); - return(_add(++p)); -} - -static int -_conv(n, digits, pad) - int n, digits; - int pad; -{ - static char buf[10]; - register char *p; - - for (p = buf + sizeof(buf) - 2; n > 0 && p > buf; n /= 10, --digits) - *p-- = (char)(n % 10 + '0'); - while (p > buf && digits-- > 0) - *p-- = (char) pad; - return(_add(++p)); -} - -static int -_add(str) - const char *str; -{ - for (;; ++pt, --gsize) { - if (!gsize) - return(0); - if (!(*pt = *str++)) - return(1); - } -} diff --git a/compat/string.h b/compat/string.h deleted file mode 100644 index b7a0653..0000000 --- a/compat/string.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * string.h -- - * - * Declarations of ANSI C library procedures for string handling. - * - * Copyright (c) 1991-1993 The Regents of the University of California. - * 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. - * - * RCS: @(#) $Id: string.h,v 1.3 1999/04/16 00:46:30 stanton Exp $ - */ - -#ifndef _STRING -#define _STRING - -#include - -/* - * The following #include is needed to define size_t. (This used to - * include sys/stdtypes.h but that doesn't exist on older versions - * of SunOS, e.g. 4.0.2, so I'm trying sys/types.h now.... hopefully - * it exists everywhere) - */ - -#ifndef MAC_TCL -#include -#endif - -extern char * memchr _ANSI_ARGS_((CONST VOID *s, int c, size_t n)); -extern int memcmp _ANSI_ARGS_((CONST VOID *s1, CONST VOID *s2, - size_t n)); -extern char * memcpy _ANSI_ARGS_((VOID *t, CONST VOID *f, size_t n)); -#ifdef NO_MEMMOVE -#define memmove(d, s, n) bcopy ((s), (d), (n)) -#else -extern char * memmove _ANSI_ARGS_((VOID *t, CONST VOID *f, - size_t n)); -#endif -extern char * memset _ANSI_ARGS_((VOID *s, int c, size_t n)); - -extern int strcasecmp _ANSI_ARGS_((CONST char *s1, - CONST char *s2)); -extern char * strcat _ANSI_ARGS_((char *dst, CONST char *src)); -extern char * strchr _ANSI_ARGS_((CONST char *string, int c)); -extern int strcmp _ANSI_ARGS_((CONST char *s1, CONST char *s2)); -extern char * strcpy _ANSI_ARGS_((char *dst, CONST char *src)); -extern size_t strcspn _ANSI_ARGS_((CONST char *string, - CONST char *chars)); -extern char * strdup _ANSI_ARGS_((CONST char *string)); -extern char * strerror _ANSI_ARGS_((int error)); -extern size_t strlen _ANSI_ARGS_((CONST char *string)); -extern int strncasecmp _ANSI_ARGS_((CONST char *s1, - CONST char *s2, size_t n)); -extern char * strncat _ANSI_ARGS_((char *dst, CONST char *src, - size_t numChars)); -extern int strncmp _ANSI_ARGS_((CONST char *s1, CONST char *s2, - size_t nChars)); -extern char * strncpy _ANSI_ARGS_((char *dst, CONST char *src, - size_t numChars)); -extern char * strpbrk _ANSI_ARGS_((CONST char *string, char *chars)); -extern char * strrchr _ANSI_ARGS_((CONST char *string, int c)); -extern size_t strspn _ANSI_ARGS_((CONST char *string, - CONST char *chars)); -extern char * strstr _ANSI_ARGS_((CONST char *string, - CONST char *substring)); -extern char * strtok _ANSI_ARGS_((CONST char *s, CONST char *delim)); - -#endif /* _STRING */ diff --git a/compat/strncasecmp.c b/compat/strncasecmp.c deleted file mode 100644 index ca2bf91..0000000 --- a/compat/strncasecmp.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * strncasecmp.c -- - * - * Source code for the "strncasecmp" library routine. - * - * Copyright (c) 1988-1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: strncasecmp.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -#include "tclPort.h" - -/* - * This array is designed for mapping upper and lower case letter - * together for a case independent comparison. The mappings are - * based upon ASCII character sequences. - */ - -static unsigned char charmap[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xe1, 0xe2, 0xe3, 0xe4, 0xc5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, -}; - -/* - * Here are the prototypes just in case they are not included - * in tclPort.h. - */ -int strncasecmp _ANSI_ARGS_((CONST char *s1, - CONST char *s2, size_t n)); - -int strcasecmp _ANSI_ARGS_((CONST char *s1, - CONST char *s2)); - -/* - *---------------------------------------------------------------------- - * - * strcasecmp -- - * - * Compares two strings, ignoring case differences. - * - * Results: - * Compares two null-terminated strings s1 and s2, returning -1, 0, - * or 1 if s1 is lexicographically less than, equal to, or greater - * than s2. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -strcasecmp(s1, s2) - CONST char *s1; /* First string. */ - CONST char *s2; /* Second string. */ -{ - unsigned char u1, u2; - - for ( ; ; s1++, s2++) { - u1 = (unsigned char) *s1; - u2 = (unsigned char) *s2; - if ((u1 == '\0') || (charmap[u1] != charmap[u2])) { - break; - } - } - return charmap[u1] - charmap[u2]; -} - -/* - *---------------------------------------------------------------------- - * - * strncasecmp -- - * - * Compares two strings, ignoring case differences. - * - * Results: - * Compares up to length chars of s1 and s2, returning -1, 0, or 1 - * if s1 is lexicographically less than, equal to, or greater - * than s2 over those characters. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -strncasecmp(s1, s2, length) - CONST char *s1; /* First string. */ - CONST char *s2; /* Second string. */ - size_t length; /* Maximum number of characters to compare - * (stop earlier if the end of either string - * is reached). */ -{ - unsigned char u1, u2; - - for (; length != 0; length--, s1++, s2++) { - u1 = (unsigned char) *s1; - u2 = (unsigned char) *s2; - if (charmap[u1] != charmap[u2]) { - return charmap[u1] - charmap[u2]; - } - if (u1 == '\0') { - return 0; - } - } - return 0; -} diff --git a/compat/strstr.c b/compat/strstr.c deleted file mode 100644 index de0c26a..0000000 --- a/compat/strstr.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * strstr.c -- - * - * Source code for the "strstr" library routine. - * - * Copyright (c) 1988-1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: strstr.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -/* - *---------------------------------------------------------------------- - * - * strstr -- - * - * Locate the first instance of a substring in a string. - * - * Results: - * If string contains substring, the return value is the - * location of the first matching instance of substring - * in string. If string doesn't contain substring, the - * return value is 0. Matching is done on an exact - * character-for-character basis with no wildcards or special - * characters. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -strstr(string, substring) - register char *string; /* String to search. */ - char *substring; /* Substring to try to find in string. */ -{ - register char *a, *b; - - /* First scan quickly through the two strings looking for a - * single-character match. When it's found, then compare the - * rest of the substring. - */ - - b = substring; - if (*b == 0) { - return string; - } - for ( ; *string != 0; string += 1) { - if (*string != *b) { - continue; - } - a = string; - while (1) { - if (*b == 0) { - return string; - } - if (*a++ != *b++) { - break; - } - } - b = substring; - } - return (char *) 0; -} diff --git a/compat/strtod.c b/compat/strtod.c deleted file mode 100644 index 744c7c8..0000000 --- a/compat/strtod.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * strtod.c -- - * - * Source code for the "strtod" library procedure. - * - * Copyright (c) 1988-1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: strtod.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -#include "tcl.h" -#ifdef NO_STDLIB_H -# include "../compat/stdlib.h" -#else -# include -#endif -#include - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif -#ifndef NULL -#define NULL 0 -#endif - -static int maxExponent = 511; /* Largest possible base 10 exponent. Any - * exponent larger than this will already - * produce underflow or overflow, so there's - * no need to worry about additional digits. - */ -static double powersOf10[] = { /* Table giving binary powers of 10. Entry */ - 10., /* is 10^2^i. Used to convert decimal */ - 100., /* exponents into floating-point numbers. */ - 1.0e4, - 1.0e8, - 1.0e16, - 1.0e32, - 1.0e64, - 1.0e128, - 1.0e256 -}; - -/* - *---------------------------------------------------------------------- - * - * strtod -- - * - * This procedure converts a floating-point number from an ASCII - * decimal representation to internal double-precision format. - * - * Results: - * The return value is the double-precision floating-point - * representation of the characters in string. If endPtr isn't - * NULL, then *endPtr is filled in with the address of the - * next character after the last one that was part of the - * floating-point number. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -double -strtod(string, endPtr) - CONST char *string; /* A decimal ASCII floating-point number, - * optionally preceded by white space. - * Must have form "-I.FE-X", where I is the - * integer part of the mantissa, F is the - * fractional part of the mantissa, and X - * is the exponent. Either of the signs - * may be "+", "-", or omitted. Either I - * or F may be omitted, or both. The decimal - * point isn't necessary unless F is present. - * The "E" may actually be an "e". E and X - * may both be omitted (but not just one). - */ - char **endPtr; /* If non-NULL, store terminating character's - * address here. */ -{ - int sign, expSign = FALSE; - double fraction, dblExp, *d; - register CONST char *p; - register int c; - int exp = 0; /* Exponent read from "EX" field. */ - int fracExp = 0; /* Exponent that derives from the fractional - * part. Under normal circumstatnces, it is - * the negative of the number of digits in F. - * However, if I is very long, the last digits - * of I get dropped (otherwise a long I with a - * large negative exponent could cause an - * unnecessary overflow on I alone). In this - * case, fracExp is incremented one for each - * dropped digit. */ - int mantSize; /* Number of digits in mantissa. */ - int decPt; /* Number of mantissa digits BEFORE decimal - * point. */ - CONST char *pExp; /* Temporarily holds location of exponent - * in string. */ - - /* - * Strip off leading blanks and check for a sign. - */ - - p = string; - while (isspace(*p)) { - p += 1; - } - if (*p == '-') { - sign = TRUE; - p += 1; - } else { - if (*p == '+') { - p += 1; - } - sign = FALSE; - } - - /* - * Count the number of digits in the mantissa (including the decimal - * point), and also locate the decimal point. - */ - - decPt = -1; - for (mantSize = 0; ; mantSize += 1) - { - c = *p; - if (!isdigit(c)) { - if ((c != '.') || (decPt >= 0)) { - break; - } - decPt = mantSize; - } - p += 1; - } - - /* - * Now suck up the digits in the mantissa. Use two integers to - * collect 9 digits each (this is faster than using floating-point). - * If the mantissa has more than 18 digits, ignore the extras, since - * they can't affect the value anyway. - */ - - pExp = p; - p -= mantSize; - if (decPt < 0) { - decPt = mantSize; - } else { - mantSize -= 1; /* One of the digits was the point. */ - } - if (mantSize > 18) { - fracExp = decPt - 18; - mantSize = 18; - } else { - fracExp = decPt - mantSize; - } - if (mantSize == 0) { - fraction = 0.0; - p = string; - goto done; - } else { - int frac1, frac2; - frac1 = 0; - for ( ; mantSize > 9; mantSize -= 1) - { - c = *p; - p += 1; - if (c == '.') { - c = *p; - p += 1; - } - frac1 = 10*frac1 + (c - '0'); - } - frac2 = 0; - for (; mantSize > 0; mantSize -= 1) - { - c = *p; - p += 1; - if (c == '.') { - c = *p; - p += 1; - } - frac2 = 10*frac2 + (c - '0'); - } - fraction = (1.0e9 * frac1) + frac2; - } - - /* - * Skim off the exponent. - */ - - p = pExp; - if ((*p == 'E') || (*p == 'e')) { - p += 1; - if (*p == '-') { - expSign = TRUE; - p += 1; - } else { - if (*p == '+') { - p += 1; - } - expSign = FALSE; - } - while (isdigit(*p)) { - exp = exp * 10 + (*p - '0'); - p += 1; - } - } - if (expSign) { - exp = fracExp - exp; - } else { - exp = fracExp + exp; - } - - /* - * Generate a floating-point number that represents the exponent. - * Do this by processing the exponent one bit at a time to combine - * many powers of 2 of 10. Then combine the exponent with the - * fraction. - */ - - if (exp < 0) { - expSign = TRUE; - exp = -exp; - } else { - expSign = FALSE; - } - if (exp > maxExponent) { - exp = maxExponent; - } - dblExp = 1.0; - for (d = powersOf10; exp != 0; exp >>= 1, d += 1) { - if (exp & 01) { - dblExp *= *d; - } - } - if (expSign) { - fraction /= dblExp; - } else { - fraction *= dblExp; - } - -done: - if (endPtr != NULL) { - *endPtr = (char *) p; - } - - if (sign) { - return -fraction; - } - return fraction; -} diff --git a/compat/strtol.c b/compat/strtol.c deleted file mode 100644 index c2f336b..0000000 --- a/compat/strtol.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * strtol.c -- - * - * Source code for the "strtol" library procedure. - * - * Copyright (c) 1988 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: strtol.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -#include - - -/* - *---------------------------------------------------------------------- - * - * strtol -- - * - * Convert an ASCII string into an integer. - * - * Results: - * The return value is the integer equivalent of string. If endPtr - * is non-NULL, then *endPtr is filled in with the character - * after the last one that was part of the integer. If string - * doesn't contain a valid integer value, then zero is returned - * and *endPtr is set to string. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -long int -strtol(string, endPtr, base) - char *string; /* String of ASCII digits, possibly - * preceded by white space. For bases - * greater than 10, either lower- or - * upper-case digits may be used. - */ - char **endPtr; /* Where to store address of terminating - * character, or NULL. */ - int base; /* Base for conversion. Must be less - * than 37. If 0, then the base is chosen - * from the leading characters of string: - * "0x" means hex, "0" means octal, anything - * else means decimal. - */ -{ - register char *p; - int result; - - /* - * Skip any leading blanks. - */ - - p = string; - while (isspace(*p)) { - p += 1; - } - - /* - * Check for a sign. - */ - - if (*p == '-') { - p += 1; - result = -(strtoul(p, endPtr, base)); - } else { - if (*p == '+') { - p += 1; - } - result = strtoul(p, endPtr, base); - } - if ((result == 0) && (endPtr != 0) && (*endPtr == p)) { - *endPtr = string; - } - return result; -} diff --git a/compat/strtoul.c b/compat/strtoul.c deleted file mode 100644 index 3b7918c..0000000 --- a/compat/strtoul.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * strtoul.c -- - * - * Source code for the "strtoul" library procedure. - * - * Copyright (c) 1988 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: strtoul.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -#include - -/* - * The table below is used to convert from ASCII digits to a - * numerical equivalent. It maps from '0' through 'z' to integers - * (100 for non-digit characters). - */ - -static char cvtIn[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* '0' - '9' */ - 100, 100, 100, 100, 100, 100, 100, /* punctuation */ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'A' - 'Z' */ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, - 100, 100, 100, 100, 100, 100, /* punctuation */ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'a' - 'z' */ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35}; - -/* - *---------------------------------------------------------------------- - * - * strtoul -- - * - * Convert an ASCII string into an integer. - * - * Results: - * The return value is the integer equivalent of string. If endPtr - * is non-NULL, then *endPtr is filled in with the character - * after the last one that was part of the integer. If string - * doesn't contain a valid integer value, then zero is returned - * and *endPtr is set to string. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -unsigned long int -strtoul(string, endPtr, base) - char *string; /* String of ASCII digits, possibly - * preceded by white space. For bases - * greater than 10, either lower- or - * upper-case digits may be used. - */ - char **endPtr; /* Where to store address of terminating - * character, or NULL. */ - int base; /* Base for conversion. Must be less - * than 37. If 0, then the base is chosen - * from the leading characters of string: - * "0x" means hex, "0" means octal, anything - * else means decimal. - */ -{ - register char *p; - register unsigned long int result = 0; - register unsigned digit; - int anyDigits = 0; - - /* - * Skip any leading blanks. - */ - - p = string; - while (isspace(*p)) { - p += 1; - } - - /* - * If no base was provided, pick one from the leading characters - * of the string. - */ - - if (base == 0) - { - if (*p == '0') { - p += 1; - if (*p == 'x') { - p += 1; - base = 16; - } else { - - /* - * Must set anyDigits here, otherwise "0" produces a - * "no digits" error. - */ - - anyDigits = 1; - base = 8; - } - } - else base = 10; - } else if (base == 16) { - - /* - * Skip a leading "0x" from hex numbers. - */ - - if ((p[0] == '0') && (p[1] == 'x')) { - p += 2; - } - } - - /* - * Sorry this code is so messy, but speed seems important. Do - * different things for base 8, 10, 16, and other. - */ - - if (base == 8) { - for ( ; ; p += 1) { - digit = *p - '0'; - if (digit > 7) { - break; - } - result = (result << 3) + digit; - anyDigits = 1; - } - } else if (base == 10) { - for ( ; ; p += 1) { - digit = *p - '0'; - if (digit > 9) { - break; - } - result = (10*result) + digit; - anyDigits = 1; - } - } else if (base == 16) { - for ( ; ; p += 1) { - digit = *p - '0'; - if (digit > ('z' - '0')) { - break; - } - digit = cvtIn[digit]; - if (digit > 15) { - break; - } - result = (result << 4) + digit; - anyDigits = 1; - } - } else { - for ( ; ; p += 1) { - digit = *p - '0'; - if (digit > ('z' - '0')) { - break; - } - digit = cvtIn[digit]; - if (digit >= base) { - break; - } - result = result*base + digit; - anyDigits = 1; - } - } - - /* - * See if there were any digits at all. - */ - - if (!anyDigits) { - p = string; - } - - if (endPtr != 0) { - *endPtr = p; - } - - return result; -} diff --git a/compat/tclErrno.h b/compat/tclErrno.h deleted file mode 100644 index df87385..0000000 --- a/compat/tclErrno.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * tclErrno.h -- - * - * This header file contains the various POSIX errno definitions that - * are used by Tcl. This file is derived from the spec POSIX 2.4 and - * previous implementations for Berkeley UNIX. - * - * Copyright (c) 1982, 1986, 1989 Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclErrno.h,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -extern int errno; /* global error number */ - -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* Input/output error */ -#define ENXIO 6 /* Device not configured */ -#define E2BIG 7 /* Argument list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file descriptor */ -#define ECHILD 10 /* No child processes */ -#define EDEADLK 11 /* Resource deadlock avoided */ - /* 11 was EAGAIN */ -#define ENOMEM 12 /* Cannot allocate memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Device busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* Operation not supported by device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Inappropriate ioctl for device */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Numerical argument out of domain */ -#define ERANGE 34 /* Result too large */ -#define EAGAIN 35 /* Resource temporarily unavailable */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define EINPROGRESS 36 /* Operation now in progress */ -#define EALREADY 37 /* Operation already in progress */ -#define ENOTSOCK 38 /* Socket operation on non-socket */ -#define EDESTADDRREQ 39 /* Destination address required */ -#define EMSGSIZE 40 /* Message too long */ -#define EPROTOTYPE 41 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 42 /* Protocol not available */ -#define EPROTONOSUPPORT 43 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ -#define EOPNOTSUPP 45 /* Operation not supported on socket */ -#define EPFNOSUPPORT 46 /* Protocol family not supported */ -#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ -#define EADDRINUSE 48 /* Address already in use */ -#define EADDRNOTAVAIL 49 /* Can't assign requested address */ -#define ENETDOWN 50 /* Network is down */ -#define ENETUNREACH 51 /* Network is unreachable */ -#define ENETRESET 52 /* Network dropped connection on reset */ -#define ECONNABORTED 53 /* Software caused connection abort */ -#define ECONNRESET 54 /* Connection reset by peer */ -#define ENOBUFS 55 /* No buffer space available */ -#define EISCONN 56 /* Socket is already connected */ -#define ENOTCONN 57 /* Socket is not connected */ -#define ESHUTDOWN 58 /* Can't send after socket shutdown */ -#define ETOOMANYREFS 59 /* Too many references: can't splice */ -#define ETIMEDOUT 60 /* Connection timed out */ -#define ECONNREFUSED 61 /* Connection refused */ -#define ELOOP 62 /* Too many levels of symbolic links */ -#define ENAMETOOLONG 63 /* File name too long */ -#define EHOSTDOWN 64 /* Host is down */ -#define EHOSTUNREACH 65 /* No route to host */ -#define ENOTEMPTY 66 /* Directory not empty */ -#define EPROCLIM 67 /* Too many processes */ -#define EUSERS 68 /* Too many users */ -#define EDQUOT 69 /* Disc quota exceeded */ -#define ESTALE 70 /* Stale NFS file handle */ -#define EREMOTE 71 /* Too many levels of remote in path */ -#define EBADRPC 72 /* RPC struct is bad */ -#define ERPCMISMATCH 73 /* RPC version wrong */ -#define EPROGUNAVAIL 74 /* RPC prog. not avail */ -#define EPROGMISMATCH 75 /* Program version wrong */ -#define EPROCUNAVAIL 76 /* Bad procedure for program */ -#define ENOLCK 77 /* No locks available */ -#define ENOSYS 78 /* Function not implemented */ -#define EFTYPE 79 /* Inappropriate file type or format */ - diff --git a/compat/tmpnam.c b/compat/tmpnam.c deleted file mode 100644 index 89bfc6a..0000000 --- a/compat/tmpnam.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of California at Berkeley. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific written prior permission. This software - * is provided ``as is'' without express or implied warranty. - * - * RCS: @(#) $Id: tmpnam.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -#include -#include -#include -#include - -/* - * Use /tmp instead of /usr/tmp, because L_tmpname is only 14 chars - * on some machines (like NeXT machines) and /usr/tmp will cause - * buffer overflows. - */ - -#ifdef P_tmpdir -# undef P_tmpdir -#endif -#define P_tmpdir "/tmp" - -char * -tmpnam(s) - char *s; -{ - static char name[50]; - char *mktemp(); - - if (!s) - s = name; - (void)sprintf(s, "%s/XXXXXX", P_tmpdir); - return(mktemp(s)); -} diff --git a/compat/unistd.h b/compat/unistd.h deleted file mode 100644 index 0b791e0..0000000 --- a/compat/unistd.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * unistd.h -- - * - * Macros, CONSTants and prototypes for Posix conformance. - * - * Copyright 1989 Regents of the University of California - * Permission to use, copy, modify, and distribute this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies. The University of California - * makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without - * express or implied warranty. - * - * RCS: @(#) $Id: unistd.h,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -#ifndef _UNISTD -#define _UNISTD - -#include -#ifndef _TCL -# include "tcl.h" -#endif - -#ifndef NULL -#define NULL 0 -#endif - -/* - * Strict POSIX stuff goes here. Extensions go down below, in the - * ifndef _POSIX_SOURCE section. - */ - -extern void _exit _ANSI_ARGS_((int status)); -extern int access _ANSI_ARGS_((CONST char *path, int mode)); -extern int chdir _ANSI_ARGS_((CONST char *path)); -extern int chown _ANSI_ARGS_((CONST char *path, uid_t owner, gid_t group)); -extern int close _ANSI_ARGS_((int fd)); -extern int dup _ANSI_ARGS_((int oldfd)); -extern int dup2 _ANSI_ARGS_((int oldfd, int newfd)); -extern int execl _ANSI_ARGS_((CONST char *path, ...)); -extern int execle _ANSI_ARGS_((CONST char *path, ...)); -extern int execlp _ANSI_ARGS_((CONST char *file, ...)); -extern int execv _ANSI_ARGS_((CONST char *path, char **argv)); -extern int execve _ANSI_ARGS_((CONST char *path, char **argv, char **envp)); -extern int execvp _ANSI_ARGS_((CONST char *file, char **argv)); -extern pid_t fork _ANSI_ARGS_((void)); -extern char *getcwd _ANSI_ARGS_((char *buf, size_t size)); -extern gid_t getegid _ANSI_ARGS_((void)); -extern uid_t geteuid _ANSI_ARGS_((void)); -extern gid_t getgid _ANSI_ARGS_((void)); -extern int getgroups _ANSI_ARGS_((int bufSize, int *buffer)); -extern pid_t getpid _ANSI_ARGS_((void)); -extern uid_t getuid _ANSI_ARGS_((void)); -extern int isatty _ANSI_ARGS_((int fd)); -extern long lseek _ANSI_ARGS_((int fd, long offset, int whence)); -extern int pipe _ANSI_ARGS_((int *fildes)); -extern int read _ANSI_ARGS_((int fd, char *buf, size_t size)); -extern int setgid _ANSI_ARGS_((gid_t group)); -extern int setuid _ANSI_ARGS_((uid_t user)); -extern unsigned sleep _ANSI_ARGS_ ((unsigned seconds)); -extern char *ttyname _ANSI_ARGS_((int fd)); -extern int unlink _ANSI_ARGS_((CONST char *path)); -extern int write _ANSI_ARGS_((int fd, CONST char *buf, size_t size)); - -#ifndef _POSIX_SOURCE -extern char *crypt _ANSI_ARGS_((CONST char *, CONST char *)); -extern int fchown _ANSI_ARGS_((int fd, uid_t owner, gid_t group)); -extern int flock _ANSI_ARGS_((int fd, int operation)); -extern int ftruncate _ANSI_ARGS_((int fd, unsigned long length)); -extern int ioctl _ANSI_ARGS_((int fd, int request, ...)); -extern int readlink _ANSI_ARGS_((CONST char *path, char *buf, int bufsize)); -extern int setegid _ANSI_ARGS_((gid_t group)); -extern int seteuid _ANSI_ARGS_((uid_t user)); -extern int setreuid _ANSI_ARGS_((int ruid, int euid)); -extern int symlink _ANSI_ARGS_((CONST char *, CONST char *)); -extern int ttyslot _ANSI_ARGS_((void)); -extern int truncate _ANSI_ARGS_((CONST char *path, unsigned long length)); -extern int vfork _ANSI_ARGS_((void)); -#endif /* _POSIX_SOURCE */ - -#endif /* _UNISTD */ - diff --git a/compat/waitpid.c b/compat/waitpid.c deleted file mode 100644 index 1069f56..0000000 --- a/compat/waitpid.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * waitpid.c -- - * - * This procedure emulates the POSIX waitpid kernel call on - * BSD systems that don't have waitpid but do have wait3. - * This code is based on a prototype version written by - * Mark Diekhans and Karl Lehenbauer. - * - * Copyright (c) 1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: waitpid.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * A linked list of the following structures is used to keep track - * of processes for which we received notification from the kernel, - * but the application hasn't waited for them yet (this can happen - * because wait may not return the process we really want). We - * save the information here until the application finally does - * wait for the process. - */ - -typedef struct WaitInfo { - int pid; /* Pid of process that exited. */ - WAIT_STATUS_TYPE status; /* Status returned when child exited - * or suspended. */ - struct WaitInfo *nextPtr; /* Next in list of exited processes. */ -} WaitInfo; - -static WaitInfo *deadList = NULL; /* First in list of all dead - * processes. */ - -/* - *---------------------------------------------------------------------- - * - * waitpid -- - * - * This procedure emulates the functionality of the POSIX - * waitpid kernel call, using the BSD wait3 kernel call. - * Note: it doesn't emulate absolutely all of the waitpid - * functionality, in that it doesn't support pid's of 0 - * or < -1. - * - * Results: - * -1 is returned if there is an error in the wait kernel call. - * Otherwise the pid of an exited or suspended process is - * returned and *statusPtr is set to the status value of the - * process. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef waitpid -# undef waitpid -#endif - -int -waitpid(pid, statusPtr, options) - int pid; /* The pid to wait on. Must be -1 or - * greater than zero. */ - int *statusPtr; /* Where to store wait status for the - * process. */ - int options; /* OR'ed combination of WNOHANG and - * WUNTRACED. */ -{ - register WaitInfo *waitPtr, *prevPtr; - int result; - WAIT_STATUS_TYPE status; - - if ((pid < -1) || (pid == 0)) { - errno = EINVAL; - return -1; - } - - /* - * See if there's a suitable process that has already stopped or - * exited. If so, remove it from the list of exited processes and - * return its information. - */ - - for (waitPtr = deadList, prevPtr = NULL; waitPtr != NULL; - prevPtr = waitPtr, waitPtr = waitPtr->nextPtr) { - if ((pid != waitPtr->pid) && (pid != -1)) { - continue; - } - if (!(options & WUNTRACED) && (WIFSTOPPED(waitPtr->status))) { - continue; - } - result = waitPtr->pid; - *statusPtr = *((int *) &waitPtr->status); - if (prevPtr == NULL) { - deadList = waitPtr->nextPtr; - } else { - prevPtr->nextPtr = waitPtr->nextPtr; - } - ckfree((char *) waitPtr); - return result; - } - - /* - * Wait for any process to stop or exit. If it's an acceptable one - * then return it to the caller; otherwise store information about it - * in the list of exited processes and try again. On systems that - * have only wait but not wait3, there are several situations we can't - * handle, but we do the best we can (e.g. can still handle some - * combinations of options by invoking wait instead of wait3). - */ - - while (1) { -#if NO_WAIT3 - if (options & WNOHANG) { - return 0; - } - if (options != 0) { - errno = EINVAL; - return -1; - } - result = wait(&status); -#else - result = wait3(&status, options, 0); -#endif - if ((result == -1) && (errno == EINTR)) { - continue; - } - if (result <= 0) { - return result; - } - - if ((pid != result) && (pid != -1)) { - goto saveInfo; - } - if (!(options & WUNTRACED) && (WIFSTOPPED(status))) { - goto saveInfo; - } - *statusPtr = *((int *) &status); - return result; - - /* - * Can't return this info to caller. Save it in the list of - * stopped or exited processes. Tricky point: first check for - * an existing entry for the process and overwrite it if it - * exists (e.g. a previously stopped process might now be dead). - */ - - saveInfo: - for (waitPtr = deadList; waitPtr != NULL; waitPtr = waitPtr->nextPtr) { - if (waitPtr->pid == result) { - waitPtr->status = status; - goto waitAgain; - } - } - waitPtr = (WaitInfo *) ckalloc(sizeof(WaitInfo)); - waitPtr->pid = result; - waitPtr->status = status; - waitPtr->nextPtr = deadList; - deadList = waitPtr; - - waitAgain: continue; - } -} diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3 deleted file mode 100644 index b1820af..0000000 --- a/doc/AddErrInfo.3 +++ /dev/null @@ -1,174 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 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. -'\" -'\" RCS: @(#) $Id: AddErrInfo.3,v 1.3 1999/03/10 05:52:45 stanton Exp $ -'\" -.so man.macros -.TH Tcl_AddErrorInfo 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_AddObjErrorInfo, Tcl_AddErrorInfo, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_PosixError \- record information about errors -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_AddObjErrorInfo\fR(\fIinterp, message, length\fR) -.sp -\fBTcl_AddErrorInfo\fR(\fIinterp, message\fR) -.sp -\fBTcl_SetObjErrorCode\fR(\fIinterp, errorObjPtr\fR) -.sp -\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fB(char *) NULL\fR) -.sp -\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR) -.sp -char * -\fBTcl_PosixError\fR(\fIinterp\fR) -.SH ARGUMENTS -.AS Tcl_Interp *message -.AP Tcl_Interp *interp in -Interpreter in which to record information. -.AP char *message in -For \fBTcl_AddObjErrorInfo\fR, -this points to the first byte of an array of bytes -containing a string to record in the \fBerrorInfo\fR variable. -This byte array may contain embedded null bytes -unless \fIlength\fR is negative. -For \fBTcl_AddErrorInfo\fR, -this is a conventional C string to record in the \fBerrorInfo\fR variable. -.AP int length in -The number of bytes to copy from \fImessage\fR when -setting the \fBerrorInfo\fR variable. -If negative, all bytes up to the first null byte are used. -.AP Tcl_Obj *errorObjPtr in -This variable \fBerrorCode\fR will be set to this value. -.AP char *element in -String to record as one element of \fBerrorCode\fR variable. -Last \fIelement\fR argument must be NULL. -.AP va_list argList in -An argument list which must have been initialised using -\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR. -.BE - -.SH DESCRIPTION -.PP -These procedures are used to manipulate two Tcl global variables -that hold information about errors. -The variable \fBerrorInfo\fR holds a stack trace of the -operations that were in progress when an error occurred, -and is intended to be human-readable. -The variable \fBerrorCode\fR holds a list of items that -are intended to be machine-readable. -The first item in \fBerrorCode\fR identifies the class of -error that occurred -(e.g. POSIX means an error occurred in a POSIX system call) -and additional elements in \fBerrorCode\fR hold additional pieces -of information that depend on the class. -See the Tcl overview manual entry for details on the various -formats for \fBerrorCode\fR. -.PP -The \fBerrorInfo\fR variable is gradually built up as an -error unwinds through the nested operations. -Each time an error code is returned to \fBTcl_EvalObj\fR -(or \fBTcl_Eval\fR, which calls \fBTcl_EvalObj\fR) -it calls the procedure \fBTcl_AddObjErrorInfo\fR to add -additional text to \fBerrorInfo\fR describing the -command that was being executed when the error occurred. -By the time the error has been passed all the way back -to the application, it will contain a complete trace -of the activity in progress when the error occurred. -.PP -It is sometimes useful to add additional information to -\fBerrorInfo\fR beyond what can be supplied automatically -by \fBTcl_EvalObj\fR. -\fBTcl_AddObjErrorInfo\fR may be used for this purpose: -its \fImessage\fR and \fIlength\fR arguments describe an additional -string to be appended to \fBerrorInfo\fR. -For example, the \fBsource\fR command calls \fBTcl_AddObjErrorInfo\fR -to record the name of the file being processed and the -line number on which the error occurred; -for Tcl procedures, the procedure name and line number -within the procedure are recorded, and so on. -The best time to call \fBTcl_AddObjErrorInfo\fR is just after -\fBTcl_EvalObj\fR has returned \fBTCL_ERROR\fR. -In calling \fBTcl_AddObjErrorInfo\fR, you may find it useful to -use the \fBerrorLine\fR field of the interpreter (see the -\fBTcl_Interp\fR manual entry for details). -.PP -\fBTcl_AddErrorInfo\fR resembles \fBTcl_AddObjErrorInfo\fR -but differs in initializing \fBerrorInfo\fR from the string -value of the interpreter's result -if the error is just starting to be logged. -It does not use the result as a Tcl object -so any embedded null characters in the result -will cause information to be lost. -It also takes a conventional C string in \fImessage\fR -instead of \fBTcl_AddObjErrorInfo\fR's counted string. -.PP -The procedure \fBTcl_SetObjErrorCode\fR is used to set the -\fBerrorCode\fR variable. \fIerrorObjPtr\fR contains a list object -built up by the caller. \fBerrorCode\fR is set to this -value. \fBTcl_SetObjErrorCode\fR is typically invoked just -before returning an error in an object command. If an error is -returned without calling \fBTcl_SetObjErrorCode\fR or -\fBTcl_SetErrorCode\fR the Tcl interpreter automatically sets -\fBerrorCode\fR to \fBNONE\fR. -.PP -The procedure \fBTcl_SetErrorCode\fR is also used to set the -\fBerrorCode\fR variable. However, it takes one or more strings to -record instead of an object. Otherwise, it is similar to -\fBTcl_SetObjErrorCode\fR in behavior. -.PP -\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that -instead of taking a variable number of arguments it takes an argument list. -.PP -\fBTcl_PosixError\fR -sets the \fBerrorCode\fR variable after an error in a POSIX kernel call. -It reads the value of the \fBerrno\fR C variable and calls -\fBTcl_SetErrorCode\fR to set \fBerrorCode\fR in the \fBPOSIX\fR format. -The caller must previously have called \fBTcl_SetErrno\fR to set -\fBerrno\fR; this is necessary on some platforms (e.g. Windows) where Tcl -is linked into an application as a shared library, or when the error -occurs in a dynamically loaded extension. See the manual entry for -\fBTcl_SetErrno\fR for more information. -.PP -\fBTcl_PosixError\fR returns a human-readable diagnostic message -for the error -(this is the same value that will appear as the third element -in \fBerrorCode\fR). -It may be convenient to include this string as part of the -error message returned to the application in -the interpreter's result. -.PP -It is important to call the procedures described here rather than -setting \fBerrorInfo\fR or \fBerrorCode\fR directly with -\fBTcl_ObjSetVar2\fR. -The reason for this is that the Tcl interpreter keeps information -about whether these procedures have been called. -For example, the first time \fBTcl_AddObjErrorInfo\fR is called -for an error, it clears the existing value of \fBerrorInfo\fR -and adds the error message in the interpreter's result to the variable -before appending \fImessage\fR; -in subsequent calls, it just appends the new \fImessage\fR. -When \fBTcl_SetErrorCode\fR is called, it sets a flag indicating -that \fBerrorCode\fR has been set; -this allows the Tcl interpreter to set \fBerrorCode\fR to \fBNONE\fR -if it receives an error return -when \fBTcl_SetErrorCode\fR hasn't been called. -.PP -If the procedure \fBTcl_ResetResult\fR is called, -it clears all of the state associated with -\fBerrorInfo\fR and \fBerrorCode\fR -(but it doesn't actually modify the variables). -If an error had occurred, this will clear the error state to -make it appear as if no error had occurred after all. - -.SH "SEE ALSO" -Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_Interp, Tcl_ResetResult, Tcl_SetErrno - -.SH KEYWORDS -error, object, object result, stack, trace, variable diff --git a/doc/Alloc.3 b/doc/Alloc.3 deleted file mode 100644 index 405d7fa..0000000 --- a/doc/Alloc.3 +++ /dev/null @@ -1,52 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: Alloc.3,v 1.2 1998/09/14 18:39:45 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Alloc 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Alloc, Tcl_Free, Tcl_Realloc \- allocate or free heap memory -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -char * -\fBTcl_Alloc\fR(\fIsize\fR) -.sp -\fBTcl_Free\fR(\fIptr\fR) -.sp -char * -\fBTcl_Realloc\fR(\fIptr, size\fR) -.SH ARGUMENTS -.AS char *size -.AP int size in -Size in bytes of the memory block to allocate. -.AP char *ptr in -Pointer to memory block to free or realloc. -.BE - -.SH DESCRIPTION -.PP -These procedures provide a platform and compiler independent interface -for memory allocation. Programs that need to transfer ownership of -memory blocks between Tcl and other modules should use these routines -rather than the native \fBmalloc()\fR and \fBfree()\fR routines -provided by the C run-time library. -.PP -\fBTcl_Alloc\fR returns a pointer to a block of at least \fIsize\fR -bytes suitably aligned for any use. -.PP -\fBTcl_Free\fR makes the space referred to by \fIptr\fR available for -further allocation. -.PP -\fBTcl_Realloc\fR changes the size of the block pointed to by -\fIptr\fR to \fIsize\fR bytes and returns a pointer to the new block. -The contents will be unchanged up to the lesser of the new and old -sizes. The returned location may be different from \fIptr\fR. -.SH KEYWORDS -alloc, allocation, free, malloc, memory, realloc diff --git a/doc/AllowExc.3 b/doc/AllowExc.3 deleted file mode 100644 index 1145fa4..0000000 --- a/doc/AllowExc.3 +++ /dev/null @@ -1,42 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: AllowExc.3,v 1.2 1998/09/14 18:39:45 stanton Exp $ -'\" -.so man.macros -.TH Tcl_AllowExceptions 3 7.4 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_AllowExceptions \- allow all exceptions in next script evaluation -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_AllowExceptions\fR(\fIinterp\fR) -.SH ARGUMENTS -.AS Tcl_Interp *doublePtr -.AP Tcl_Interp *interp in -Interpreter in which script will be evaluated. -.BE - -.SH DESCRIPTION -.PP -If a script is evaluated at top-level (i.e. no other scripts are -pending evaluation when the script is invoked), and if the script -terminates with a completion code other than TCL_OK, TCL_CONTINUE -or TCL_RETURN, then Tcl normally converts this into a TCL_ERROR -return with an appropriate message. -.PP -However, if \fBTcl_AllowExceptions\fR is invoked immediately before -calling a procedure such as \fBTcl_Eval\fR, then arbitrary completion -codes are permitted from the script, and they are returned without -modification. -This is useful in cases where the caller can deal with exceptions -such as TCL_BREAK or TCL_CONTINUE in a meaningful way. - -.SH KEYWORDS -continue, break, exception, interpreter diff --git a/doc/AppInit.3 b/doc/AppInit.3 deleted file mode 100644 index 15ea1e8..0000000 --- a/doc/AppInit.3 +++ /dev/null @@ -1,73 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: AppInit.3,v 1.2 1998/09/14 18:39:46 stanton Exp $ -'\" -.so man.macros -.TH Tcl_AppInit 3 7.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_AppInit \- perform application-specific initialization -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_AppInit\fR(\fIinterp\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP Tcl_Interp *interp in -Interpreter for the application. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_AppInit\fR is a ``hook'' procedure that is invoked by -the main programs for Tcl applications such as \fBtclsh\fR and \fBwish\fR. -Its purpose is to allow new Tcl applications to be created without -modifying the main programs provided as part of Tcl and Tk. -To create a new application you write a new version of -\fBTcl_AppInit\fR to replace the default version provided by Tcl, -then link your new \fBTcl_AppInit\fR with the Tcl library. -.PP -\fBTcl_AppInit\fR is invoked after by \fBTcl_Main\fR and \fBTk_Main\fR -after their own initialization and before entering the main loop -to process commands. -Here are some examples of things that \fBTcl_AppInit\fR might do: -.IP [1] -Call initialization procedures for various packages used by -the application. -Each initialization procedure adds new commands to \fIinterp\fR -for its package and performs other package-specific initialization. -.IP [2] -Process command-line arguments, which can be accessed from the -Tcl variables \fBargv\fR and \fBargv0\fR in \fIinterp\fR. -.IP [3] -Invoke a startup script to initialize the application. -.LP -\fBTcl_AppInit\fR returns TCL_OK or TCL_ERROR. -If it returns TCL_ERROR then it must leave an error message in -\fIinterp->result\fR; otherwise the result is ignored. -.PP -In addition to \fBTcl_AppInit\fR, your application should also contain -a procedure \fBmain\fR that calls \fBTcl_Main\fR as follows: -.CS -Tcl_Main(argc, argv, Tcl_AppInit); -.CE -The third argument to \fBTcl_Main\fR gives the address of the -application-specific initialization procedure to invoke. -This means that you don't have to use the name \fBTcl_AppInit\fR -for the procedure, but in practice the name is nearly always -\fBTcl_AppInit\fR (in versions before Tcl 7.4 the name \fBTcl_AppInit\fR -was implicit; there was no way to specify the procedure explicitly). -The best way to get started is to make a copy of the file -\fBtclAppInit.c\fR from the Tcl library or source directory. -It already contains a \fBmain\fR procedure and a template for -\fBTcl_AppInit\fR that you can modify for your application. - -.SH KEYWORDS -application, argument, command, initialization, interpreter diff --git a/doc/AssocData.3 b/doc/AssocData.3 deleted file mode 100644 index 9b68c43..0000000 --- a/doc/AssocData.3 +++ /dev/null @@ -1,89 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" -'\" RCS: @(#) $Id: AssocData.3,v 1.3 1999/04/16 00:46:30 stanton Exp $ -.so man.macros -.TH Tcl_SetAssocData 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData \- manage -associations of string keys and user specified data with Tcl -interpreters. -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -ClientData -\fBTcl_GetAssocData\fR(\fIinterp, key, delProcPtr\fR) -.sp -\fBTcl_SetAssocData\fR(\fIinterp, key, delProc, clientData\fR) -.sp -\fBTcl_DeleteAssocData\fR(\fIinterp, key\fR) -.SH ARGUMENTS -.AS Tcl_InterpDeleteProc *delProcPtr -.AP Tcl_Interp *interp in -Interpreter in which to execute the specified command. -.AP char *key in -Key for association with which to store data or from which to delete or -retrieve data. Typically the module prefix for a package. -.AP Tcl_InterpDeleteProc *delProc in -Procedure to call when \fIinterp\fR is deleted. -.AP Tcl_InterpDeleteProc **delProcPtr in -Pointer to location in which to store address of current deletion procedure -for association. Ignored if NULL. -.AP ClientData clientData in -Arbitrary one-word value associated with the given key in this -interpreter. This data is owned by the caller. -.BE - -.SH DESCRIPTION -.PP -These procedures allow extensions to associate their own data with -a Tcl interpreter. -An association consists of a string key, typically the name of -the extension, and a one-word value, which is typically a pointer -to a data structure holding data specific to the extension. -Tcl makes no interpretation of either the key or the value for -an association. -.PP -Storage management is facilitated by storing with each association a -procedure to call when the interpreter is deleted. This -procedure can dispose of the storage occupied by the client's data in any -way it sees fit. -.PP -\fBTcl_SetAssocData\fR creates an association between a string -key and a user specified datum in the given interpreter. -If there is already an association with the given \fIkey\fR, -\fBTcl_SetAssocData\fR overwrites it with the new information. -It is up to callers to organize their use of names to avoid conflicts, -for example, by using package names as the keys. -If the \fIdeleteProc\fR argument is non-NULL it specifies the address of a -procedure to invoke if the interpreter is deleted before the association -is deleted. \fIDeleteProc\fR should have arguments and result that match -the type \fBTcl_InterpDeleteProc\fR: -.CS -typedef void Tcl_InterpDeleteProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR); -.CE -When \fIdeleteProc\fR is invoked the \fIclientData\fR and \fIinterp\fR -arguments will be the same as the corresponding arguments passed to -\fBTcl_SetAssocData\fR. -The deletion procedure will \fInot\fR be invoked if the association -is deleted before the interpreter is deleted. -.PP -\fBTcl_GetAssocData\fR returns the datum stored in the association with the -specified key in the given interpreter, and if the \fIdelProcPtr\fR field -is non-\fBNULL\fR, the address indicated by it gets the address of the -delete procedure stored with this association. If no association with the -specified key exists in the given interpreter \fBTcl_GetAssocData\fR -returns \fBNULL\fR. -.PP -\fBTcl_DeleteAssocData\fR deletes an association with a specified key in -the given interpreter. Then it calls the deletion procedure. -.SH KEYWORDS -association, data, deletion procedure, interpreter, key diff --git a/doc/Async.3 b/doc/Async.3 deleted file mode 100644 index 5086557..0000000 --- a/doc/Async.3 +++ /dev/null @@ -1,156 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Async.3,v 1.3 1999/04/16 00:46:30 stanton Exp $ -'\" -.so man.macros -.TH Tcl_AsyncCreate 3 7.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_AsyncCreate, Tcl_AsyncMark, Tcl_AsyncInvoke, Tcl_AsyncDelete, Tcl_AsyncReady \- handle asynchronous events -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_AsyncHandler -\fBTcl_AsyncCreate\fR(\fIproc, clientData\fR) -.sp -\fBTcl_AsyncMark\fR(\fIasync\fR) -.sp -int -\fBTcl_AsyncInvoke\fR(\fIinterp, code\fR) -.sp -\fBTcl_AsyncDelete\fR(\fIasync\fR) -.sp -int -\fBTcl_AsyncReady\fR() -.SH ARGUMENTS -.AS Tcl_AsyncHandler clientData -.AP Tcl_AsyncProc *proc in -Procedure to invoke to handle an asynchronous event. -.AP ClientData clientData in -One-word value to pass to \fIproc\fR. -.AP Tcl_AsyncHandler async in -Token for asynchronous event handler. -.AP Tcl_Interp *interp in -Tcl interpreter in which command was being evaluated when handler was -invoked, or NULL if handler was invoked when there was no interpreter -active. -.AP int code in -Completion code from command that just completed in \fIinterp\fR, -or 0 if \fIinterp\fR is NULL. -.BE - -.SH DESCRIPTION -.PP -These procedures provide a safe mechanism for dealing with -asynchronous events such as signals. -If an event such as a signal occurs while a Tcl script is being -evaluated then it isn't safe to take any substantive action to -process the event. -For example, it isn't safe to evaluate a Tcl script since the -interpreter may already be in the middle of evaluating a script; -it may not even be safe to allocate memory, since a memory -allocation could have been in progress when the event occurred. -The only safe approach is to set a flag indicating that the event -occurred, then handle the event later when the world has returned -to a clean state, such as after the current Tcl command completes. -.PP -\fBTcl_AsyncCreate\fR creates an asynchronous handler and returns -a token for it. -The asynchronous handler must be created before -any occurrences of the asynchronous event that it is intended -to handle (it is not safe to create a handler at the time of -an event). -When an asynchronous event occurs the code that detects the event -(such as a signal handler) should call \fBTcl_AsyncMark\fR with the -token for the handler. -\fBTcl_AsyncMark\fR will mark the handler as ready to execute, but it -will not invoke the handler immediately. -Tcl will call the \fIproc\fR associated with the handler later, when -the world is in a safe state, and \fIproc\fR can then carry out -the actions associated with the asynchronous event. -\fIProc\fR should have arguments and result that match the -type \fBTcl_AsyncProc\fR: -.CS -typedef int Tcl_AsyncProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - int \fIcode\fR); -.CE -The \fIclientData\fR will be the same as the \fIclientData\fR -argument passed to \fBTcl_AsyncCreate\fR when the handler was -created. -If \fIproc\fR is invoked just after a command has completed -execution in an interpreter, then \fIinterp\fR will identify -the interpreter in which the command was evaluated and -\fIcode\fR will be the completion code returned by that -command. -The command's result will be present in \fIinterp->result\fR. -When \fIproc\fR returns, whatever it leaves in \fIinterp->result\fR -will be returned as the result of the command and the integer -value returned by \fIproc\fR will be used as the new completion -code for the command. -.PP -It is also possible for \fIproc\fR to be invoked when no interpreter -is active. -This can happen, for example, if an asynchronous event occurs while -the application is waiting for interactive input or an X event. -In this case \fIinterp\fR will be NULL and \fIcode\fR will be -0, and the return value from \fIproc\fR will be ignored. -.PP -The procedure \fBTcl_AsyncInvoke\fR is called to invoke all of the -handlers that are ready. -The procedure \fBTcl_AsyncReady\fR will return non-zero whenever any -asynchronous handlers are ready; it can be checked to avoid calls -to \fBTcl_AsyncInvoke\fR when there are no ready handlers. -Tcl calls \fBTcl_AsyncReady\fR after each command is evaluated -and calls \fBTcl_AsyncInvoke\fR if needed. -Applications may also call \fBTcl_AsyncInvoke\fR at interesting -times for that application. -For example, Tcl's event handler calls \fBTcl_AsyncReady\fR -after each event and calls \fBTcl_AsyncInvoke\fR if needed. -The \fIinterp\fR and \fIcode\fR arguments to \fBTcl_AsyncInvoke\fR -have the same meaning as for \fIproc\fR: they identify the active -interpreter, if any, and the completion code from the command -that just completed. -.PP -\fBTcl_AsyncDelete\fR removes an asynchronous handler so that -its \fIproc\fR will never be invoked again. -A handler can be deleted even when ready, and it will still -not be invoked. -.PP -If multiple handlers become active at the same time, the -handlers are invoked in the order they were created (oldest -handler first). -The \fIcode\fR and \fIinterp->result\fR for later handlers -reflect the values returned by earlier handlers, so that -the most recently created handler has last say about -the interpreter's result and completion code. -If new handlers become ready while handlers are executing, -\fBTcl_AsyncInvoke\fR will invoke them all; at each point it -invokes the highest-priority (oldest) ready handler, repeating -this over and over until there are no longer any ready handlers. - -.SH WARNING -.PP -It is almost always a bad idea for an asynchronous event -handler to modify \fIinterp->result\fR or return a code different -from its \fIcode\fR argument. -This sort of behavior can disrupt the execution of scripts in -subtle ways and result in bugs that are extremely difficult -to track down. -If an asynchronous event handler needs to evaluate Tcl scripts -then it should first save \fIinterp->result\fR plus the values -of the variables \fBerrorInfo\fR and \fBerrorCode\fR (this can -be done, for example, by storing them in dynamic strings). -When the asynchronous handler is finished it should restore -\fIinterp->result\fR, \fBerrorInfo\fR, and \fBerrorCode\fR, -and return the \fIcode\fR argument. - -.SH KEYWORDS -asynchronous event, handler, signal diff --git a/doc/BackgdErr.3 b/doc/BackgdErr.3 deleted file mode 100644 index 72d1530..0000000 --- a/doc/BackgdErr.3 +++ /dev/null @@ -1,58 +0,0 @@ -'\" -'\" Copyright (c) 1992-1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: BackgdErr.3,v 1.2 1998/09/14 18:39:46 stanton Exp $ -'\" -.so man.macros -.TH Tcl_BackgroundError 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_BackgroundError \- report Tcl error that occurred in background processing -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_BackgroundError\fR(\fIinterp\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP Tcl_Interp *interp in -Interpreter in which the error occurred. -.BE - -.SH DESCRIPTION -.PP -This procedure is typically invoked when a Tcl error occurs during -``background processing'' such as executing an event handler. -When such an error occurs, the error condition is reported to Tcl -or to a widget or some other C code, and there is not usually any -obvious way for that code to report the error to the user. -In these cases the code calls \fBTcl_BackgroundError\fR with an -\fIinterp\fR argument identifying the interpreter in which the -error occurred. At the time \fBTcl_BackgroundError\fR is invoked, -\fIinterp->result\fR is expected to contain an error message. -\fBTcl_BackgroundError\fR will invoke the \fBbgerror\fR -Tcl command to report the error in an application-specific fashion. -If no \fBbgerror\fR command exists, or if it returns with an error condition, -then \fBTcl_BackgroundError\fR reports the error itself by printing -a message on the standard error file. -.PP -\fBTcl_BackgroundError\fR does not invoke \fBbgerror\fR immediately -because this could potentially interfere with scripts that are in process -at the time the error occurred. -Instead, it invokes \fBbgerror\fR later as an idle callback. -\fBTcl_BackgroundError\fR saves the values of the \fBerrorInfo\fR and -\fBerrorCode\fR variables and restores these values just before -invoking \fBbgerror\fR. -.PP -It is possible for many background errors to accumulate before -\fBbgerror\fR is invoked. When this happens, each of the errors -is processed in order. However, if \fBbgerror\fR returns a -break exception, then all remaining error reports for the -interpreter are skipped. - -.SH KEYWORDS -background, bgerror, error diff --git a/doc/Backslash.3 b/doc/Backslash.3 deleted file mode 100644 index 95fc7e8..0000000 --- a/doc/Backslash.3 +++ /dev/null @@ -1,53 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Backslash.3,v 1.3 1999/04/16 00:46:30 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Backslash \- parse a backslash sequence -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -char -\fBTcl_Backslash\fR(\fIsrc, countPtr\fR) -.SH ARGUMENTS -.AS char *countPtr -.AP char *src in -Pointer to a string starting with a backslash. -.AP int *countPtr out -If \fIcountPtr\fR isn't NULL, \fI*countPtr\fR gets filled -in with number of characters in the backslash sequence, including -the backslash character. -.BE - -.SH DESCRIPTION -.PP -.VS 8.1 -The use of \fBTcl_Backslash\fR is deprecated in favor of -\fBTcl_UtfBackslash\fR. -.PP -This is a utility procedure provided for backwards compatibilty with -non-internationalized Tcl extensions. It parses a backslash sequence and -returns the low byte of the Unicode character corresponding to the sequence. -.VE -\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of -characters in the backslash sequence. -.PP -See the Tcl manual entry for information on the valid backslash sequences. -All of the sequences described in the Tcl manual entry are supported by -\fBTcl_Backslash\fR. -.VS 8.1 br -.SH "SEE ALSO" -Tcl(n), Tcl_UtfBackslash(3) -.VE - -.SH KEYWORDS -backslash, parse diff --git a/doc/BoolObj.3 b/doc/BoolObj.3 deleted file mode 100644 index 2306350..0000000 --- a/doc/BoolObj.3 +++ /dev/null @@ -1,83 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: BoolObj.3,v 1.2 1998/09/14 18:39:46 stanton Exp $ -'\" -.so man.macros -.TH Tcl_BooleanObj 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_NewBooleanObj, Tcl_SetBooleanObj, Tcl_GetBooleanFromObj \- manipulate Tcl objects as boolean values -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Obj * -\fBTcl_NewBooleanObj\fR(\fIboolValue\fR) -.sp -\fBTcl_SetBooleanObj\fR(\fIobjPtr, boolValue\fR) -.sp -int -\fBTcl_GetBooleanFromObj\fR(\fIinterp, objPtr, boolPtr\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP int boolValue in -Integer value used to initialize or set a boolean object. -If the integer is nonzero, the boolean object is set to 1; -otherwise the boolean object is set to 0. -.AP Tcl_Obj *objPtr in/out -For \fBTcl_SetBooleanObj\fR, this points to the object to be converted -to boolean type. -For \fBTcl_GetBooleanFromObj\fR, this refers to the object -from which to get a boolean value; -if \fIobjPtr\fR does not already point to a boolean object, -an attempt will be made to convert it to one. -.AP Tcl_Interp *interp in/out -If an error occurs during conversion, -an error message is left in the interpreter's result object -unless \fIinterp\fR is NULL. -.AP int *boolPtr out -Points to place where \fBTcl_GetBooleanFromObj\fR -stores the boolean value (0 or 1) obtained from \fIobjPtr\fR. -.BE - -.SH DESCRIPTION -.PP -These procedures are used to create, modify, and read -boolean Tcl objects from C code. -\fBTcl_NewBooleanObj\fR and \fBTcl_SetBooleanObj\fR -will create a new object of boolean type -or modify an existing object to have boolean type. -Both of these procedures set the object to have the -boolean value (0 or 1) specified by \fIboolValue\fR; -if \fIboolValue\fR is nonzero, the object is set to 1, -otherwise to 0. -\fBTcl_NewBooleanObj\fR returns a pointer to a newly created object -with reference count zero. -Both procedures set the object's type to be boolean -and assign the boolean value to the object's internal representation -\fIlongValue\fR member. -\fBTcl_SetBooleanObj\fR invalidates any old string representation -and, if the object is not already a boolean object, -frees any old internal representation. -.PP -\fBTcl_GetBooleanFromObj\fR attempts to return a boolean value -from the Tcl object \fIobjPtr\fR. -If the object is not already a boolean object, -it will attempt to convert it to one. -If an error occurs during conversion, it returns \fBTCL_ERROR\fR -and leaves an error message in the interpreter's result object -unless \fIinterp\fR is NULL. -Otherwise, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR -and stores the boolean value in the address given by \fIboolPtr\fR. -If the object is not already a boolean object, -the conversion will free any old internal representation. - -.SH "SEE ALSO" -Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult - -.SH KEYWORDS -boolean, boolean object, boolean type, internal representation, object, object type, string representation diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3 deleted file mode 100644 index b3ed34f..0000000 --- a/doc/ByteArrObj.3 +++ /dev/null @@ -1,91 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: ByteArrObj.3,v 1.2 1999/03/03 00:38:36 stanton Exp $ -'\" -.so man.macros -.TH Tcl_ByteArrayObj 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl objects as a arrays of bytes -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Obj * -\fBTcl_NewByteArrayObj\fR(\fIbytes, length\fR) -.sp -void -\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, length\fR) -.sp -unsigned char * -\fBTcl_GetByteArrayFromObj\fR(\fIobjPtr, lengthPtr\fR) -.sp -unsigned char * -\fBTcl_SetByteArrayLength\fR(\fIobjPtr, length\fR) -.SH ARGUMENTS -.AS "unsigned char" *lengthPtr in/out -.AP "unsigned char" *bytes in -The array of bytes used to initialize or set a byte-array object. -.AP int length in -The length of the array of bytes. It must be >= 0. -.AP Tcl_Obj *objPtr in/out -For \fBTcl_SetByteArrayObj\fR, this points to the object to be converted to -byte-array type. For \fBTcl_GetByteArrayFromObj\fR and -\fBTcl_SetByteArrayLength\fR, this points to the object from which to get -the byte-array value; if \fIobjPtr\fR does not already point to a byte-array -object, it will be converted to one. -.AP int *lengthPtr out -If non-NULL, filled with the length of the array of bytes in the object. -.BE - -.SH DESCRIPTION -.PP -These procedures are used to create, modify, and read Tcl byte-array objects -from C code. Byte-array objects are typically used to hold the -results of binary IO operations or data structures created with the -\fBbinary\fR command. In Tcl, an array of bytes is not equivalent to a -string. Conceptually, a string is an array of Unicode characters, while a -byte-array is an array of 8-bit quantities with no implicit meaning. -Accesser functions are provided to get the string representation of a -byte-array or to convert an arbitrary object to a byte-array. Obtaining the -string representation of a byte-array object (by calling -\fBTcl_GetStringFromObj\fR) produces a properly formed UTF-8 sequence with a -one-to-one mapping between the bytes in the internal representation and the -UTF-8 characters in the string representation. -.PP -\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR will -create a new object of byte-array type or modify an existing object to have a -byte-array type. Both of these procedures set the object's type to be -byte-array and set the object's internal representation to a copy of the -array of bytes given by \fIbytes\fR. \fBTcl_NewByteArrayObj\fR returns a -pointer to a newly allocated object with a reference count of zero. -\fBTcl_SetByteArrayObj\fR invalidates any old string representation and, if -the object is not already a byte-array object, frees any old internal -representation. -.PP -\fBTcl_GetByteArrayFromObj\fR converts a Tcl object to byte-array type and -returns a pointer to the object's new internal representation as an array of -bytes. The length of this array is stored in \fIlengthPtr\fR if -\fIlengthPtr\fR is non-NULL. The storage for the array of bytes is owned by -the object and should not be freed. The contents of the array may be -modified by the caller only if the object is not shared and the caller -invalidates the string representation. -.PP -\fBTcl_SetByteArrayLength\fR converts the Tcl object to byte-array type -and changes the length of the object's internal representation as an -array of bytes. If \fIlength\fR is greater than the space currently -allocated for the array, the array is reallocated to the new length; the -newly allocated bytes at the end of the array have arbitrary values. If -\fIlength\fR is less than the space currently allocated for the array, -the length of array is reduced to the new length. The return value is a -pointer to the object's new array of bytes. - -.SH "SEE ALSO" -Tcl_GetStringFromObj, Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount - -.SH KEYWORDS -object, byte array, utf, unicode, internationalization diff --git a/doc/CallDel.3 b/doc/CallDel.3 deleted file mode 100644 index 089a922..0000000 --- a/doc/CallDel.3 +++ /dev/null @@ -1,63 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: CallDel.3,v 1.2 1998/09/14 18:39:46 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CallWhenDeleted 3 7.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted \- Arrange for callback when interpreter is deleted -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_CallWhenDeleted\fR(\fIinterp\fR, \fIproc\fR, \fIclientData\fR) -.sp -\fBTcl_DontCallWhenDeleted\fR(\fIinterp\fR, \fIproc\fR, \fIclientData\fR) -.SH ARGUMENTS -.AS Tcl_InterpDeleteProc clientData -.AP Tcl_Interp *interp in -Interpreter with which to associated callback. -.AP Tcl_InterpDeleteProc *proc in -Procedure to call when \fIinterp\fR is deleted. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_CallWhenDeleted\fR arranges for \fIproc\fR to be called by -\fBTcl_DeleteInterp\fR if/when \fIinterp\fR is deleted at some future -time. \fIProc\fR will be invoked just before the interpreter -is deleted, but the interpreter will still be valid at the -time of the call. -\fIProc\fR should have arguments and result that match the -type \fBTcl_InterpDeleteProc\fR: -.CS -typedef void Tcl_InterpDeleteProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR); -.CE -The \fIclientData\fR and \fIinterp\fR parameters are -copies of the \fIclientData\fR and \fIinterp\fR arguments given -to \fBTcl_CallWhenDeleted\fR. -Typically, \fIclientData\fR points to an application-specific -data structure that \fIproc\fR uses to perform cleanup when an -interpreter is about to go away. -\fIProc\fR does not return a value. -.PP -\fBTcl_DontCallWhenDeleted\fR cancels a previous call to -\fBTcl_CallWhenDeleted\fR with the same arguments, so that -\fIproc\fR won't be called after all when \fIinterp\fR is -deleted. -If there is no deletion callback that matches \fIinterp\fR, -\fIproc\fR, and \fIclientData\fR then the call to -\fBTcl_DontCallWhenDeleted\fR has no effect. - -.SH KEYWORDS -callback, delete, interpreter diff --git a/doc/CmdCmplt.3 b/doc/CmdCmplt.3 deleted file mode 100644 index b7effed..0000000 --- a/doc/CmdCmplt.3 +++ /dev/null @@ -1,36 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: CmdCmplt.3,v 1.2 1998/09/14 18:39:46 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CommandComplete 3 "" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CommandComplete \- Check for unmatched braces in a Tcl command -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_CommandComplete\fR(\fIcmd\fR) -.SH ARGUMENTS -.AS char *cmd -.AP char *cmd in -Command string to test for completeness. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_CommandComplete\fR takes a Tcl command string -as argument and determines whether it contains one or more -complete commands (i.e. there are no unclosed quotes, braces, -brackets, or variable references). -If the command string is complete then it returns 1; otherwise it returns 0. - -.SH KEYWORDS -complete command, partial command diff --git a/doc/Concat.3 b/doc/Concat.3 deleted file mode 100644 index edebc01..0000000 --- a/doc/Concat.3 +++ /dev/null @@ -1,55 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Concat.3,v 1.2 1998/09/14 18:39:46 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Concat 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Concat \- concatenate a collection of strings -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -char * -\fBTcl_Concat\fR(\fIargc, argv\fR) -.SH ARGUMENTS -.AP int argc in -Number of strings. -.AP char *argv[] in -Array of strings to concatenate. Must have \fIargc\fR entries. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_Concat\fR is a utility procedure used by several of the -Tcl commands. Given a collection of strings, it concatenates -them together into a single string, with the original strings -separated by spaces. This procedure behaves differently than -\fBTcl_Merge\fR, in that the arguments are simply concatenated: -no effort is made to ensure proper list structure. -However, in most common usage the arguments will all be proper -lists themselves; if this is true, then the result will also have -proper list structure. -.PP -\fBTcl_Concat\fR eliminates leading and trailing white space as it -copies strings from \fBargv\fR to the result. If an element of -\fBargv\fR consists of nothing but white space, then that string -is ignored entirely. This white-space removal was added to make -the output of the \fBconcat\fR command cleaner-looking. -.PP -.VS -The result string is dynamically allocated -using \fBTcl_Alloc\fR; the caller must eventually release the space -by calling \fBTcl_Free\fR. -.VE -.VS -.SH "SEE ALSO" -Tcl_ConcatObj -.SH KEYWORDS -concatenate, strings diff --git a/doc/CrtChannel.3 b/doc/CrtChannel.3 deleted file mode 100644 index dc0f91b..0000000 --- a/doc/CrtChannel.3 +++ /dev/null @@ -1,592 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: CrtChannel.3,v 1.3 1999/04/16 00:46:30 stanton Exp $ -.so man.macros -.TH Tcl_CreateChannel 3 8.0 Tcl "Tcl Library Procedures" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption \- procedures for creating and manipulating channels -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Channel -\fBTcl_CreateChannel\fR(\fItypePtr, channelName, instanceData, mask\fR) -.sp -ClientData -\fBTcl_GetChannelInstanceData\fR(\fIchannel\fR) -.sp -Tcl_ChannelType * -\fBTcl_GetChannelType\fR(\fIchannel\fR) -.sp -char * -\fBTcl_GetChannelName\fR(\fIchannel\fR) -.VS -.sp -int -\fBTcl_GetChannelHandle\fR(\fIchannel, direction, handlePtr\fR) -.VE -.sp -int -\fBTcl_GetChannelBufferSize\fR(\fIchannel\fR) -.sp -\fBTcl_SetChannelBufferSize\fR(\fIchannel, size\fR) -.sp -.VS -\fBTcl_NotifyChannel\fR(\fIchannel, mask\fR) -.sp -int -\fBTcl_BadChannelOption\fR(\fIinterp, optionName, optionList\fR) -.VE -.sp -.SH ARGUMENTS -.AS Tcl_EolTranslation *channelName in -.AP Tcl_ChannelType *typePtr in -Points to a structure containing the addresses of procedures that -can be called to perform I/O and other functions on the channel. -.AP char *channelName in -The name of this channel, such as \fBfile3\fR; must not be in use -by any other channel. Can be NULL, in which case the channel is -created without a name. -.AP ClientData instanceData in -Arbitrary one-word value to be associated with this channel. This -value is passed to procedures in \fItypePtr\fR when they are invoked. -.AP int mask in -OR-ed combination of \fBTCL_READABLE\fR and \fBTCL_WRITABLE\fR to indicate -whether a channel is readable and writable. -.AP Tcl_Channel channel in -The channel to operate on. -.VS -.AP int direction in -\fBTCL_READABLE\fR means the input handle is wanted; \fBTCL_WRITABLE\fR -means the output handle is wanted. -.AP ClientData *handlePtr out -Points to the location where the desired OS-specific handle should be -stored. -.VE -.AP Tcl_EolTranslation transMode in -The translation mode; one of the constants \fBTCL_TRANSLATE_AUTO\fR, -\fBTCL_TRANSLATE_CR\fR, \fBTCL_TRANSLATE_LF\fR and \fBTCL_TRANSLATE_CRLF\fR. -.AP int size in -The size, in bytes, of buffers to allocate in this channel. -.VS -.AP int mask in -An OR-ed combination of \fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR -and \fBTCL_EXCEPTION\fR that indicates events that have occurred on -this channel. -.AP Tcl_Interp *interp in -Current interpreter. (can be NULL) -.AP char *optionName in -Name of the invalid option. -.AP char *optionList in -Specific options list (space separated words, without "-") -to append to the standard generic options list. -Can be NULL for generic options error message only. -.VE - -.BE - -.SH DESCRIPTION -.PP -Tcl uses a two-layered channel architecture. It provides a generic upper -layer to enable C and Tcl programs to perform input and output using the -same APIs for a variety of files, devices, sockets etc. The generic C APIs -are described in the manual entry for \fBTcl_OpenFileChannel\fR. -.PP -The lower layer provides type-specific channel drivers for each type -of device supported on each platform. This manual entry describes the -C APIs used to communicate between the generic layer and the -type-specific channel drivers. It also explains how new types of -channels can be added by providing new channel drivers. -.PP -Channel drivers consist of a number of components: First, each channel -driver provides a \fBTcl_ChannelType\fR structure containing pointers to -functions implementing the various operations used by the generic layer to -communicate with the channel driver. The \fBTcl_ChannelType\fR structure -and the functions referenced by it are described in the section -TCL_CHANNELTYPE, below. -.PP -Second, channel drivers usually provide a Tcl command to create -instances of that type of channel. For example, the Tcl \fBopen\fR -command creates channels that use the file and command channel -drivers, and the Tcl \fBsocket\fR command creates channels that use -TCP sockets for network communication. -.PP -Third, a channel driver optionally provides a C function to open -channel instances of that type. For example, \fBTcl_OpenFileChannel\fR -opens a channel that uses the file channel driver, and -\fBTcl_OpenTcpClient\fR opens a channel that uses the TCP network -protocol. These creation functions typically use -\fBTcl_CreateChannel\fR internally to open the channel. -.PP -To add a new type of channel you must implement a C API or a Tcl command -that opens a channel by invoking \fBTcl_CreateChannel\fR. -When your driver calls \fBTcl_CreateChannel\fR it passes in -a \fBTcl_ChannelType\fR structure describing the driver's I/O -procedures. -The generic layer will then invoke the functions referenced in that -structure to perform operations on the channel. -.PP -\fBTcl_CreateChannel\fR opens a new channel and associates the supplied -\fItypePtr\fR and \fIinstanceData\fR with it. The channel is opened in the -mode indicated by \fImask\fR. -For a discussion of channel drivers, their operations and the -\fBTcl_ChannelType\fR structure, see the section TCL_CHANNELTYPE, below. -.PP -\fBTcl_GetChannelInstanceData\fR returns the instance data associated with -the channel in \fIchannel\fR. This is the same as the \fIinstanceData\fR -argument in the call to \fBTcl_CreateChannel\fR that created this channel. -.PP -\fBTcl_GetChannelType\fR returns a pointer to the \fBTcl_ChannelType\fR -structure used by the channel in the \fIchannel\fR argument. This is -the same as the \fItypePtr\fR argument in the call to -\fBTcl_CreateChannel\fR that created this channel. -.PP -\fBTcl_GetChannelName\fR returns a string containing the name associated -with the channel, or NULL if the \fIchannelName\fR argument to -\fBTcl_CreateChannel\fR was NULL. -.PP -.VS -\fBTcl_GetChannelHandle\fR places the OS-specific device handle -associated with \fIchannel\fR for the given \fIdirection\fR in the -location specified by \fIhandlePtr\fR and returns \fBTCL_OK\fR. If -the channel does not have a device handle for the specified direction, -then \fBTCL_ERROR\fR is returned instead. Different channel drivers -will return different types of handle. Refer to the manual entries -for each driver to determine what type of handle is returned. -.VE -.PP -\fBTcl_GetChannelMode\fR returns an OR-ed combination of \fBTCL_READABLE\fR -and \fBTCL_WRITABLE\fR, indicating whether the channel is open for input -and output. -.PP - \fBTcl_GetChannelBufferSize\fR returns the size, in bytes, of buffers -allocated to store input or output in \fIchan\fR. If the value was not set -by a previous call to \fBTcl_SetChannelBufferSize\fR, described below, then -the default value of 4096 is returned. -.PP -\fBTcl_SetChannelBufferSize\fR sets the size, in bytes, of buffers that -will be allocated in subsequent operations on the channel to store input or -output. The \fIsize\fR argument should be between ten and one million, -allowing buffers of ten bytes to one million bytes. If \fIsize\fR is -outside this range, \fBTcl_SetChannelBufferSize\fR sets the buffer size to -4096. -.PP -.VS -\fBTcl_NotifyChannel\fR is called by a channel driver to indicate to -the generic layer that the events specified by \fImask\fR have -occurred on the channel. Channel drivers are responsible for invoking -this function whenever the channel handlers need to be called for the -channel. See \fBWATCHPROC\fR below for more details. -.VE -.PP -.VS -\fBTcl_BadChannelOption\fR is called from driver specific set or get option -procs to generate a complete error message. -.VE - -.SH TCL_CHANNELTYPE -.PP -A channel driver provides a \fBTcl_ChannelType\fR structure that contains -pointers to functions that implement the various operations on a channel; -these operations are invoked as needed by the generic layer. The -\fBTcl_ChannelType\fR structure contains the following fields: -.PP -.VS -.CS -typedef struct Tcl_ChannelType { - char *\fItypeName\fR; - Tcl_DriverBlockModeProc *\fIblockModeProc\fR; - Tcl_DriverCloseProc *\fIcloseProc\fR; - Tcl_DriverInputProc *\fIinputProc\fR; - Tcl_DriverOutputProc *\fIoutputProc\fR; - Tcl_DriverSeekProc *\fIseekProc\fR; - Tcl_DriverSetOptionProc *\fIsetOptionProc\fR; - Tcl_DriverGetOptionProc *\fIgetOptionProc\fR; - Tcl_DriverWatchProc *\fIwatchProc\fR; - Tcl_DriverGetHandleProc *\fIgetHandleProc\fR; - Tcl_DriverClose2Proc *\fIclose2Proc\fR; -} Tcl_ChannelType; -.CE -.VE -.PP -The driver must provide implementations for all functions except -\fIblockModeProc\fR, \fIseekProc\fR, \fIsetOptionProc\fR, -.VS -\fIgetOptionProc\fR, and \fIclose2Proc\fR, which may be specified as -.VE -NULL. Other functions that can not be implemented for this type of -device should return \fBEINVAL\fR when invoked to indicate that they -are not implemented. - -.SH TYPENAME -.PP -The \fItypeName\fR field contains a null-terminated string that -identifies the type of the device implemented by this driver, e.g. -\fBfile\fR or \fBsocket\fR. - -.SH BLOCKMODEPROC -.PP -The \fIblockModeProc\fR field contains the address of a function called by -the generic layer to set blocking and nonblocking mode on the device. -\fIBlockModeProc\fR should match the following prototype: -.PP -.CS -typedef int Tcl_DriverBlockModeProc( - ClientData \fIinstanceData\fR, - int \fImode\fR); -.CE -.PP -The \fIinstanceData\fR is the same as the value passed to -\fBTcl_CreateChannel\fR when this channel was created. The \fImode\fR -argument is either \fBTCL_MODE_BLOCKING\fR or \fBTCL_MODE_NONBLOCKING\fR to -set the device into blocking or nonblocking mode. The function should -return zero if the operation was successful, or a nonzero POSIX error code -if the operation failed. -.PP -If the operation is successful, the function can modify the supplied -\fIinstanceData\fR to record that the channel entered blocking or -nonblocking mode and to implement the blocking or nonblocking behavior. -For some device types, the blocking and nonblocking behavior can be -implemented by the underlying operating system; for other device types, the -behavior must be emulated in the channel driver. - -.SH CLOSEPROC AND CLOSE2PROC -.PP -The \fIcloseProc\fR field contains the address of a function called by the -generic layer to clean up driver-related information when the channel is -closed. \fICloseProc\fR must match the following prototype: -.PP -.CS -typedef int Tcl_DriverCloseProc( - ClientData \fIinstanceData\fR, - Tcl_Interp *\fIinterp\fR); -.CE -.PP -The \fIinstanceData\fR argument is the same as the value provided to -\fBTcl_CreateChannel\fR when the channel was created. The function should -release any storage maintained by the channel driver for this channel, and -close the input and output devices encapsulated by this channel. All queued -output will have been flushed to the device before this function is called, -and no further driver operations will be invoked on this instance after -calling the \fIcloseProc\fR. If the close operation is successful, the -procedure should return zero; otherwise it should return a nonzero POSIX -error code. In addition, if an error occurs and \fIinterp\fR is not NULL, -the procedure should store an error message in \fIinterp->result\fR. -.PP -.VS -Alternatively, channels that support closing the read and write sides -independently may set \fIcloseProc\fR to \fBTCL_CLOSE2PROC\fR and set -\fIclose2Proc\fR to the address of a function that matches the -following prototype: -.PP -.CS -typedef int Tcl_DriverClose2Proc( - ClientData \fIinstanceData\fR, - Tcl_Interp *\fIinterp\fR, - int \fIflags\fR); -.CE -.PP -The \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed -combination of \fBTCL_CLOSE_READ\fR or \fBTCL_CLOSE_WRITE\fR to -indicate that the driver should close the read and/or write side of -the channel. The channel driver may be invoked to perform -additional operations on the channel after \fIclose2Proc\fR is -called to close one or both sides of the channel. If \fIflags\fR is -\fB0\fR (zero), the driver should close the channel in the manner -described above for \fIcloseProc\fR. No further operations will be -invoked on this instance after \fIclose2Proc\fR is called with all -flags cleared. In all cases, the \fIclose2Proc\fR function should -return zero if the close operation was successful; otherwise it should -return a nonzero POSIX error code. In addition, if an error occurs and -\fIinterp\fR is not NULL, the procedure should store an error message -in \fIinterp->result\fR. -.VE - -.SH INPUTPROC -.PP -The \fIinputProc\fR field contains the address of a function called by the -generic layer to read data from the file or device and store it in an -internal buffer. \fIInputProc\fR must match the following prototype: -.PP -.CS -typedef int Tcl_DriverInputProc( - ClientData \fIinstanceData\fR, - char *\fIbuf\fR, - int \fIbufSize\fR, - int *\fIerrorCodePtr\fR); -.CE -.PP -\fIInstanceData\fR is the same as the value passed to -\fBTcl_CreateChannel\fR when the channel was created. The \fIbuf\fR -argument points to an array of bytes in which to store input from the -device, and the \fIbufSize\fR argument indicates how many bytes are -available at \fIbuf\fR. -.PP -The \fIerrorCodePtr\fR argument points to an integer variable provided by -the generic layer. If an error occurs, the function should set the variable -to a POSIX error code that identifies the error that occurred. -.PP -The function should read data from the input device encapsulated by the -channel and store it at \fIbuf\fR. On success, the function should return -a nonnegative integer indicating how many bytes were read from the input -device and stored at \fIbuf\fR. On error, the function should return -1. If -an error occurs after some data has been read from the device, that data is -lost. -.PP -If \fIinputProc\fR can determine that the input device has some data -available but less than requested by the \fIbufSize\fR argument, the -function should only attempt to read as much data as is available and -return without blocking. If the input device has no data available -whatsoever and the channel is in nonblocking mode, the function should -return an \fBEAGAIN\fR error. If the input device has no data available -whatsoever and the channel is in blocking mode, the function should block -for the shortest possible time until at least one byte of data can be read -from the device; then, it should return as much data as it can read without -blocking. - -.SH OUTPUTPROC -.PP -The \fIoutputProc\fR field contains the address of a function called by the -generic layer to transfer data from an internal buffer to the output device. -\fIOutputProc\fR must match the following prototype: -.PP -.CS -typedef int Tcl_DriverOutputProc( - ClientData \fIinstanceData\fR, - char *\fIbuf\fR, - int \fItoWrite\fR, - int *\fIerrorCodePtr\fR); -.CE -.PP -\fIInstanceData\fR is the same as the value passed to -\fBTcl_CreateChannel\fR when the channel was created. The \fIbuf\fR -argument contains an array of bytes to be written to the device, and the -\fItoWrite\fR argument indicates how many bytes are to be written from the -\fIbuf\fR argument. -.PP -The \fIerrorCodePtr\fR argument points to an integer variable provided by -the generic layer. If an error occurs, the function should set this -variable to a POSIX error code that identifies the error. -.PP -The function should write the data at \fIbuf\fR to the output device -encapsulated by the channel. On success, the function should return a -nonnegative integer indicating how many bytes were written to the output -device. The return value is normally the same as \fItoWrite\fR, but may be -less in some cases such as if the output operation is interrupted by a -signal. If an error occurs the function should return -1. In case of -error, some data may have been written to the device. -.PP -If the channel is nonblocking and the output device is unable to absorb any -data whatsoever, the function should return -1 with an \fBEAGAIN\fR error -without writing any data. - -.SH SEEKPROC -.PP -The \fIseekProc\fR field contains the address of a function called by the -generic layer to move the access point at which subsequent input or output -operations will be applied. \fISeekProc\fR must match the following -prototype: -.PP -.CS -typedef int Tcl_DriverSeekProc( - ClientData \fIinstanceData\fR, - long \fIoffset\fR, - int \fIseekMode\fR, - int *\fIerrorCodePtr\fR); -.CE -.PP -The \fIinstanceData\fR argument is the same as the value given to -\fBTcl_CreateChannel\fR when this channel was created. \fIOffset\fR and -\fIseekMode\fR have the same meaning as for the \fBTcl_Seek\fR -procedure (described in the manual entry for \fBTcl_OpenFileChannel\fR). -.PP -The \fIerrorCodePtr\fR argument points to an integer variable provided by -the generic layer for returning \fBerrno\fR values from the function. The -function should set this variable to a POSIX error code if an error occurs. -The function should store an \fBEINVAL\fR error code if the channel type -does not implement seeking. -.PP -The return value is the new access point or -1 in case of error. If an -error occurred, the function should not move the access point. - -.SH SETOPTIONPROC -.PP -The \fIsetOptionProc\fR field contains the address of a function called by -the generic layer to set a channel type specific option on a channel. -\fIsetOptionProc\fR must match the following prototype: -.PP -.CS -typedef int Tcl_DriverSetOptionProc( - ClientData \fIinstanceData\fR, - Tcl_Interp *\fIinterp\fR, - char *\fIoptionName\fR, - char *\fIoptionValue\fR); -.CE -.PP -\fIoptionName\fR is the name of an option to set, and \fIoptionValue\fR is -the new value for that option, as a string. The \fIinstanceData\fR is the -same as the value given to \fBTcl_CreateChannel\fR when this channel was -created. The function should do whatever channel type specific action is -required to implement the new value of the option. -.PP -Some options are handled by the generic code and this function is never -called to set them, e.g. \fB-blockmode\fR. Other options are specific to -each channel type and the \fIsetOptionProc\fR procedure of the channel -driver will get called to implement them. The \fIsetOptionProc\fR field can -be NULL, which indicates that this channel type supports no type specific -options. -.PP -If the option value is successfully modified to the new value, the function -returns \fBTCL_OK\fR. -.VS -It should call \fBTcl_BadChannelOption\fR which itself returns -\fBTCL_ERROR\fR if the \fIoptionName\fR is -unrecognized. -.VE -If \fIoptionValue\fR specifies a value for the option that -is not supported or if a system call error occurs, -the function should leave an error message in the -\fIresult\fR field of \fIinterp\fR if \fIinterp\fR is not NULL. The -function should also call \fBTcl_SetErrno\fR to store an appropriate POSIX -error code. - -.SH GETOPTIONPROC -.PP -The \fIgetOptionProc\fR field contains the address of a function called by -the generic layer to get the value of a channel type specific option on a -channel. \fIgetOptionProc\fR must match the following prototype: -.PP -.CS -typedef int Tcl_DriverGetOptionProc( - ClientData \fIinstanceData\fR, -.VS - Tcl_Interp *\fIinterp\fR, -.VE - char *\fIoptionName\fR, - Tcl_DString *\fIdsPtr\fR); -.CE -.PP -\fIOptionName\fR is the name of an option supported by this type of -channel. If the option name is not NULL, the function stores its current -value, as a string, in the Tcl dynamic string \fIdsPtr\fR. -If \fIoptionName\fR is NULL, the function stores in \fIdsPtr\fR an -alternating list of all supported options and their current values. -On success, the function returns \fBTCL_OK\fR. -.VS -It should call \fBTcl_BadChannelOption\fR which itself returns -\fBTCL_ERROR\fR if the \fIoptionName\fR is -unrecognized. If a system call error occurs, -the function should leave an error message in the -\fIresult\fR field of \fIinterp\fR if \fIinterp\fR is not NULL. The -function should also call \fBTcl_SetErrno\fR to store an appropriate POSIX -error code. -.VE -.PP -Some options are handled by the generic code and this function is never -called to retrieve their value, e.g. \fB-blockmode\fR. Other options are -specific to each channel type and the \fIgetOptionProc\fR procedure of the -channel driver will get called to implement them. The \fIgetOptionProc\fR -field can be NULL, which indicates that this channel type supports no type -specific options. - -.SH WATCHPROC -.VS -.PP -The \fIwatchProc\fR field contains the address of a function called -by the generic layer to initialize the event notification mechanism to -notice events of interest on this channel. -\fIWatchProc\fR should match the following prototype: -.PP -.CS -typedef void Tcl_DriverWatchProc( - ClientData \fIinstanceData\fR, - int \fImask\fR); -.CE -.VE -.PP -The \fIinstanceData\fR is the same as the value passed to -\fBTcl_CreateChannel\fR when this channel was created. The \fImask\fR -argument is an OR-ed combination of \fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR -and \fBTCL_EXCEPTION\fR; it indicates events the caller is interested in -noticing on this channel. -.PP -.VS -The function should initialize device type specific mechanisms to -notice when an event of interest is present on the channel. When one -or more of the designated events occurs on the channel, the channel -driver is responsible for calling \fBTcl_NotifyChannel\fR to inform -the generic channel module. The driver should take care not to starve -other channel drivers or sources of callbacks by invoking -Tcl_NotifyChannel too frequently. Fairness can be insured by using -the Tcl event queue to allow the channel event to be scheduled in sequence -with other events. See the description of \fBTcl_QueueEvent\fR for -details on how to queue an event. - -.SH GETHANDLEPROC -.PP -The \fIgetHandleProc\fR field contains the address of a function called by -the generic layer to retrieve a device-specific handle from the channel. -\fIGetHandleProc\fR should match the following prototype: -.PP -.CS -typedef int Tcl_DriverGetHandleProc( - ClientData \fIinstanceData\fR, - int \fIdirection\fR, - ClientData *\fIhandlePtr\fR); -.CE -.PP -\fIInstanceData is the same as the value passed to -\fBTcl_CreateChannel\fR when this channel was created. The \fIdirection\fR -argument is either \fBTCL_READABLE\fR to retrieve the handle used -for input, or \fBTCL_WRITABLE\fR to retrieve the handle used for -output. -.PP -If the channel implementation has device-specific handles, the -function should retrieve the appropriate handle associated with the -channel, according the \fIdirection\fR argument. The handle should be -stored in the location referred to by \fIhandlePtr\fR, and -\fBTCL_OK\fR should be returned. If the channel is not open for the -specified direction, or if the channel implementation does not use -device handles, the function should return \fBTCL_ERROR\fR. -.VE - -.VS -.SH TCL_BADCHANNELOPTION -.PP -This procedure generates a "bad option" error message in an -(optional) interpreter. It is used by channel drivers when -a invalid Set/Get option is requested. Its purpose is to concatenate -the generic options list to the specific ones and factorize -the generic options error message string. -.PP -It always return \fBTCL_ERROR\fR -.PP -An error message is generated in interp's result object to -indicate that a command was invoked with the a bad option -The message has the form -.CS - bad option "blah": should be one of - <...generic options...>+<...specific options...> -so you get for instance: - bad option "-blah": should be one of -blocking, - -buffering, -buffersize, -eofchar, -translation, - -peername, or -sockname -when called with optionList="peername sockname" -.CE -"blah" is the optionName argument and "" -is a space separated list of specific option words. -The function takes good care of inserting minus signs before -each option, commas after, and an "or" before the last option. -.VE - -.SH "SEE ALSO" -Tcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3), Tcl_QueueEvent(3) - -.SH KEYWORDS -blocking, channel driver, channel registration, channel type, nonblocking diff --git a/doc/CrtChnlHdlr.3 b/doc/CrtChnlHdlr.3 deleted file mode 100644 index 4536ef6..0000000 --- a/doc/CrtChnlHdlr.3 +++ /dev/null @@ -1,92 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: CrtChnlHdlr.3,v 1.2 1998/09/14 18:39:46 stanton Exp $ -.so man.macros -.TH Tcl_CreateChannelHandler 3 7.5 Tcl "Tcl Library Procedures" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -Tcl_CreateChannelHandler, Tcl_DeleteChannelHandler \- call a procedure when a channel becomes readable or writable -.SH SYNOPSIS -.nf -.nf -\fB#include \fR -.sp -void -\fBTcl_CreateChannelHandler\fR(\fIchannel, mask, proc, clientData\fR) -.sp -void -\fBTcl_DeleteChannelHandler\fR(\fIchannel, proc, clientData\fR) -.sp -.SH ARGUMENTS -.AS Tcl_ChannelProc clientData -.AP Tcl_Channel channel in -Tcl channel such as returned by \fBTcl_CreateChannel\fR. -.AP int mask in -Conditions under which \fIproc\fR should be called: OR-ed combination of -\fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR and \fBTCL_EXCEPTION\fR. Specify -a zero value to temporarily disable an existing handler. -.AP Tcl_FileProc *proc in -Procedure to invoke whenever the channel indicated by \fIchannel\fR meets -the conditions specified by \fImask\fR. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_CreateChannelHandler\fR arranges for \fIproc\fR to be called in the -future whenever input or output becomes possible on the channel identified -by \fIchannel\fR, or whenever an exceptional condition exists for -\fIchannel\fR. The conditions of interest under which \fIproc\fR will be -invoked are specified by the \fImask\fR argument. -See the manual entry for \fBfileevent\fR for a precise description of -what it means for a channel to be readable or writable. -\fIProc\fR must conform to the following prototype: -.CS -typedef void Tcl_ChannelProc( - ClientData \fIclientData\fR, - int \fImask\fR); -.CE -.PP -The \fIclientData\fR argument is the same as the value passed to -\fBTcl_CreateChannelHandler\fR when the handler was created. Typically, -\fIclientData\fR points to a data structure containing application-specific -information about the channel. \fIMask\fR is an integer mask indicating -which of the requested conditions actually exists for the channel; it will -contain a subset of the bits from the \fImask\fR argument to -\fBTcl_CreateChannelHandler\fR when the handler was created. -.PP -Each channel handler is identified by a unique combination of \fIchannel\fR, -\fIproc\fR and \fIclientData\fR. -There may be many handlers for a given channel as long as they don't -have the same \fIchannel\fR, \fIproc\fR, and \fIclientData\fR. -If \fBTcl_CreateChannelHandler\fR is invoked when there is already a handler -for \fIchannel\fR, \fIproc\fR, and \fIclientData\fR, then no new -handler is created; instead, the \fImask\fR is changed for the -existing handler. -.PP -\fBTcl_DeleteChannelHandler\fR deletes a channel handler identified by -\fIchannel\fR, \fIproc\fR and \fIclientData\fR; if no such handler exists, -the call has no effect. -.PP -Channel handlers are invoked via the Tcl event mechanism, so they -are only useful in applications that are event-driven. -Note also that the conditions specified in the \fImask\fR argument -to \fIproc\fR may no longer exist when \fIproc\fR is invoked: for -example, if there are two handlers for \fBTCL_READABLE\fR on the same -channel, the first handler could consume all of the available input -so that the channel is no longer readable when the second handler -is invoked. -For this reason it may be useful to use nonblocking I/O on channels -for which there are event handlers. - -.SH "SEE ALSO" -Notifier(3), Tcl_CreateChannel(3), Tcl_OpenFileChannel(3), vwait(n). - -.SH KEYWORDS -blocking, callback, channel, events, handler, nonblocking. diff --git a/doc/CrtCloseHdlr.3 b/doc/CrtCloseHdlr.3 deleted file mode 100644 index 8f7b4ba..0000000 --- a/doc/CrtCloseHdlr.3 +++ /dev/null @@ -1,59 +0,0 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: CrtCloseHdlr.3,v 1.2 1998/09/14 18:39:47 stanton Exp $ -.so man.macros -.TH Tcl_CreateCloseHandler 3 7.5 Tcl "Tcl Library Procedures" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -Tcl_CreateCloseHandler, Tcl_DeleteCloseHandler \- arrange for callbacks when channels are closed -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -void -\fBTcl_CreateCloseHandler\fR(\fIchannel, proc, clientData\fR) -.sp -void -\fBTcl_DeleteCloseHandler\fR(\fIchannel, proc, clientData\fR) -.sp -.SH ARGUMENTS -.AS Tcl_CloseProc callbackData in -.AP Tcl_Channel channel in -The channel for which to create or delete a close callback. -.AP Tcl_CloseProc *proc in -The procedure to call as the callback. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_CreateCloseHandler\fR arranges for \fIproc\fR to be called when -\fIchannel\fR is closed with \fBTcl_Close\fR or -\fBTcl_UnregisterChannel\fR, or using the Tcl \fBclose\fR command. -\fIProc\fR should match the following prototype: -.PP -.CS -typedef void Tcl_CloseProc( - ClientData \fIclientData\fR); -.CE -.PP -The \fIclientData\fR is the same as the value provided in the call to -\fBTcl_CreateCloseHandler\fR. -.PP -\fBTcl_DeleteCloseHandler\fR removes a close callback for \fIchannel\fR. -The \fIproc\fR and \fIclientData\fR identify which close callback to -remove; \fBTcl_DeleteCloseHandler\fR does nothing if its \fIproc\fR and -\fIclientData\fR arguments do not match the \fIproc\fR and \fIclientData\fR -for a close handler for \fIchannel\fR. - -.SH "SEE ALSO" -close(n), Tcl_Close(3), Tcl_UnregisterChannel(3) - -.SH KEYWORDS -callback, channel closing diff --git a/doc/CrtCommand.3 b/doc/CrtCommand.3 deleted file mode 100644 index f2f6cea..0000000 --- a/doc/CrtCommand.3 +++ /dev/null @@ -1,143 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 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. -'\" -'\" RCS: @(#) $Id: CrtCommand.3,v 1.3 1998/10/05 17:35:53 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CreateCommand 3 "" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CreateCommand \- implement new commands in C -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Command -\fBTcl_CreateCommand\fR(\fIinterp, cmdName, proc, clientData, deleteProc\fR) -.SH ARGUMENTS -.AS Tcl_CmdDeleteProc **deleteProcPtr -.AP Tcl_Interp *interp in -Interpreter in which to create new command. -.AP char *cmdName in -Name of command. -.AP Tcl_CmdProc *proc in -Implementation of new command: \fIproc\fR will be called whenever -\fIcmdName\fR is invoked as a command. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR. -.AP Tcl_CmdDeleteProc *deleteProc in -Procedure to call before \fIcmdName\fR is deleted from the interpreter; -allows for command-specific cleanup. If NULL, then no procedure is -called before the command is deleted. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_CreateCommand\fR defines a new command in \fIinterp\fR and associates -it with procedure \fIproc\fR such that whenever \fIcmdName\fR is -invoked as a Tcl command (via a call to \fBTcl_Eval\fR) the Tcl interpreter -will call \fIproc\fR to process the command. -It differs from \fBTcl_CreateObjCommand\fR in that a new string-based -command is defined; -that is, a command procedure is defined that takes an array of -argument strings instead of objects. -The object-based command procedures registered by \fBTcl_CreateObjCommand\fR -can execute significantly faster than the string-based command procedures -defined by \fBTcl_CreateCommand\fR. -This is because they take Tcl objects as arguments -and those objects can retain an internal representation that -can be manipulated more efficiently. -Also, Tcl's interpreter now uses objects internally. -In order to invoke a string-based command procedure -registered by \fBTcl_CreateCommand\fR, -it must generate and fetch a string representation -from each argument object before the call -and create a new Tcl object to hold the string result returned by the -string-based command procedure. -New commands should be defined using \fBTcl_CreateObjCommand\fR. -We support \fBTcl_CreateCommand\fR for backwards compatibility. -.PP -The procedures \fBTcl_DeleteCommand\fR, \fBTcl_GetCommandInfo\fR, -and \fBTcl_SetCommandInfo\fR are used in conjunction with -\fBTcl_CreateCommand\fR. -.PP -\fBTcl_CreateCommand\fR will delete an existing command \fIcmdName\fR, -if one is already associated with the interpreter. -It returns a token that may be used to refer -to the command in subsequent calls to \fBTcl_GetCommandName\fR. -If \fIcmdName\fR contains any \fB::\fR namespace qualifiers, -then the command is added to the specified namespace; -otherwise the command is added to the global namespace. -If \fBTcl_CreateCommand\fR is called for an interpreter that is in -the process of being deleted, then it does not create a new command -and it returns NULL. -\fIProc\fR should have arguments and result that match the type -\fBTcl_CmdProc\fR: -.CS -typedef int Tcl_CmdProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - int \fIargc\fR, - char *\fIargv\fR[]); -.CE -When \fIproc\fR is invoked the \fIclientData\fR and \fIinterp\fR -parameters will be copies of the \fIclientData\fR and \fIinterp\fR -arguments given to \fBTcl_CreateCommand\fR. -Typically, \fIclientData\fR points to an application-specific -data structure that describes what to do when the command procedure -is invoked. \fIArgc\fR and \fIargv\fR describe the arguments to -the command, \fIargc\fR giving the number of arguments (including -the command name) and \fIargv\fR giving the values of the arguments -as strings. The \fIargv\fR array will contain \fIargc\fR+1 values; -the first \fIargc\fR values point to the argument strings, and the -last value is NULL. -.VS -Note that the argument strings should not be modified as they may -point to constant strings or may be shared with other parts of the -interpreter. -.VE -.PP -\fIProc\fR must return an integer code that is either \fBTCL_OK\fR, \fBTCL_ERROR\fR, -\fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR. See the Tcl overview man page -for details on what these codes mean. Most normal commands will only -return \fBTCL_OK\fR or \fBTCL_ERROR\fR. In addition, \fIproc\fR must set -the interpreter result to point to a string value; -in the case of a \fBTCL_OK\fR return code this gives the result -of the command, and in the case of \fBTCL_ERROR\fR it gives an error message. -The \fBTcl_SetResult\fR procedure provides an easy interface for setting -the return value; for complete details on how the the interpreter result -field is managed, see the \fBTcl_Interp\fR man page. -Before invoking a command procedure, -\fBTcl_Eval\fR sets the interpreter result to point to an empty string, -so simple commands can return an empty result by doing nothing at all. -.PP -The contents of the \fIargv\fR array belong to Tcl and are not -guaranteed to persist once \fIproc\fR returns: \fIproc\fR should -not modify them, nor should it set the interpreter result to point -anywhere within the \fIargv\fR values. -Call \fBTcl_SetResult\fR with status \fBTCL_VOLATILE\fR if you want -to return something from the \fIargv\fR array. -.PP -\fIDeleteProc\fR will be invoked when (if) \fIcmdName\fR is deleted. -This can occur through a call to \fBTcl_DeleteCommand\fR or \fBTcl_DeleteInterp\fR, -or by replacing \fIcmdName\fR in another call to \fBTcl_CreateCommand\fR. -\fIDeleteProc\fR is invoked before the command is deleted, and gives the -application an opportunity to release any structures associated -with the command. \fIDeleteProc\fR should have arguments and -result that match the type \fBTcl_CmdDeleteProc\fR: -.CS -typedef void Tcl_CmdDeleteProc(ClientData \fIclientData\fR); -.CE -The \fIclientData\fR argument will be the same as the \fIclientData\fR -argument passed to \fBTcl_CreateCommand\fR. -.PP - -.SH "SEE ALSO" -Tcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_GetCommandInfo, Tcl_SetCommandInfo, Tcl_GetCommandName, Tcl_SetObjResult - -.SH KEYWORDS -bind, command, create, delete, interpreter, namespace diff --git a/doc/CrtFileHdlr.3 b/doc/CrtFileHdlr.3 deleted file mode 100644 index b660170..0000000 --- a/doc/CrtFileHdlr.3 +++ /dev/null @@ -1,100 +0,0 @@ -'\" -'\" Copyright (c) 1990-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. -'\" -'\" RCS: @(#) $Id: CrtFileHdlr.3,v 1.2 1998/09/14 18:39:47 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CreateFileHandler 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CreateFileHandler, Tcl_DeleteFileHandler \- associate procedure callbacks with files or devices (Unix only) -.SH SYNOPSIS -.nf -\fB#include \fR -.VS -.sp -\fBTcl_CreateFileHandler\fR(\fIfd, mask, proc, clientData\fR) -.sp -\fBTcl_DeleteFileHandler\fR(\fIfd\fR) -.VE -.SH ARGUMENTS -.AS Tcl_FileProc clientData -.VS -.AP int fd in -Unix file descriptor for an open file or device. -.VE -.AP int mask in -Conditions under which \fIproc\fR should be called: -OR-ed combination of \fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR, -and \fBTCL_EXCEPTION\fR. May be set to 0 to temporarily disable -a handler. -.AP Tcl_FileProc *proc in -Procedure to invoke whenever the file or device indicated -by \fIfile\fR meets the conditions specified by \fImask\fR. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -.VS -\fBTcl_CreateFileHandler\fR arranges for \fIproc\fR to be -invoked in the future whenever I/O becomes possible on a file -or an exceptional condition exists for the file. The file -is indicated by \fIfd\fR, and the conditions of interest -.VE -are indicated by \fImask\fR. For example, if \fImask\fR -is \fBTCL_READABLE\fR, \fIproc\fR will be called when -the file is readable. -The callback to \fIproc\fR is made by \fBTcl_DoOneEvent\fR, so -\fBTcl_CreateFileHandler\fR is only useful in programs that dispatch -events through \fBTcl_DoOneEvent\fR or through Tcl commands such -as \fBvwait\fR. -.PP -\fIProc\fR should have arguments and result that match the -type \fBTcl_FileProc\fR: -.CS -typedef void Tcl_FileProc( - ClientData \fIclientData\fR, - int \fImask\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy -of the \fIclientData\fR -argument given to \fBTcl_CreateFileHandler\fR when the callback -was created. Typically, \fIclientData\fR points to a data -structure containing application-specific information about -the file. \fIMask\fR is an integer mask indicating which -of the requested conditions actually exists for the file; it -will contain a subset of the bits in the \fImask\fR argument -to \fBTcl_CreateFileHandler\fR. -.PP -.PP -There may exist only one handler for a given file at a given time. -If \fBTcl_CreateFileHandler\fR is called when a handler already -exists for \fIfd\fR, then the new callback replaces the information -that was previously recorded. -.PP -\fBTcl_DeleteFileHandler\fR may be called to delete the -file handler for \fIfd\fR; if no handler exists for the -file given by \fIfd\fR then the procedure has no effect. -.PP -The purpose of file handlers is to enable an application to respond to -events while waiting for files to become ready for I/O. For this to work -correctly, the application may need to use non-blocking I/O operations on -the files for which handlers are declared. Otherwise the application may -block if it reads or writes too much data; while waiting for the I/O to -complete the application won't be able to service other events. Use -\fBTcl_SetChannelOption\fR with \fB\-blocking\fR to set the channel into -blocking or nonblocking mode as required. -.PP -.VS -Note that these interfaces are only supported by the Unix -implementation of the Tcl notifier. -.VE - -.SH KEYWORDS -callback, file, handler diff --git a/doc/CrtInterp.3 b/doc/CrtInterp.3 deleted file mode 100644 index 62055d9..0000000 --- a/doc/CrtInterp.3 +++ /dev/null @@ -1,131 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: CrtInterp.3,v 1.2 1998/09/14 18:39:47 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CreateInterp 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CreateInterp, Tcl_DeleteInterp, Tcl_InterpDeleted \- create and delete Tcl command interpreters -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Interp * -\fBTcl_CreateInterp\fR() -.sp -\fBTcl_DeleteInterp\fR(\fIinterp\fR) -.sp -int -\fBTcl_InterpDeleted\fR(\fIinterp\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP Tcl_Interp *interp in -Token for interpreter to be destroyed. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_CreateInterp\fR creates a new interpreter structure and returns -a token for it. The token is required in calls to most other Tcl -procedures, such as \fBTcl_CreateCommand\fR, \fBTcl_Eval\fR, and -\fBTcl_DeleteInterp\fR. -Clients are only allowed to access a few of the fields of -Tcl_Interp structures; see the Tcl_Interp -and \fBTcl_CreateCommand\fR man pages for details. -The new interpreter is initialized with no defined variables and only -the built-in Tcl commands. To bind in additional commands, call -\fBTcl_CreateCommand\fR. -.PP -\fBTcl_DeleteInterp\fR marks an interpreter as deleted; the interpreter -will eventually be deleted when all calls to \fBTcl_Preserve\fR for it have -been matched by calls to \fBTcl_Release\fR. At that time, all of the -resources associated with it, including variables, procedures, and -application-specific command bindings, will be deleted. After -\fBTcl_DeleteInterp\fR returns any attempt to use \fBTcl_Eval\fR on the -interpreter will fail and return \fBTCL_ERROR\fR. After the call to -\fBTcl_DeleteInterp\fR it is safe to examine \fIinterp->result\fR, query or -set the values of variables, define, undefine or retrieve procedures, and -examine the runtime evaluation stack. See below, in the section -\fBINTERPRETERS AND MEMORY MANAGEMENT\fR for details. -.PP -\fBTcl_InterpDeleted\fR returns nonzero if \fBTcl_DeleteInterp\fR was -called with \fIinterp\fR as its argument; this indicates that the -interpreter will eventually be deleted, when the last call to -\fBTcl_Preserve\fR for it is matched by a call to \fBTcl_Release\fR. If -nonzero is returned, further calls to \fBTcl_Eval\fR in this interpreter -will return \fBTCL_ERROR\fR. -.PP -\fBTcl_InterpDeleted\fR is useful in deletion callbacks to distinguish -between when only the memory the callback is responsible for is being -deleted and when the whole interpreter is being deleted. In the former case -the callback may recreate the data being deleted, but this would lead to an -infinite loop if the interpreter were being deleted. - -.SH "INTERPRETERS AND MEMORY MANAGEMENT" -.PP -\fBTcl_DeleteInterp\fR can be called at any time on an interpreter that may -be used by nested evaluations and C code in various extensions. Tcl -implements a simple mechanism that allows callers to use interpreters -without worrying about the interpreter being deleted in a nested call, and -without requiring special code to protect the interpreter, in most cases. -This mechanism ensures that nested uses of an interpreter can safely -continue using it even after \fBTcl_DeleteInterp\fR is called. -.PP -The mechanism relies on matching up calls to \fBTcl_Preserve\fR with calls -to \fBTcl_Release\fR. If \fBTcl_DeleteInterp\fR has been called, only when -the last call to \fBTcl_Preserve\fR is matched by a call to -\fBTcl_Release\fR, will the interpreter be freed. See the manual entry for -\fBTcl_Preserve\fR for a description of these functions. -.PP -The rules for when the user of an interpreter must call \fBTcl_Preserve\fR -and \fBTcl_Release\fR are simple: -.TP -Interpreters Passed As Arguments -Functions that are passed an interpreter as an argument can safely use the -interpreter without any special protection. Thus, when you write an -extension consisting of new Tcl commands, no special code is needed to -protect interpreters received as arguments. This covers the majority of all -uses. -.TP -Interpreter Creation And Deletion -When a new interpreter is created and used in a call to \fBTcl_Eval\fR, -\fBTcl_VarEval\fR, \fBTcl_GlobalEval\fR, \fBTcl_SetVar\fR, or -\fBTcl_GetVar\fR, a pair of calls to \fBTcl_Preserve\fR and -\fBTcl_Release\fR should be wrapped around all uses of the interpreter. -Remember that it is unsafe to use the interpreter once \fBTcl_Release\fR -has been called. To ensure that the interpreter is properly deleted when -it is no longer needed, call \fBTcl_InterpDeleted\fR to test if some other -code already called \fBTcl_DeleteInterp\fR; if not, call -\fBTcl_DeleteInterp\fR before calling \fBTcl_Release\fR in your own code. -Do not call \fBTcl_DeleteInterp\fR on an interpreter for which -\fBTcl_InterpDeleted\fR returns nonzero. -.TP -Retrieving An Interpreter From A Data Structure -When an interpreter is retrieved from a data structure (e.g. the client -data of a callback) for use in \fBTcl_Eval\fR, \fBTcl_VarEval\fR, -\fBTcl_GlobalEval\fR, \fBTcl_SetVar\fR, or \fBTcl_GetVar\fR, a pair of -calls to \fBTcl_Preserve\fR and \fBTcl_Release\fR should be wrapped around -all uses of the interpreter; it is unsafe to reuse the interpreter once -\fBTcl_Release\fR has been called. If an interpreter is stored inside a -callback data structure, an appropriate deletion cleanup mechanism should -be set up by the code that creates the data structure so that the -interpreter is removed from the data structure (e.g. by setting the field -to NULL) when the interpreter is deleted. Otherwise, you may be using an -interpreter that has been freed and whose memory may already have been -reused. -.PP -All uses of interpreters in Tcl and Tk have already been protected. -Extension writers should ensure that their code also properly protects any -additional interpreters used, as described above. - -.SH KEYWORDS -command, create, delete, interpreter - -.SH "SEE ALSO" -Tcl_Preserve(3), Tcl_Release(3) diff --git a/doc/CrtMathFnc.3 b/doc/CrtMathFnc.3 deleted file mode 100644 index 21a7761..0000000 --- a/doc/CrtMathFnc.3 +++ /dev/null @@ -1,93 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: CrtMathFnc.3,v 1.2 1998/09/14 18:39:47 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CreateMathFunc 3 7.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CreateMathFunc \- Define a new math function for expressions -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_CreateMathFunc\fR(\fIinterp, name, numArgs, argTypes, proc, clientData\fR) -.SH ARGUMENTS -.AS Tcl_ValueType clientData -.AP Tcl_Interp *interp in -Interpreter in which new function will be defined. -.AP char *name in -Name for new function. -.AP int numArgs in -Number of arguments to new function; also gives size of \fIargTypes\fR array. -.AP Tcl_ValueType *argTypes in -Points to an array giving the permissible types for each argument to -function. -.AP Tcl_MathProc *proc in -Procedure that implements the function. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR when it is invoked. -.BE - -.SH DESCRIPTION -.PP -Tcl allows a number of mathematical functions to be used in -expressions, such as \fBsin\fR, \fBcos\fR, and \fBhypot\fR. -\fBTcl_CreateMathFunc\fR allows applications to add additional functions -to those already provided by Tcl or to replace existing functions. -\fIName\fR is the name of the function as it will appear in expressions. -If \fIname\fR doesn't already exist as a function then a new function -is created. If it does exist, then the existing function is replaced. -\fINumArgs\fR and \fIargTypes\fR describe the arguments to the function. -Each entry in the \fIargTypes\fR array must be either TCL_INT, TCL_DOUBLE, -or TCL_EITHER to indicate whether the corresponding argument must be an -integer, a double-precision floating value, or either, respectively. -.PP -Whenever the function is invoked in an expression Tcl will invoke -\fIproc\fR. \fIProc\fR should have arguments and result that match -the type \fBTcl_MathProc\fR: -.CS -typedef int Tcl_MathProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - Tcl_Value *\fIargs\fR, - Tcl_Value *\fIresultPtr\fR); -.CE -.PP -When \fIproc\fR is invoked the \fIclientData\fR and \fIinterp\fR -arguments will be the same as those passed to \fBTcl_CreateMathFunc\fR. -\fIArgs\fR will point to an array of \fInumArgs\fR Tcl_Value structures, -which describe the actual arguments to the function: -.CS -typedef struct Tcl_Value { - Tcl_ValueType \fItype\fR; - long \fIintValue\fR; - double \fIdoubleValue\fR; -} Tcl_Value; -.CE -.PP -The \fItype\fR field indicates the type of the argument and is -either TCL_INT or TCL_DOUBLE. -It will match the \fIargTypes\fR value specified for the function unless -the \fIargTypes\fR value was TCL_EITHER. Tcl converts -the argument supplied in the expression to the type requested in -\fIargTypes\fR, if that is necessary. -Depending on the value of the \fItype\fR field, the \fIintValue\fR -or \fIdoubleValue\fR field will contain the actual value of the argument. -.PP -\fIProc\fR should compute its result and store it either as an integer -in \fIresultPtr->intValue\fR or as a floating value in -\fIresultPtr->doubleValue\fR. -It should set also \fIresultPtr->type\fR to either TCL_INT or TCL_DOUBLE -to indicate which value was set. -Under normal circumstances \fIproc\fR should return TCL_OK. -If an error occurs while executing the function, \fIproc\fR should -return TCL_ERROR and leave an error message in \fIinterp->result\fR. - -.SH KEYWORDS -expression, mathematical function diff --git a/doc/CrtObjCmd.3 b/doc/CrtObjCmd.3 deleted file mode 100644 index 756b970..0000000 --- a/doc/CrtObjCmd.3 +++ /dev/null @@ -1,261 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: CrtObjCmd.3,v 1.3 1999/04/16 00:46:30 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CreateObjCommand 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetCommandInfo, Tcl_SetCommandInfo, Tcl_GetCommandName \- implement new commands in C -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Command -\fBTcl_CreateObjCommand\fR(\fIinterp, cmdName, proc, clientData, deleteProc\fR) -.sp -int -\fBTcl_DeleteCommand\fR(\fIinterp, cmdName\fR) -.sp -int -\fBTcl_DeleteCommandFromToken\fR(\fIinterp, token\fR) -.sp -int -\fBTcl_GetCommandInfo\fR(\fIinterp, cmdName, infoPtr\fR) -.sp -int -\fBTcl_SetCommandInfo\fR(\fIinterp, cmdName, infoPtr\fR) -.sp -char * -\fBTcl_GetCommandName\fR(\fIinterp, token\fR) -.SH ARGUMENTS -.AS Tcl_ObjCmdProc *deleteProc in/out -.AP Tcl_Interp *interp in -Interpreter in which to create a new command or that contains a command. -.AP char *cmdName in -Name of command. -.AP Tcl_ObjCmdProc *proc in -Implementation of the new command: \fIproc\fR will be called whenever -\fIcmdName\fR is invoked as a command. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR. -.AP Tcl_CmdDeleteProc *deleteProc in -Procedure to call before \fIcmdName\fR is deleted from the interpreter; -allows for command-specific cleanup. If NULL, then no procedure is -called before the command is deleted. -.AP Tcl_Command token in -Token for command, returned by previous call to \fBTcl_CreateObjCommand\fR. -The command must not have been deleted. -.AP Tcl_CmdInfo *infoPtr in/out -Pointer to structure containing various information about a -Tcl command. -.BE -.SH DESCRIPTION -.PP -\fBTcl_CreateObjCommand\fR defines a new command in \fIinterp\fR -and associates it with procedure \fIproc\fR -such that whenever \fIname\fR is -invoked as a Tcl command (e.g., via a call to \fBTcl_EvalObj\fR) -the Tcl interpreter will call \fIproc\fR to process the command. -.PP -\fBTcl_CreateObjCommand\fR deletes any existing command -\fIname\fR already associated with the interpreter -(however see below for an exception where the existing command -is not deleted). -It returns a token that may be used to refer -to the command in subsequent calls to \fBTcl_GetCommandName\fR. -If \fIname\fR contains any \fB::\fR namespace qualifiers, -then the command is added to the specified namespace; -otherwise the command is added to the global namespace. -If \fBTcl_CreateObjCommand\fR is called for an interpreter that is in -the process of being deleted, then it does not create a new command -and it returns NULL. -\fIproc\fR should have arguments and result that match the type -\fBTcl_ObjCmdProc\fR: -.CS -typedef int Tcl_ObjCmdProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - int \fIobjc\fR, -.VS - Tcl_Obj *CONST \fIobjv\fR[]); -.CE -When \fIproc\fR is invoked, the \fIclientData\fR and \fIinterp\fR parameters -will be copies of the \fIclientData\fR and \fIinterp\fR arguments given to -\fBTcl_CreateObjCommand\fR. Typically, \fIclientData\fR points to an -application-specific data structure that describes what to do when the -command procedure is invoked. \fIObjc\fR and \fIobjv\fR describe the -arguments to the command, \fIobjc\fR giving the number of argument objects -(including the command name) and \fIobjv\fR giving the values of the -arguments. The \fIobjv\fR array will contain \fIobjc\fR values, pointing to -the argument objects. Unlike \fIargv\fR[\fIargv\fR] used in a -string-based command procedure, \fIobjv\fR[\fIobjc\fR] will not contain NULL. -.PP -Additionally, when \fIproc\fR is invoked, it must not modify the contents -of the \fIobjv\fR array by assigning new pointer values to any element of the -array (for example, \fIobjv\fR[\fB2\fR] = \fBNULL\fR) because this will -cause memory to be lost and the runtime stack to be corrupted. The -\fBCONST\fR in the declaration of \fIobjv\fR will cause ANSI-compliant -compilers to report any such attempted assignment as an error. However, -it is acceptable to modify the internal representation of any individual -object argument. For instance, the user may call -\fBTcl_GetIntFromObj\fR on \fIobjv\fR[\fB2\fR] to obtain the integer -representation of that object; that call may change the type of the object -that \fIobjv\fR[\fB2\fR] points at, but will not change where -\fIobjv\fR[\fB2\fR] points. -.VE -.PP -\fIproc\fR must return an integer code that is either \fBTCL_OK\fR, -\fBTCL_ERROR\fR, \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR. -See the Tcl overview man page -for details on what these codes mean. Most normal commands will only -return \fBTCL_OK\fR or \fBTCL_ERROR\fR. -In addition, if \fIproc\fR needs to return a non-empty result, -it can call \fBTcl_SetObjResult\fR to set the interpreter's result. -In the case of a \fBTCL_OK\fR return code this gives the result -of the command, -and in the case of \fBTCL_ERROR\fR this gives an error message. -Before invoking a command procedure, -\fBTcl_EvalObj\fR sets interpreter's result to -point to an object representing an empty string, so simple -commands can return an empty result by doing nothing at all. -.PP -The contents of the \fIobjv\fR array belong to Tcl and are not -guaranteed to persist once \fIproc\fR returns: \fIproc\fR should -not modify them. -Call \fBTcl_SetObjResult\fR if you want -to return something from the \fIobjv\fR array. -.PP -Ordinarily, \fBTcl_CreateObjCommand\fR deletes any existing command -\fIname\fR already associated with the interpreter. -However, if the existing command was created by a previous call to -\fBTcl_CreateCommand\fR, -\fBTcl_CreateObjCommand\fR does not delete the command -but instead arranges for the Tcl interpreter to call the -\fBTcl_ObjCmdProc\fR \fIproc\fR in the future. -The old string-based \fBTcl_CmdProc\fR associated with the command -is retained and its address can be obtained by subsequent -\fBTcl_GetCommandInfo\fR calls. This is done for backwards compatibility. -.PP -\fIDeleteProc\fR will be invoked when (if) \fIname\fR is deleted. -This can occur through a call to \fBTcl_DeleteCommand\fR, -\fBTcl_DeleteCommandFromToken\fR, or \fBTcl_DeleteInterp\fR, -or by replacing \fIname\fR in another call to \fBTcl_CreateObjCommand\fR. -\fIDeleteProc\fR is invoked before the command is deleted, and gives the -application an opportunity to release any structures associated -with the command. \fIDeleteProc\fR should have arguments and -result that match the type \fBTcl_CmdDeleteProc\fR: -.CS -typedef void Tcl_CmdDeleteProc(ClientData \fIclientData\fR); -.CE -The \fIclientData\fR argument will be the same as the \fIclientData\fR -argument passed to \fBTcl_CreateObjCommand\fR. -.PP -\fBTcl_DeleteCommand\fR deletes a command from a command interpreter. -Once the call completes, attempts to invoke \fIcmdName\fR in -\fIinterp\fR will result in errors. -If \fIcmdName\fR isn't bound as a command in \fIinterp\fR then -\fBTcl_DeleteCommand\fR does nothing and returns -1; otherwise -it returns 0. -There are no restrictions on \fIcmdName\fR: it may refer to -a built-in command, an application-specific command, or a Tcl procedure. -If \fIname\fR contains any \fB::\fR namespace qualifiers, -the command is deleted from the specified namespace. -.PP -Given a token returned by \fBTcl_CreateObjCommand\fR, -\fBTcl_DeleteCommandFromToken\fR deletes the command -from a command interpreter. -It will delete a command even if that command has been renamed. -Once the call completes, attempts to invoke the command in -\fIinterp\fR will result in errors. -If the command corresponding to \fItoken\fR -has already been deleted from \fIinterp\fR then -\fBTcl_DeleteCommand\fR does nothing and returns -1; -otherwise it returns 0. -.PP -\fBTcl_GetCommandInfo\fR checks to see whether its \fIcmdName\fR argument -exists as a command in \fIinterp\fR. -\fIcmdName\fR may include \fB::\fR namespace qualifiers -to identify a command in a particular namespace. -If the command is not found, then it returns 0. -Otherwise it places information about the command -in the \fBTcl_CmdInfo\fR structure -pointed to by \fIinfoPtr\fR and returns 1. -A \fBTcl_CmdInfo\fR structure has the following fields: -.CS -typedef struct Tcl_CmdInfo { - int isNativeObjectProc; - Tcl_ObjCmdProc *objProc; - ClientData objClientData; - Tcl_CmdProc *proc; - ClientData clientData; - Tcl_CmdDeleteProc *deleteProc; - ClientData deleteData; - Tcl_Namespace *namespacePtr; -} Tcl_CmdInfo; -.CE -The \fIisNativeObjectProc\fR field has the value 1 -if \fBTcl_CreateObjCommand\fR was called to register the command; -it is 0 if only \fBTcl_CreateCommand\fR was called. -It allows a program to determine whether it is faster to -call \fIobjProc\fR or \fIproc\fR: -\fIobjProc\fR is normally faster -if \fIisNativeObjectProc\fR has the value 1. -The fields \fIobjProc\fR and \fIobjClientData\fR -have the same meaning as the \fIproc\fR and \fIclientData\fR -arguments to \fBTcl_CreateObjCommand\fR; -they hold information about the object-based command procedure -that the Tcl interpreter calls to implement the command. -The fields \fIproc\fR and \fIclientData\fR -hold information about the string-based command procedure -that implements the command. -If \fBTcl_CreateCommand\fR was called for this command, -this is the procedure passed to it; -otherwise, this is a compatibility procedure -registered by \fBTcl_CreateObjCommand\fR -that simply calls the command's -object-based procedure after converting its string arguments to Tcl objects. -The field \fIdeleteData\fR is the ClientData value -to pass to \fIdeleteProc\fR; it is normally the same as -\fIclientData\fR but may be set independently using the -\fBTcl_SetCommandInfo\fR procedure. -The field \fInamespacePtr\fR holds a pointer to the -Tcl_Namespace that contains the command. -.PP -\fBTcl_SetCommandInfo\fR is used to modify the procedures and -ClientData values associated with a command. -Its \fIcmdName\fR argument is the name of a command in \fIinterp\fR. -\fIcmdName\fR may include \fB::\fR namespace qualifiers -to identify a command in a particular namespace. -If this command does not exist then \fBTcl_SetCommandInfo\fR returns 0. -Otherwise, it copies the information from \fI*infoPtr\fR to -Tcl's internal structure for the command and returns 1. -Note that this procedure allows the ClientData for a command's -deletion procedure to be given a different value than the ClientData -for its command procedure. -Note that \fBTcl_SetCmdInfo\fR will not change a command's namespace; -you must use \fBTcl_RenameCommand\fR to do that. -.PP -\fBTcl_GetCommandName\fR provides a mechanism for tracking commands -that have been renamed. -Given a token returned by \fBTcl_CreateObjCommand\fR -when the command was created, \fBTcl_GetCommandName\fR returns the -string name of the command. If the command has been renamed since it -was created, then \fBTcl_GetCommandName\fR returns the current name. -This name does not include any \fB::\fR namespace qualifiers. -The command corresponding to \fItoken\fR must not have been deleted. -The string returned by \fBTcl_GetCommandName\fR is in dynamic memory -owned by Tcl and is only guaranteed to retain its value as long as the -command isn't deleted or renamed; callers should copy the string if -they need to keep it for a long time. -.PP - -.SH "SEE ALSO" -Tcl_CreateCommand, Tcl_ResetResult, Tcl_SetObjResult - -.SH KEYWORDS -bind, command, create, delete, namespace, object diff --git a/doc/CrtSlave.3 b/doc/CrtSlave.3 deleted file mode 100644 index 940ae57..0000000 --- a/doc/CrtSlave.3 +++ /dev/null @@ -1,230 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: CrtSlave.3,v 1.2 1998/09/14 18:39:47 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CreateSlave 3 7.6 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateSlave, Tcl_GetSlave, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands. -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_IsSafe\fR(\fIinterp\fR) -.sp -int -\fBTcl_MakeSafe\fR(\fIinterp\fR) -.sp -Tcl_Interp * -\fBTcl_CreateSlave\fR(\fIinterp, slaveName, isSafe\fR) -.sp -Tcl_Interp * -\fBTcl_GetSlave\fR(\fIinterp, slaveName\fR) -.sp -Tcl_Interp * -\fBTcl_GetMaster\fR(\fIinterp\fR) -.sp -int -\fBTcl_GetInterpPath\fR(\fIaskingInterp, slaveInterp\fR) -.sp -.VS -int -\fBTcl_CreateAlias\fR(\fIslaveInterp, srcCmd, targetInterp, targetCmd, argc, argv\fR) -.sp -int -\fBTcl_CreateAliasObj\fR(\fIslaveInterp, srcCmd, targetInterp, targetCmd, objc, objv\fR) -.VE -.sp -int -\fBTcl_GetAlias\fR(\fIinterp, srcCmd, targetInterpPtr, targetCmdPtr, argcPtr, argvPtr\fR) -.sp -.VS -int -\fBTcl_GetAliasObj\fR(\fIinterp, srcCmd, targetInterpPtr, targetCmdPtr, objcPtr, objvPtr\fR) -.sp -int -\fBTcl_ExposeCommand\fR(\fIinterp, hiddenCmdName, cmdName\fR) -.sp -int -\fBTcl_HideCommand\fR(\fIinterp, cmdName, hiddenCmdName\fR) -.SH ARGUMENTS -.AS Tcl_InterpDeleteProc **hiddenCmdName -.AP Tcl_Interp *interp in -Interpreter in which to execute the specified command. -.AP char *slaveName in -Name of slave interpreter to create or manipulate. -.AP int isSafe in -If non-zero, a ``safe'' slave that is suitable for running untrusted code -is created, otherwise a trusted slave is created. -.AP Tcl_Interp *slaveInterp in -Interpreter to use for creating the source command for an alias (see -below). -.AP char *srcCmd in -Name of source command for alias. -.AP Tcl_Interp *targetInterp in -Interpreter that contains the target command for an alias. -.AP char *targetCmd in -Name of target command for alias in \fItargetInterp\fR. -.AP int argc in -Count of additional arguments to pass to the alias command. -.AP char **argv in -Vector of strings, the additional arguments to pass to the alias command. -This storage is owned by the caller. -.AP int objc in -Count of additional object arguments to pass to the alias object command. -.AP Tcl_Object **objv in -Vector of Tcl_Obj structures, the additional object argumenst to pass to -the alias object command. -This storage is owned by the caller. -.AP Tcl_Interp **targetInterpPtr in -Pointer to location to store the address of the interpreter where a target -command is defined for an alias. -.AP char **targetCmdPtr out -Pointer to location to store the address of the name of the target command -for an alias. -.AP int *argcPtr out -Pointer to location to store count of additional arguments to be passed to -the alias. The location is in storage owned by the caller. -.AP char ***argvPtr out -Pointer to location to store a vector of strings, the additional arguments -to pass to an alias. The location is in storage owned by the caller, the -vector of strings is owned by the called function. -.AP int *objcPtr out -Pointer to location to store count of additional object arguments to be -passed to the alias. The location is in storage owned by the caller. -.AP Tcl_Obj ***objvPtr out -Pointer to location to store a vector of Tcl_Obj structures, the additional -arguments to pass to an object alias command. The location is in storage -owned by the caller, the vector of Tcl_Obj structures is owned by the -called function. -.VS -.AP char *cmdName in -Name of an exposed command to hide or create. -.AP char *hiddenCmdName in -Name under which a hidden command is stored and with which it can be -exposed or invoked. -.VE -.BE - -.SH DESCRIPTION -.PP -These procedures are intended for access to the multiple interpreter -facility from inside C programs. They enable managing multiple interpreters -in a hierarchical relationship, and the management of aliases, commands -that when invoked in one interpreter execute a command in another -interpreter. The return value for those procedures that return an \fBint\fR -is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned -then the \fBresult\fR field of the interpreter contains an error message. -.PP -\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR. -It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which -allows \fIinterp\fR to manipulate the new slave. -If \fIisSafe\fR is zero, the command creates a trusted slave in which Tcl -code has access to all the Tcl commands. -If it is \fB1\fR, the command creates a ``safe'' slave in which Tcl code -has access only to set of Tcl commands defined as ``Safe Tcl''; see the -manual entry for the Tcl \fBinterp\fR command for details. -If the creation of the new slave interpreter failed, \fBNULL\fR is returned. -.PP -\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is ``safe'' (was created -with the \fBTCL_SAFE_INTERPRETER\fR flag specified), -\fB0\fR otherwise. -.PP -\fBTcl_MakeSafe\fR makes \fIinterp\fR ``safe'' by removing all -non-core and core unsafe functionality. Note that if you call this after -adding some extension to an interpreter, all traces of that extension will -be removed from the interpreter. -.PP -\fBTcl_GetSlave\fR returns a pointer to a slave interpreter of -\fIinterp\fR. The slave interpreter is identified by \fIslaveName\fR. -If no such slave interpreter exists, \fBNULL\fR is returned. -.PP -\fBTcl_GetMaster\fR returns a pointer to the master interpreter of -\fIinterp\fR. If \fIinterp\fR has no master (it is a -top-level interpreter) then \fBNULL\fR is returned. -.PP -\fBTcl_GetInterpPath\fR sets the \fIresult\fR field in \fIaskingInterp\fR -to the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR; -\fIslaveInterp\fR must be a slave of \fIaskingInterp\fR. If the computation -of the relative path succeeds, \fBTCL_OK\fR is returned, else -\fBTCL_ERROR\fR is returned and the \fIresult\fR field in -\fIaskingInterp\fR contains the error message. -.PP -.VS -\fBTcl_CreateAlias\fR creates an object command named \fIsrcCmd\fR in -\fIslaveInterp\fR that when invoked, will cause the command \fItargetCmd\fR -to be invoked in \fItargetInterp\fR. The arguments specified by the strings -contained in \fIargv\fR are always prepended to any arguments supplied in the -invocation of \fIsrcCmd\fR and passed to \fItargetCmd\fR. -This operation returns \fBTCL_OK\fR if it succeeds, or \fBTCL_ERROR\fR if -it fails; in that case, an error message is left in the object result -of \fIslaveInterp\fR. -Note that there are no restrictions on the ancestry relationship (as -created by \fBTcl_CreateSlave\fR) between \fIslaveInterp\fR and -\fItargetInterp\fR. Any two interpreters can be used, without any -restrictions on how they are related. -.PP -\fBTcl_CreateAliasObj\fR is similar to \fBTcl_CreateAliasObj\fR except -that it takes a vector of objects to pass as additional arguments instead -of a vector of strings. -.VE -.PP -\fBTcl_GetAlias\fR returns information about an alias \fIaliasName\fR -in \fIinterp\fR. Any of the result fields can be \fBNULL\fR, in -which case the corresponding datum is not returned. If a result field is -non\-\fBNULL\fR, the address indicated is set to the corresponding datum. -For example, if \fItargetNamePtr\fR is non\-\fBNULL\fR it is set to a -pointer to the string containing the name of the target command. -.VS -.PP -\fBTcl_GetAliasObj\fR is similar to \fBTcl_GetAlias\fR except that it -returns a pointer to a vector of Tcl_Obj structures instead of a vector of -strings. -.PP -\fBTcl_ExposeCommand\fR moves the command named \fIhiddenCmdName\fR from -the set of hidden commands to the set of exposed commands, putting -it under the name -\fIcmdName\fR. -\fIHiddenCmdName\fR must be the name of an existing hidden -command, or the operation will return \fBTCL_ERROR\fR and leave an error -message in the \fIresult\fR field in \fIinterp\fR. -If an exposed command named \fIcmdName\fR already exists, -the operation returns \fBTCL_ERROR\fR and leaves an error message in the -object result of \fIinterp\fR. -If the operation succeeds, it returns \fBTCL_OK\fR. -After executing this command, attempts to use \fIcmdName\fR in a call to -\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will again succeed. -.PP -\fBTcl_HideCommand\fR moves the command named \fIcmdName\fR from the set of -exposed commands to the set of hidden commands, under the name -\fIhiddenCmdName\fR. -\fICmdName\fR must be the name of an existing exposed -command, or the operation will return \fBTCL_ERROR\fR and leave an error -message in the object result of \fIinterp\fR. -Currently both \fIcmdName\fR and \fIhiddenCmdName\fR must not contain -namespace qualifiers, or the operation will return \fBTCL_ERROR\fR and -leave an error message in the object result of \fIinterp\fR. -The \fICmdName\fR will be looked up in the global namespace, and not -relative to the current namespace, even if the current namespace is not the -global one. -If a hidden command whose name is \fIhiddenCmdName\fR already -exists, the operation also returns \fBTCL_ERROR\fR and the \fIresult\fR -field in \fIinterp\fR contains an error message. -If the operation succeeds, it returns \fBTCL_OK\fR. -After executing this command, attempts to use \fIcmdName\fR in a call to -\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will fail. -.PP -.SH "SEE ALSO" -For a description of the Tcl interface to multiple interpreters, see -\fIinterp(n)\fR. - -.SH KEYWORDS -alias, command, exposed commands, hidden commands, interpreter, invoke, -master, slave, - diff --git a/doc/CrtTimerHdlr.3 b/doc/CrtTimerHdlr.3 deleted file mode 100644 index ecfa4c3..0000000 --- a/doc/CrtTimerHdlr.3 +++ /dev/null @@ -1,76 +0,0 @@ -'\" -'\" Copyright (c) 1990 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: CrtTimerHdlr.3,v 1.2 1998/09/14 18:39:47 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CreateTimerHandler 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CreateTimerHandler, Tcl_DeleteTimerHandler \- call a procedure at a -given time -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_TimerToken -\fBTcl_CreateTimerHandler\fR(\fImilliseconds, proc, clientData\fR) -.sp -\fBTcl_DeleteTimerHandler\fR(\fItoken\fR) -.SH ARGUMENTS -.AS Tcl_TimerToken milliseconds -.AP int milliseconds in -How many milliseconds to wait before invoking \fIproc\fR. -.AP Tcl_TimerProc *proc in -Procedure to invoke after \fImilliseconds\fR have elapsed. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.AP Tcl_TimerToken token in -Token for previously-created timer handler (the return value -from some previous call to \fBTcl_CreateTimerHandler\fR). -.BE - -.SH DESCRIPTION -.PP -\fBTcl_CreateTimerHandler\fR arranges for \fIproc\fR to be -invoked at a time \fImilliseconds\fR milliseconds in the -future. -The callback to \fIproc\fR will be made by \fBTcl_DoOneEvent\fR, -so \fBTcl_CreateTimerHandler\fR is only useful in programs that -dispatch events through \fBTcl_DoOneEvent\fR or through Tcl commands -such as \fBvwait\fR. -The call to \fIproc\fR may not be made at the exact time given by -\fImilliseconds\fR: it will be made at the next opportunity -after that time. For example, if \fBTcl_DoOneEvent\fR isn't -called until long after the time has elapsed, or if there -are other pending events to process before the call to -\fIproc\fR, then the call to \fIproc\fR will be delayed. -.PP -\fIProc\fR should have arguments and return value that match -the type \fBTcl_TimerProc\fR: -.CS -typedef void Tcl_TimerProc(ClientData \fIclientData\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a -copy of the \fIclientData\fR argument given to -\fBTcl_CreateTimerHandler\fR when the callback -was created. Typically, \fIclientData\fR points to a data -structure containing application-specific information about -what to do in \fIproc\fR. -.PP -\fBTcl_DeleteTimerHandler\fR may be called to delete a -previously-created timer handler. It deletes the handler -indicated by \fItoken\fR so that no call to \fIproc\fR -will be made; if that handler no longer exists -(e.g. because the time period has already elapsed and \fIproc\fR -has been invoked then \fBTcl_DeleteTimerHandler\fR does nothing. -The tokens returned by \fBTcl_CreateTimerHandler\fR never have -a value of NULL, so if NULL is passed to \fBTcl_DeleteTimerHandler\fR -then the procedure does nothing. - -.SH KEYWORDS -callback, clock, handler, timer diff --git a/doc/CrtTrace.3 b/doc/CrtTrace.3 deleted file mode 100644 index dff97d1..0000000 --- a/doc/CrtTrace.3 +++ /dev/null @@ -1,106 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: CrtTrace.3,v 1.2 1998/09/14 18:39:47 stanton Exp $ -'\" -.so man.macros -.TH Tcl_CreateTrace 3 "" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_CreateTrace, Tcl_DeleteTrace \- arrange for command execution to be traced -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Trace -\fBTcl_CreateTrace\fR(\fIinterp, level, proc, clientData\fR) -.sp -\fBTcl_DeleteTrace\fR(\fIinterp, trace\fR) -.SH ARGUMENTS -.AS Tcl_CmdTraceProc (clientData)() -.AP Tcl_Interp *interp in -Interpreter containing command to be traced or untraced. -.AP int level in -Only commands at or below this nesting level will be traced. 1 means -top-level commands only, 2 means top-level commands or those that are -invoked as immediate consequences of executing top-level commands -(procedure bodies, bracketed commands, etc.) and so on. -.AP Tcl_CmdTraceProc *proc in -Procedure to call for each command that's executed. See below for -details on the calling sequence. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.AP Tcl_Trace trace in -Token for trace to be removed (return value from previous call -to \fBTcl_CreateTrace\fR). -.BE - -.SH DESCRIPTION -.PP -\fBTcl_CreateTrace\fR arranges for command tracing. From now on, \fIproc\fR -will be invoked before Tcl calls command procedures to process -commands in \fIinterp\fR. The return value from -\fBTcl_CreateTrace\fR is a token for the trace, -which may be passed to \fBTcl_DeleteTrace\fR to remove the trace. There may -be many traces in effect simultaneously for the same command interpreter. -.PP -\fIProc\fR should have arguments and result that match the -type \fBTcl_CmdTraceProc\fR: -.CS -typedef void Tcl_CmdTraceProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - int \fIlevel\fR, - char *\fIcommand\fR, - Tcl_CmdProc *\fIcmdProc\fR, - ClientData \fIcmdClientData\fR, - int \fIargc\fR, - char *\fIargv\fR[]); -.CE -The \fIclientData\fR and \fIinterp\fR parameters are -copies of the corresponding arguments given to \fBTcl_CreateTrace\fR. -\fIClientData\fR typically points to an application-specific -data structure that describes what to do when \fIproc\fR -is invoked. \fILevel\fR gives the nesting level of the command -(1 for top-level commands passed to \fBTcl_Eval\fR by the application, -2 for the next-level commands passed to \fBTcl_Eval\fR as part of parsing -or interpreting level-1 commands, and so on). \fICommand\fR -points to a string containing the text of the -command, before any argument substitution. -\fICmdProc\fR contains the address of the command procedure that -will be called to process the command (i.e. the \fIproc\fR argument -of some previous call to \fBTcl_CreateCommand\fR) and \fIcmdClientData\fR -contains the associated client data for \fIcmdProc\fR (the \fIclientData\fR -value passed to \fBTcl_CreateCommand\fR). \fIArgc\fR and \fIargv\fR give -the final argument information that will be passed to \fIcmdProc\fR, after -command, variable, and backslash substitution. -\fIProc\fR must not modify the \fIcommand\fR or \fIargv\fR strings. -.PP -Tracing will only occur for commands at nesting level less than -or equal to the \fIlevel\fR parameter (i.e. the \fIlevel\fR -parameter to \fIproc\fR will always be less than or equal to the -\fIlevel\fR parameter to \fBTcl_CreateTrace\fR). -.PP -Calls to \fIproc\fR will be made by the Tcl parser immediately before -it calls the command procedure for the command (\fIcmdProc\fR). This -occurs after argument parsing and substitution, so tracing for -substituted commands occurs before tracing of the commands -containing the substitutions. If there is a syntax error in a -command, or if there is no command procedure associated with a -command name, then no tracing will occur for that command. If a -string passed to Tcl_Eval contains multiple commands (bracketed, or -on different lines) then multiple calls to \fIproc\fR will occur, -one for each command. The \fIcommand\fR string for each of these -trace calls will reflect only a single command, not the entire string -passed to Tcl_Eval. -.PP -\fBTcl_DeleteTrace\fR removes a trace, so that no future calls will be -made to the procedure associated with the trace. After \fBTcl_DeleteTrace\fR -returns, the caller should never again use the \fItrace\fR token. - -.SH KEYWORDS -command, create, delete, interpreter, trace diff --git a/doc/DString.3 b/doc/DString.3 deleted file mode 100644 index e8cc5e1..0000000 --- a/doc/DString.3 +++ /dev/null @@ -1,145 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: DString.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_DString 3 7.4 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_DStringInit\fR(\fIdsPtr\fR) -.sp -char * -\fBTcl_DStringAppend\fR(\fIdsPtr, string, length\fR) -.sp -char * -\fBTcl_DStringAppendElement\fR(\fIdsPtr, string\fR) -.sp -\fBTcl_DStringStartSublist\fR(\fIdsPtr\fR) -.sp -\fBTcl_DStringEndSublist\fR(\fIdsPtr\fR) -.sp -int -\fBTcl_DStringLength\fR(\fIdsPtr\fR) -.sp -char * -\fBTcl_DStringValue\fR(\fIdsPtr\fR) -.sp -\fBTcl_DStringSetLength\fR(\fIdsPtr, newLength\fR) -.sp -\fBTcl_DStringFree\fR(\fIdsPtr\fR) -.sp -\fBTcl_DStringResult\fR(\fIinterp, dsPtr\fR) -.sp -\fBTcl_DStringGetResult\fR(\fIinterp, dsPtr\fR) -.SH ARGUMENTS -.AS Tcl_DString newLength -.AP Tcl_DString *dsPtr in/out -Pointer to structure that is used to manage a dynamic string. -.AP char *string in -Pointer to characters to add to dynamic string. -.AP int length in -Number of characters from string to add to dynamic string. If -1, -add all characters up to null terminating character. -.AP int newLength in -New length for dynamic string, not including null terminating -character. -.AP Tcl_Interp *interp in/out -Interpreter whose result is to be set from or moved to the -dynamic string. -.BE - -.SH DESCRIPTION -.PP -Dynamic strings provide a mechanism for building up arbitrarily long -strings by gradually appending information. If the dynamic string is -short then there will be no memory allocation overhead; as the string -gets larger, additional space will be allocated as needed. -.PP -\fBTcl_DStringInit\fR initializes a dynamic string to zero length. -The Tcl_DString structure must have been allocated by the caller. -No assumptions are made about the current state of the structure; -anything already in it is discarded. -If the structure has been used previously, \fBTcl_DStringFree\fR should -be called first to free up any memory allocated for the old -string. -.PP -\fBTcl_DStringAppend\fR adds new information to a dynamic string, -allocating more memory for the string if needed. -If \fIlength\fR is less than zero then everything in \fIstring\fR -is appended to the dynamic string; otherwise \fIlength\fR -specifies the number of bytes to append. -\fBTcl_DStringAppend\fR returns a pointer to the characters of -the new string. The string can also be retrieved from the -\fIstring\fR field of the Tcl_DString structure. -.PP -\fBTcl_DStringAppendElement\fR is similar to \fBTcl_DStringAppend\fR -except that it doesn't take a \fIlength\fR argument (it appends -all of \fIstring\fR) and it converts the string to a proper list element -before appending. -\fBTcl_DStringAppendElement\fR adds a separator space before the -new list element unless the new list element is the first in a -list or sub-list (i.e. either the current string is empty, or it -contains the single character ``{'', or the last two characters of -the current string are `` {''). -\fBTcl_DStringAppendElement\fR returns a pointer to the -characters of the new string. -.PP -\fBTcl_DStringStartSublist\fR and \fBTcl_DStringEndSublist\fR can be -used to create nested lists. -To append a list element that is itself a sublist, first -call \fBTcl_DStringStartSublist\fR, then call \fBTcl_DStringAppendElement\fR -for each of the elements in the sublist, then call -\fBTcl_DStringEndSublist\fR to end the sublist. -\fBTcl_DStringStartSublist\fR appends a space character if needed, -followed by an open brace; \fBTcl_DStringEndSublist\fR appends -a close brace. -Lists can be nested to any depth. -.PP -\fBTcl_DStringLength\fR is a macro that returns the current length -of a dynamic string (not including the terminating null character). -\fBTcl_DStringValue\fR is a macro that returns a pointer to the -current contents of a dynamic string. -.PP -.PP -\fBTcl_DStringSetLength\fR changes the length of a dynamic string. -If \fInewLength\fR is less than the string's current length, then -the string is truncated. -If \fInewLength\fR is greater than the string's current length, -then the string will become longer and new space will be allocated -for the string if needed. -However, \fBTcl_DStringSetLength\fR will not initialize the new -space except to provide a terminating null character; it is up to the -caller to fill in the new space. -\fBTcl_DStringSetLength\fR does not free up the string's storage space -even if the string is truncated to zero length, so \fBTcl_DStringFree\fR -will still need to be called. -.PP -\fBTcl_DStringFree\fR should be called when you're finished using -the string. It frees up any memory that was allocated for the string -and reinitializes the string's value to an empty string. -.PP -\fBTcl_DStringResult\fR sets the result of \fIinterp\fR to the value of -the dynamic string given by \fIdsPtr\fR. It does this by moving -a pointer from \fIdsPtr\fR to \fIinterp->result\fR. -This saves the cost of allocating new memory and copying the string. -\fBTcl_DStringResult\fR also reinitializes the dynamic string to -an empty string. -.PP -\fBTcl_DStringGetResult\fR does the opposite of \fBTcl_DStringResult\fR. -It sets the value of \fIdsPtr\fR to the result of \fIinterp\fR and -it clears \fIinterp\fR's result. -If possible it does this by moving a pointer rather than by copying -the string. - -.SH KEYWORDS -append, dynamic string, free, result diff --git a/doc/DetachPids.3 b/doc/DetachPids.3 deleted file mode 100644 index 23b16c5..0000000 --- a/doc/DetachPids.3 +++ /dev/null @@ -1,62 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: DetachPids.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_DetachPids, Tcl_ReapDetachedProcs \- manage child processes in background -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_DetachPids\fR(\fInumPids, pidPtr\fR) -.sp -\fBTcl_ReapDetachedProcs\fR() -.SH ARGUMENTS -.AS int *statusPtr -.AP int numPids in -Number of process ids contained in the array pointed to by \fIpidPtr\fR. -.AP int *pidPtr in -Address of array containing \fInumPids\fR process ids. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_DetachPids\fR and \fBTcl_ReapDetachedProcs\fR provide a -mechanism for managing subprocesses that are running in background. -These procedures are needed because the parent of a process must -eventually invoke the \fBwaitpid\fR kernel call (or one of a few other -similar kernel calls) to wait for the child to exit. Until the -parent waits for the child, the child's state cannot be completely -reclaimed by the system. If a parent continually creates children -and doesn't wait on them, the system's process table will eventually -overflow, even if all the children have exited. -.PP -\fBTcl_DetachPids\fR may be called to ask Tcl to take responsibility -for one or more processes whose process ids are contained in the -\fIpidPtr\fR array passed as argument. The caller presumably -has started these processes running in background and doesn't -want to have to deal with them again. -.PP -\fBTcl_ReapDetachedProcs\fR invokes the \fBwaitpid\fR kernel call -on each of the background processes so that its state can be cleaned -up if it has exited. If the process hasn't exited yet, -\fBTcl_ReapDetachedProcs\fR doesn't wait for it to exit; it will check again -the next time it is invoked. -Tcl automatically calls \fBTcl_ReapDetachedProcs\fR each time the -\fBexec\fR command is executed, so in most cases it isn't necessary -for any code outside of Tcl to invoke \fBTcl_ReapDetachedProcs\fR. -However, if you call \fBTcl_DetachPids\fR in situations where the -\fBexec\fR command may never get executed, you may wish to call -\fBTcl_ReapDetachedProcs\fR from time to time so that background -processes can be cleaned up. - -.SH KEYWORDS -background, child, detach, process, wait diff --git a/doc/DoOneEvent.3 b/doc/DoOneEvent.3 deleted file mode 100644 index 8ae7a88..0000000 --- a/doc/DoOneEvent.3 +++ /dev/null @@ -1,108 +0,0 @@ -'\" -'\" Copyright (c) 1990-1992 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: DoOneEvent.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_DoOneEvent 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_DoOneEvent \- wait for events and invoke event handlers -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_DoOneEvent\fR(\fIflags\fR) -.SH ARGUMENTS -.AS int flags -.AP int flags in -This parameter is normally zero. It may be an OR-ed combination -of any of the following flag bits: -TCL_WINDOW_EVENTS, -TCL_FILE_EVENTS, TCL_TIMER_EVENTS, TCL_IDLE_EVENTS, TCL_ALL_EVENTS, or -TCL_DONT_WAIT. -.BE - -.SH DESCRIPTION -.PP -This procedure is the entry point to Tcl's event loop; it is responsible for -waiting for events and dispatching event handlers created with -procedures such as \fBTk_CreateEventHandler\fR, \fBTcl_CreateFileHandler\fR, -\fBTcl_CreateTimerHandler\fR, and \fBTcl_DoWhenIdle\fR. -\fBTcl_DoOneEvent\fR checks to see if -events are already present on the Tcl event queue; if so, -it calls the handler(s) for the first (oldest) event, removes it from -the queue, and returns. -If there are no events ready to be handled, then \fBTcl_DoOneEvent\fR -checks for new events from all possible sources. -If any are found, it puts all of them on Tcl's event queue, calls -handlers for the first event on the queue, and returns. -If no events are found, \fBTcl_DoOneEvent\fR checks for \fBTcl_DoWhenIdle\fR -callbacks; if any are found, it invokes all of them and returns. -Finally, if no events or idle callbacks have been found, then -\fBTcl_DoOneEvent\fR sleeps until an event occurs; then it adds any -new events to the Tcl event queue, calls handlers for the first event, -and returns. -The normal return value is 1 to signify that some event -was processed (see below for other alternatives). -.PP -If the \fIflags\fR argument to \fBTcl_DoOneEvent\fR is non-zero, -it restricts the kinds of events that will be processed by -\fBTcl_DoOneEvent\fR. -\fIFlags\fR may be an OR-ed combination of any of the following bits: -.TP 27 -\fBTCL_WINDOW_EVENTS\fR \- -Process window system events. -.TP 27 -\fBTCL_FILE_EVENTS\fR \- -Process file events. -.TP 27 -\fBTCL_TIMER_EVENTS\fR \- -Process timer events. -.TP 27 -\fBTCL_IDLE_EVENTS\fR \- -Process idle callbacks. -.TP 27 -\fBTCL_ALL_EVENTS\fR \- -Process all kinds of events: equivalent to OR-ing together all of the -above flags or specifying none of them. -.TP 27 -\fBTCL_DONT_WAIT\fR \- -Don't sleep: process only events that are ready at the time of the -call. -.LP -If any of the flags \fBTCL_WINDOW_EVENTS\fR, \fBTCL_FILE_EVENTS\fR, -\fBTCL_TIMER_EVENTS\fR, or \fBTCL_IDLE_EVENTS\fR is set, then the only -events that will be considered are those for which flags are set. -Setting none of these flags is equivalent to the value -\fBTCL_ALL_EVENTS\fR, which causes all event types to be processed. -If an application has defined additional event sources with -\fBTcl_CreateEventSource\fR, then additional \fIflag\fR values -may also be valid, depending on those event sources. -.PP -The \fBTCL_DONT_WAIT\fR flag causes \fBTcl_DoOneEvent\fR not to put -the process to sleep: it will check for events but if none are found -then it returns immediately with a return value of 0 to indicate -that no work was done. -\fBTcl_DoOneEvent\fR will also return 0 without doing anything if -the only alternative is to block forever (this can happen, for example, -if \fIflags\fR is \fBTCL_IDLE_EVENTS\fR and there are no -\fBTcl_DoWhenIdle\fR callbacks pending, or if no event handlers or -timer handlers exist). -.PP -\fBTcl_DoOneEvent\fR may be invoked recursively. For example, -it is possible to invoke \fBTcl_DoOneEvent\fR recursively -from a handler called by \fBTcl_DoOneEvent\fR. This sort -of operation is useful in some modal situations, such -as when a -notification dialog has been popped up and an application wishes to -wait for the user to click a button in the dialog before -doing anything else. - -.SH KEYWORDS -callback, event, handler, idle, timer diff --git a/doc/DoWhenIdle.3 b/doc/DoWhenIdle.3 deleted file mode 100644 index 90a6aa7..0000000 --- a/doc/DoWhenIdle.3 +++ /dev/null @@ -1,86 +0,0 @@ -'\" -'\" Copyright (c) 1990 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: DoWhenIdle.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pending events -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_DoWhenIdle\fR(\fIproc, clientData\fR) -.sp -\fBTcl_CancelIdleCall\fR(\fIproc, clientData\fR) -.SH ARGUMENTS -.AS Tcl_IdleProc clientData -.AP Tcl_IdleProc *proc in -Procedure to invoke. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_DoWhenIdle\fR arranges for \fIproc\fR to be invoked -when the application becomes idle. The application is -considered to be idle when \fBTcl_DoOneEvent\fR has been -called, couldn't find any events to handle, and is about -to go to sleep waiting for an event to occur. At this -point all pending \fBTcl_DoWhenIdle\fR handlers are -invoked. For each call to \fBTcl_DoWhenIdle\fR there will -be a single call to \fIproc\fR; after \fIproc\fR is -invoked the handler is automatically removed. -\fBTcl_DoWhenIdle\fR is only usable in programs that -use \fBTcl_DoOneEvent\fR to dispatch events. -.PP -\fIProc\fR should have arguments and result that match the -type \fBTcl_IdleProc\fR: -.CS -typedef void Tcl_IdleProc(ClientData \fIclientData\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR -argument given to \fBTcl_DoWhenIdle\fR. Typically, \fIclientData\fR -points to a data structure containing application-specific information about -what \fIproc\fR should do. -.PP -\fBTcl_CancelIdleCall\fR -may be used to cancel one or more previous -calls to \fBTcl_DoWhenIdle\fR: if there is a \fBTcl_DoWhenIdle\fR -handler registered for \fIproc\fR and \fIclientData\fR, then it -is removed without invoking it. If there is more than one -handler on the idle list that refers to \fIproc\fR and \fIclientData\fR, -all of the handlers are removed. If no existing handlers match -\fIproc\fR and \fIclientData\fR then nothing happens. -.PP -\fBTcl_DoWhenIdle\fR is most useful in situations where -(a) a piece of work will have to be done but (b) it's -possible that something will happen in the near future -that will change what has to be done or require something -different to be done. \fBTcl_DoWhenIdle\fR allows the -actual work to be deferred until all pending events have -been processed. At this point the exact work to be done -will presumably be known and it can be done exactly once. -.PP -For example, \fBTcl_DoWhenIdle\fR might be used by an editor -to defer display updates until all pending commands have -been processed. Without this feature, redundant redisplays -might occur in some situations, such as the processing of -a command file. -.SH BUGS -.PP -At present it is not safe for an idle callback to reschedule itself -continuously. This will interact badly with certain features of Tk -that attempt to wait for all idle callbacks to complete. If you would -like for an idle callback to reschedule itself continuously, it is -better to use a timer handler with a zero timeout period. - -.SH KEYWORDS -callback, defer, idle callback diff --git a/doc/DoubleObj.3 b/doc/DoubleObj.3 deleted file mode 100644 index 164d4c9..0000000 --- a/doc/DoubleObj.3 +++ /dev/null @@ -1,79 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: DoubleObj.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_DoubleObj 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_NewDoubleObj, Tcl_SetDoubleObj, Tcl_GetDoubleFromObj \- manipulate Tcl objects as floating-point values -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Obj * -\fBTcl_NewDoubleObj\fR(\fIdoubleValue\fR) -.sp -\fBTcl_SetDoubleObj\fR(\fIobjPtr, doubleValue\fR) -.sp -int -\fBTcl_GetDoubleFromObj\fR(\fIinterp, objPtr, doublePtr\fR) -.SH ARGUMENTS -.AS Tcl_Interp doubleValue in/out -.AP double doubleValue in -A double-precision floating point value used to initialize or set a double object. -.AP Tcl_Obj *objPtr in/out -For \fBTcl_SetDoubleObj\fR, this points to the object to be converted -to double type. -For \fBTcl_GetDoubleFromObj\fR, this refers to the object -from which to get a double value; -if \fIobjPtr\fR does not already point to a double object, -an attempt will be made to convert it to one. -.AP Tcl_Interp *interp in/out -If an error occurs during conversion, -an error message is left in the interpreter's result object -unless \fIinterp\fR is NULL. -.AP double *doublePtr out -Points to place to store the double value -obtained from \fIobjPtr\fR. -.BE - -.SH DESCRIPTION -.PP -These procedures are used to create, modify, and read -double Tcl objects from C code. -\fBTcl_NewDoubleObj\fR and \fBTcl_SetDoubleObj\fR -will create a new object of double type -or modify an existing object to have double type. -Both of these procedures set the object to have the -double-precision floating point value given by \fIdoubleValue\fR; -\fBTcl_NewDoubleObj\fR returns a pointer to a newly created object -with reference count zero. -Both procedures set the object's type to be double -and assign the double value to the object's internal representation -\fIdoubleValue\fR member. -\fBTcl_SetDoubleObj\fR invalidates any old string representation -and, if the object is not already a double object, -frees any old internal representation. -.PP -\fBTcl_GetDoubleFromObj\fR attempts to return a double value -from the Tcl object \fIobjPtr\fR. -If the object is not already a double object, -it will attempt to convert it to one. -If an error occurs during conversion, it returns \fBTCL_ERROR\fR -and leaves an error message in the interpreter's result object -unless \fIinterp\fR is NULL. -Otherwise, it returns \fBTCL_OK\fR and stores the double value -in the address given by \fIdoublePtr\fR. -If the object is not already a double object, -the conversion will free any old internal representation. - -.SH "SEE ALSO" -Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult - -.SH KEYWORDS -double, double object, double type, internal representation, object, object type, string representation diff --git a/doc/Encoding.3 b/doc/Encoding.3 deleted file mode 100644 index e9329dd..0000000 --- a/doc/Encoding.3 +++ /dev/null @@ -1,484 +0,0 @@ -'\" -'\" Copyright (c) 1997-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. -'\" -'\" RCS: @(#) $Id: Encoding.3,v 1.2 1999/04/16 00:46:31 stanton Exp $ -'\" -.so man.macros -.TH Tcl_GetEncoding 3 "8.1" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetDefaultEncodingDir, Tcl_SetDefaultEncodingDir \- procedures for creating and using encodings. - - - - -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Encoding -\fBTcl_GetEncoding\fR(\fIinterp, name\fR) -.sp -void -\fBTcl_FreeEncoding\fR(\fIencoding\fR) -.sp -void -\fBTcl_ExternalToUtfDString\fR(\fIencoding, src, srcLen, dstPtr\fR) -.sp -int -\fBTcl_ExternalToUtf\fR(\fIinterp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, - dstCharsPtr\fR) -.sp -void -\fBTcl_UtfToExternalDString\fR(\fIencoding, src, srcLen, dstPtr\fR) -.sp -int -\fBTcl_UtfToExternal\fR(\fIinterp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, - dstCharsPtr\fR) -.sp -char * -\fBTcl_GetEncodingName\fR(\fIencoding\fR) -.sp -int -\fBTcl_SetSystemEncoding\fR(\fIinterp, name\fR) -.sp -void -\fBTcl_GetEncodingNames\fR(\fIinterp\fR) -.sp -Tcl_Encoding -\fBTcl_CreateEncoding\fR(\fItypePtr\fR) - -.sp -char * -\fBTcl_GetDefaultEncodingDir\fR(\fIvoid\fR) -.sp -void -\fBTcl_SetDefaultEncodingDir\fR(\fIpath\fR) - - -.SH ARGUMENTS -.AS Tcl_EncodingState *dstWrotePtr -.AP Tcl_Interp *interp in -Interpreter to use for error reporting, or NULL if no error reporting is -desired. -.AP "CONST char" *name in -Name of encoding to load. -.AP Tcl_Encoding encoding in -The encoding to query, free, or use for converting text. If \fIencoding\fR is -NULL, the current system encoding is used. -.AP "CONST char" *src in -For the \fBTcl_ExternalToUtf\fR functions, an array of bytes in the -specified encoding that are to be converted to UTF-8. For the -\fBTcl_UtfToExternal\fR functions, an array of UTF-8 characters to be -converted to the specified encoding. -.AP int srcLen in -Length of \fIsrc\fR in bytes. If the length is negative, the -encoding-specific length of the string is used. -.AP Tcl_DString *dstPtr out -Pointer to an uninitialized or free \fBTcl_DString\fR in which the converted -result will be stored. -.AP int flags in -Various flag bits OR-ed together. -TCL_ENCODING_START signifies that the -source buffer is the first block in a (potentially multi-block) input -stream, telling the conversion routine to reset to an initial state and -perform any initialization that needs to occur before the first byte is -converted. TCL_ENCODING_END signifies that the source buffer is the last -block in a (potentially multi-block) input stream, telling the conversion -routine to perform any finalization that needs to occur after the last -byte is converted and then to reset to an initial state. -TCL_ENCODING_STOPONERROR signifies that the conversion routine should -return immediately upon reading a source character that doesn't exist in -the target encoding; otherwise a default fallback character will -automatically be substituted. -.AP Tcl_EncodingState *statePtr in/out -Used when converting a (generally long or indefinite length) byte stream -in a piece by piece fashion. The conversion routine stores its current -state in \fI*statePtr\fR after \fIsrc\fR (the buffer containing the -current piece) has been converted; that state information must be passed -back when converting the next piece of the stream so the conversion -routine knows what state it was in when it left off at the end of the -last piece. May be NULL, in which case the value specified for \fIflags\fR -is ignored and the source buffer is assumed to contain the complete string to -convert. -.AP char *dst out -Buffer in which the converted result will be stored. No more than -\fIdstLen\fR bytes will be stored in \fIdst\fR. -.AP int dstLen in -The maximum length of the output buffer \fIdst\fR in bytes. -.AP int *srcReadPtr out -Filled with the number of bytes from \fIsrc\fR that were actually -converted. This may be less than the original source length if there was -a problem converting some source characters. May be NULL. -.AP int *dstWrotePtr out -Filled with the number of bytes that were actually stored in the output -buffer as a result of the conversion. May be NULL. -.AP int *dstCharsPtr out -Filled with the number of characters that correspond to the number of bytes -stored in the output buffer. May be NULL. -.AP Tcl_EncodingType *typePtr in -Structure that defines a new type of encoding. -.AP char *path in -A path to the location of the encoding file. -.BE -.SH INTRODUCTION -.PP -These routines convert between Tcl's internal character representation, -UTF-8, and character representations used by various operating systems or -file systems, such as Unicode, ASCII, or Shift-JIS. When operating on -strings, such as such as obtaining the names of files or displaying -characters using international fonts, the strings must be translated into -one or possibly multiple formats that the various system calls can use. For -instance, on a Japanese Unix workstation, a user might obtain a filename -represented in the EUC-JP file encoding and then translate the characters to -the jisx0208 font encoding in order to display the filename in a Tk widget. -The purpose of the encoding package is to help bridge the translation gap. -UTF-8 provides an intermediate staging ground for all the various -encodings. In the example above, text would be translated into UTF-8 from -whatever file encoding the operating system is using. Then it would be -translated from UTF-8 into whatever font encoding the display routines -require. -.PP -Some basic encodings are compiled into Tcl. Others can be defined by the -user or dynamically loaded from encoding files in a -platform-independent manner. -.SH DESCRIPTION -.PP -\fBTcl_GetEncoding\fR finds an encoding given its \fIname\fR. The name may -refer to a builtin Tcl encoding, a user-defined encoding registered by -calling \fBTcl_CreateEncoding\fR, or a dynamically-loadable encoding -file. The return value is a token that represents the encoding and can be -used in subsequent calls to procedures such as \fBTcl_GetEncodingName\fR, -\fBTcl_FreeEncoding\fR, and \fBTcl_UtfToExternal\fR. If the name did not -refer to any known or loadable encoding, NULL is returned and an error -message is returned in \fIinterp\fR. -.PP -The encoding package maintains a database of all encodings currently in use. -The first time \fIname\fR is seen, \fBTcl_GetEncoding\fR returns an -encoding with a reference count of 1. If the same \fIname\fR is requested -further times, then the reference count for that encoding is incremented -without the overhead of allocating a new encoding and all its associated -data structures. -.PP -When an \fIencoding\fR is no longer needed, \fBTcl_FreeEncoding\fR -should be called to release it. When an \fIencoding\fR is no longer in use -anywhere (i.e., it has been freed as many times as it has been gotten) -\fBTcl_FreeEncoding\fR will release all storage the encoding was using -and delete it from the database. -.PP -\fBTcl_ExternalToUtfDString\fR converts a source buffer \fIsrc\fR from the -specified \fIencoding\fR into UTF-8. The converted bytes are stored in -\fIdstPtr\fR, which is then NULL terminated. The caller should eventually -call \fBTcl_DStringFree\fR to free any information stored in \fIdstPtr\fR. -When converting, if any of the characters in the source buffer cannot be -represented in the target encoding, a default fallback character will be -used. -.PP -\fBTcl_ExternalToUtf\fR converts a source buffer \fIsrc\fR from the specified -\fIencoding\fR into UTF-8. Up to \fIsrcLen\fR bytes are converted from the -source buffer and up to \fIdstLen\fR converted bytes are stored in \fIdst\fR. -In all cases, \fI*srcReadPtr\fR is filled with the number of bytes that were -successfully converted from \fIsrc\fR and \fI*dstWrotePtr\fR is filled with -the corresponding number of bytes that were stored in \fIdst\fR. The return -value is one of the following: -.RS -.IP \fBTCL_OK\fR 29 -All bytes of \fIsrc\fR were converted. -.IP \fBTCL_CONVERT_NOSPACE\fR 29 -The destination buffer was not large enough for all of the converted data; as -many characters as could fit were converted though. -.IP \fBTCL_CONVERT_MULTIBYTE\fR 29 -The last fews bytes in the source buffer were the beginning of a multibyte -sequence, but more bytes were needed to complete this sequence. A -subsequent call to the conversion routine should pass a buffer containing -the unconverted bytes that remained in \fIsrc\fR plus some further bytes -from the source stream to properly convert the formerly split-up multibyte -sequence. -.IP \fBTCL_CONVERT_SYNTAX\fR 29 -The source buffer contained an invalid character sequence. This may occur -if the input stream has been damaged or if the input encoding method was -misidentified. -.IP \fBTCL_CONVERT_UNKNOWN\fR 29 -The source buffer contained a character that could not be represented in -the target encoding and TCL_ENCODING_STOPONERROR was specified. -.RE -.LP -\fBTcl_UtfToExternalDString\fR converts a source buffer \fIsrc\fR from UTF-8 -into the specified \fIencoding\fR. The converted bytes are stored in -\fIdstPtr\fR, which is then terminated with the appropriate encoding-specific -NULL. The caller should eventually call \fBTcl_DStringFree\fR to free any -information stored in \fIdstPtr\fR. When converting, if any of the -characters in the source buffer cannot be represented in the target -encoding, a default fallback character will be used. -.PP -\fBTcl_UtfToExternal\fR converts a source buffer \fIsrc\fR from UTF-8 into -the specified \fIencoding\fR. Up to \fIsrcLen\fR bytes are converted from -the source buffer and up to \fIdstLen\fR converted bytes are stored in -\fIdst\fR. In all cases, \fI*srcReadPtr\fR is filled with the number of -bytes that were successfully converted from \fIsrc\fR and \fI*dstWrotePtr\fR -is filled with the corresponding number of bytes that were stored in -\fIdst\fR. The return values are the same as the return values for -\fBTcl_ExternalToUtf\fR. -.PP -\fBTcl_GetEncodingName\fR is roughly the inverse of \fBTk_GetEncoding\fR. -Given an \fIencoding\fR, the return value is the \fIname\fR argument that -was used to create the encoding. The string returned by -\fBTcl_GetEncodingName\fR is only guaranteed to persist until the -\fIencoding\fR is deleted. The caller must not modify this string. -.PP -\fBTcl_SetSystemEncoding\fR sets the default encoding that should be used -whenever the user passes a NULL value for the \fIencoding\fR argument to -any of the other encoding functions. If \fIname\fR is NULL, the system -encoding is reset to the default system encoding, \fBbinary\fR. If the -name did not refer to any known or loadable encoding, TCL_ERROR is -returned and an error message is left in \fIinterp\fR. Otherwise, this -procedure increments the reference count of the new system encoding, -decrements the reference count of the old system encoding, and returns -TCL_OK. -.PP -\fBTcl_GetEncodingNames\fR sets the \fIinterp\fR result to a list -consisting of the names of all the encodings that are currently defined -or can be dynamically loaded, searching the encoding path specified by -\fBTcl_SetDefaultEncodingDir\fR. This procedure does not ensure that the -dynamically-loadable encoding files contain valid data, but merely that they -exist. -.PP -\fBTcl_CreateEncoding\fR defines a new encoding and registers the C -procedures that are called back to convert between the encoding and -UTF-8. Encodings created by \fBTcl_CreateEncoding\fR are thereafter -visible in the database used by \fBTcl_GetEncoding\fR. Just as with the -\fBTcl_GetEncoding\fR procedure, the return value is a token that -represents the encoding and can be used in subsequent calls to other -encoding functions. \fBTcl_CreateEncoding\fR returns an encoding with a -reference count of 1. If an encoding with the specified \fIname\fR -already exists, then its entry in the database is replaced with the new -encoding; the token for the old encoding will remain valid and continue -to behave as before, but users of the new token will now call the new -encoding procedures. -.PP -The \fItypePtr\fR argument to \fBTcl_CreateEncoding\fR contains information -about the name of the encoding and the procedures that will be called to -convert between this encoding and UTF-8. It is defined as follows: -.PP -.CS -typedef struct Tcl_EncodingType { - CONST char *\fIencodingName\fR; - Tcl_EncodingConvertProc *\fItoUtfProc\fR; - Tcl_EncodingConvertProc *\fIfromUtfProc\fR; - Tcl_EncodingFreeProc *\fIfreeProc\fR; - ClientData \fIclientData\fR; - int \fInullSize\fR; -} Tcl_EncodingType; -.CE -.PP -The \fIencodingName\fR provides a string name for the encoding, by -which it can be referred in other procedures such as -\fBTcl_GetEncoding\fR. The \fItoUtfProc\fR refers to a callback -procedure to invoke to convert text from this encoding into UTF-8. -The \fIfromUtfProc\fR refers to a callback procedure to invoke to -convert text from UTF-8 into this encoding. The \fIfreeProc\fR refers -to a callback procedure to invoke when this encoding is deleted. The -\fIfreeProc\fR field may be NULL. The \fIclientData\fR contains an -arbitrary one-word value passed to \fItoUtfProc\fR, \fIfromUtfProc\fR, -and \fIfreeProc\fR whenever they are called. Typically, this is a -pointer to a data structure containing encoding-specific information -that can be used by the callback procedures. For instance, two very -similar encodings such as \fBascii\fR and \fBmacRoman\fR may use the -same callback procedure, but use different values of \fIclientData\fR -to control its behavior. The \fInullSize\fR specifies the number of -zero bytes that signify end-of-string in this encoding. It must be -\fB1\fR (for single-byte or multi-byte encodings like ASCII or -Shift-JIS) or \fB2\fR (for double-byte encodings like Unicode). -Constant-sized encodings with 3 or more bytes per character (such as -CNS11643) are not accepted. -.PP -The callback procedures \fItoUtfProc\fR and \fIfromUtfProc\fR should match the -type \fBTcl_EncodingConvertProc\fR: -.PP -.CS -typedef int Tcl_EncodingConvertProc( - ClientData \fIclientData\fR, - CONST char *\fIsrc\fR, - int \fIsrcLen\fR, - int \fIflags\fR, - Tcl_Encoding *\fIstatePtr\fR, - char *\fIdst\fR, - int \fIdstLen\fR, - int *\fIsrcReadPtr\fR, - int *\fIdstWrotePtr\fR, - int *\fIdstCharsPtr\fR); -.CE -.PP -The \fItoUtfProc\fR and \fIfromUtfProc\fR procedures are called by the -\fBTcl_ExternalToUtf\fR or \fBTcl_UtfToExternal\fR family of functions to -perform the actual conversion. The \fIclientData\fR parameter to these -procedures is the same as the \fIclientData\fR field specified to -\fBTcl_CreateEncoding\fR when the encoding was created. The remaining -arguments to the callback procedures are the same as the arguments, -documented at the top, to \fBTcl_ExternalToUtf\fR or -\fBTcl_UtfToExternal\fR, with the following exceptions. If the -\fIsrcLen\fR argument to one of those high-level functions is negative, -the value passed to the callback procedure will be the appropriate -encoding-specific string length of \fIsrc\fR. If any of the \fIsrcReadPtr\fR, -\fIdstWrotePtr\fR, or \fIdstCharsPtr\fR arguments to one of the high-level -functions is NULL, the corresponding value passed to the callback -procedure will be a non-NULL location. -.PP -The callback procedure \fIfreeProc\fR, if non-NULL, should match the type -\fBTcl_EncodingFreeProc\fR: -.CS -typedef void Tcl_EncodingFreeProc( - ClientData \fIclientData\fR); -.CE -.PP -This \fIfreeProc\fR function is called when the encoding is deleted. The -\fIclientData\fR parameter is the same as the \fIclientData\fR field -specified to \fBTcl_CreateEncoding\fR when the encoding was created. -.PP - -\fBTcl_GetDefaultEncodingDir\fR and \fBTcl_SetDefaultEncodingDir\fR -access and set the directory to use when locating the default encoding -files. If this value is not NULL, the \fBTclpInitLibraryPath\fR routine -appends the path to the head of the search path, and uses this path as -the first place to look into when trying to locate the encoding file. - -.SH ENCODING FILES -Space would prohibit precompiling into Tcl every possible encoding -algorithm, so many encodings are stored on disk as dynamically-loadable -encoding files. This behavior also allows the user to create additional -encoding files that can be loaded using the same mechanism. These -encoding files contain information about the tables and/or escape -sequences used to map between an external encoding and Unicode. The -external encoding may consist of single-byte, multi-byte, or double-byte -characters. -.PP -Each dynamically-loadable encoding is represented as a text file. The -initial line of the file, beginning with a ``#'' symbol, is a comment -that provides a human-readable description of the file. The next line -identifies the type of encoding file. It can be one of the following -letters: -.IP "[1] \fBS\fR" -A single-byte encoding, where one character is always one byte long in the -encoding. An example is \fBiso8859-1\fR, used by many European languages. -.IP "[2] \fBD\fR" -A double-byte encoding, where one character is always two bytes long in the -encoding. An example is \fBbig5\fR, used for Chinese text. -.IP "[3] \fBM\fR" -A multi-byte encoding, where one character may be either one or two bytes long. -Certain bytes are a lead bytes, indicating that another byte must follow -and that together the two bytes represent one character. Other bytes are not -lead bytes and represent themselves. An example is \fBshiftjis\fR, used by -many Japanese computers. -.IP "[4] \fBE\fR" -An escape-sequence encoding, specifying that certain sequences of bytes -do not represent characters, but commands that describe how following bytes -should be interpreted. -.PP -The rest of the lines in the file depend on the type. -.PP -Cases [1], [2], and [3] are collectively referred to as table-based encoding -files. The lines in a table-based encoding file are in the same -format as this example taken from the \fBshiftjis\fR encoding (this is not -the complete file): -.CS -# Encoding file: shiftjis, multi-byte -M -003F 0 40 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D203E007F -0080000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F -FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F -FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F -FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -81 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8FF3E -FFE3FF3F30FD30FE309D309E30034EDD30053006300730FC20152010FF0F005C -301C2016FF5C2026202520182019201C201DFF08FF0930143015FF3BFF3DFF5B -FF5D30083009300A300B300C300D300E300F30103011FF0B221200B100D70000 -00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5 -FF0400A200A3FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C725C6 -25A125A025B325B225BD25BC203B301221922190219121933013000000000000 -000000000000000000000000000000002208220B2286228722822283222A2229 -000000000000000000000000000000002227222800AC21D221D4220022030000 -0000000000000000000000000000000000000000222022A52312220222072261 -2252226A226B221A223D221D2235222B222C0000000000000000000000000000 -212B2030266F266D266A2020202100B6000000000000000025EF000000000000 -.CE -.PP -The third line of the file is three numbers. The first number is the -fallback character (in base 16) to use when converting from UTF-8 to this -encoding. The second number is a \fB1\fR if this file represents the -encoding for a symbol font, or \fB0\fR otherwise. The last number (in base -10) is how many pages of data follow. -.PP -Subsequent lines in the example above are pages that describe how to map -from the encoding into 2-byte Unicode. The first line in a page identifies -the page number. Following it are 256 double-byte numbers, arranged as 16 -rows of 16 numbers. Given a character in the encoding, the high byte of -that character is used to select which page, and the low byte of that -character is used as an index to select one of the double-byte numbers in -that page \- the value obtained being the corresponding Unicode character. -By examination of the example above, one can see that the characters 0x7E -and 0x8163 in \fBshiftjis\fR map to 203E and 2026 in Unicode, respectively. -.PP -Following the first page will be all the other pages, each in the same -format as the first: one number identifying the page followed by 256 -double-byte Unicode characters. If a character in the encoding maps to the -Unicode character 0000, it means that the character doesn't actually exist. -If all characters on a page would map to 0000, that page can be omitted. -.PP -Case [4] is the escape-sequence encoding file. The lines in an this type of -file are in the same format as this example taken from the \fBiso2022-jp\fR -encoding: -.CS -.ta 1.5i -# Encoding file: iso2022-jp, escape-driven -E -init {} -final {} -iso8859-1 \\x1b(B -jis0201 \\x1b(J -jis0208 \\x1b$@ -jis0208 \\x1b$B -jis0212 \\x1b$(D -gb2312 \\x1b$A -ksc5601 \\x1b$(C -.CE -.PP -In the file, the first column represents an option and the second column -is the associated value. \fBinit\fR is a string to emit or expect before -the first character is converted, while \fBfinal\fR is a string to emit -or expect after the last character. All other options are names of -table-based encodings; the associated value is the escape-sequence that -marks that encoding. Tcl syntax is used for the values; in the above -example, for instance, ``\fB{}\fR'' represents the empty string and -``\fB\\x1b\fR'' represents character 27. -.PP -When \fBTcl_GetEncoding\fR encounters an encoding \fIname\fR that has not -been loaded, it attempts to load an encoding file called \fIname\fB.enc\fR -from the \fBencoding\fR subdirectory of each directory specified in the -library path \fB$tcl_libPath\fR. If the encoding file exists, but is -malformed, an error message will be left in \fIinterp\fR. -.SH KEYWORDS -utf, encoding, convert - - - diff --git a/doc/Eval.3 b/doc/Eval.3 deleted file mode 100644 index bc0effc..0000000 --- a/doc/Eval.3 +++ /dev/null @@ -1,196 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 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. -'\" -'\" RCS: @(#) $Id: Eval.3,v 1.4 1999/04/16 00:46:31 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Eval 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA \- execute Tcl scripts -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -.VS -int -\fBTcl_EvalObjEx\fR(\fIinterp, objPtr, flags\fR) -.sp -int -\fBTcl_EvalFile\fR(\fIinterp, fileName\fR) -.sp -int -\fBTcl_EvalObjv\fR(\fIinterp, objc, objv, flags\fR) -.sp -int -\fBTcl_Eval\fR(\fIinterp, script\fR) -.sp -int -\fBTcl_EvalEx\fR(\fIinterp, script, numBytes, flags\fR) -.sp -int -\fBTcl_GlobalEval\fR(\fIinterp, script\fR) -.sp -int -\fBTcl_GlobalEvalObj\fR(\fIinterp, objPtr, flags\fR) -.sp -int -\fBTcl_VarEval\fR(\fIinterp, string, string, ... \fB(char *) NULL\fR) -.sp -int -\fBTcl_VarEvalVA\fR(\fIinterp, argList\fR) -.SH ARGUMENTS -.AS Tcl_Interp **termPtr; -.AP Tcl_Interp *interp in -Interpreter in which to execute the script. The interpreter's result is -modified to hold the result or error message from the script. -.AP Tcl_Obj *objPtr in -A Tcl object containing the script to execute. -.AP int flags in -ORed combination of flag bits that specify additional options. -\fBTCL_EVAL_GLOBAL\fR and \fBTCL_EVAL_DIRECT\fR are currently supported. -.AP char *fileName in -Name of a file containing a Tcl script. -.AP int *objc in -The number of objects in the array pointed to by \fIobjPtr\fR; -this is also the number of words in the command. -.AP Tcl_Obj **objv in -Points to an array of pointers to objects; each object holds the -value of a single word in the command to execute. -.AP int numBytes in -The number of bytes in \fIscript\fR, not including any -null terminating character. If \-1, then all characters up to the -first null byte are used. -.AP char *script in -Points to first byte of script to execute. This script must be in -writable memory: temporary modifications are made to it during -parsing. -.AP char *string in -String forming part of a Tcl script. -.AP va_list argList in -An argument list which must have been initialised using -\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR. -.BE - -.SH DESCRIPTION -.PP -The procedures described here are invoked to execute Tcl scripts in -various forms. -\fBTcl_EvalObjEx\fR is the core procedure and is used by many of the others. -It executes the commands in the script stored in \fIobjPtr\fR -until either an error occurs or the end of the script is reached. -If this is the first time \fIobjPtr\fR has been executed, -its commands are compiled into bytecode instructions -which are then executed. The -bytecodes are saved in \fIobjPtr\fR so that the compilation step -can be skipped if the object is evaluated again in the future. -.PP -The return value from \fBTcl_EvalObjEx\fR (and all the other procedures -described here) is a Tcl completion code with -one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR, \fBTCL_RETURN\fR, -\fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR. -In addition, a result value or error message is left in \fIinterp\fR's -result; it can be retrieved using \fBTcl_GetObjResult\fR. -.PP -\fBTcl_EvalFile\fR reads the file given by \fIfileName\fR and evaluates -its contents as a Tcl script. It returns the same information as -\fBTcl_EvalObjEx\fR. -If the file couldn't be read then a Tcl error is returned to describe -why the file couldn't be read. -.PP -\fBTcl_EvalObjv\fR executes a single pre-parsed command instead of a -script. The \fIobjc\fR and \fIobjv\fR arguments contain the values -of the words for the Tcl command, one word in each object in -\fIobjv\fR. \fBTcl_EvalObjv\fR evaluates the command and returns -a completion code and result just like \fBTcl_EvalObjEx\fR. -.PP -\fBTcl_Eval\fR is similar to \fBTcl_EvalObjEx\fR except that -the script to be executed is supplied as a string instead of an -object and no compilation occurs. The string is parsed and executed -directly (using \fBTcl_EvalObjv\fR) instead of compiling it and -executing the bytecodes. In situations where it is known that the -script will never be executed again, \fBTcl_Eval\fR may be -faster than \fBTcl_EvalObjEx\fR. \fBTcl_Eval\fR returns a completion -code and result just like \fBTcl_EvalObjEx\fR. Note: for backward -compatibility with versions before Tcl 8.0, \fBTcl_Eval\fR -copies the object result in \fIinterp\fR to \fIinterp->result\fR -where it can be accessed directly. This makes \fBTcl_Eval\fR somewhat -slower than \fBTcl_EvalEx\fR, which doesn't do the copy. -.PP -\fBTcl_EvalEx\fR is an extended version of \fBTcl_Eval\fR that takes -additional arguments \fInumBytes\fR and \fIflags\fR. For the -efficiency reason given above, \fBTcl_EvalEx\fR is generally preferred -over \fBTcl_Eval\fR. -.PP -\fBTcl_GlobalEval\fR and \fBTcl_GlobalEvalObj\fR are older procedures -that are now deprecated. They are similar to \fBTcl_EvalEx\fR and -\fBTcl_EvalObjEx\fR except that the script is evaluated in the global -namespace and its variable context consists of global variables only -(it ignores any Tcl procedures that are active). These functions are -equivalent to using the \fBTCL_EVAL_GLOBAL\fR flag (see below). -.PP -\fBTcl_VarEval\fR takes any number of string arguments -of any length, concatenates them into a single string, -then calls \fBTcl_Eval\fR to execute that string as a Tcl command. -It returns the result of the command and also modifies -\fIinterp->result\fR in the same way as \fBTcl_Eval\fR. -The last argument to \fBTcl_VarEval\fR must be NULL to indicate the end -of arguments. \fBTcl_VarEval\fR is now deprecated. -.PP -\fBTcl_VarEvalVA\fR is the same as \fBTcl_VarEval\fR except that -instead of taking a variable number of arguments it takes an argument -list. Like \fBTcl_VarEval\fR, \fBTcl_VarEvalVA\fR is deprecated. - -.SH "FLAG BITS" -Any ORed combination of the following values may be used for the -\fIflags\fR argument to procedures such as \fBTcl_EvalObjEx\fR: -.TP 23 -\fBTCL_EVAL_DIRECT\fR -This flag is only used by \fBTcl_EvalObjEx\fR; it is ignored by -other procedures. If this flag bit is set, the script is not -compiled to bytecodes; instead it is executed directly -as is done by \fBTcl_EvalEx\fR. The -\fBTCL_EVAL_DIRECT\fR flag is useful in situations where the -contents of an object are going to change immediately, so the -bytecodes won't be reused in a future execution. In this case, -it's faster to execute the script directly. -.TP 23 -\fBTCL_EVAL_GLOBAL\fR -If this flag is set, the script is processed at global level. This -means that it is evaluated in the global namespace and its variable -context consists of global variables only (it ignores any Tcl -procedures at are active). - -.SH "MISCELLANEOUS DETAILS" -.PP -During the processing of a Tcl command it is legal to make nested -calls to evaluate other commands (this is how procedures and -some control structures are implemented). -If a code other than \fBTCL_OK\fR is returned -from a nested \fBTcl_EvalObjEx\fR invocation, -then the caller should normally return immediately, -passing that same return code back to its caller, -and so on until the top-level application is reached. -A few commands, like \fBfor\fR, will check for certain -return codes, like \fBTCL_BREAK\fR and \fBTCL_CONTINUE\fR, and process them -specially without returning. -.PP -\fBTcl_EvalObjEx\fR keeps track of how many nested \fBTcl_EvalObjEx\fR -invocations are in progress for \fIinterp\fR. -If a code of \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR is -about to be returned from the topmost \fBTcl_EvalObjEx\fR -invocation for \fIinterp\fR, -it converts the return code to \fBTCL_ERROR\fR -and sets \fIinterp\fR's result to an error message indicating that -the \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command was -invoked in an inappropriate place. -This means that top-level applications should never see a return code -from \fBTcl_EvalObjEx\fR other then \fBTCL_OK\fR or \fBTCL_ERROR\fR. -.VE - -.SH KEYWORDS -execute, file, global, object, result, script diff --git a/doc/Exit.3 b/doc/Exit.3 deleted file mode 100644 index c533efe..0000000 --- a/doc/Exit.3 +++ /dev/null @@ -1,131 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: Exit.3,v 1.3 1999/04/16 00:46:31 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Exit 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Exit, Tcl_Finalize, Tcl_FinalizeThread, Tcl_CreateExitHandler, Tcl_DeleteExitHandler, Tcl_CreateThreadExitHandler, Tcl_DeleteThreadExitHandler \- end the application or thread (and invoke exit handlers) -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_Exit\fR(\fIstatus\fR) -.sp -\fBTcl_Finalize\fR() -.sp -\fBTcl_CreateExitHandler\fR(\fIproc, clientData\fR) -.sp -\fBTcl_DeleteExitHandler\fR(\fIproc, clientData\fR) -.sp -\fBTcl_ExitThread\fR(\fIstatus\fR) -.sp -\fBTcl_FinalizeThread\fR() -.sp -\fBTcl_CreateThreadExitHandler\fR(\fIproc, clientData\fR) -.sp -\fBTcl_DeleteThreadExitHandler\fR(\fIproc, clientData\fR) -.SH ARGUMENTS -.AS Tcl_ExitProc clientData -.AP int status in -Provides information about why the application or thread exited. -Exact meaning may -be platform-specific. 0 usually means a normal exit, any nonzero value -usually means that an error occurred. -.AP Tcl_ExitProc *proc in -Procedure to invoke before exiting application. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -The procedures described here provide a graceful mechanism to end the -execution of a \fBTcl\fR application. Exit handlers are invoked to cleanup the -application's state before ending the execution of \fBTcl\fR code. -.PP -Invoke \fBTcl_Exit\fR to end a \fBTcl\fR application and to exit from this -process. This procedure is invoked by the \fBexit\fR command, and can be -invoked anyplace else to terminate the application. -No-one should ever invoke the \fBexit\fR system procedure directly; always -invoke \fBTcl_Exit\fR instead, so that it can invoke exit handlers. -Note that if other code invokes \fBexit\fR system procedure directly, or -otherwise causes the application to terminate without calling -\fBTcl_Exit\fR, the exit handlers will not be run. -\fBTcl_Exit\fR internally invokes the \fBexit\fR system call, thus it never -returns control to its caller. -.PP -\fBTcl_Finalize\fR is similar to \fBTcl_Exit\fR except that it does not -exit from the current process. -It is useful for cleaning up when a process is finished using \fBTcl\fR but -wishes to continue executing, and when \fBTcl\fR is used in a dynamically -loaded extension that is about to be unloaded. -On some systems \fBTcl\fR is automatically notified when it is being -unloaded, and it calls \fBTcl_Finalize\fR internally; on these systems it -not necessary for the caller to explicitly call \fBTcl_Finalize\fR. -However, to ensure portability, your code should always invoke -\fBTcl_Finalize\fR when \fBTcl\fR is being unloaded, to ensure that the -code will work on all platforms. \fBTcl_Finalize\fR can be safely called -more than once. -.PP -.VS -\fBTcl_ExitThread\fR is used to terminate the current thread and invoke -per-thread exit handlers. This finalization is done by -\fBTcl_FinalizeThread\fR, which you can call if you just want to clean -up per-thread state and invoke the thread exit handlers. -\fBTcl_Finalize\fR calls \fBTcl_FinalizeThread\fR for the current -thread automatically. -.VE -.PP -\fBTcl_CreateExitHandler\fR arranges for \fIproc\fR to be invoked -by \fBTcl_Finalize\fR and \fBTcl_Exit\fR. -\fBTcl_CreateThreadExitHandler\fR arranges for \fIproc\fR to be invoked -by \fBTcl_FinalizeThread\fR and \fBTcl_ExitThread\fR. -This provides a hook for cleanup operations such as flushing buffers -and freeing global memory. -\fIProc\fR should match the type \fBTcl_ExitProc\fR: -.CS -typedef void Tcl_ExitProc(ClientData \fIclientData\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a -copy of the \fIclientData\fR argument given to -\fBTcl_CreateExitHandler\fR or \fBTcl_CreateThreadExitHandler\fR when -the callback -was created. Typically, \fIclientData\fR points to a data -structure containing application-specific information about -what to do in \fIproc\fR. -.PP -\fBTcl_DeleteExitHandler\fR and \fBTcl_DeleteThreadExitHandler\fR may be -called to delete a -previously-created exit handler. It removes the handler -indicated by \fIproc\fR and \fIclientData\fR so that no call -to \fIproc\fR will be made. If no such handler exists then -\fBTcl_DeleteExitHandler\fR or \fBTcl_DeleteThreadExitHandler\fR does nothing. -.PP -.VS -.PP -\fBTcl_Finalize\fR and \fBTcl_Exit\fR execute all registered exit handlers, -in reverse order from the order in which they were registered. -This matches the natural order in which extensions are loaded and unloaded; -if extension \fBA\fR loads extension \fBB\fR, it usually -unloads \fBB\fR before it itself is unloaded. -If extension \fBA\fR registers its exit handlers before loading extension -\fBB\fR, this ensures that any exit handlers for \fBB\fR will be executed -before the exit handlers for \fBA\fR. -.VE -.VS -.PP -\fBTcl_Finalize\fR and \fBTcl_Exit\fR call \fBTcl_FinalizeThread\fR -and the thread exit handlers \fIafter\fR -the process-wide exit handlers. This is because thread finalization shuts -down the I/O channel system, so any attempt at I/O by the global exit -handlers will vanish into the bitbucket. -.VE - -.SH KEYWORDS -callback, cleanup, dynamic loading, end application, exit, unloading, thread diff --git a/doc/ExprLong.3 b/doc/ExprLong.3 deleted file mode 100644 index ba15782..0000000 --- a/doc/ExprLong.3 +++ /dev/null @@ -1,114 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 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. -'\" -'\" RCS: @(#) $Id: ExprLong.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_ExprLong 3 7.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean, Tcl_ExprString \- evaluate an expression -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_ExprLong\fR(\fIinterp, string, longPtr\fR) -.sp -int -\fBTcl_ExprDouble\fR(\fIinterp, string, doublePtr\fR) -.sp -int -\fBTcl_ExprBoolean\fR(\fIinterp, string, booleanPtr\fR) -.sp -int -\fBTcl_ExprString\fR(\fIinterp, string\fR) -.SH ARGUMENTS -.AS Tcl_Interp *booleanPtr -.AP Tcl_Interp *interp in -Interpreter in whose context to evaluate \fIstring\fR or \fIobjPtr\fR. -.AP char *string in -Expression to be evaluated. Must be in writable memory (the expression -parser makes temporary modifications to the string during parsing, which -it undoes before returning). -.AP long *longPtr out -Pointer to location in which to store the integer value of the -expression. -.AP int *doublePtr out -Pointer to location in which to store the floating-point value of the -expression. -.AP int *booleanPtr out -Pointer to location in which to store the 0/1 boolean value of the -expression. -.BE - -.SH DESCRIPTION -.PP -These four procedures all evaluate the expression -given by the \fIstring\fR argument -and return the result in one of four different forms. -The expression can have any of the forms accepted by the \fBexpr\fR command. -Note that these procedures have been largely replaced by the -object-based procedures \fBTcl_ExprLongObj\fR, \fBTcl_ExprDoubleObj\fR, -\fBTcl_ExprBooleanObj\fR, and \fBTcl_ExprStringObj\fR. -Those object-based procedures evaluate an expression held in a Tcl object -instead of a string. -The object argument can retain an internal representation -that is more efficient to execute. -.PP -The \fIinterp\fR argument refers to an interpreter used to -evaluate the expression (e.g. for variables and nested Tcl -commands) and to return error information. -\fIinterp->result\fR is assumed to be initialized -in the standard fashion when they are invoked. -.PP -For all of these procedures the return value is a standard -Tcl result: \fBTCL_OK\fR means the expression was successfully -evaluated, and \fBTCL_ERROR\fR means that an error occurred while -evaluating the expression. -If \fBTCL_ERROR\fR is returned then -\fIinterp->result\fR will hold a message describing the error. -If an error occurs while executing a Tcl command embedded in -the expression then that error will be returned. -.PP -If the expression is successfully evaluated, then its value is -returned in one of four forms, depending on which procedure -is invoked. -\fBTcl_ExprLong\fR stores an integer value at \fI*longPtr\fR. -If the expression's actual value is a floating-point number, -then it is truncated to an integer. -If the expression's actual value is a non-numeric string then -an error is returned. -.PP -\fBTcl_ExprDouble\fR stores a floating-point value at \fI*doublePtr\fR. -If the expression's actual value is an integer, it is converted to -floating-point. -If the expression's actual value is a non-numeric string then -an error is returned. -.PP -\fBTcl_ExprBoolean\fR stores a 0/1 integer value at \fI*booleanPtr\fR. -If the expression's actual value is an integer or floating-point -number, then they store 0 at \fI*booleanPtr\fR if -the value was zero and 1 otherwise. -If the expression's actual value is a non-numeric string then -it must be one of the values accepted by \fBTcl_GetBoolean\fR -such as ``yes'' or ``no'', or else an error occurs. -.PP -\fBTcl_ExprString\fR returns the value of the expression as a -string stored in \fIinterp->result\fR. -If the expression's actual value is an integer -then \fBTcl_ExprString\fR converts it to a string using \fBsprintf\fR -with a ``%d'' converter. -If the expression's actual value is a floating-point -number, then \fBTcl_ExprString\fR calls \fBTcl_PrintDouble\fR -to convert it to a string. - -.SH "SEE ALSO" -Tcl_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj, Tcl_ExprObj - -.SH KEYWORDS -boolean, double, evaluate, expression, integer, object, string diff --git a/doc/ExprLongObj.3 b/doc/ExprLongObj.3 deleted file mode 100644 index f1e500d..0000000 --- a/doc/ExprLongObj.3 +++ /dev/null @@ -1,104 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: ExprLongObj.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_ExprLongObj 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj, Tcl_ExprObj \- evaluate an expression -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_ExprLongObj\fR(\fIinterp, objPtr, longPtr\fR) -.sp -int -\fBTcl_ExprDoubleObj\fR(\fIinterp, objPtr, doublePtr\fR) -.sp -int -\fBTcl_ExprBooleanObj\fR(\fIinterp, objPtr, booleanPtr\fR) -.sp -int -\fBTcl_ExprObj\fR(\fIinterp, objPtr, resultPtrPtr\fR) -.SH ARGUMENTS -.AS Tcl_Interp *resultPtrPtr out -.AP Tcl_Interp *interp in -Interpreter in whose context to evaluate \fIstring\fR or \fIobjPtr\fR. -.AP Tcl_Obj *objPtr in -Pointer to an object containing the expression to evaluate. -.AP long *longPtr out -Pointer to location in which to store the integer value of the -expression. -.AP int *doublePtr out -Pointer to location in which to store the floating-point value of the -expression. -.AP int *booleanPtr out -Pointer to location in which to store the 0/1 boolean value of the -expression. -.AP Tcl_Obj *resultPtrPtr out -Pointer to location in which to store a pointer to the object -that is the result of the expression. -.BE - -.SH DESCRIPTION -.PP -These four procedures all evaluate an expression, returning -the result in one of four different forms. -The expression is given by the \fIobjPtr\fR argument, and it -can have any of the forms accepted by the \fBexpr\fR command. -.PP -The \fIinterp\fR argument refers to an interpreter used to -evaluate the expression (e.g. for variables and nested Tcl -commands) and to return error information. -.PP -For all of these procedures the return value is a standard -Tcl result: \fBTCL_OK\fR means the expression was successfully -evaluated, and \fBTCL_ERROR\fR means that an error occurred while -evaluating the expression. -If \fBTCL_ERROR\fR is returned, -then a message describing the error -can be retrieved using \fBTcl_GetObjResult\fR. -If an error occurs while executing a Tcl command embedded in -the expression then that error will be returned. -.PP -If the expression is successfully evaluated, then its value is -returned in one of four forms, depending on which procedure -is invoked. -\fBTcl_ExprLongObj\fR stores an integer value at \fI*longPtr\fR. -If the expression's actual value is a floating-point number, -then it is truncated to an integer. -If the expression's actual value is a non-numeric string then -an error is returned. -.PP -\fBTcl_ExprDoubleObj\fR stores a floating-point value at \fI*doublePtr\fR. -If the expression's actual value is an integer, it is converted to -floating-point. -If the expression's actual value is a non-numeric string then -an error is returned. -.PP -\fBTcl_ExprBooleanObj\fR stores a 0/1 integer value at \fI*booleanPtr\fR. -If the expression's actual value is an integer or floating-point -number, then they store 0 at \fI*booleanPtr\fR if -the value was zero and 1 otherwise. -If the expression's actual value is a non-numeric string then -it must be one of the values accepted by \fBTcl_GetBoolean\fR -such as ``yes'' or ``no'', or else an error occurs. -.PP -If \fBTcl_ExprObj\fR successfully evaluates the expression, -it stores a pointer to the Tcl object -containing the expression's value at \fI*resultPtrPtr\fR. -In this case, the caller is responsible for calling -\fBTcl_DecrRefCount\fR to decrement the object's reference count -when it is finished with the object. - -.SH "SEE ALSO" -Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean, Tcl_ExprString, Tcl_GetObjResult - -.SH KEYWORDS -boolean, double, evaluate, expression, integer, object, string diff --git a/doc/FindExec.3 b/doc/FindExec.3 deleted file mode 100644 index 098c7a2..0000000 --- a/doc/FindExec.3 +++ /dev/null @@ -1,56 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: FindExec.3,v 1.3 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_FindExecutable 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of the binary file containing the application -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -char * -\fBTcl_FindExecutable\fR(\fIargv0\fR) -.sp -CONST char * -\fBTcl_GetNameOfExecutable\fR() -.SH ARGUMENTS -.AS char *argv0 in -.AP char *argv0 in -The first command-line argument to the program, which gives the -application's name. -.BE - -.SH DESCRIPTION -.PP -The \fBTcl_FindExecutable\fR procedure computes the full path name of -the executable file from which the application was invoked and saves -it for Tcl's internal use. -The executable's path name is needed for several purposes in -Tcl. For example, it is needed on some platforms in the -implementation of the \fBload\fR command. -It is also returned by the \fBinfo nameofexecutable\fR command. -.PP -On UNIX platforms this procedure is typically invoked as the very -first thing in the application's main program; it must be passed -\fIargv[0]\fR as its argument. \fBTcl_FindExecutable\fR uses \fIargv0\fR -along with the \fBPATH\fR environment variable to find the -application's executable, if possible. If it fails to find -the binary, then future calls to \fBinfo nameofexecutable\fR -will return an empty string. -.PP -\fBTcl_GetNameOfExecutable\fR simply returns a pointer to the -internal full path name of the executable file as computed by -\fBTcl_FindExecutable\fR. This procedure call is the C API -equivalent to the \fBinfo nameofexecutable\fR command. NULL -is returned if the internal full path name has not been -computed or unknown. - -.SH KEYWORDS -binary, executable file diff --git a/doc/GetCwd.3 b/doc/GetCwd.3 deleted file mode 100755 index 4c8d65d..0000000 --- a/doc/GetCwd.3 +++ /dev/null @@ -1,54 +0,0 @@ -'\" -'\" Copyright (c) 1998-1999 Scriptics Corportation -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: GetCwd.3,v 1.2 1999/04/16 00:46:31 stanton Exp $ -'\" -.so man.macros -.TH Tcl_GetCwd 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_GetCwd, Tcl_Chdir \- manipulate the current working directory -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -char * -\fBTcl_GetCwd\fR(\fIinterp\fR, \fIbufferPtr\fR) -.sp -int -\fBTcl_Chdir\fR(\fIpath\fR) -.SH ARGUMENTS -.AS Tcl_DString *bufferPtr -.AP Tcl_Interp *interp in -Interpreter in which to report an error, if any. -.AP Tcl_DString *bufferPtr in/out -This dynamic string is used to store the current working directory. -At the time of the call it should be uninitialized or free. The -caller must eventually call \fBTcl_DStringFree\fR to free up -anything stored here. -.AP char *path in -File path in UTF\-8 format. -.BE - -.SH DESCRIPTION -.PP -These procedures may be used to manipulate the current working -directory for the application. They provide C\-level access to -the same functionality as the Tcl \fBpwd\fR command. -.PP -\fBTcl_GetCwd\fR returns 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 \fBTcl_DStringFree()\fR when the result is no longer needed. -The format of the path is UTF\-8. -.PP -\fBTcl_Chdir\fR changes the applications current working directory to -the value specified in \fIpath\fR. The format of the passed in string -must be UTF\-8. The function returns -1 on error or 0 on success. - -.SH KEYWORDS -pwd diff --git a/doc/GetIndex.3 b/doc/GetIndex.3 deleted file mode 100644 index 342069a..0000000 --- a/doc/GetIndex.3 +++ /dev/null @@ -1,100 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: GetIndex.3,v 1.3 1999/04/16 00:46:31 stanton Exp $ -'\" -.so man.macros -.TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_GetIndexFromObj \- lookup string in table of keywords -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_GetIndexFromObj\fR(\fIinterp, objPtr, tablePtr, msg, flags, -indexPtr\fR) -.VS -.sp -int -\fBTcl_GetIndexFromObjStruct\fR(\fIinterp, objPtr, tablePtr, offset, -msg, flags, indexPtr\fR) -.VE -.SH ARGUMENTS -.AS Tcl_Interp **tablePtr -.AP Tcl_Interp *interp in -Interpreter to use for error reporting; if NULL, then no message is -provided on errors. -.AP Tcl_Obj *objPtr in/out -The string value of this object is used to search through \fItablePtr\fR. -The internal representation is modified to hold the index of the matching -table entry. -.AP char **tablePtr in -An array of null-terminated strings. The end of the array is marked -by a NULL string pointer. -.VS -.AP int offset in -The offset to add to tablePtr to get to the next string in the -list. The end of the array is marked by a NULL string pointer. -.VE -.AP char *msg in -Null-terminated string describing what is being looked up, such as -\fBoption\fR. This string is included in error messages. -.AP int flags in -OR-ed combination of bits providing additional information for -operation. The only bit that is currently defined is \fBTCL_EXACT\fR. -.AP int *indexPtr out -The index of the string in \fItablePtr\fR that matches the value of -\fIobjPtr\fR is returned here. -.BE - -.SH DESCRIPTION -.PP -This procedure provides an efficient way for looking up keywords, -switch names, option names, and similar things where the value of -an object must be one of a predefined set of values. -\fIObjPtr\fR is compared against each of -the strings in \fItablePtr\fR to find a match. A match occurs if -\fIobjPtr\fR's string value is identical to one of the strings in -\fItablePtr\fR, or if it is a unique abbreviation -for exactly one of the strings in \fItablePtr\fR and the -\fBTCL_EXACT\fR flag was not specified; in either case -the index of the matching entry is stored at \fI*indexPtr\fR -and TCL_OK is returned. -.PP -If there is no matching entry, -TCL_ERROR is returned and an error message is left in \fIinterp\fR's -result if \fIinterp\fR isn't NULL. \fIMsg\fR is included in the -error message to indicate what was being looked up. For example, -if \fImsg\fR is \fBoption\fR the error message will have a form like -\fBbad option "firt": must be first, second, or third\fR. -.PP -If \fBTcl_GetIndexFromObj\fR completes successfully it modifies the -internal representation of \fIobjPtr\fR to hold the address of -the table and the index of the matching entry. If \fBTcl_GetIndexFromObj\fR -is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR -arguments (e.g. during a reinvocation of a Tcl command), it returns -the matching index immediately without having to redo the lookup -operation. Note: \fBTcl_GetIndexFromObj\fR assumes that the entries -in \fItablePtr\fR are static: they must not change between -invocations. -.VS -.PP -\fBTcl_GetIndexFromObjStruct\fR works just like -\fBTcl_GetIndexFromObj\fR, except that instead of treating -\fItablePtr\fR as an array of string pointers, it treats it as the -first in a series of string ptrs that are spaced apart by \fIoffset\fR -bytes. This is particularly useful when processing things like -\fBTk_ConfigurationSpec\fR, whose string keys are in the same place in -each of several array elements. -.VE - -.SH "SEE ALSO" -Tcl_WrongNumArgs - -.SH KEYWORDS -index, object, table lookup diff --git a/doc/GetInt.3 b/doc/GetInt.3 deleted file mode 100644 index 473a12f..0000000 --- a/doc/GetInt.3 +++ /dev/null @@ -1,81 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: GetInt.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_GetInt 3 "" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_GetInt, Tcl_GetDouble, Tcl_GetBoolean \- convert from string to integer, double, or boolean -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_GetInt\fR(\fIinterp, string, intPtr\fR) -.sp -int -\fBTcl_GetDouble\fR(\fIinterp, string, doublePtr\fR) -.sp -int -\fBTcl_GetBoolean\fR(\fIinterp, string, boolPtr\fR) -.SH ARGUMENTS -.AS Tcl_Interp *doublePtr -.AP Tcl_Interp *interp in -Interpreter to use for error reporting. -.AP char *string in -Textual value to be converted. -.AP int *intPtr out -Points to place to store integer value converted from \fIstring\fR. -.AP double *doublePtr out -Points to place to store double-precision floating-point -value converted from \fIstring\fR. -.AP int *boolPtr out -Points to place to store boolean value (0 or 1) converted from \fIstring\fR. -.BE - -.SH DESCRIPTION -.PP -These procedures convert from strings to integers or double-precision -floating-point values or booleans (represented as 0- or 1-valued -integers). Each of the procedures takes a \fIstring\fR argument, -converts it to an internal form of a particular type, and stores -the converted value at the location indicated by the procedure's -third argument. If all goes well, each of the procedures returns -TCL_OK. If \fIstring\fR doesn't have the proper syntax for the -desired type then TCL_ERROR is returned, an error message is left -in \fIinterp->result\fR, and nothing is stored at *\fIintPtr\fR -or *\fIdoublePtr\fR or *\fIboolPtr\fR. -.PP -\fBTcl_GetInt\fR expects \fIstring\fR to consist of a collection -of integer digits, optionally signed and optionally preceded by -white space. If the first two characters of \fIstring\fR are ``0x'' -then \fIstring\fR is expected to be in hexadecimal form; otherwise, -if the first character of \fIstring\fR is ``0'' then \fIstring\fR -is expected to be in octal form; otherwise, \fIstring\fR is -expected to be in decimal form. -.PP -\fBTcl_GetDouble\fR expects \fIstring\fR to consist of a floating-point -number, which is: white space; a sign; a sequence of digits; a -decimal point; a sequence of digits; the letter ``e''; and a -signed decimal exponent. Any of the fields may be omitted, except that -the digits either before or after the decimal point must be present -and if the ``e'' is present then it must be followed by the -exponent number. -.PP -\fBTcl_GetBoolean\fR expects \fIstring\fR to specify a boolean -value. If \fIstring\fR is any of \fB0\fR, \fBfalse\fR, -\fBno\fR, or \fBoff\fR, then \fBTcl_GetBoolean\fR stores a zero -value at \fI*boolPtr\fR. -If \fIstring\fR is any of \fB1\fR, \fBtrue\fR, \fByes\fR, or \fBon\fR, -then 1 is stored at \fI*boolPtr\fR. -Any of these values may be abbreviated, and upper-case spellings -are also acceptable. - -.SH KEYWORDS -boolean, conversion, double, floating-point, integer diff --git a/doc/GetOpnFl.3 b/doc/GetOpnFl.3 deleted file mode 100644 index 38c7a07..0000000 --- a/doc/GetOpnFl.3 +++ /dev/null @@ -1,61 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: GetOpnFl.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -.so man.macros -.TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_GetOpenFile \- Get a standard IO File * handle from a channel. (Unix only) -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_GetOpenFile\fR(\fIinterp, string, write, checkUsage, filePtr\fR) -.sp -.SH ARGUMENTS -.AS Tcl_Interp checkUsage -.AP Tcl_Interp *interp in -Tcl interpreter from which file handle is to be obtained. -.AP char *string in -String identifying channel, such as \fBstdin\fR or \fBfile4\fR. -.AP int write in -Non-zero means the file will be used for writing, zero means it will -be used for reading. -.AP int checkUsage in -If non-zero, then an error will be generated if the file wasn't opened -for the access indicated by \fIwrite\fR. -.AP ClientData *filePtr out -Points to word in which to store pointer to FILE structure for -the file given by \fIstring\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_GetOpenFile\fR takes as argument a file identifier of the form -returned by the \fBopen\fR command and -returns at \fI*filePtr\fR a pointer to the FILE structure for -the file. -The \fIwrite\fR argument indicates whether the FILE pointer will -be used for reading or writing. -In some cases, such as a channel that connects to a pipeline of -subprocesses, different FILE pointers will be returned for reading -and writing. -\fBTcl_GetOpenFile\fR normally returns TCL_OK. -If an error occurs in \fBTcl_GetOpenFile\fR (e.g. \fIstring\fR didn't -make any sense or \fIcheckUsage\fR was set and the file wasn't opened -for the access specified by \fIwrite\fR) then TCL_ERROR is returned -and \fIinterp->result\fR will contain an error message. -In the current implementation \fIcheckUsage\fR is ignored and consistency -checks are always performed. -.VS -.PP -Note that this interface is only supported on the Unix platform. -.VE - -.SH KEYWORDS -channel, file handle, permissions, pipeline, read, write diff --git a/doc/GetStdChan.3 b/doc/GetStdChan.3 deleted file mode 100644 index 565eaa7..0000000 --- a/doc/GetStdChan.3 +++ /dev/null @@ -1,73 +0,0 @@ -'\" -'\" Copyright (c) 1996 by Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: GetStdChan.3,v 1.2 1998/09/14 18:39:48 stanton Exp $ -'\" -.so man.macros -.TH Tcl_GetStdChannel 3 7.5 Tcl "Tcl Library Procedures" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -Tcl_GetStdChannel, Tcl_SetStdChannel \- procedures for retrieving and replacing the standard channels -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Channel -\fBTcl_GetStdChannel\fR(\fItype\fR) -.sp -\fBTcl_SetStdChannel\fR(\fIchannel, type\fR) -.sp -.SH ARGUMENTS -.AS Tcl_Channel channel in -.AP int type in -The identifier for the standard channel to retrieve or modify. Must be one of -\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR, or \fBTCL_STDERR\fR. -.AP Tcl_Channel channel in -The channel to use as the new value for the specified standard channel. -.BE - -.SH DESCRIPTION -.PP -Tcl defines three special channels that are used by various I/O related -commands if no other channels are specified. The standard input channel -has a channel name of \fBstdin\fR and is used by \fBread\fR and \fBgets\fR. -The standard output channel is named \fBstdout\fR and is used by -\fBputs\fR. The standard error channel is named \fBstderr\fR and is used for -reporting errors. In addition, the standard channels are inherited by any -child processes created using \fBexec\fR or \fBopen\fR in the absence of any -other redirections. -.PP -The standard channels are actually aliases for other normal channels. The -current channel associated with a standard channel can be retrieved by calling -\fBTcl_GetStdChannel\fR with one of -\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR, or \fBTCL_STDERR\fR as the \fItype\fR. The -return value will be a valid channel, or NULL. -.PP -A new channel can be set for the standard channel specified by \fItype\fR -by calling \fBTcl_SetStdChannel\fR with a new channel or NULL in the -\fIchannel\fR argument. If the specified channel is closed by a later call to -\fBTcl_Close\fR, then the corresponding standard channel will automatically be -set to NULL. -.PP -If \fBTcl_GetStdChannel\fR is called before \fBTcl_SetStdChannel\fR, Tcl will -construct a new channel to wrap the appropriate platform-specific standard -file handle. If \fBTcl_SetStdChannel\fR is called before -\fBTcl_GetStdChannel\fR, then the default channel will not be created. -.PP -If one of the standard channels is set to NULL, either by calling -\fBTcl_SetStdChannel\fR with a null \fIchannel\fR argument, or by calling -\fBTcl_Close\fR on the channel, then the next call to \fBTcl_CreateChannel\fR -will automatically set the standard channel with the newly created channel. If -more than one standard channel is NULL, then the standard channels will be -assigned starting with standard input, followed by standard output, with -standard error being last. - -.SH "SEE ALSO" -Tcl_Close(3), Tcl_CreateChannel(3) - -.SH KEYWORDS -standard channel, standard input, standard output, standard error diff --git a/doc/GetVersion.3 b/doc/GetVersion.3 deleted file mode 100755 index 0b88dc5..0000000 --- a/doc/GetVersion.3 +++ /dev/null @@ -1,49 +0,0 @@ -'\" -'\" Copyright (c) 1999 Scriptics Corporation -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: GetVersion.3,v 1.2 1999/04/16 00:46:32 stanton Exp $ -'\" -.so man.macros -.TH Tcl_GetVersion 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_GetVersion \- get the version of the library at runtime -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_GetVersion\fR(\fImajor, minor, patchLevel, type\fR) -.SH ARGUMENTS -.AP int *major out -Major version number of the Tcl library. -.AP int *minor out -Minor version number of the Tcl library. -.AP int *patchLevel out -The patch level of the Tcl library (or alpha or beta number). -.AP Tcl_ReleaseType *type out -The type of release, also indicates the type of patch level. Can be -one of \fBTCL_ALPHA_RELEASE\fR, \fBTCL_BETA_RELEASE\fR, or -\fBTCL_FINAL_RELEASE\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_GetVersion\fR should be used to query the version number -of the Tcl library at runtime. This is useful when using a -dynamically loaded Tcl library or when writing a stubs-aware -extension. For instance, if you write an extension that is -linked against the Tcl stubs library, it could be loaded into -a program linked to an older version of Tcl than you expected. -Use \fBTcl_GetVersion\fR to verify that fact, and possibly to -change the behavior of your extension. -.PP -If may pass a NULL for any of the arguments. For instance if -you do not care about the \fIpatchLevel\fR of the library, pass -a NULL for the \fIpatchLevel\fR argument. - -.SH KEYWORDS -version, patchlevel, major, minor, alpha, beta, release - diff --git a/doc/Hash.3 b/doc/Hash.3 deleted file mode 100644 index 0c5bb35..0000000 --- a/doc/Hash.3 +++ /dev/null @@ -1,208 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Hash.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Hash 3 "" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_InitHashTable, Tcl_DeleteHashTable, Tcl_CreateHashEntry, Tcl_DeleteHashEntry, Tcl_FindHashEntry, Tcl_GetHashValue, Tcl_SetHashValue, Tcl_GetHashKey, Tcl_FirstHashEntry, Tcl_NextHashEntry, Tcl_HashStats \- procedures to manage hash tables -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_InitHashTable\fR(\fItablePtr, keyType\fR) -.sp -\fBTcl_DeleteHashTable\fR(\fItablePtr\fR) -.sp -Tcl_HashEntry * -\fBTcl_CreateHashEntry\fR(\fItablePtr, key, newPtr\fR) -.sp -\fBTcl_DeleteHashEntry\fR(\fIentryPtr\fR) -.sp -Tcl_HashEntry * -\fBTcl_FindHashEntry\fR(\fItablePtr, key\fR) -.sp -ClientData -\fBTcl_GetHashValue\fR(\fIentryPtr\fR) -.sp -\fBTcl_SetHashValue\fR(\fIentryPtr, value\fR) -.sp -char * -\fBTcl_GetHashKey\fR(\fItablePtr, entryPtr\fR) -.sp -Tcl_HashEntry * -\fBTcl_FirstHashEntry\fR(\fItablePtr, searchPtr\fR) -.sp -Tcl_HashEntry * -\fBTcl_NextHashEntry\fR(\fIsearchPtr\fR) -.sp -char * -\fBTcl_HashStats\fR(\fItablePtr\fR) -.SH ARGUMENTS -.AS Tcl_HashSearch *searchPtr -.AP Tcl_HashTable *tablePtr in -Address of hash table structure (for all procedures but -\fBTcl_InitHashTable\fR, this must have been initialized by -previous call to \fBTcl_InitHashTable\fR). -.AP int keyType in -Kind of keys to use for new hash table. Must be either -TCL_STRING_KEYS, TCL_ONE_WORD_KEYS, or an integer value -greater than 1. -.AP char *key in -Key to use for probe into table. Exact form depends on -\fIkeyType\fR used to create table. -.AP int *newPtr out -The word at \fI*newPtr\fR is set to 1 if a new entry was created -and 0 if there was already an entry for \fIkey\fR. -.AP Tcl_HashEntry *entryPtr in -Pointer to hash table entry. -.AP ClientData value in -New value to assign to hash table entry. Need not have type -ClientData, but must fit in same space as ClientData. -.AP Tcl_HashSearch *searchPtr in -Pointer to record to use to keep track of progress in enumerating -all the entries in a hash table. -.BE - -.SH DESCRIPTION -.PP -A hash table consists of zero or more entries, each consisting of -a key and a value. -Given the key for an entry, the hashing routines can very quickly -locate the entry, and hence its value. -There may be at most one entry in a hash table with a -particular key, but many entries may have the same value. -Keys can take one of three forms: strings, -one-word values, or integer arrays. -All of the keys in a given table have the same form, which is -specified when the table is initialized. -.PP -The value of a hash table entry can be anything that fits in -the same space as a ``char *'' pointer. -Values for hash table entries are managed entirely by clients, -not by the hash module itself. -Typically each entry's value is a pointer to a data structure -managed by client code. -.PP -Hash tables grow gracefully as the number of entries increases, -so that there are always less than three entries per hash bucket, -on average. -This allows for fast lookups regardless of the number of entries -in a table. -.PP -\fBTcl_InitHashTable\fR initializes a structure that describes -a new hash table. -The space for the structure is provided by the caller, not by -the hash module. -The value of \fIkeyType\fR indicates what kinds of keys will -be used for all entries in the table. \fIKeyType\fR must have -one of the following values: -.IP \fBTCL_STRING_KEYS\fR 25 -Keys are null-terminated ASCII strings. -They are passed to hashing routines using the address of the -first character of the string. -.IP \fBTCL_ONE_WORD_KEYS\fR 25 -Keys are single-word values; they are passed to hashing routines -and stored in hash table entries as ``char *'' values. -The pointer value is the key; it need not (and usually doesn't) -actually point to a string. -.IP \fIother\fR 25 -If \fIkeyType\fR is not TCL_STRING_KEYS or TCL_ONE_WORD_KEYS, -then it must be an integer value greater than 1. -In this case the keys will be arrays of ``int'' values, where -\fIkeyType\fR gives the number of ints in each key. -This allows structures to be used as keys. -All keys must have the same size. -Array keys are passed into hashing functions using the address -of the first int in the array. -.PP -\fBTcl_DeleteHashTable\fR deletes all of the entries in a hash -table and frees up the memory associated with the table's -bucket array and entries. -It does not free the actual table structure (pointed to -by \fItablePtr\fR), since that memory is assumed to be managed -by the client. -\fBTcl_DeleteHashTable\fR also does not free or otherwise -manipulate the values of the hash table entries. -If the entry values point to dynamically-allocated memory, then -it is the client's responsibility to free these structures -before deleting the table. -.PP -\fBTcl_CreateHashEntry\fR locates the entry corresponding to a -particular key, creating a new entry in the table if there -wasn't already one with the given key. -If an entry already existed with the given key then \fI*newPtr\fR -is set to zero. -If a new entry was created, then \fI*newPtr\fR is set to a non-zero -value and the value of the new entry will be set to zero. -The return value from \fBTcl_CreateHashEntry\fR is a pointer to -the entry, which may be used to retrieve and modify the entry's -value or to delete the entry from the table. -.PP -\fBTcl_DeleteHashEntry\fR will remove an existing entry from a -table. -The memory associated with the entry itself will be freed, but -the client is responsible for any cleanup associated with the -entry's value, such as freeing a structure that it points to. -.PP -\fBTcl_FindHashEntry\fR is similar to \fBTcl_CreateHashEntry\fR -except that it doesn't create a new entry if the key doesn't exist; -instead, it returns NULL as result. -.PP -\fBTcl_GetHashValue\fR and \fBTcl_SetHashValue\fR are used to -read and write an entry's value, respectively. -Values are stored and retrieved as type ``ClientData'', which is -large enough to hold a pointer value. On almost all machines this is -large enough to hold an integer value too. -.PP -\fBTcl_GetHashKey\fR returns the key for a given hash table entry, -either as a pointer to a string, a one-word (``char *'') key, or -as a pointer to the first word of an array of integers, depending -on the \fIkeyType\fR used to create a hash table. -In all cases \fBTcl_GetHashKey\fR returns a result with type -``char *''. -When the key is a string or array, the result of \fBTcl_GetHashKey\fR -points to information in the table entry; this information will -remain valid until the entry is deleted or its table is deleted. -.PP -\fBTcl_FirstHashEntry\fR and \fBTcl_NextHashEntry\fR may be used -to scan all of the entries in a hash table. -A structure of type ``Tcl_HashSearch'', provided by the client, -is used to keep track of progress through the table. -\fBTcl_FirstHashEntry\fR initializes the search record and -returns the first entry in the table (or NULL if the table is -empty). -Each subsequent call to \fBTcl_NextHashEntry\fR returns the -next entry in the table or -NULL if the end of the table has been reached. -A call to \fBTcl_FirstHashEntry\fR followed by calls to -\fBTcl_NextHashEntry\fR will return each of the entries in -the table exactly once, in an arbitrary order. -It is unadvisable to modify the structure of the table, e.g. -by creating or deleting entries, while the search is in -progress. -.PP -\fBTcl_HashStats\fR returns a dynamically-allocated string with -overall information about a hash table, such as the number of -entries it contains, the number of buckets in its hash array, -and the utilization of the buckets. -It is the caller's responsibility to free the result string -by passing it to \fBfree\fR. -.PP -The header file \fBtcl.h\fR defines the actual data structures -used to implement hash tables. -This is necessary so that clients can allocate Tcl_HashTable -structures and so that macros can be used to read and write -the values of entries. -However, users of the hashing routines should never refer directly -to any of the fields of any of the hash-related data structures; -use the procedures and macros defined here. - -.SH KEYWORDS -hash table, key, lookup, search, value diff --git a/doc/IntObj.3 b/doc/IntObj.3 deleted file mode 100644 index 6222498..0000000 --- a/doc/IntObj.3 +++ /dev/null @@ -1,104 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: IntObj.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_IntObj 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_NewIntObj, Tcl_NewLongObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_GetIntFromObj, Tcl_GetLongFromObj \- manipulate Tcl objects as integers -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Obj * -\fBTcl_NewIntObj\fR(\fIintValue\fR) -.sp -Tcl_Obj * -\fBTcl_NewLongObj\fR(\fIlongValue\fR) -.sp -\fBTcl_SetIntObj\fR(\fIobjPtr, intValue\fR) -.sp -\fBTcl_SetLongObj\fR(\fIobjPtr, longValue\fR) -.sp -int -\fBTcl_GetIntFromObj\fR(\fIinterp, objPtr, intPtr\fR) -.sp -int -\fBTcl_GetLongFromObj\fR(\fIinterp, objPtr, longPtr\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP int intValue in -Integer value used to initialize or set an integer object. -.AP long longValue in -Long integer value used to initialize or set an integer object. -.AP Tcl_Obj *objPtr in/out -For \fBTcl_SetIntObj\fR and \fBTcl_SetLongObj\fR, -this points to the object to be converted to integer type. -For \fBTcl_GetIntFromObj\fR and \fBTcl_GetLongFromObj\fR, -this refers to the object -from which to get an integer or long integer value; -if \fIobjPtr\fR does not already point to an integer object, -an attempt will be made to convert it to one. -.AP Tcl_Interp *interp in/out -If an error occurs during conversion, -an error message is left in the interpreter's result object -unless \fIinterp\fR is NULL. -.AP int *intPtr out -Points to place to store the integer value -obtained by \fBTcl_GetIntFromObj\fR from \fIobjPtr\fR. -.AP long *longPtr out -Points to place to store the long integer value -obtained by \fBTcl_GetLongFromObj\fR from \fIobjPtr\fR. -.BE - -.SH DESCRIPTION -.PP -These procedures are used to create, modify, and read -integer Tcl objects from C code. -\fBTcl_NewIntObj\fR, \fBTcl_NewLongObj\fR, -\fBTcl_SetIntObj\fR, and \fBTcl_SetLongObj\fR -create a new object of integer type -or modify an existing object to have integer type. -\fBTcl_NewIntObj\fR and \fBTcl_SetIntObj\fR set the object to have the -integer value given by \fIintValue\fR, -while \fBTcl_NewLongObj\fR and \fBTcl_SetLongObj\fR -set the object to have the -long integer value given by \fIlongValue\fR. -\fBTcl_NewIntObj\fR and \fBTcl_NewLongObj\fR -return a pointer to a newly created object with reference count zero. -These procedures set the object's type to be integer -and assign the integer value to the object's internal representation -\fIlongValue\fR member. -\fBTcl_SetIntObj\fR and \fBTcl_SetLongObj\fR -invalidate any old string representation and, -if the object is not already an integer object, -free any old internal representation. -.PP -\fBTcl_GetIntFromObj\fR and \fBTcl_GetLongFromObj\fR -attempt to return an integer value from the Tcl object \fIobjPtr\fR. -If the object is not already an integer object, -they will attempt to convert it to one. -If an error occurs during conversion, they return \fBTCL_ERROR\fR -and leave an error message in the interpreter's result object -unless \fIinterp\fR is NULL. -Also, if the long integer held in the object's internal representation -\fIlongValue\fR member can not be represented in a (non-long) integer, -\fBTcl_GetIntFromObj\fR returns \fBTCL_ERROR\fR -and leaves an error message in the interpreter's result object -unless \fIinterp\fR is NULL. -Otherwise, both procedures return \fBTCL_OK\fR and -store the integer or the long integer value -in the address given by \fIintPtr\fR and \fIlongPtr\fR respectively. -If the object is not already an integer object, -the conversion will free any old internal representation. - -.SH "SEE ALSO" -Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult - -.SH KEYWORDS -integer, integer object, integer type, internal representation, object, object type, string representation diff --git a/doc/Interp.3 b/doc/Interp.3 deleted file mode 100644 index db08dcd..0000000 --- a/doc/Interp.3 +++ /dev/null @@ -1,125 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Interp.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Interp 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Interp \- client-visible fields of interpreter structures -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -typedef struct { - char *\fIresult\fR; - Tcl_FreeProc *\fIfreeProc\fR; - int \fIerrorLine\fR; -} Tcl_Interp; - -typedef void Tcl_FreeProc(char *\fIblockPtr\fR); -.BE - -.SH DESCRIPTION -.PP -The \fBTcl_CreateInterp\fR procedure returns a pointer to a Tcl_Interp -structure. This pointer is then passed into other Tcl procedures -to process commands in the interpreter and perform other operations -on the interpreter. Interpreter structures contain many many fields -that are used by Tcl, but only three that may be accessed by -clients: \fIresult\fR, \fIfreeProc\fR, and \fIerrorLine\fR. -.PP -The \fIresult\fR and \fIfreeProc\fR fields are used to return -results or error messages from commands. -This information is returned by command procedures back to \fBTcl_Eval\fR, -and by \fBTcl_Eval\fR back to its callers. -The \fIresult\fR field points to the string that represents the -result or error message, and the \fIfreeProc\fR field tells how -to dispose of the storage for the string when it isn't needed anymore. -The easiest way for command procedures to manipulate these -fields is to call procedures like \fBTcl_SetResult\fR -or \fBTcl_AppendResult\fR; they -will hide all the details of managing the fields. -The description below is for those procedures that manipulate the -fields directly. -.PP -Whenever a command procedure returns, it must ensure -that the \fIresult\fR field of its interpreter points to the string -being returned by the command. -The \fIresult\fR field must always point to a valid string. -If a command wishes to return no result then \fIinterp->result\fR -should point to an empty string. -Normally, results are assumed to be statically allocated, -which means that the contents will not change before the next time -\fBTcl_Eval\fR is called or some other command procedure is invoked. -.VS -In this case, the \fIfreeProc\fR field must be zero. -Alternatively, a command procedure may dynamically -allocate its return value (e.g. using \fBTcl_Alloc\fR) -and store a pointer to it in \fIinterp->result\fR. -In this case, the command procedure must also set \fIinterp->freeProc\fR -to the address of a procedure that can free the value, or \fBTCL_DYNAMIC\fR -if the storage was allocated directly by Tcl or by a call to -\fBTcl_Alloc\fR. -.VE -If \fIinterp->freeProc\fR is non-zero, then Tcl will call \fIfreeProc\fR -to free the space pointed to by \fIinterp->result\fR before it -invokes the next command. -If a client procedure overwrites \fIinterp->result\fR when -\fIinterp->freeProc\fR is non-zero, then it is responsible for calling -\fIfreeProc\fR to free the old \fIinterp->result\fR (the \fBTcl_FreeResult\fR -macro should be used for this purpose). -.PP -\fIFreeProc\fR should have arguments and result that match the -\fBTcl_FreeProc\fR declaration above: it receives a single -argument which is a pointer to the result value to free. -.VS -In most applications \fBTCL_DYNAMIC\fR is the only non-zero value ever -used for \fIfreeProc\fR. -.VE -However, an application may store a different procedure address -in \fIfreeProc\fR in order to use an alternate memory allocator -or in order to do other cleanup when the result memory is freed. -.PP -As part of processing each command, \fBTcl_Eval\fR initializes -\fIinterp->result\fR -and \fIinterp->freeProc\fR just before calling the command procedure for -the command. The \fIfreeProc\fR field will be initialized to zero, -and \fIinterp->result\fR will point to an empty string. Commands that -do not return any value can simply leave the fields alone. -Furthermore, the empty string pointed to by \fIresult\fR is actually -part of an array of \fBTCL_RESULT_SIZE\fR characters (approximately 200). -If a command wishes to return a short string, it can simply copy -it to the area pointed to by \fIinterp->result\fR. Or, it can use -the sprintf procedure to generate a short result string at the location -pointed to by \fIinterp->result\fR. -.PP -It is a general convention in Tcl-based applications that the result -of an interpreter is normally in the initialized state described -in the previous paragraph. -Procedures that manipulate an interpreter's result (e.g. by -returning an error) will generally assume that the result -has been initialized when the procedure is called. -If such a procedure is to be called after the result has been -changed, then \fBTcl_ResetResult\fR should be called first to -reset the result to its initialized state. -.PP -The \fIerrorLine\fR -field is valid only after \fBTcl_Eval\fR returns -a \fBTCL_ERROR\fR return code. In this situation the \fIerrorLine\fR -field identifies the line number of the command being executed when -the error occurred. The line numbers are relative to the command -being executed: 1 means the first line of the command passed to -\fBTcl_Eval\fR, 2 means the second line, and so on. -The \fIerrorLine\fR field is typically used in conjunction with -\fBTcl_AddErrorInfo\fR to report information about where an error -occurred. -\fIErrorLine\fR should not normally be modified except by \fBTcl_Eval\fR. - -.SH KEYWORDS -free, initialized, interpreter, malloc, result diff --git a/doc/LinkVar.3 b/doc/LinkVar.3 deleted file mode 100644 index 25d3c17..0000000 --- a/doc/LinkVar.3 +++ /dev/null @@ -1,115 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: LinkVar.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_LinkVar 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_LinkVar, Tcl_UnlinkVar, Tcl_UpdateLinkedVar \- link Tcl variable to C variable -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_LinkVar\fR(\fIinterp, varName, addr, type\fR) -.sp -\fBTcl_UnlinkVar\fR(\fIinterp, varName\fR) -.sp -\fBTcl_UpdateLinkedVar\fR(\fIinterp, varName\fR) -.SH ARGUMENTS -.AS Tcl_Interp writable -.AP Tcl_Interp *interp in -Interpreter that contains \fIvarName\fR. -Also used by \fBTcl_LinkVar\fR to return error messages. -.AP char *varName in -Name of global variable. Must be in writable memory: Tcl may make -temporary modifications to it while parsing the variable name. -.AP char *addr in -Address of C variable that is to be linked to \fIvarName\fR. -.AP int type in -Type of C variable. Must be one of TCL_LINK_INT, TCL_LINK_DOUBLE, -TCL_LINK_BOOLEAN, or TCL_LINK_STRING, optionally OR'ed with -TCL_LINK_READ_ONLY to make Tcl variable read-only. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_LinkVar\fR uses variable traces to keep the Tcl variable -named by \fIvarName\fR in sync with the C variable at the address -given by \fIaddr\fR. -Whenever the Tcl variable is read the value of the C variable will -be returned, and whenever the Tcl variable is written the C -variable will be updated to have the same value. -\fBTcl_LinkVar\fR normally returns TCL_OK; if an error occurs -while setting up the link (e.g. because \fIvarName\fR is the -name of array) then TCL_ERROR is returned and \fIinterp->result\fR -contains an error message. -.PP -The \fItype\fR argument specifies the type of the C variable, -and must have one of the following values, optionally OR'ed with -TCL_LINK_READ_ONLY: -.TP -\fBTCL_LINK_INT\fR -The C variable is of type \fBint\fR. -Any value written into the Tcl variable must have a proper integer -form acceptable to \fBTcl_GetInt\fR; attempts to write -non-integer values into \fIvarName\fR will be rejected with -Tcl errors. -.TP -\fBTCL_LINK_DOUBLE\fR -The C variable is of type \fBdouble\fR. -Any value written into the Tcl variable must have a proper real -form acceptable to \fBTcl_GetDouble\fR; attempts to write -non-real values into \fIvarName\fR will be rejected with -Tcl errors. -.TP -\fBTCL_LINK_BOOLEAN\fR -The C variable is of type \fBint\fR. -If its value is zero then it will read from Tcl as ``0''; -otherwise it will read from Tcl as ``1''. -Whenever \fIvarName\fR is -modified, the C variable will be set to a 0 or 1 value. -Any value written into the Tcl variable must have a proper boolean -form acceptable to \fBTcl_GetBoolean\fR; attempts to write -non-boolean values into \fIvarName\fR will be rejected with -Tcl errors. -.TP -\fBTCL_LINK_STRING\fR -The C variable is of type \fBchar *\fR. -.VS -If its value is not null then it must be a pointer to a string -allocated with \fBTcl_Alloc\fR. -.VE -Whenever the Tcl variable is modified the current C string will be -freed and new memory will be allocated to hold a copy of the variable's -new value. -If the C variable contains a null pointer then the Tcl variable -will read as ``NULL''. -.PP -If the TCL_LINK_READ_ONLY flag is present in \fItype\fR then the -variable will be read-only from Tcl, so that its value can only be -changed by modifying the C variable. -Attempts to write the variable from Tcl will be rejected with errors. -.PP -\fBTcl_UnlinkVar\fR removes the link previously set up for the -variable given by \fIvarName\fR. If there does not exist a link -for \fIvarName\fR then the procedure has no effect. -.PP -\fBTcl_UpdateLinkedVar\fR may be invoked after the C variable has -changed to force the Tcl variable to be updated immediately. -In many cases this procedure is not needed, since any attempt to -read the Tcl variable will return the latest value of the C variable. -However, if a trace has been set on the Tcl variable (such as a -Tk widget that wishes to display the value of the variable), the -trace will not trigger when the C variable has changed. -\fBTcl_UpdateLinkedVar\fR ensures that any traces on the Tcl -variable are invoked. - -.SH KEYWORDS -boolean, integer, link, read-only, real, string, traces, variable diff --git a/doc/ListObj.3 b/doc/ListObj.3 deleted file mode 100644 index c36bdfe..0000000 --- a/doc/ListObj.3 +++ /dev/null @@ -1,249 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: ListObj.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_ListObj 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_ListObjAppendList, Tcl_ListObjAppendElement, Tcl_NewListObj, Tcl_SetListObj, Tcl_ListObjGetElements, Tcl_ListObjLength, Tcl_ListObjIndex, Tcl_ListObjReplace \- manipulate Tcl objects as lists -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_ListObjAppendList\fR(\fIinterp, listPtr, elemListPtr\fR) -.sp -int -\fBTcl_ListObjAppendElement\fR(\fIinterp, listPtr, objPtr\fR) -.sp -Tcl_Obj * -\fBTcl_NewListObj\fR(\fIobjc, objv\fR) -.sp -\fBTcl_SetListObj\fR(\fIobjPtr, objc, objv\fR) -.sp -int -\fBTcl_ListObjGetElements\fR(\fIinterp, listPtr, objcPtr, objvPtr\fR) -.sp -int -\fBTcl_ListObjLength\fR(\fIinterp, listPtr, intPtr\fR) -.sp -int -\fBTcl_ListObjIndex\fR(\fIinterp, listPtr, index, objPtrPtr\fR) -.sp -int -\fBTcl_ListObjReplace\fR(\fIinterp, listPtr, first, count, objc, objv\fR) -.SH ARGUMENTS -.AS Tcl_Interp "*CONST objv[]" out -.AP Tcl_Interp *interp in -If an error occurs while converting an object to be a list object, -an error message is left in the interpreter's result object -unless \fIinterp\fR is NULL. -.AP Tcl_Obj *listPtr in/out -Points to the list object to be manipulated. -If \fIlistPtr\fR does not already point to a list object, -an attempt will be made to convert it to one. -.AP Tcl_Obj *elemListPtr in/out -For \fBTcl_ListObjAppendList\fR, this points to a list object -containing elements to be appended onto \fIlistPtr\fR. -Each element of *\fIelemListPtr\fR will -become a new element of \fIlistPtr\fR. -If *\fIelemListPtr\fR is not NULL and -does not already point to a list object, -an attempt will be made to convert it to one. -.AP Tcl_Obj *objPtr in -For \fBTcl_ListObjAppendElement\fR, -points to the Tcl object that will be appended to \fIlistPtr\fR. -For \fBTcl_SetListObj\fR, -this points to the Tcl object that will be converted to a list object -containing the \fIobjc\fR elements of the array referenced by \fIobjv\fR. -.AP int *objcPtr in -Points to location where \fBTcl_ListObjGetElements\fR -stores the number of element objects in \fIlistPtr\fR. -.AP Tcl_Obj ***objvPtr out -A location where \fBTcl_ListObjGetElements\fR stores a pointer to an array -of pointers to the element objects of \fIlistPtr\fR. -.AP int objc in -The number of Tcl objects that \fBTcl_NewListObj\fR -will insert into a new list object, -and \fBTcl_ListObjReplace\fR will insert into \fIlistPtr\fR. -For \fBTcl_SetListObj\fR, -the number of Tcl objects to insert into \fIobjPtr\fR. -.VS -.TP -Tcl_Obj *CONST \fIobjv\fR[] (in) -. -An array of pointers to objects. -\fBTcl_NewListObj\fR will insert these objects into a new list object -and \fBTcl_ListObjReplace\fR will insert them into an existing \fIlistPtr\fR. -Each object will become a separate list element. -.VE -.AP int *intPtr out -Points to location where \fBTcl_ListObjLength\fR -stores the length of the list. -.AP int index in -Index of the list element that \fBTcl_ListObjIndex\fR -is to return. -The first element has index 0. -.AP Tcl_Obj **objPtrPtr out -Points to place where \fBTcl_ListObjIndex\fR is to store -a pointer to the resulting list element object. -.AP int first in -Index of the starting list element that \fBTcl_ListObjReplace\fR -is to replace. -The list's first element has index 0. -.AP int count in -The number of elements that \fBTcl_ListObjReplace\fR -is to replace. -.BE - -.SH DESCRIPTION -.PP -Tcl list objects have an internal representation that supports -the efficient indexing and appending. -The procedures described in this man page are used to -create, modify, index, and append to Tcl list objects from C code. -.PP -\fBTcl_ListObjAppendList\fR and \fBTcl_ListObjAppendElement\fR -both add one or more objects -to the end of the list object referenced by \fIlistPtr\fR. -\fBTcl_ListObjAppendList\fR appends each element of the list object -referenced by \fIelemListPtr\fR while -\fBTcl_ListObjAppendElement\fR appends the single object -referenced by \fIobjPtr\fR. -Both procedures will convert the object referenced by \fIlistPtr\fR -to a list object if necessary. -If an error occurs during conversion, -both procedures return \fBTCL_ERROR\fR and leave an error message -in the interpreter's result object if \fIinterp\fR is not NULL. -Similarly, if \fIelemListPtr\fR does not already refer to a list object, -\fBTcl_ListObjAppendList\fR will attempt to convert it to one -and if an error occurs during conversion, -will return \fBTCL_ERROR\fR -and leave an error message in the interpreter's result object -if interp is not NULL. -Both procedures invalidate any old string representation of \fIlistPtr\fR -and, if it was converted to a list object, -free any old internal representation. -Similarly, \fBTcl_ListObjAppendList\fR frees any old internal representation -of \fIelemListPtr\fR if it converts it to a list object. -After appending each element in \fIelemListPtr\fR, -\fBTcl_ListObjAppendList\fR increments the element's reference count -since \fIlistPtr\fR now also refers to it. -For the same reason, \fBTcl_ListObjAppendElement\fR -increments \fIobjPtr\fR's reference count. -If no error occurs, -the two procedures return \fBTCL_OK\fR after appending the objects. -.PP -\fBTcl_NewListObj\fR and \fBTcl_SetListObj\fR -create a new object or modify an existing object to hold -the \fIobjc\fR elements of the array referenced by \fIobjv\fR -where each element is a pointer to a Tcl object. -If \fIobjc\fR is less than or equal to zero, -they return an empty object. -The new object's string representation is left invalid. -The two procedures increment the reference counts -of the elements in \fIobjc\fR since the list object now refers to them. -The new list object returned by \fBTcl_NewListObj\fR -has reference count zero. -.PP -\fBTcl_ListObjGetElements\fR returns a count and -a pointer to an array of the elements in a list object. -It returns the count by storing it in the address \fIobjcPtr\fR. -Similarly, it returns the array pointer by storing it -in the address \fIobjvPtr\fR. -If \fIlistPtr\fR is not already a list object, -\fBTcl_ListObjGetElements\fR will attempt to convert it to one; -if the conversion fails, it returns \fBTCL_ERROR\fR -and leaves an error message in the interpreter's result object -if \fIinterp\fR is not NULL. -Otherwise it returns \fBTCL_OK\fR after storing the count and array pointer. -.PP -\fBTcl_ListObjLength\fR returns the number of elements in the list object -referenced by \fIlistPtr\fR. -It returns this count by storing an integer in the address \fIintPtr\fR. -If the object is not already a list object, -\fBTcl_ListObjLength\fR will attempt to convert it to one; -if the conversion fails, it returns \fBTCL_ERROR\fR -and leaves an error message in the interpreter's result object -if \fIinterp\fR is not NULL. -Otherwise it returns \fBTCL_OK\fR after storing the list's length. -.PP -The procedure \fBTcl_ListObjIndex\fR returns a pointer to the object -at element \fIindex\fR in the list referenced by \fIlistPtr\fR. -It returns this object by storing a pointer to it -in the address \fIobjPtrPtr\fR. -If \fIlistPtr\fR does not already refer to a list object, -\fBTcl_ListObjIndex\fR will attempt to convert it to one; -if the conversion fails, it returns \fBTCL_ERROR\fR -and leaves an error message in the interpreter's result object -if \fIinterp\fR is not NULL. -If the index is out of range, -that is, \fIindex\fR is negative or -greater than or equal to the number of elements in the list, -\fBTcl_ListObjIndex\fR stores a NULL in \fIobjPtrPtr\fR -and returns \fBTCL_OK\fR. -Otherwise it returns \fBTCL_OK\fR after storing the element's -object pointer. -The reference count for the list element is not incremented; -the caller must do that if it needs to retain a pointer to the element. -.PP -\fBTcl_ListObjReplace\fR replaces zero or more elements -of the list referenced by \fIlistPtr\fR -with the \fIobjc\fR objects in the array referenced by \fIobjv\fR. -If \fIlistPtr\fR does not point to a list object, -\fBTcl_ListObjReplace\fR will attempt to convert it to one; -if the conversion fails, it returns \fBTCL_ERROR\fR -and leaves an error message in the interpreter's result object -if \fIinterp\fR is not NULL. -Otherwise, it returns \fBTCL_OK\fR after replacing the objects. -If \fIobjv\fR is NULL, no new elements are added. -If the argument \fIfirst\fR is zero or negative, -it refers to the first element. -If \fIfirst\fR is greater than or equal to the -number of elements in the list, then no elements are deleted; -the new elements are appended to the list. -\fIcount\fR gives the number of elements to replace. -If \fIcount\fR is zero or negative then no elements are deleted; -the new elements are simply inserted before the one -designated by \fIfirst\fR. -\fBTcl_ListObjReplace\fR invalidates \fIlistPtr\fR's -old string representation. -The reference counts of any elements inserted from \fIobjv\fR -are incremented since the resulting list now refers to them. -Similarly, the reference counts for any replaced objects are decremented. -.PP -Because \fBTcl_ListObjReplace\fR combines -both element insertion and deletion, -it can be used to implement a number of list operations. -For example, the following code inserts the \fIobjc\fR objects -referenced by the array of object pointers \fIobjv\fR -just before the element \fIindex\fR of the list referenced by \fIlistPtr\fR: -.CS -result = Tcl_ListObjReplace(interp, listPtr, index, 0, objc, objv); -.CE -Similarly, the following code appends the \fIobjc\fR objects -referenced by the array \fIobjv\fR -to the end of the list \fIlistPtr\fR: -.CS -result = Tcl_ListObjLength(interp, listPtr, &length); -if (result == TCL_OK) { - result = Tcl_ListObjReplace(interp, listPtr, length, 0, objc, objv); -} -.CE -The \fIcount\fR list elements starting at \fIfirst\fR can be deleted -by simply calling \fBTcl_ListObjReplace\fR -with a NULL \fIobjvPtr\fR: -.CS -result = Tcl_ListObjReplace(interp, listPtr, first, count, 0, NULL); -.CE - -.SH "SEE ALSO" -Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult - -.SH KEYWORDS -append, index, insert, internal representation, length, list, list object, list type, object, object type, replace, string representation diff --git a/doc/Notifier.3 b/doc/Notifier.3 deleted file mode 100644 index dcd8250..0000000 --- a/doc/Notifier.3 +++ /dev/null @@ -1,537 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: Notifier.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Notifier 3 8.0 Tcl "Tcl Library Procedures" -.BS -.VS -.SH NAME -Tcl_CreateEventSource, Tcl_DeleteEventSource, Tcl_SetMaxBlockTime, Tcl_QueueEvent, Tcl_DeleteEvents, Tcl_WaitForEvent, Tcl_SetTimer, Tcl_ServiceAll, Tcl_ServiceEvent, Tcl_GetServiceMode, Tcl_SetServiceMode \- the event queue and notifier interfaces - -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_CreateEventSource\fR(\fIsetupProc, checkProc, clientData\fB)\fR -.sp -\fBTcl_DeleteEventSource\fR(\fIsetupProc, checkProc, clientData\fB)\fR -.sp -\fBTcl_SetMaxBlockTime\fR(\fItimePtr\fB)\fR -.sp -\fBTcl_QueueEvent\fR(\fIevPtr, position\fR) -.VS -.sp -\fBTcl_DeleteEvents\fR(\fIdeleteProc, clientData\fR) -.sp -int -\fBTcl_WaitForEvent\fR(\fItimePtr\fR) -.sp -\fBTcl_SetTimer\fR(\fItimePtr\fR) -.sp -int -\fBTcl_ServiceAll\fR() -.sp -int -\fBTcl_ServiceEvent\fR(\fIflags\fR) -.sp -int -\fBTcl_GetServiceMode\fR() -.sp -int -\fBTcl_SetServiceMode\fR(\fImode\fR) -.VE - -.SH ARGUMENTS -.AS Tcl_EventDeleteProc milliseconds -.AS Tcl_EventSetupProc *setupProc -.AP Tcl_EventSetupProc *setupProc in -Procedure to invoke to prepare for event wait in \fBTcl_DoOneEvent\fR. -.AP Tcl_EventCheckProc *checkProc in -Procedure for \fBTcl_DoOneEvent\fR to invoke after waiting for -events. Checks to see if any events have occurred and, if so, -queues them. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIsetupProc\fR, \fIcheckProc\fR, or -\fIdeleteProc\fR. -.AP Tcl_Time *timePtr in -Indicates the maximum amount of time to wait for an event. This -is specified as an interval (how long to wait), not an absolute -time (when to wakeup). If the pointer passed to \fBTcl_WaitForEvent\fR -is NULL, it means there is no maximum wait time: wait forever if -necessary. -.AP Tcl_Event *evPtr in -An event to add to the event queue. The storage for the event must -have been allocated by the caller using \fBTcl_Alloc\fR or \fBckalloc\fR. -.AP Tcl_QueuePosition position in -Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR, -\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR. -.AP int flags in -What types of events to service. These flags are the same as those -passed to \fBTcl_DoOneEvent\fR. -.AP Tcl_EventDeleteProc *deleteProc in -Procedure to invoke for each queued event in \fBTcl_DeleteEvents\fR. -.VS -.AP int mode in -Inidicates whether events should be serviced by \fBTcl_ServiceAll\fR. -Must be one of \fBTCL_SERVICE_NONE\fR or \fBTCL_SERVICE_ALL\fR. -.VE -.BE - -.SH INTRODUCTION -.PP -.VS -The interfaces described here are used to customize the Tcl event -loop. The two most common customizations are to add new sources of -events and to merge Tcl's event loop with some other event loop, such -as one provided by an application in which Tcl is embedded. Each of -these tasks is described in a separate section below. -.VE -.PP -The procedures in this manual entry are the building blocks out of which -the Tcl event notifier is constructed. The event notifier is the lowest -layer in the Tcl event mechanism. It consists of three things: -.IP [1] -Event sources: these represent the ways in which events can be -generated. For example, there is a timer event source that implements -the \fBTcl_CreateTimerHandler\fR procedure and the \fBafter\fR -command, and there is a file event source that implements the -\fBTcl_CreateFileHandler\fR procedure on Unix systems. An event -source must work with the notifier to detect events at the right -times, record them on the event queue, and eventually notify -higher-level software that they have occurred. The procedures -\fBTcl_CreateEventSource\fR, \fBTcl_DeleteEventSource\fR, -and \fBTcl_SetMaxBlockTime\fR, \fBTcl_QueueEvent\fR, and -\fBTcl_DeleteEvents\fR are used primarily by event sources. -.IP [2] -The event queue: there is a single queue for the whole application, -containing events that have been detected but not yet serviced. Event -sources place events onto the queue so that they may be processed in -order at appropriate times during the event loop. The event queue -guarantees a fair discipline of event handling, so that no event -source can starve the others. It also allows events to be saved for -servicing at a future time. -.VS -\fBTcl_QueueEvent\fR is used (primarily -by event sources) to add events to the event queue and -\fBTcl_DeleteEvents\fR is used to remove events from the queue without -processing them. -.IP [3] -The event loop: in order to detect and process events, the application -enters a loop that waits for events to occur, places them on the event -queue, and then processes them. Most applications will do this by -calling the procedure \fBTcl_DoOneEvent\fR, which is described in a -separate manual entry. -.PP -Most Tcl applications need not worry about any of the internals of -the Tcl notifier. However, the notifier now has enough flexibility -to be retargeted either for a new platform or to use an external event -loop (such as the Motif event loop, when Tcl is embedded in a Motif -application). The procedures \fBTcl_WaitForEvent\fR and -\fBTcl_SetTimer\fR are normally implemented by Tcl, but may be -replaced with new versions to retarget the notifier (the \fBTcl_Sleep\fR, -\fBTcl_CreateFileHandler\fR, and \fBTcl_DeleteFileHandler\fR must -also be replaced; see CREATING A NEW NOTIFIER below for details). -The procedures \fBTcl_ServiceAll\fR, \fBTcl_ServiceEvent\fR, -\fBTcl_GetServiceMode\fR, and \fBTcl_SetServiceMode\fR are provided -to help connect Tcl's event loop to an external event loop such as -Motif's. -.SH "NOTIFIER BASICS" -.VE -.PP -The easiest way to understand how the notifier works is to consider -what happens when \fBTcl_DoOneEvent\fR is called. -\fBTcl_DoOneEvent\fR is passed a \fIflags\fR argument that indicates -what sort of events it is OK to process and also whether or not to -block if no events are ready. \fBTcl_DoOneEvent\fR does the following -things: -.IP [1] -Check the event queue to see if it contains any events that can -be serviced. If so, service the first possible event, remove it -.VS -from the queue, and return. It does this by calling -\fBTcl_ServiceEvent\fR and passing in the \fIflags\fR argument. -.VE -.IP [2] -Prepare to block for an event. To do this, \fBTcl_DoOneEvent\fR -invokes a \fIsetup procedure\fR in each event source. -The event source will perform event-source specific initialization and -.VS -possibly call \fBTcl_SetMaxBlockTime\fR to limit how long -.VE -\fBTcl_WaitForEvent\fR will block if no new events occur. -.IP [3] -Call \fBTcl_WaitForEvent\fR. This procedure is implemented differently -on different platforms; it waits for an event to occur, based on the -information provided by the event sources. -It may cause the application to block if \fItimePtr\fR specifies -an interval other than 0. -\fBTcl_WaitForEvent\fR returns when something has happened, -such as a file becoming readable or the interval given by \fItimePtr\fR -expiring. If there are no events for \fBTcl_WaitForEvent\fR to -wait for, so that it would block forever, then it returns immediately -and \fBTcl_DoOneEvent\fR returns 0. -.IP [4] -Call a \fIcheck procedure\fR in each event source. The check -procedure determines whether any events of interest to this source -occurred. If so, the events are added to the event queue. -.IP [5] -Check the event queue to see if it contains any events that can -be serviced. If so, service the first possible event, remove it -from the queue, and return. -.IP [6] -See if there are idle callbacks pending. If so, invoke all of them and -return. -.IP [7] -Either return 0 to indicate that no events were ready, or go back to -step [2] if blocking was requested by the caller. - -.SH "CREATING A NEW EVENT SOURCE" -.PP -An event source consists of three procedures invoked by the notifier, -plus additional C procedures that are invoked by higher-level code -to arrange for event-driven callbacks. The three procedures called -by the notifier consist of the setup and check procedures described -above, plus an additional procedure that is invoked when an event -is removed from the event queue for servicing. -.PP -The procedure \fBTcl_CreateEventSource\fR creates a new event source. -Its arguments specify the setup procedure and check procedure for -the event source. -\fISetupProc\fR should match the following prototype: -.CS -typedef void Tcl_EventSetupProc( - ClientData \fIclientData\fR, - int \fIflags\fR); -.CE -The \fIclientData\fR argument will be the same as the \fIclientData\fR -argument to \fBTcl_CreateEventSource\fR; it is typically used to -point to private information managed by the event source. -The \fIflags\fR argument will be the same as the \fIflags\fR -argument passed to \fBTcl_DoOneEvent\fR except that it will never -be 0 (\fBTcl_DoOneEvent\fR replaces 0 with \fBTCL_ALL_EVENTS\fR). -\fIFlags\fR indicates what kinds of events should be considered; -if the bit corresponding to this event source isn't set, the event -source should return immediately without doing anything. For -example, the file event source checks for the \fBTCL_FILE_EVENTS\fR -bit. -.PP -\fISetupProc\fR's job is to make sure that the application wakes up -when events of the desired type occur. This is typically done in a -platform-dependent fashion. For example, under Unix an event source -might call \fBTcl_CreateFileHandler\fR; under Windows it might -request notification with a Windows event. For timer-driven event -sources such as timer events or any polled event, the event source -can call \fBTcl_SetMaxBlockTime\fR to force the application to wake -up after a specified time even if no events have occurred. -.VS -If no event source calls \fBTcl_SetMaxBlockTime\fR -then \fBTcl_WaitForEvent\fR will wait as long as necessary for an -event to occur; otherwise, it will only wait as long as the shortest -interval passed to \fBTcl_SetMaxBlockTime\fR by one of the event -sources. If an event source knows that it already has events ready to -report, it can request a zero maximum block time. For example, the -setup procedure for the X event source looks to see if there are -events already queued. If there are, it calls -\fBTcl_SetMaxBlockTime\fR with a 0 block time so that -\fBTcl_WaitForEvent\fR does not block if there is no new data on the X -connection. -.VE -The \fItimePtr\fR argument to \fBTcl_WaitForEvent\fR points to -a structure that describes a time interval in seconds and -microseconds: -.CS -typedef struct Tcl_Time { - long \fIsec\fR; - long \fIusec\fR; -} Tcl_Time; -.CE -The \fIusec\fR field should be less than 1000000. -.PP -.VS -Information provided to \fBTcl_SetMaxBlockTime\fR -is only used for the next call to \fBTcl_WaitForEvent\fR; it is -discarded after \fBTcl_WaitForEvent\fR returns. -.VE -The next time an event wait is done each of the event sources' -setup procedures will be called again, and they can specify new -information for that event wait. -.PP -.VS -If the application uses an external event loop rather than -\fBTcl_DoOneEvent\fR, the event sources may need to call -\fBTcl_SetMaxBlockTime\fR at other times. For example, if a new event -handler is registered that needs to poll for events, the event source -may call \fBTcl_SetMaxBlockTime\fR to set the block time to zero to -force the external event loop to call Tcl. In this case, -\fBTcl_SetMaxBlockTime\fR invokes \fBTcl_SetTimer\fR with the shortest -interval seen since the last call to \fBTcl_DoOneEvent\fR or -\fBTcl_ServiceAll\fR. -.PP -In addition to the generic procedure \fBTcl_SetMaxBlockTime\fR, other -platform-specific procedures may also be available for -\fIsetupProc\fR, if there is additional information needed by -\fBTcl_WaitForEvent\fR on that platform. For example, on Unix systems -the \fBTcl_CreateFileHandler\fR interface can be used to wait for file events. -.VE -.PP -The second procedure provided by each event source is its check -procedure, indicated by the \fIcheckProc\fR argument to -\fBTcl_CreateEventSource\fR. \fICheckProc\fR must match the -following prototype: -.CS -typedef void Tcl_EventCheckProc( - ClientData \fIclientData\fR, - int \fIflags\fR); -.CE -The arguments to this procedure are the same as those for \fIsetupProc\fR. -\fBCheckProc\fR is invoked by \fBTcl_DoOneEvent\fR after it has waited -for events. Presumably at least one event source is now prepared to -queue an event. \fBTcl_DoOneEvent\fR calls each of the event sources -in turn, so they all have a chance to queue any events that are ready. -The check procedure does two things. First, it must see if any events -have triggered. Different event sources do this in different ways. -.PP -If an event source's check procedure detects an interesting event, it -must add the event to Tcl's event queue. To do this, the event source -calls \fBTcl_QueueEvent\fR. The \fIevPtr\fR argument is a pointer to -a dynamically allocated structure containing the event (see below for -more information on memory management issues). Each event source can -define its own event structure with whatever information is relevant -to that event source. However, the first element of the structure -must be a structure of type \fBTcl_Event\fR, and the address of this -structure is used when communicating between the event source and the -rest of the notifier. A \fBTcl_Event\fR has the following definition: -.CS -typedef struct Tcl_Event { - Tcl_EventProc *\fIproc\fR; - struct Tcl_Event *\fInextPtr\fR; -}; -.CE -The event source must fill in the \fIproc\fR field of -the event before calling \fBTcl_QueueEvent\fR. -The \fInextPtr\fR is used to link together the events in the queue -and should not be modified by the event source. -.PP -An event may be added to the queue at any of three positions, depending -on the \fIposition\fR argument to \fBTcl_QueueEvent\fR: -.IP \fBTCL_QUEUE_TAIL\fR 24 -Add the event at the back of the queue, so that all other pending -events will be serviced first. This is almost always the right -place for new events. -.IP \fBTCL_QUEUE_HEAD\fR 24 -Add the event at the front of the queue, so that it will be serviced -before all other queued events. -.IP \fBTCL_QUEUE_MARK\fR 24 -Add the event at the front of the queue, unless there are other -events at the front whose position is \fBTCL_QUEUE_MARK\fR; if so, -add the new event just after all other \fBTCL_QUEUE_MARK\fR events. -This value of \fIposition\fR is used to insert an ordered sequence of -events at the front of the queue, such as a series of -Enter and Leave events synthesized during a grab or ungrab operation -in Tk. -.PP -.VS -When it is time to handle an event from the queue (steps 1 and 4 -above) \fBTcl_ServiceEvent\fR will invoke the \fIproc\fR specified -.VE -in the first queued \fBTcl_Event\fR structure. -\fIProc\fR must match the following prototype: -.CS -typedef int Tcl_EventProc( - Tcl_Event *\fIevPtr\fR, - int \fIflags\fR); -.CE -The first argument to \fIproc\fR is a pointer to the event, which will -be the same as the first argument to the \fBTcl_QueueEvent\fR call that -added the event to the queue. -The second argument to \fIproc\fR is the \fIflags\fR argument for the -.VS -current call to \fBTcl_ServiceEvent\fR; this is used by the event source -.VE -to return immediately if its events are not relevant. -.PP -It is up to \fIproc\fR to handle the event, typically by invoking -one or more Tcl commands or C-level callbacks. -Once the event source has finished handling the event it returns 1 -to indicate that the event can be removed from the queue. -If for some reason the event source decides that the event cannot -be handled at this time, it may return 0 to indicate that the event -.VS -should be deferred for processing later; in this case \fBTcl_ServiceEvent\fR -.VE -will go on to the next event in the queue and attempt to service it. -There are several reasons why an event source might defer an event. -One possibility is that events of this type are excluded by the -\fIflags\fR argument. -For example, the file event source will always return 0 if the -\fBTCL_FILE_EVENTS\fR bit isn't set in \fIflags\fR. -Another example of deferring events happens in Tk if -\fBTk_RestrictEvents\fR has been invoked to defer certain kinds -of window events. -.PP -.VS -When \fIproc\fR returns 1, \fBTcl_ServiceEvent\fR will remove the -event from the event queue and free its storage. -Note that the storage for an event must be allocated by -the event source (using \fBTcl_Alloc\fR or the Tcl macro \fBckalloc\fR) -before calling \fBTcl_QueueEvent\fR, but it -will be freed by \fBTcl_ServiceEvent\fR, not by the event source. -.PP -\fBTcl_DeleteEvents\fR can be used to explicitly remove one or more -events from the event queue. \fBTcl_DeleteEvents\fR calls \fIproc\fR -for each event in the queue, deleting those for with the procedure -returns 1. Events for which the procedure returns 0 are left in the -queue. \fIProc\fR should match the following prototype: -.CS -typedef int Tcl_EventDeleteProc( - Tcl_Event *\fIevPtr\fR, - ClientData \fIclientData\fR); -.CE -The \fIclientData\fR argument will be the same as the \fIclientData\fR -argument to \fBTcl_DeleteEvents\fR; it is typically used to point to -private information managed by the event source. The \fIevPtr\fR will -point to the next event in the queue. -.VE - -.SH "CREATING A NEW NOTIFIER" -.PP -The notifier consists of all the procedures described in this manual -entry, plus \fBTcl_DoOneEvent\fR and \fBTcl_Sleep\fR, which are -.VS -available on all platforms, and \fBTcl_CreateFileHandler\fR and -\fBTcl_DeleteFileHandler\fR, which are Unix-specific. Most of these -procedures are generic, in that they are the same for all notifiers. -However, five of the procedures are notifier-dependent: -\fBTcl_SetTimer\fR, \fBTcl_Sleep\fR, \fBTcl_WaitForEvent\fR, -\fBTcl_CreateFileHandler\fR and \fBTcl_DeleteFileHandler\fR. To -support a new platform or to integrate Tcl with an -application-specific event loop, you must write new versions of these -procedures. -.PP -\fBTcl_WaitForEvent\fR is the lowest-level procedure in the notifier; -it is responsible for waiting for an ``interesting'' event to occur or -for a given time to elapse. Before \fBTcl_WaitForEvent\fR is invoked, -each of the event sources' setup procedure will have been invoked. -The \fItimePtr\fR argument to -\fBTcl_WaitForEvent\fR gives the maximum time to block for an event, -based on calls to \fBTcl_SetMaxBlockTime\fR made by setup procedures -and on other information (such as the \fBTCL_DONT_WAIT\fR bit in -\fIflags\fR). -.PP -Ideally, \fBTcl_WaitForEvent\fR should only wait for an event -to occur; it should not actually process the event in any way. -Later on, the -event sources will process the raw events and create Tcl_Events on -the event queue in their \fIcheckProc\fR procedures. -However, on some platforms (such as Windows) this isn't possible; -events may be processed in \fBTcl_WaitForEvent\fR, including queuing -Tcl_Events and more (for example, callbacks for native widgets may be -invoked). The return value from \fBTcl_WaitForEvent\fR must be either -0, 1, or \-1. On platforms such as Windows where events get processed in -\fBTcl_WaitForEvent\fR, a return value of 1 means that there may be more -events still pending that haven't been processed. This is a sign to the -caller that it must call \fBTcl_WaitForEvent\fR again if it wants all -pending events to be processed. A 0 return value means that calling -\fBTcl_WaitForEvent\fR again will not have any effect: either this is a -platform where \fBTcl_WaitForEvent\fR only waits without doing any event -processing, or \fBTcl_WaitForEvent\fR knows for sure that there are no -additional events to process (e.g. it returned because the time -elapsed). Finally, a return value of \-1 means that the event loop is -no longer operational and the application should probably unwind and -terminate. Under Windows this happens when a WM_QUIT message is received; -under Unix it happens when \fBTcl_WaitForEvent\fR would have waited -forever because there were no active event sources and the timeout was -infinite. -.PP -If the notifier will be used with an external event loop, then it must -also support the \fBTcl_SetTimer\fR interface. \fBTcl_SetTimer\fR is -invoked by \fBTcl_SetMaxBlockTime\fR whenever the maximum blocking -time has been reduced. \fBTcl_SetTimer\fR should arrange for the -external event loop to invoke \fBTcl_ServiceAll\fR after the specified -interval even if no events have occurred. This interface is needed -because \fBTcl_WaitForEvent\fR isn't invoked when there is an external -event loop. If the -notifier will only be used from \fBTcl_DoOneEvent\fR, then -\fBTcl_SetTimer\fR need not do anything. -.PP -On Unix systems, the file event source also needs support from the -notifier. The file event source consists of the -\fBTcl_CreateFileHandler\fR and \fBTcl_DeleteFileHandler\fR -procedures, which are described elsewhere. -.PP -The \fBTcl_Sleep\fR and \fBTcl_DoOneEvent\fR interfaces are described -elsewhere. -.PP -The easiest way to create a new notifier is to look at the code -for an existing notifier, such as the files \fBunix/tclUnixNotfy.c\fR -or \fBwin/tclWinNotify.c\fR in the Tcl source distribution. - -.SH "EXTERNAL EVENT LOOPS" -.PP -The notifier interfaces are designed so that Tcl can be embedded into -applications that have their own private event loops. In this case, -the application does not call \fBTcl_DoOneEvent\fR except in the case -of recursive event loops such as calls to the Tcl commands \fBupdate\fR -or \fBvwait\fR. Most of the time is spent in the external event loop -of the application. In this case the notifier must arrange for the -external event loop to call back into Tcl when something -happens on the various Tcl event sources. These callbacks should -arrange for appropriate Tcl events to be placed on the Tcl event queue. -.PP -Because the external event loop is not calling \fBTcl_DoOneEvent\fR on -a regular basis, it is up to the notifier to arrange for -\fBTcl_ServiceEvent\fR to be called whenever events are pending on the -Tcl event queue. The easiest way to do this is to invoke -\fBTcl_ServiceAll\fR at the end of each callback from the external -event loop. This will ensure that all of the event sources are -polled, any queued events are serviced, and any pending idle handlers -are processed before returning control to the application. In -addition, event sources that need to poll for events can call -\fBTcl_SetMaxBlockTime\fR to force the external event loop to call -Tcl even if no events are available on the system event queue. -.PP -As a side effect of processing events detected in the main external -event loop, Tcl may invoke \fBTcl_DoOneEvent\fR to start a recursive event -loop in commands like \fBvwait\fR. \fBTcl_DoOneEvent\fR will invoke -the external event loop, which will result in callbacks as described -in the preceding paragraph, which will result in calls to -\fBTcl_ServiceAll\fR. However, in these cases it is undesirable to -service events in \fBTcl_ServiceAll\fR. Servicing events there is -unnecessary because control will immediately return to the -external event loop and hence to \fBTcl_DoOneEvent\fR, which can -service the events itself. Furthermore, \fBTcl_DoOneEvent\fR is -supposed to service only a single event, whereas \fBTcl_ServiceAll\fR -normally services all pending events. To handle this situation, -\fBTcl_DoOneEvent\fR sets a flag for \fBTcl_ServiceAll\fR -that causes it to return without servicing any events. -This flag is called the \fIservice mode\fR; -\fBTcl_DoOneEvent\fR restores it to its previous value before it returns. -.PP -In some cases, however, it may be necessary for \fBTcl_ServiceAll\fR -to service events -even when it has been invoked from \fBTcl_DoOneEvent\fR. This happens -when there is yet another recursive event loop invoked via an -event handler called by \fBTcl_DoOneEvent\fR (such as one that is -part of a native widget). In this case, \fBTcl_DoOneEvent\fR may not -have a chance to service events so \fBTcl_ServiceAll\fR must service -them all. Any recursive event loop that calls an external event -loop rather than \fBTcl_DoOneEvent\fR must reset the service mode so -that all events get processed in \fBTcl_ServiceAll\fR. This is done -by invoking the \fBTcl_SetServiceMode\fR procedure. If -\fBTcl_SetServiceMode\fR is passed \fBTCL_SERVICE_NONE\fR, then calls -to \fBTcl_ServiceAll\fR will return immediately without processing any -events. If \fBTcl_SetServiceMode\fR is passed \fBTCL_SERVICE_ALL\fR, -then calls to \fBTcl_ServiceAll\fR will behave normally. -\fBTcl_SetServiceMode\fR returns the previous value of the service -mode, which should be restored when the recursive loop exits. -\fBTcl_GetServiceMode\fR returns the current value of the service -mode. -.VE - -.SH KEYWORDS -event, notifier, event queue, event sources, file events, timer, idle, service mode diff --git a/doc/Object.3 b/doc/Object.3 deleted file mode 100644 index 214695f..0000000 --- a/doc/Object.3 +++ /dev/null @@ -1,337 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: Object.3,v 1.3 1999/04/16 00:46:32 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Obj 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_NewObj, Tcl_DuplicateObj, Tcl_IncrRefCount, Tcl_DecrRefCount, Tcl_IsShared \- manipulate Tcl objects -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Obj * -\fBTcl_NewObj\fR() -.sp -Tcl_Obj * -\fBTcl_DuplicateObj\fR(\fIobjPtr\fR) -.sp -\fBTcl_IncrRefCount\fR(\fIobjPtr\fR) -.sp -\fBTcl_DecrRefCount\fR(\fIobjPtr\fR) -.sp -int -\fBTcl_IsShared\fR(\fIobjPtr\fR) -.sp -\fBTcl_InvalidateStringRep\fR(\fIobjPtr\fR) -.SH ARGUMENTS -.AS Tcl_Obj *objPtr in -.AP Tcl_Obj *objPtr in -Points to an object; -must have been the result of a previous call to \fBTcl_NewObj\fR. -.BE - -.SH INTRODUCTION -.PP -This man page presents an overview of Tcl objects and how they are used. -It also describes generic procedures for managing Tcl objects. -These procedures are used to create and copy objects, -and increment and decrement the count of references (pointers) to objects. -The procedures are used in conjunction with ones -that operate on specific types of objects such as -\fBTcl_GetIntFromObj\fR and \fBTcl_ListObjAppendElement\fR. -The individual procedures are described along with the data structures -they manipulate. -.PP -Tcl's \fIdual-ported\fR objects provide a general-purpose mechanism -for storing and exchanging Tcl values. -They largely replace the use of strings in Tcl. -For example, they are used to store variable values, -command arguments, command results, and scripts. -Tcl objects behave like strings but also hold an internal representation -that can be manipulated more efficiently. -For example, a Tcl list is now represented as an object -that holds the list's string representation -as well as an array of pointers to the objects for each list element. -Dual-ported objects avoid most runtime type conversions. -They also improve the speed of many operations -since an appropriate representation is immediately available. -The compiler itself uses Tcl objects to -cache the instruction bytecodes resulting from compiling scripts. -.PP -The two representations are a cache of each other and are computed lazily. -That is, each representation is only computed when necessary, -it is computed from the other representation, -and, once computed, it is saved. -In addition, a change in one representation invalidates the other one. -As an example, a Tcl program doing integer calculations can -operate directly on a variable's internal machine integer -representation without having to constantly convert -between integers and strings. -Only when it needs a string representing the variable's value, -say to print it, -will the program regenerate the string representation from the integer. -Although objects contain an internal representation, -their semantics are defined in terms of strings: -an up-to-date string can always be obtained, -and any change to the object will be reflected in that string -when the object's string representation is fetched. -Because of this representation invalidation and regeneration, -it is dangerous for extension writers to access -\fBTcl_Obj\fR fields directly. -It is better to access Tcl_Obj information using -procedures like \fBTcl_GetStringFromObj\fR and \fBTcl_GetString\fR. -.PP -Objects are allocated on the heap -and are referenced using a pointer to their \fBTcl_Obj\fR structure. -Objects are shared as much as possible. -This significantly reduces storage requirements -because some objects such as long lists are very large. -Also, most Tcl values are only read and never modified. -This is especially true for procedure arguments, -which can be shared between the caller and the called procedure. -Assignment and argument binding is done by -simply assigning a pointer to the value. -Reference counting is used to determine when it is safe to -reclaim an object's storage. -.PP -Tcl objects are typed. -An object's internal representation is controlled by its type. -Seven types are predefined in the Tcl core -including integer, double, list, and bytecode. -Extension writers can extend the set of types -by using the procedure \fBTcl_RegisterObjType\fR . - -.SH "THE TCL_OBJ STRUCTURE" -.PP -Each Tcl object is represented by a \fBTcl_Obj\fR structure -which is defined as follows. -.CS -typedef struct Tcl_Obj { - int \fIrefCount\fR; - char *\fIbytes\fR; - int \fIlength\fR; - Tcl_ObjType *\fItypePtr\fR; - union { - long \fIlongValue\fR; - double \fIdoubleValue\fR; - VOID *\fIotherValuePtr\fR; - struct { - VOID *\fIptr1\fR; - VOID *\fIptr2\fR; - } \fItwoPtrValue\fR; - } \fIinternalRep\fR; -} Tcl_Obj; -.CE -The \fIbytes\fR and the \fIlength\fR members together hold -an object's string representation, -which is a \fIcounted\fR or \fIbinary string\fR -that may contain binary data with embedded null bytes. -\fIbytes\fR points to the first byte of the string representation. -The \fIlength\fR member gives the number of bytes. -The byte array must always have a null after the last byte, -at offset \fIlength\fR; -this allows string representations that do not contain nulls -to be treated as conventional null-terminated C strings. -C programs use \fBTcl_GetStringFromObj\fR and \fBTcl_GetString\fR to get -an object's string representation. -If \fIbytes\fR is NULL, -the string representation is invalid. -.PP -An object's type manages its internal representation. -The member \fItypePtr\fR points to the Tcl_ObjType structure -that describes the type. -If \fItypePtr\fR is NULL, -the internal representation is invalid. -.PP -The \fIinternalRep\fR union member holds -an object's internal representation. -This is either a (long) integer, a double-precision floating point number, -a pointer to a value containing additional information -needed by the object's type to represent the object, -or two arbitrary pointers. -.PP -The \fIrefCount\fR member is used to tell when it is safe to free -an object's storage. -It holds the count of active references to the object. -Maintaining the correct reference count is a key responsibility -of extension writers. -Reference counting is discussed below -in the section \fBSTORAGE MANAGEMENT OF OBJECTS\fR. -.PP -Although extension writers can directly access -the members of a Tcl_Obj structure, -it is much better to use the appropriate procedures and macros. -For example, extension writers should never -read or update \fIrefCount\fR directly; -they should use macros such as -\fBTcl_IncrRefCount\fR and \fBTcl_IsShared\fR instead. -.PP -A key property of Tcl objects is that they hold two representations. -An object typically starts out containing only a string representation: -it is untyped and has a NULL \fItypePtr\fR. -An object containing an empty string or a copy of a specified string -is created using \fBTcl_NewObj\fR or \fBTcl_NewStringObj\fR respectively. -An object's string value is gotten with -\fBTcl_GetStringFromObj\fR or \fBTcl_GetString\fR -and changed with \fBTcl_SetStringObj\fR. -If the object is later passed to a procedure like \fBTcl_GetIntFromObj\fR -that requires a specific internal representation, -the procedure will create one and set the object's \fItypePtr\fR. -The internal representation is computed from the string representation. -An object's two representations are duals of each other: -changes made to one are reflected in the other. -For example, \fBTcl_ListObjReplace\fR will modify an object's -internal representation and the next call to \fBTcl_GetStringFromObj\fR -or \fBTcl_GetString\fR will reflect that change. -.PP -Representations are recomputed lazily for efficiency. -A change to one representation made by a procedure -such as \fBTcl_ListObjReplace\fR is not reflected immediately -in the other representation. -Instead, the other representation is marked invalid -so that it is only regenerated if it is needed later. -Most C programmers never have to be concerned with how this is done -and simply use procedures such as \fBTcl_GetBooleanFromObj\fR or -\fBTcl_ListObjIndex\fR. -Programmers that implement their own object types -must check for invalid representations -and mark representations invalid when necessary. -The procedure \fBTcl_InvalidateStringRep\fR is used -to mark an object's string representation invalid and to -free any storage associated with the old string representation. -.PP -Objects usually remain one type over their life, -but occasionally an object must be converted from one type to another. -For example, a C program might build up a string in an object -with repeated calls to \fBTcl_AppendToObj\fR, -and then call \fBTcl_ListObjIndex\fR to extract a list element from -the object. -The same object holding the same string value -can have several different internal representations -at different times. -Extension writers can also force an object to be converted from one type -to another using the \fBTcl_ConvertToType\fR procedure. -Only programmers that create new object types need to be concerned -about how this is done. -A procedure defined as part of the object type's implementation -creates a new internal representation for an object -and changes its \fItypePtr\fR. -See the man page for \fBTcl_RegisterObjType\fR -to see how to create a new object type. - -.SH "EXAMPLE OF THE LIFETIME OF AN OBJECT" -.PP -As an example of the lifetime of an object, -consider the following sequence of commands: -.CS -\fBset x 123\fR -.CE -This assigns to \fIx\fR an untyped object whose -\fIbytes\fR member points to \fB123\fR and \fIlength\fR member contains 3. -The object's \fItypePtr\fR member is NULL. -.CS -\fBputs "x is $x"\fR -.CE -\fIx\fR's string representation is valid (since \fIbytes\fR is non-NULL) -and is fetched for the command. -.CS -\fBincr x\fR -.CE -The \fBincr\fR command first gets an integer from \fIx\fR's object -by calling \fBTcl_GetIntFromObj\fR. -This procedure checks whether the object is already an integer object. -Since it is not, it converts the object -by setting the object's \fIinternalRep.longValue\fR member -to the integer \fB123\fR -and setting the object's \fItypePtr\fR -to point to the integer Tcl_ObjType structure. -Both representations are now valid. -\fBincr\fR increments the object's integer internal representation -then invalidates its string representation -(by calling \fBTcl_InvalidateStringRep\fR) -since the string representation -no longer corresponds to the internal representation. -.CS -\fBputs "x is now $x"\fR -.CE -The string representation of \fIx\fR's object is needed -and is recomputed. -The string representation is now \fB124\fR. -and both representations are again valid. - -.SH "STORAGE MANAGEMENT OF OBJECTS" -.PP -Tcl objects are allocated on the heap and are shared as much as possible -to reduce storage requirements. -Reference counting is used to determine when an object is -no longer needed and can safely be freed. -An object just created by \fBTcl_NewObj\fR or \fBTcl_NewStringObj\fR -has \fIrefCount\fR 0. -The macro \fBTcl_IncrRefCount\fR increments the reference count -when a new reference to the object is created. -The macro \fBTcl_DecrRefCount\fR decrements the count -when a reference is no longer needed and, -if the object's reference count drops to zero, frees its storage. -An object shared by different code or data structures has -\fIrefCount\fR greater than 1. -Incrementing an object's reference count ensures that -it won't be freed too early or have its value change accidently. -.PP -As an example, the bytecode interpreter shares argument objects -between calling and called Tcl procedures to avoid having to copy objects. -It assigns the call's argument objects to the procedure's -formal parameter variables. -In doing so, it calls \fBTcl_IncrRefCount\fR to increment -the reference count of each argument since there is now a new -reference to it from the formal parameter. -When the called procedure returns, -the interpreter calls \fBTcl_DecrRefCount\fR to decrement -each argument's reference count. -When an object's reference count drops to zero, -\fBTcl_DecrRefCount\fR reclaims its storage. -Most command procedures do not have to be concerned about -reference counting since they use an object's value immediately -and don't retain a pointer to the object after they return. -However, if they do retain a pointer to an object in a data structure, -they must be careful to increment its reference count -since the retained pointer is a new reference. -.PP -Command procedures that directly modify objects -such as those for \fBlappend\fR and \fBlinsert\fR must be careful to -copy a shared object before changing it. -They must first check whether the object is shared -by calling \fBTcl_IsShared\fR. -If the object is shared they must copy the object -by using \fBTcl_DuplicateObj\fR; -this returns a new duplicate of the original object -that has \fIrefCount\fR 0. -If the object is not shared, -the command procedure "owns" the object and can safely modify it directly. -For example, the following code appears in the command procedure -that implements \fBlinsert\fR. -This procedure modifies the list object passed to it in \fIobjv[1]\fR -by inserting \fIobjc-3\fR new elements before \fIindex\fR. -.CS -listPtr = objv[1]; -if (Tcl_IsShared(listPtr)) { - listPtr = Tcl_DuplicateObj(listPtr); -} -result = Tcl_ListObjReplace(interp, listPtr, index, 0, (objc-3), &(objv[3])); -.CE -As another example, \fBincr\fR's command procedure -must check whether the variable's object is shared before -incrementing the integer in its internal representation. -If it is shared, it needs to duplicate the object -in order to avoid accidently changing values in other data structures. - -.SH "SEE ALSO" -Tcl_ConvertToType, Tcl_GetIntFromObj, Tcl_ListObjAppendElement, Tcl_ListObjIndex, Tcl_ListObjReplace, Tcl_RegisterObjType - -.SH KEYWORDS -internal representation, object, object creation, object type, reference counting, string representation, type conversion diff --git a/doc/ObjectType.3 b/doc/ObjectType.3 deleted file mode 100644 index df79219..0000000 --- a/doc/ObjectType.3 +++ /dev/null @@ -1,198 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: ObjectType.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_ObjType 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_RegisterObjType, Tcl_GetObjType, Tcl_AppendAllObjTypes, Tcl_ConvertToType \- manipulate Tcl object types -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_RegisterObjType\fR(\fItypePtr\fR) -.sp -Tcl_ObjType * -\fBTcl_GetObjType\fR(\fItypeName\fR) -.sp -int -\fBTcl_AppendAllObjTypes\fR(\fIinterp, objPtr\fR) -.sp -int -\fBTcl_ConvertToType\fR(\fIinterp, objPtr, typePtr\fR) -.SH ARGUMENTS -.AS Tcl_ObjType *typeName in -.AP Tcl_ObjType *typePtr in -Points to the structure containing information about the Tcl object type. -This storage must must live forever, -typically by being statically allocated. -.AP char *typeName in -The name of a Tcl object type that \fBTcl_GetObjType\fR should look up. -.AP Tcl_Interp *interp in -Interpreter to use for error reporting. -.AP Tcl_Obj *objPtr in -For \fBTcl_AppendAllObjTypes\fR, this points to the object onto which -it appends the name of each object type as a list element. -For \fBTcl_ConvertToType\fR, this points to an object that -must have been the result of a previous call to \fBTcl_NewObj\fR. -.BE - -.SH DESCRIPTION -.PP -The procedures in this man page manage Tcl object types. -The are used to register new object types, -look up types, -and force conversions from one type to another. -.PP -\fBTcl_RegisterObjType\fR registers a new Tcl object type -in the table of all object types supported by Tcl. -The argument \fItypePtr\fR points to a Tcl_ObjType structure that -describes the new type by giving its name -and by supplying pointers to four procedures -that implement the type. -If the type table already containes a type -with the same name as in \fItypePtr\fR, -it is replaced with the new type. -The Tcl_ObjType structure is described -in the section \fBTHE TCL_OBJTYPE STRUCTURE\fR below. -.PP -\fBTcl_GetObjType\fR returns a pointer to the Tcl_ObjType -with name \fItypeName\fR. -It returns NULL if no type with that name is registered. -.PP -\fBTcl_AppendAllObjTypes\fR appends the name of each object type -as a list element onto the Tcl object referenced by \fIobjPtr\fR. -The return value is \fBTCL_OK\fR unless there was an error -converting \fIobjPtr\fR to a list object; -in that case \fBTCL_ERROR\fR is returned. -.PP -\fBTcl_ConvertToType\fR converts an object from one type to another -if possible. -It creates a new internal representation for \fIobjPtr\fR -appropriate for the target type \fItypePtr\fR -and sets its \fItypePtr\fR member to that type. -Any internal representation for \fIobjPtr\fR's old type is freed. -If an error occurs during conversion, it returns \fBTCL_ERROR\fR -and leaves an error message in the result object for \fIinterp\fR -unless \fIinterp\fR is NULL. -Otherwise, it returns \fBTCL_OK\fR. -Passing a NULL \fIinterp\fR allows this procedure to be used -as a test whether the conversion can be done (and in fact was done). - -.SH "THE TCL_OBJTYPE STRUCTURE" -.PP -Extension writers can define new object types by defining four -procedures, -initializing a Tcl_ObjType structure to describe the type, -and calling \fBTcl_RegisterObjType\fR. -The \fBTcl_ObjType\fR structure is defined as follows: -.CS -typedef struct Tcl_ObjType { - char *\fIname\fR; - Tcl_FreeInternalRepProc *\fIfreeIntRepProc\fR; - Tcl_DupInternalRepProc *\fIdupIntRepProc\fR; - Tcl_UpdateStringProc *\fIupdateStringProc\fR; - Tcl_SetFromAnyProc *\fIsetFromAnyProc\fR; -} Tcl_ObjType; -.CE -.PP -The \fIname\fR member describes the name of the type, e.g. \fBint\fR. -Extension writers can look up an object type using its name -with the \fBTcl_GetObjType\fR procedure. -The remaining four members are pointers to procedures -called by the generic Tcl object code: -.PP -The \fIsetFromAnyProc\fR member contains the address of a function -called to create a valid internal representation -from an object's string representation. -.CS -typedef int (Tcl_SetFromAnyProc) (Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIobjPtr\fR); -.CE -If an internal representation can't be created from the string, -it returns \fBTCL_ERROR\fR and puts a message -describing the error in the result object for \fIinterp\fR -unless \fIinterp\fR is NULL. -If \fIsetFromAnyProc\fR is successful, -it stores the new internal representation, -sets \fIobjPtr\fR's \fItypePtr\fR member to point to -\fIsetFromAnyProc\fR's \fBTcl_ObjType\fR, and returns \fBTCL_OK\fR. -Before setting the new internal representation, -the \fIsetFromAnyProc\fR must free any internal representation -of \fIobjPtr\fR's old type; -it does this by calling the old type's \fIfreeIntRepProc\fR -if it is not NULL. -As an example, the \fIsetFromAnyProc\fR for the builtin Tcl integer type -gets an up-to-date string representation for \fIobjPtr\fR -by calling \fBTcl_GetStringFromObj\fR. -It parses the string to obtain an integer and, -if this succeeds, -stores the integer in \fIobjPtr\fR's internal representation -and sets \fIobjPtr\fR's \fItypePtr\fR member to point to the integer type's -Tcl_ObjType structure. -.PP -The \fIupdateStringProc\fR member contains the address of a function -called to create a valid string representation -from an object's internal representation. -.CS -typedef void (Tcl_UpdateStringProc) (Tcl_Obj *\fIobjPtr\fR); -.CE -\fIobjPtr\fR's \fIbytes\fR member is always NULL when it is called. -It must always set \fIbytes\fR non-NULL before returning. -We require the string representation's byte array -to have a null after the last byte, at offset \fIlength\fR; -this allows string representations that do not contain null bytes -to be treated as conventional null character-terminated C strings. -Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR. -Note that \fIupdateStringProc\fRs must allocate -enough storage for the string's bytes and the terminating null byte. -The \fIupdateStringProc\fR for Tcl's builtin list type, for example, -builds an array of strings for each element object -and then calls \fBTcl_Merge\fR -to construct a string with proper Tcl list structure. -It stores this string as the list object's string representation. -.PP -The \fIdupIntRepProc\fR member contains the address of a function -called to copy an internal representation from one object to another. -.CS -typedef void (Tcl_DupInternalRepProc) (Tcl_Obj *\fIsrcPtr\fR, Tcl_Obj *\fIdupPtr\fR); -.CE -\fIdupPtr\fR's internal representation is made a copy of \fIsrcPtr\fR's -internal representation. -Before the call, -\fIsrcPtr\fR's internal representation is valid and \fIdupPtr\fR's is not. -\fIsrcPtr\fR's object type determines what -copying its internal representation means. -For example, the \fIdupIntRepProc\fR for the Tcl integer type -simply copies an integer. -The builtin list type's \fIdupIntRepProc\fR -allocates a new array that points at the original element objects; -the elements are shared between the two lists -(and their reference counts are incremented to reflect the new references). -.PP -The \fIfreeIntRepProc\fR member contains the address of a function -that is called when an object is freed. -.CS -typedef void (Tcl_FreeInternalRepProc) (Tcl_Obj *\fIobjPtr\fR); -.CE -The \fIfreeIntRepProc\fR function can deallocate the storage -for the object's internal representation -and do other type-specific processing necessary when an object is freed. -For example, Tcl list objects have an \fIinternalRep.otherValuePtr\fR -that points to an array of pointers to each element in the list. -The list type's \fIfreeIntRepProc\fR decrements -the reference count for each element object -(since the list will no longer refer to those objects), -then deallocates the storage for the array of pointers. -The \fIfreeIntRepProc\fR member can be set to NULL -to indicate that the internal representation does not require freeing. - -.SH "SEE ALSO" -Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount - -.SH KEYWORDS -internal representation, object, object type, string representation, type conversion diff --git a/doc/OpenFileChnl.3 b/doc/OpenFileChnl.3 deleted file mode 100644 index e9205e3..0000000 --- a/doc/OpenFileChnl.3 +++ /dev/null @@ -1,566 +0,0 @@ -'\" -'\" Copyright (c) 1996-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: OpenFileChnl.3,v 1.3 1999/04/16 00:46:32 stanton Exp $ -.so man.macros -.TH Tcl_OpenFileChannel 3 8.1 Tcl "Tcl Library Procedures" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -Tcl_OpenFileChannel, Tcl_OpenCommandChannel, Tcl_MakeFileChannel, Tcl_GetChannel, Tcl_RegisterChannel, Tcl_UnregisterChannel, Tcl_Close, Tcl_ReadChars, Tcl_Read, Tcl_GetsObj, Tcl_Gets, Tcl_WriteObj, Tcl_WriteChars, Tcl_Write, Tcl_Flush, Tcl_Seek, Tcl_Tell, Tcl_GetChannelOption, Tcl_SetChannelOption, Tcl_Eof, Tcl_InputBlocked, Tcl_InputBuffered, \- buffered I/O facilities using channels -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -typedef ... Tcl_Channel; -.sp -Tcl_Channel -\fBTcl_OpenFileChannel\fR(\fIinterp, fileName, mode, permissions\fR) -.sp -Tcl_Channel -\fBTcl_OpenCommandChannel\fR(\fIinterp, argc, argv, flags\fR) -.VS 8.0 -.sp -Tcl_Channel -\fBTcl_MakeFileChannel\fR(\fIhandle, readOrWrite\fR) -.VE -.sp -Tcl_Channel -\fBTcl_GetChannel\fR(\fIinterp, channelName, modePtr\fR) -.sp -void -\fBTcl_RegisterChannel\fR(\fIinterp, channel\fR) -.sp -int -\fBTcl_UnregisterChannel\fR(\fIinterp, channel\fR) -.sp -int -\fBTcl_Close\fR(\fIinterp, channel\fR) -.sp -.VS 8.1 -int -\fBTcl_ReadChars\fR(\fIchannel, readObjPtr, charsToRead, appendFlag\fR) -.sp -int -\fBTcl_Read\fR(\fIchannel, byteBuf, bytesToRead\fR) -.sp -int -\fBTcl_GetsObj\fR(\fIchannel, lineObjPtr\fR) -.sp -int -\fBTcl_Gets\fR(\fIchannel, lineRead\fR) -.sp -int -\fBTcl_WriteObj\fR(\fIchannel, writeObjPtr\fR) -.sp -int -\fBTcl_WriteChars\fR(\fIchannel, charBuf, bytesToWrite\fR) -.sp -int -\fBTcl_Write\fR(\fIchannel, byteBuf, bytesToWrite\fR) -.VE -.sp -int -\fBTcl_Flush\fR(\fIchannel\fR) -.sp -int -\fBTcl_Seek\fR(\fIchannel, offset, seekMode\fR) -.sp -int -\fBTcl_Tell\fR(\fIchannel\fR) -.sp -int -\fBTcl_GetChannelOption\fR(\fIinterp, channel, optionName, optionValue\fR) -.sp -int -\fBTcl_SetChannelOption\fR(\fIinterp, channel, optionName, newValue\fR) -.sp -int -\fBTcl_Eof\fR(\fIchannel\fR) -.sp -int -\fBTcl_InputBlocked\fR(\fIchannel\fR) -.sp -int -\fBTcl_InputBuffered\fR(\fIchannel\fR) -.sp -.SH ARGUMENTS -.AS Tcl_ChannelType newClientProcPtr in -.AP Tcl_Interp *interp in -Used for error reporting and to look up a channel registered in it. -.AP char *fileName in -The name of a local or network file. -.AP char *mode in -Specifies how the file is to be accessed. May have any of the values -allowed for the \fImode\fR argument to the Tcl \fBopen\fR command. For -\fBTcl_OpenCommandChannel\fR, may be NULL. -.AP int permissions in -POSIX-style permission flags such as 0644. If a new file is created, these -permissions will be set on the created file. -.AP int argc in -The number of elements in \fIargv\fR. -.AP char **argv in -Arguments for constructing a command pipeline. These values have the same -meaning as the non-switch arguments to the Tcl \fBexec\fR command. -.AP int flags in -Specifies the disposition of the stdio handles in pipeline: OR-ed -combination of \fBTCL_STDIN\fR, \fBTCL_STDOUT\fR, \fBTCL_STDERR\fR, and -\fBTCL_ENFORCE_MODE\fR. If \fBTCL_STDIN\fR is set, stdin for the first child -in the pipe is the pipe channel, otherwise it is the same as the standard -input of the invoking process; likewise for \fBTCL_STDOUT\fR and -\fBTCL_STDERR\fR. If \fBTCL_ENFORCE_MODE\fR is not set, then the pipe can -redirect stdio handles to override the stdio handles for which -\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set. If it -is set, then such redirections cause an error. -.VS 8.0 -.AP ClientData handle in -Operating system specific handle for I/O to a file. For Unix this is a -file descriptor, for Windows it is a HANDLE. -.AP int readOrWrite in -OR-ed combination of \fBTCL_READABLE\fR and \fBTCL_WRITABLE\fR to indicate -what operations are valid on \fIhandle\fR. -.AP char *channelName in -The name of the channel. -.VE -.AP int *modePtr out -Points at an integer variable that will receive an OR-ed combination of -\fBTCL_READABLE\fR and \fBTCL_WRITABLE\fR denoting whether the channel is -open for reading and writing. -.AP Tcl_Channel channel in -A Tcl channel for input or output. Must have been the return value -from a procedure such as \fBTcl_OpenFileChannel\fR. -.VS 8.1 br -.AP Tcl_Obj *readObjPtr in/out -A pointer to a Tcl Object in which to store the characters read from the -channel. -.AP int charsToRead in -The number of characters to read from the channel. If the channel's encoding -is \fBbinary\fR, this is equivalent to the number of bytes to read from the -channel. -.AP int appendFlag in -If non-zero, data read from the channel will be appended to the object. -Otherwise, the data will replace the existing contents of the object. -.AP char *readBuf out -A buffer in which to store the bytes read from the channel. -.AP int bytesToRead in -The number of bytes to read from the channel. The buffer \fIreadBuf\fR must -be large enough to hold this many bytes. -.AP Tcl_Obj *lineObjPtr in/out -A pointer to a Tcl object in which to store the line read from the -channel. The line read will be appended to the current value of the -object. -.AP Tcl_DString *lineRead in/out -A pointer to a Tcl dynamic string in which to store the line read from the -channel. Must have been initialized by the caller. The line read will be -appended to any data already in the dynamic string. -.AP Tcl_Obj *writeObjPtr in -A pointer to a Tcl Object whose contents will be output to the channel. -.AP "CONST char" *charBuf in -A buffer containing the characters to output to the channel. -.AP char *byteBuf in -A buffer containing the bytes to output to the channel. -.AP int bytesToWrite in -The number of bytes to consume from \fIcharBuf\fR or \fIbyteBuf\fR and -output to the channel. -.VE -.AP int offset in -How far to move the access point in the channel at which the next input or -output operation will be applied, measured in bytes from the position -given by \fIseekMode\fR. May be either positive or negative. -.AP int seekMode in -Relative to which point to seek; used with \fIoffset\fR to calculate the new -access point for the channel. Legal values are \fBSEEK_SET\fR, -\fBSEEK_CUR\fR, and \fBSEEK_END\fR. -.AP char *optionName in -The name of an option applicable to this channel, such as \fB\-blocking\fR. -May have any of the values accepted by the \fBfconfigure\fR command. -.AP Tcl_DString *optionValue in -Where to store the value of an option or a list of all options and their -values. Must have been initialized by the caller. -.AP char *newValue in -New value for the option given by \fIoptionName\fR. -.BE - -.SH DESCRIPTION -.PP -The Tcl channel mechanism provides a device-independent and -platform-independent mechanism for performing buffered input -and output operations on a variety of file, socket, and device -types. -The channel mechanism is extensible to new channel types, by -providing a low level channel driver for the new type; the channel driver -interface is described in the manual entry for \fBTcl_CreateChannel\fR. The -channel mechanism provides a buffering scheme modeled after -Unix's standard I/O, and it also allows for nonblocking I/O on -channels. -.PP -The procedures described in this manual entry comprise the C APIs of the -generic layer of the channel architecture. For a description of the channel -driver architecture and how to implement channel drivers for new types of -channels, see the manual entry for \fBTcl_CreateChannel\fR. - -.SH TCL_OPENFILECHANNEL -.PP -\fBTcl_OpenFileChannel\fR opens a file specified by \fIfileName\fR and -returns a channel handle that can be used to perform input and output on -the file. This API is modeled after the \fBfopen\fR procedure of -the Unix standard I/O library. -The syntax and meaning of all arguments is similar to those -given in the Tcl \fBopen\fR command when opening a file. -If an error occurs while opening the channel, \fBTcl_OpenFileChannel\fR -returns NULL and records a POSIX error code that can be -retrieved with \fBTcl_GetErrno\fR. -In addition, if \fIinterp\fR is non-NULL, \fBTcl_OpenFileChannel\fR -leaves an error message in \fIinterp\fR's result after any error. -.PP -The newly created channel is not registered in the supplied interpreter; to -register it, use \fBTcl_RegisterChannel\fR, described below. -If one of the standard channels, \fBstdin, stdout\fR or \fBstderr\fR was -previously closed, the act of creating the new channel also assigns it as a -replacement for the standard channel. - -.SH TCL_OPENCOMMANDCHANNEL -.PP -\fBTcl_OpenCommandChannel\fR provides a C-level interface to the -functions of the \fBexec\fR and \fBopen\fR commands. -It creates a sequence of subprocesses specified -by the \fIargv\fR and \fIargc\fR arguments and returns a channel that can -be used to communicate with these subprocesses. -The \fIflags\fR argument indicates what sort of communication will -exist with the command pipeline. -.PP -If the \fBTCL_STDIN\fR flag is set then the standard input for the -first subprocess will be tied to the channel: writing to the channel -will provide input to the subprocess. If \fBTCL_STDIN\fR is not set, -then standard input for the first subprocess will be the same as this -application's standard input. If \fBTCL_STDOUT\fR is set then -standard output from the last subprocess can be read from the channel; -otherwise it goes to this application's standard output. If -\fBTCL_STDERR\fR is set, standard error output for all subprocesses is -returned to the channel and results in an error when the channel is -closed; otherwise it goes to this application's standard error. If -\fBTCL_ENFORCE_MODE\fR is not set, then \fIargc\fR and \fIargv\fR can -redirect the stdio handles to override \fBTCL_STDIN\fR, -\fBTCL_STDOUT\fR, and \fBTCL_STDERR\fR; if it is set, then it is an -error for argc and argv to override stdio channels for which -\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR, and \fBTCL_STDERR\fR have been set. -.PP -If an error occurs while opening the channel, \fBTcl_OpenCommandChannel\fR -returns NULL and records a POSIX error code that can be retrieved with -\fBTcl_GetErrno\fR. -In addition, \fBTcl_OpenCommandChannel\fR leaves an error message in -\fIinterp->result\fR if \fIinterp\fR is not NULL. -.PP -The newly created channel is not registered in the supplied interpreter; to -register it, use \fBTcl_RegisterChannel\fR, described below. -If one of the standard channels, \fBstdin, stdout\fR or \fBstderr\fR was -previously closed, the act of creating the new channel also assigns it as a -replacement for the standard channel. - -.SH TCL_MAKEFILECHANNEL -.PP -\fBTcl_MakeFileChannel\fR makes a \fBTcl_Channel\fR from an existing, -platform-specific, file handle. -The newly created channel is not registered in the supplied interpreter; to -register it, use \fBTcl_RegisterChannel\fR, described below. -If one of the standard channels, \fBstdin, stdout\fR or \fBstderr\fR was -previously closed, the act of creating the new channel also assigns it as a -replacement for the standard channel. - -.SH TCL_GETCHANNEL -.PP -\fBTcl_GetChannel\fR returns a channel given the \fIchannelName\fR used to -create it with \fBTcl_CreateChannel\fR and a pointer to a Tcl interpreter in -\fIinterp\fR. If a channel by that name is not registered in that interpreter, -the procedure returns NULL. If the \fImode\fR argument is not NULL, it -points at an integer variable that will receive an OR-ed combination of -\fBTCL_READABLE\fR and \fBTCL_WRITABLE\fR describing whether the channel is -open for reading and writing. - -.SH TCL_REGISTERCHANNEL -.PP -\fBTcl_RegisterChannel\fR adds a channel to the set of channels accessible -in \fIinterp\fR. After this call, Tcl programs executing in that -interpreter can refer to the channel in input or output operations using -the name given in the call to \fBTcl_CreateChannel\fR. After this call, -the channel becomes the property of the interpreter, and the caller should -not call \fBTcl_Close\fR for the channel; the channel will be closed -automatically when it is unregistered from the interpreter. -.PP -Code executing outside of any Tcl interpreter can call -\fBTcl_RegisterChannel\fR with \fIinterp\fR as NULL, to indicate that it -wishes to hold a reference to this channel. Subsequently, the channel can -be registered in a Tcl interpreter and it will only be closed when the -matching number of calls to \fBTcl_UnregisterChannel\fR have been made. -This allows code executing outside of any interpreter to safely hold a -reference to a channel that is also registered in a Tcl interpreter. - -.SH TCL_UNREGISTERCHANNEL -.PP -\fBTcl_UnregisterChannel\fR removes a channel from the set of channels -accessible in \fIinterp\fR. After this call, Tcl programs will no longer be -able to use the channel's name to refer to the channel in that interpreter. -If this operation removed the last registration of the channel in any -interpreter, the channel is also closed and destroyed. -.PP -Code not associated with a Tcl interpreter can call -\fBTcl_UnregisterChannel\fR with \fIinterp\fR as NULL, to indicate to Tcl -that it no longer holds a reference to that channel. If this is the last -reference to the channel, it will now be closed. - -.SH TCL_CLOSE -.PP -\fBTcl_Close\fR destroys the channel \fIchannel\fR, which must denote a -currently open channel. The channel should not be registered in any -interpreter when \fBTcl_Close\fR is called. Buffered output is flushed to -the channel's output device prior to destroying the channel, and any -buffered input is discarded. If this is a blocking channel, the call does -not return until all buffered data is successfully sent to the channel's -output device. If this is a nonblocking channel and there is buffered -output that cannot be written without blocking, the call returns -immediately; output is flushed in the background and the channel will be -closed once all of the buffered data has been output. In this case errors -during flushing are not reported. -.PP -If the channel was closed successfully, \fBTcl_Close\fR returns \fBTCL_OK\fR. -If an error occurs, \fBTcl_Close\fR returns \fBTCL_ERROR\fR and records a -POSIX error code that can be retrieved with \fBTcl_GetErrno\fR. -If the channel is being closed synchronously and an error occurs during -closing of the channel and \fIinterp\fR is not NULL, an error message is -left in \fIinterp->result\fR. -.PP -Note: it is not safe to call \fBTcl_Close\fR on a channel that has been -registered using \fBTcl_RegisterChannel\fR; see the documentation for -\fBTcl_RegisterChannel\fR, above, for details. If the channel has ever -been given as the \fBchan\fR argument in a call to -\fBTcl_RegisterChannel\fR, you should instead use -\fBTcl_UnregisterChannel\fR, which will internally call \fBTcl_Close\fR -when all calls to \fBTcl_RegisterChannel\fR have been matched by -corresponding calls to \fBTcl_UnregisterChannel\fR. - -.VS 8.1 br -.SH TCL_READCHARS AND TCL_READ -.PP -\fBTcl_ReadChars\fR consumes bytes from \fIchannel\fR, converting the bytes -to UTF-8 based on the channel's encoding and storing the produced data in -\fIreadObjPtr\fR's string representation. The return value of -\fBTcl_ReadChars\fR is the number of characters, up to \fIcharsToRead\fR, -that were stored in \fIobjPtr\fR. If an error occurs while reading, the -return value is \-1 and \fBTcl_ReadChars\fR records a POSIX error code that -can be retrieved with \fBTcl_GetErrno\fR. -.PP -The return value may be smaller than the value to read, indicating that less -data than requested was available. This is called a \fIshort read\fR. In -blocking mode, this can only happen on an end-of-file. In nonblocking mode, -a short read can also occur if there is not enough input currently -available: \fBTcl_ReadChars\fR returns a short count rather than waiting -for more data. -.PP -If the channel is in blocking mode, a return value of zero indicates an -end-of-file condition. If the channel is in nonblocking mode, a return -value of zero indicates either that no input is currently available or an -end-of-file condition. Use \fBTcl_Eof\fR and \fBTcl_InputBlocked\fR to tell -which of these conditions actually occurred. -.PP -\fBTcl_ReadChars\fR translates the various end-of-line representations into -the canonical \fB\en\fR internal representation according to the current -end-of-line recognition mode. End-of-line recognition and the various -platform-specific modes are described in the manual entry for the Tcl -\fBfconfigure\fR command. -.PP -As a performance optimization, when reading from a channel with the encoding -\fBbinary\fR, the bytes are not converted to UTF-8 as they are read. -Instead, they are stored in \fIreadObjPtr\fR's internal representation as a -byte-array object. The string representation of this object will only be -constructed if it is needed (e.g., because of a call to -\fBTcl_GetStringFromObj\fR). In this way, byte-oriented data can be read -from a channel, manipulated by calling \fBTcl_GetByteArrayFromObj\fR and -related functions, and then written to a channel without the expense of ever -converting to or from UTF-8. -.PP -\fBTcl_Read\fR is similar to \fBTcl_ReadChars\fR, except that it doesn't do -encoding conversions, regardless of the channel's encoding. It is deprecated -and exists for backwards compatibility with non-internationalized Tcl -extensions. It consumes bytes from \fIchannel\fR and stores them in -\fIbuf\fR, performing end-of-line translations on the way. The return value -of \fBTcl_Read\fR is the number of bytes, up to \fItoRead\fR, written in -\fIbuf\fR. The buffer produced by \fBTcl_Read\fR is not NULL terminated. -Its contents are valid from the zeroth position up to and excluding the -position indicated by the return value. - -.SH TCL_GETSOBJ AND TCL_GETS -.PP -\fBTcl_GetsObj\fR consumes bytes from \fIchannel\fR, converting the bytes to -UTF-8 based on the channel's encoding, until a full line of input has been -seen. If the channel's encoding is \fBbinary\fR, each byte read from the -channel is treated as an individual Unicode character. All of the -characters of the line except for the terminating end-of-line character(s) -are appended to \fIlineObjPtr\fR's string representation. The end-of-line -character(s) are read and discarded. -.PP -If a line was successfully read, the return value is greater than or equal -to zero and indicates the number of bytes stored in \fIlineObjPtr\fR. If an -error occurs, \fBTcl_GetsObj\fR returns \-1 and records a POSIX error code -that can be retrieved with \fBTcl_GetErrno\fR. \fBTcl_GetsObj\fR also -returns \-1 if the end of the file is reached; the \fBTcl_Eof\fR procedure -can be used to distinguish an error from an end-of-file condition. -.PP -If the channel is in nonblocking mode, the return value can also be \-1 if -no data was available or the data that was available did not contain an -end-of-line character. When \-1 is returned, the \fBTcl_InputBlocked\fR -procedure may be invoked to determine if the channel is blocked because -of input unavailability. -.PP -\fBTcl_Gets\fR is the same as \fBTcl_GetsObj\fR except the resulting -characters are appended to the appended to the dynamic string given by -\fIdsPtr\fR rather than a Tcl object. - -.SH TCL_WRITECHARS, TCL_WRITEOBJ, AND TCL_WRITE -.PP -\fBTcl_WriteChars\fR accepts \fIbytesToWrite\fR bytes of character data at -\fIcharBuf\fR. The UTF-8 characters in the buffer are converted to the -channel's encoding and queued for output to \fIchannel\fR. If -\fIbytesToWrite\fR is negative, \fBTcl_WriteChars\fR expects \fIcharBuf\fR -to be NULL terminated and it outputs everything up to the NULL. -.PP -Data queued for output may not appear on the output device immediately, due -to internal buffering. If the data should appear immediately, call -\fBTcl_Flush\fR after the call to \fBTcl_WriteChars\fR, or set the -\fB\-buffering\fR option on the channel to \fBnone\fR. If you wish the data -to appear as soon as a complete line is accepted for output, set the -\fB\-buffering\fR option on the channel to \fBline\fR mode. -.PP -The return value of \fBTcl_WriteChars\fR is a count of how many bytes were -accepted for output to the channel. This is either greater than zero to -indicate success or \-1 to indicate that an error occurred. If an error -occurs, \fBTcl_WriteChars\fR records a POSIX error code that may be -retrieved with \fBTcl_GetErrno\fR. -.PP -Newline characters in the output data are translated to platform-specific -end-of-line sequences according to the \fB\-translation\fR option for the -channel. This is done even if the channel has no encoding. -.PP -\fBTcl_WriteObj\fR is similar to \fBTcl_WriteChars\fR except it -accepts a Tcl object whose contents will be output to the channel. The -UTF-8 characters in \fIwriteObjPtr\fR's string representation are converted -to the channel's encoding and queued for output to \fIchannel\fR. -As a performance optimization, when writing to a channel with the encoding -\fBbinary\fR, UTF-8 characters are not converted as they are written. -Instead, the bytes in \fIwriteObjPtr\fR's internal representation as a -byte-array object are written to the channel. The byte-array representation -of the object will be constructed if it is needed. In this way, -byte-oriented data can be read from a channel, manipulated by calling -\fBTcl_GetByteArrayFromObj\fR and related functions, and then written to a -channel without the expense of ever converting to or from UTF-8. -.PP -\fBTcl_Write\fR is similar to \fBTcl_WriteChars\fR except that it doesn't do -encoding conversions, regardless of the channel's encoding. It is -deprecated and exists for backwards compatibility with non-internationalized -Tcl extensions. It accepts \fIbytesToWrite\fR bytes of data at -\fIbyteBuf\fR and queues them for output to \fIchannel\fR. If -\fIbytesToWrite\fR is negative, \fBTcl_Write\fR expects \fIbyteBuf\fR to be -NULL terminated and it outputs everything up to the NULL. -.VE - -.SH TCL_FLUSH -.PP -\fBTcl_Flush\fR causes all of the buffered output data for \fIchannel\fR -to be written to its underlying file or device as soon as possible. -If the channel is in blocking mode, the call does not return until -all the buffered data has been sent to the channel or some error occurred. -The call returns immediately if the channel is nonblocking; it starts -a background flush that will write the buffered data to the channel -eventually, as fast as the channel is able to absorb it. -.PP -The return value is normally \fBTCL_OK\fR. -If an error occurs, \fBTcl_Flush\fR returns \fBTCL_ERROR\fR and -records a POSIX error code that can be retrieved with \fBTcl_GetErrno\fR. - -.SH TCL_SEEK -.PP -\fBTcl_Seek\fR moves the access point in \fIchannel\fR where subsequent -data will be read or written. Buffered output is flushed to the channel and -buffered input is discarded, prior to the seek operation. -.PP -\fBTcl_Seek\fR normally returns the new access point. -If an error occurs, \fBTcl_Seek\fR returns \-1 and records a POSIX error -code that can be retrieved with \fBTcl_GetErrno\fR. -After an error, the access point may or may not have been moved. - -.SH TCL_TELL -.PP -\fBTcl_Tell\fR returns the current access point for a channel. The returned -value is \-1 if the channel does not support seeking. - -.SH TCL_GETCHANNELOPTION -.PP -\fBTcl_GetChannelOption\fR retrieves, in \fIdsPtr\fR, the value of one of -the options currently in effect for a channel, or a list of all options and -their values. The \fIchannel\fR argument identifies the channel for which -to query an option or retrieve all options and their values. -If \fIoptionName\fR is not NULL, it is the name of the -option to query; the option's value is copied to the Tcl dynamic string -denoted by \fIoptionValue\fR. If -\fIoptionName\fR is NULL, the function stores an alternating list of option -names and their values in \fIoptionValue\fR, using a series of calls to -\fBTcl_DStringAppendElement\fR. The various preexisting options and -their possible values are described in the manual entry for the Tcl -\fBfconfigure\fR command. Other options can be added by each channel type. -These channel type specific options are described in the manual entry for -the Tcl command that creates a channel of that type; for example, the -additional options for TCP based channels are described in the manual entry -for the Tcl \fBsocket\fR command. -The procedure normally returns \fBTCL_OK\fR. If an error occurs, it returns -\fBTCL_ERROR\fR and calls \fBTcl_SetErrno\fR to store an appropriate POSIX -error code. - -.SH TCL_SETCHANNELOPTION -.PP -\fBTcl_SetChannelOption\fR sets a new value for an option on \fIchannel\fR. -\fIOptionName\fR is the option to set and \fInewValue\fR is the value to -set. -The procedure normally returns \fBTCL_OK\fR. If an error occurs, -it returns \fBTCL_ERROR\fR; in addition, if \fIinterp\fR is non-NULL, -\fBTcl_SetChannelOption\fR leaves an error message in \fIinterp->result\fR. - -.SH TCL_EOF -.PP -\fBTcl_Eof\fR returns a nonzero value if \fIchannel\fR encountered -an end of file during the last input operation. - -.SH TCL_INPUTBLOCKED -.PP -\fBTcl_InputBlocked\fR returns a nonzero value if \fIchannel\fR is in -nonblocking mode and the last input operation returned less data than -requested because there was insufficient data available. -The call always returns zero if the channel is in blocking mode. - -.SH TCL_INPUTBUFFERED -.PP -\fBTcl_InputBuffered\fR returns the number of bytes of input currently -buffered in the internal buffers for a channel. If the channel is not open -for reading, this function always returns zero. - -.VS 8.0 -.SH "PLATFORM ISSUES" -.PP -The handles returned from \fBTcl_GetChannelHandle\fR depend on the -platform and the channel type. On Unix platforms, the handle is -always a Unix file descriptor as returned from the \fBopen\fR system -call. On Windows platforms, the handle is a file \fBHANDLE\fR when -the channel was created with \fBTcl_OpenFileChannel\fR, -\fBTcl_OpenCommandChannel\fR, or \fBTcl_MakeFileChannel\fR. Other -channel types may return a different type of handle on Windows -platforms. On the Macintosh platform, the handle is a file reference -number as returned from \fBHOpenDF\fR. -.VE - -.SH "SEE ALSO" -DString(3), fconfigure(n), filename(n), fopen(2), Tcl_CreateChannel(3) - -.SH KEYWORDS -access point, blocking, buffered I/O, channel, channel driver, end of file, -flush, input, nonblocking, output, read, seek, write diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3 deleted file mode 100644 index 6f5da00..0000000 --- a/doc/OpenTcp.3 +++ /dev/null @@ -1,179 +0,0 @@ -'\" -'\" Copyright (c) 1996-7 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: OpenTcp.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -.so man.macros -.TH Tcl_OpenTcpClient 3 8.0 Tcl "Tcl Library Procedures" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer \- procedures to open channels using TCP sockets -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Channel -\fBTcl_OpenTcpClient\fR(\fIinterp, port, host, myaddr, myport, async\fR) -.sp -Tcl_Channel -\fBTcl_MakeTcpClientChannel\fR(\fIsock\fR) -.sp -Tcl_Channel -\fBTcl_OpenTcpServer\fR(\fIinterp, port, myaddr, proc, clientData\fR) -.sp -.SH ARGUMENTS -.AS Tcl_ChannelType newClientProcPtr in -.AP Tcl_Interp *interp in -Tcl interpreter to use for error reporting. If non-NULL and an -error occurs, an error message is left in \fIinterp->result\fR. -.AP int port in -A port number to connect to as a client or to listen on as a server. -.AP char *host in -A string specifying a host name or address for the remote end of the connection. -.AP int myport in -A port number for the client's end of the socket. If 0, a port number -is allocated at random. -.AP char *myaddr in -A string specifying the host name or address for network interface to use -for the local end of the connection. If NULL, a default interface is -chosen. -.AP int async in -If nonzero, the client socket is connected asynchronously to the server. -.AP ClientData sock in -Platform-specific handle for client TCP socket. -.AP Tcl_TcpAcceptProc *proc in -Pointer to a procedure to invoke each time a new connection is -accepted via the socket. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -These functions are convenience procedures for creating -channels that communicate over TCP sockets. -The operations on a channel -are described in the manual entry for \fBTcl_OpenFileChannel\fR. - -.SH TCL_OPENTCPCLIENT -.PP -\fBTcl_OpenTcpClient\fR opens a client TCP socket connected to a \fIport\fR -on a specific \fIhost\fR, and returns a channel that can be used to -communicate with the server. The host to connect to can be specified either -as a domain name style name (e.g. \fBwww.sunlabs.com\fR), or as a string -containing the alphanumeric representation of its four-byte address (e.g. -\fB127.0.0.1\fR). Use the string \fBlocalhost\fR to connect to a TCP socket on -the host on which the function is invoked. -.PP -The \fImyaddr\fR and \fImyport\fR arguments allow a client to specify an -address for the local end of the connection. If \fImyaddr\fR is NULL, then -an interface is chosen automatically by the operating system. -If \fImyport\fR is 0, then a port number is chosen at random by -the operating system. -.PP -If \fIasync\fR is zero, the call to \fBTcl_OpenTcpClient\fR returns only -after the client socket has either successfully connected to the server, or -the attempted connection has failed. -If \fIasync\fR is nonzero the socket is connected asynchronously and the -returned channel may not yet be connected to the server when the call to -\fBTcl_OpenTcpClient\fR returns. If the channel is in blocking mode and an -input or output operation is done on the channel before the connection is -completed or fails, that operation will wait until the connection either -completes successfully or fails. If the channel is in nonblocking mode, the -input or output operation will return immediately and a subsequent call to -\fBTcl_InputBlocked\fR on the channel will return nonzero. -.PP -The returned channel is opened for reading and writing. -If an error occurs in opening the socket, \fBTcl_OpenTcpClient\fR returns -NULL and records a POSIX error code that can be retrieved -with \fBTcl_GetErrno\fR. -In addition, if \fIinterp\fR is non-NULL, an error message -is left in \fIinterp->result\fR. -.PP -The newly created channel is not registered in the supplied interpreter; to -register it, use \fBTcl_RegisterChannel\fR. -If one of the standard channels, \fBstdin, stdout\fR or \fBstderr\fR was -previously closed, the act of creating the new channel also assigns it as a -replacement for the standard channel. - -.SH TCL_MAKETCPCLIENTCHANNEL -.PP -\fBTcl_MakeTcpClientChannel\fR creates a \fBTcl_Channel\fR around an -existing, platform specific, handle for a client TCP socket. -.PP -The newly created channel is not registered in the supplied interpreter; to -register it, use \fBTcl_RegisterChannel\fR. -If one of the standard channels, \fBstdin, stdout\fR or \fBstderr\fR was -previously closed, the act of creating the new channel also assigns it as a -replacement for the standard channel. - -.SH TCL_OPENTCPSERVER -.PP -\fBTcl_OpenTcpServer\fR opens a TCP socket on the local host on a specified -\fIport\fR and uses the Tcl event mechanism to accept requests from clients -to connect to it. The \fImyaddr\fP argument specifies the network interface. -If \fImyaddr\fP is NULL the special address INADDR_ANY should be used to -allow connections from any network interface. -Each time a client connects to this socket, Tcl creates a channel -for the new connection and invokes \fIproc\fR with information about -the channel. \fIProc\fR must match the following prototype: -.CS -typedef void Tcl_TcpAcceptProc( - ClientData \fIclientData\fR, - Tcl_Channel \fIchannel\fR, - char *\fIhostName\fR, - int \fIport\fP); -.CE -.PP -The \fIclientData\fR argument will be the same as the \fIclientData\fR -argument to \fBTcl_OpenTcpServer\fR, \fIchannel\fR will be the handle -for the new channel, \fIhostName\fR points to a string containing -the name of the client host making the connection, and \fIport\fP -will contain the client's port number. -The new channel -is opened for both input and output. -If \fIproc\fR raises an error, the connection is closed automatically. -\fIProc\fR has no return value, but if it wishes to reject the -connection it can close \fIchannel\fR. -.PP -\fBTcl_OpenTcpServer\fR normally returns a pointer to a channel -representing the server socket. -If an error occurs, \fBTcl_OpenTcpServer\fR returns NULL and -records a POSIX error code that can be retrieved with \fBTcl_GetErrno\fR. -In addition, if \fIinterp->result\fR is non-NULL, an error message -is left in \fIinterp->result\fR. -.PP -The channel returned by \fBTcl_OpenTcpServer\fR cannot be used for -either input or output. -It is simply a handle for the socket used to accept connections. -The caller can close the channel to shut down the server and disallow -further connections from new clients. -.PP -TCP server channels operate correctly only in applications that dispatch -events through \fBTcl_DoOneEvent\fR or through Tcl commands such as -\fBvwait\fR; otherwise Tcl will never notice that a connection request from -a remote client is pending. -.PP -The newly created channel is not registered in the supplied interpreter; to -register it, use \fBTcl_RegisterChannel\fR. -If one of the standard channels, \fBstdin, stdout\fR or \fBstderr\fR was -previously closed, the act of creating the new channel also assigns it as a -replacement for the standard channel. - -.VS -.SH "PLATFORM ISSUES" -.PP -On Unix platforms, the socket handle is a Unix file descriptor as -returned by the \fBsocket\fR system call. On the Windows platform, the -socket handle is a \fBSOCKET\fR as defined in the WinSock API. On the -Macintosh platform, the socket handle is a \fBStreamPtr\fR. -.VE - -.SH "SEE ALSO" -Tcl_OpenFileChannel(3), Tcl_RegisterChannel(3), vwait(n) - -.SH KEYWORDS -client, server, TCP diff --git a/doc/ParseCmd.3 b/doc/ParseCmd.3 deleted file mode 100644 index 2a180a6..0000000 --- a/doc/ParseCmd.3 +++ /dev/null @@ -1,426 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: ParseCmd.3,v 1.2 1999/04/16 00:46:32 stanton Exp $ -'\" -.so man.macros -.TH Tcl_ParseCommand 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_FreeParse, Tcl_EvalTokens \- parse Tcl scripts and expressions -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_ParseCommand\fR(\fIinterp, string, numBytes, nested, parsePtr\fR) -.sp -int -\fBTcl_ParseExpr\fR(\fIinterp, string, numBytes, parsePtr\fR) -.sp -int -\fBTcl_ParseBraces\fR(\fIinterp, string, numBytes, parsePtr, append, termPtr\fR) -.sp -int -\fBTcl_ParseQuotedString\fR(\fIinterp, string, numBytes, parsePtr, append, termPtr\fR) -.sp -int -\fBTcl_ParseVarName\fR(\fIinterp, string, numBytes, parsePtr, append\fR) -.sp -\fBTcl_FreeParse\fR(\fIusedParsePtr\fR) -.sp -Tcl_Obj * -\fBTcl_EvalTokens\fR(\fIinterp, tokenPtr, numTokens\fR) -.SH ARGUMENTS -.AS Tcl_Interp *usedParsePtr -.AP Tcl_Interp *interp out -For procedures other than \fBTcl_FreeParse\fR and \fBTcl_EvalTokens\fR, -used only for error reporting; -if NULL, then no error messages are left after errors. -For \fBTcl_EvalTokens\fR, determines the context for evaluating the -script and also is used for error reporting; must not be NULL. -.AP char *string in -Pointer to first character in string to parse. -.AP int numBytes in -Number of bytes in \fIstring\fR, not including any terminating null -character. If less than 0 then the script consists of all characters -in \fIstring\fR up to the first null character. -.AP int nested in -Non-zero means that the script is part of a command substitution so an -unquoted close bracket should be treated as a command terminator. If zero, -close brackets have no special meaning. -.AP int append in -Non-zero means that \fI*parsePtr\fR already contains valid tokens; the new -tokens should be appended to those already present. Zero means that -\fI*parsePtr\fR is uninitialized; any information in it is ignored. -This argument is normally 0. -.AP Tcl_Parse *parsePtr out -Points to structure to fill in with information about the parsed -command, expression, variable name, etc. -Any previous information in this structure -is ignored, unless \fIappend\fR is non-zero in a call to -\fBTcl_ParseBraces\fR, \fBTcl_ParseQuotedString\fR, -or \fBTcl_ParseVarName\fR. -.AP char **termPtr out -If not NULL, points to a location where -\fBTcl_ParseBraces\fR and \fBTcl_ParseQuotedString\fR -will store a pointer to the character -just after the terminating close-brace or close-quote (respectively) -if the parse was successful. -.AP Tcl_Parse *usedParsePtr in -Points to structure that was filled in by a previous call to -\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseVarName\fR, etc. -.BE - -.SH DESCRIPTION -.PP -These procedures parse Tcl commands or portions of Tcl commands such as -expressions or references to variables. -Each procedure takes a pointer to a script (or portion thereof) -and fills in the structure pointed to by \fIparsePtr\fR -with a collection of tokens describing the information that was parsed. -The procedures normally return \fBTCL_OK\fR. -However, if an error occurs then they return \fBTCL_ERROR\fR, -leave an error message in \fIinterp's\fR result -(if \fIinterp\fR is not NULL), -and leave nothing in \fIparsePtr\fR. -.PP -\fBTcl_ParseCommand\fR is a procedure that parses Tcl -scripts. Given a pointer to a script, it -parses the first command from the script. If the command was parsed -successfully, \fBTcl_ParseCommand\fR returns \fBTCL_OK\fR and fills in the -structure pointed to by \fIparsePtr\fR with information about the -structure of the command (see below for details). -If an error occurred in parsing the command then -\fBTCL_ERROR\fR is returned, an error message is left in \fIinterp\fR's -result, and no information is left at \fI*parsePtr\fR. -.PP -\fBTcl_ParseExpr\fR parses Tcl expressions. -Given a pointer to a script containing an expression, -\fBTcl_ParseCommand\fR parses the expression. -If the expression was parsed successfully, -\fBTcl_ParseExpr\fR returns \fBTCL_OK\fR and fills in the -structure pointed to by \fIparsePtr\fR with information about the -structure of the expression (see below for details). -If an error occurred in parsing the command then -\fBTCL_ERROR\fR is returned, an error message is left in \fIinterp\fR's -result, and no information is left at \fI*parsePtr\fR. -.PP -\fBTcl_ParseBraces\fR parses a string or command argument -enclosed in braces such as -\fB{hello}\fR or \fB{string \\t with \\t tabs}\fR -from the beginning of its argument \fIstring\fR. -The first character of \fIstring\fR must be \fB{\fR. -If the braced string was parsed successfully, -\fBTcl_ParseBraces\fR returns \fBTCL_OK\fR, -fills in the structure pointed to by \fIparsePtr\fR -with information about the structure of the string -(see below for details), -and stores a pointer to the character just after the terminating \fB}\fR -in the location given by \fI*termPtr\fR. -If an error occurrs while parsing the string -then \fBTCL_ERROR\fR is returned, -an error message is left in \fIinterp\fR's result, -and no information is left at \fI*parsePtr\fR or \fI*termPtr\fR. -.PP -\fBTcl_ParseQuotedString\fR parses a double-quoted string such as -\fB"sum is [expr $a+$b]"\fR -from the beginning of the argument \fIstring\fR. -The first character of \fIstring\fR must be \fB"\fR. -If the double-quoted string was parsed successfully, -\fBTcl_ParseQuotedString\fR returns \fBTCL_OK\fR, -fills in the structure pointed to by \fIparsePtr\fR -with information about the structure of the string -(see below for details), -and stores a pointer to the character just after the terminating \fB"\fR -in the location given by \fI*termPtr\fR. -If an error occurrs while parsing the string -then \fBTCL_ERROR\fR is returned, -an error message is left in \fIinterp\fR's result, -and no information is left at \fI*parsePtr\fR or \fI*termPtr\fR. -.PP -\fBTcl_ParseVarName\fR parses a Tcl variable reference such as -\fB$abc\fR or \fB$x([expr $index + 1])\fR from the beginning of its -\fIstring\fR argument. -The first character of \fIstring\fR must be \fB$\fR. -If a variable name was parsed successfully, \fBTcl_ParseVarName\fR -returns \fBTCL_OK\fR and fills in the structure pointed to by -\fIparsePtr\fR with information about the structure of the variable name -(see below for details). If an error -occurrs while parsing the command then \fBTCL_ERROR\fR is returned, an -error message is left in \fIinterp\fR's result (if \fIinterp\fR isn't -NULL), and no information is left at \fI*parsePtr\fR. -.PP -The information left at \fI*parsePtr\fR -by \fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR, -\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR -may include dynamically allocated memory. -If these five parsing procedures return \fBTCL_OK\fR -then the caller must invoke \fBTcl_FreeParse\fR to release -the storage at \fI*parsePtr\fR. -These procedures ignore any existing information in -\fI*parsePtr\fR (unless \fIappend\fR is non-zero), -so if repeated calls are being made to any of them -then \fBTcl_FreeParse\fR must be invoked once after each call. -.PP -\fBTcl_EvalTokens\fR evaluates a sequence of parse tokens from a Tcl_Parse -structure. The tokens typically consist -of all the tokens in a word or all the tokens that make up the index for -a reference to an array variable. \fBTcl_EvalTokens\fR performs the -substitutions requested by the tokens, concatenates the -resulting values, and returns the result in a new Tcl_Obj. The -reference count of the object returned as result has been -incremented, so the caller must -invoke \fBTcl_DecrRefCount\fR when it is finished with the object. -If an error occurs while evaluating the tokens (such as a reference to -a non-existent variable) then the return value is NULL and an error -message is left in \fIinterp\fR's result. - -.SH TCL_PARSE STRUCTURE -.PP -\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR, -\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR -return parse information in two data structures, Tcl_Parse and Tcl_Token: -.CS -typedef struct Tcl_Parse { - char *\fIcommentStart\fR; - int \fIcommentSize\fR; - char *\fIcommandStart\fR; - int \fIcommandSize\fR; - int \fInumWords\fR; - Tcl_Token *\fItokenPtr\fR; - int \fInumTokens\fR; - ... -} Tcl_Parse; - -typedef struct Tcl_Token { - int \fItype\fR; - char *\fIstart\fR; - int \fIsize\fR; - int \fInumComponents\fR; -} Tcl_Token; -.CE -.PP -The first five fields of a Tcl_Parse structure -are filled in only by \fBTcl_ParseCommand\fR. -These fields are not used by the other parsing procedures. -.PP -\fBTcl_ParseCommand\fR fills in a Tcl_Parse structure -with information that describes one Tcl command and any comments that -precede the command. -If there are comments, -the \fIcommentStart\fR field points to the \fB#\fR character that begins -the first comment and \fIcommentSize\fR indicates the number of bytes -in all of the comments preceding the command, including the newline -character that terminates the last comment. -If the command is not preceded by any comments, \fIcommentSize\fR is 0. -\fBTcl_ParseCommand\fR also sets the \fIcommandStart\fR field -to point to the first character of the first -word in the command (skipping any comments and leading space) and -\fIcommandSize\fR gives the total number of bytes in the command, -including the character pointed to by \fIcommandStart\fR up to and -including the newline, close bracket, or semicolon character that -terminates the command. The \fInumWords\fR field gives the -total number of words in the command. -.PP -All parsing procedures set the remaining fields, -\fItokenPtr\fR and \fInumTokens\fR. -The \fItokenPtr\fR field points to the first in an array of Tcl_Token -structures that describe the components of the entity being parsed. -The \fInumTokens\fR field gives the total number of tokens -present in the array. -Each token contains four fields. -The \fItype\fR field selects one of several token types -that are described below. The \fIstart\fR field -points to the first character in the token and the \fIsize\fR field -gives the total number of characters in the token. Some token types, -such as \fBTCL_TOKEN_WORD\fR and \fBTCL_TOKEN_VARIABLE\fR, consist of -several component tokens, which immediately follow the parent token; -the \fInumComponents\fR field describes how many of these there are. -The \fItype\fR field has one of the following values: -.TP 20 -\fBTCL_TOKEN_WORD\fR -This token ordinarily describes one word of a command -but it may also describe a quoted or braced string in an expression. -The token describes a component of the script that is -the result of concatenating together a sequence of subcomponents, -each described by a separate subtoken. -The token starts with the first non-blank -character of the component (which may be a double-quote or open brace) -and includes all characters in the component up to but not including the -space, semicolon, close bracket, close quote, or close brace that -terminates the component. The \fInumComponents\fR field counts the total -number of sub-tokens that make up the word, including sub-tokens -of \fBTCL_TOKEN_VARIABLE\fR and \fBTCL_TOKEN_BS\fR tokens. -.TP -\fBTCL_TOKEN_SIMPLE_WORD\fR -This token has the same meaning as \fBTCL_TOKEN_WORD\fR, except that -the word is guaranteed to consist of a single \fBTCL_TOKEN_TEXT\fR -sub-token. The \fInumComponents\fR field is always 1. -.TP -\fBTCL_TOKEN_TEXT\fR -The token describes a range of literal text that is part of a word. -The \fInumComponents\fR field is always 0. -.TP -\fBTCL_TOKEN_BS\fR -The token describes a backslash sequence such as \fB\en\fR or \fB\e0xa3\fR. -The \fInumComponents\fR field is always 0. -.TP -\fBTCL_TOKEN_COMMAND\fR -The token describes a command whose result result must be substituted into -the word. The token includes the square brackets that surround the -command. The \fInumComponents\fR field is always 0 (the nested command -is not parsed; call \fBTcl_ParseCommand\fR recursively if you want to -see its tokens). -.TP -\fBTCL_TOKEN_VARIABLE\fR -The token describes a variable substitution, including the -\fB$\fR, variable name, and array index (if there is one) up through the -close parenthesis that terminates the index. This token is followed -by one or more additional tokens that describe the variable name and -array index. If \fInumComponents\fR is 1 then the variable is a -scalar and the next token is a \fBTCL_TOKEN_TEXT\fR token that gives the -variable name. If \fInumComponents\fR is greater than 1 then the -variable is an array: the first sub-token is a \fBTCL_TOKEN_TEXT\fR -token giving the array name and the remaining sub-tokens are -\fBTCL_TOKEN_TEXT\fR, \fBTCL_TOKEN_BS\fR, \fBTCL_TOKEN_COMMAND\fR, and -\fBTCL_TOKEN_VARIABLE\fR tokens that must be concatenated to produce the -array index. The \fInumComponents\fR field includes nested sub-tokens -that are part of \fBTCL_TOKEN_VARIABLE\fR tokens in the array index. -.TP -\fBTCL_TOKEN_SUB_EXPR\fR -The token describes one subexpression of an expression -(or an entire expression). -A subexpression may consist of a value -such as an integer literal, variable substitution, -or parenthesized subexpression; -it may also consist of an operator and its operands. -The token starts with the first non-blank character of the subexpression -up to but not including the space, brace, close-paren, or bracket -that terminates the subexpression. -This token is followed by one or more additional tokens -that describe the subexpression. -If the first sub-token after the \fBTCL_TOKEN_SUB_EXPR\fR token -is a \fBTCL_TOKEN_OPERATOR\fR token, -the subexpression consists of an operator and its token operands. -If the operator has no operands, the subexpression consists of -just the \fBTCL_TOKEN_OPERATOR\fR token. -Each operand is described by a \fBTCL_TOKEN_SUB_EXPR\fR token. -Otherwise, the subexpression is a value described by -one of the token types \fBTCL_TOKEN_WORD\fR, \fBTCL_TOKEN_TEXT\fR, -\fBTCL_TOKEN_BS\fR, \fBTCL_TOKEN_COMMAND\fR, -\fBTCL_TOKEN_VARIABLE\fR, and \fBTCL_TOKEN_SUB_EXPR\fR. -The \fInumComponents\fR field -counts the total number of sub-tokens that make up the subexpression; -this includes the sub-tokens for any nested \fBTCL_TOKEN_SUB_EXPR\fR tokens. -.TP -\fBTCL_TOKEN_OPERATOR\fR -The token describes one operator of an expression -such as \fB&&\fR or \fBhypot\fR. -An \fBTCL_TOKEN_OPERATOR\fR token is always preceeded by a -\fBTCL_TOKEN_SUB_EXPR\fR token -that describes the operator and its operands; -the \fBTCL_TOKEN_SUB_EXPR\fR token's \fInumComponents\fR field -can be used to determine the number of operands. -A binary operator such as \fB*\fR -is followed by two \fBTCL_TOKEN_SUB_EXPR\fR tokens -that describe its operands. -A unary operator like \fB-\fR -is followed by a single \fBTCL_TOKEN_SUB_EXPR\fR token -for its operand. -If the operator is a math function such as \fBlog10\fR, -the \fBTCL_TOKEN_OPERATOR\fR token will give its name and -the following \fBTCL_TOKEN_SUB_EXPR\fR tokens will describe -its operands; -if there are no operands (as with \fBrand\fR), -no \fBTCL_TOKEN_SUB_EXPR\fR tokens follow. -There is one trinary operator, \fB?\fR, -that appears in if-then-else subexpressions -such as \fIx\fB?\fIy\fB:\fIz\fR; -in this case, the \fB?\fR \fBTCL_TOKEN_OPERATOR\fR token -is followed by three \fBTCL_TOKEN_SUB_EXPR\fR tokens for the operands -\fIx\fR, \fIy\fR, and \fIz\fR. -The \fInumComponents\fR field for a \fBTCL_TOKEN_OPERATOR\fR token -is always 0. -.PP -After \fBTcl_ParseCommand\fR returns, the first token pointed to by -the \fItokenPtr\fR field of the -Tcl_Parse structure always has type \fBTCL_TOKEN_WORD\fR or -\fBTCL_TOKEN_SIMPLE_WORD\fR. It is followed by the sub-tokens -that must be concatenated to produce the value of that word. -The next token is the \fBTCL_TOKEN_WORD\fR or \fBTCL_TOKEN_SIMPLE_WORD\fR -token for the second word, followed by sub-tokens for that -word, and so on until all \fInumWords\fR have been accounted -for. -.PP -After \fBTcl_ParseExpr\fR returns, the first token pointed to by -the \fItokenPtr\fR field of the -Tcl_Parse structure always has type \fBTCL_TOKEN_SUB_EXPR\fR. -It is followed by the sub-tokens that must be evaluated -to produce the value of the expression. -Only the token information in the Tcl_Parse structure -is modified: the \fIcommentStart\fR, \fIcommentSize\fR, -\fIcommandStart\fR, and \fIcommandSize\fR fields are not modified -by \fBTcl_ParseExpr\fR. -.PP -After \fBTcl_ParseBraces\fR returns, -the array of tokens pointed to by the \fItokenPtr\fR field of the -Tcl_Parse structure will contain a single \fBTCL_TOKEN_TEXT\fR token -if the braced string does not contain any backslash-newlines. -If the string does contain backslash-newlines, -the array of tokens will contain one or more -\fBTCL_TOKEN_TEXT\fR or \fBTCL_TOKEN_BS\fR sub-tokens -that must be concatenated to produce the value of the string. -If the braced string was just \fB{}\fR -(that is, the string was empty), -the single \fBTCL_TOKEN_TEXT\fR token will have a \fIsize\fR field -containing zero; -this ensures that at least one token appears -to describe the braced string. -Only the token information in the Tcl_Parse structure -is modified: the \fIcommentStart\fR, \fIcommentSize\fR, -\fIcommandStart\fR, and \fIcommandSize\fR fields are not modified -by \fBTcl_ParseBraces\fR. -.PP -After \fBTcl_ParseQuotedString\fR returns, -the array of tokens pointed to by the \fItokenPtr\fR field of the -Tcl_Parse structure depends on the contents of the quoted string. -It will consist of one or more \fBTCL_TOKEN_TEXT\fR, \fBTCL_TOKEN_BS\fR, -\fBTCL_TOKEN_COMMAND\fR, and \fBTCL_TOKEN_VARIABLE\fR sub-tokens. -The array always contains at least one token; -for example, if the argument \fIstring\fR is empty, -the array returned consists of a single \fBTCL_TOKEN_TEXT\fR token -with a zero \fIsize\fR field. -Only the token information in the Tcl_Parse structure -is modified: the \fIcommentStart\fR, \fIcommentSize\fR, -\fIcommandStart\fR, and \fIcommandSize\fR fields are not modified. -.PP -After \fBTcl_ParseVarName\fR returns, the first token pointed to by -the \fItokenPtr\fR field of the -Tcl_Parse structure always has type \fBTCL_TOKEN_VARIABLE\fR. It -is followed by the sub-tokens that make up the variable name as -described above. The total length of the variable name is -contained in the \fIsize\fR field of the first token. -As in \fBTcl_ParseExpr\fR, -only the token information in the Tcl_Parse structure -is modified by \fBTcl_ParseVarName\fR: -the \fIcommentStart\fR, \fIcommentSize\fR, -\fIcommandStart\fR, and \fIcommandSize\fR fields are not modified. -.PP -All of the character pointers in the -Tcl_Parse and Tcl_Token structures refer -to characters in the \fIstring\fR argument passed to -\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR, -\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR. -.PP -There are additional fields in the Tcl_Parse structure after the -\fInumTokens\fR field, but these are for the private use of -\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR, -\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR; they should not be -referenced by code outside of these procedures. - -.SH KEYWORDS -backslash substitution, braces, command, expression, parse, token, variable substitution diff --git a/doc/PkgRequire.3 b/doc/PkgRequire.3 deleted file mode 100644 index 796ee6f..0000000 --- a/doc/PkgRequire.3 +++ /dev/null @@ -1,87 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: PkgRequire.3,v 1.3 1999/03/10 05:52:45 stanton Exp $ -'\" -.so man.macros -.TH Tcl_PkgRequire 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_PkgRequire, Tcl_PkgRequireEx, Tcl_PkgPresent, Tcl_PkgPresentEx, Tcl_PkgProvide, Tcl_PkgProvideEx \- package version control -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -char * -\fBTcl_PkgRequire\fR(\fIinterp, name, version, exact\fR) -.sp -char * -\fBTcl_PkgRequireEx\fR(\fIinterp, name, version, exact, clientDataPtr\fR) -.sp -char * -\fBTcl_PkgPresent\fR(\fIinterp, name, version, exact\fR) -.sp -char * -\fBTcl_PkgPresentEx\fR(\fIinterp, name, version, exact, clientDataPtr\fR) -.sp -int -\fBTcl_PkgProvide\fR(\fIinterp, name, version\fR) -.sp -int -\fBTcl_PkgProvideEx\fR(\fIinterp, name, version, clientData\fR) -.SH ARGUMENTS -.AS Tcl_FreeProc clientDataPtr -.AP Tcl_Interp *interp in -Interpreter where package is needed or available. -.AP char *name in -Name of package. -.AP char *version in -A version string consisting of one or more decimal numbers -separated by dots. -.AP int exact in -Non-zero means that only the particular version specified by -\fIversion\fR is acceptable. -Zero means that newer versions than \fIversion\fR are also -acceptable as long as they have the same major version number -as \fIversion\fR. -.AP ClientData clientData in -Arbitrary value to be associated with the package. -.AP ClientData *clientDataPtr out -Pointer to place to store the value associated with the matching -package. It is only changed if the pointer is not NULL and the -function completed successfully. -.BE - -.SH DESCRIPTION -.PP -These procedures provide C-level interfaces to Tcl's package and -version management facilities. -.PP -\fBTcl_PkgRequire\fR is equivalent to the \fBpackage require\fR -command, \fBTcl_PkgPresent\fR is equivalent to the \fBpackage present\fR -command, and \fBTcl_PkgProvide\fR is equivalent to the -\fBpackage provide\fR command. -.PP -See the documentation for the Tcl commands for details on what these -procedures do. -.PP -If \fBTcl_PkgPresent\fR or \fBTcl_PkgRequire\fR complete successfully -they return a pointer to the version string for the version of the package -that is provided in the interpreter (which may be different than -\fIversion\fR); if an error occurs they return NULL and leave an error -message in \fIinterp->result\fR. -.PP -\fBTcl_PkgProvide\fR returns TCL_OK if it completes successfully; -if an error occurs it returns TCL_ERROR and leaves an error message -in \fIinterp->result\fR. -.PP -\fBTcl_PkgProvideEx\fR, \fBTcl_PkgPresentEx\fR and \fBTcl_PkgRequireEx\fR -allow the setting and retrieving of the client data associated with -the package. In all other respects they are equivalent to the matching -functions. - -.SH KEYWORDS -package, present, provide, require, version diff --git a/doc/Preserve.3 b/doc/Preserve.3 deleted file mode 100644 index 07c6476..0000000 --- a/doc/Preserve.3 +++ /dev/null @@ -1,103 +0,0 @@ -'\" -'\" Copyright (c) 1990 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Preserve.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Preserve 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Preserve, Tcl_Release, Tcl_EventuallyFree \- avoid freeing storage while it's being used -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_Preserve\fR(\fIclientData\fR) -.sp -\fBTcl_Release\fR(\fIclientData\fR) -.sp -\fBTcl_EventuallyFree\fR(\fIclientData, freeProc\fR) -.SH ARGUMENTS -.AS Tcl_FreeProc clientData -.AP ClientData clientData in -Token describing structure to be freed or reallocated. Usually a pointer -to memory for structure. -.AP Tcl_FreeProc *freeProc in -Procedure to invoke to free \fIclientData\fR. -.BE - -.SH DESCRIPTION -.PP -These three procedures help implement a simple reference count mechanism -for managing storage. They are designed to solve a problem -having to do with widget deletion, but are also useful in many other -situations. When a widget is deleted, its -widget record (the structure holding information specific to the -widget) must be returned to the storage allocator. -However, it's possible that the widget record is in active use -by one of the procedures on the stack at the time of the deletion. -This can happen, for example, if the command associated with a button -widget causes the button to be destroyed: an X event causes an -event-handling C procedure in the button to be invoked, which in -turn causes the button's associated Tcl command to be executed, -which in turn causes the button to be deleted, which in turn causes -the button's widget record to be de-allocated. -Unfortunately, when the Tcl command returns, the button's -event-handling procedure will need to reference the -button's widget record. -Because of this, the widget record must not be freed as part of the -deletion, but must be retained until the event-handling procedure has -finished with it. -In other situations where the widget is deleted, it may be possible -to free the widget record immediately. -.PP -\fBTcl_Preserve\fR and \fBTcl_Release\fR -implement short-term reference counts for their \fIclientData\fR -argument. -The \fIclientData\fR argument identifies an object and usually -consists of the address of a structure. -The reference counts guarantee that an object will not be freed -until each call to \fBTcl_Preserve\fR for the object has been -matched by calls to \fBTcl_Release\fR. -There may be any number of unmatched \fBTcl_Preserve\fR calls -in effect at once. -.PP -\fBTcl_EventuallyFree\fR is invoked to free up its \fIclientData\fR -argument. -It checks to see if there are unmatched \fBTcl_Preserve\fR calls -for the object. -If not, then \fBTcl_EventuallyFree\fR calls \fIfreeProc\fR immediately. -Otherwise \fBTcl_EventuallyFree\fR records the fact that \fIclientData\fR -needs eventually to be freed. -When all calls to \fBTcl_Preserve\fR have been matched with -calls to \fBTcl_Release\fR then \fIfreeProc\fR will be called by -\fBTcl_Release\fR to do the cleanup. -.PP -All the work of freeing the object is carried out by \fIfreeProc\fR. -\fIFreeProc\fR must have arguments and result that match the -type \fBTcl_FreeProc\fR: -.CS -typedef void Tcl_FreeProc(char *\fIblockPtr\fR); -.CE -The \fIblockPtr\fR argument to \fIfreeProc\fR will be the -same as the \fIclientData\fR argument to \fBTcl_EventuallyFree\fR. -The type of \fIblockPtr\fR (\fBchar *\fR) is different than the type of the -\fIclientData\fR argument to \fBTcl_EventuallyFree\fR for historical -reasons, but the value is the same. -.PP -This mechanism can be used to solve the problem described above -by placing \fBTcl_Preserve\fR and \fBTcl_Release\fR calls around -actions that may cause undesired storage re-allocation. The -mechanism is intended only for short-term use (i.e. while procedures -are pending on the stack); it will not work efficiently as a -mechanism for long-term reference counts. -The implementation does not depend in any way on the internal -structure of the objects being freed; it keeps the reference -counts in a separate structure. - -.SH KEYWORDS -free, reference count, storage diff --git a/doc/PrintDbl.3 b/doc/PrintDbl.3 deleted file mode 100644 index 81af506..0000000 --- a/doc/PrintDbl.3 +++ /dev/null @@ -1,47 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 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. -'\" -'\" RCS: @(#) $Id: PrintDbl.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_PrintDouble \- Convert floating value to string -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_PrintDouble\fR(\fIinterp, value, dst\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP Tcl_Interp *interp in -.VS -Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter -controlled the conversion. As of Tcl 8.0, this argument is ignored and -the conversion is controlled by the \fBtcl_precision\fR variable -that is now shared by all interpreters. -.VE -.AP double value in -Floating-point value to be converted. -.AP char *dst out -Where to store string representing \fIvalue\fR. Must have at -least TCL_DOUBLE_SPACE characters of storage. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_PrintDouble\fR generates a string that represents the value -of \fIvalue\fR and stores it in memory at the location given by -\fIdst\fR. It uses \fB%g\fR format to generate the string, with one -special twist: the string is guaranteed to contain either -a ``.'' or an ``e'' so that it doesn't look like an integer. Where -\fB%g\fR would generate an integer with no decimal point, \fBTcl_PrintDouble\fR -adds ``.0''. - -.SH KEYWORDS -conversion, double-precision, floating-point, string diff --git a/doc/RecEvalObj.3 b/doc/RecEvalObj.3 deleted file mode 100644 index 6af989f..0000000 --- a/doc/RecEvalObj.3 +++ /dev/null @@ -1,55 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: RecEvalObj.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ -'\" -.so man.macros -.TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_RecordAndEvalObj \- save command on history list before evaluating -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_RecordAndEvalObj\fR(\fIinterp, cmdPtr, flags\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp; -.AP Tcl_Interp *interp in -Tcl interpreter in which to evaluate command. -.AP Tcl_Obj *cmdPtr in -Points to a Tcl object containing a command (or sequence of commands) -to execute. -.AP int flags in -An OR'ed combination of flag bits. TCL_NO_EVAL means record the -command but don't evaluate it. TCL_EVAL_GLOBAL means evaluate -the command at global level instead of the current stack level. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event -on the history list and then execute it using \fBTcl_EvalObj\fR -(or \fBTcl_GlobalEvalObj\fR if the TCL_EVAL_GLOBAL bit is set -in \fIflags\fR). -It returns a completion code such as TCL_OK just like \fBTcl_EvalObj\fR, -as well as a result object containing additional information -(a result value or error message) -that can be retrieved using \fBTcl_GetObjResult\fR. -If you don't want the command recorded on the history list then -you should invoke \fBTcl_EvalObj\fR instead of \fBTcl_RecordAndEvalObj\fR. -Normally \fBTcl_RecordAndEvalObj\fR is only called with top-level -commands typed by the user, since the purpose of history is to -allow the user to re-issue recently-invoked commands. -If the \fIflags\fR argument contains the TCL_NO_EVAL bit then -the command is recorded without being evaluated. - -.SH "SEE ALSO" -Tcl_EvalObj, Tcl_GetObjResult - -.SH KEYWORDS -command, event, execute, history, interpreter, object, record diff --git a/doc/RecordEval.3 b/doc/RecordEval.3 deleted file mode 100644 index 090a56d..0000000 --- a/doc/RecordEval.3 +++ /dev/null @@ -1,57 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 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. -'\" -'\" RCS: @(#) $Id: RecordEval.3,v 1.2 1998/09/14 18:39:50 stanton Exp $ -'\" -.so man.macros -.TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_RecordAndEval \- save command on history list before evaluating -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_RecordAndEval\fR(\fIinterp, cmd, flags\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp; -.AP Tcl_Interp *interp in -Tcl interpreter in which to evaluate command. -.AP char *cmd in -Command (or sequence of commands) to execute. -.AP int flags in -An OR'ed combination of flag bits. TCL_NO_EVAL means record the -command but don't evaluate it. TCL_EVAL_GLOBAL means evaluate -the command at global level instead of the current stack level. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_RecordAndEval\fR is invoked to record a command as an event -on the history list and then execute it using \fBTcl_Eval\fR -(or \fBTcl_GlobalEval\fR if the TCL_EVAL_GLOBAL bit is set in \fIflags\fR). -It returns a completion code such as TCL_OK just like \fBTcl_Eval\fR -and it leaves information in \fIinterp->result\fR. -If you don't want the command recorded on the history list then -you should invoke \fBTcl_Eval\fR instead of \fBTcl_RecordAndEval\fR. -Normally \fBTcl_RecordAndEval\fR is only called with top-level -commands typed by the user, since the purpose of history is to -allow the user to re-issue recently-invoked commands. -If the \fIflags\fR argument contains the TCL_NO_EVAL bit then -the command is recorded without being evaluated. -.PP -Note that \fBTcl_RecordAndEval\fR has been largely replaced by the -object-based procedure \fBTcl_RecordAndEvalObj\fR. -That object-based procedure records and optionally executes -a command held in a Tcl object instead of a string. - -.SH "SEE ALSO" -Tcl_RecordAndEvalObj - -.SH KEYWORDS -command, event, execute, history, interpreter, record diff --git a/doc/RegExp.3 b/doc/RegExp.3 deleted file mode 100644 index 1f1064d..0000000 --- a/doc/RegExp.3 +++ /dev/null @@ -1,131 +0,0 @@ -'\" -'\" Copyright (c) 1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 1998-1999 Scriptics Corportation -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: RegExp.3,v 1.3 1999/04/16 00:46:32 stanton Exp $ -'\" -.so man.macros -.TH Tcl_RegExpMatch 3 7.4 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_GetRegExpFromObj, Tcl_RegExpMatch, Tcl_RegExpCompile, Tcl_RegExpExec, Tcl_RegExpRange \- Pattern matching with regular expressions -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_RegExp -\fBTcl_GetRegExpFromObj\fR(\fIinterp\fR, \fIpatObj\fR, \fIflags\fR) -.sp -int -\fBTcl_RegExpMatch\fR(\fIinterp\fR, \fIstring\fR, \fIpattern\fR) -.sp -Tcl_RegExp -\fBTcl_RegExpCompile\fR(\fIinterp\fR, \fIpattern\fR) -.sp -int -\fBTcl_RegExpExec\fR(\fIinterp\fR, \fIregexp\fR, \fIstring\fR, \fIstart\fR) -.sp -\fBTcl_RegExpRange\fR(\fIregexp\fR, \fIindex\fR, \fIstartPtr\fR, \fIendPtr\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP Tcl_Interp *interp in -Tcl interpreter to use for error reporting. -.AP char *string in -String to check for a match with a regular expression. -.AP char *pattern in -String in the form of a regular expression pattern. -.AP Tcl_Obj *patObj in -Refers to the object from which to get a compiled regular expression. -.AP int flags in -Various flags to control regular expression compile options. -.AP Tcl_RegExp regexp in -Compiled regular expression. Must have been returned previously -by \fBTcl_GetRegExpFromObj\fR. -.AP char *start in -If \fIstring\fR is just a portion of some other string, this argument -identifies the beginning of the larger string. -If it isn't the same as \fIstring\fR, then no \fB^\fR matches -will be allowed. -.AP int index in -Specifies which range is desired: 0 means the range of the entire -match, 1 or greater means the range that matched a parenthesized -sub-expression. -.AP char **startPtr out -The address of the first character in the range is stored here, or -NULL if there is no such range. -.AP char **endPtr out -The address of the character just after the last one in the range -is stored here, or NULL if there is no such range. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_GetRegExpFromObj\fR attepts to return a compiled regular -expression from the Tcl obj \fIpatObj\fR. If the object does not -already contain a compiled regular expression it will attempt to -create one from the string in the Tcl obj and assign it to the -internal representation of the \fIpatObj\fR. The return value -of this function is of type \fBTcl_RegExp\fR. -.PP -\fBTcl_RegExpMatch\fR determines whether its \fIpattern\fR argument -matches \fIregexp\fR, where \fIregexp\fR is interpreted -as a regular expression using the same rules as for the -\fBregexp\fR Tcl command. -If there is a match then \fBTcl_RegExpMatch\fR returns 1. -If there is no match then \fBTcl_RegExpMatch\fR returns 0. -If an error occurs in the matching process (e.g. \fIpattern\fR -is not a valid regular expression) then \fBTcl_RegExpMatch\fR -returns \-1 and leaves an error message in \fIinterp->result\fR. -.PP -\fBTcl_RegExpCompile\fR, \fBTcl_RegExpExec\fR, and \fBTcl_RegExpRange\fR -provide lower-level access to the regular expression pattern matcher. -\fBTcl_RegExpCompile\fR compiles a regular expression string into -the internal form used for efficient pattern matching. -The return value is a token for this compiled form, which can be -used in subsequent calls to \fBTcl_RegExpExec\fR or \fBTcl_RegExpRange\fR. -If an error occurs while compiling the regular expression then -\fBTcl_RegExpCompile\fR returns NULL and leaves an error message -in \fIinterp->result\fR. -Note: the return value from \fBTcl_RegExpCompile\fR is only valid -up to the next call to \fBTcl_RegExpCompile\fR; it is not safe to -retain these values for long periods of time. -.PP -\fBTcl_RegExpExec\fR executes the regular expression pattern matcher. -It returns 1 if \fIstring\fR contains a range of characters that -match \fIregexp\fR, 0 if no match is found, and -\-1 if an error occurs. -In the case of an error, \fBTcl_RegExpExec\fR leaves an error -message in \fIinterp->result\fR. -When searching a string for multiple matches of a pattern, -it is important to distinguish between the start of the original -string and the start of the current search. -For example, when searching for the second occurrence of a -match, the \fIstring\fR argument might point to the character -just after the first match; however, it is important for the -pattern matcher to know that this is not the start of the entire string, -so that it doesn't allow \fB^\fR atoms in the pattern to match. -The \fIstart\fR argument provides this information by pointing -to the start of the overall string containing \fIstring\fR. -\fIStart\fR will be less than or equal to \fIstring\fR; if it -is less than \fIstring\fR then no \fB^\fR matches will be allowed. -.PP -\fBTcl_RegExpRange\fR may be invoked after \fBTcl_RegExpExec\fR -returns; it provides detailed information about what ranges of -the string matched what parts of the pattern. -\fBTcl_RegExpRange\fR returns a pair of pointers in \fI*startPtr\fR -and \fI*endPtr\fR that identify a range of characters in -the source string for the most recent call to \fBTcl_RegExpExec\fR. -\fIIndex\fR indicates which of several ranges is desired: -if \fIindex\fR is 0, information is returned about the overall range -of characters that matched the entire pattern; otherwise, -information is returned about the range of characters that matched the -\fIindex\fR'th parenthesized subexpression within the pattern. -If there is no range corresponding to \fIindex\fR then NULL -is stored in \fI*firstPtr\fR and \fI*lastPtr\fR. - -.SH KEYWORDS -match, pattern, regular expression, string, subexpression diff --git a/doc/SaveResult.3 b/doc/SaveResult.3 deleted file mode 100644 index 6a0a051..0000000 --- a/doc/SaveResult.3 +++ /dev/null @@ -1,65 +0,0 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: SaveResult.3,v 1.2 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl_SaveResult 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult \- save and restore an interpreter's result -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_SaveResult(\fIinterp, statePtr\fB)\fR -.sp -\fBTcl_RestoreResult(\fIinterp, statePtr\fB)\fR -.sp -\fBTcl_DiscardResult(\fIstatePtr\fB)\fR -.SH ARGUMENTS -.AS Tcl_SavedResult statePtr -.AP Tcl_Interp *interp in -Interpreter for which state should be saved. -.AP Tcl_SavedResult *statePtr in -Pointer to location where interpreter result should be saved or restored. -.BE - -.SH DESCRIPTION -.PP -These routines allows a C procedure to take a snapshot of the current -interpreter result so that it can be restored after a call -to \fBTcl_Eval\fR or some other routine that modifies the interpreter -result. These routines are passed a pointer to a structure that is -used to store enough information to restore the interpreter result -state. This structure can be allocated on the stack of the calling -procedure. These routines do not save the state of any error -information in the interpreter (e.g. the \fBerrorCode\fR or -\fBerrorInfo\fR variables). -.PP -\fBTcl_SaveResult\fR moves the string and object results -of \fIinterp\fR into the location specified by \fIstatePtr\fR. -\fBTcl_SaveResult\fR clears the result for \fIinterp\fR and -leaves the result in its normal empty initialized state. -.PP -\fBTcl_RestoreResult\fR moves the string and object results from -\fIstatePtr\fR back into \fIinterp\fR. Any result or error that was -already in the interpreter will be cleared. The \fIstatePtr\fR is left -in an uninitialized state and cannot be used until another call to -\fBTcl_SaveResult\fR. -.PP -\fBTcl_DiscardResult\fR releases the saved interpreter state -stored at \fBstatePtr\fR. The state structure is left in an -uninitialized state and cannot be used until another call to -\fBTcl_SaveResult\fR. -.PP -Once \fBTcl_SaveResult\fR is called to save the interpreter -result, either \fBTcl_RestoreResult\fR or -\fBTcl_DiscardResult\fR must be called to properly clean up the -memory associated with the saved state. - -.SH KEYWORDS -result, state, interp diff --git a/doc/SetErrno.3 b/doc/SetErrno.3 deleted file mode 100644 index d57263b..0000000 --- a/doc/SetErrno.3 +++ /dev/null @@ -1,48 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: SetErrno.3,v 1.2 1998/09/14 18:39:50 stanton Exp $ -.so man.macros -.TH Tcl_SetErrno 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_SetErrno, Tcl_GetErrno \- manipulate errno to store and retrieve error codes -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -void -\fBTcl_SetErrno\fR(\fIerrorCode\fR) -.sp -int -\fBTcl_GetErrno\fR() -.sp -.SH ARGUMENTS -.AS Tcl_Interp *errorCode in -.AP int errorCode in -A POSIX error code such as \fBENOENT\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_SetErrno\fR and \fBTcl_GetErrno\fR provide portable access -to the \fBerrno\fR variable, which is used to record a POSIX error -code after system calls and other operations such as \fBTcl_Gets\fR. -These procedures are necessary because global variable accesses cannot -be made across module boundaries on some platforms. -.PP -\fBTcl_SetErrno\fR sets the \fBerrno\fR variable to the value of the -\fIerrorCode\fR argument -C procedures that wish to return error information to their callers -via \fBerrno\fR should call \fBTcl_SetErrno\fR rather than setting -\fBerrno\fR directly. -.PP -\fBTcl_GetErrno\fR returns the current value of \fBerrno\fR. -Procedures wishing to access \fBerrno\fR should call this procedure -instead of accessing \fBerrno\fR directly. - -.SH KEYWORDS -errno, error code, global variables diff --git a/doc/SetRecLmt.3 b/doc/SetRecLmt.3 deleted file mode 100644 index 599e46f..0000000 --- a/doc/SetRecLmt.3 +++ /dev/null @@ -1,55 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: SetRecLmt.3,v 1.3 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl_SetRecursionLimit 3 7.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_SetRecursionLimit \- set maximum allowable nesting depth in interpreter -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_SetRecursionLimit\fR(\fIinterp, depth\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP Tcl_Interp *interp in -Interpreter whose recursion limit is to be set. -Must be greater than zero. -.AP int depth in -New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR. -.BE - -.SH DESCRIPTION -.PP -At any given time Tcl enforces a limit on the number of recursive -calls that may be active for \fBTcl_Eval\fR and related procedures -such as \fBTcl_GlobalEval\fR. -Any call to \fBTcl_Eval\fR that exceeds this depth is aborted with -an error. -By default the recursion limit is 1000. -.PP -\fBTcl_SetRecursionLimit\fR may be used to change the maximum -allowable nesting depth for an interpreter. -The \fIdepth\fR argument specifies a new limit for \fIinterp\fR, -and \fBTcl_SetRecursionLimit\fR returns the old limit. -To read out the old limit without modifying it, invoke -\fBTcl_SetRecursionLimit\fR with \fIdepth\fR equal to 0. -.PP -The \fBTcl_SetRecursionLimit\fR only sets the size of the Tcl -call stack: it cannot by itself prevent stack overflows on the -C stack being used by the application. If your machine has a -limit on the size of the C stack, you may get stack overflows -before reaching the limit set by \fBTcl_SetRecursionLimit\fR. -If this happens, see if there is a mechanism in your system for -increasing the maximum size of the C stack. - -.SH KEYWORDS -nesting depth, recursion diff --git a/doc/SetResult.3 b/doc/SetResult.3 deleted file mode 100644 index 1fed065..0000000 --- a/doc/SetResult.3 +++ /dev/null @@ -1,225 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 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. -'\" -'\" RCS: @(#) $Id: SetResult.3,v 1.3 1999/03/10 05:52:45 stanton Exp $ -'\" -.so man.macros -.TH Tcl_SetResult 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendResultVA, Tcl_AppendElement, Tcl_ResetResult \- manipulate Tcl result -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_SetObjResult\fR(\fIinterp, objPtr\fR) -.sp -Tcl_Obj * -\fBTcl_GetObjResult\fR(\fIinterp\fR) -.sp -\fBTcl_SetResult\fR(\fIinterp, string, freeProc\fR) -.sp -char * -\fBTcl_GetStringResult\fR(\fIinterp\fR) -.sp -\fBTcl_AppendResult\fR(\fIinterp, string, string, ... , \fB(char *) NULL\fR) -.sp -\fBTcl_AppendResultVA\fR(\fIinterp, argList\fR) -.sp -\fBTcl_AppendElement\fR(\fIinterp, string\fR) -.sp -\fBTcl_ResetResult\fR(\fIinterp\fR) -.sp -\fBTcl_FreeResult\fR(\fIinterp\fR) -.SH ARGUMENTS -.AS Tcl_FreeProc freeProc -.AP Tcl_Interp *interp out -Interpreter whose result is to be modified or read. -.AP Tcl_Obj *objPtr in -Object value to become result for \fIinterp\fR. -.AP char *string in -String value to become result for \fIinterp\fR or to be -appended to the existing result. -.AP Tcl_FreeProc *freeProc in -Address of procedure to call to release storage at -\fIstring\fR, or \fBTCL_STATIC\fR, \fBTCL_DYNAMIC\fR, or -\fBTCL_VOLATILE\fR. -.AP va_list argList in -An argument list which must have been initialised using -\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR. -.BE - -.SH DESCRIPTION -.PP -The procedures described here are utilities for manipulating the -result value in a Tcl interpreter. -The interpreter result may be either a Tcl object or a string. -For example, \fBTcl_SetObjResult\fR and \fBTcl_SetResult\fR -set the interpreter result to, respectively, an object and a string. -Similarly, \fBTcl_GetObjResult\fR and \fBTcl_GetStringResult\fR -return the interpreter result as an object and as a string. -The procedures always keep the string and object forms -of the interpreter result consistent. -For example, if \fBTcl_SetObjResult\fR is called to set -the result to an object, -then \fBTcl_GetStringResult\fR is called, -it will return the object's string value. -.PP -\fBTcl_SetObjResult\fR -arranges for \fIobjPtr\fR to be the result for \fIinterp\fR, -replacing any existing result. -The result is left pointing to the object -referenced by \fIobjPtr\fR. -\fIobjPtr\fR's reference count is incremented -since there is now a new reference to it from \fIinterp\fR. -The reference count for any old result object -is decremented and the old result object is freed if no -references to it remain. -.PP -\fBTcl_GetObjResult\fR returns the result for \fIinterp\fR as an object. -The object's reference count is not incremented; -if the caller needs to retain a long-term pointer to the object -they should use \fBTcl_IncrRefCount\fR to increment its reference count -in order to keep it from being freed too early or accidently changed. -.PP -\fBTcl_SetResult\fR -arranges for \fIstring\fR to be the result for the current Tcl -command in \fIinterp\fR, replacing any existing result. -The \fIfreeProc\fR argument specifies how to manage the storage -for the \fIstring\fR argument; -it is discussed in the section -\fBTHE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT\fR below. -If \fIstring\fR is \fBNULL\fR, then \fIfreeProc\fR is ignored -and \fBTcl_SetResult\fR -re-initializes \fIinterp\fR's result to point to an empty string. -.PP -\fBTcl_GetStringResult\fR returns the result for \fIinterp\fR as an string. -If the result was set to an object by a \fBTcl_SetObjResult\fR call, -the object form will be converted to a string and returned. -If the object's string representation contains null bytes, -this conversion will lose information. -For this reason, programmers are encouraged to -write their code to use the new object API procedures -and to call \fBTcl_GetObjResult\fR instead. -.PP -\fBTcl_ResetResult\fR clears the result for \fIinterp\fR -and leaves the result in its normal empty initialized state. -If the result is an object, -its reference count is decremented and the result is left -pointing to an unshared object representing an empty string. -If the result is a dynamically allocated string, its memory is free*d -and the result is left as a empty string. -\fBTcl_ResetResult\fR also clears the error state managed by -\fBTcl_AddErrorInfo\fR, \fBTcl_AddObjErrorInfo\fR, -and \fBTcl_SetErrorCode\fR. - -.SH OLD STRING PROCEDURES -.PP -Use of the following procedures is deprecated -since they manipulate the Tcl result as a string. -Procedures such as \fBTcl_SetObjResult\fR -that manipulate the result as an object -can be significantly more efficient. -.PP -\fBTcl_AppendResult\fR makes it easy to build up Tcl results in pieces. -It takes each of its \fIstring\fR arguments and appends them in order -to the current result associated with \fIinterp\fR. -If the result is in its initialized empty state (e.g. a command procedure -was just invoked or \fBTcl_ResetResult\fR was just called), -then \fBTcl_AppendResult\fR sets the result to the concatenation of -its \fIstring\fR arguments. -\fBTcl_AppendResult\fR may be called repeatedly as additional pieces -of the result are produced. -\fBTcl_AppendResult\fR takes care of all the -storage management issues associated with managing \fIinterp\fR's -result, such as allocating a larger result area if necessary. -It also converts the current interpreter result from an object -to a string, if necessary, before appending the argument strings. -Any number of \fIstring\fR arguments may be passed in a single -call; the last argument in the list must be a NULL pointer. -.PP -\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that -instead of taking a variable number of arguments it takes an argument list. -.PP -\fBTcl_AppendElement\fR is similar to \fBTcl_AppendResult\fR in -that it allows results to be built up in pieces. -However, \fBTcl_AppendElement\fR takes only a single \fIstring\fR -argument and it appends that argument to the current result -as a proper Tcl list element. -\fBTcl_AppendElement\fR adds backslashes or braces if necessary -to ensure that \fIinterp\fR's result can be parsed as a list and that -\fIstring\fR will be extracted as a single element. -Under normal conditions, \fBTcl_AppendElement\fR will add a space -character to \fIinterp\fR's result just before adding the new -list element, so that the list elements in the result are properly -separated. -However if the new list element is the first in a list or sub-list -(i.e. \fIinterp\fR's current result is empty, or consists of the -single character ``{'', or ends in the characters `` {'') then no -space is added. -.PP -\fBTcl_FreeResult\fR performs part of the work -of \fBTcl_ResetResult\fR. -It frees up the memory associated with \fIinterp\fR's result. -It also sets \fIinterp->freeProc\fR to zero, but doesn't -change \fIinterp->result\fR or clear error state. -\fBTcl_FreeResult\fR is most commonly used when a procedure -is about to replace one result value with another. - -.SH DIRECT ACCESS TO INTERP->RESULT IS DEPRECATED -.PP -It used to be legal for programs to -directly read and write \fIinterp->result\fR -to manipulate the interpreter result. -Direct access to \fIinterp->result\fR is now strongly deprecated -because it can make the result's string and object forms inconsistent. -Programs should always read the result -using the procedures \fBTcl_GetObjResult\fR or \fBTcl_GetStringResult\fR, -and write the result using \fBTcl_SetObjResult\fR or \fBTcl_SetResult\fR. - -.SH THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT -.PP -\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how -the Tcl system is to manage the storage for the \fIstring\fR argument. -If \fBTcl_SetResult\fR or \fBTcl_SetObjResult\fR are called -at a time when \fIinterp\fR holds a string result, -they do whatever is necessary to dispose of the old string result -(see the \fBTcl_Interp\fR manual entry for details on this). -.PP -If \fIfreeProc\fR is \fBTCL_STATIC\fR it means that \fIstring\fR -refers to an area of static storage that is guaranteed not to be -modified until at least the next call to \fBTcl_Eval\fR. -If \fIfreeProc\fR -is \fBTCL_DYNAMIC\fR it means that \fIstring\fR was allocated with a call -to \fBTcl_Alloc\fR and is now the property of the Tcl system. -\fBTcl_SetResult\fR will arrange for the string's storage to be -released by calling \fBTcl_Free\fR when it is no longer needed. -If \fIfreeProc\fR is \fBTCL_VOLATILE\fR it means that \fIstring\fR -points to an area of memory that is likely to be overwritten when -\fBTcl_SetResult\fR returns (e.g. it points to something in a stack frame). -In this case \fBTcl_SetResult\fR will make a copy of the string in -dynamically allocated storage and arrange for the copy to be the -result for the current Tcl command. -.PP -If \fIfreeProc\fR isn't one of the values \fBTCL_STATIC\fR, -\fBTCL_DYNAMIC\fR, and \fBTCL_VOLATILE\fR, then it is the address -of a procedure that Tcl should call to free the string. -This allows applications to use non-standard storage allocators. -When Tcl no longer needs the storage for the string, it will -call \fIfreeProc\fR. \fIFreeProc\fR should have arguments and -result that match the type \fBTcl_FreeProc\fR: -.CS -typedef void Tcl_FreeProc(char *\fIblockPtr\fR); -.CE -When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to -the value of \fIstring\fR passed to \fBTcl_SetResult\fR. - -.SH "SEE ALSO" -Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp - -.SH KEYWORDS -append, command, element, list, object, result, return value, interpreter diff --git a/doc/SetVar.3 b/doc/SetVar.3 deleted file mode 100644 index bb07005..0000000 --- a/doc/SetVar.3 +++ /dev/null @@ -1,261 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 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. -'\" -'\" RCS: @(#) $Id: SetVar.3,v 1.3 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl_SetVar 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_SetVar2Ex, Tcl_SetVar, Tcl_SetVar2, Tcl_ObjSetVar2, Tcl_GetVar2Ex, Tcl_GetVar, Tcl_GetVar2, Tcl_ObjGetVar2, Tcl_UnsetVar, Tcl_UnsetVar2 \- manipulate Tcl variables -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -.VS 8.1 -Tcl_Obj * -\fBTcl_SetVar2Ex\fR(\fIinterp, name1, name2, newValuePtr, flags\fR) -.VE -.sp -char * -\fBTcl_SetVar\fR(\fIinterp, varName, newValue, flags\fR) -.sp -char * -\fBTcl_SetVar2\fR(\fIinterp, name1, name2, newValue, flags\fR) -.sp -Tcl_Obj * -\fBTcl_ObjSetVar2\fR(\fIinterp, part1Ptr, part2Ptr, newValuePtr, flags\fR) -.sp -.VS 8.1 -Tcl_Obj * -\fBTcl_GetVar2Ex\fR(\fIinterp, name1, name2, flags\fR) -.VE -.sp -char * -\fBTcl_GetVar\fR(\fIinterp, varName, flags\fR) -.sp -char * -\fBTcl_GetVar2\fR(\fIinterp, name1, name2, flags\fR) -.sp -Tcl_Obj * -\fBTcl_ObjGetVar2\fR(\fIinterp, part1Ptr, part2Ptr, flags\fR) -.sp -int -\fBTcl_UnsetVar\fR(\fIinterp, varName, flags\fR) -.sp -int -\fBTcl_UnsetVar2\fR(\fIinterp, name1, name2, flags\fR) -.SH ARGUMENTS -.AS Tcl_Interp *newValuePtr -.AP Tcl_Interp *interp in -Interpreter containing variable. -.AP char *name1 in -Contains the name of an array variable (if \fIname2\fR is non-NULL) -or (if \fIname2\fR is NULL) either the name of a scalar variable -or a complete name including both variable name and index. -May include \fB::\fR namespace qualifiers -to specify a variable in a particular namespace. -.AP char *name2 in -If non-NULL, gives name of element within array; in this -case \fIname1\fR must refer to an array variable. -.AP Tcl_Obj *newValuePtr in -.VS 8.1 -Points to a Tcl object containing the new value for the variable. -.VE -.AP int flags in -OR-ed combination of bits providing additional information. See below -for valid values. -.AP char *varName in -Name of variable. -May include \fB::\fR namespace qualifiers -to specify a variable in a particular namespace. -May refer to a scalar variable or an element of -an array. -If the name references an element of an array, then the name -must be in writable memory: Tcl will make temporary modifications -to it while looking up the name. -.AP char *newValue in -New value for variable, specified as a NULL-terminated string. -A copy of this value is stored in the variable. -.AP Tcl_Obj *part1Ptr in -Points to a Tcl object containing the variable's name. -The name may include a series of \fB::\fR namespace qualifiers -to specify a variable in a particular namespace. -May refer to a scalar variable or an element of an array variable. -.AP Tcl_Obj *part2Ptr in -If non-NULL, points to an object containing the name of an element -within an array and \fIpart1Ptr\fR must refer to an array variable. -.BE - -.SH DESCRIPTION -.PP -These procedures are used to create, modify, read, and delete -Tcl variables from C code. -.PP -.VS 8.1 -\fBTcl_SetVar2Ex\fR, \fBTcl_SetVar\fR, \fBTcl_SetVar2\fR, and -\fBTcl_ObjSetVar2\fR -will create a new variable or modify an existing one. -These procedures set the given variable to the value -given by \fInewValuePtr\fR or \fInewValue\fR and return a -pointer to the variable's new value, which is stored in Tcl's -variable structure. -\fBTcl_SetVar2Ex\fR and \fBTcl_ObjSetVar2\fR take the new value as a -Tcl_Obj and return -a pointer to a Tcl_Obj. \fBTcl_SetVar\fR and \fBTcl_SetVar2\fR -take the new value as a string and return a string; they are -usually less efficient than \fBTcl_ObjSetVar2\fR. Note that the -return value may be different than the \fInewValuePtr\fR or -.VE -\fInewValue\fR argument, due to modifications made by write traces. -If an error occurs in setting the variable (e.g. an array -variable is referenced without giving an index into the array) -NULL is returned and an error message is left in \fIinterp\fR's -result if the \fBTCL_LEAVE_ERR_MSG\fR \fIflag\fR bit is set. -.PP -.VS 8.1 -\fBTcl_GetVar2Ex\fR, \fBTcl_GetVar\fR, \fBTcl_GetVar2\fR, and -\fBTcl_ObjGetVar2\fR -return the current value of a variable. -The arguments to these procedures are treated in the same way -as the arguments to the procedures described above. -Under normal circumstances, the return value is a pointer -to the variable's value. For \fBTcl_GetVar2Ex\fR and -\fBTcl_ObjGetVar2\fR the value is -returned as a pointer to a Tcl_Obj. For \fBTcl_GetVar\fR and -\fBTcl_GetVar2\fR the value is returned as a string; this is -usually less efficient, so \fBTcl_GetVar2Ex\fR or \fBTcl_ObjGetVar2\fR -are preferred. -.VE -If an error occurs while reading the variable (e.g. the variable -doesn't exist or an array element is specified for a scalar -variable), then NULL is returned and an error message is left -in \fIinterp\fR's result if the \fBTCL_LEAVE_ERR_MSG\fR \fIflag\fR -bit is set. -.PP -\fBTcl_UnsetVar\fR and \fBTcl_UnsetVar2\fR may be used to remove -a variable, so that future attempts to read the variable will return -an error. -The arguments to these procedures are treated in the same way -as the arguments to the procedures above. -If the variable is successfully removed then TCL_OK is returned. -If the variable cannot be removed because it doesn't exist then -TCL_ERROR is returned and an error message is left -in \fIinterp\fR's result if the \fBTCL_LEAVE_ERR_MSG\fR \fIflag\fR -bit is set. -If an array element is specified, the given element is removed -but the array remains. -If an array name is specified without an index, then the entire -array is removed. -.PP -The name of a variable may be specified to these procedures in -four ways: -.IP [1] -If \fBTcl_SetVar\fR, \fBTcl_GetVar\fR, or \fBTcl_UnsetVar\fR -is invoked, the variable name is given as -a single string, \fIvarName\fR. -If \fIvarName\fR contains an open parenthesis and ends with a -close parenthesis, then the value between the parentheses is -treated as an index (which can have any string value) and -the characters before the first open -parenthesis are treated as the name of an array variable. -If \fIvarName\fR doesn't have parentheses as described above, then -the entire string is treated as the name of a scalar variable. -.IP [2] -If the \fIname1\fR and \fIname2\fR arguments are provided and -\fIname2\fR is non-NULL, then an array element is specified and -the array name and index have -already been separated by the caller: \fIname1\fR contains the -name and \fIname2\fR contains the index. -.VS 8.1 -An error is generated -if \fIname1\fR contains an open parenthesis and ends with a -close parenthesis (array element) and \fIname2\fR is non-NULL. -.IP [3] -If \fIname2\fR is NULL, \fIname1\fR is treated just like -\fIvarName\fR in case [1] above (it can be either a scalar or an array -element variable name). -.VE -.PP -The \fIflags\fR argument may be used to specify any of several -options to the procedures. -It consists of an OR-ed combination of the following bits. -.TP -\fBTCL_GLOBAL_ONLY\fR -Under normal circumstances the procedures look up variables as follows. -If a procedure call is active in \fIinterp\fR, -the variable is looked up at the current level of procedure call. -Otherwise, the variable is looked up first in the current namespace, -then in the global namespace. -However, if this bit is set in \fIflags\fR then the variable -is looked up only in the global namespace -even if there is a procedure call active. -If both \fBTCL_GLOBAL_ONLY\fR and \fBTCL_NAMESPACE_ONLY\fR are given, -\fBTCL_GLOBAL_ONLY\fR is ignored. -.TP -\fBTCL_NAMESPACE_ONLY\fR -If this bit is set in \fIflags\fR then the variable -is looked up only in the current namespace; if a procedure is active -its variables are ignored, and the global namespace is also ignored unless -it is the current namespace. -.TP -\fBTCL_LEAVE_ERR_MSG\fR -If an error is returned and this bit is set in \fIflags\fR, then -an error message will be left in the interpreter's result, -where it can be retrieved with \fBTcl_GetObjResult\fR -or \fBTcl_GetStringResult\fR. -If this flag bit isn't set then no error message is left -and the interpreter's result will not be modified. -.TP -\fBTCL_APPEND_VALUE\fR -If this bit is set then \fInewValuePtr\fR or \fInewValue\fR is -appended to the current value instead of replacing it. -If the variable is currently undefined, then the bit is ignored. -This bit is only used by the \fBTcl_Set*\fR procedures. -.TP -\fBTCL_LIST_ELEMENT\fR -If this bit is set, then \fInewValue\fR is converted to a valid -Tcl list element before setting (or appending to) the variable. -A separator space is appended before the new list element unless -the list element is going to be the first element in a list or -sublist (i.e. the variable's current value is empty, or contains -the single character ``{'', or ends in `` }''). -.PP -\fBTcl_GetVar\fR and \fBTcl_GetVar2\fR -return the current value of a variable. -The arguments to these procedures are treated in the same way -as the arguments to \fBTcl_SetVar\fR and \fBTcl_SetVar2\fR. -Under normal circumstances, the return value is a pointer -to the variable's value (which is stored in Tcl's variable -structure and will not change before the next call to \fBTcl_SetVar\fR -or \fBTcl_SetVar2\fR). -\fBTcl_GetVar\fR and \fBTcl_GetVar2\fR use the flag bits TCL_GLOBAL_ONLY -and TCL_LEAVE_ERR_MSG, both of -which have -the same meaning as for \fBTcl_SetVar\fR. -If an error occurs in reading the variable (e.g. the variable -doesn't exist or an array element is specified for a scalar -variable), then NULL is returned. -.PP -\fBTcl_UnsetVar\fR and \fBTcl_UnsetVar2\fR may be used to remove -a variable, so that future calls to \fBTcl_GetVar\fR or \fBTcl_GetVar2\fR -for the variable will return an error. -The arguments to these procedures are treated in the same way -as the arguments to \fBTcl_GetVar\fR and \fBTcl_GetVar2\fR. -If the variable is successfully removed then TCL_OK is returned. -If the variable cannot be removed because it doesn't exist then -TCL_ERROR is returned. -If an array element is specified, the given element is removed -but the array remains. -If an array name is specified without an index, then the entire -array is removed. - -.SH "SEE ALSO" -Tcl_GetObjResult, Tcl_GetStringResult, Tcl_TraceVar - -.SH KEYWORDS -array, get variable, interpreter, object, scalar, set, unset, variable diff --git a/doc/Sleep.3 b/doc/Sleep.3 deleted file mode 100644 index fcfed9b..0000000 --- a/doc/Sleep.3 +++ /dev/null @@ -1,37 +0,0 @@ -'\" -'\" Copyright (c) 1990 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Sleep.3,v 1.2 1998/09/14 18:39:50 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Sleep 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Sleep \- delay execution for a given number of milliseconds -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_Sleep\fR(\fIms\fR) -.SH ARGUMENTS -.AP int ms in -Number of milliseconds to sleep. -.BE - -.SH DESCRIPTION -.PP -This procedure delays the calling process by the number of -milliseconds given by the \fIms\fR parameter and returns -after that time has elapsed. It is typically used for things -like flashing a button, where the delay is short and the -application needn't do anything while it waits. For longer -delays where the application needs to respond to other events -during the delay, the procedure \fBTcl_CreateTimerHandler\fR -should be used instead of \fBTcl_Sleep\fR. - -.SH KEYWORDS -sleep, time, wait diff --git a/doc/SplitList.3 b/doc/SplitList.3 deleted file mode 100644 index e30771c..0000000 --- a/doc/SplitList.3 +++ /dev/null @@ -1,191 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: SplitList.3,v 1.2 1998/09/14 18:39:50 stanton Exp $ -'\" -.so man.macros -.TH Tcl_SplitList 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_SplitList, Tcl_Merge, Tcl_ScanElement, Tcl_ConvertElement \- manipulate Tcl lists -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_SplitList\fR(\fIinterp, list, argcPtr, argvPtr\fR) -.sp -char * -\fBTcl_Merge\fR(\fIargc, argv\fR) -.sp -int -\fBTcl_ScanElement\fR(\fIsrc, flagsPtr\fR) -.VS -.sp -int -\fBTcl_ScanCountedElement\fR(\fIsrc, length, flagsPtr\fR) -.VE -.sp -int -\fBTcl_ConvertElement\fR(\fIsrc, dst, flags\fR) -.VS -.sp -int -\fBTcl_ConvertCountedElement\fR(\fIsrc, length, dst, flags\fR) -.VE -.SH ARGUMENTS -.AS Tcl_Interp ***argvPtr -.AP Tcl_Interp *interp out -.VS -Interpreter to use for error reporting. If NULL, then no error message -is left. -.VE -.AP char *list in -Pointer to a string with proper list structure. -.AP int *argcPtr out -Filled in with number of elements in \fIlist\fR. -.AP char ***argvPtr out -\fI*argvPtr\fR will be filled in with the address of an array of -pointers to the strings that are the extracted elements of \fIlist\fR. -There will be \fI*argcPtr\fR valid entries in the array, followed by -a NULL entry. -.AP int argc in -Number of elements in \fIargv\fR. -.AP char **argv in -Array of strings to merge together into a single list. -Each string will become a separate element of the list. -.AP char *src in -String that is to become an element of a list. -.AP int *flagsPtr in -Pointer to word to fill in with information about \fIsrc\fR. -The value of *\fIflagsPtr\fR must be passed to \fBTcl_ConvertElement\fR. -.VS -.AP int length in -Number of bytes in string \fIsrc\fR. -.VE -.AP char *dst in -Place to copy converted list element. Must contain enough characters -to hold converted string. -.AP int flags in -Information about \fIsrc\fR. Must be value returned by previous -call to \fBTcl_ScanElement\fR, possibly OR-ed -with \fBTCL_DONT_USE_BRACES\fR. -.BE - -.SH DESCRIPTION -.PP -These procedures may be used to disassemble and reassemble Tcl lists. -\fBTcl_SplitList\fR breaks a list up into its constituent elements, -returning an array of pointers to the elements using -\fIargcPtr\fR and \fIargvPtr\fR. -While extracting the arguments, \fBTcl_SplitList\fR obeys the usual -rules for backslash substitutions and braces. The area of -memory pointed to by \fI*argvPtr\fR is dynamically allocated; in -addition to the array of pointers, it -also holds copies of all the list elements. It is the caller's -responsibility to free up all of this storage. -For example, suppose that you have called \fBTcl_SplitList\fR with -the following code: -.CS -int argc, code; -char *string; -char **argv; -\&... -code = Tcl_SplitList(interp, string, &argc, &argv); -.CE -Then you should eventually free the storage with a call like the -following: -.VS -.CS -Tcl_Free((char *) argv); -.CE -.VE -.PP -\fBTcl_SplitList\fR normally returns \fBTCL_OK\fR, which means the list was -successfully parsed. -If there was a syntax error in \fIlist\fR, then \fBTCL_ERROR\fR is returned -and \fIinterp->result\fR will point to an error message describing the -.VS -problem (if \fIinterp\fR was not NULL). -.VE -If \fBTCL_ERROR\fR is returned then no memory is allocated and \fI*argvPtr\fR -is not modified. -.PP -\fBTcl_Merge\fR is the inverse of \fBTcl_SplitList\fR: it -takes a collection of strings given by \fIargc\fR -and \fIargv\fR and generates a result string -that has proper list structure. -This means that commands like \fBindex\fR may be used to -extract the original elements again. -In addition, if the result of \fBTcl_Merge\fR is passed to \fBTcl_Eval\fR, -it will be parsed into \fIargc\fR words whose values will -be the same as the \fIargv\fR strings passed to \fBTcl_Merge\fR. -\fBTcl_Merge\fR will modify the list elements with braces and/or -backslashes in order to produce proper Tcl list structure. -.VS -The result string is dynamically allocated -using \fBTcl_Alloc\fR; the caller must eventually release the space -using \fBTcl_Free\fR. -.VE -.PP -If the result of \fBTcl_Merge\fR is passed to \fBTcl_SplitList\fR, -the elements returned by \fBTcl_SplitList\fR will be identical to -those passed into \fBTcl_Merge\fR. -However, the converse is not true: if \fBTcl_SplitList\fR -is passed a given string, and the resulting \fIargc\fR and -\fIargv\fR are passed to \fBTcl_Merge\fR, the resulting string -may not be the same as the original string passed to \fBTcl_SplitList\fR. -This is because \fBTcl_Merge\fR may use backslashes and braces -differently than the original string. -.PP -\fBTcl_ScanElement\fR and \fBTcl_ConvertElement\fR are the -procedures that do all of the real work of \fBTcl_Merge\fR. -\fBTcl_ScanElement\fR scans its \fIsrc\fR argument -and determines how to use backslashes and braces -when converting it to a list element. -It returns an overestimate of the number of characters -required to represent \fIsrc\fR as a list element, and -it stores information in \fI*flagsPtr\fR that is needed -by \fBTcl_ConvertElement\fR. -.PP -\fBTcl_ConvertElement\fR is a companion procedure to \fBTcl_ScanElement\fR. -It does the actual work of converting a string to a list element. -Its \fIflags\fR argument must be the same as the value returned -by \fBTcl_ScanElement\fR. -\fBTcl_ConvertElement\fR writes a proper list element to memory -starting at *\fIdst\fR and returns a count of the total number -of characters written, which will be no more than the result -returned by \fBTcl_ScanElement\fR. -\fBTcl_ConvertElement\fR writes out only the actual list element -without any leading or trailing spaces: it is up to the caller to -include spaces between adjacent list elements. -.PP -\fBTcl_ConvertElement\fR uses one of two different approaches to -handle the special characters in \fIsrc\fR. Wherever possible, it -handles special characters by surrounding the string with braces. -This produces clean-looking output, but can't be used in some situations, -such as when \fIsrc\fR contains unmatched braces. -In these situations, \fBTcl_ConvertElement\fR handles special -characters by generating backslash sequences for them. -The caller may insist on the second approach by OR-ing the -flag value returned by \fBTcl_ScanElement\fR with -\fBTCL_DONT_USE_BRACES\fR. -Although this will produce an uglier result, it is useful in some -special situations, such as when \fBTcl_ConvertElement\fR is being -used to generate a portion of an argument for a Tcl command. -In this case, surrounding \fIsrc\fR with curly braces would cause -the command not to be parsed correctly. -.PP -.VS -\fBTcl_ScanCountedElement\fR and \fBTcl_ConvertCountedElement\fR are -the same as \fBTcl_ScanElement\fR and \fBTcl_ConvertElement\fR, except -the length of string \fIsrc\fR is specified by the \fIlength\fR -argument, and the string may contain embedded nulls. -.VE - -.SH KEYWORDS -backslash, convert, element, list, merge, split, strings diff --git a/doc/SplitPath.3 b/doc/SplitPath.3 deleted file mode 100644 index b112b82..0000000 --- a/doc/SplitPath.3 +++ /dev/null @@ -1,93 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: SplitPath.3,v 1.2 1998/09/14 18:39:50 stanton Exp $ -'\" -.so man.macros -.TH Tcl_SplitPath 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_SplitPath, Tcl_JoinPath, Tcl_GetPathType \- manipulate platform-dependent file paths -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_SplitPath\fR(\fIpath, argcPtr, argvPtr\fR) -.sp -char * -\fBTcl_JoinPath\fR(\fIargc, argv, resultPtr\fR) -.sp -Tcl_PathType -\fBTcl_GetPathType\fR(\fIpath\fR) -.SH ARGUMENTS -.AS Tcl_DString ***argvPtr -.AP char *path in -File path in a form appropriate for the current platform (see the -\fBfilename\fR manual entry for acceptable forms for path names). -.AP int *argcPtr out -Filled in with number of path elements in \fIpath\fR. -.AP char ***argvPtr out -\fI*argvPtr\fR will be filled in with the address of an array of -pointers to the strings that are the extracted elements of \fIpath\fR. -There will be \fI*argcPtr\fR valid entries in the array, followed by -a NULL entry. -.AP int argc in -Number of elements in \fIargv\fR. -.AP char **argv in -Array of path elements to merge together into a single path. -.AP Tcl_DString *resultPtr in/out -A pointer to an initialized \fBTcl_DString\fR to which the result of -\fBTcl_JoinPath\fR will be appended. -.BE - -.SH DESCRIPTION -.PP -These procedures may be used to disassemble and reassemble file -paths in a platform independent manner: they provide C-level access to -the same functionality as the \fBfile split\fR, \fBfile join\fR, and -\fBfile pathtype\fR commands. -.PP -\fBTcl_SplitPath\fR breaks a path into its constituent elements, -returning an array of pointers to the elements using \fIargcPtr\fR and -\fIargvPtr\fR. The area of memory pointed to by \fI*argvPtr\fR is -dynamically allocated; in addition to the array of pointers, it also -holds copies of all the path elements. It is the caller's -responsibility to free all of this storage. -For example, suppose that you have called \fBTcl_SplitPath\fR with the -following code: -.CS -int argc; -char *path; -char **argv; -\&... -Tcl_SplitPath(string, &argc, &argv); -.CE -Then you should eventually free the storage with a call like the -following: -.CS -Tcl_Free((char *) argv); -.CE -.PP -\fBTcl_JoinPath\fR is the inverse of \fBTcl_SplitPath\fR: it takes a -collection of path elements given by \fIargc\fR and \fIargv\fR and -generates a result string that is a properly constructed path. The -result string is appended to \fIresultPtr\fR. \fIResultPtr\fR must -refer to an initialized \fBTcl_DString\fR. -.PP -If the result of \fBTcl_SplitPath\fR is passed to \fBTcl_JoinPath\fR, -the result will refer to the same location, but may not be in the same -form. This is because \fBTcl_SplitPath\fR and \fBTcl_JoinPath\fR -eliminate duplicate path separators and return a normalized form for -each platform. -.PP -\fBTcl_GetPathType\fR returns the type of the specified \fIpath\fR, -where \fBTcl_PathType\fR is one of \fBTCL_PATH_ABSOLUTE\fR, -\fBTCL_PATH_RELATIVE\fR, or \fBTCL_PATH_VOLUME_RELATIVE\fR. See the -\fBfilename\fR manual entry for a description of the path types for -each platform. - -.SH KEYWORDS -file, filename, join, path, split, type diff --git a/doc/StaticPkg.3 b/doc/StaticPkg.3 deleted file mode 100644 index e268b5f..0000000 --- a/doc/StaticPkg.3 +++ /dev/null @@ -1,70 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: StaticPkg.3,v 1.2 1998/09/14 18:39:50 stanton Exp $ -'\" -.so man.macros -.TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_StaticPackage \- make a statically linked package available via the \fBload\fR command -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_StaticPackage\fR(\fIinterp, pkgName, initProc, safeInitProc\fR) -.SH ARGUMENTS -.AS Tcl_PackageInitProc *safeInitProc -.AP Tcl_Interp *interp in -If not NULL, points to an interpreter into which the package has -already been loaded (i.e., the caller has already invoked the -appropriate initialization procedure). NULL means the package -hasn't yet been incorporated into any interpreter. -.AP char *pkgName in -Name of the package; should be properly capitalized (first letter -upper-case, all others lower-case). -.AP Tcl_PackageInitProc *initProc in -Procedure to invoke to incorporate this package into a trusted -interpreter. -.AP Tcl_PackageInitProc *safeInitProc in -Procedure to call to incorporate this package into a safe interpreter -(one that will execute untrusted scripts). NULL means the package -can't be used in safe interpreters. -.BE - -.SH DESCRIPTION -.PP -This procedure may be invoked to announce that a package has been -linked statically with a Tcl application and, optionally, that it -has already been loaded into an interpreter. -Once \fBTcl_StaticPackage\fR has been invoked for a package, it -may be loaded into interpreters using the \fBload\fR command. -\fBTcl_StaticPackage\fR is normally invoked only by the \fBTcl_AppInit\fR -procedure for the application, not by packages for themselves -(\fBTcl_StaticPackage\fR should only be invoked for statically -loaded packages, and code in the package itself should not need -to know whether the package is dynamically or statically loaded). -.PP -When the \fBload\fR command is used later to load the package into -an interpreter, one of \fIinitProc\fR and \fIsafeInitProc\fR will -be invoked, depending on whether the target interpreter is safe -or not. -\fIinitProc\fR and \fIsafeInitProc\fR must both match the -following prototype: -.CS -typedef int Tcl_PackageInitProc(Tcl_Interp *\fIinterp\fR); -.CE -The \fIinterp\fR argument identifies the interpreter in which the -package is to be loaded. The initialization procedure must return -\fBTCL_OK\fR or \fBTCL_ERROR\fR to indicate whether or not it completed -successfully; in the event of an error it should set \fIinterp->result\fR -to point to an error message. -The result or error from the initialization procedure will be returned -as the result of the \fBload\fR command that caused the -initialization procedure to be invoked. - -.SH KEYWORDS -initialization procedure, package, static linking diff --git a/doc/StrMatch.3 b/doc/StrMatch.3 deleted file mode 100644 index 09cd6df..0000000 --- a/doc/StrMatch.3 +++ /dev/null @@ -1,39 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: StrMatch.3,v 1.2 1998/09/14 18:39:50 stanton Exp $ -'\" -.so man.macros -.TH Tcl_StringMatch 3 "" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_StringMatch \- test whether a string matches a pattern -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_StringMatch\fR(\fIstring\fR, \fIpattern\fR) -.SH ARGUMENTS -.AP char *string in -String to test. -.AP char *pattern in -Pattern to match against string. May contain special -characters from the set *?\e[]. -.BE - -.SH DESCRIPTION -.PP -This utility procedure determines whether a string matches -a given pattern. If it does, then \fBTcl_StringMatch\fR returns -1. Otherwise \fBTcl_StringMatch\fR returns 0. The algorithm -used for matching is the same algorithm used in the ``string match'' -Tcl command and is similar to the algorithm used by the C-shell -for file name matching; see the Tcl manual entry for details. - -.SH KEYWORDS -match, pattern, string diff --git a/doc/StringObj.3 b/doc/StringObj.3 deleted file mode 100644 index 46fe959..0000000 --- a/doc/StringObj.3 +++ /dev/null @@ -1,161 +0,0 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: StringObj.3,v 1.4 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl_StringObj 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_NewStringObj, Tcl_SetStringObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_AppendToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendObjToObj, Tcl_SetObjLength, Tcl_ConcatObj \- manipulate Tcl objects as strings -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_Obj * -\fBTcl_NewStringObj\fR(\fIbytes, length\fR) -.sp -\fBTcl_SetStringObj\fR(\fIobjPtr, bytes, length\fR) -.sp -char * -\fBTcl_GetStringFromObj\fR(\fIobjPtr, lengthPtr\fR) -.sp -char * -\fBTcl_GetString\fR(\fIobjPtr\fR) -.sp -\fBTcl_AppendToObj\fR(\fIobjPtr, bytes, length\fR) -.VS -.sp -\fBTcl_AppendObjToObj\fR(\fIobjPtr, appendObjPtr\fR) -.VE -.sp -\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fB(char *) NULL\fR) -.sp -\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR) -.sp -\fBTcl_SetObjLength\fR(\fIobjPtr, newLength\fR) -.sp -Tcl_Obj * -\fBTcl_ConcatObj\fR(\fIobjc, objv\fR) -.SH ARGUMENTS -.AS Tcl_Interp *appendObjPtr in/out -.AP char *bytes in -Points to the first byte of an array of bytes -used to set or append to a string object. -This byte array may contain embedded null bytes -unless \fIlength\fR is negative. -.AP int length in -The number of bytes to copy from \fIbytes\fR when -initializing, setting, or appending to a string object. -If negative, all bytes up to the first null are used. -.AP Tcl_Obj *objPtr in/out -Points to an object to manipulate. -.VS -.AP Tcl_Obj *appendObjPtr in -The object to append to \fIobjPtr\fR in \fBTcl_AppendObjToObj\fR. -.VE -.AP int *lengthPtr out -If non-NULL, the location where \fBTcl_GetStringFromObj\fR will store -the the length of an object's string representation. -.AP char *string in -Null-terminated string value to append to \fIobjPtr\fR. -.AP va_list argList in -An argument list which must have been initialised using -\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR. -.AP int newLength in -New length for the string value of \fIobjPtr\fR, not including the -final NULL character. -.AP int objc in -The number of elements to concatenate. -.AP Tcl_Obj *objv[] in -The array of objects to concatenate. -.BE - -.SH DESCRIPTION -.PP -The procedures described in this manual entry allow Tcl objects to -be manipulated as string values. They use the internal representation -of the object to store additional information to make the string -manipulations more efficient. In particular, they make a series of -append operations efficient by allocating extra storage space for the -string so that it doesn't have to be copied for each append. -.PP -\fBTcl_NewStringObj\fR and \fBTcl_SetStringObj\fR create a new object -or modify an existing object to hold a copy of -the string given by \fIbytes\fR and \fIlength\fR. -\fBTcl_NewStringObj\fR returns a pointer to a newly created object -with reference count zero. -Both procedures set the object to hold a copy of the specified string. -\fBTcl_SetStringObj\fR frees any old string representation -as well as any old internal representation of the object. -.PP -\fBTcl_GetStringFromObj\fR and \fBTcl_GetString\fR -return an object's string representation. -This is given by the returned byte pointer -and (for \fBTcl_GetStringFromObj\fR) length, -which is stored in \fIlengthPtr\fR if it is non-NULL. -If the object's string representation is invalid -(its byte pointer is NULL), -the string representation is regenerated from the -object's internal representation. -The storage referenced by the returned byte pointer -is owned by the object manager and should not be modified by the caller. -The procedure \fBTcl_GetString\fR is used in the common case -where the caller does not need the length of the string representation. -.PP -\fBTcl_AppendToObj\fR appends the data given by \fIbytes\fR and -\fIlength\fR to the object specified by \fIobjPtr\fR. It does this -in a way that handles repeated calls relatively efficiently (it -overallocates the string space to avoid repeated reallocations -and copies of object's string value). -.VS -.PP -\fBTcl_AppendObjToObj\fR is similar to \fBTcl_AppendToObj\fR, but it -appends the string value of \fIappendObjPtr\fR to \fIobjPtr\fR. -.VE -.PP -\fBTcl_AppendStringsToObj\fR is similar to \fBTcl_AppendToObj\fR -except that it can be passed more than one value to append and -each value must be a null-terminated string (i.e. none of the -values may contain internal null characters). Any number of -\fIstring\fR arguments may be provided, but the last argument -must be a NULL pointer to indicate the end of the list. -.PP -\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR -except that instead of taking a variable number of arguments it takes an -argument list. -.PP -The \fBTcl_SetObjLength\fR procedure changes the length of the -string value of its \fIobjPtr\fR argument. If the \fInewLength\fR -argument is greater than the space allocated for the object's -string, then the string space is reallocated and the old value -is copied to the new space; the bytes between the old length of -the string and the new length may have arbitrary values. -If the \fInewLength\fR argument is less than the current length -of the object's string, with \fIobjPtr->length\fR is reduced without -reallocating the string space; the original allocated size for the -string is recorded in the object, so that the string length can be -enlarged in a subsequent call to \fBTcl_SetObjLength\fR without -reallocating storage. In all cases \fBTcl_SetObjLength\fR leaves -a null character at \fIobjPtr->bytes[newLength]\fR. -.PP -The \fBTcl_ConcatObj\fR function returns a new string object whose -value is the space-separated concatenation of the string -representations of all of the objects in the \fIobjv\fR -array. \fBTcl_ConcatObj\fR eliminates leading and trailing white space -as it copies the string representations of the \fIobjv\fR array to the -result. If an element of the \fIobjv\fR array consists of nothing but -white space, then that object is ignored entirely. This white-space -removal was added to make the output of the \fBconcat\fR command -cleaner-looking. \fBTcl_ConcatObj\fR returns a pointer to a -newly-created object whose ref count is zero. - -.SH "SEE ALSO" -Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount - -.SH KEYWORDS -append, internal representation, object, object type, string object, -string type, string representation, concat, concatenate diff --git a/doc/Tcl.n b/doc/Tcl.n deleted file mode 100644 index 6bd8511..0000000 --- a/doc/Tcl.n +++ /dev/null @@ -1,195 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Tcl.n,v 1.3 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl n "8.1" Tcl "Tcl Built-In Commands" -.BS -.SH NAME -Tcl \- Summary of Tcl language syntax. -.BE - -.SH DESCRIPTION -.PP -The following rules define the syntax and semantics of the Tcl language: -.IP [1] -A Tcl script is a string containing one or more commands. -Semi-colons and newlines are command separators unless quoted as -described below. -Close brackets are command terminators during command substitution -(see below) unless quoted. -.IP [2] -A command is evaluated in two steps. -First, the Tcl interpreter breaks the command into \fIwords\fR -and performs substitutions as described below. -These substitutions are performed in the same way for all -commands. -The first word is used to locate a command procedure to -carry out the command, then all of the words of the command are -passed to the command procedure. -The command procedure is free to interpret each of its words -in any way it likes, such as an integer, variable name, list, -or Tcl script. -Different commands interpret their words differently. -.IP [3] -Words of a command are separated by white space (except for -newlines, which are command separators). -.IP [4] -If the first character of a word is double-quote (``"'') then -the word is terminated by the next double-quote character. -If semi-colons, close brackets, or white space characters -(including newlines) appear between the quotes then they are treated -as ordinary characters and included in the word. -Command substitution, variable substitution, and backslash substitution -are performed on the characters between the quotes as described below. -The double-quotes are not retained as part of the word. -.IP [5] -If the first character of a word is an open brace (``{'') then -the word is terminated by the matching close brace (``}''). -Braces nest within the word: for each additional open -brace there must be an additional close brace (however, -if an open brace or close brace within the word is -quoted with a backslash then it is not counted in locating the -matching close brace). -No substitutions are performed on the characters between the -braces except for backslash-newline substitutions described -below, nor do semi-colons, newlines, close brackets, -or white space receive any special interpretation. -The word will consist of exactly the characters between the -outer braces, not including the braces themselves. -.IP [6] -If a word contains an open bracket (``['') then Tcl performs -\fIcommand substitution\fR. -To do this it invokes the Tcl interpreter recursively to process -the characters following the open bracket as a Tcl script. -The script may contain any number of commands and must be terminated -by a close bracket (``]''). -The result of the script (i.e. the result of its last command) is -substituted into the word in place of the brackets and all of the -characters between them. -There may be any number of command substitutions in a single word. -Command substitution is not performed on words enclosed in braces. -.IP [7] -If a word contains a dollar-sign (``$'') then Tcl performs \fIvariable -substitution\fR: the dollar-sign and the following characters are -replaced in the word by the value of a variable. -Variable substitution may take any of the following forms: -.RS -.TP 15 -\fB$\fIname\fR -\fIName\fR is the name of a scalar variable; the name is terminated -by any character that isn't a letter, digit, or underscore. -.TP 15 -\fB$\fIname\fB(\fIindex\fB)\fR -\fIName\fR gives the name of an array variable and \fIindex\fR gives -the name of an element within that array. -\fIName\fR must contain only letters, digits, and underscores. -Command substitutions, variable substitutions, and backslash -substitutions are performed on the characters of \fIindex\fR. -.TP 15 -\fB${\fIname\fB}\fR -\fIName\fR is the name of a scalar variable. It may contain any -characters whatsoever except for close braces. -.LP -There may be any number of variable substitutions in a single word. -Variable substitution is not performed on words enclosed in braces. -.RE -.IP [8] -If a backslash (``\e'') appears within a word then -\fIbackslash substitution\fR occurs. -In all cases but those described below the backslash is dropped and -the following character is treated as an ordinary -character and included in the word. -This allows characters such as double quotes, close brackets, -and dollar signs to be included in words without triggering -special processing. -The following table lists the backslash sequences that are -handled specially, along with the value that replaces each sequence. -.RS -.TP 7 -\e\fBa\fR -Audible alert (bell) (0x7). -.TP 7 -\e\fBb\fR -Backspace (0x8). -.TP 7 -\e\fBf\fR -Form feed (0xc). -.TP 7 -\e\fBn\fR -Newline (0xa). -.TP 7 -\e\fBr\fR -Carriage-return (0xd). -.TP 7 -\e\fBt\fR -Tab (0x9). -.TP 7 -\e\fBv\fR -Vertical tab (0xb). -.TP 7 -\e\fB\fIwhiteSpace\fR -. -A single space character replaces the backslash, newline, and all spaces -and tabs after the newline. This backslash sequence is unique in that it -is replaced in a separate pre-pass before the command is actually parsed. -This means that it will be replaced even when it occurs between braces, -and the resulting space will be treated as a word separator if it isn't -in braces or quotes. -.TP 7 -\e\e -Backslash (``\e''). -.VS 8.1 br -.TP 7 -\e\fIooo\fR -. -The digits \fIooo\fR (one, two, or three of them) give an eight-bit octal -value for the Unicode character that will be inserted. The upper bits of the -Unicode character will be 0. -.TP 7 -\e\fBx\fIhh\fR -. -The hexadecimal digits \fIhh\fR give an eight-bit hexadecimal value for the -Unicode character that will be inserted. Any number of hexadecimal digits -may be present; however, all but the last two are ignored (the result is -always a one-byte quantity). The upper bits of the Unicode character will -be 0. -.TP 7 -\e\fBu\fIhhhh\fR -. -The hexadecimal digits \fIhhhh\fR (one, two, three, or four of them) give a -sixteen-bit hexadecimal value for the Unicode character that will be -inserted. -.VE -.LP -Backslash substitution is not performed on words enclosed in braces, -except for backslash-newline as described above. -.RE -.IP [9] -If a hash character (``#'') appears at a point where Tcl is -expecting the first character of the first word of a command, -then the hash character and the characters that follow it, up -through the next newline, are treated as a comment and ignored. -The comment character only has significance when it appears -at the beginning of a command. -.IP [10] -Each character is processed exactly once by the Tcl interpreter -as part of creating the words of a command. -For example, if variable substitution occurs then no further -substitutions are performed on the value of the variable; the -value is inserted into the word verbatim. -If command substitution occurs then the nested command is -processed entirely by the recursive call to the Tcl interpreter; -no substitutions are performed before making the recursive -call and no additional substitutions are performed on the result -of the nested script. -.IP [11] -Substitutions do not affect the word boundaries of a command. -For example, during variable substitution the entire value of -the variable becomes part of a single word, even if the variable's -value contains spaces. diff --git a/doc/Tcl_Main.3 b/doc/Tcl_Main.3 deleted file mode 100644 index 0979994..0000000 --- a/doc/Tcl_Main.3 +++ /dev/null @@ -1,61 +0,0 @@ -'\" -'\" Copyright (c) 1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: Tcl_Main.3,v 1.2 1998/09/14 18:39:50 stanton Exp $ -'\" -.so man.macros -.TH Tcl_Main 3 7.4 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Main \- main program for Tcl-based applications -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_Main\fR(\fIargc, argv, appInitProc\fR) -.SH ARGUMENTS -.AS Tcl_AppInitProc *appInitProc -.AP int argc in -Number of elements in \fIargv\fR. -.AP char *argv[] in -Array of strings containing command-line arguments. -.AP Tcl_AppInitProc *appInitProc in -Address of an application-specific initialization procedure. -The value for this argument is usually \fBTcl_AppInit\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_Main\fR acts as the main program for most Tcl-based applications. -Starting with Tcl 7.4 it is not called \fBmain\fR anymore because it -is part of the Tcl library and having a function \fBmain\fR -in a library (particularly a shared library) causes problems on many -systems. -Having \fBmain\fR in the Tcl library would also make it hard to use -Tcl in C++ programs, since C++ programs must have special C++ -\fBmain\fR functions. -.PP -Normally each application contains a small \fBmain\fR function that does -nothing but invoke \fBTcl_Main\fR. -\fBTcl_Main\fR then does all the work of creating and running a -\fBtclsh\fR-like application. -.PP -When it is has finished its own initialization, but before -it processes commands, \fBTcl_Main\fR calls the procedure given by -the \fIappInitProc\fR argument. This procedure provides a ``hook'' -for the application to perform its own initialization, such as defining -application-specific commands. The procedure must have an interface -that matches the type \fBTcl_AppInitProc\fR: -.CS -typedef int Tcl_AppInitProc(Tcl_Interp *\fIinterp\fR); -.CE -\fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR; -for more details on this procedure, see the documentation -for \fBTcl_AppInit\fR. - -.SH KEYWORDS -application-specific initialization, command-line arguments, main program diff --git a/doc/Thread.3 b/doc/Thread.3 deleted file mode 100644 index 595fac3..0000000 --- a/doc/Thread.3 +++ /dev/null @@ -1,100 +0,0 @@ -'\" -'\" Copyright (c) 1998 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: Thread.3,v 1.2 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl_ConditionNotify 3 "8.1" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_ConditionNotify, Tcl_ConditionWait, Tcl_GetThreadData, Tcl_MutexLock, Tcl_MutexUnlock \- thread synchronization support. -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -void -\fBTcl_ConditionNotify\fR(\fIcondPtr\fR) -.sp -void -\fBTcl_ConditionWait\fR(\fIcondPtr, mutexPtr, timePtr\fR) -.sp -VOID * -\fBTcl_GetThreadData\fR(\fIkeyPtr, size\fR) -.sp -void -\fBTcl_MutexLock\fR(\fImutexPtr\fR) -.sp -void -\fBTcl_MutexUnlock\fR(\fImutexPtr\fR) -.SH ARGUMENTS -.AS Tcl_ThreadDataKey *keyPtr -.AP Tcl_Condition *condPtr in -A condition variable, which must be associated with a mutex lock. -.AP Tcl_Condition *mutexPtr in -A mutex lock. -.AP Tcl_Time *timePtr in -A time limit on the condition wait. NULL to wait forever. -Note that a polling value of 0 seconds doesn't make much sense. -.AP Tcl_ThreadDataKey *keyPtr in -This identifies a block of thread local storage. The key should be -static and process-wide, yet each thread will end up associating -a different block of storage with this key. -.AP int *size in -The size of the thread local storage block. This amount of data -is allocated and initialized to zero the first time each thread -calls \fBTcl_GetThreadData\fR. -.BE - -.SH DESCRIPTION -.PP -A mutex is a lock that is used to serialize all threads through a piece -of code by calling \fBTcl_MutexLock\fR and \fBTcl_MutexUnlock\fR. -If one thread holds a mutex, any other thread calling \fBTcl_MutexLock\fR will -block until \fBTcl_MutexUnlock\fR is called. -.VS -The result of locking a mutex twice from the same thread is undefined. -On some platforms it will result in a deadlock. -.VE -\fBTcl_MutexLock\fR and \fBTcl_MutexUnlock\fR -procedures are defined as empty macros if not compiling with threads enabled. -.PP -A condition variable is used as a signaling mechanism: -a thread can lock a mutex and then wait on a condition variable -with \fBTcl_ConditionWait\fR. This atomically releases the mutex lock -and blocks the waiting thread until another thread calls -\fBTcl_ConditionNotify\fR. The caller of \fBTcl_ConditionNotify\fR should -have the associated mutex held by previously calling \fBTcl_MutexLock\fR, -but this is not enforced. Notifying the -condition variable unblocks all threads waiting on the condition variable, -but they do not proceed until the mutex is released with \fBTcl_MutexUnlock\fR. -The implementation of \fBTcl_ConditionWait\fR automatically locks -the mutex before returning. -.PP -The caller of \fBTcl_ConditionWait\fR should be prepared for spurious -notifications by calling \fBTcl_ConditionWait\fR within a while loop -that tests some invariant. -.PP -The \fBTcl_GetThreadData\fR call returns a pointer to a block of -thread-private data. Its argument is a key that is shared by all threads -and a size for the block of storage. The storage is automatically -allocated and initialized to all zeros the first time each thread asks for it. -The storage is automatically deallocated by \fBTcl_FinalizeThread\fR -.SH INITIALIZATION -.PP -.PP -All of these synchronization objects are self initializing. -They are implemented as opaque pointers that should be NULL -upon first use. -The mutexes and condition variables are -cleaned up by process exit handlers. Thread local storage is -reclaimed during \fBTcl_FinalizeThread\fR. -.SH CREATING THREADS -The API to create threads is not finalized at this time. -There are private facilities to create threads that contain a new -Tcl interpreter, and to send scripts among threads. -Dive into tclThreadTest.c and tclThread.c for examples. -.SH KEYWORDS -thread, mutex, condition variable, thread local storage diff --git a/doc/ToUpper.3 b/doc/ToUpper.3 deleted file mode 100644 index 639dd61..0000000 --- a/doc/ToUpper.3 +++ /dev/null @@ -1,90 +0,0 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: ToUpper.3,v 1.2 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl_UtfToUpper 3 "8.1" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_UniCharToUpper, Tcl_UniCharToLower, Tcl_UniCharToTitle, Tcl_UtfToUpper, Tcl_UtfToLower, Tcl_UtfToTitle \- routines for manipulating the case of Unicode characters and UTF-8 strings. -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tcl_UniChar -\fBTcl_UniCharToUpper\fR(\fIch\fR) -.sp -Tcl_UniChar -\fBTcl_UniCharToLower\fR(\fIch\fR) -.sp -Tcl_UniChar -\fBTcl_UniCharToTitle\fR(\fIch\fR) -.sp -int -\fBTcl_UtfToUpper\fR(\fIstr\fR) -.sp -int -\fBTcl_UtfToLower\fR(\fIstr\fR) -.sp -int -\fBTcl_UtfToTitle\fR(\fIstr\fR) -.SH ARGUMENTS -.AS char *str in/out -.AP int ch in -The Tcl_UniChar to be converted. -.AP char *str in/out -Pointer to UTF-8 string to be converted in place. -.BE - -.SH DESCRIPTION -.PP -The first three routines convert the case of individual Unicode characters: -.PP -If \fIch\fR represents a lower-case character, -\fBTcl_UniCharToUpper\fR returns the corresponding upper-case -character. If no upper-case character is defined, it returns the -character unchanged. -.PP -If \fIch\fR represents an upper-case character, -\fBTcl_UniCharToLower\fR returns the corresponding lower-case -character. If no lower-case character is defined, it returns the -character unchanged. -.PP -If \fIch\fR represents a lower-case character, -\fBTcl_UniCharToTitle\fR returns the corresponding title-case -character. If no title-case character is defined, it returns the -corresponding upper-case character. If no upper-case character is -defined, it returns the character unchanged. Title-case is defined -for a small number of characters that have a different appearance when -they are at the beginning of a capitalized word. -.PP -The next three routines convert the case of UTF-8 strings in place in -memory: -.PP -\fBTcl_UtfToUpper\fR changes every UTF-8 character in \fIstr\fR to -upper-case. Because changing the case of a character may change its -size, the byte offset of each character in the resulting string may -differ from its original location. \fBTcl_UtfToUpper\fR writes a null -byte at the end of the converted string. \fBTcl_UtfToUpper\fR returns -the new length of the string in bytes. This new length is guaranteed -to be no longer than the original string length. -.PP -\fBTcl_UtfToLower\fR is the same as \fBTcl_UtfToUpper\fR except it -turns each character in the string into its lower-case equivalent. -.PP -\fBTcl_UtfToTitle\fR is the same as \fBTcl_UtfToUpper\fR except it -turns the first character in the string into its title-case equivalent -and all following characters into their lower-case equivalents. - -.SH BUGS -.PP -At this time, the case conversions are only defined for the ISO8859-1 -characters. Unicode characters above 0x00ff are not modified by these -routines. - -.SH KEYWORDS -utf, unicode, toupper, tolower, totitle, case diff --git a/doc/TraceVar.3 b/doc/TraceVar.3 deleted file mode 100644 index 57a3350..0000000 --- a/doc/TraceVar.3 +++ /dev/null @@ -1,366 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: TraceVar.3,v 1.3 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_TraceVar, Tcl_TraceVar2, Tcl_UntraceVar, Tcl_UntraceVar2, Tcl_VarTraceInfo, Tcl_VarTraceInfo2 \- monitor accesses to a variable -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_TraceVar(\fIinterp, varName, flags, proc, clientData\fB)\fR -.sp -int -\fBTcl_TraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR -.sp -\fBTcl_UntraceVar(\fIinterp, varName, flags, proc, clientData\fB)\fR -.sp -\fBTcl_UntraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR -.sp -ClientData -\fBTcl_VarTraceInfo(\fIinterp, varName, flags, proc, prevClientData\fB)\fR -.sp -ClientData -\fBTcl_VarTraceInfo2(\fIinterp, name1, name2, flags, proc, prevClientData\fB)\fR -.SH ARGUMENTS -.AS Tcl_VarTraceProc prevClientData -.AP Tcl_Interp *interp in -Interpreter containing variable. -.AP char *varName in -Name of variable. May refer to a scalar variable, to -an array variable with no index, or to an array variable -with a parenthesized index. -If the name references an element of an array, then it -must be in writable memory: Tcl will make temporary modifications -to it while looking up the name. -.AP int flags in -OR-ed combination of the values TCL_TRACE_READS, TCL_TRACE_WRITES, and -TCL_TRACE_UNSETS, TCL_TRACE_ARRAY, and TCL_GLOBAL_ONLY. -Not all flags are used by all -procedures. See below for more information. -.AP Tcl_VarTraceProc *proc in -Procedure to invoke whenever one of the traced operations occurs. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.AP char *name1 in -Name of scalar or array variable (without array index). -.AP char *name2 in -For a trace on an element of an array, gives the index of the -element. For traces on scalar variables or on whole arrays, -is NULL. -.AP ClientData prevClientData in -If non-NULL, gives last value returned by \fBTcl_VarTraceInfo\fR or -\fBTcl_VarTraceInfo2\fR, so this call will return information about -next trace. If NULL, this call will return information about first -trace. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_TraceVar\fR allows a C procedure to monitor and control -access to a Tcl variable, so that the C procedure is invoked -whenever the variable is read or written or unset. -If the trace is created successfully then \fBTcl_TraceVar\fR returns -TCL_OK. If an error occurred (e.g. \fIvarName\fR specifies an element -of an array, but the actual variable isn't an array) then TCL_ERROR -is returned and an error message is left in \fIinterp->result\fR. -.PP -The \fIflags\fR argument to \fBTcl_TraceVar\fR indicates when the -trace procedure is to be invoked and provides information -for setting up the trace. It consists of an OR-ed combination -of any of the following values: -.TP -\fBTCL_GLOBAL_ONLY\fR -Normally, the variable will be looked up at the current level of -procedure call; if this bit is set then the variable will be looked -up at global level, ignoring any active procedures. -.TP -\fBTCL_TRACE_READS\fR -Invoke \fIproc\fR whenever an attempt is made to read the variable. -.TP -\fBTCL_TRACE_WRITES\fR -Invoke \fIproc\fR whenever an attempt is made to modify the variable. -.TP -\fBTCL_TRACE_UNSETS\fR -Invoke \fIproc\fR whenever the variable is unset. -A variable may be unset either explicitly by an \fBunset\fR command, -or implicitly when a procedure returns (its local variables are -automatically unset) or when the interpreter is deleted (all -variables are automatically unset). -.TP -\fBTCL_TRACE_ARRAY\fR -Invoke \fIproc\fR whenever the array command is invoked. -This gives the trace procedure a chance to update the array before -array names or array get is called. Note that this is called -before an array set, but that will trigger write traces. -.PP -Whenever one of the specified operations occurs on the variable, -\fIproc\fR will be invoked. -It should have arguments and result that match the type -\fBTcl_VarTraceProc\fR: -.CS -typedef char *Tcl_VarTraceProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - char *\fIname1\fR, - char *\fIname2\fR, - int \fIflags\fR); -.CE -The \fIclientData\fR and \fIinterp\fR parameters will -have the same values as those passed to \fBTcl_TraceVar\fR when the -trace was created. -\fIClientData\fR typically points to an application-specific -data structure that describes what to do when \fIproc\fR -is invoked. -\fIName1\fR and \fIname2\fR give the name of the traced variable -in the normal two-part form (see the description of \fBTcl_TraceVar2\fR -below for details). -\fIFlags\fR is an OR-ed combination of bits providing several -pieces of information. -One of the bits TCL_TRACE_READS, TCL_TRACE_WRITES, TCL_TRACE_ARRAY, -or TCL_TRACE_UNSETS -will be set in \fIflags\fR to indicate which operation is being performed -on the variable. -The bit TCL_GLOBAL_ONLY will be set whenever the variable being -accessed is a global one not accessible from the current level of -procedure call: the trace procedure will need to pass this flag -back to variable-related procedures like \fBTcl_GetVar\fR if it -attempts to access the variable. -The bit TCL_TRACE_DESTROYED will be set in \fIflags\fR if the trace is -about to be destroyed; this information may be useful to \fIproc\fR -so that it can clean up its own internal data structures (see -the section TCL_TRACE_DESTROYED below for more details). -Lastly, the bit TCL_INTERP_DESTROYED will be set if the entire -interpreter is being destroyed. -When this bit is set, \fIproc\fR must be especially careful in -the things it does (see the section TCL_INTERP_DESTROYED below). -The trace procedure's return value should normally be NULL; see -ERROR RETURNS below for information on other possibilities. -.PP -\fBTcl_UntraceVar\fR may be used to remove a trace. -If the variable specified by \fIinterp\fR, \fIvarName\fR, and \fIflags\fR -has a trace set with \fIflags\fR, \fIproc\fR, and -\fIclientData\fR, then the corresponding trace is removed. -If no such trace exists, then the call to \fBTcl_UntraceVar\fR -has no effect. -The same bits are valid for \fIflags\fR as for calls to \fBTcl_TraceVar\fR. -.PP -\fBTcl_VarTraceInfo\fR may be used to retrieve information about -traces set on a given variable. -The return value from \fBTcl_VarTraceInfo\fR is the \fIclientData\fR -associated with a particular trace. -The trace must be on the variable specified by the \fIinterp\fR, -\fIvarName\fR, and \fIflags\fR arguments (only the TCL_GLOBAL_ONLY -bit from \fIflags\fR is used; other bits are ignored) and its trace procedure -must the same as the \fIproc\fR argument. -If the \fIprevClientData\fR argument is NULL then the return -value corresponds to the first (most recently created) matching -trace, or NULL if there are no matching traces. -If the \fIprevClientData\fR argument isn't NULL, then it should -be the return value from a previous call to \fBTcl_VarTraceInfo\fR. -In this case, the new return value will correspond to the next -matching trace after the one whose \fIclientData\fR matches -\fIprevClientData\fR, or NULL if no trace matches \fIprevClientData\fR -or if there are no more matching traces after it. -This mechanism makes it possible to step through all of the -traces for a given variable that have the same \fIproc\fR. - -.SH "TWO-PART NAMES" -.PP -The procedures \fBTcl_TraceVar2\fR, \fBTcl_UntraceVar2\fR, and -\fBTcl_VarTraceInfo2\fR are identical to \fBTcl_TraceVar\fR, -\fBTcl_UntraceVar\fR, and \fBTcl_VarTraceInfo\fR, respectively, -except that the name of the variable consists of two parts. -\fIName1\fR gives the name of a scalar variable or array, -and \fIname2\fR gives the name of an element within an array. -.VS 8.1 -When \fIname2\fR is NULL, -\fIname1\fR may contain both an array and an element name: -if the name contains an open parenthesis and ends with a -close parenthesis, then the value between the parentheses is -treated as an element name (which can have any string value) and -the characters before the first open -parenthesis are treated as the name of an array variable. -If \fIname2\fR is NULL and \fIname1\fR does not refer -to an array element -.VE -it means that either the variable is -a scalar or the trace is to be set on the entire array rather -than an individual element (see WHOLE-ARRAY TRACES below for -more information). - - -.SH "ACCESSING VARIABLES DURING TRACES" -.PP -During read, write, and array traces, the -trace procedure can read, write, or unset the traced -variable using \fBTcl_GetVar2\fR, \fBTcl_SetVar2\fR, and -other procedures. -While \fIproc\fR is executing, traces are temporarily disabled -for the variable, so that calls to \fBTcl_GetVar2\fR and -\fBTcl_SetVar2\fR will not cause \fIproc\fR or other trace procedures -to be invoked again. -Disabling only occurs for the variable whose trace procedure -is active; accesses to other variables will still be traced. -However, if a variable is unset during a read or write trace then unset -traces will be invoked. -.PP -During unset traces the variable has already been completely -expunged. -It is possible for the trace procedure to read or write the -variable, but this will be a new version of the variable. -Traces are not disabled during unset traces as they are for -read and write traces, but existing traces have been removed -from the variable before any trace procedures are invoked. -If new traces are set by unset trace procedures, these traces -will be invoked on accesses to the variable by the trace -procedures. - -.SH "CALLBACK TIMING" -.PP -When read tracing has been specified for a variable, the trace -procedure will be invoked whenever the variable's value is -read. This includes \fBset\fR Tcl commands, \fB$\fR-notation -in Tcl commands, and invocations of the \fBTcl_GetVar\fR -and \fBTcl_GetVar2\fR procedures. -\fIProc\fR is invoked just before the variable's value is -returned. -It may modify the value of the variable to affect what -is returned by the traced access. -If it unsets the variable then the access will return an error -just as if the variable never existed. -.PP -When write tracing has been specified for a variable, the -trace procedure will be invoked whenever the variable's value -is modified. This includes \fBset\fR commands, -commands that modify variables as side effects (such as -\fBcatch\fR and \fBscan\fR), and calls to the \fBTcl_SetVar\fR -and \fBTcl_SetVar2\fR procedures). -\fIProc\fR will be invoked after the variable's value has been -modified, but before the new value of the variable has been -returned. -It may modify the value of the variable to override the change -and to determine the value actually returned by the traced -access. -If it deletes the variable then the traced access will return -an empty string. -.PP -When array tracing has been specified, the trace procedure -will be invoked at the beginning of the array command implementation, -before any of the operations like get, set, or names have been invoked. -The trace procedure can modify the array elements with \fBTcl_SetVar\fR -and \fBTcl_SetVar2\fR. -.PP -When unset tracing has been specified, the trace procedure -will be invoked whenever the variable is destroyed. -The traces will be called after the variable has been -completely unset. - -.SH "WHOLE-ARRAY TRACES" -.PP -If a call to \fBTcl_TraceVar\fR or \fBTcl_TraceVar2\fR specifies -the name of an array variable without an index into the array, -then the trace will be set on the array as a whole. -This means that \fIproc\fR will be invoked whenever any -element of the array is accessed in the ways specified by -\fIflags\fR. -When an array is unset, a whole-array trace will be invoked -just once, with \fIname1\fR equal to the name of the array -and \fIname2\fR NULL; it will not be invoked once for each -element. - -.SH "MULTIPLE TRACES" -.PP -It is possible for multiple traces to exist on the same variable. -When this happens, all of the trace procedures will be invoked on each -access, in order from most-recently-created to least-recently-created. -When there exist whole-array traces for an array as well as -traces on individual elements, the whole-array traces are invoked -before the individual-element traces. -If a read or write trace unsets the variable then all of the unset -traces will be invoked but the remainder of the read and write traces -will be skipped. - -.SH "ERROR RETURNS" -.PP -Under normal conditions trace procedures should return NULL, indicating -successful completion. -If \fIproc\fR returns a non-NULL value it signifies that an -error occurred. -The return value must be a pointer to a static character string -containing an error message. -If a trace procedure returns an error, no further traces are -invoked for the access and the traced access aborts with the -given message. -Trace procedures can use this facility to make variables -read-only, for example (but note that the value of the variable -will already have been modified before the trace procedure is -called, so the trace procedure will have to restore the correct -value). -.PP -The return value from \fIproc\fR is only used during read and -write tracing. -During unset traces, the return value is ignored and all relevant -trace procedures will always be invoked. - -.SH "RESTRICTIONS" -.PP -A trace procedure can be called at any time, even when there -is a partially-formed result in the interpreter's result area. If -the trace procedure does anything that could damage this result (such -as calling \fBTcl_Eval\fR) then it must save the original values of -the interpreter's \fBresult\fR and \fBfreeProc\fR fields and restore -them before it returns. - -.SH "UNDEFINED VARIABLES" -.PP -It is legal to set a trace on an undefined variable. -The variable will still appear to be undefined until the -first time its value is set. -If an undefined variable is traced and then unset, the unset will fail -with an error (``no such variable''), but the trace -procedure will still be invoked. - -.SH "TCL_TRACE_DESTROYED FLAG" -.PP -In an unset callback to \fIproc\fR, the TCL_TRACE_DESTROYED bit -is set in \fIflags\fR if the trace is being removed as part -of the deletion. -Traces on a variable are always removed whenever the variable -is deleted; the only time TCL_TRACE_DESTROYED isn't set is for -a whole-array trace invoked when only a single element of an -array is unset. - -.SH "TCL_INTERP_DESTROYED" -.PP -When an interpreter is destroyed, unset traces are called for -all of its variables. -The TCL_INTERP_DESTROYED bit will be set in the \fIflags\fR -argument passed to the trace procedures. -Trace procedures must be extremely careful in what they do if -the TCL_INTERP_DESTROYED bit is set. -It is not safe for the procedures to invoke any Tcl procedures -on the interpreter, since its state is partially deleted. -All that trace procedures should do under these circumstances is -to clean up and free their own internal data structures. - -.SH BUGS -.PP -Tcl doesn't do any error checking to prevent trace procedures -from misusing the interpreter during traces with TCL_INTERP_DESTROYED -set. -.PP -Array traces are not yet integrated with the Tcl "info exists" command, -nor is there Tcl-level access to array traces. - -.SH KEYWORDS -clientData, trace, variable diff --git a/doc/Translate.3 b/doc/Translate.3 deleted file mode 100644 index 5d0d598..0000000 --- a/doc/Translate.3 +++ /dev/null @@ -1,66 +0,0 @@ -'\" -'\" Copyright (c) 1989-1993 The Regents of the University of California. -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: Translate.3,v 1.3 1999/04/16 00:46:33 stanton Exp $ -'\" -.so man.macros -.TH Tcl_TranslateFileName 3 8.1 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_TranslateFileName \- convert file name to native form and replace tilde with home directory -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -char * -\fBTcl_TranslateFileName\fR(\fIinterp\fR, \fIname\fR, \fIbufferPtr\fR) -.SH ARGUMENTS -.AS Tcl_DString *bufferPtr -.AP Tcl_Interp *interp in -Interpreter in which to report an error, if any. -.AP char *name in -File name, which may start with a ``~''. -.AP Tcl_DString *bufferPtr in/out -If needed, this dynamic string is used to store the new file name. -At the time of the call it should be uninitialized or free. The -caller must eventually call \fBTcl_DStringFree\fR to free up -anything stored here. -.BE - -.SH DESCRIPTION -.PP -This utility procedure translates a file name to a form suitable for -passing to the local operating system. It converts network names into -native form and does tilde substitution. -.PP -If -\fBTcl_TranslateFileName\fR has to do tilde substitution or translate -the name then it uses -the dynamic string at \fI*bufferPtr\fR to hold the new string it -generates. -After \fBTcl_TranslateFileName\fR returns a non-NULL result, the caller must -eventually invoke \fBTcl_DStringFree\fR to free any information -placed in \fI*bufferPtr\fR. The caller need not know whether or -not \fBTcl_TranslateFileName\fR actually used the string; \fBTcl_TranslateFileName\fR -initializes \fI*bufferPtr\fR even if it doesn't use it, so the call to -\fBTcl_DStringFree\fR will be safe in either case. -.PP -If an error occurs (e.g. because there was no user by the given -name) then NULL is returned and an error message will be left -at \fIinterp->result\fR. -When an error occurs, \fBTcl_TranslateFileName\fR -frees the dynamic string itself so that the caller need not call -\fBTcl_DStringFree\fR. -.PP -The caller is responsible for making sure that \fIinterp->result\fR -has its default empty value when \fBTcl_TranslateFileName\fR is invoked. - -.SH "SEE ALSO" -filename - -.SH KEYWORDS -file name, home directory, tilde, translate, user diff --git a/doc/UpVar.3 b/doc/UpVar.3 deleted file mode 100644 index 8dcb06f..0000000 --- a/doc/UpVar.3 +++ /dev/null @@ -1,76 +0,0 @@ -'\" -'\" Copyright (c) 1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: UpVar.3,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH Tcl_UpVar 3 7.4 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_UpVar, Tcl_UpVar2 \- link one variable to another -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_UpVar(\fIinterp, frameName, sourceName, destName, flags\fB)\fR -.sp -int -\fBTcl_UpVar2(\fIinterp, frameName, name1, name2, destName, flags\fB)\fR -.SH ARGUMENTS -.AS Tcl_VarTraceProc prevClientData -.AP Tcl_Interp *interp in -Interpreter containing variables; also used for error reporting. -.AP char *frameName in -Identifies the stack frame containing source variable. -May have any of the forms accepted by -the \fBupvar\fR command, such as \fB#0\fR or \fB1\fR. -.AP char *sourceName in -Name of source variable, in the frame given by \fIframeName\fR. -May refer to a scalar variable or to an array variable with a -parenthesized index. -.AP char *destName in -Name of destination variable, which is to be linked to source -variable so that references to \fIdestName\fR -refer to the other variable. Must not currently exist except as -an upvar-ed variable. -.AP int flags in -Either TCL_GLOBAL_ONLY or 0; if non-zero, then \fIdestName\fR is -a global variable; otherwise it is a local to the current procedure -(or global if no procedure is active). -.AP char *name1 in -First part of source variable's name (scalar name, or name of array -without array index). -.AP char *name2 in -If source variable is an element of an array, gives the index of the element. -For scalar source variables, is NULL. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_UpVar\fR and \fBTcl_UpVar2\fR provide the same functionality -as the \fBupvar\fR command: they make a link from a source variable -to a destination variable, so that references to the destination are -passed transparently through to the source. -The name of the source variable may be specified either as a single -string such as \fBxyx\fR or \fBa(24)\fR (by calling \fBTcl_UpVar\fR) -or in two parts where the array name has been separated from the -element name (by calling \fBTcl_UpVar2\fR). -The destination variable name is specified in a single string; it -may not be an array element. -.PP -Both procedures return either TCL_OK or TCL_ERROR, and they -leave an error message in \fIinterp->result\fR if an error -occurs. -.PP -As with the \fBupvar\fR command, the source variable need not exist; -if it does exist, unsetting it later does not destroy the link. The -destination variable may exist at the time of the call, but if so -it must exist as a linked variable. - -.SH KEYWORDS -linked variable, upvar, variable diff --git a/doc/Utf.3 b/doc/Utf.3 deleted file mode 100644 index f68a6cb..0000000 --- a/doc/Utf.3 +++ /dev/null @@ -1,160 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: Utf.3,v 1.2 1999/04/16 00:46:34 stanton Exp $ -'\" -.so man.macros -.TH Utf 3 "8.1" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings. -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -typedef ... Tcl_UniChar; -.sp -int -\fBTcl_UniCharToUtf\fR(\fIch, buf\fR) -.sp -int -\fBTcl_UtfToUniChar\fR(\fIsrc, chPtr\fR) -.sp -int -\fBTcl_UtfCharComplete\fR(\fIsrc, len\fR) -.sp -int -\fBTcl_NumUtfChars\fR(\fIsrc, len\fR) -.sp -char * -\fBTcl_UtfFindFirst\fR(\fIsrc, ch\fR) -.sp -char * -\fBTcl_UtfFindLast\fR(\fIsrc, ch\fR) -.sp -char * -\fBTcl_UtfNext\fR(\fIsrc\fR) -.sp -char * -\fBTcl_UtfPrev\fR(\fIsrc, start\fR) -.sp -Tcl_UniChar -\fBTcl_UniCharAtIndex\fR(\fIsrc, index\fR) -.sp -char * -\fBTcl_UtfAtIndex\fR(\fIsrc, index\fR) -.sp -int -\fBTcl_UtfBackslash\fR(\fIsrc, readPtr, dst\fR) -.SH ARGUMENTS -.AS "CONST char" *chPtr out -.AP char *buf out -Buffer in which the UTF-8 representation of the Tcl_UniChar is stored. At most -TCL_UTF_MAX bytes are stored in the buffer. -.AP int ch in -The Tcl_UniChar to be converted or examined. -.AP Tcl_UniChar *chPtr out -Filled with the Tcl_UniChar represented by the head of the UTF-8 string. -.AP "CONST char" *src in -Pointer to a UTF-8 string. -.AP int len in -The length of the UTF-8 string in bytes (not UTF-8 characters). If -negative, all bytes up to the first null byte are used. -.AP "CONST char" *start in -Pointer to the beginning of a UTF-8 string. -.AP int index in -The index of a character (not byte) in the UTF-8 string. -.AP int *readPtr out -If non-NULL, filled with the number of bytes in the backslash sequence, -including the backslash character. -.AP char *dst out -Buffer in which the bytes represented by the backslash sequence are stored. -At most TCL_UTF_MAX bytes are stored in the buffer. -.BE - -.SH DESCRIPTION -.PP -These routines convert between UTF-8 strings and Tcl_UniChars. A -Tcl_UniChar is a Unicode character represented as an unsigned, fixed-size -quantity. A UTF-8 character is a Unicode character represented as -a varying-length sequence of up to TCL_UTF_MAX bytes. A multibyte UTF-8 -sequence consists of a lead byte followed by some number of trail bytes. -.PP -\fBTCL_UTF_MAX\fR is the maximum number of bytes that it takes to -represent one Unicode character in the UTF-8 representation. -.PP -\fBTcl_UniCharToUtf\fR stores the Tcl_UniChar \fIch\fR as a UTF-8 string -in starting at \fIbuf\fR. The return value is the number of bytes stored -in \fIbuf\fR. -.PP -\fBTcl_UtfToUniChar\fR reads one UTF-8 character starting at \fIsrc\fR -and stores it as a Tcl_UniChar in \fI*chPtr\fR. The return value is the -number of bytes read from \fIsrc\fR.. The caller must ensure that the -source buffer is long enough such that this routine does not run off the -end and dereference non-existent or random memory; if the source buffer -is known to be null terminated, this will not happen. If the input is -not in proper UTF-8 format, \fBTcl_UtfToUniChar\fR will store the first -byte of \fIsrc\fR in \fI*chPtr\fR as a Tcl_UniChar between 0x0000 and -0x00ff and return 1. -.PP -\fBTcl_UtfCharComplete\fR returns 1 if the source UTF-8 string \fIsrc\fR -of length \fIlen\fR bytes is long enough to be decoded by -\fBTcl_UtfToUniChar\fR, or 0 otherwise. This function does not guarantee -that the UTF-8 string is properly formed. This routine is used by -procedures that are operating on a byte at a time and need to know if a -full Tcl_UniChar has been seen. -.PP -\fBTcl_NumUtfChars\fR corresponds to \fBstrlen\fR for UTF-8 strings. It -returns the number of Tcl_UniChars that are represented by the UTF-8 string -\fIsrc\fR. The length of the source string is \fIlen\fR bytes. If the -length is negative, all bytes up to the first NULL byte are used. -.PP -\fBTcl_UtfFindFirst\fR corresponds to \fBstrchr\fR for UTF-8 strings. It -returns a pointer to the first occurance of the Tcl_UniChar \fIch\fR -in the NULL-terminated UTF-8 string \fIsrc\fR. The NULL terminator is -considered part of the UTF-8 string. -.PP -\fBTcl_UtfFindLast\fR corresponds to \fBstrrchr\fR for UTF-8 strings. It -returns a pointer to the last occurance of the Tcl_UniChar \fIch\fR -in the NULL terminated UTF-8 string \fIsrc\fR. The NULL terminator is -considered part of the UTF-8 string. -.PP -Given \fIsrc\fR, a pointer to some location in a UTF-8 string, -\fBTcl_UtfNext\fR returns a pointer to the next UTF-8 character in the -string. The caller must not ask for the next character after the last -character in the string. -.PP -Given \fIsrc\fR, a pointer to some location in a UTF-8 string, -\fBTcl_UtfPrev\fR returns a pointer to the previous UTF-8 character in the -string. This function will not back up to a position before \fIstart\fR, -the start of the UTF-8 string. If \fIsrc\fR was already at \fIstart\fR, the -return value will be \fIstart\fR. -.PP -\fBTcl_UniCharAtIndex\fR corresponds to a C string array dereference or the -Pascal Ord() function. It returns the Tcl_UniChar represented at the -specified character (not byte) \fIindex\fR in the UTF-8 string -\fIsrc\fR. The source string must contain at least \fIindex\fR -characters. -.PP -\fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not -byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must -contain at least \fIindex\fR characters. This is equivalent to calling -\fBTcl_UtfNext\fR \fIindex\fR times. -.PP -\fBTcl_UtfBackslash\fR is a utility procedure used by several of the Tcl -commands. It parses a backslash sequence and stores the properly formed -UTF-8 character represented by the backslash sequence in the output -buffer \fIdst\fR. At most TCL_UTF_MAX bytes are stored in the buffer. -\fBTcl_UtfBackslash\fR modifies \fI*readPtr\fR to contain the number -of bytes in the backslash sequence, including the backslash character. -The return value is the number of bytes stored in the output buffer. -.PP -See the \fBTcl\fR manual entry for information on the valid backslash -sequences. All of the sequences described in the Tcl manual entry are -supported by \fBTcl_UtfBackslash\fR. - -.SH KEYWORDS -utf, unicode, backslash diff --git a/doc/WrongNumArgs.3 b/doc/WrongNumArgs.3 deleted file mode 100644 index 30157d9..0000000 --- a/doc/WrongNumArgs.3 +++ /dev/null @@ -1,79 +0,0 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: WrongNumArgs.3,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH Tcl_WrongNumArgs 3 8.0 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_WrongNumArgs \- generate standard error message for wrong number of arguments -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTcl_WrongNumArgs\fR(\fIinterp, objc, objv, message\fR) -.SH ARGUMENTS -.AS Tcl_Interp "*CONST objv[]" -.AP Tcl_Interp interp in -Interpreter in which error will be reported: error message gets stored -in its result object. -.AP int objc in -Number of leading arguments from \fIobjv\fR to include in error -message. -.TP -Tcl_Obj *CONST \fIobjv\fR[] (in) -Arguments to command that had the wrong number of arguments. -.AP char *message in -Additional error information to print after leading arguments -from \fIobjv\fR. This typically gives the acceptable syntax -of the command. This argument may be NULL. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_WrongNumArgs\fR is a utility procedure that is invoked by -command procedures when they discover that they have received the -wrong number of arguments. \fBTcl_WrongNumArgs\fR generates a -standard error message and stores it in the result object of -\fIinterp\fR. The message includes the \fIobjc\fR initial -elements of \fIobjv\fR plus \fImessage\fR. For example, if -\fIobjv\fR consists of the values \fBfoo\fR and \fBbar\fR, -\fIobjc\fR is 1, and \fImessage\fR is ``\fBfileName count\fR'' -then \fIinterp\fR's result object will be set to the following -string: -.CS -wrong # args: should be "foo fileName count" -.CE -If \fIobjc\fR is 2, the result will be set to the following string: -.CS -wrong # args: should be "foo bar fileName count" -.CE -\fIObjc\fR is usually 1, but may be 2 or more for commands like -\fBstring\fR and the Tk widget commands, which use the first argument -as a subcommand. -.PP -Some of the objects in the \fIobjv\fR array may be abbreviations for -a subcommand. The command -\fBTcl_GetIndexFromObj\fR will convert the abbreviated string object -into an \fIindexObject\fR. If an error occurs in the parsing of the -subcommand we would like to use the full subcommand name rather than -the abbreviation. If the \fBTcl_WrongNumArgs\fR command finds any -\fIindexObjects\fR in the \fIobjv\fR array it will use the full subcommand -name in the error message instead of the abbreviated name that was -origionally passed in. Using the above example, lets assume that -\fIbar\fR is actually an abbreviation for \fIbarfly\fR and the object -is now an indexObject becasue it was passed to -\fBTcl_GetIndexFromObj\fR. In this case the error message would be: -.CS -wrong # args: should be "foo barfly fileName count" -.CE - -.SH "SEE ALSO" -Tcl_GetIndexFromObj - -.SH KEYWORDS -command, error message, wrong number of arguments diff --git a/doc/after.n b/doc/after.n deleted file mode 100644 index 17fcf7f..0000000 --- a/doc/after.n +++ /dev/null @@ -1,109 +0,0 @@ -'\" -'\" Copyright (c) 1990-1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: after.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH after n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -after \- Execute a command after a time delay -.SH SYNOPSIS -\fBafter \fIms\fR -.sp -\fBafter \fIms \fR?\fIscript script script ...\fR? -.sp -\fBafter cancel \fIid\fR -.sp -\fBafter cancel \fIscript script script ...\fR -.sp -\fBafter idle \fR?\fIscript script script ...\fR? -.sp -\fBafter info \fR?\fIid\fR? -.BE - -.SH DESCRIPTION -.PP -This command is used to delay execution of the program or to execute -a command in background sometime in the future. It has several forms, -depending on the first argument to the command: -.TP -\fBafter \fIms\fR -\fIMs\fR must be an integer giving a time in milliseconds. -The command sleeps for \fIms\fR milliseconds and then returns. -While the command is sleeping the application does not respond to -events. -.TP -\fBafter \fIms \fR?\fIscript script script ...\fR? -In this form the command returns immediately, but it arranges -for a Tcl command to be executed \fIms\fR milliseconds later as an -event handler. -The command will be executed exactly once, at the given time. -The delayed command is formed by concatenating all the \fIscript\fR -arguments in the same fashion as the \fBconcat\fR command. -The command will be executed at global level (outside the context -of any Tcl procedure). -If an error occurs while executing the delayed command then the -\fBbgerror\fR mechanism is used to report the error. -The \fBafter\fR command returns an identifier that can be used -to cancel the delayed command using \fBafter cancel\fR. -.TP -\fBafter cancel \fIid\fR -Cancels the execution of a delayed command that -was previously scheduled. -\fIId\fR indicates which command should be canceled; it must have -been the return value from a previous \fBafter\fR command. -If the command given by \fIid\fR has already been executed then -the \fBafter cancel\fR command has no effect. -.TP -\fBafter cancel \fIscript script ...\fR -This command also cancels the execution of a delayed command. -The \fIscript\fR arguments are concatenated together with space -separators (just as in the \fBconcat\fR command). -If there is a pending command that matches the string, it is -cancelled and will never be executed; if no such command is -currently pending then the \fBafter cancel\fR command has no effect. -.TP -\fBafter idle \fIscript \fR?\fIscript script ...\fR? -Concatenates the \fIscript\fR arguments together with space -separators (just as in the \fBconcat\fR command), and arranges -for the resulting script to be evaluated later as an idle callback. -The script will be run exactly once, the next time the event -loop is entered and there are no events to process. -The command returns an identifier that can be used -to cancel the delayed command using \fBafter cancel\fR. -If an error occurs while executing the script then the -\fBbgerror\fR mechanism is used to report the error. -.TP -\fBafter info \fR?\fIid\fR? -This command returns information about existing event handlers. -If no \fIid\fR argument is supplied, the command returns -a list of the identifiers for all existing -event handlers created by the \fBafter\fR command for this -interpreter. -If \fIid\fR is supplied, it specifies an existing handler; -\fIid\fR must have been the return value from some previous call -to \fBafter\fR and it must not have triggered yet or been cancelled. -In this case the command returns a list with two elements. -The first element of the list is the script associated -with \fIid\fR, and the second element is either -\fBidle\fR or \fBtimer\fR to indicate what kind of event -handler it is. -.LP -The \fBafter \fIms\fR and \fBafter idle\fR forms of the command -assume that the application is event driven: the delayed commands -will not be executed unless the application enters the event loop. -In applications that are not normally event-driven, such as -\fBtclsh\fR, the event loop can be entered with the \fBvwait\fR -and \fBupdate\fR commands. - -.SH "SEE ALSO" -bgerror - -.SH KEYWORDS -cancel, delay, idle callback, sleep, time diff --git a/doc/append.n b/doc/append.n deleted file mode 100644 index 1a28065..0000000 --- a/doc/append.n +++ /dev/null @@ -1,32 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: append.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH append n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -append \- Append to variable -.SH SYNOPSIS -\fBappend \fIvarName \fR?\fIvalue value value ...\fR? -.BE - -.SH DESCRIPTION -.PP -Append all of the \fIvalue\fR arguments to the current value -of variable \fIvarName\fR. If \fIvarName\fR doesn't exist, -it is given a value equal to the concatenation of all the -\fIvalue\fR arguments. -This command provides an efficient way to build up long -variables incrementally. -For example, ``\fBappend a $b\fR'' is much more efficient than -``\fBset a $a$b\fR'' if \fB$a\fR is long. - -.SH KEYWORDS -append, variable diff --git a/doc/array.n b/doc/array.n deleted file mode 100644 index f18c91e..0000000 --- a/doc/array.n +++ /dev/null @@ -1,116 +0,0 @@ -'\" -'\" Copyright (c) 1993-1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: array.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH array n 7.4 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -array \- Manipulate array variables -.SH SYNOPSIS -\fBarray \fIoption arrayName\fR ?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command performs one of several operations on the -variable given by \fIarrayName\fR. -Unless otherwise specified for individual commands below, -\fIarrayName\fR must be the name of an existing array variable. -The \fIoption\fR argument determines what action is carried -out by the command. -The legal \fIoptions\fR (which may be abbreviated) are: -.TP -\fBarray anymore \fIarrayName searchId\fR -Returns 1 if there are any more elements left to be processed -in an array search, 0 if all elements have already been -returned. -\fISearchId\fR indicates which search on \fIarrayName\fR to -check, and must have been the return value from a previous -invocation of \fBarray startsearch\fR. -This option is particularly useful if an array has an element -with an empty name, since the return value from -\fBarray nextelement\fR won't indicate whether the search -has been completed. -.TP -\fBarray donesearch \fIarrayName searchId\fR -This command terminates an array search and destroys all the -state associated with that search. \fISearchId\fR indicates -which search on \fIarrayName\fR to destroy, and must have -been the return value from a previous invocation of -\fBarray startsearch\fR. Returns an empty string. -.TP -\fBarray exists \fIarrayName\fR -Returns 1 if \fIarrayName\fR is an array variable, 0 if there -is no variable by that name or if it is a scalar variable. -.TP -\fBarray get \fIarrayName\fR ?\fIpattern\fR? -Returns a list containing pairs of elements. The first -element in each pair is the name of an element in \fIarrayName\fR -and the second element of each pair is the value of the -array element. The order of the pairs is undefined. -If \fIpattern\fR is not specified, then all of the elements of the -array are included in the result. -If \fIpattern\fR is specified, then only those elements whose names -match \fIpattern\fR (using the glob-style matching rules of -\fBstring match\fR) are included. -If \fIarrayName\fR isn't the name of an array variable, or if -the array contains no elements, then an empty list is returned. -.TP -\fBarray names \fIarrayName\fR ?\fIpattern\fR? -Returns a list containing the names of all of the elements in -the array that match \fIpattern\fR (using the glob-style matching -rules of \fBstring match\fR). -If \fIpattern\fR is omitted then the command returns all of -the element names in the array. -If there are no (matching) elements in the array, or if \fIarrayName\fR -isn't the name of an array variable, then an empty string is -returned. -.TP -\fBarray nextelement \fIarrayName searchId\fR -Returns the name of the next element in \fIarrayName\fR, or -an empty string if all elements of \fIarrayName\fR have -already been returned in this search. The \fIsearchId\fR -argument identifies the search, and must have -been the return value of an \fBarray startsearch\fR command. -Warning: if elements are added to or deleted from the array, -then all searches are automatically terminated just as if -\fBarray donesearch\fR had been invoked; this will cause -\fBarray nextelement\fR operations to fail for those searches. -.TP -\fBarray set \fIarrayName list\fR -Sets the values of one or more elements in \fIarrayName\fR. -\fIlist\fR must have a form like that returned by \fBarray get\fR, -consisting of an even number of elements. -Each odd-numbered element in \fIlist\fR is treated as an element -name within \fIarrayName\fR, and the following element in \fIlist\fR -is used as a new value for that array element. -If the variable \fIarrayName\fR does not already exist -and \fIlist\fR is empty, -\fIarrayName\fR is created with an empty array value. -.TP -\fBarray size \fIarrayName\fR -Returns a decimal string giving the number of elements in the -array. -If \fIarrayName\fR isn't the name of an array then 0 is returned. -.TP -\fBarray startsearch \fIarrayName\fR -This command initializes an element-by-element search through the -array given by \fIarrayName\fR, such that invocations of the -\fBarray nextelement\fR command will return the names of the -individual elements in the array. -When the search has been completed, the \fBarray donesearch\fR -command should be invoked. -The return value is a -search identifier that must be used in \fBarray nextelement\fR -and \fBarray donesearch\fR commands; it allows multiple -searches to be underway simultaneously for the same array. - -.SH KEYWORDS -array, element names, search diff --git a/doc/bgerror.n b/doc/bgerror.n deleted file mode 100644 index 3f946c3..0000000 --- a/doc/bgerror.n +++ /dev/null @@ -1,68 +0,0 @@ -'\" -'\" Copyright (c) 1990-1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: bgerror.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH bgerror n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -bgerror \- Command invoked to process background errors -.SH SYNOPSIS -\fBbgerror \fImessage\fR -.BE - -.SH DESCRIPTION -.PP -The \fBbgerror\fR command doesn't exist as built-in part of Tcl. Instead, -individual applications or users can define a \fBbgerror\fR -command (e.g. as a Tcl procedure) if they wish to handle background -errors. -.PP -A background error is one that occurs in an event handler or some -other command that didn't originate with the application. -For example, if an error occurs while executing a command specified -with the \fBafter\fR command, then it is a background error. -For a non-background error, the error can simply be returned up -through nested Tcl command evaluations until it reaches the top-level -code in the application; then the application can report the error -in whatever way it wishes. -When a background error occurs, the unwinding ends in -the Tcl library and there is no obvious way for Tcl to report -the error. -.PP -When Tcl detects a background error, it saves information about the -error and invokes the \fBbgerror\fR command later as an idle event handler. -Before invoking \fBbgerror\fR, Tcl restores the \fBerrorInfo\fR -and \fBerrorCode\fR variables to their values at the time the -error occurred, then it invokes \fBbgerror\fR with -the error message as its only argument. -Tcl assumes that the application has implemented the \fBbgerror\fR -command, and that the command will report the error in a way that -makes sense for the application. Tcl will ignore any result returned -by the \fBbgerror\fR command as long as no error is generated. -.PP -If another Tcl error occurs within the \fBbgerror\fR command -(for example, because no \fBbgerror\fR command has been defined) -then Tcl reports the error itself by writing a message to stderr. -.PP -If several background errors accumulate before \fBbgerror\fR -is invoked to process them, \fBbgerror\fR will be invoked once -for each error, in the order they occurred. -However, if \fBbgerror\fR returns with a break exception, then -any remaining errors are skipped without calling \fBbgerror\fR. -.PP -Tcl has no default implementation for \fBbgerror\fR. -However, in applications using Tk there is a default -\fBbgerror\fR procedure -which posts a dialog box containing -the error message and offers the user a chance to see a stack -trace showing where the error occurred. - -.SH KEYWORDS -background error, reporting diff --git a/doc/binary.n b/doc/binary.n deleted file mode 100644 index 8b20259..0000000 --- a/doc/binary.n +++ /dev/null @@ -1,532 +0,0 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: binary.n,v 1.3 1999/04/16 00:46:34 stanton Exp $ -'\" -.so man.macros -.TH binary n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -binary \- Insert and extract fields from binary strings -.SH SYNOPSIS -\fBbinary format \fIformatString \fR?\fIarg arg ...\fR? -.br -\fBbinary scan \fIstring formatString \fR?\fIvarName varName ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command provides facilities for manipulating binary data. The -first form, \fBbinary format\fR, creates a binary string from normal -Tcl values. For example, given the values 16 and 22, it might produce -an 8-byte binary string consisting of two 4-byte integers, one for -each of the numbers. The second form of the command, -\fBbinary scan\fR, does the opposite: it extracts data from a binary -string and returns it as ordinary Tcl string values. - -.SH "BINARY FORMAT" -.PP -The \fBbinary format\fR command generates a binary string whose layout -is specified by the \fIformatString\fR and whose contents come from -the additional arguments. The resulting binary value is returned. -.PP -The \fIformatString\fR consists of a sequence of zero or more field -specifiers separated by zero or more spaces. Each field specifier is -a single type character followed by an optional numeric \fIcount\fR. -Most field specifiers consume one argument to obtain the value to be -formatted. The type character specifies how the value is to be -formatted. The \fIcount\fR typically indicates how many items of the -specified type are taken from the value. If present, the \fIcount\fR -is a non-negative decimal integer or \fB*\fR, which normally indicates -that all of the items in the value are to be used. If the number of -arguments does not match the number of fields in the format string -that consume arguments, then an error is generated. -.PP -Each type-count pair moves an imaginary cursor through the binary -data, storing bytes at the current position and advancing the cursor -to just after the last byte stored. The cursor is initially at -position 0 at the beginning of the data. The type may be any one of -the following characters: -.IP \fBa\fR 5 -Stores a character string of length \fIcount\fR in the output string. -If \fIarg\fR has fewer than \fIcount\fR bytes, then additional zero -bytes are used to pad out the field. If \fIarg\fR is longer than the -specified length, the extra characters will be ignored. If -\fIcount\fR is \fB*\fR, then all of the bytes in \fIarg\fR will be -formatted. If \fIcount\fR is omitted, then one character will be -formatted. For example, -.RS -.CS -\fBbinary format a7a*a alpha bravo charlie\fR -.CE -will return a string equivalent to \fBalpha\\000\\000bravoc\fR. -.RE -.IP \fBA\fR 5 -This form is the same as \fBa\fR except that spaces are used for -padding instead of nulls. For example, -.RS -.CS -\fBbinary format A6A*A alpha bravo charlie\fR -.CE -will return \fBalpha bravoc\fR. -.RE -.IP \fBb\fR 5 -Stores a string of \fIcount\fR binary digits in low-to-high order -within each byte in the output string. \fIArg\fR must contain a -sequence of \fB1\fR and \fB0\fR characters. The resulting bytes are -emitted in first to last order with the bits being formatted in -low-to-high order within each byte. If \fIarg\fR has fewer than -\fIcount\fR digits, then zeros will be used for the remaining bits. -If \fIarg\fR has more than the specified number of digits, the extra -digits will be ignored. If \fIcount\fR is \fB*\fR, then all of the -digits in \fIarg\fR will be formatted. If \fIcount\fR is omitted, -then one digit will be formatted. If the number of bits formatted -does not end at a byte boundary, the remaining bits of the last byte -will be zeros. For example, -.RS -.CS -\fBbinary format b5b* 11100 111000011010\fR -.CE -will return a string equivalent to \fB\\x07\\x87\\x05\fR. -.RE -.IP \fBB\fR 5 -This form is the same as \fBb\fR except that the bits are stored in -high-to-low order within each byte. For example, -.RS -.CS -\fBbinary format B5B* 11100 111000011010\fR -.CE -will return a string equivalent to \fB\\xe0\\xe1\\xa0\fR. -.RE -.IP \fBh\fR 5 -Stores a string of \fIcount\fR hexadecimal digits in low-to-high -within each byte in the output string. \fIArg\fR must contain a -sequence of characters in the set ``0123456789abcdefABCDEF''. The -resulting bytes are emitted in first to last order with the hex digits -being formatted in low-to-high order within each byte. If \fIarg\fR -has fewer than \fIcount\fR digits, then zeros will be used for the -remaining digits. If \fIarg\fR has more than the specified number of -digits, the extra digits will be ignored. If \fIcount\fR is -\fB*\fR, then all of the digits in \fIarg\fR will be formatted. If -\fIcount\fR is omitted, then one digit will be formatted. If the -number of digits formatted does not end at a byte boundary, the -remaining bits of the last byte will be zeros. For example, -.RS -.CS -\fBbinary format h3h* AB def\fR -.CE -will return a string equivalent to \fB\\xba\\x00\\xed\\x0f\fR. -.RE -.IP \fBH\fR 5 -This form is the same as \fBh\fR except that the digits are stored in -high-to-low order within each byte. For example, -.RS -.CS -\fBbinary format H3H* ab DEF\fR -.CE -will return a string equivalent to \fB\\xab\\x00\\xde\\xf0\fR. -.RE -.IP \fBc\fR 5 -Stores one or more 8-bit integer values in the output string. If no -\fIcount\fR is specified, then \fIarg\fR must consist of an integer -value; otherwise \fIarg\fR must consist of a list containing at least -\fIcount\fR integer elements. The low-order 8 bits of each integer -are stored as a one-byte value at the cursor position. If \fIcount\fR -is \fB*\fR, then all of the integers in the list are formatted. If -the number of elements in the list is fewer than \fIcount\fR, then an -error is generated. If the number of elements in the list is greater -than \fIcount\fR, then the extra elements are ignored. For example, -.RS -.CS -\fBbinary format c3cc* {3 -3 128 1} 260 {2 5}\fR -.CE -will return a string equivalent to -\fB\\x03\\xfd\\x80\\x04\\x02\\x05\fR, whereas -.CS -\fBbinary format c {2 5}\fR -.CE -will generate an error. -.RE -.IP \fBs\fR 5 -This form is the same as \fBc\fR except that it stores one or more -16-bit integers in little-endian byte order in the output string. The -low-order 16-bits of each integer are stored as a two-byte value at -the cursor position with the least significant byte stored first. For -example, -.RS -.CS -\fBbinary format s3 {3 -3 258 1}\fR -.CE -will return a string equivalent to -\fB\\x03\\x00\\xfd\\xff\\x02\\x01\fR. -.RE -.IP \fBS\fR 5 -This form is the same as \fBs\fR except that it stores one or more -16-bit integers in big-endian byte order in the output string. For -example, -.RS -.CS -\fBbinary format S3 {3 -3 258 1}\fR -.CE -will return a string equivalent to -\fB\\x00\\x03\\xff\\xfd\\x01\\x02\fR. -.RE -.IP \fBi\fR 5 -This form is the same as \fBc\fR except that it stores one or more -32-bit integers in little-endian byte order in the output string. The -low-order 32-bits of each integer are stored as a four-byte value at -the cursor position with the least significant byte stored first. For -example, -.RS -.CS -\fBbinary format i3 {3 -3 65536 1}\fR -.CE -will return a string equivalent to -\fB\\x03\\x00\\x00\\x00\\xfd\\xff\\xff\\xff\\x00\\x00\\x01\\x00\fR -.RE -.IP \fBI\fR 5 -This form is the same as \fBi\fR except that it stores one or more one -or more 32-bit integers in big-endian byte order in the output string. -For example, -.RS -.CS -\fBbinary format I3 {3 -3 65536 1}\fR -.CE -will return a string equivalent to -\fB\\x00\\x00\\x00\\x03\\xff\\xff\\xff\\xfd\\x00\\x01\\x00\\x00\fR -.RE -.IP \fBf\fR 5 -This form is the same as \fBc\fR except that it stores one or more one -or more single-precision floating in the machine's native -representation in the output string. This representation is not -portable across architectures, so it should not be used to communicate -floating point numbers across the network. The size of a floating -point number may vary across architectures, so the number of bytes -that are generated may vary. If the value overflows the -machine's native representation, then the value of FLT_MAX -as defined by the system will be used instead. Because Tcl uses -double-precision floating-point numbers internally, there may be some -loss of precision in the conversion to single-precision. For example, -on a Windows system running on an Intel Pentium processor, -.RS -.CS -\fBbinary format f2 {1.6 3.4}\fR -.CE -will return a string equivalent to -\fB\\xcd\\xcc\\xcc\\x3f\\x9a\\x99\\x59\\x40\fR. -.RE -.IP \fBd\fR 5 -This form is the same as \fBf\fR except that it stores one or more one -or more double-precision floating in the machine's native -representation in the output string. For example, on a -Windows system running on an Intel Pentium processor, -.RS -.CS -\fBbinary format d1 {1.6}\fR -.CE -will return a string equivalent to -\fB\\x9a\\x99\\x99\\x99\\x99\\x99\\xf9\\x3f\fR. -.RE -.IP \fBx\fR 5 -Stores \fIcount\fR null bytes in the output string. If \fIcount\fR is -not specified, stores one null byte. If \fIcount\fR is \fB*\fR, -generates an error. This type does not consume an argument. For -example, -.RS -.CS -\fBbinary format a3xa3x2a3 abc def ghi\fR -.CE -will return a string equivalent to \fBabc\\000def\\000\\000ghi\fR. -.RE -.IP \fBX\fR 5 -Moves the cursor back \fIcount\fR bytes in the output string. If -\fIcount\fR is \fB*\fR or is larger than the current cursor position, -then the cursor is positioned at location 0 so that the next byte -stored will be the first byte in the result string. If \fIcount\fR is -omitted then the cursor is moved back one byte. This type does not -consume an argument. For example, -.RS -.CS -\fBbinary format a3X*a3X2a3 abc def ghi\fR -.CE -will return \fBdghi\fR. -.RE -.IP \fB@\fR 5 -Moves the cursor to the absolute location in the output string -specified by \fIcount\fR. Position 0 refers to the first byte in the -output string. If \fIcount\fR refers to a position beyond the last -byte stored so far, then null bytes will be placed in the unitialized -locations and the cursor will be placed at the specified location. If -\fIcount\fR is \fB*\fR, then the cursor is moved to the current end of -the output string. If \fIcount\fR is omitted, then an error will be -generated. This type does not consume an argument. For example, -.RS -.CS -\fBbinary format a5@2a1@*a3@10a1 abcde f ghi j\fR -.CE -will return \fBabfdeghi\\000\\000j\fR. -.RE - -.SH "BINARY SCAN" -.PP -The \fBbinary scan\fR command parses fields from a binary string, -returning the number of conversions performed. \fIString\fR gives the -input to be parsed and \fIformatString\fR indicates how to parse it. -Each \fIvarName\fR gives the name of a variable; when a field is -scanned from \fIstring\fR the result is assigned to the corresponding -variable. -.PP -As with \fBbinary format\fR, the \fIformatString\fR consists of a -sequence of zero or more field specifiers separated by zero or more -spaces. Each field specifier is a single type character followed by -an optional numeric \fIcount\fR. Most field specifiers consume one -argument to obtain the variable into which the scanned values should -be placed. The type character specifies how the binary data is to be -interpreted. The \fIcount\fR typically indicates how many items of -the specified type are taken from the data. If present, the -\fIcount\fR is a non-negative decimal integer or \fB*\fR, which -normally indicates that all of the remaining items in the data are to -be used. If there are not enough bytes left after the current cursor -position to satisfy the current field specifier, then the -corresponding variable is left untouched and \fBbinary scan\fR returns -immediately with the number of variables that were set. If there are -not enough arguments for all of the fields in the format string that -consume arguments, then an error is generated. -.PP -Each type-count pair moves an imaginary cursor through the binary data, -reading bytes from the current position. The cursor is initially -at position 0 at the beginning of the data. The type may be any one of -the following characters: -.IP \fBa\fR 5 -The data is a character string of length \fIcount\fR. If \fIcount\fR -is \fB*\fR, then all of the remaining bytes in \fIstring\fR will be -scanned into the variable. If \fIcount\fR is omitted, then one -character will be scanned. For example, -.RS -.CS -\fBbinary scan abcde\\000fghi a6a10 var1 var2\fR -.CE -will return \fB1\fR with the string equivalent to \fBabcde\\000\fR -stored in \fBvar1\fR and \fBvar2\fR left unmodified. -.RE -.IP \fBA\fR 5 -This form is the same as \fBa\fR, except trailing blanks and nulls are stripped from -the scanned value before it is stored in the variable. For example, -.RS -.CS -\fBbinary scan "abc efghi \\000" A* var1\fR -.CE -will return \fB1\fR with \fBabc efghi\fR stored in \fBvar1\fR. -.RE -.IP \fBb\fR 5 -The data is turned into a string of \fIcount\fR binary digits in -low-to-high order represented as a sequence of ``1'' and ``0'' -characters. The data bytes are scanned in first to last order with -the bits being taken in low-to-high order within each byte. Any extra -bits in the last byte are ignored. If \fIcount\fR is \fB*\fR, then -all of the remaining bits in \fBstring\fR will be scanned. If -\fIcount\fR is omitted, then one bit will be scanned. For example, -.RS -.CS -\fBbinary scan \\x07\\x87\\x05 b5b* var1 var2\fR -.CE -will return \fB2\fR with \fB11100\fR stored in \fBvar1\fR and -\fB1110000110100000\fR stored in \fBvar2\fR. -.RE -.IP \fBB\fR 5 -This form is the same as \fBb\fR, except the bits are taken in -high-to-low order within each byte. For example, -.RS -.CS -\fBbinary scan \\x70\\x87\\x05 B5B* var1 var2\fR -.CE -will return \fB2\fR with \fB01110\fR stored in \fBvar1\fR and -\fB1000011100000101\fR stored in \fBvar2\fR. -.RE -.IP \fBh\fR 5 -The data is turned into a string of \fIcount\fR hexadecimal digits in -low-to-high order represented as a sequence of characters in the set -``0123456789abcdef''. The data bytes are scanned in first to last -order with the hex digits being taken in low-to-high order within each -byte. Any extra bits in the last byte are ignored. If \fIcount\fR -is \fB*\fR, then all of the remaining hex digits in \fBstring\fR will be -scanned. If \fIcount\fR is omitted, then one hex digit will be -scanned. For example, -.RS -.CS -\fBbinary scan \\x07\\x86\\x05 h3h* var1 var2\fR -.CE -will return \fB2\fR with \fB706\fR stored in \fBvar1\fR and -\fB50\fR stored in \fBvar2\fR. -.RE -.IP \fBH\fR 5 -This form is the same as \fBh\fR, except the digits are taken in -high-to-low order within each byte. For example, -.RS -.CS -\fBbinary scan \\x07\\x86\\x05 H3H* var1 var2\fR -.CE -will return \fB2\fR with \fB078\fR stored in \fBvar1\fR and -\fB05\fR stored in \fBvar2\fR. -.RE -.IP \fBc\fR 5 -The data is turned into \fIcount\fR 8-bit signed integers and stored -in the corresponding variable as a list. If \fIcount\fR is \fB*\fR, -then all of the remaining bytes in \fBstring\fR will be scanned. If -\fIcount\fR is omitted, then one 8-bit integer will be scanned. For -example, -.RS -.CS -\fBbinary scan \\x07\\x86\\x05 c2c* var1 var2\fR -.CE -will return \fB2\fR with \fB7 -122\fR stored in \fBvar1\fR and \fB5\fR -stored in \fBvar2\fR. Note that the integers returned are signed, but -they can be converted to unsigned 8-bit quantities using an expression -like: -.CS -\fBexpr ( $num + 0x100 ) % 0x100\fR -.CE -.RE -.IP \fBs\fR 5 -The data is interpreted as \fIcount\fR 16-bit signed integers -represented in little-endian byte order. The integers are stored in -the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then -all of the remaining bytes in \fBstring\fR will be scanned. If -\fIcount\fR is omitted, then one 16-bit integer will be scanned. For -example, -.RS -.CS -\fBbinary scan \\x05\\x00\\x07\\x00\\xf0\\xff s2s* var1 var2\fR -.CE -will return \fB2\fR with \fB5 7\fR stored in \fBvar1\fR and \fB-16\fR -stored in \fBvar2\fR. Note that the integers returned are signed, but -they can be converted to unsigned 16-bit quantities using an expression -like: -.CS -\fBexpr ( $num + 0x10000 ) % 0x10000\fR -.CE -.RE -.IP \fBS\fR 5 -This form is the same as \fBs\fR except that the data is interpreted -as \fIcount\fR 16-bit signed integers represented in big-endian byte -order. For example, -.RS -.CS -\fBbinary scan \\x00\\x05\\x00\\x07\\xff\\xf0 S2S* var1 var2\fR -.CE -will return \fB2\fR with \fB5 7\fR stored in \fBvar1\fR and \fB-16\fR -stored in \fBvar2\fR. -.RE -.IP \fBi\fR 5 -The data is interpreted as \fIcount\fR 32-bit signed integers -represented in little-endian byte order. The integers are stored in -the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then -all of the remaining bytes in \fBstring\fR will be scanned. If -\fIcount\fR is omitted, then one 32-bit integer will be scanned. For -example, -.RS -.CS -\fBbinary scan \\x05\\x00\\x00\\x00\\x07\\x00\\x00\\x00\\xf0\\xff\\xff\\xff i2i* var1 var2\fR -.CE -will return \fB2\fR with \fB5 7\fR stored in \fBvar1\fR and \fB-16\fR -stored in \fBvar2\fR. Note that the integers returned are signed and -cannot be represented by Tcl as unsigned values. -.RE -.IP \fBI\fR 5 -This form is the same as \fBI\fR except that the data is interpreted -as \fIcount\fR 32-bit signed integers represented in big-endian byte -order. For example, -.RS -.CS -\fBbinary \\x00\\x00\\x00\\x05\\x00\\x00\\x00\\x07\\xff\\xff\\xff\\xf0 I2I* var1 var2\fR -.CE -will return \fB2\fR with \fB5 7\fR stored in \fBvar1\fR and \fB-16\fR -stored in \fBvar2\fR. -.RE -.IP \fBf\fR 5 -The data is interpreted as \fIcount\fR single-precision floating point -numbers in the machine's native representation. The floating point -numbers are stored in the corresponding variable as a list. If -\fIcount\fR is \fB*\fR, then all of the remaining bytes in -\fBstring\fR will be scanned. If \fIcount\fR is omitted, then one -single-precision floating point number will be scanned. The size of a -floating point number may vary across architectures, so the number of -bytes that are scanned may vary. If the data does not represent a -valid floating point number, the resulting value is undefined and -compiler dependent. For example, on a Windows system running on an -Intel Pentium processor, -.RS -.CS -\fBbinary scan \\x3f\\xcc\\xcc\\xcd f var1\fR -.CE -will return \fB1\fR with \fB1.6000000238418579\fR stored in -\fBvar1\fR. -.RE -.IP \fBd\fR 5 -This form is the same as \fBf\fR except that the data is interpreted -as \fIcount\fR double-precision floating point numbers in the -machine's native representation. For example, on a Windows system -running on an Intel Pentium processor, -.RS -.CS -\fBbinary scan \\x9a\\x99\\x99\\x99\\x99\\x99\\xf9\\x3f d var1\fR -.CE -will return \fB1\fR with \fB1.6000000000000001\fR -stored in \fBvar1\fR. -.RE -.IP \fBx\fR 5 -Moves the cursor forward \fIcount\fR bytes in \fIstring\fR. If -\fIcount\fR is \fB*\fR or is larger than the number of bytes after the -current cursor cursor position, then the cursor is positioned after -the last byte in \fIstring\fR. If \fIcount\fR is omitted, then the -cursor is moved forward one byte. Note that this type does not -consume an argument. For example, -.RS -.CS -\fBbinary scan \\x01\\x02\\x03\\x04 x2H* var1\fR -.CE -will return \fB1\fR with \fB0304\fR stored in \fBvar1\fR. -.RE -.IP \fBX\fR 5 -Moves the cursor back \fIcount\fR bytes in \fIstring\fR. If -\fIcount\fR is \fB*\fR or is larger than the current cursor position, -then the cursor is positioned at location 0 so that the next byte -scanned will be the first byte in \fIstring\fR. If \fIcount\fR -is omitted then the cursor is moved back one byte. Note that this -type does not consume an argument. For example, -.RS -.CS -\fBbinary scan \\x01\\x02\\x03\\x04 c2XH* var1 var2\fR -.CE -will return \fB2\fR with \fB1 2\fR stored in \fBvar1\fR and \fB020304\fR -stored in \fBvar2\fR. -.RE -.IP \fB@\fR 5 -Moves the cursor to the absolute location in the data string specified -by \fIcount\fR. Note that position 0 refers to the first byte in -\fIstring\fR. If \fIcount\fR refers to a position beyond the end of -\fIstring\fR, then the cursor is positioned after the last byte. If -\fIcount\fR is omitted, then an error will be generated. For example, -.RS -.CS -\fBbinary scan \\x01\\x02\\x03\\x04 c2@1H* var1 var2\fR -.CE -will return \fB2\fR with \fB1 2\fR stored in \fBvar1\fR and \fB020304\fR -stored in \fBvar2\fR. -.RE - -.SH "PLATFORM ISSUES" -Sometimes it is desirable to format or scan integer values in the -native byte order for the machine. Refer to the \fBbyteOrder\fR -element of the \fBtcl_platform\fR array to decide which type character -to use when formatting or scanning integers. - -.SH "SEE ALSO" -format, scan, tclvars - -.SH KEYWORDS -binary, format, scan diff --git a/doc/break.n b/doc/break.n deleted file mode 100644 index 86d0d8b..0000000 --- a/doc/break.n +++ /dev/null @@ -1,34 +0,0 @@ -'\" -'\" Copyright (c) 1993-1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: break.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH break n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -break \- Abort looping command -.SH SYNOPSIS -\fBbreak\fR -.BE - -.SH DESCRIPTION -.PP -This command is typically invoked inside the body of a looping command -such as \fBfor\fR or \fBforeach\fR or \fBwhile\fR. -It returns a TCL_BREAK code, which causes a break exception -to occur. -The exception causes the current script to be aborted -out to the innermost containing loop command, which then -aborts its execution and returns normally. -Break exceptions are also handled in a few other situations, such -as the \fBcatch\fR command, Tk event bindings, and the outermost -scripts of procedure bodies. - -.SH KEYWORDS -abort, break, loop diff --git a/doc/case.n b/doc/case.n deleted file mode 100644 index cf15a94..0000000 --- a/doc/case.n +++ /dev/null @@ -1,59 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: case.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH case n 7.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -case \- Evaluate one of several scripts, depending on a given value -.SH SYNOPSIS -\fBcase\fI string \fR?\fBin\fR? \fIpatList body \fR?\fIpatList body \fR...? -.sp -\fBcase\fI string \fR?\fBin\fR? {\fIpatList body \fR?\fIpatList body \fR...?} -.BE - -.SH DESCRIPTION -.PP -\fINote: the \fBcase\fI command is obsolete and is supported only -for backward compatibility. At some point in the future it may be -removed entirely. You should use the \fBswitch\fI command instead.\fR -.PP -The \fBcase\fR command matches \fIstring\fR against each of -the \fIpatList\fR arguments in order. -Each \fIpatList\fR argument is a list of one or -more patterns. If any of these patterns matches \fIstring\fR then -\fBcase\fR evaluates the following \fIbody\fR argument -by passing it recursively to the Tcl interpreter and returns the result -of that evaluation. -Each \fIpatList\fR argument consists of a single -pattern or list of patterns. Each pattern may contain any of the wild-cards -described under \fBstring match\fR. If a \fIpatList\fR -argument is \fBdefault\fR, the corresponding body will be evaluated -if no \fIpatList\fR matches \fIstring\fR. If no \fIpatList\fR argument -matches \fIstring\fR and no default is given, then the \fBcase\fR -command returns an empty string. -.PP -Two syntaxes are provided for the \fIpatList\fR and \fIbody\fR arguments. -The first uses a separate argument for each of the patterns and commands; -this form is convenient if substitutions are desired on some of the -patterns or commands. -The second form places all of the patterns and commands together into -a single argument; the argument must have proper list structure, with -the elements of the list being the patterns and commands. -The second form makes it easy to construct multi-line case commands, -since the braces around the whole list make it unnecessary to include a -backslash at the end of each line. -Since the \fIpatList\fR arguments are in braces in the second form, -no command or variable substitutions are performed on them; this makes -the behavior of the second form different than the first form in some -cases. - -.SH KEYWORDS -case, match, regular expression diff --git a/doc/catch.n b/doc/catch.n deleted file mode 100644 index 23771f9..0000000 --- a/doc/catch.n +++ /dev/null @@ -1,70 +0,0 @@ -'\" -'\" Copyright (c) 1993-1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: catch.n,v 1.3 1999/04/16 00:46:34 stanton Exp $ -'\" -.so man.macros -.TH catch n "8.0" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -catch \- Evaluate script and trap exceptional returns -.SH SYNOPSIS -\fBcatch\fI script \fR?\fIvarName\fR? -.BE - -.SH DESCRIPTION -.PP -The \fBcatch\fR command may be used to prevent errors from aborting command -interpretation. \fBCatch\fR calls the Tcl interpreter recursively to -execute \fIscript\fR, and always returns without raising an error, -regardless of any errors that might occur while executing \fIscript\fR. -.PP -If \fIscript\fR raises an error, \fBcatch\fR will return a non-zero integer -value corresponding to one of the exceptional return codes (see tcl.h -for the definitions of code values). If the \fIvarName\fR argument is -given, then the variable it names is set to the error message from -interpreting \fIscript\fR. -.PP -If \fIscript\fR does not raise an error, \fBcatch\fR will return 0 -(TCL_OK) and set the variable to the value returned from \fIscript\fR. -.PP -Note that \fBcatch\fR catches all exceptions, including those -generated by \fBbreak\fR and \fBcontinue\fR as well as errors. The -only errors that are not caught are syntax errors found when the -script is compiled. This is because the catch command only catches -errors during runtime. When the catch statement is compiled, the -script is compiled as well and any syntax errors will generate a Tcl -error. - -.SH EXAMPLES - -The \fBcatch\fR command may be used in an \fBif\fR to branch based on -the success of a script. - -.DS -.CS -if { [catch {open $someFile w} fid] } { - puts stderr "Could not open $someFile for writing\\n$fid" - exit 1 -} -.CE -.DE -The \fBcatch\fR command will not catch compiled syntax errors. The -first time proc \fBfoo\fR is called, the body will be compiled and a -Tcl error will be generated. - -.DS -.CS -proc foo {} { - catch {expr {1 +- }} -} -.CE -.DE - -.SH KEYWORDS -catch, error diff --git a/doc/cd.n b/doc/cd.n deleted file mode 100644 index a570cdc..0000000 --- a/doc/cd.n +++ /dev/null @@ -1,28 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: cd.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH cd n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -cd \- Change working directory -.SH SYNOPSIS -\fBcd \fR?\fIdirName\fR? -.BE - -.SH DESCRIPTION -.PP -Change the current working directory to \fIdirName\fR, or to the -home directory (as specified in the HOME environment variable) if -\fIdirName\fR is not given. -Returns an empty string. - -.SH KEYWORDS -working directory diff --git a/doc/clock.n b/doc/clock.n deleted file mode 100644 index db8af8a..0000000 --- a/doc/clock.n +++ /dev/null @@ -1,188 +0,0 @@ -'\" -'\" Copyright (c) 1992-1995 Karl Lehenbauer and Mark Diekhans. -'\" Copyright (c) 1995-1997 Sun Microsystems, Inc. -'\" -'\" This documentation is derived from the time and date facilities of -'\" TclX, by Mark Diekhans and Karl Lehenbauer. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: clock.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH clock n 7.4 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -clock \- Obtain and manipulate time -.SH SYNOPSIS -\fBclock \fIoption\fR ?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command performs one of several operations that may obtain -or manipulate strings or values that represent some notion of -time. The \fIoption\fR argument determines what action is carried -out by the command. The legal \fIoptions\fR (which may be -abbreviated) are: -.TP -\fBclock clicks\fR -Return a high-resolution time value as a system-dependent integer -value. The unit of the value is system-dependent but should be the -highest resolution clock available on the system such as a CPU cycle -counter. This value should only be used for the relative measurement -of elapsed time. -.TP -\fBclock format \fIclockValue\fR ?\fB\-format \fIstring\fR? ?\fB\-gmt \fIboolean\fR? -Converts an integer time value, typically returned by -\fBclock seconds\fR, \fBclock scan\fR, or the \fBatime\fR, \fBmtime\fR, -or \fBctime\fR options of the \fBfile\fR command, to human-readable -form. If the \fB\-format\fR argument is present the next argument is a -string that describes how the date and time are to be formatted. -Field descriptors consist of a \fB%\fR followed by a field -descriptor character. All other characters are copied into the result. -Valid field descriptors are: -.RS -.IP \fB%%\fR -Insert a %. -.IP \fB%a\fR -Abbreviated weekday name (Mon, Tue, etc.). -.IP \fB%A\fR -Full weekday name (Monday, Tuesday, etc.). -.IP \fB%b\fR -Abbreviated month name (Jan, Feb, etc.). -.IP \fB%B\fR -Full month name. -.IP \fB%c\fR -Locale specific date and time. -.IP \fB%d\fR -Day of month (01 - 31). -.IP \fB%H\fR -Hour in 24-hour format (00 - 23). -.IP \fB%I\fR -Hour in 12-hour format (00 - 12). -.IP \fB%j\fR -Day of year (001 - 366). -.IP \fB%m\fR -Month number (01 - 12). -.IP \fB%M\fR -Minute (00 - 59). -.IP \fB%p\fR -AM/PM indicator. -.IP \fB%S\fR -Seconds (00 - 59). -.IP \fB%U\fR -Week of year (01 - 52), Sunday is the first day of the week. -.IP \fB%w\fR -Weekday number (Sunday = 0). -.IP \fB%W\fR -Week of year (01 - 52), Monday is the first day of the week. -.IP \fB%x\fR -Locale specific date format. -.IP \fB%X\fR -Locale specific time format. -.IP \fB%y\fR -Year without century (00 - 99). -.IP \fB%Y\fR -Year with century (e.g. 1990) -.IP \fB%Z\fR -Time zone name. -.RE -.sp -.RS -In addition, the following field descriptors may be supported on some -systems (e.g. Unix but not Windows): -.IP \fB%D\fR -Date as %m/%d/%y. -.IP \fB%e\fR -Day of month (1 - 31), no leading zeros. -.IP \fB%h\fR -Abbreviated month name. -.IP \fB%n\fR -Insert a newline. -.IP \fB%r\fR -Time as %I:%M:%S %p. -.IP \fB%R\fR -Time as %H:%M. -.IP \fB%t\fR -Insert a tab. -.IP \fB%T\fR -Time as %H:%M:%S. -.RE -.sp -.RS -If the \fB\-format\fR argument is not specified, the format string -"\fB%a %b %d %H:%M:%S %Z %Y\fR" is used. If the \fB\-gmt\fR argument -is present the next argument must be a boolean which if true specifies -that the time will be formatted as Greenwich Mean Time. If false -then the local timezone will be used as defined by the operating -environment. -.RE -.TP -\fBclock scan \fIdateString\fR ?\fB\-base \fIclockVal\fR? ?\fB\-gmt \fIboolean\fR? -Convert \fIdateString\fR to an integer clock value (see \fBclock seconds\fR). -This command can parse and convert virtually any standard date and/or time -string, which can include standard time zone mnemonics. If only a time is -specified, the current date is assumed. If the string does not contain a -time zone mnemonic, the local time zone is assumed, unless the \fB\-gmt\fR -argument is true, in which case the clock value is calculated assuming -that the specified time is relative to Greenwich Mean Time. -.sp -If the \fB\-base\fR flag is specified, the next argument should contain -an integer clock value. Only the date in this value is used, not the -time. This is useful for determining the time on a specific day or -doing other date-relative conversions. -.sp -The \fIdateString\fR consists of zero or more specifications of the -following form: -.RS -.TP -\fItime\fR -A time of day, which is of the form: \fIhh\fR?\fI:mm\fR?\fI:ss\fR?? -?\fImeridian\fR? ?\fIzone\fR? or \fIhhmm \fR?\fImeridian\fR? -?\fIzone\fR?. If no meridian is specified, \fIhh\fR is interpreted on -a 24-hour clock. -.TP -\fIdate\fR -A specific month and day with optional year. The -acceptable formats are \fImm/dd\fR?\fI/yy\fR?, \fImonthname dd\fR -?, \fIyy\fR?, \fIdd monthname \fR?\fIyy\fR? and \fIday, dd monthname -yy\fR. The default year is the current year. If the year is less -.VS -than 100, we treat the years 00-68 as 2000-2068 and the years 69-99 -as 1969-1999. Not all platforms can represent the years 38-70, so -an error may result if these years are used. -.VE -.TP -\fIrelative time\fR -A specification relative to the current time. The format is \fInumber -unit\fR acceptable units are \fByear\fR, \fBfortnight\fR, \fBmonth\fR, \fBweek\fR, \fBday\fR, -\fBhour\fR, \fBminute\fR (or \fBmin\fR), and \fBsecond\fR (or \fBsec\fR). The -unit can be specified as a singular or plural, as in \fB3 weeks\fR. -These modifiers may also be specified: -\fBtomorrow\fR, \fByesterday\fR, \fBtoday\fR, \fBnow\fR, -\fBlast\fR, \fBthis\fR, \fBnext\fR, \fBago\fR. -.RE -.sp -.RS -The actual date is calculated according to the following steps. -First, any absolute date and/or time is processed and converted. -Using that time as the base, day-of-week specifications are added. -Next, relative specifications are used. If a date or day is -specified, and no absolute or relative time is given, midnight is -used. Finally, a correction is applied so that the correct hour of -the day is produced after allowing for daylight savings time -differences and the correct date is given when going from the end -of a long month to a short month. -.RE -.TP -\fBclock seconds\fR -Return the current date and time as a system-dependent integer value. The -unit of the value is seconds, allowing it to be used for relative time -calculations. The value is usually defined as total elapsed time from -an ``epoch''. You shouldn't assume the value of the epoch. - -.SH KEYWORDS -clock, date, time diff --git a/doc/close.n b/doc/close.n deleted file mode 100644 index 2097e04..0000000 --- a/doc/close.n +++ /dev/null @@ -1,59 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: close.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH close n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -close \- Close an open channel. -.SH SYNOPSIS -\fBclose \fIchannelId\fR -.BE - -.SH DESCRIPTION -.PP -Closes the channel given by \fIchannelId\fR. \fIChannelId\fR must be a -channel identifier such as the return value from a previous \fBopen\fR -or \fBsocket\fR command. -All buffered output is flushed to the channel's output device, -any buffered input is discarded, the underlying file or device is closed, -and \fIchannelId\fR becomes unavailable for use. -.VS "" br -.PP -If the channel is blocking, the command does not return until all output -is flushed. -If the channel is nonblocking and there is unflushed output, the -channel remains open and the command -returns immediately; output will be flushed in the background and the -channel will be closed when all the flushing is complete. -.VE -.PP -If \fIchannelId\fR is a blocking channel for a command pipeline then -\fBclose\fR waits for the child processes to complete. -.VS "" br -.PP -If the channel is shared between interpreters, then \fBclose\fR -makes \fIchannelId\fR unavailable in the invoking interpreter but has no -other effect until all of the sharing interpreters have closed the -channel. -When the last interpreter in which the channel is registered invokes -\fBclose\fR, the cleanup actions described above occur. See the -\fBinterp\fR command for a description of channel sharing. -.PP -Channels are automatically closed when an interpreter is destroyed and -when the process exits. Channels are switched to blocking mode, to ensure -that all output is correctly flushed before the process exits. -.VE -.PP -The command returns an empty string, and may generate an error if -an error occurs while flushing output. - -.SH KEYWORDS -blocking, channel, close, nonblocking diff --git a/doc/concat.n b/doc/concat.n deleted file mode 100644 index a2f9c1e..0000000 --- a/doc/concat.n +++ /dev/null @@ -1,40 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: concat.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH concat n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -concat \- Join lists together -.SH SYNOPSIS -\fBconcat\fI \fR?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command treats each argument as a list and concatenates them -into a single list. -It also eliminates leading and trailing spaces in the \fIarg\fR's -and adds a single separator space between \fIarg\fR's. -It permits any number of arguments. For example, -the command -.CS -\fBconcat a b {c d e} {f {g h}}\fR -.CE -will return -.CS -\fBa b c d e f {g h}\fR -.CE -as its result. -.PP -If no \fIarg\fRs are supplied, the result is an empty string. - -.SH KEYWORDS -concatenate, join, lists diff --git a/doc/continue.n b/doc/continue.n deleted file mode 100644 index 2faddd1..0000000 --- a/doc/continue.n +++ /dev/null @@ -1,34 +0,0 @@ -'\" -'\" Copyright (c) 1993-1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: continue.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH continue n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -continue \- Skip to the next iteration of a loop -.SH SYNOPSIS -\fBcontinue\fR -.BE - -.SH DESCRIPTION -.PP -This command is typically invoked inside the body of a looping command -such as \fBfor\fR or \fBforeach\fR or \fBwhile\fR. -It returns a TCL_CONTINUE code, which causes a continue exception -to occur. -The exception causes the current script to be aborted -out to the innermost containing loop command, which then -continues with the next iteration of the loop. -Catch exceptions are also handled in a few other situations, such -as the \fBcatch\fR command and the outermost scripts of procedure -bodies. - -.SH KEYWORDS -continue, iteration, loop diff --git a/doc/dde.n b/doc/dde.n deleted file mode 100644 index c9797a6..0000000 --- a/doc/dde.n +++ /dev/null @@ -1,124 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: dde.n,v 1.2 1999/04/16 00:46:34 stanton Exp $ -'\" -.so man.macros -.TH dde n 8.1 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -dde \- Execute a Dynamic Data Exchange command -.SH SYNOPSIS -.sp -\fBpackage require dde 1.0\fR -.sp -\fBdde \fIservername \fR?\fItopic\fR? -.sp -\fBdde ?\-async?\fR \fIcommand service topic \fR?\fIdata\fR? -.BE - -.SH DESCRIPTION -.PP -This command allows an application to send Dynamic Data Exchange (DDE) -command when running under Microsoft Windows. Dynamic Data Exchange is -a mechanism where applications can exchange raw data. Each DDE -transaction needs a \fIservice name\fR and a \fItopic\fR. Both the -\fIservice name\fR and \fItopic\fR are application defined; Tcl uses -the service name \fBTclEval\fR, while the topic name is the name of the -interpreter given by \fBdde servername\fR. Other applications have their -own \fIservice names\fR and \fItopics\fR. For instance, Microsoft Excel -has the service name \fBExcel\fR. -.PP -The only option to the \fBdde\fR command is: -.TP -\fB\-async\fR -Requests asynchronous invocation. This is valid only for the -\fBexecute\fR subcommand. Normally, the \fBdde execute\fR subcommand -waits until the command completes, returning appropriate error -messages. When the \fB\-async\fR option is used, the command returns -immediately, and no error information is available. -.SH "DDE COMMANDS" -.PP -The following commands are a subset of the full Dynamic Data Exchange -set of commands. -.TP -\fBdde servername \fR?\fItopic\fR? -\fBdde servername\fR registers the interpreter as a DDE server with -the service name TclEval and the topic name specified byt \fItopic\fR. -If no \fItopic\fR is given, \fBdde servername\fR returns the name -of the current topic or the empty string if it is not registered as a service. -.TP -\fBdde execute \fIservice topic data\fR -\fBdde execute\fR takes the \fIdata\fR and sends it to the server -indicated by \fIservice\fR with the topic indicated by -\fItopic\fR. Typically, \fIservice\fR is the name of an application, -and \fItopic\fR is a file to work on. The \fIdata\fR field is given -to the remote application. Typically, the application treats the -\fIdata\fR field as a script, and the script is run in the -application. The command returns an error if the script did not -run. If the \fB\-async\fR flag was used, the command -returns immediately with no error. -.TP -\fBdde request \fIservice topic item\fR -\fBdde request\fR is typically used to get the value of something; the -value of a cell in Microsoft Excel or the text of a selection in -Microsoft Word. \fIservice\fR is typically the name of an application, -\fItopic\fR is typically the name of the file, and \fIitem\fR is -application-specific. The command returns the value of \fIitem\fR as -defined in the application. -.TP -\fBdde services \fIservice topic\fR -\fBdde services\fR returns a list of service-topic pairs that -currently exist on the machine. If \fIservice\fR and \fItopic\fR are -both null strings ({}), then all service-topic pairs currently -available on the system are returned. If \fIservice\fR is null and -\fItopic\fR is not, then all services with the specified topic are -returned. If \fIservice\fR is not null and \fItopic\fR is, all topics -for a given service are returned. If both are not null, if that -service-topic pair currently exists, it is returned; otherwise, null -is returned. -.TP -\fBdde eval \fItopic cmd \fR?\fIarg arg ...\fR? -\fBdde eval\fR evaluates a command and its arguments using the -interpreter specified by \fItopic\fR. The DDE service must be the -"TclEval" service. This command can be used to replace send on Windows. -.SH "DDE AND TCL" -A Tcl interpreter always has a service name of "TclEval". Each -different interp of all running Tcl applications should a unique -name specified by \fBdde servername\fR. Each interp is available as a -DDE topic only if the \fBdde servername\fR command was used to set the -name of the topic for each interp. So a \fBdde services TclEval {}\fR -command will return a list of service-topic pairs, where each of the -currently running interps will be a topic. -.PP -When Tcl processes a \fBdde execute\fR command, the data for the -execute is run as a script in the interp named by the topic of the -\fBdde execute\fR command. -.PP -When Tcl processes a \fBdde request\fR command, it returns the value of -the variable given in the dde command in the context of the interp -named by the dde topic. Tcl reserves the variable "$TCLEVAL$EXECUTE$RESULT" -for internal use, and \fBdde request\fR commands for that variable -will give unpredictable results. -.PP -An external application which wishes to run a script in Tcl should have -that script store its result in a variable, run the \fBdde execute\fR -command, and the run \fBdde request\fR to get the value of the -variable. -.PP -When using DDE, be careful to ensure that the event queue is flushed -using either \fBupdate\fR or \fBvwait\fR. This happens by default -when using \fBwish\fR unless a blocking command is called (such as \fBexec\fR -without adding the \fB&\fR to place the process in the background). -If for any reason the event queue is not flushed, DDE commands may -hang until the event queue is flushed. This can create a deadlock -situation. -.SH KEYWORDS -application, dde, name, remote execution -.SH "SEE ALSO" -tk, winfo, send - diff --git a/doc/encoding.n b/doc/encoding.n deleted file mode 100644 index fc6d4f7..0000000 --- a/doc/encoding.n +++ /dev/null @@ -1,79 +0,0 @@ -'\" -'\" Copyright (c) 1998 by Scriptics Corporation. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: encoding.n,v 1.2 1999/04/16 00:46:34 stanton Exp $ -'\" -.so man.macros -.TH encoding n "8.1" Tcl "Tcl Built-In Commands" -.BS -.SH NAME -encoding \- Manipulate encodings -.SH SYNOPSIS -\fBencoding \fIoption\fR ?\fIarg arg ...\fR? -.BE - -.SH INTRODUCTION -.PP -Strings in Tcl are encoded using 16-bit Unicode characters. Different -operating system interfaces or applications may generate strings in -other encodings such as Shift-JIS. The \fBencoding\fR command helps -to bridge the gap between Unicode and these other formats. - -.SH DESCRIPTION -.PP -Performs one of several encoding related operations, depending on -\fIoption\fR. The legal \fIoption\fRs are: -.TP -\fBencoding convertfrom ?\fIencoding\fR? \fIdata\fR -Convert \fIdata\fR to Unicode from the specified \fIencoding\fR. The -characters in \fIdata\fR are treated as binary data where the lower -8-bits of each character is taken as a single byte. The resulting -sequence of bytes is treated as a string in the specified -\fIencoding\fR. If \fIencoding\fR is not specified, the current -system encoding is used. -.TP -\fBencoding convertto ?\fIencoding\fR? \fIstring\fR -Convert \fIstring\fR from Unicode to the specified \fIencoding\fR. -The result is a sequence of bytes that represents the converted -string. Each byte is stored in the lower 8-bits of a Unicode -character. If \fIencoding\fR is not specified, the current -system encoding is used. -.TP -\fBencoding names\fR -Returns a list containing the names of all of the encodings that are -currently available. -.TP -\fBencoding system\fR ?\fIencoding\fR? -Set the system encoding to \fIencoding\fR. If \fIencoding\fR is -omitted then the command returns the current system encoding. The -system encoding is used whenever Tcl passes strings to system calls. - -.SH EXAMPLE -.PP -It is common practice to write script files using a text editor that -produces output in the euc-jp encoding, which represents the ASCII -characters as singe bytes and Japanese characters as two bytes. This -makes it easy to embed literal strings that correspond to non-ASCII -characters by simply typing the strings in place in the script. -However, because the \fBsource\fR command always reads files using the -ISO8859-1 encoding, Tcl will treat each byte in the file as a separate -character that maps to the 00 page in Unicode. The -resulting Tcl strings will not contain the expected Japanese -characters. Instead, they will contain a sequence of Latin-1 -characters that correspond to the bytes of the original string. The -\fBencoding\fR command can be used to convert this string to the -expected Japanese Unicode characters. For example, -.CS - set s [encoding convertfrom euc-jp "\\xA4\\xCF"] -.CE -would return the Unicode string "\\u306F", which is the Hiragana -letter HA. - -.SH "SEE ALSO" -Tcl_GetEncoding - -.SH KEYWORDS -encoding diff --git a/doc/eof.n b/doc/eof.n deleted file mode 100644 index a9f97c9..0000000 --- a/doc/eof.n +++ /dev/null @@ -1,27 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: eof.n,v 1.2 1998/09/14 18:39:51 stanton Exp $ -'\" -.so man.macros -.TH eof n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -eof \- Check for end of file condition on channel -.SH SYNOPSIS -\fBeof \fIchannelId\fR -.BE - -.SH DESCRIPTION -.PP -Returns 1 if an end of file condition occurred during the most -recent input operation on \fIchannelId\fR (such as \fBgets\fR), -0 otherwise. - -.SH KEYWORDS -channel, end of file diff --git a/doc/error.n b/doc/error.n deleted file mode 100644 index 347e26e..0000000 --- a/doc/error.n +++ /dev/null @@ -1,58 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: error.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH error n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -error \- Generate an error -.SH SYNOPSIS -\fBerror \fImessage\fR ?\fIinfo\fR? ?\fIcode\fR? -.BE - -.SH DESCRIPTION -.PP -Returns a TCL_ERROR code, which causes command interpretation to be -unwound. \fIMessage\fR is a string that is returned to the application -to indicate what went wrong. -.PP -If the \fIinfo\fR argument is provided and is non-empty, -it is used to initialize the global variable \fBerrorInfo\fR. -\fBerrorInfo\fR is used to accumulate a stack trace of what -was in progress when an error occurred; as nested commands unwind, -the Tcl interpreter adds information to \fBerrorInfo\fR. If the -\fIinfo\fR argument is present, it is used to initialize -\fBerrorInfo\fR and the first increment of unwind information -will not be added by the Tcl interpreter. In other -words, the command containing the \fBerror\fR command will not appear -in \fBerrorInfo\fR; in its place will be \fIinfo\fR. -This feature is most useful in conjunction with the \fBcatch\fR command: -if a caught error cannot be handled successfully, \fIinfo\fR can be used -to return a stack trace reflecting the original point of occurrence -of the error: -.CS -\fBcatch {...} errMsg -set savedInfo $errorInfo -\&... -error $errMsg $savedInfo\fR -.CE -.PP -If the \fIcode\fR argument is present, then its value is stored -in the \fBerrorCode\fR global variable. This variable is intended -to hold a machine-readable description of the error in cases where -such information is available; see the \fBtclvars\fR manual -page for information on the proper format for the variable. -If the \fIcode\fR argument is not -present, then \fBerrorCode\fR is automatically reset to -``NONE'' by the Tcl interpreter as part of processing the -error generated by the command. - -.SH KEYWORDS -error, errorCode, errorInfo diff --git a/doc/eval.n b/doc/eval.n deleted file mode 100644 index 698b28e..0000000 --- a/doc/eval.n +++ /dev/null @@ -1,30 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: eval.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH eval n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -eval \- Evaluate a Tcl script -.SH SYNOPSIS -\fBeval \fIarg \fR?\fIarg ...\fR? -.BE - -.SH DESCRIPTION -.PP -\fBEval\fR takes one or more arguments, which together comprise a Tcl -script containing one or more commands. -\fBEval\fR concatenates all its arguments in the same -fashion as the \fBconcat\fR command, passes the concatenated string to the -Tcl interpreter recursively, and returns the result of that -evaluation (or any error generated by it). - -.SH KEYWORDS -concatenate, evaluate, script diff --git a/doc/exec.n b/doc/exec.n deleted file mode 100644 index f30f6b0..0000000 --- a/doc/exec.n +++ /dev/null @@ -1,358 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: exec.n,v 1.3 1999/04/16 00:46:34 stanton Exp $ -'\" -.so man.macros -.TH exec n 7.6 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -exec \- Invoke subprocess(es) -.SH SYNOPSIS -\fBexec \fR?\fIswitches\fR? \fIarg \fR?\fIarg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command treats its arguments as the specification -of one or more subprocesses to execute. -The arguments take the form of a standard shell pipeline -where each \fIarg\fR becomes one word of a command, and -each distinct command becomes a subprocess. -.PP -If the initial arguments to \fBexec\fR start with \fB\-\fR then -they are treated as command-line switches and are not part -of the pipeline specification. The following switches are -currently supported: -.TP 13 -\fB\-keepnewline\fR -Retains a trailing newline in the pipeline's output. -Normally a trailing newline will be deleted. -.TP 13 -\fB\-\|\-\fR -Marks the end of switches. The argument following this one will -be treated as the first \fIarg\fR even if it starts with a \fB\-\fR. -.PP -If an \fIarg\fR (or pair of \fIarg\fR's) has one of the forms -described below then it is used by \fBexec\fR to control the -flow of input and output among the subprocess(es). -Such arguments will not be passed to the subprocess(es). In forms -such as ``< \fIfileName\fR'' \fIfileName\fR may either be in a -separate argument from ``<'' or in the same argument with no -intervening space (i.e. ``<\fIfileName\fR''). -.TP 15 -| -Separates distinct commands in the pipeline. The standard output -of the preceding command will be piped into the standard input -of the next command. -.TP 15 -|& -Separates distinct commands in the pipeline. Both standard output -and standard error of the preceding command will be piped into -the standard input of the next command. -This form of redirection overrides forms such as 2> and >&. -.TP 15 -<\0\fIfileName\fR -The file named by \fIfileName\fR is opened and used as the standard -input for the first command in the pipeline. -.TP 15 -<@\0\fIfileId\fR -\fIFileId\fR must be the identifier for an open file, such as the return -value from a previous call to \fBopen\fR. -It is used as the standard input for the first command in the pipeline. -\fIFileId\fR must have been opened for reading. -.TP 15 -<<\0\fIvalue\fR -\fIValue\fR is passed to the first command as its standard input. -.TP 15 ->\0\fIfileName\fR -Standard output from the last command is redirected to the file named -\fIfileName\fR, overwriting its previous contents. -.TP 15 -2>\0\fIfileName\fR -Standard error from all commands in the pipeline is redirected to the -file named \fIfileName\fR, overwriting its previous contents. -.TP 15 ->&\0\fIfileName\fR -Both standard output from the last command and standard error from all -commands are redirected to the file named \fIfileName\fR, overwriting -its previous contents. -.TP 15 ->>\0\fIfileName\fR -Standard output from the last command is -redirected to the file named \fIfileName\fR, appending to it rather -than overwriting it. -.TP 15 -2>>\0\fIfileName\fR -Standard error from all commands in the pipeline is -redirected to the file named \fIfileName\fR, appending to it rather -than overwriting it. -.TP 15 ->>&\0\fIfileName\fR -Both standard output from the last command and standard error from -all commands are redirected to the file named \fIfileName\fR, -appending to it rather than overwriting it. -.TP 15 ->@\0\fIfileId\fR -\fIFileId\fR must be the identifier for an open file, such as the return -value from a previous call to \fBopen\fR. -Standard output from the last command is redirected to \fIfileId\fR's -file, which must have been opened for writing. -.TP 15 -2>@\0\fIfileId\fR -\fIFileId\fR must be the identifier for an open file, such as the return -value from a previous call to \fBopen\fR. -Standard error from all commands in the pipeline is -redirected to \fIfileId\fR's file. -The file must have been opened for writing. -.TP 15 ->&@\0\fIfileId\fR -\fIFileId\fR must be the identifier for an open file, such as the return -value from a previous call to \fBopen\fR. -Both standard output from the last command and standard error from -all commands are redirected to \fIfileId\fR's file. -The file must have been opened for writing. -.PP -If standard output has not been redirected then the \fBexec\fR -command returns the standard output from the last command -in the pipeline. -If any of the commands in the pipeline exit abnormally or -are killed or suspended, then \fBexec\fR will return an error -and the error message will include the pipeline's output followed by -error messages describing the abnormal terminations; the -\fBerrorCode\fR variable will contain additional information -about the last abnormal termination encountered. -If any of the commands writes to its standard error file and that -standard error isn't redirected, -then \fBexec\fR will return an error; the error message -will include the pipeline's standard output, followed by messages -about abnormal terminations (if any), followed by the standard error -output. -.PP -If the last character of the result or error message -is a newline then that character is normally deleted -from the result or error message. -This is consistent with other Tcl return values, which don't -normally end with newlines. -However, if \fB\-keepnewline\fR is specified then the trailing -newline is retained. -.PP -If standard input isn't redirected with ``<'' or ``<<'' -or ``<@'' then the standard input for the first command in the -pipeline is taken from the application's current standard input. -.PP -If the last \fIarg\fR is ``&'' then the pipeline will be -executed in background. -In this case the \fBexec\fR command will return a list whose -elements are the process identifiers for all of the subprocesses -in the pipeline. -The standard output from the last command in the pipeline will -go to the application's standard output if it hasn't been -redirected, and error output from all of -the commands in the pipeline will go to the application's -standard error file unless redirected. -.PP -The first word in each command is taken as the command name; -tilde-substitution is performed on it, and if the result contains -no slashes then the directories -in the PATH environment variable are searched for -an executable by the given name. -If the name contains a slash then it must refer to an executable -reachable from the current directory. -No ``glob'' expansion or other shell-like substitutions -are performed on the arguments to commands. - -.VS -.SH "PORTABILITY ISSUES" -.TP -\fBWindows\fR (all versions) -. -Reading from or writing to a socket, using the ``\fB@\0\fIfileId\fR'' -notation, does not work. When reading from a socket, a 16-bit DOS -application will hang and a 32-bit application will return immediately with -end-of-file. When either type of application writes to a socket, the -information is instead sent to the console, if one is present, or is -discarded. -.sp -The Tk console text widget does not provide real standard IO capabilities. -Under Tk, when redirecting from standard input, all applications will see an -immediate end-of-file; information redirected to standard output or standard -error will be discarded. -.sp -Either forward or backward slashes are accepted as path separators for -arguments to Tcl commands. When executing an application, the path name -specified for the application may also contain forward or backward slashes -as path separators. Bear in mind, however, that most Windows applications -accept arguments with forward slashes only as option delimiters and -backslashes only in paths. Any arguments to an application that specify a -path name with forward slashes will not automatically be converted to use -the backslash character. If an argument contains forward slashes as the -path separator, it may or may not be recognized as a path name, depending on -the program. -.sp -Additionally, when calling a 16-bit DOS or Windows 3.X application, all path -names must use the short, cryptic, path format (e.g., using ``applba~1.def'' -instead of ``applbakery.default''). -.sp -Two or more forward or backward slashes in a row in a path refer to a -network path. For example, a simple concatenation of the root directory -\fBc:/\fR with a subdirectory \fB/windows/system\fR will yield -\fBc://windows/system\fR (two slashes together), which refers to the mount -point called \fBsystem\fR on the machine called \fBwindows\fR (and the -\fBc:/\fR is ignored), and is not equivalent to \fBc:/windows/system\fR, -which describes a directory on the current computer. The \fBfile join\fR -command should be used to concatenate path components. -.TP -\fBWindows NT\fR -. -When attempting to execute an application, \fBexec\fR first searches for the -name as it was specified. Then, in order, \fB.com\fR, \fB.exe\fR, and \fB.bat\fR -are appended to the end of the specified name and it searches for -the longer name. If a directory name was not specified as part of the -application name, the following directories are automatically searched in -order when attempting to locate the application: -.sp -.RS -.RS -The directory from which the Tcl executable was loaded. -.br -The current directory. -.br -The Windows NT 32-bit system directory. -.br -The Windows NT 16-bit system directory. -.br -The Windows NT home directory. -.br -The directories listed in the path. -.RE -.sp -In order to execute the shell builtin commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend ``\fBcmd.exe /c\0\fR'' to the desired command. -.sp -.RE -.TP -\fBWindows 95\fR -. -When attempting to execute an application, \fBexec\fR first searches for the -name as it was specified. Then, in order, \fB.com\fR, \fB.exe\fR, and \fB.bat\fR -are appended to the end of the specified name and it searches for -the longer name. If a directory name was not specified as part of the -application name, the following directories are automatically searched in -order when attempting to locate the application: -.sp -.RS -.RS -The directory from which the Tcl executable was loaded. -.br -The current directory. -.br -The Windows 95 system directory. -.br -The Windows 95 home directory. -.br -The directories listed in the path. -.RE -.sp -In order to execute the shell builtin commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend ``\fBcommand.com /c\0\fR'' to the desired command. -.sp -Once a 16-bit DOS application has read standard input from a console and -then quit, all subsequently run 16-bit DOS applications will see the -standard input as already closed. 32-bit applications do not have this -problem and will run correctly, even after a 16-bit DOS application thinks -that standard input is closed. There is no known workaround for this bug -at this time. -.sp -Redirection between the \fBNUL:\fR device and a 16-bit application does not -always work. When redirecting from \fBNUL:\fR, some applications may hang, -others will get an infinite stream of ``0x01'' bytes, and some will actually -correctly get an immediate end-of-file; the behavior seems to depend upon -something compiled into the application itself. When redirecting greater than -4K or so to \fBNUL:\fR, some applications will hang. The above problems do not -happen with 32-bit applications. -.sp -All DOS 16-bit applications are run synchronously. All standard input from -a pipe to a 16-bit DOS application is collected into a temporary file; the -other end of the pipe must be closed before the 16-bit DOS application -begins executing. All standard output or error from a 16-bit DOS -application to a pipe is collected into temporary files; the application -must terminate before the temporary files are redirected to the next stage -of the pipeline. This is due to a workaround for a Windows 95 bug in the -implementation of pipes, and is how the standard Windows 95 DOS shell -handles pipes itself. -.sp -Certain applications, such as \fBcommand.com\fR, should not be executed -interactively. Applications which directly access the console window, -rather than reading from their standard input and writing to their standard -output may fail, hang Tcl, or even hang the system if their own private -console window is not available to them. -.RE -.TP -\fBWindows 3.X\fR -. -When attempting to execute an application, \fBexec\fR first searches for the -name as it was specified. Then, in order, \fB.com\fR, \fB.exe\fR, and \fB.bat\fR -are appended to the end of the specified name and it searches for -the longer name. If a directory name was not specified as part of the -application name, the following directories are automatically searched in -order when attempting to locate the application: -.sp -.RS -.RS -The directory from which the Tcl executable was loaded. -.br -The current directory. -.br -The Windows 3.X system directory. -.br -The Windows 3.X home directory. -.br -The directories listed in the path. -.RE -.sp -In order to execute the shell builtin commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend ``\fBcommand.com /c\0\fR'' to the desired command. -.sp -16-bit and 32-bit DOS and Windows applications may be executed. However, -redirection and piping of standard IO only works with 16-bit DOS -applications. 32-bit applications always see standard input as already -closed, and any standard output or error is discarded, no matter where in the -pipeline the application occurs or what redirection symbols are used by the -caller. Additionally, for 16-bit applications, standard error is always -sent to the same place as standard output; it cannot be redirected to a -separate location. In order to achieve pseudo-redirection for 32-bit -applications, the 32-bit application must instead be written to take command -line arguments that specify the files that it should read from and write to -and open those files itself. -.sp -All applications, both 16-bit and 32-bit, run synchronously; each application -runs to completion before the next one in the pipeline starts. Temporary files -are used to simulate piping between applications. The \fBexec\fR -command cannot be used to start an application in the background. -.sp -When standard input is redirected from an open file using the -``\fB@\0\fIfileId\fR'' notation, the open file is completely read up to its -end. This is slightly different than under Windows 95 or NT, where the child -application consumes from the open file only as much as it wants. -Redirecting to an open file is supported as normal. -.RE -.TP -\fBMacintosh\fR -The \fBexec\fR command is not implemented and does not exist under Macintosh. -.TP -\fBUnix\fR\0\0\0\0\0\0\0 -The \fBexec\fR command is fully functional and works as described. - -.SH "SEE ALSO" -open(n) -.VE - -.SH KEYWORDS -execute, pipeline, redirection, subprocess - diff --git a/doc/exit.n b/doc/exit.n deleted file mode 100644 index d3960f0..0000000 --- a/doc/exit.n +++ /dev/null @@ -1,28 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: exit.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH exit n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -exit \- End the application -.SH SYNOPSIS -\fBexit \fR?\fIreturnCode\fR? -.BE - -.SH DESCRIPTION -.PP -Terminate the process, returning \fIreturnCode\fR to the -system as the exit status. -If \fIreturnCode\fR isn't specified then it defaults -to 0. - -.SH KEYWORDS -exit, process diff --git a/doc/expr.n b/doc/expr.n deleted file mode 100644 index 25f6ad6..0000000 --- a/doc/expr.n +++ /dev/null @@ -1,323 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: expr.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH expr n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -expr \- Evaluate an expression -.SH SYNOPSIS -\fBexpr \fIarg \fR?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -Concatenates \fIarg\fR's (adding separator spaces between them), -evaluates the result as a Tcl expression, and returns the value. -The operators permitted in Tcl expressions are a subset of -the operators permitted in C expressions, and they have the -same meaning and precedence as the corresponding C operators. -Expressions almost always yield numeric results -(integer or floating-point values). -For example, the expression -.CS -\fBexpr 8.2 + 6\fR -.CE -evaluates to 14.2. -Tcl expressions differ from C expressions in the way that -operands are specified. Also, Tcl expressions support -non-numeric operands and string comparisons. -.SH OPERANDS -.PP -A Tcl expression consists of a combination of operands, operators, -and parentheses. -White space may be used between the operands and operators and -parentheses; it is ignored by the expression's instructions. -Where possible, operands are interpreted as integer values. -Integer values may be specified in decimal (the normal case), in octal (if the -first character of the operand is \fB0\fR), or in hexadecimal (if the first -two characters of the operand are \fB0x\fR). -If an operand does not have one of the integer formats given -above, then it is treated as a floating-point number if that is -possible. Floating-point numbers may be specified in any of the -ways accepted by an ANSI-compliant C compiler (except that the -\fBf\fR, \fBF\fR, \fBl\fR, and \fBL\fR suffixes will not be permitted in -most installations). For example, all of the -following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16. -If no numeric interpretation is possible, then an operand is left -as a string (and only a limited set of operators may be applied to -it). -.PP -Operands may be specified in any of the following ways: -.IP [1] -As an numeric value, either integer or floating-point. -.IP [2] -As a Tcl variable, using standard \fB$\fR notation. -The variable's value will be used as the operand. -.IP [3] -As a string enclosed in double-quotes. -The expression parser will perform backslash, variable, and -command substitutions on the information between the quotes, -and use the resulting value as the operand -.IP [4] -As a string enclosed in braces. -The characters between the open brace and matching close brace -will be used as the operand without any substitutions. -.IP [5] -As a Tcl command enclosed in brackets. -The command will be executed and its result will be used as -the operand. -.IP [6] -As a mathematical function whose arguments have any of the above -forms for operands, such as \fBsin($x)\fR. See below for a list of defined -functions. -.LP -Where substitutions occur above (e.g. inside quoted strings), they -are performed by the expression's instructions. -However, an additional layer of substitution may already have -been performed by the command parser before the expression -processor was called. -As discussed below, it is usually best to enclose expressions -in braces to prevent the command parser from performing substitutions -on the contents. -.PP -For some examples of simple expressions, suppose the variable -\fBa\fR has the value 3 and -the variable \fBb\fR has the value 6. -Then the command on the left side of each of the lines below -will produce the value on the right side of the line: -.CS -.ta 6c -\fBexpr 3.1 + $a 6.1 -expr 2 + "$a.$b" 5.6 -expr 4*[llength "6 2"] 8 -expr {{word one} < "word $a"} 0\fR -.CE -.SH OPERATORS -.PP -The valid operators are listed below, grouped in decreasing order -of precedence: -.TP 20 -\fB\-\0\0+\0\0~\0\0!\fR -Unary minus, unary plus, bit-wise NOT, logical NOT. None of these operands -may be applied to string operands, and bit-wise NOT may be -applied only to integers. -.TP 20 -\fB*\0\0/\0\0%\fR -Multiply, divide, remainder. None of these operands may be -applied to string operands, and remainder may be applied only -to integers. -The remainder will always have the same sign as the divisor and -an absolute value smaller than the divisor. -.TP 20 -\fB+\0\0\-\fR -Add and subtract. Valid for any numeric operands. -.TP 20 -\fB<<\0\0>>\fR -Left and right shift. Valid for integer operands only. -A right shift always propagates the sign bit. -.TP 20 -\fB<\0\0>\0\0<=\0\0>=\fR -Boolean less, greater, less than or equal, and greater than or equal. -Each operator produces 1 if the condition is true, 0 otherwise. -These operators may be applied to strings as well as numeric operands, -in which case string comparison is used. -.TP 20 -\fB==\0\0!=\fR -Boolean equal and not equal. Each operator produces a zero/one result. -Valid for all operand types. -.TP 20 -\fB&\fR -Bit-wise AND. Valid for integer operands only. -.TP 20 -\fB^\fR -Bit-wise exclusive OR. Valid for integer operands only. -.TP 20 -\fB|\fR -Bit-wise OR. Valid for integer operands only. -.TP 20 -\fB&&\fR -Logical AND. Produces a 1 result if both operands are non-zero, -0 otherwise. -Valid for boolean and numeric (integers or floating-point) operands only. -.TP 20 -\fB||\fR -Logical OR. Produces a 0 result if both operands are zero, 1 otherwise. -Valid for boolean and numeric (integers or floating-point) operands only. -.TP 20 -\fIx\fB?\fIy\fB:\fIz\fR -If-then-else, as in C. If \fIx\fR -evaluates to non-zero, then the result is the value of \fIy\fR. -Otherwise the result is the value of \fIz\fR. -The \fIx\fR operand must have a numeric value. -.LP -See the C manual for more details on the results -produced by each operator. -All of the binary operators group left-to-right within the same -precedence level. For example, the command -.CS -\fBexpr 4*2 < 7\fR -.CE -returns 0. -.PP -The \fB&&\fR, \fB||\fR, and \fB?:\fR operators have ``lazy -evaluation'', just as in C, -which means that operands are not evaluated if they are -not needed to determine the outcome. For example, in the command -.CS -\fBexpr {$v ? [a] : [b]}\fR -.CE -only one of \fB[a]\fR or \fB[b]\fR will actually be evaluated, -depending on the value of \fB$v\fR. Note, however, that this is -only true if the entire expression is enclosed in braces; otherwise -the Tcl parser will evaluate both \fB[a]\fR and \fB[b]\fR before -invoking the \fBexpr\fR command. -.SH "MATH FUNCTIONS" -.PP -Tcl supports the following mathematical functions in expressions: -.DS -.ta 3c 6c 9c -\fBacos\fR \fBcos\fR \fBhypot\fR \fBsinh\fR -\fBasin\fR \fBcosh\fR \fBlog\fR \fBsqrt\fR -\fBatan\fR \fBexp\fR \fBlog10\fR \fBtan\fR -\fBatan2\fR \fBfloor\fR \fBpow\fR \fBtanh\fR -\fBceil\fR \fBfmod\fR \fBsin\fR -.DE -Each of these functions invokes the math library function of the same -name; see the manual entries for the library functions for details -on what they do. Tcl also implements the following functions for -conversion between integers and floating-point numbers and the -generation of random numbers: -.TP -\fBabs(\fIarg\fB)\fR -Returns the absolute value of \fIarg\fR. \fIArg\fR may be either -integer or floating-point, and the result is returned in the same form. -.TP -\fBdouble(\fIarg\fB)\fR -If \fIarg\fR is a floating value, returns \fIarg\fR, otherwise converts -\fIarg\fR to floating and returns the converted value. -.TP -\fBint(\fIarg\fB)\fR -If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts -\fIarg\fR to integer by truncation and returns the converted value. -.TP -\fBrand()\fR -Returns a floating point number from zero to just less than one or, -in mathematical terms, the range [0,1). The seed comes from the -internal clock of the machine or may be set manual with the srand -function. -.TP -\fBround(\fIarg\fB)\fR -If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts -\fIarg\fR to integer by rounding and returns the converted value. -.TP -\fBsrand(\fIarg\fB)\fR -The \fIarg\fR, which must be an integer, is used to reset the seed for -the random number generator. Returns the first random number from -that seed. Each interpreter has it's own seed. -.PP -In addition to these predefined functions, applications may -define additional functions using \fBTcl_CreateMathFunc\fR(). -.SH "TYPES, OVERFLOW, AND PRECISION" -.PP -All internal computations involving integers are done with the C type -\fIlong\fR, and all internal computations involving floating-point are -done with the C type \fIdouble\fR. -When converting a string to floating-point, exponent overflow is -detected and results in a Tcl error. -For conversion to integer from string, detection of overflow depends -on the behavior of some routines in the local C library, so it should -be regarded as unreliable. -In any case, integer overflow and underflow are generally not detected -reliably for intermediate results. Floating-point overflow and underflow -are detected to the degree supported by the hardware, which is generally -pretty reliable. -.PP -Conversion among internal representations for integer, floating-point, -and string operands is done automatically as needed. -For arithmetic computations, integers are used until some -floating-point number is introduced, after which floating-point is used. -For example, -.CS -\fBexpr 5 / 4\fR -.CE -returns 1, while -.CS -\fBexpr 5 / 4.0\fR -\fBexpr 5 / ( [string length "abcd"] + 0.0 )\fR -.CE -both return 1.25. -Floating-point values are always returned with a ``\fB.\fR'' -or an \fBe\fR so that they will not look like integer values. For -example, -.CS -\fBexpr 20.0/5.0\fR -.CE -returns \fB4.0\fR, not \fB4\fR. - -.SH "STRING OPERATIONS" -.PP -String values may be used as operands of the comparison operators, -although the expression evaluator tries to do comparisons as integer -or floating-point when it can. -If one of the operands of a comparison is a string and the other -has a numeric value, the numeric operand is converted back to -a string using the C \fIsprintf\fR format specifier -\fB%d\fR for integers and \fB%g\fR for floating-point values. -For example, the commands -.CS -\fBexpr {"0x03" > "2"}\fR -\fBexpr {"0y" < "0x12"}\fR -.CE -both return 1. The first comparison is done using integer -comparison, and the second is done using string comparison after -the second operand is converted to the string \fB18\fR. -Because of Tcl's tendency to treat values as numbers whenever -possible, it isn't generally a good idea to use operators like \fB==\fR -when you really want string comparison and the values of the -operands could be arbitrary; it's better in these cases to use the -\fBstring compare\fR command instead. - -.SH "PERFORMANCE CONSIDERATIONS" -.VS -.PP -Enclose expressions in braces for the best speed and the smallest -storage requirements. -This allows the Tcl bytecode compiler to generate the best code. -.PP -As mentioned above, expressions are substituted twice: -once by the Tcl parser and once by the \fBexpr\fR command. -For example, the commands -.CS -\fBset a 3\fR -\fBset b {$a + 2}\fR -\fBexpr $b*4\fR -.CE -return 11, not a multiple of 4. -This is because the Tcl parser will first substitute \fB$a + 2\fR for -the variable \fBb\fR, -then the \fBexpr\fR command will evaluate the expression \fB$a + 2*4\fR. -.PP -Most expressions do not require a second round of substitutions. -Either they are enclosed in braces or, if not, -their variable and command substitutions yield numbers or strings -that don't themselves require substitutions. -However, because a few unbraced expressions -need two rounds of substitutions, -the bytecode compiler must emit -additional instructions to handle this situation. -The most expensive code is required for -unbraced expressions that contain command substitutions. -These expressions must be implemented by generating new code -each time the expression is executed. -.VE - -.SH KEYWORDS -arithmetic, boolean, compare, expression, fuzzy comparison diff --git a/doc/fblocked.n b/doc/fblocked.n deleted file mode 100644 index 3481c7d..0000000 --- a/doc/fblocked.n +++ /dev/null @@ -1,32 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: fblocked.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -.so man.macros -.TH fblocked n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -fblocked \- Test whether the last input operation exhausted all available input -.SH SYNOPSIS -\fBfblocked \fIchannelId\fR -.BE - -.SH DESCRIPTION -.PP -The \fBfblocked\fR command returns 1 if the most recent input operation -on \fIchannelId\fR returned less information than requested because all -available input was exhausted. -For example, if \fBgets\fR is invoked when there are only three -characters available for input and no end-of-line sequence, \fBgets\fR -returns an empty string and a subsequent call to \fBfblocked\fR will -return 1. -.PP -.SH "SEE ALSO" -gets(n), read(n) - -.SH KEYWORDS -blocking, nonblocking diff --git a/doc/fconfigure.n b/doc/fconfigure.n deleted file mode 100644 index e2479e8a..0000000 --- a/doc/fconfigure.n +++ /dev/null @@ -1,200 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: fconfigure.n,v 1.3 1999/04/16 00:46:34 stanton Exp $ -'\" -.so man.macros -.TH fconfigure n 8.1 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -fconfigure \- Set and get options on a channel -.SH SYNOPSIS -.nf -\fBfconfigure \fIchannelId\fR -\fBfconfigure \fIchannelId\fR \fIname\fR -\fBfconfigure \fIchannelId\fR \fIname value \fR?\fIname value ...\fR? -.fi -.BE - -.SH DESCRIPTION -.PP -The \fBfconfigure\fR command sets and retrieves options for channels. -\fIChannelId\fR identifies the channel for which to set or query an option. -If no \fIname\fR or \fIvalue\fR arguments are supplied, the command -returns a list containing alternating option names and values for the channel. -If \fIname\fR is supplied but no \fIvalue\fR then the command returns -the current value of the given option. -If one or more pairs of \fIname\fR and \fIvalue\fR are supplied, the -command sets each of the named options to the corresponding \fIvalue\fR; -in this case the return value is an empty string. -.PP -The options described below are supported for all channels. In addition, -each channel type may add options that only it supports. See the manual -entry for the command that creates each type of channels for the options -that that specific type of channel supports. For example, see the manual -entry for the \fBsocket\fR command for its additional options. -.TP -\fB\-blocking\fR \fIboolean\fR -The \fB\-blocking\fR option determines whether I/O operations on the -channel can cause the process to block indefinitely. -The value of the option must be a proper boolean value. -Channels are normally in blocking mode; if a channel is placed into -nonblocking mode it will affect the operation of the \fBgets\fR, -\fBread\fR, \fBputs\fR, \fBflush\fR, and \fBclose\fR commands; -see the documentation for those commands for details. -For nonblocking mode to work correctly, the application must be -using the Tcl event loop (e.g. by calling \fBTcl_DoOneEvent\fR or -invoking the \fBvwait\fR command). -.TP -\fB\-buffering\fR \fInewValue\fR -. -If \fInewValue\fR is \fBfull\fR then the I/O system will buffer output -until its internal buffer is full or until the \fBflush\fR command is -invoked. If \fInewValue\fR is \fBline\fR, then the I/O system will -automatically flush output for the channel whenever a newline character -is output. If \fInewValue\fR is \fBnone\fR, the I/O system will flush -automatically after every output operation. The default is for -\fB\-buffering\fR to be set to \fBfull\fR except for channels that -connect to terminal-like devices; for these channels the initial setting -is \fBline\fR. -.TP -\fB\-buffersize\fR \fInewSize\fR -. -\fINewvalue\fR must be an integer; its value is used to set the size of -buffers, in bytes, subsequently allocated for this channel to store input -or output. \fINewvalue\fR must be between ten and one million, allowing -buffers of ten to one million bytes in size. -.VS 8.1 br -.TP -\fB\-encoding\fR \fIname\fR -. -This option is used to specify the encoding of the channel, so that the data -can be converted to and from Unicode for use in Tcl. For instance, in -order for Tcl to read characters from a Japanese file in \fBshiftjis\fR -and properly process and display the contents, the encoding would be set -to \fBshiftjis\fR. Thereafter, when reading from the channel, the bytes in -the Japanese file would be converted to Unicode as they are read. -Writing is also supported \- as Tcl strings are written to the channel they -will automatically be converted to the specified encoding on output. -.RS -.PP -If a file contains pure binary data (for instance, a JPEG image), the -encoding for the channel should be configured to be \fBbinary\fR. Tcl -will then assign no interpretation to the data in the file and simply read or -write raw bytes. The Tcl \fBbinary\fR command can be used to manipulate this -byte-oriented data. -.PP -The default encoding for newly opened channels is the same platform- and -locale-dependent system encoding used for interfacing with the operating -system. -.RE -.VE -.TP -\fB\-eofchar\fR \fIchar\fR -.TP -\fB\-eofchar\fR \fB{\fIinChar outChar\fB}\fR -. -This option supports DOS file systems that use Control-z (\ex1a) as an -end of file marker. If \fIchar\fR is not an empty string, then this -character signals end-of-file when it is encountered during input. For -output, the end-of-file character is output when the channel is closed. -If \fIchar\fR is the empty string, then there is no special end of file -character marker. For read-write channels, a two-element list specifies -the end of file marker for input and output, respectively. As a -convenience, when setting the end-of-file character for a read-write -channel you can specify a single value that will apply to both reading -and writing. When querying the end-of-file character of a read-write -channel, a two-element list will always be returned. The default value -for \fB\-eofchar\fR is the empty string in all cases except for files -under Windows. In that case the \fB\-eofchar\fR is Control-z (\ex1a) for -reading and the empty string for writing. -.TP -\fB\-translation\fR \fImode\fR -.TP -\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR -. -In Tcl scripts the end of a line is always represented using a single -newline character (\en). However, in actual files and devices the end of -a line may be represented differently on different platforms, or even for -different devices on the same platform. For example, under UNIX newlines -are used in files, whereas carriage-return-linefeed sequences are -normally used in network connections. On input (i.e., with \fBgets\fP -and \fBread\fP) the Tcl I/O system automatically translates the external -end-of-line representation into newline characters. Upon output (i.e., -with \fBputs\fP), the I/O system translates newlines to the external -end-of-line representation. The default translation mode, \fBauto\fP, -handles all the common cases automatically, but the \fB\-translation\fR -option provides explicit control over the end of line translations. -.RS -.PP -The value associated with \fB\-translation\fR is a single item for -read-only and write-only channels. The value is a two-element list for -read-write channels; the read translation mode is the first element of -the list, and the write translation mode is the second element. As a -convenience, when setting the translation mode for a read-write channel -you can specify a single value that will apply to both reading and -writing. When querying the translation mode of a read-write channel, a -two-element list will always be returned. The following values are -currently supported: -.TP -\fBauto\fR -. -As the input translation mode, \fBauto\fR treats any of newline -(\fBlf\fP), carriage return (\fBcr\fP), or carriage return followed by a -newline (\fBcrlf\fP) as the end of line representation. The end of line -representation can even change from line-to-line, and all cases are -translated to a newline. As the output translation mode, \fBauto\fR -chooses a platform specific representation; for sockets on all platforms -Tcl chooses \fBcrlf\fR, for all Unix flavors, it chooses \fBlf\fR, for the -Macintosh platform it chooses \fBcr\fR and for the various flavors of -Windows it chooses \fBcrlf\fR. The default setting for -\fB\-translation\fR is \fBauto\fR for both input and output. -.VS 8.1 br -.TP -\fBbinary\fR -. -No end-of-line translations are performed. This is nearly identical to -\fBlf\fP mode, except that in addition \fBbinary\fP mode also sets the -end-of-file character to the empty string (which disables it) and sets the -encoding to \fBbinary\fR (which disables encoding filtering). See the -description of \fB\-eofchar\fR and \fB\-encoding\fR for more information. -.VE -.TP -\fBcr\fR -. -The end of a line in the underlying file or device is represented by a -single carriage return character. As the input translation mode, -\fBcr\fP mode converts carriage returns to newline characters. As the -output translation mode, \fBcr\fP mode translates newline characters to -carriage returns. This mode is typically used on Macintosh platforms. -.TP -\fBcrlf\fR -. -The end of a line in the underlying file or device is represented by a -carriage return character followed by a linefeed character. As the input -translation mode, \fBcrlf\fP mode converts carriage-return-linefeed -sequences to newline characters. As the output translation mode, -\fBcrlf\fP mode translates newline characters to carriage-return-linefeed -sequences. This mode is typically used on Windows platforms and for -network connections. -.TP -\fBlf\fR -. -The end of a line in the underlying file or device is represented by a -single newline (linefeed) character. In this mode no translations occur -during either input or output. This mode is typically used on UNIX -platforms. -.RE -.PP - -.SH "SEE ALSO" -close(n), flush(n), gets(n), puts(n), read(n), socket(n) - -.SH KEYWORDS -blocking, buffering, carriage return, end of line, flushing, linemode, -newline, nonblocking, platform, translation, encoding, filter, byte array, -binary diff --git a/doc/fcopy.n b/doc/fcopy.n deleted file mode 100644 index 5261f70..0000000 --- a/doc/fcopy.n +++ /dev/null @@ -1,127 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: fcopy.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH fcopy n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -fcopy \- Copy data from one channel to another. -.SH SYNOPSIS -\fBfcopy \fIinchan\fR \fIoutchan\fR ?\fB\-size \fIsize\fR? ?\fB\-command \fIcallback\fR? -.BE - -.SH DESCRIPTION -.PP -The \fBfcopy\fP command copies data from one I/O channel, \fIinchan\fR to another I/O channel, \fIoutchan\fR. -The \fBfcopy\fP command leverages the buffering in the Tcl I/O system to -avoid extra copies and to avoid buffering too much data in -main memory when copying large files to slow destinations like -network sockets. -.PP -The \fBfcopy\fP -command transfers data from \fIinchan\fR until end of file -or \fIsize\fP bytes have been -transferred. If no \fB\-size\fP argument is given, -then the copy goes until end of file. -All the data read from \fIinchan\fR is copied to \fIoutchan\fR. -Without the \fB\-command\fP option, \fBfcopy\fP blocks until the copy is complete -and returns the number of bytes written to \fIoutchan\fR. -.PP -The \fB\-command\fP argument makes \fBfcopy\fP work in the background. -In this case it returns immediately and the \fIcallback\fP is invoked -later when the copy completes. -The \fIcallback\fP is called with -one or two additional -arguments that indicates how many bytes were written to \fIoutchan\fR. -If an error occurred during the background copy, the second argument is the -error string associated with the error. -With a background copy, -it is not necessary to put \fIinchan\fR or \fIoutchan\fR into -non-blocking mode; the \fBfcopy\fP command takes care of that automatically. -However, it is necessary to enter the event loop by using -the \fBvwait\fP command or by using Tk. -.PP -You are not allowed to do other I/O operations with -\fIinchan\fR or \fIoutchan\fR during a background fcopy. -If either \fIinchan\fR or \fIoutchan\fR get closed -while the copy is in progress, the current copy is stopped -and the command callback is \fInot\fP made. -If \fIinchan\fR is closed, -then all data already queued for \fIoutchan\fR is written out. -.PP -Note that \fIinchan\fR can become readable during a background copy. -You should turn off any \fBfileevent\fP handlers during a background -copy so those handlers do not interfere with the copy. -Any I/O attempted by a \fBfileevent\fP handler will get a "channel busy" error. -.PP -\fBFcopy\fR translates end-of-line sequences in \fIinchan\fR and \fIoutchan\fR -according to the \fB\-translation\fR option -for these channels. -See the manual entry for \fBfconfigure\fR for details on the -\fB\-translation\fR option. -The translations mean that the number of bytes read from \fIinchan\fR -can be different than the number of bytes written to \fIoutchan\fR. -Only the number of bytes written to \fIoutchan\fR is reported, -either as the return value of a synchronous \fBfcopy\fP or -as the argument to the callback for an asynchronous \fBfcopy\fP. - -.SH EXAMPLE -.PP -This first example shows how the callback gets -passed the number of bytes transferred. -It also uses vwait to put the application into the event loop. -Of course, this simplified example could be done without the command -callback. -.DS -proc Cleanup {in out bytes {error {}}} { - global total - set total $bytes - close $in - close $out - if {[string length $error] != 0} { - # error occurred during the copy - } -} -set in [open $file1] -set out [socket $server $port] -fcopy $in $out -command [list Cleanup $in $out] -vwait total - -.DE -.PP -The second example copies in chunks and tests for end of file -in the command callback -.DS -proc CopyMore {in out chunk bytes {error {}}} { - global total done - incr total $bytes - if {([string length $error] != 0) || [eof $in] { - set done $total - close $in - close $out - } else { - fcopy $in $out -command [list CopyMore $in $out $chunk] \\ - -size $chunk - } -} -set in [open $file1] -set out [socket $server $port] -set chunk 1024 -set total 0 -fcopy $in $out -command [list CopyMore $in $out $chunk] -size $chunk -vwait done - -.DE - -.SH "SEE ALSO" -eof(n), fblocked(n), fconfigure(n) - -.SH KEYWORDS -blocking, channel, end of line, end of file, nonblocking, read, translation diff --git a/doc/file.n b/doc/file.n deleted file mode 100644 index 79644e9..0000000 --- a/doc/file.n +++ /dev/null @@ -1,331 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: file.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH file n 7.6 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -file \- Manipulate file names and attributes -.SH SYNOPSIS -\fBfile \fIoption\fR \fIname\fR ?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command provides several operations on a file's name or attributes. -\fIName\fR is the name of a file; if it starts with a tilde, then tilde -substitution is done before executing the command (see the manual entry for -\fBfilename\fR for details). \fIOption\fR indicates what to do with the -file name. Any unique abbreviation for \fIoption\fR is acceptable. The -valid options are: -.TP -\fBfile atime \fIname\fR -. -Returns a decimal string giving the time at which file \fIname\fR -was last accessed. The time is measured in the standard POSIX -fashion as seconds from a fixed starting time (often January 1, 1970). -If the file doesn't exist or its access time cannot be queried then an -error is generated. -.VS -.TP -\fBfile attributes \fIname\fR -.br -\fBfile attributes \fIname\fR ?\fBoption\fR? -.br -\fBfile attributes \fIname\fR ?\fBoption value option value...\fR? -.RS -This subcommand returns or sets platform specific values associated -with a file. The first form returns a list of the platform specific -flags and their values. The second form returns the value for the -specific option. The third form sets one or more of the values. The -values are as follows: -.PP -On Unix, \fB-group\fR gets or sets the group name for the file. A group id can -be given to the command, but it returns a group name. \fB-owner\fR -gets or sets the user name of the owner of the file. The command -returns the owner name, but the numerical id can be passed when -setting the owner. \fB-permissions\fR sets or retrieves the octal code -that chmod(1) uses. This command does not support the symbolic -attributes for chmod(1) at this time. -.PP -On Windows, \fB-archive\fR gives the value or sets or clears the -archive attribute of the file. \fB-hidden\fR gives the value or sets -or clears the hidden attribute of the file. \fB-longname\fR will -expand each path element to its long version. This attribute cannot be -set. \fB-readonly\fR gives the value or sets or clears the readonly -attribute of the file. \fB-shortname\fR gives a string where every -path element is replaced with its short (8.3) version of the -name. This attribute cannot be set. \fB-system\fR gives or sets or -clears the value of the system attribute of the file. -.PP -On Macintosh, \fB-creator\fR gives or sets the Finder creator type of -the file. \fB-hidden\fR gives or sets or clears the hidden attribute -of the file. \fB-readonly\fR gives or sets or clears the readonly -attribute of the file. Note that directories can only be locked if -File Sharing is turned on. \fB-type\fR gives or sets the Finder file -type for the file. -.RE -.VE -.PP -\fBfile copy \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR \fItarget\fR -.br -\fBfile copy \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR ?\fIsource\fR ...? \fItargetDir\fR -.RS -The first form makes a copy of the file or directory \fIsource\fR under -the pathname \fItarget\fR. If \fItarget\fR is an existing directory, -then the second form is used. The second form makes a copy inside -\fItargetDir\fR of each \fIsource\fR file listed. If a directory is -specified as a \fIsource\fR, then the contents of the directory will be -recursively copied into \fItargetDir\fR. Existing files will not be -overwritten unless the \fB\-force\fR option is specified. Trying to -overwrite a non-empty directory, overwrite a directory with a file, or a -file with a directory will all result in errors even if \fI\-force\fR was -specified. Arguments are processed in the order specified, halting at the -first error, if any. A \fB\-\|\-\fR marks the end of switches; the argument -following the \fB\-\|\-\fR will be treated as a \fIsource\fR even if it -starts with a \fB\-\fR. -.RE -.TP -\fBfile delete \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIpathname\fR ?\fIpathname\fR ... ? -. -Removes the file or directory specified by each \fIpathname\fR argument. -Non-empty directories will be removed only if the \fB\-force\fR option is -specified. Trying to delete a non-existant file is not considered an -error. Trying to delete a read-only file will cause the file to be deleted, -even if the \fB\-force\fR flags is not specified. Arguments are processed -in the order specified, halting at the first error, if any. A \fB\-\|\-\fR -marks the end of switches; the argument following the \fB\-\|\-\fR will be -treated as a \fIpathname\fR even if it starts with a \fB\-\fR. -.TP -\fBfile dirname \fIname\fR -Returns a name comprised of all of the path components in \fIname\fR -excluding the last element. If \fIname\fR is a relative file name and -only contains one path element, then returns ``\fB.\fR'' (or ``\fB:\fR'' -on the Macintosh). If \fIname\fR refers to a root directory, then the -root directory is returned. For example, -.RS -.CS -\fBfile dirname c:/\fR -.CE -returns \fBc:/\fR. -.PP -Note that tilde substitution will only be -performed if it is necessary to complete the command. For example, -.CS -\fBfile dirname ~/src/foo.c\fR -.CE -returns \fB~/src\fR, whereas -.CS -\fBfile dirname ~\fR -.CE -returns \fB/home\fR (or something similar). -.RE -.TP -\fBfile executable \fIname\fR -. -Returns \fB1\fR if file \fIname\fR is executable by the current user, -\fB0\fR otherwise. -.TP -\fBfile exists \fIname\fR -. -Returns \fB1\fR if file \fIname\fR exists and the current user has -search privileges for the directories leading to it, \fB0\fR otherwise. -.TP -\fBfile extension \fIname\fR -. -Returns all of the characters in \fIname\fR after and including the last -dot in the last element of \fIname\fR. If there is no dot in the last -element of \fIname\fR then returns the empty string. -.TP -\fBfile isdirectory \fIname\fR -. -Returns \fB1\fR if file \fIname\fR is a directory, \fB0\fR otherwise. -.TP -\fBfile isfile \fIname\fR -. -Returns \fB1\fR if file \fIname\fR is a regular file, \fB0\fR otherwise. -.TP -\fBfile join \fIname\fR ?\fIname ...\fR? -. -Takes one or more file names and combines them, using the correct path -separator for the current platform. If a particular \fIname\fR is -relative, then it will be joined to the previous file name argument. -Otherwise, any earlier arguments will be discarded, and joining will -proceed from the current argument. For example, -.RS -.CS -\fBfile join a b /foo bar\fR -.CE -returns \fB/foo/bar\fR. -.PP -Note that any of the names can contain separators, and that the result -is always canonical for the current platform: \fB/\fR for Unix and -Windows, and \fB:\fR for Macintosh. -.RE -.TP -\fBfile lstat \fIname varName\fR -. -Same as \fBstat\fR option (see below) except uses the \fIlstat\fR -kernel call instead of \fIstat\fR. This means that if \fIname\fR -refers to a symbolic link the information returned in \fIvarName\fR -is for the link rather than the file it refers to. On systems that -don't support symbolic links this option behaves exactly the same -as the \fBstat\fR option. -.TP -\fBfile mkdir \fIdir\fR ?\fIdir\fR ...? -. -Creates each directory specified. For each pathname \fIdir\fR specified, -this command will create all non-existing parent directories as -well as \fIdir\fR itself. If an existing directory is specified, then -no action is taken and no error is returned. Trying to overwrite an existing -file with a directory will result in an error. Arguments are processed in -the order specified, halting at the first error, if any. -.TP -\fBfile mtime \fIname\fR -. -Returns a decimal string giving the time at which file \fIname\fR was -last modified. The time is measured in the standard POSIX fashion as -seconds from a fixed starting time (often January 1, 1970). If the file -doesn't exist or its modified time cannot be queried then an error is -generated. -.VS -.TP -\fBfile nativename \fIname\fR -. -Returns the platform-specific name of the file. This is useful if the -filename is needed to pass to a platform-specific call, such as exec -under Windows or AppleScript on the Macintosh. -.VE -.TP -\fBfile owned \fIname\fR -. -Returns \fB1\fR if file \fIname\fR is owned by the current user, \fB0\fR -otherwise. -.TP -\fBfile pathtype \fIname\fR -. -Returns one of \fBabsolute\fR, \fBrelative\fR, \fBvolumerelative\fR. If -\fIname\fR refers to a specific file on a specific volume, the path type -will be \fBabsolute\fR. If \fIname\fR refers to a file relative to the -current working directory, then the path type will be \fBrelative\fR. If -\fIname\fR refers to a file relative to the current working directory on -a specified volume, or to a specific file on the current working volume, then -the file type is \fBvolumerelative\fR. -.TP -\fBfile readable \fIname\fR -. -Returns \fB1\fR if file \fIname\fR is readable by the current user, -\fB0\fR otherwise. -.TP -\fBfile readlink \fIname\fR -. -Returns the value of the symbolic link given by \fIname\fR (i.e. the name -of the file it points to). If \fIname\fR isn't a symbolic link or its -value cannot be read, then an error is returned. On systems that don't -support symbolic links this option is undefined. -.PP -\fBfile rename \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR \fItarget\fR -.br -\fBfile rename \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR ?\fIsource\fR ...? \fItargetDir\fR -.RS -The first form takes the file or directory specified by pathname -\fIsource\fR and renames it to \fItarget\fR, moving the file if the -pathname \fItarget\fR specifies a name in a different directory. If -\fItarget\fR is an existing directory, then the second form is used. The -second form moves each \fIsource\fR file or directory into the directory -\fItargetDir\fR. Existing files will not be overwritten unless the -\fB\-force\fR option is specified. Trying to overwrite a non-empty -directory, overwrite a directory with a file, or a file with a directory -will all result in errors. Arguments are processed in the order specified, -halting at the first error, if any. A \fB\-\|\-\fR marks the end of -switches; the argument following the \fB\-\|\-\fR will be treated as a -\fIsource\fR even if it starts with a \fB\-\fR. -.RE -.TP -\fBfile rootname \fIname\fR -. -Returns all of the characters in \fIname\fR up to but not including the -last ``.'' character in the last component of name. If the last -component of \fIname\fR doesn't contain a dot, then returns \fIname\fR. -.TP -\fBfile size \fIname\fR -. -Returns a decimal string giving the size of file \fIname\fR in bytes. If -the file doesn't exist or its size cannot be queried then an error is -generated. -.TP -\fBfile split \fIname\fR -. -Returns a list whose elements are the path components in \fIname\fR. The -first element of the list will have the same path type as \fIname\fR. -All other elements will be relative. Path separators will be discarded -unless they are needed ensure that an element is unambiguously relative. -For example, under Unix -.RS -.CS -\fBfile split /foo/~bar/baz\fR -.CE -returns \fB/\0\0foo\0\0./~bar\0\0baz\fR to ensure that later commands -that use the third component do not attempt to perform tilde -substitution. -.RE -.TP -\fBfile stat \fIname varName\fR -. -Invokes the \fBstat\fR kernel call on \fIname\fR, and uses the variable -given by \fIvarName\fR to hold information returned from the kernel call. -\fIVarName\fR is treated as an array variable, and the following elements -of that variable are set: \fBatime\fR, \fBctime\fR, \fBdev\fR, \fBgid\fR, -\fBino\fR, \fBmode\fR, \fBmtime\fR, \fBnlink\fR, \fBsize\fR, \fBtype\fR, -\fBuid\fR. Each element except \fBtype\fR is a decimal string with the -value of the corresponding field from the \fBstat\fR return structure; -see the manual entry for \fBstat\fR for details on the meanings of the -values. The \fBtype\fR element gives the type of the file in the same -form returned by the command \fBfile type\fR. This command returns an -empty string. -.TP -\fBfile tail \fIname\fR -. -Returns all of the characters in \fIname\fR after the last directory -separator. If \fIname\fR contains no separators then returns -\fIname\fR. -.TP -\fBfile type \fIname\fR -. -Returns a string giving the type of file \fIname\fR, which will be one of -\fBfile\fR, \fBdirectory\fR, \fBcharacterSpecial\fR, \fBblockSpecial\fR, -\fBfifo\fR, \fBlink\fR, or \fBsocket\fR. -.TP -\fBfile volume\fR -. -Returns the absolute paths to the volumes mounted on the system, as a proper -Tcl list. On the Macintosh, this will be a list of the mounted drives, -both local and network. N.B. if two drives have the same name, they will -both appear on the volume list, but there is currently no way, from Tcl, to -access any but the first of these drives. On UNIX, the command will always return -"/", since all filesystems are locally mounted. On Windows, it will return -a list of the available local drives (e.g. {a:/ c:/}). -.TP -\fBfile writable \fIname\fR -. -Returns \fB1\fR if file \fIname\fR is writable by the current user, -\fB0\fR otherwise. -.SH "PORTABILITY ISSUES" -.TP -\fBUnix\fR\0\0\0\0\0\0\0 -. -These commands always operate using the real user and group identifiers, -not the effective ones. - -.SH "SEE ALSO" -filename - -.SH KEYWORDS -attributes, copy files, delete files, directory, file, move files, name, rename files, stat diff --git a/doc/fileevent.n b/doc/fileevent.n deleted file mode 100644 index 99051ee..0000000 --- a/doc/fileevent.n +++ /dev/null @@ -1,109 +0,0 @@ -'\" -'\" Copyright (c) 1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: fileevent.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH fileevent n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -fileevent \- Execute a script when a channel becomes readable or writable -.SH SYNOPSIS -\fBfileevent \fIchannelId \fBreadable \fR?\fIscript\fR? -.sp -\fBfileevent \fIchannelId \fBwritable \fR?\fIscript\fR? -.BE - -.SH DESCRIPTION -.PP -This command is used to create \fIfile event handlers\fR. A file event -handler is a binding between a channel and a script, such that the script -is evaluated whenever the channel becomes readable or writable. File event -handlers are most commonly used to allow data to be received from another -process on an event-driven basis, so that the receiver can continue to -interact with the user while waiting for the data to arrive. If an -application invokes \fBgets\fR or \fBread\fR on a blocking channel when -there is no input data available, the process will block; until the input -data arrives, it will not be able to service other events, so it will -appear to the user to ``freeze up''. With \fBfileevent\fR, the process can -tell when data is present and only invoke \fBgets\fR or \fBread\fR when -they won't block. -.PP -The \fIchannelId\fR argument to \fBfileevent\fR refers to an open channel, -such as the return value from a previous \fBopen\fR or \fBsocket\fR -command. -If the \fIscript\fR argument is specified, then \fBfileevent\fR -creates a new event handler: \fIscript\fR will be evaluated -whenever the channel becomes readable or writable (depending on the -second argument to \fBfileevent\fR). -In this case \fBfileevent\fR returns an empty string. -The \fBreadable\fR and \fBwritable\fR event handlers for a file -are independent, and may be created and deleted separately. -However, there may be at most one \fBreadable\fR and one \fBwritable\fR -handler for a file at a given time in a given interpreter. -If \fBfileevent\fR is called when the specified handler already -exists in the invoking interpreter, the new script replaces the old one. -.PP -If the \fIscript\fR argument is not specified, \fBfileevent\fR -returns the current script for \fIchannelId\fR, or an empty string -if there is none. -If the \fIscript\fR argument is specified as an empty string -then the event handler is deleted, so that no script will be invoked. -A file event handler is also deleted automatically whenever -its channel is closed or its interpreter is deleted. -.PP -A channel is considered to be readable if there is unread data -available on the underlying device. -A channel is also considered to be readable if there is unread -data in an input buffer, except in the special case where the -most recent attempt to read from the channel was a \fBgets\fR -call that could not find a complete line in the input buffer. -This feature allows a file to be read a line at a time in nonblocking mode -using events. -A channel is also considered to be readable if an end of file or -error condition is present on the underlying file or device. -It is important for \fIscript\fR to check for these conditions -and handle them appropriately; for example, if there is no special -check for end of file, an infinite loop may occur where \fIscript\fR -reads no data, returns, and is immediately invoked again. -.PP -A channel is considered to be writable if at least one byte of data -can be written to the underlying file or device without blocking, -or if an error condition is present on the underlying file or device. -.PP -Event-driven I/O works best for channels that have been -placed into nonblocking mode with the \fBfconfigure\fR command. -In blocking mode, a \fBputs\fR command may block if you give it -more data than the underlying file or device can accept, and a -\fBgets\fR or \fBread\fR command will block if you attempt to read -more data than is ready; no events will be processed while the -commands block. -In nonblocking mode \fBputs\fR, \fBread\fR, and \fBgets\fR never block. -See the documentation for the individual commands for information -on how they handle blocking and nonblocking channels. -.PP -The script for a file event is executed at global level (outside the -context of any Tcl procedure) in the interpreter in which the -\fBfileevent\fR command was invoked. -If an error occurs while executing the script then the -\fBbgerror\fR mechanism is used to report the error. -In addition, the file event handler is deleted if it ever returns -an error; this is done in order to prevent infinite loops due to -buggy handlers. - -.SH CREDITS -.PP -\fBfileevent\fR is based on the \fBaddinput\fR command created -by Mark Diekhans. - -.SH "SEE ALSO" -bgerror, fconfigure, gets, puts, read - -.SH KEYWORDS -asynchronous I/O, blocking, channel, event handler, nonblocking, readable, -script, writable. diff --git a/doc/filename.n b/doc/filename.n deleted file mode 100644 index dd82a86..0000000 --- a/doc/filename.n +++ /dev/null @@ -1,197 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: filename.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH filename n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -filename \- File name conventions supported by Tcl commands -.BE -.SH INTRODUCTION -.PP -All Tcl commands and C procedures that take file names as arguments -expect the file names to be in one of three forms, depending on the -current platform. On each platform, Tcl supports file names in the -standard forms(s) for that platform. In addition, on all platforms, -Tcl supports a Unix-like syntax intended to provide a convenient way -of constructing simple file names. However, scripts that are intended -to be portable should not assume a particular form for file names. -Instead, portable scripts must use the \fBfile split\fR and \fBfile -join\fR commands to manipulate file names (see the \fBfile\fR manual -entry for more details). - -.SH PATH TYPES -.PP -File names are grouped into three general types based on the starting point -for the path used to specify the file: absolute, relative, and -volume-relative. Absolute names are completely qualified, giving a path to -the file relative to a particular volume and the root directory on that -volume. Relative names are unqualified, giving a path to the file relative -to the current working directory. Volume-relative names are partially -qualified, either giving the path relative to the root directory on the -current volume, or relative to the current directory of the specified -volume. The \fBfile pathtype\fR command can be used to determine the -type of a given path. - -.SH PATH SYNTAX -.PP -The rules for native names depend on the value reported in the Tcl -array element \fBtcl_platform(platform)\fR: -.TP 10 -\fBmac\fR -On Apple Macintosh systems, Tcl supports two forms of path names. The -normal Mac style names use colons as path separators. Paths may be -relative or absolute, and file names may contain any character other -than colon. A leading colon causes the rest of the path to be -interpreted relative to the current directory. If a path contains a -colon that is not at the beginning, then the path is interpreted as an -absolute path. Sequences of two or more colons anywhere in the path -are used to construct relative paths where \fB::\fR refers to the -parent of the current directory, \fB:::\fR refers to the parent of the -parent, and so forth. -.RS -.PP -In addition to Macintosh style names, Tcl also supports a subset of -Unix-like names. If a path contains no colons, then it is interpreted -like a Unix path. Slash is used as the path separator. The file name -\fB\&.\fR refers to the current directory, and \fB\&..\fR refers to the -parent of the current directory. However, some names like \fB/\fR or -\fB/..\fR have no mapping, and are interpreted as Macintosh names. In -general, commands that generate file names will return Macintosh style -names, but commands that accept file names will take both Macintosh -and Unix-style names. -.PP -The following examples illustrate various forms of path names: -.TP 15 -\fB:\fR -Relative path to the current folder. -.TP 15 -\fBMyFile\fR -Relative path to a file named \fBMyFile\fR in the current folder. -.TP 15 -\fBMyDisk:MyFile\fR -Absolute path to a file named \fBMyFile\fR on the device named \fBMyDisk\fR. -.TP 15 -\fB:MyDir:MyFile\fR -Relative path to a file name \fBMyFile\fR in a folder named -\fBMyDir\fR in the current folder. -.TP 15 -\fB::MyFile\fR -Relative path to a file named \fBMyFile\fR in the folder above the -current folder. -.TP 15 -\fB:::MyFile\fR -Relative path to a file named \fBMyFile\fR in the folder two levels above the -current folder. -.TP 15 -\fB/MyDisk/MyFile\fR -Absolute path to a file named \fBMyFile\fR on the device named -\fBMyDisk\fR. -.TP 15 -\fB\&../MyFile\fR -Relative path to a file named \fBMyFile\fR in the folder above the -current folder. -.RE -.TP -\fBunix\fR -On Unix platforms, Tcl uses path names where the components are -separated by slashes. Path names may be relative or absolute, and -file names may contain any character other than slash. The file names -\fB\&.\fR and \fB\&..\fR are special and refer to the current directory -and the parent of the current directory respectively. Multiple -adjacent slash characters are interpreted as a single separator. -The following examples illustrate various forms of path names: -.RS -.TP 15 -\fB/\fR -Absolute path to the root directory. -.TP 15 -\fB/etc/passwd\fR -Absolute path to the file named \fBpasswd\fR in the directory -\fBetc\fR in the root directory. -.TP 15 -\fB\&.\fR -Relative path to the current directory. -.TP 15 -\fBfoo\fR -Relative path to the file \fBfoo\fR in the current directory. -.TP 15 -\fBfoo/bar\fR -Relative path to the file \fBbar\fR in the directory \fBfoo\fR in the -current directory. -.TP 15 -\fB\&../foo\fR -Relative path to the file \fBfoo\fR in the directory above the current -directory. -.RE -.TP -\fBwindows\fR -On Microsoft Windows platforms, Tcl supports both drive-relative and UNC -style names. Both \fB/\fR and \fB\e\fR may be used as directory separators -in either type of name. Drive-relative names consist of an optional drive -specifier followed by an absolute or relative path. UNC paths follow the -general form \fB\e\eservername\esharename\epath\efile\fR. In both forms, -the file names \fB.\fR and \fB..\fR are special and refer to the current -directory and the parent of the current directory respectively. The -following examples illustrate various forms of path names: -.RS -.TP 15 -\fB\&\e\eHost\eshare/file\fR -Absolute UNC path to a file called \fBfile\fR in the root directory of -the export point \fBshare\fR on the host \fBHost\fR. -.TP 15 -\fBc:foo\fR -Volume-relative path to a file \fBfoo\fR in the current directory on drive -\fBc\fR. -.TP 15 -\fBc:/foo\fR -Absolute path to a file \fBfoo\fR in the root directory of drive -\fBc\fR. -.TP 15 -\fBfoo\ebar\fR -Relative path to a file \fBbar\fR in the \fBfoo\fR directory in the current -directory on the current volume. -.TP 15 -\fB\&\efoo\fR -Volume-relative path to a file \fBfoo\fR in the root directory of the current -volume. -.RE - -.SH TILDE SUBSTITUTION -.PP -In addition to the file name rules described above, Tcl also supports -\fIcsh\fR-style tilde substitution. If a file name starts with a -tilde, then the file name will be interpreted as if the first element -is replaced with the location of the home directory for the given -user. If the tilde is followed immediately by a separator, then the -\fB$HOME\fR environment variable is substituted. Otherwise the -characters between the tilde and the next separator are taken as a -user name, which is used to retrieve the user's home directory for -substitution. -.PP -The Macintosh and Windows platforms do not support tilde substitution -when a user name follows the tilde. On these platforms, attempts to -use a tilde followed by a user name will generate an error. File -names that have a tilde without a user name will be substituted using -the \fB$HOME\fR environment variable, just like for Unix. - -.SH PORTABILITY ISSUES -.PP -Not all file systems are case sensitive, so scripts should avoid code -that depends on the case of characters in a file name. In addition, -the character sets allowed on different devices may differ, so scripts -should choose file names that do not contain special characters like: -\fB<>:"/\e|\fR. The safest approach is to use names consisting of -alphanumeric characters only. Also Windows 3.1 only supports file -names with a root of no more than 8 characters and an extension of no -more than 3 characters. - -.SH KEYWORDS -current directory, absolute file name, relative file name, -volume-relative file name, portability diff --git a/doc/flush.n b/doc/flush.n deleted file mode 100644 index d88ccec..0000000 --- a/doc/flush.n +++ /dev/null @@ -1,35 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: flush.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH flush n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -flush \- Flush buffered output for a channel -.SH SYNOPSIS -\fBflush \fIchannelId\fR -.BE - -.SH DESCRIPTION -.PP -Flushes any output that has been buffered for \fIchannelId\fR. -\fIChannelId\fR must be a channel identifier such as returned by a previous -\fBopen\fR or \fBsocket\fR command, and it must have been opened for writing. -If the channel is in blocking mode the command does not return until all the -buffered output has been flushed to the channel. If the channel is in -nonblocking mode, the command may return before all buffered output has been -flushed; the remainder will be flushed in the background as fast as the -underlying file or device is able to absorb it. - -.SH "SEE ALSO" -open(n), socket(n) - -.SH KEYWORDS -blocking, buffer, channel, flush, nonblocking, output diff --git a/doc/for.n b/doc/for.n deleted file mode 100644 index 73abb9f..0000000 --- a/doc/for.n +++ /dev/null @@ -1,60 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: for.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH for n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -for \- ``For'' loop -.SH SYNOPSIS -\fBfor \fIstart test next body\fR -.BE - -.SH DESCRIPTION -.PP -\fBFor\fR is a looping command, similar in structure to the C -\fBfor\fR statement. The \fIstart\fR, \fInext\fR, and -\fIbody\fR arguments must be Tcl command strings, and \fItest\fR -is an expression string. -The \fBfor\fR command first invokes the Tcl interpreter to -execute \fIstart\fR. Then it repeatedly evaluates \fItest\fR as -an expression; if the result is non-zero it invokes the Tcl -interpreter on \fIbody\fR, then invokes the Tcl interpreter on \fInext\fR, -then repeats the loop. The command terminates when \fItest\fR evaluates -to 0. If a \fBcontinue\fR command is invoked within \fIbody\fR then -any remaining commands in the current execution of \fIbody\fR are skipped; -processing continues by invoking the Tcl interpreter on \fInext\fR, then -evaluating \fItest\fR, and so on. If a \fBbreak\fR command is invoked -within \fIbody\fR -or \fInext\fR, -then the \fBfor\fR command will -return immediately. -The operation of \fBbreak\fR and \fBcontinue\fR are similar to the -corresponding statements in C. -\fBFor\fR returns an empty string. -.PP -Note: \fItest\fR should almost always be enclosed in braces. If not, -variable substitutions will be made before the \fBfor\fR -command starts executing, which means that variable changes -made by the loop body will not be considered in the expression. -This is likely to result in an infinite loop. If \fItest\fR is -enclosed in braces, variable substitutions are delayed until the -expression is evaluated (before -each loop iteration), so changes in the variables will be visible. -For an example, try the following script with and without the braces -around \fB$x<10\fR: -.CS -for {set x 0} {$x<10} {incr x} { - puts "x is $x" -} -.CE - -.SH KEYWORDS -for, iteration, looping diff --git a/doc/foreach.n b/doc/foreach.n deleted file mode 100644 index 213a6fc..0000000 --- a/doc/foreach.n +++ /dev/null @@ -1,86 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: foreach.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH foreach n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -foreach \- Iterate over all elements in one or more lists -.SH SYNOPSIS -\fBforeach \fIvarname list body\fR -.br -\fBforeach \fIvarlist1 list1\fR ?\fIvarlist2 list2 ...\fR? \fIbody\fR -.BE - -.SH DESCRIPTION -.PP -The \fBforeach\fR command implements a loop where the loop -variable(s) take on values from one or more lists. -In the simplest case there is one loop variable, \fIvarname\fR, -and one list, \fIlist\fR, that is a list of values to assign to \fIvarname\fR. -The \fIbody\fR argument is a Tcl script. -For each element of \fIlist\fR (in order -from first to last), \fBforeach\fR assigns the contents of the -element to \fIvarname\fR as if the \fBlindex\fR command had been used -to extract the element, then calls the Tcl interpreter to execute -\fIbody\fR. -.PP -In the general case there can be more than one value list -(e.g., \fIlist1\fR and \fIlist2\fR), -and each value list can be associated with a list of loop variables -(e.g., \fIvarlist1\fR and \fIvarlist2\fR). -During each iteration of the loop -the variables of each \fIvarlist\fP are assigned -consecutive values from the corresponding \fIlist\fP. -Values in each \fIlist\fP are used in order from first to last, -and each value is used exactly once. -The total number of loop iterations is large enough to use -up all the values from all the value lists. -If a value list does not contain enough -elements for each of its loop variables in each iteration, -empty values are used for the missing elements. -.PP -The \fBbreak\fR and \fBcontinue\fR statements may be -invoked inside \fIbody\fR, with the same effect as in the \fBfor\fR -command. \fBForeach\fR returns an empty string. -.SH EXAMPLES -.PP -The following loop uses i and j as loop variables to iterate over -pairs of elements of a single list. -.DS -set x {} -foreach {i j} {a b c d e f} { - lappend x $j $i -} -# The value of x is "b a d c f e" -# There are 3 iterations of the loop. -.DE -.PP -The next loop uses i and j to iterate over two lists in parallel. -.DS -set x {} -foreach i {a b c} j {d e f g} { - lappend x $i $j -} -# The value of x is "a d b e c f {} g" -# There are 4 iterations of the loop. -.DE -.PP -The two forms are combined in the following example. -.DS -set x {} -foreach i {a b c} {j k} {d e f g} { - lappend x $i $j $k -} -# The value of x is "a d e b f g c {} {}" -# There are 3 iterations of the loop. -.DE -.SH KEYWORDS -foreach, iteration, list, looping diff --git a/doc/format.n b/doc/format.n deleted file mode 100644 index 9f737e0..0000000 --- a/doc/format.n +++ /dev/null @@ -1,214 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: format.n,v 1.3 1999/04/16 00:46:34 stanton Exp $ -'\" -.so man.macros -.TH format n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -format \- Format a string in the style of sprintf -.SH SYNOPSIS -\fBformat \fIformatString \fR?\fIarg arg ...\fR? -.BE - -.SH INTRODUCTION -.PP -This command generates a formatted string in the same way as the -ANSI C \fBsprintf\fR procedure (it uses \fBsprintf\fR in its -implementation). -\fIFormatString\fR indicates how to format the result, using -\fB%\fR conversion specifiers as in \fBsprintf\fR, and the additional -arguments, if any, provide values to be substituted into the result. -The return value from \fBformat\fR is the formatted string. - -.SH "DETAILS ON FORMATTING" -.PP -The command operates by scanning \fIformatString\fR from left to right. -Each character from the format string is appended to the result -string unless it is a percent sign. -If the character is a \fB%\fR then it is not copied to the result string. -Instead, the characters following the \fB%\fR character are treated as -a conversion specifier. -The conversion specifier controls the conversion of the next successive -\fIarg\fR to a particular format and the result is appended to -the result string in place of the conversion specifier. -If there are multiple conversion specifiers in the format string, -then each one controls the conversion of one additional \fIarg\fR. -The \fBformat\fR command must be given enough \fIarg\fRs to meet the needs -of all of the conversion specifiers in \fIformatString\fR. -.PP -Each conversion specifier may contain up to six different parts: -an XPG3 position specifier, -a set of flags, a minimum field width, a precision, a length modifier, -and a conversion character. -Any of these fields may be omitted except for the conversion character. -The fields that are present must appear in the order given above. -The paragraphs below discuss each of these fields in turn. -.PP -If the \fB%\fR is followed by a decimal number and a \fB$\fR, as in -``\fB%2$d\fR'', then the value to convert is not taken from the -next sequential argument. -Instead, it is taken from the argument indicated by the number, -where 1 corresponds to the first \fIarg\fR. -If the conversion specifier requires multiple arguments because -of \fB*\fR characters in the specifier then -successive arguments are used, starting with the argument -given by the number. -This follows the XPG3 conventions for positional specifiers. -If there are any positional specifiers in \fIformatString\fR -then all of the specifiers must be positional. -.PP -The second portion of a conversion specifier may contain any of the -following flag characters, in any order: -.TP 10 -\fB\-\fR -Specifies that the converted argument should be left-justified -in its field (numbers are normally right-justified with leading -spaces if needed). -.TP 10 -\fB+\fR -Specifies that a number should always be printed with a sign, -even if positive. -.TP 10 -\fIspace\fR -Specifies that a space should be added to the beginning of the -number if the first character isn't a sign. -.TP 10 -\fB0\fR -Specifies that the number should be padded on the left with -zeroes instead of spaces. -.TP 10 -\fB#\fR -Requests an alternate output form. For \fBo\fR and \fBO\fR -conversions it guarantees that the first digit is always \fB0\fR. -For \fBx\fR or \fBX\fR conversions, \fB0x\fR or \fB0X\fR (respectively) -will be added to the beginning of the result unless it is zero. -For all floating-point conversions (\fBe\fR, \fBE\fR, \fBf\fR, -\fBg\fR, and \fBG\fR) it guarantees that the result always -has a decimal point. -For \fBg\fR and \fBG\fR conversions it specifies that -trailing zeroes should not be removed. -.PP -The third portion of a conversion specifier is a number giving a -minimum field width for this conversion. -It is typically used to make columns line up in tabular printouts. -If the converted argument contains fewer characters than the -minimum field width then it will be padded so that it is as wide -as the minimum field width. -Padding normally occurs by adding extra spaces on the left of the -converted argument, but the \fB0\fR and \fB\-\fR flags -may be used to specify padding with zeroes on the left or with -spaces on the right, respectively. -If the minimum field width is specified as \fB*\fR rather than -a number, then the next argument to the \fBformat\fR command -determines the minimum field width; it must be a numeric string. -.PP -The fourth portion of a conversion specifier is a precision, -which consists of a period followed by a number. -The number is used in different ways for different conversions. -For \fBe\fR, \fBE\fR, and \fBf\fR conversions it specifies the number -of digits to appear to the right of the decimal point. -For \fBg\fR and \fBG\fR conversions it specifies the total number -of digits to appear, including those on both sides of the decimal -point (however, trailing zeroes after the decimal point will still -be omitted unless the \fB#\fR flag has been specified). -For integer conversions, it specifies a minimum number of digits -to print (leading zeroes will be added if necessary). -For \fBs\fR conversions it specifies the maximum number of characters to be -printed; if the string is longer than this then the trailing characters will be dropped. -If the precision is specified with \fB*\fR rather than a number -then the next argument to the \fBformat\fR command determines the precision; -it must be a numeric string. -.PP -The fifth part of a conversion specifier is a length modifier, -which must be \fBh\fR or \fBl\fR. -If it is \fBh\fR it specifies that the numeric value should be -truncated to a 16-bit value before converting. -This option is rarely useful. -The \fBl\fR modifier is ignored. -.PP -The last thing in a conversion specifier is an alphabetic character -that determines what kind of conversion to perform. -The following conversion characters are currently supported: -.TP 10 -\fBd\fR -Convert integer to signed decimal string. -.TP 10 -\fBu\fR -Convert integer to unsigned decimal string. -.TP 10 -\fBi\fR -Convert integer to signed decimal string; the integer may either be -in decimal, in octal (with a leading \fB0\fR) or in hexadecimal -(with a leading \fB0x\fR). -.TP 10 -\fBo\fR -Convert integer to unsigned octal string. -.TP 10 -\fBx\fR or \fBX\fR -Convert integer to unsigned hexadecimal string, using digits -``0123456789abcdef'' for \fBx\fR and ``0123456789ABCDEF'' for \fBX\fR). -.VS -.TP 10 -\fBc\fR -Convert integer to the Unicode character it represents. -.VE -.TP 10 -\fBs\fR -No conversion; just insert string. -.TP 10 -\fBf\fR -Convert floating-point number to signed decimal string of -the form \fIxx.yyy\fR, where the number of \fIy\fR's is determined by -the precision (default: 6). -If the precision is 0 then no decimal point is output. -.TP 10 -\fBe\fR or \fBe\fR -Convert floating-point number to scientific notation in the -form \fIx.yyy\fBe\(+-\fIzz\fR, where the number of \fIy\fR's is determined -by the precision (default: 6). -If the precision is 0 then no decimal point is output. -If the \fBE\fR form is used then \fBE\fR is -printed instead of \fBe\fR. -.TP 10 -\fBg\fR or \fBG\fR -If the exponent is less than \-4 or greater than or equal to the -precision, then convert floating-point number as for \fB%e\fR or -\fB%E\fR. -Otherwise convert as for \fB%f\fR. -Trailing zeroes and a trailing decimal point are omitted. -.TP 10 -\fB%\fR -No conversion: just insert \fB%\fR. -.LP -For the numerical conversions the argument being converted must -be an integer or floating-point string; format converts the argument -to binary and then converts it back to a string according to -the conversion specifier. - -.SH "DIFFERENCES FROM ANSI SPRINTF" -.PP -The behavior of the format command is the same as the -ANSI C \fBsprintf\fR procedure except for the following -differences: -.IP [1] -\fB%p\fR and \fB%n\fR specifiers are not currently supported. -.IP [2] -For \fB%c\fR conversions the argument must be a decimal string, -which will then be converted to the corresponding character value. -.IP [3] -The \fBl\fR modifier is ignored; integer values are always converted -as if there were no modifier present and real values are always -converted as if the \fBl\fR modifier were present (i.e. type -\fBdouble\fR is used for the internal representation). -If the \fBh\fR modifier is specified then integer values are truncated -to \fBshort\fR before conversion. - -.SH KEYWORDS -conversion specifier, format, sprintf, string, substitution diff --git a/doc/gets.n b/doc/gets.n deleted file mode 100644 index 9a1c477..0000000 --- a/doc/gets.n +++ /dev/null @@ -1,50 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: gets.n,v 1.2 1998/09/14 18:39:52 stanton Exp $ -'\" -.so man.macros -.TH gets n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -gets \- Read a line from a channel -.SH SYNOPSIS -\fBgets \fIchannelId\fR ?\fIvarName\fR? -.BE - -.SH DESCRIPTION -.PP -This command reads the next line from \fIchannelId\fR, returns everything -in the line up to (but not including) the end-of-line character(s), and -discards the end-of-line character(s). -If \fIvarName\fR is omitted the line is returned as the result of the -command. -If \fIvarName\fR is specified then the line is placed in the variable by -that name and the return value is a count of the number of characters -returned. -.PP -If end of file occurs while scanning for an end of -line, the command returns whatever input is available up to the end of file. -If \fIchannelId\fR is in nonblocking mode and there is not a full -line of input available, the command returns an empty string and -does not consume any input. -If \fIvarName\fR is specified and an empty string is returned in -\fIvarName\fR because of end-of-file or because of insufficient -data in nonblocking mode, then the return count is -1. -Note that if \fIvarName\fR is not specified then the end-of-file -and no-full-line-available cases can -produce the same results as if there were an input line consisting -only of the end-of-line character(s). -The \fBeof\fR and \fBfblocked\fR commands can be used to distinguish -these three cases. - -.SH "SEE ALSO" -eof(n), fblocked(n) - -.SH KEYWORDS -blocking, channel, end of file, end of line, line, nonblocking, read diff --git a/doc/glob.n b/doc/glob.n deleted file mode 100644 index 47c4e50..0000000 --- a/doc/glob.n +++ /dev/null @@ -1,93 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: glob.n,v 1.3 1999/04/16 00:46:35 stanton Exp $ -'\" -.so man.macros -.TH glob n 8.1 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -glob \- Return names of files that match patterns -.SH SYNOPSIS -\fBglob \fR?\fIswitches\fR? \fIpattern \fR?\fIpattern ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command performs file name ``globbing'' in a fashion similar to -the csh shell. It returns a list of the files whose names match any -of the \fIpattern\fR arguments. -.LP -If the initial arguments to \fBglob\fR start with \fB\-\fR then -they are treated as switches. The following switches are -currently supported: -.TP 15 -\fB\-nocomplain\fR -Allows an empty list to be returned without error; without this -switch an error is returned if the result list would be empty. -.TP 15 -\fB\-\|\-\fR -Marks the end of switches. The argument following this one will -be treated as a \fIpattern\fR even if it starts with a \fB\-\fR. -.PP -The \fIpattern\fR arguments may contain any of the following -special characters: -.TP 10 -\fB?\fR -Matches any single character. -.TP 10 -\fB*\fR -Matches any sequence of zero or more characters. -.TP 10 -\fB[\fIchars\fB]\fR -Matches any single character in \fIchars\fR. If \fIchars\fR -contains a sequence of the form \fIa\fB\-\fIb\fR then any -character between \fIa\fR and \fIb\fR (inclusive) will match. -.TP 10 -\fB\e\fIx\fR -Matches the character \fIx\fR. -.TP 10 -\fB{\fIa\fB,\fIb\fB,\fI...\fR} -Matches any of the strings \fIa\fR, \fIb\fR, etc. -.LP -As with csh, a ``.'' at the beginning of a file's name or just -after a ``/'' must be matched explicitly or with a {} construct. -In addition, all ``/'' characters must be matched explicitly. -.LP -If the first character in a \fIpattern\fR is ``~'' then it refers -to the home directory for the user whose name follows the ``~''. -If the ``~'' is followed immediately by ``/'' then the value of -the HOME environment variable is used. -.LP -The \fBglob\fR command differs from csh globbing in two ways. -First, it does not sort its result list (use the \fBlsort\fR -command if you want the list sorted). -Second, \fBglob\fR only returns the names of files that actually -exist; in csh no check for existence is made unless a pattern -contains a ?, *, or [] construct. - -.SH PORTABILITY ISSUES -.PP -Unlike other Tcl commands that will accept both network and native -style names (see the \fBfilename\fR manual entry for details on how -native and network names are specified), the \fBglob\fR command only -accepts native names. -.VS 8.1 -.TP -\fBWindows\fR -. -For Windows UNC names, the servername and sharename components of the path -may not contain ?, *, or [] constructs. On Windows NT, if \fIpattern\fR is -of the form ``\fB~\fIusername\fB@\fIdomain\fR'' it refers to the home -directory of the user whose account information resides on the specified NT -domain server. Otherwise, user account information is obtained from -the local computer. -.VE - -.SH KEYWORDS -exist, file, glob, pattern diff --git a/doc/global.n b/doc/global.n deleted file mode 100644 index 252cbfb..0000000 --- a/doc/global.n +++ /dev/null @@ -1,35 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: global.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH global n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -global \- Access global variables -.SH SYNOPSIS -\fBglobal \fIvarname \fR?\fIvarname ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command is ignored unless a Tcl procedure is being interpreted. -If so then it declares the given \fIvarname\fR's to be global variables -rather than local ones. -Global variables are variables in the global namespace. -For the duration of the current procedure -(and only while executing in the current procedure), -any reference to any of the \fIvarname\fRs -will refer to the global variable by the same name. - -.SH "SEE ALSO" -namespace(n), variable(n) - -.SH KEYWORDS -global, namespace, procedure, variable diff --git a/doc/history.n b/doc/history.n deleted file mode 100644 index 4e0716a..0000000 --- a/doc/history.n +++ /dev/null @@ -1,104 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: history.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH history n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -history \- Manipulate the history list -.SH SYNOPSIS -\fBhistory \fR?\fIoption\fR? ?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -The \fBhistory\fR command performs one of several operations related to -recently-executed commands recorded in a history list. Each of -these recorded commands is referred to as an ``event''. When -specifying an event to the \fBhistory\fR command, the following -forms may be used: -.IP [1] -A number: if positive, it refers to the event with -that number (all events are numbered starting at 1). If the number -is negative, it selects an event relative to the current event -(\fB\-1\fR refers to the previous event, \fB\-2\fR to the one before that, and -so on). Event \fB0\fP refers to the current event. -.IP [2] -A string: selects the most recent event that matches the string. -An event is considered to match the string either if the string is -the same as the first characters of the event, or if the string -matches the event in the sense of the \fBstring match\fR command. -.PP -The \fBhistory\fR command can take any of the following forms: -.TP -\fBhistory\fR -Same -as \fBhistory info\fR, described below. -.TP -\fBhistory add\fI command \fR?\fBexec\fR? -Adds the \fIcommand\fR argument to the history list as a new event. If -\fBexec\fR is specified (or abbreviated) then the command is also -executed and its result is returned. If \fBexec\fR isn't specified -then an empty string is returned as result. -.TP -\fBhistory change\fI newValue\fR ?\fIevent\fR? -Replaces the value recorded for an event with \fInewValue\fR. \fIEvent\fR -specifies the event to replace, and -defaults to the \fIcurrent\fR event (not event \fB\-1\fR). This command -is intended for use in commands that implement new forms of history -substitution and wish to replace the current event (which invokes the -substitution) with the command created through substitution. The return -value is an empty string. -.TP -\fBhistory clear\fR -Erase the history list. The current keep limit is retained. -The history event numbers are reset. -.TP -\fBhistory event\fR ?\fIevent\fR? -Returns the value of the event given by \fIevent\fR. \fIEvent\fR -defaults to \fB\-1\fR. -.TP -\fBhistory info \fR?\fIcount\fR? -Returns a formatted string (intended for humans to read) giving -the event number and contents for each of the events in the history -list except the current event. If \fIcount\fR is specified -then only the most recent \fIcount\fR events are returned. -.TP -\fBhistory keep \fR?\fIcount\fR? -This command may be used to change the size of the history list to -\fIcount\fR events. Initially, 20 events are retained in the history -list. If \fIcount\fR is not specified, the current keep limit is returned. -.TP -\fBhistory nextid\fR -Returns the number of the next event to be recorded -in the history list. It is useful for things like printing the -event number in command-line prompts. -.TP -\fBhistory redo \fR?\fIevent\fR? -Re-executes the command indicated by \fIevent\fR and return its result. -\fIEvent\fR defaults to \fB\-1\fR. This command results in history -revision: see below for details. -.SH "HISTORY REVISION" -.PP -Pre-8.0 Tcl had a complex history revision mechanism. -The current mechanism is more limited, and the old -history operations \fBsubstitute\fP and \fBwords\fP have been removed. -(As a consolation, the \fBclear\fP operation was added.) -.PP -The history option \fBredo\fR results in much simpler ``history revision''. -When this option is invoked then the most recent event -is modified to eliminate the history command and replace it with -the result of the history command. -If you want to redo an event without modifying history, then use -the \fBevent\fP operation to retrieve some event, -and the \fBadd\fP operation to add it to history and execute it. - -.SH KEYWORDS -event, history, record diff --git a/doc/http.n b/doc/http.n deleted file mode 100644 index 7fd61ce..0000000 --- a/doc/http.n +++ /dev/null @@ -1,362 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: http.n,v 1.3 1999/04/16 00:46:35 stanton Exp $ -'\" -.so man.macros -.TH "Http" n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -Http \- Client-side implementation of the HTTP/1.0 protocol. -.SH SYNOPSIS -\fBpackage require http ?2.0?\fP -.sp -\fB::http::config \fI?options?\fR -.sp -\fB::http::geturl \fIurl ?options?\fR -.sp -\fB::http::formatQuery \fIlist\fR -.sp -\fB::http::reset \fItoken\fR -.sp -\fB::http::wait \fItoken\fR -.sp -\fB::http::status \fItoken\fR -.sp -\fB::http::size \fItoken\fR -.sp -\fB::http::code \fItoken\fR -.sp -\fB::http::data \fItoken\fR -.BE - -.SH DESCRIPTION -.PP -The \fBhttp\fR package provides the client side of the HTTP/1.0 -protocol. The package implements the GET, POST, and HEAD operations -of HTTP/1.0. It allows configuration of a proxy host to get through -firewalls. The package is compatible with the \fBSafesock\fR security -policy, so it can be used by untrusted applets to do URL fetching from -a restricted set of hosts. -.PP -The \fB::http::geturl\fR procedure does a HTTP transaction. -Its \fIoptions \fR determine whether a GET, POST, or HEAD transaction -is performed. -The return value of \fB::http::geturl\fR is a token for the transaction. -The value is also the name of an array in the ::http namespace - that contains state -information about the transaction. The elements of this array are -described in the STATE ARRAY section. -.PP -If the \fB-command\fP option is specified, then -the HTTP operation is done in the background. -\fB::http::geturl\fR returns immediately after generating the -HTTP request and the callback is invoked -when the transaction completes. For this to work, the Tcl event loop -must be active. In Tk applications this is always true. For pure-Tcl -applications, the caller can use \fB::http::wait\fR after calling -\fB::http::geturl\fR to start the event loop. -.SH COMMANDS -.TP -\fB::http::config\fP ?\fIoptions\fR? -The \fB::http::config\fR command is used to set and query the name of the -proxy server and port, and the User-Agent name used in the HTTP -requests. If no options are specified, then the current configuration -is returned. If a single argument is specified, then it should be one -of the flags described below. In this case the current value of -that setting is returned. Otherwise, the options should be a set of -flags and values that define the configuration: -.RS -.TP -\fB\-accept\fP \fImimetypes\fP -The Accept header of the request. The default is */*, which means that -all types of documents are accepted. Otherwise you can supply a -comma separated list of mime type patterns that you are -willing to receive. For example, "image/gif, image/jpeg, text/*". -.TP -\fB\-proxyhost\fP \fIhostname\fP -The name of the proxy host, if any. If this value is the -empty string, the URL host is contacted directly. -.TP -\fB\-proxyport\fP \fInumber\fP -The proxy port number. -.TP -\fB\-proxyfilter\fP \fIcommand\fP -The command is a callback that is made during -\fB::http::geturl\fR -to determine if a proxy is required for a given host. One argument, a -host name, is added to \fIcommand\fR when it is invoked. If a proxy -is required, the callback should return a two element list containing -the proxy server and proxy port. Otherwise the filter should return -an empty list. The default filter returns the values of the -\fB\-proxyhost\fR and \fB\-proxyport\fR settings if they are -non-empty. -.TP -\fB\-useragent\fP \fIstring\fP -The value of the User-Agent header in the HTTP request. The default -is \fB"Tcl http client package 2.0."\fR -.RE -.TP -\fB::http::geturl\fP \fIurl\fP ?\fIoptions\fP? -The \fB::http::geturl \fR command is the main procedure in the package. -The \fB\-query\fR option causes a POST operation and -the \fB\-validate\fR option causes a HEAD operation; -otherwise, a GET operation is performed. The \fB::http::geturl\fR command -returns a \fItoken\fR value that can be used to get -information about the transaction. See the STATE ARRAY section for -details. The \fB::http::geturl\fR command blocks until the operation -completes, unless the \fB\-command\fR option specifies a callback -that is invoked when the HTTP transaction completes. -\fB::http::geturl\fR takes several options: -.RS -.TP -\fB\-blocksize\fP \fIsize\fP -The blocksize used when reading the URL. -At most -\fIsize\fR -bytes are read at once. After each block, a call to the -\fB\-progress\fR -callback is made. -.TP -\fB\-channel\fP \fIname\fP -Copy the URL contents to channel \fIname\fR instead of saving it in -\fBstate(body)\fR. -.TP -\fB\-command\fP \fIcallback\fP -Invoke \fIcallback\fP after the HTTP transaction completes. -This option causes \fB::http::geturl\fP to return immediately. -The \fIcallback\fP gets an additional argument that is the \fItoken\fR returned -from \fB::http::geturl\fR. This token is the name of an array that is -described in the STATE ARRAY section. Here is a template for the -callback: -.RS -.CS -proc httpCallback {token} { - upvar #0 $token state - # Access state as a Tcl array -} -.CE -.RE -.TP -\fB\-handler\fP \fIcallback\fP -Invoke \fIcallback\fP whenever HTTP data is available; if present, nothing -else will be done with the HTTP data. This procedure gets two additional -arguments: the socket for the HTTP data and the \fItoken\fR returned from -\fB::http::geturl\fR. The token is the name of a global array that is described -in the STATE ARRAY section. The procedure is expected to return the number -of bytes read from the socket. Here is a template for the callback: -.RS -.CS -proc httpHandlerCallback {socket token} { - upvar #0 $token state - # Access socket, and state as a Tcl array - ... - (example: set data [read $socket 1000];set nbytes [string length $data]) - ... - return nbytes -} -.CE -.RE -.TP -\fB\-headers\fP \fIkeyvaluelist\fP -This option is used to add extra headers to the HTTP request. The -\fIkeyvaluelist\fR argument must be a list with an even number of -elements that alternate between keys and values. The keys become -header field names. Newlines are stripped from the values so the -header cannot be corrupted. For example, if \fIkeyvaluelist\fR is -\fBPragma no-cache\fR then the following header is included in the -HTTP request: -.CS -Pragma: no-cache -.CE -.TP -\fB\-progress\fP \fIcallback\fP -The \fIcallback\fR is made after each transfer of data from the URL. -The callback gets three additional arguments: the \fItoken\fR from -\fB::http::geturl\fR, the expected total size of the contents from the -\fBContent-Length\fR meta-data, and the current number of bytes -transferred so far. The expected total size may be unknown, in which -case zero is passed to the callback. Here is a template for the -progress callback: -.RS -.CS -proc httpProgress {token total current} { - upvar #0 $token state -} -.CE -.RE -.TP -\fB\-query\fP \fIquery\fP -This flag causes \fB::http::geturl\fR to do a POST request that passes the -\fIquery\fR to the server. The \fIquery\fR must be a x-url-encoding -formatted query. The \fB::http::formatQuery\fR procedure can be used to -do the formatting. -.TP -\fB\-timeout\fP \fImilliseconds\fP -If \fImilliseconds\fR is non-zero, then \fB::http::geturl\fR sets up a timeout -to occur after the specified number of milliseconds. -A timeout results in a call to \fB::http::reset\fP and to -the \fB-command\fP callback, if specified. -The return value of \fB::http::status\fP is \fBtimeout\fP -after a timeout has occurred. -.TP -\fB\-validate\fP \fIboolean\fP -If \fIboolean\fR is non-zero, then \fB::http::geturl\fR does an HTTP HEAD -request. This request returns meta information about the URL, but the -contents are not returned. The meta information is available in the -\fBstate(meta) \fR variable after the transaction. See the STATE -ARRAY section for details. -.RE -.TP -\fB::http::formatQuery\fP \fIkey value\fP ?\fIkey value\fP ...? -This procedure does x-url-encoding of query data. It takes an even -number of arguments that are the keys and values of the query. It -encodes the keys and values, and generates one string that has the -proper & and = separators. The result is suitable for the -\fB\-query\fR value passed to \fB::http::geturl\fR. -.TP -\fB::http::reset\fP \fItoken\fP ?\fIwhy\fP? -This command resets the HTTP transaction identified by \fItoken\fR, if -any. This sets the \fBstate(status)\fP value to \fIwhy\fP, which defaults to \fBreset\fR, and then calls the registered \fB\-command\fR callback. -.TP -\fB::http::wait\fP \fItoken\fP -This is a convenience procedure that blocks and waits for the -transaction to complete. This only works in trusted code because it -uses \fBvwait\fR. -.TP -\fB::http::data\fP \fItoken\fP -This is a convenience procedure that returns the \fBbody\fP element -(i.e., the URL data) of the state array. -.TP -\fB::http::status\fP \fItoken\fP -This is a convenience procedure that returns the \fBstatus\fP element of -the state array. -.TP -\fB::http::code\fP \fItoken\fP -This is a convenience procedure that returns the \fBhttp\fP element of the -state array. -.TP -\fB::http::size\fP \fItoken\fP -This is a convenience procedure that returns the \fBcurrentsize\fP -element of the state array. -.SH "STATE ARRAY" -The \fB::http::geturl\fR procedure returns a \fItoken\fR that can be used to -get to the state of the HTTP transaction in the form of a Tcl array. -Use this construct to create an easy-to-use array variable: -.CS -upvar #0 $token state -.CE -Once the data associated with the url is no longer needed, the state -array should be unset to free up storage. The following elements of -the array are supported: -.RS -.TP -\fBbody\fR -The contents of the URL. This will be empty if the \fB\-channel\fR -option has been specified. This value is returned by the \fB::http::data\fP command. -.TP -\fBcurrentsize\fR -The current number of bytes fetched from the URL. -This value is returned by the \fB::http::size\fP command. -.TP -\fBerror\fR -If defined, this is the error string seen when the HTTP transaction -was aborted. -.TP -\fBhttp\fR -The HTTP status reply from the server. This value -is returned by the \fB::http::code\fP command. The format of this value is: -.RS -.CS -\fIcode string\fP -.CE -The \fIcode\fR is a three-digit number defined in the HTTP standard. -A code of 200 is OK. Codes beginning with 4 or 5 indicate errors. -Codes beginning with 3 are redirection errors. In this case the -\fBLocation\fR meta-data specifies a new URL that contains the -requested information. -.RE -.TP -\fBmeta\fR -The HTTP protocol returns meta-data that describes the URL contents. -The \fBmeta\fR element of the state array is a list of the keys and -values of the meta-data. This is in a format useful for initializing -an array that just contains the meta-data: -.RS -.CS -array set meta $state(meta) -.CE -Some of the meta-data keys are listed below, but the HTTP standard defines -more, and servers are free to add their own. -.TP -\fBContent-Type\fR -The type of the URL contents. Examples include \fBtext/html\fR, -\fBimage/gif,\fR \fBapplication/postscript\fR and -\fBapplication/x-tcl\fR. -.TP -\fBContent-Length\fR -The advertised size of the contents. The actual size obtained by -\fB::http::geturl\fR is available as \fBstate(size)\fR. -.TP -\fBLocation\fR -An alternate URL that contains the requested data. -.RE -.TP -\fBstatus\fR -Either \fBok\fR, for successful completion, \fBreset\fR for -user-reset, or \fBerror\fR for an error condition. During the -transaction this value is the empty string. -.TP -\fBtotalsize\fR -A copy of the \fBContent-Length\fR meta-data value. -.TP -\fBtype\fR -A copy of the \fBContent-Type\fR meta-data value. -.TP -\fBurl\fR -The requested URL. -.RE -.SH EXAMPLE -.DS -# Copy a URL to a file and print meta-data -proc ::http::copy { url file {chunk 4096} } { - set out [open $file w] - set token [geturl $url -channel $out -progress ::http::Progress \\ - -blocksize $chunk] - close $out - # This ends the line started by http::Progress - puts stderr "" - upvar #0 $token state - set max 0 - foreach {name value} $state(meta) { - if {[string length $name] > $max} { - set max [string length $name] - } - if {[regexp -nocase ^location$ $name]} { - # Handle URL redirects - puts stderr "Location:$value" - return [copy [string trim $value] $file $chunk] - } - } - incr max - foreach {name value} $state(meta) { - puts [format "%-*s %s" $max $name: $value] - } - - return $token -} -proc ::http::Progress {args} { - puts -nonewline stderr . ; flush stderr -} - -.DE -.SH "SEE ALSO" -safe(n), socket(n), safesock(n) -.SH KEYWORDS -security policy, socket - - diff --git a/doc/if.n b/doc/if.n deleted file mode 100644 index cebca19..0000000 --- a/doc/if.n +++ /dev/null @@ -1,43 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: if.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH if n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -if \- Execute scripts conditionally -.SH SYNOPSIS -\fBif \fIexpr1 \fR?\fBthen\fR? \fIbody1 \fBelseif \fIexpr2 \fR?\fBthen\fR? \fIbody2\fR \fBelseif\fR ... ?\fBelse\fR? ?\fIbodyN\fR? -.BE - -.SH DESCRIPTION -.PP -The \fIif\fR command evaluates \fIexpr1\fR as an expression (in the -same way that \fBexpr\fR evaluates its argument). The value of the -expression must be a boolean -(a numeric value, where 0 is false and -anything is true, or a string value such as \fBtrue\fR or \fByes\fR -for true and \fBfalse\fR or \fBno\fR for false); -if it is true then \fIbody1\fR is executed by passing it to the -Tcl interpreter. -Otherwise \fIexpr2\fR is evaluated as an expression and if it is true -then \fBbody2\fR is executed, and so on. -If none of the expressions evaluates to true then \fIbodyN\fR is -executed. -The \fBthen\fR and \fBelse\fR arguments are optional -``noise words'' to make the command easier to read. -There may be any number of \fBelseif\fR clauses, including zero. -\fIBodyN\fR may also be omitted as long as \fBelse\fR is omitted too. -The return value from the command is the result of the body script -that was executed, or an empty string -if none of the expressions was non-zero and there was no \fIbodyN\fR. - -.SH KEYWORDS -boolean, conditional, else, false, if, true diff --git a/doc/incr.n b/doc/incr.n deleted file mode 100644 index 90c4740..0000000 --- a/doc/incr.n +++ /dev/null @@ -1,31 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: incr.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH incr n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -incr \- Increment the value of a variable -.SH SYNOPSIS -\fBincr \fIvarName \fR?\fIincrement\fR? -.BE - -.SH DESCRIPTION -.PP -Increments the value stored in the variable whose name is \fIvarName\fR. -The value of the variable must be an integer. -If \fIincrement\fR is supplied then its value (which must be an -integer) is added to the value of variable \fIvarName\fR; otherwise -1 is added to \fIvarName\fR. -The new value is stored as a decimal string in variable \fIvarName\fR -and also returned as result. - -.SH KEYWORDS -add, increment, variable, value diff --git a/doc/info.n b/doc/info.n deleted file mode 100644 index 79afb72..0000000 --- a/doc/info.n +++ /dev/null @@ -1,185 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" Copyright (c) 1994-1997 Sun Microsystems, Inc. -'\" Copyright (c) 1993-1997 Bell Labs Innovations for Lucent Technologies -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: info.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH info n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -info \- Return information about the state of the Tcl interpreter -.SH SYNOPSIS -\fBinfo \fIoption \fR?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command provides information about various internals of the Tcl -interpreter. -The legal \fIoption\fR's (which may be abbreviated) are: -.TP -\fBinfo args \fIprocname\fR -Returns a list containing the names of the arguments to procedure -\fIprocname\fR, in order. \fIProcname\fR must be the name of a -Tcl command procedure. -.TP -\fBinfo body \fIprocname\fR -Returns the body of procedure \fIprocname\fR. \fIProcname\fR must be -the name of a Tcl command procedure. -.TP -\fBinfo cmdcount\fR -Returns a count of the total number of commands that have been invoked -in this interpreter. -.TP -\fBinfo commands \fR?\fIpattern\fR? -If \fIpattern\fR isn't specified, -returns a list of names of all the Tcl commands in the current namespace, -including both the built-in commands written in C and -the command procedures defined using the \fBproc\fR command. -If \fIpattern\fR is specified, -only those names matching \fIpattern\fR are returned. -Matching is determined using the same rules as for \fBstring match\fR. -\fIpattern\fR can be a qualified name like \fBFoo::print*\fR. -That is, it may specify a particular namespace -using a sequence of namespace names separated by \fB::\fRs, -and may have pattern matching special characters -at the end to specify a set of commands in that namespace. -If \fIpattern\fR is a qualified name, -the resulting list of command names has each one qualified with the name -of the specified namespace. -.TP -\fBinfo complete \fIcommand\fR -Returns 1 if \fIcommand\fR is a complete Tcl command in the sense of -having no unclosed quotes, braces, brackets or array element names, -If the command doesn't appear to be complete then 0 is returned. -This command is typically used in line-oriented input environments -to allow users to type in commands that span multiple lines; if the -command isn't complete, the script can delay evaluating it until additional -lines have been typed to complete the command. -.TP -\fBinfo default \fIprocname arg varname\fR -\fIProcname\fR must be the name of a Tcl command procedure and \fIarg\fR -must be the name of an argument to that procedure. If \fIarg\fR -doesn't have a default value then the command returns \fB0\fR. -Otherwise it returns \fB1\fR and places the default value of \fIarg\fR -into variable \fIvarname\fR. -.TP -\fBinfo exists \fIvarName\fR -Returns \fB1\fR if the variable named \fIvarName\fR exists in the -current context (either as a global or local variable), returns \fB0\fR -otherwise. -.TP -\fBinfo globals \fR?\fIpattern\fR? -If \fIpattern\fR isn't specified, returns a list of all the names -of currently-defined global variables. -Global variables are variables in the global namespace. -If \fIpattern\fR is specified, only those names matching \fIpattern\fR -are returned. Matching is determined using the same rules as for -\fBstring match\fR. -.TP -\fBinfo hostname\fR -Returns the name of the computer on which this invocation is being -executed. -.TP -\fBinfo level\fR ?\fInumber\fR? -If \fInumber\fR is not specified, this command returns a number -giving the stack level of the invoking procedure, or 0 if the -command is invoked at top-level. If \fInumber\fR is specified, -then the result is a list consisting of the name and arguments for the -procedure call at level \fInumber\fR on the stack. If \fInumber\fR -is positive then it selects a particular stack level (1 refers -to the top-most active procedure, 2 to the procedure it called, and -so on); otherwise it gives a level relative to the current level -(0 refers to the current procedure, -1 to its caller, and so on). -See the \fBuplevel\fR command for more information on what stack -levels mean. -.TP -\fBinfo library\fR -Returns the name of the library directory in which standard Tcl -scripts are stored. -This is actually the value of the \fBtcl_library\fR -variable and may be changed by setting \fBtcl_library\fR. -See the \fBtclvars\fR manual entry for more information. -.TP -\fBinfo loaded \fR?\fIinterp\fR? -Returns a list describing all of the packages that have been loaded into -\fIinterp\fR with the \fBload\fR command. -Each list element is a sub-list with two elements consisting of the -name of the file from which the package was loaded and the name of -the package. -For statically-loaded packages the file name will be an empty string. -If \fIinterp\fR is omitted then information is returned for all packages -loaded in any interpreter in the process. -To get a list of just the packages in the current interpreter, specify -an empty string for the \fIinterp\fR argument. -.TP -\fBinfo locals \fR?\fIpattern\fR? -If \fIpattern\fR isn't specified, returns a list of all the names -of currently-defined local variables, including arguments to the -current procedure, if any. -Variables defined with the \fBglobal\fR and \fBupvar\fR commands -will not be returned. -If \fIpattern\fR is specified, only those names matching \fIpattern\fR -are returned. Matching is determined using the same rules as for -\fBstring match\fR. -.TP -\fBinfo nameofexecutable\fR -Returns the full path name of the binary file from which the application -was invoked. If Tcl was unable to identify the file, then an empty -string is returned. -.TP -\fBinfo patchlevel\fR -Returns the value of the global variable \fBtcl_patchLevel\fR; see -the \fBtclvars\fR manual entry for more information. -.TP -\fBinfo procs \fR?\fIpattern\fR? -If \fIpattern\fR isn't specified, returns a list of all the -names of Tcl command procedures in the current namespace. -If \fIpattern\fR is specified, -only those procedure names in the current namespace -matching \fIpattern\fR are returned. -Matching is determined using the same rules as for -\fBstring match\fR. -.TP -\fBinfo script\fR -If a Tcl script file is currently being evaluated (i.e. there is a -call to \fBTcl_EvalFile\fR active or there is an active invocation -of the \fBsource\fR command), then this command returns the name -of the innermost file being processed. Otherwise the command returns an -empty string. -.TP -\fBinfo sharedlibextension\fR -Returns the extension used on this platform for the names of files -containing shared libraries (for example, \fB.so\fR under Solaris). -If shared libraries aren't supported on this platform then an empty -string is returned. -.TP -\fBinfo tclversion\fR -Returns the value of the global variable \fBtcl_version\fR; see -the \fBtclvars\fR manual entry for more information. -.TP -\fBinfo vars\fR ?\fIpattern\fR? -If \fIpattern\fR isn't specified, -returns a list of all the names of currently-visible variables. -This includes locals and currently-visible globals. -If \fIpattern\fR is specified, only those names matching \fIpattern\fR -are returned. Matching is determined using the same rules as for -\fBstring match\fR. -\fIpattern\fR can be a qualified name like \fBFoo::option*\fR. -That is, it may specify a particular namespace -using a sequence of namespace names separated by \fB::\fRs, -and may have pattern matching special characters -at the end to specify a set of variables in that namespace. -If \fIpattern\fR is a qualified name, -the resulting list of variable names -has each matching namespace variable qualified with the name -of its namespace. - -.SH KEYWORDS -command, information, interpreter, level, namespace, procedure, variable diff --git a/doc/interp.n b/doc/interp.n deleted file mode 100644 index d714f4d..0000000 --- a/doc/interp.n +++ /dev/null @@ -1,540 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: interp.n,v 1.3 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH interp n 7.6 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -interp \- Create and manipulate Tcl interpreters -.SH SYNOPSIS -\fBinterp \fIoption \fR?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command makes it possible to create one or more new Tcl -interpreters that co-exist with the creating interpreter in the -same application. The creating interpreter is called the \fImaster\fR -and the new interpreter is called a \fIslave\fR. -A master can create any number of slaves, and each slave can -itself create additional slaves for which it is master, resulting -in a hierarchy of interpreters. -.PP -Each interpreter is independent from the others: it has its own name -space for commands, procedures, and global variables. -A master interpreter may create connections between its slaves and -itself using a mechanism called an \fIalias\fR. An \fIalias\fR is -a command in a slave interpreter which, when invoked, causes a -command to be invoked in its master interpreter or in another slave -interpreter. The only other connections between interpreters are -through environment variables (the \fBenv\fR variable), which are -normally shared among all interpreters in the application. Note that the -name space for files (such as the names returned by the \fBopen\fR command) -is no longer shared between interpreters. Explicit commands are provided to -share files and to transfer references to open files from one interpreter -to another. -.PP -The \fBinterp\fR command also provides support for \fIsafe\fR -interpreters. A safe interpreter is a slave whose functions have -been greatly restricted, so that it is safe to execute untrusted -scripts without fear of them damaging other interpreters or the -application's environment. For example, all IO channel creation -commands and subprocess creation commands are made inaccessible to safe -interpreters. -.VS -See SAFE INTERPRETERS below for more information on -what features are present in a safe interpreter. -The dangerous functionality is not removed from the safe interpreter; -instead, it is \fIhidden\fR, so that only trusted interpreters can obtain -access to it. For a detailed explanation of hidden commands, see -HIDDEN COMMANDS, below. -The alias mechanism can be used for protected communication (analogous to a -kernel call) between a slave interpreter and its master. See ALIAS -INVOCATION, below, for more details on how the alias mechanism works. -.VE -.PP -A qualified interpreter name is a proper Tcl lists containing a subset of its -ancestors in the interpreter hierarchy, terminated by the string naming the -interpreter in its immediate master. Interpreter names are relative to the -interpreter in which they are used. For example, if \fBa\fR is a slave of -the current interpreter and it has a slave \fBa1\fR, which in turn has a -slave \fBa11\fR, the qualified name of \fBa11\fR in \fBa\fR is the list -\fBa1 a11\fR. -.PP -The \fBinterp\fR command, described below, accepts qualified interpreter -names as arguments; the interpreter in which the command is being evaluated -can always be referred to as \fB{}\fR (the empty list or string). Note that -it is impossible to refer to a master (ancestor) interpreter by name in a -slave interpreter except through aliases. Also, there is no global name by -which one can refer to the first interpreter created in an application. -Both restrictions are motivated by safety concerns. - -.VS -.SH "THE INTERP COMMAND" -.PP -.VE -The \fBinterp\fR command is used to create, delete, and manipulate -slave interpreters, and to share or transfer -channels between interpreters. It can have any of several forms, depending -on the \fIoption\fR argument: -.TP -\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcCmd\fR -Returns a Tcl list whose elements are the \fItargetCmd\fR and -\fIarg\fRs associated with the alias named \fIsrcCmd\fR -(all of these are the values specified when the alias was -created; it is possible that the actual source command in the -slave is different from \fIsrcCmd\fR if it was renamed). -.TP -\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcCmd\fR \fB{}\fR -Deletes the alias for \fIsrcCmd\fR in the slave interpreter identified by -\fIsrcPath\fR. -\fIsrcCmd\fR refers to the name under which the alias -was created; if the source command has been renamed, the renamed -command will be deleted. -.TP -\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcCmd\fR \fItargetPath\fR \fItargetCmd \fR?\fIarg arg ...\fR? -This command creates an alias between one slave and another (see the -\fBalias\fR slave command below for creating aliases between a slave -and its master). In this command, either of the slave interpreters -may be anywhere in the hierarchy of interpreters under the interpreter -invoking the command. -\fISrcPath\fR and \fIsrcCmd\fR identify the source of the alias. -\fISrcPath\fR is a Tcl list whose elements select a particular -interpreter. For example, ``\fBa b\fR'' identifies an interpreter -\fBb\fR, which is a slave of interpreter \fBa\fR, which is a slave -of the invoking interpreter. An empty list specifies the interpreter -invoking the command. \fIsrcCmd\fR gives the name of a new -command, which will be created in the source interpreter. -\fITargetPath\fR and \fItargetCmd\fR specify a target interpreter -and command, and the \fIarg\fR arguments, if any, specify additional -arguments to \fItargetCmd\fR which are prepended to any arguments specified -in the invocation of \fIsrcCmd\fR. -\fITargetCmd\fR may be undefined at the time of this call, or it may -already exist; it is not created by this command. -The alias arranges for the given target command to be invoked -in the target interpreter whenever the given source command is -invoked in the source interpreter. See ALIAS INVOCATION below for -more details. -.TP -\fBinterp\fR \fBaliases \fR?\fIpath\fR? -This command returns a Tcl list of the names of all the source commands for -aliases defined in the interpreter identified by \fIpath\fR. -.TP -\fBinterp\fR \fBcreate \fR?\fB\-safe\fR? ?\fB\-\|\-\fR? ?\fIpath\fR? -Creates a slave interpreter identified by \fIpath\fR and a new command, -called a \fIslave command\fR. The name of the slave command is the last -component of \fIpath\fR. The new slave interpreter and the slave command -are created in the interpreter identified by the path obtained by removing -the last component from \fIpath\fR. For example, if \fIpath is \fBa b -c\fR then a new slave interpreter and slave command named \fBc\fR are -created in the interpreter identified by the path \fBa b\fR. -The slave command may be used to manipulate the new interpreter as -described below. If \fIpath\fR is omitted, Tcl creates a unique name of the -form \fBinterp\fIx\fR, where \fIx\fR is an integer, and uses it for the -interpreter and the slave command. If the \fB\-safe\fR switch is specified -(or if the master interpreter is a safe interpreter), the new slave -interpreter will be created as a safe interpreter with limited -functionality; otherwise the slave will include the full set of Tcl -built-in commands and variables. The \fB\-\|\-\fR switch can be used to -mark the end of switches; it may be needed if \fIpath\fR is an unusual -value such as \fB\-safe\fR. The result of the command is the name of the -new interpreter. The name of a slave interpreter must be unique among all -the slaves for its master; an error occurs if a slave interpreter by the -given name already exists in this master. -.TP -\fBinterp\fR \fBdelete \fR?\fIpath ...?\fR -Deletes zero or more interpreters given by the optional \fIpath\fR -arguments, and for each interpreter, it also deletes its slaves. The -command also deletes the slave command for each interpreter deleted. -For each \fIpath\fR argument, if no interpreter by that name -exists, the command raises an error. -.TP -\fBinterp\fR \fBeval\fR \fIpath arg \fR?\fIarg ...\fR? -This command concatenates all of the \fIarg\fR arguments in the same -fashion as the \fBconcat\fR command, then evaluates the resulting string as -a Tcl script in the slave interpreter identified by \fIpath\fR. The result -of this evaluation (including error information such as the \fBerrorInfo\fR -and \fBerrorCode\fR variables, if an error occurs) is returned to the -invoking interpreter. -.TP -\fBinterp exists \fIpath\fR -Returns \fB1\fR if a slave interpreter by the specified \fIpath\fR -exists in this master, \fB0\fR otherwise. If \fIpath\fR is omitted, the -invoking interpreter is used. -.VS "" BR -.TP -\fBinterp expose \fIpath\fR \fIhiddenName\fR ?\fIexposedCmdName\fR? -Makes the hidden command \fIhiddenName\fR exposed, eventually bringing -it back under a new \fIexposedCmdName\fR name (this name is currently -accepted only if it is a valid global name space name without any ::), -in the interpreter -denoted by \fIpath\fR. -If an exposed command with the targetted name already exists, this command -fails. -Hidden commands are explained in more detail in HIDDEN COMMANDS, below. -.TP -\fBinterp\fR \fBhide\fR \fIpath\fR \fIexposedCmdName\fR ?\fIhiddenCmdName\fR? -Makes the exposed command \fIexposedCmdName\fR hidden, renaming -it to the hidden command \fIhiddenCmdName\fR, or keeping the same name if -\fIhiddenCmdName\fR is not given, in the interpreter denoted -by \fIpath\fR. -If a hidden command with the targetted name already exists, this command -fails. -Currently both \fIexposedCmdName\fR and \fIhiddenCmdName\fR can -not contain namespace qualifiers, or an error is raised. -Commands to be hidden by \fBinterp hide\fR are looked up in the global -namespace even if the current namespace is not the global one. This -prevents slaves from fooling a master interpreter into hiding the wrong -command, by making the current namespace be different from the global one. -Hidden commands are explained in more detail in HIDDEN COMMANDS, below. -.TP -\fBinterp\fR \fBhidden\fR \fIpath\fR -Returns a list of the names of all hidden commands in the interpreter -identified by \fIpath\fR. -.TP -\fBinterp\fR \fBinvokehidden\fR \fIpath\fR ?\fB-global\fR? \fIhiddenCmdName\fR ?\fIarg ...\fR? -Invokes the hidden command \fIhiddenCmdName\fR with the arguments supplied -in the interpreter denoted by \fIpath\fR. No substitutions or evaluation -are applied to the arguments. -If the \fB-global\fR flag is present, the hidden command is invoked at the -global level in the target interpreter; otherwise it is invoked at the -current call frame and can access local variables in that and outer call -frames. -Hidden commands are explained in more detail in HIDDEN COMMANDS, below. -.VE -.TP -\fBinterp issafe\fR ?\fIpath\fR? -Returns \fB1\fR if the interpreter identified by the specified \fIpath\fR -is safe, \fB0\fR otherwise. -.VS "" BR -.TP -\fBinterp marktrusted\fR \fIpath\fR -Marks the interpreter identified by \fIpath\fR as trusted. Does -not expose the hidden commands. This command can only be invoked from a -trusted interpreter. -The command has no effect if the interpreter identified by \fIpath\fR is -already trusted. -.VE -.TP -\fBinterp\fR \fBshare\fR \fIsrcPath channelId destPath\fR -Causes the IO channel identified by \fIchannelId\fR to become shared -between the interpreter identified by \fIsrcPath\fR and the interpreter -identified by \fIdestPath\fR. Both interpreters have the same permissions -on the IO channel. -Both interpreters must close it to close the underlying IO channel; IO -channels accessible in an interpreter are automatically closed when an -interpreter is destroyed. -.TP -\fBinterp\fR \fBslaves\fR ?\fIpath\fR? -Returns a Tcl list of the names of all the slave interpreters associated -with the interpreter identified by \fIpath\fR. If \fIpath\fR is omitted, -the invoking interpreter is used. -.TP -\fBinterp\fR \fBtarget\fR \fIpath alias\fR -Returns a Tcl list describing the target interpreter for an alias. The -alias is specified with an interpreter path and source command name, just -as in \fBinterp alias\fR above. The name of the target interpreter is -returned as an interpreter path, relative to the invoking interpreter. -If the target interpreter for the alias is the invoking interpreter then an -empty list is returned. If the target interpreter for the alias is not the -invoking interpreter or one of its descendants then an error is generated. -The target command does not have to be defined at the time of this invocation. -.TP -\fBinterp\fR \fBtransfer\fR \fIsrcPath channelId destPath\fR -Causes the IO channel identified by \fIchannelId\fR to become available in -the interpreter identified by \fIdestPath\fR and unavailable in the -interpreter identified by \fIsrcPath\fR. - -.SH "SLAVE COMMAND" -.PP -For each slave interpreter created with the \fBinterp\fR command, a -new Tcl command is created in the master interpreter with the same -name as the new interpreter. This command may be used to invoke -various operations on the interpreter. It has the following -general form: -.CS -\fIslave command \fR?\fIarg arg ...\fR? -.CE -\fISlave\fR is the name of the interpreter, and \fIcommand\fR -and the \fIarg\fRs determine the exact behavior of the command. -The valid forms of this command are: -.TP -\fIslave \fBaliases\fR -Returns a Tcl list whose elements are the names of all the -aliases in \fIslave\fR. The names returned are the \fIsrcCmd\fR -values used when the aliases were created (which may not be the same -as the current names of the commands, if they have been -renamed). -.TP -\fIslave \fBalias \fIsrcCmd\fR -Returns a Tcl list whose elements are the \fItargetCmd\fR and -\fIarg\fRs associated with the alias named \fIsrcCmd\fR -(all of these are the values specified when the alias was -created; it is possible that the actual source command in the -slave is different from \fIsrcCmd\fR if it was renamed). -.TP -\fIslave \fBalias \fIsrcCmd \fB{}\fR -Deletes the alias for \fIsrcCmd\fR in the slave interpreter. -\fIsrcCmd\fR refers to the name under which the alias -was created; if the source command has been renamed, the renamed -command will be deleted. -.TP -\fIslave \fBalias \fIsrcCmd targetCmd \fR?\fIarg ..\fR? -Creates an alias such that whenever \fIsrcCmd\fR is invoked -in \fIslave\fR, \fItargetCmd\fR is invoked in the master. -The \fIarg\fR arguments will be passed to \fItargetCmd\fR as additional -arguments, prepended before any arguments passed in the invocation of -\fIsrcCmd\fR. -See ALIAS INVOCATION below for details. -.TP -\fIslave \fBeval \fIarg \fR?\fIarg ..\fR? -This command concatenates all of the \fIarg\fR arguments in -the same fashion as the \fBconcat\fR command, then evaluates -the resulting string as a Tcl script in \fIslave\fR. -The result of this evaluation (including error information -such as the \fBerrorInfo\fR and \fBerrorCode\fR variables, if an -error occurs) is returned to the invoking interpreter. -.VS "" BR -.TP -\fIslave \fBexpose \fIhiddenName \fR?\fIexposedCmdName\fR? -This command exposes the hidden command \fIhiddenName\fR, eventually bringing -it back under a new \fIexposedCmdName\fR name (this name is currently -accepted only if it is a valid global name space name without any ::), -in \fIslave\fR. -If an exposed command with the targetted name already exists, this command -fails. -For more details on hidden commands, see HIDDEN COMMANDS, below. -.TP -\fIslave \fBhide \fIexposedCmdName\fR ?\fIhiddenCmdName\fR? -This command hides the exposed command \fIexposedCmdName\fR, renaming it to -the hidden command \fIhiddenCmdName\fR, or keeping the same name if the -the argument is not given, in the \fIslave\fR interpreter. -If a hidden command with the targetted name already exists, this command -fails. -Currently both \fIexposedCmdName\fR and \fIhiddenCmdName\fR can -not contain namespace qualifiers, or an error is raised. -Commands to be hidden are looked up in the global -namespace even if the current namespace is not the global one. This -prevents slaves from fooling a master interpreter into hiding the wrong -command, by making the current namespace be different from the global one. -For more details on hidden commands, see HIDDEN COMMANDS, below. -.TP -\fIslave \fBhidden\fR -Returns a list of the names of all hidden commands in \fIslave\fR. -.TP -\fIslave \fBinvokehidden\fR ?\fB-global\fR \fIhiddenName \fR?\fIarg ..\fR? -This command invokes the hidden command \fIhiddenName\fR with the -supplied arguments, in \fIslave\fR. No substitutions or evaluations are -applied to the arguments. -If the \fB-global\fR flag is given, the command is invoked at the global -level in the slave; otherwise it is invoked at the current call frame and -can access local variables in that or outer call frames. -For more details on hidden commands, see HIDDEN -COMMANDS, below. -.VE -.TP -\fIslave \fBissafe\fR -Returns \fB1\fR if the slave interpreter is safe, \fB0\fR otherwise. -.VS "" BR -.TP -\fIslave \fBmarktrusted\fR -Marks the slave interpreter as trusted. Can only be invoked by a -trusted interpreter. This command does not expose any hidden -commands in the slave interpreter. The command has no effect if the slave -is already trusted. -.VE - -.SH "SAFE INTERPRETERS" -.PP -A safe interpreter is one with restricted functionality, so that -is safe to execute an arbitrary script from your worst enemy without -fear of that script damaging the enclosing application or the rest -of your computing environment. In order to make an interpreter -safe, certain commands and variables are removed from the interpreter. -For example, commands to create files on disk are removed, and the -\fBexec\fR command is removed, since it could be used to cause damage -through subprocesses. -Limited access to these facilities can be provided, by creating -aliases to the master interpreter which check their arguments carefully -and provide restricted access to a safe subset of facilities. -For example, file creation might be allowed in a particular subdirectory -and subprocess invocation might be allowed for a carefully selected and -fixed set of programs. -.PP -A safe interpreter is created by specifying the \fB\-safe\fR switch -to the \fBinterp create\fR command. Furthermore, any slave created -by a safe interpreter will also be safe. -.PP -A safe interpreter is created with exactly the following set of -built-in commands: -.DS -.ta 1.2i 2.4i 3.6i -\fBafter append array break -case catch clock close -concat continue eof error -eval expr fblocked fileevent -flush for foreach format -gets global history if -incr info interp join -lappend lindex linsert list -llength lower lrange lreplace -lsearch lsort package pid -proc puts read rename -return scan seek set -split string subst switch -tell trace unset update -uplevel upvar vwait while\fR -.DE -.VS "" BR -The following commands are hidden by \fBinterp create\fR when it -creates a safe interpreter: -.DS -.ta 1.2i 2.4i 3.6i -\fBcd exec exit fconfigure -file glob load open -pwd socket source vwait\fR -.DE -These commands can be recreated later as Tcl procedures or aliases, or -re-exposed by \fBinterp expose\fR. -.VE -.PP -In addition, the \fBenv\fR variable is not present in a safe interpreter, -so it cannot share environment variables with other interpreters. The -\fBenv\fR variable poses a security risk, because users can store -sensitive information in an environment variable. For example, the PGP -manual recommends storing the PGP private key protection password in -the environment variable \fIPGPPASS\fR. Making this variable available -to untrusted code executing in a safe interpreter would incur a -security risk. -.PP -If extensions are loaded into a safe interpreter, they may also restrict -their own functionality to eliminate unsafe commands. For a discussion of -management of extensions for safety see the manual entries for -\fBSafe\-Tcl\fR and the \fBload\fR Tcl command. - -.SH "ALIAS INVOCATION" -.PP -The alias mechanism has been carefully designed so that it can -be used safely when an untrusted script is executing -in a safe slave and the target of the alias is a trusted -master. The most important thing in guaranteeing safety is to -ensure that information passed from the slave to the master is -never evaluated or substituted in the master; if this were to -occur, it would enable an evil script in the slave to invoke -arbitrary functions in the master, which would compromise security. -.PP -When the source for an alias is invoked in the slave interpreter, the -usual Tcl substitutions are performed when parsing that command. -These substitutions are carried out in the source interpreter just -as they would be for any other command invoked in that interpreter. -The command procedure for the source command takes its arguments -and merges them with the \fItargetCmd\fR and \fIarg\fRs for the -alias to create a new array of arguments. If the words -of \fIsrcCmd\fR were ``\fIsrcCmd arg1 arg2 ... argN\fR'', -the new set of words will be -``\fItargetCmd arg arg ... arg arg1 arg2 ... argN\fR'', -where \fItargetCmd\fR and \fIarg\fRs are the values supplied when the -alias was created. \fITargetCmd\fR is then used to locate a command -procedure in the target interpreter, and that command procedure -is invoked with the new set of arguments. An error occurs if -there is no command named \fItargetCmd\fR in the target interpreter. -No additional substitutions are performed on the words: the -target command procedure is invoked directly, without -going through the normal Tcl evaluation mechanism. -Substitutions are thus performed on each word exactly once: -\fItargetCmd\fR and \fIargs\fR were substituted when parsing the command -that created the alias, and \fIarg1 - argN\fR are substituted when -the alias's source command is parsed in the source interpreter. -.PP -When writing the \fItargetCmd\fRs for aliases in safe interpreters, -it is very important that the arguments to that command never be -evaluated or substituted, since this would provide an escape -mechanism whereby the slave interpreter could execute arbitrary -code in the master. This in turn would compromise the security -of the system. - -.VS -.SH "HIDDEN COMMANDS" -.PP -Safe interpreters greatly restrict the functionality available to Tcl -programs executing within them. -Allowing the untrusted Tcl program to have direct access to this -functionality is unsafe, because it can be used for a variety of -attacks on the environment. -However, there are times when there is a legitimate need to use the -dangerous functionality in the context of the safe interpreter. For -example, sometimes a program must be \fBsource\fRd into the interpreter. -Another example is Tk, where windows are bound to the hierarchy of windows -for a specific interpreter; some potentially dangerous functions, e.g. -window management, must be performed on these windows within the -interpreter context. -.PP -The \fBinterp\fR command provides a solution to this problem in the form of -\fIhidden commands\fR. Instead of removing the dangerous commands entirely -from a safe interpreter, these commands are hidden so they become -unavailable to Tcl scripts executing in the interpreter. However, such -hidden commands can be invoked by any trusted ancestor of the safe -interpreter, in the context of the safe interpreter, using \fBinterp -invoke\fR. Hidden commands and exposed commands reside in separate name -spaces. It is possible to define a hidden command and an exposed command by -the same name within one interpreter. -.PP -Hidden commands in a slave interpreter can be invoked in the body of -procedures called in the master during alias invocation. For example, an -alias for \fBsource\fR could be created in a slave interpreter. When it is -invoked in the slave interpreter, a procedure is called in the master -interpreter to check that the operation is allowable (e.g. it asks to -source a file that the slave interpreter is allowed to access). The -procedure then it invokes the hidden \fBsource\fR command in the slave -interpreter to actually source in the contents of the file. Note that two -commands named \fBsource\fR exist in the slave interpreter: the alias, and -the hidden command. -.PP -Because a master interpreter may invoke a hidden command as part of -handling an alias invocation, great care must be taken to avoid evaluating -any arguments passed in through the alias invocation. -Otherwise, malicious slave interpreters could cause a trusted master -interpreter to execute dangerous commands on their behalf. See the section -on ALIAS INVOCATION for a more complete discussion of this topic. -To help avoid this problem, no substitutions or evaluations are -applied to arguments of \fBinterp invokehidden\fR. -.PP -Safe interpreters are not allowed to invoke hidden commands in themselves -or in their descendants. This prevents safe slaves from gaining access to -hidden functionality in themselves or their descendants. -.PP -The set of hidden commands in an interpreter can be manipulated by a trusted -interpreter using \fBinterp expose\fR and \fBinterp hide\fR. The \fBinterp -expose\fR command moves a hidden command to the -set of exposed commands in the interpreter identified by \fIpath\fR, -potentially renaming the command in the process. If an exposed command by -the targetted name already exists, the operation fails. Similarly, -\fBinterp hide\fR moves an exposed command to the set of hidden commands in -that interpreter. Safe interpreters are not allowed to move commands -between the set of hidden and exposed commands, in either themselves or -their descendants. -.PP -Currently, the names of hidden commands cannot contain namespace -qualifiers, and you must first rename a command in a namespace to the -global namespace before you can hide it. -Commands to be hidden by \fBinterp hide\fR are looked up in the global -namespace even if the current namespace is not the global one. This -prevents slaves from fooling a master interpreter into hiding the wrong -command, by making the current namespace be different from the global one. -.VE -.SH CREDITS -.PP -This mechanism is based on the Safe-Tcl prototype implemented -by Nathaniel Borenstein and Marshall Rose. - -.SH "SEE ALSO" -load(n), safe(n), Tcl_CreateSlave(3) - -.SH KEYWORDS -alias, master interpreter, safe interpreter, slave interpreter diff --git a/doc/join.n b/doc/join.n deleted file mode 100644 index 76e41e3..0000000 --- a/doc/join.n +++ /dev/null @@ -1,29 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: join.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH join n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -join \- Create a string by joining together list elements -.SH SYNOPSIS -\fBjoin \fIlist \fR?\fIjoinString\fR? -.BE - -.SH DESCRIPTION -.PP -The \fIlist\fR argument must be a valid Tcl list. -This command returns the string -formed by joining all of the elements of \fIlist\fR together with -\fIjoinString\fR separating each adjacent pair of elements. -The \fIjoinString\fR argument defaults to a space character. - -.SH KEYWORDS -element, join, list, separator diff --git a/doc/lappend.n b/doc/lappend.n deleted file mode 100644 index c4af6e3..0000000 --- a/doc/lappend.n +++ /dev/null @@ -1,35 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: lappend.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH lappend n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -lappend \- Append list elements onto a variable -.SH SYNOPSIS -\fBlappend \fIvarName \fR?\fIvalue value value ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command treats the variable given by \fIvarName\fR as a list -and appends each of the \fIvalue\fR arguments to that list as a separate -element, with spaces between elements. -If \fIvarName\fR doesn't exist, it is created as a list with elements -given by the \fIvalue\fR arguments. -\fBLappend\fR is similar to \fBappend\fR except that the \fIvalue\fRs -are appended as list elements rather than raw text. -This command provides a relatively efficient way to build up -large lists. For example, ``\fBlappend a $b\fR'' is much -more efficient than ``\fBset a [concat $a [list $b]]\fR'' when -\fB$a\fR is long. - -.SH KEYWORDS -append, element, list, variable diff --git a/doc/library.n b/doc/library.n deleted file mode 100644 index eb20351..0000000 --- a/doc/library.n +++ /dev/null @@ -1,288 +0,0 @@ -'\" -'\" Copyright (c) 1991-1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: library.n,v 1.6 1999/04/16 00:46:35 stanton Exp $ -.so man.macros -.TH library n "8.0" Tcl "Tcl Built-In Commands" -.BS -.SH NAME -library \- standard library of Tcl procedures -.SH SYNOPSIS -.nf -\fBauto_execok \fIcmd\fR -\fBauto_load \fIcmd\fR -\fBauto_mkindex \fIdir pattern pattern ...\fR -\fBauto_mkindex_old \fIdir pattern pattern ...\fR -\fBauto_reset\fR -\fBtcl_findLibrary \fIbasename version patch initScript enVarName varName\fR -\fBparray \fIarrayName\fR -.VS -\fBtcl_endOfWord \fIstr start\fR -\fBtcl_startOfNextWord \fIstr start\fR -\fBtcl_startOfPreviousWord \fIstr start\fR -\fBtcl_wordBreakAfter \fIstr start\fR -\fBtcl_wordBreakBefore \fIstr start\fR -.VE -.BE - -.SH INTRODUCTION -.PP -Tcl includes a library of Tcl procedures for commonly-needed functions. -The procedures defined in the Tcl library are generic ones suitable -for use by many different applications. -The location of the Tcl library is returned by the \fBinfo library\fR -command. -In addition to the Tcl library, each application will normally have -its own library of support procedures as well; the location of this -library is normally given by the value of the \fB$\fIapp\fB_library\fR -global variable, where \fIapp\fR is the name of the application. -For example, the location of the Tk library is kept in the variable -\fB$tk_library\fR. -.PP -To access the procedures in the Tcl library, an application should -source the file \fBinit.tcl\fR in the library, for example with -the Tcl command -.CS -\fBsource [file join [info library] init.tcl]\fR -.CE -If the library procedure \fBTcl_Init\fR is invoked from an application's -\fBTcl_AppInit\fR procedure, this happens automatically. -The code in \fBinit.tcl\fR will define the \fBunknown\fR procedure -and arrange for the other procedures to be loaded on-demand using -the auto-load mechanism defined below. - -.SH "COMMAND PROCEDURES" -.PP -The following procedures are provided in the Tcl library: -.TP -\fBauto_execok \fIcmd\fR -Determines whether there is an executable file or shell builtin -by the name \fIcmd\fR. If so, it returns a list of arguments to be -passed to \fBexec\fR to execute the executable file or shell builtin -named by \fIcmd\fR. If not, it returns an empty string. This command -examines the directories in the current search path (given by the PATH -environment variable) in its search for an executable file named -\fIcmd\fR. On Windows platforms, the search is expanded with the same -directories and file extensions as used by \fBexec\fR. \fBAuto_exec\fR -remembers information about previous searches in an array named -\fBauto_execs\fR; this avoids the path search in future calls for the -same \fIcmd\fR. The command \fBauto_reset\fR may be used to force -\fBauto_execok\fR to forget its cached information. -.TP -\fBauto_load \fIcmd\fR -This command attempts to load the definition for a Tcl command named -\fIcmd\fR. -To do this, it searches an \fIauto-load path\fR, which is a list of -one or more directories. -The auto-load path is given by the global variable \fB$auto_path\fR -if it exists. -If there is no \fB$auto_path\fR variable, then the TCLLIBPATH environment -variable is used, if it exists. -Otherwise the auto-load path consists of just the Tcl library directory. -Within each directory in the auto-load path there must be a file -\fBtclIndex\fR that describes one -or more commands defined in that directory -and a script to evaluate to load each of the commands. -The \fBtclIndex\fR file should be generated with the -\fBauto_mkindex\fR command. -If \fIcmd\fR is found in an index file, then the appropriate -script is evaluated to create the command. -The \fBauto_load\fR command returns 1 if \fIcmd\fR was successfully -created. -The command returns 0 if there was no index entry for \fIcmd\fR -or if the script didn't actually define \fIcmd\fR (e.g. because -index information is out of date). -If an error occurs while processing the script, then that error -is returned. -\fBAuto_load\fR only reads the index information once and saves it -in the array \fBauto_index\fR; future calls to \fBauto_load\fR -check for \fIcmd\fR in the array rather than re-reading the index -files. -The cached index information may be deleted with the command -\fBauto_reset\fR. -This will force the next \fBauto_load\fR command to reload the -index database from disk. -.TP -\fBauto_mkindex \fIdir pattern pattern ...\fR -Generates an index suitable for use by \fBauto_load\fR. -The command searches \fIdir\fR for all files whose names match -any of the \fIpattern\fR arguments -(matching is done with the \fBglob\fR command), -generates an index of all the Tcl command -procedures defined in all the matching files, and stores the -index information in a file named \fBtclIndex\fR in \fIdir\fR. -If no pattern is given a pattern of \fB*.tcl\fR will be assumed. -For example, the command -.RS -.CS -\fBauto_mkindex foo *.tcl\fR -.CE -.LP -will read all the \fB.tcl\fR files in subdirectory \fBfoo\fR -and generate a new index file \fBfoo/tclIndex\fR. -.PP -\fBAuto_mkindex\fR parses the Tcl scripts by sourcing them -into a slave interpreter and monitoring the proc and -namespace commands that are executed. -Extensions can use the (undocumented) -auto_mkindex_parser package to register other commands that -can contribute to the auto_load index. -You will have to read through init.tcl to see how this works. -.PP -\fBAuto_mkindex_old\fR parses the Tcl scripts in a relatively -unsophisticated way: if any line contains the word \fBproc\fR -as its first characters then it is assumed to be a procedure -definition and the next word of the line is taken as the -procedure's name. -Procedure definitions that don't appear in this way (e.g. they -have spaces before the \fBproc\fR) will not be indexed. -.RE -.TP -\fBauto_reset\fR -Destroys all the information cached by \fBauto_execok\fR and -\fBauto_load\fR. -This information will be re-read from disk the next time it is -needed. -\fBAuto_reset\fR also deletes any procedures listed in the auto-load -index, so that fresh copies of them will be loaded the next time -that they're used. -.TP -\fBtcl_findLibrary \fIbasename version patch initScript enVarName varName\fR -This is a standard search procedure for use by extensions during -their initialization. They call this procedure to look for their -script library in several standard directories. -The last component of the name of the library directory is -normally \fIbasenameversion\fP -(e.g., tk8.0), but it might be "library" when in the build hierarchies. -The \fIinitScript\fR file will be sourced into the interpreter -once it is found. The directory in which this file is found is -stored into the global variable \fIvarName\fP. -If this variable is already defined (e.g., by C code during -application initialization) then no searching is done. -Otherwise the search looks in these directories: -the directory named by the environment variable \fIenVarName\fP; -relative to the Tcl library directory; -relative to the executable file in the standard installation -bin or bin/\fIarch\fP directory; -relative to the executable file in the current build tree; -relative to the executable file in a parallel build tree. -.TP -\fBparray \fIarrayName\fR -Prints on standard output the names and values of all the elements -in the array \fIarrayName\fR. -\fBArrayName\fR must be an array accessible to the caller of \fBparray\fR. -It may be either local or global. -.TP -\fBtcl_endOfWord \fIstr start\fR -.VS -Returns the index of the first end-of-word location that occurs after -a starting index \fIstart\fR in the string \fIstr\fR. An end-of-word -location is defined to be the first non-word character following the -first word character after the starting point. Returns -1 if there -are no more end-of-word locations after the starting point. See the -description of \fBtcl_wordchars\fR and \fBtcl_nonwordchars\fR below -for more details on how Tcl determines which characters are word -characters. -.TP -\fBtcl_startOfNextWord \fIstr start\fR -Returns the index of the first start-of-word location that occurs -after a starting index \fIstart\fR in the string \fIstr\fR. A -start-of-word location is defined to be the first word character -following a non-word character. Returns \-1 if there are no more -start-of-word locations after the starting point. -.TP -\fBtcl_startOfPreviousWord \fIstr start\fR -Returns the index of the first start-of-word location that occurs -before a starting index \fIstart\fR in the string \fIstr\fR. Returns -\-1 if there are no more start-of-word locations before the starting -point. -.TP -\fBtcl_wordBreakAfter \fIstr start\fR -Returns the index of the first word boundary after the starting index -\fIstart\fR in the string \fIstr\fR. Returns \-1 if there are no more -boundaries after the starting point in the given string. The index -returned refers to the second character of the pair that comprises a -boundary. -.TP -\fBtcl_wordBreakBefore \fIstr start\fR -Returns the index of the first word boundary before the starting index -\fIstart\fR in the string \fIstr\fR. Returns \-1 if there are no more -boundaries before the starting point in the given string. The index -returned refers to the second character of the pair that comprises a -boundary. -.VE - -.SH "VARIABLES" -.PP -The following global variables are defined or used by the procedures in -the Tcl library: -.TP -\fBauto_execs\fR -Used by \fBauto_execok\fR to record information about whether -particular commands exist as executable files. -.TP -\fBauto_index\fR -Used by \fBauto_load\fR to save the index information read from -disk. -.TP -\fBauto_noexec\fR -If set to any value, then \fBunknown\fR will not attempt to auto-exec -any commands. -.TP -\fBauto_noload\fR -If set to any value, then \fBunknown\fR will not attempt to auto-load -any commands. -.TP -\fBauto_path\fR -If set, then it must contain a valid Tcl list giving directories to -search during auto-load operations. -This variable is initialized during startup to contain, in order: -the directories listed in the TCLLIBPATH environment variable, -the directory named by the $tcl_library variable, -the parent directory of $tcl_library, -the directories listed in the $tcl_pkgPath variable. -.TP -\fBenv(TCL_LIBRARY)\fR -If set, then it specifies the location of the directory containing -library scripts (the value of this variable will be -assigned to the \fBtcl_library\fR variable and therefore returned by -the command \fBinfo library\fR). If this variable isn't set then -a default value is used. -.TP -\fBenv(TCLLIBPATH)\fR -If set, then it must contain a valid Tcl list giving directories to -search during auto-load operations. -This variable is only used when -initializing the \fBauto_path\fR variable. -.TP -\fBtcl_nonwordchars\fR -.VS -This variable contains a regular expression that is used by routines -like \fBtcl_endOfWord\fR to identify whether a character is part of a -word or not. If the pattern matches a character, the character is -considered to be a non-word character. On Windows platforms, spaces, -tabs, and newlines are considered non-word characters. Under Unix, -everything but numbers, letters and underscores are considered -non-word characters. -.TP -\fBtcl_wordchars\fR -This variable contains a regular expression that is used by routines -like \fBtcl_endOfWord\fR to identify whether a character is part of a -word or not. If the pattern matches a character, the character is -considered to be a word character. On Windows platforms, words are -comprised of any character that is not a space, tab, or newline. Under -Unix, words are comprised of numbers, letters or underscores. -.VE -.TP -\fBunknown_active\fR -This variable is set by \fBunknown\fR to indicate that it is active. -It is used to detect errors where \fBunknown\fR recurses on itself -infinitely. -The variable is unset before \fBunknown\fR returns. - -.SH KEYWORDS -auto-exec, auto-load, library, unknown, word, whitespace diff --git a/doc/lindex.n b/doc/lindex.n deleted file mode 100644 index 393ee78..0000000 --- a/doc/lindex.n +++ /dev/null @@ -1,35 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: lindex.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH lindex n 7.4 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -lindex \- Retrieve an element from a list -.SH SYNOPSIS -\fBlindex \fIlist index\fR -.BE - -.SH DESCRIPTION -.PP -This command treats \fIlist\fR as a Tcl list and returns the -\fIindex\fR'th element from it (0 refers to the first element of the list). -In extracting the element, \fIlindex\fR observes the same rules -concerning braces and quotes and backslashes as the Tcl command -interpreter; however, variable -substitution and command substitution do not occur. -If \fIindex\fR is negative or greater than or equal to the number -of elements in \fIvalue\fR, then an empty -string is returned. -If \fIindex\fR has the value \fBend\fR, it refers to the last element -in the list. - -.SH KEYWORDS -element, index, list diff --git a/doc/linsert.n b/doc/linsert.n deleted file mode 100644 index 4877e03..0000000 --- a/doc/linsert.n +++ /dev/null @@ -1,33 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: linsert.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH linsert n 7.4 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -linsert \- Insert elements into a list -.SH SYNOPSIS -\fBlinsert \fIlist index element \fR?\fIelement element ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command produces a new list from \fIlist\fR by inserting all -of the \fIelement\fR arguments just before the \fIindex\fRth -element of \fIlist\fR. Each \fIelement\fR argument will become -a separate element of the new list. If \fIindex\fR is less than -or equal to zero, then the new elements are inserted at the -beginning of the list. If \fIindex\fR -has the value \fBend\fR, -or if it is greater than or equal to the number of elements in the list, -then the new elements are appended to the list. - -.SH KEYWORDS -element, insert, list diff --git a/doc/list.n b/doc/list.n deleted file mode 100644 index 9f25140..0000000 --- a/doc/list.n +++ /dev/null @@ -1,45 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: list.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH list n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -list \- Create a list -.SH SYNOPSIS -\fBlist \fR?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command returns a list comprised of all the \fIarg\fRs, -or an empty string if no \fIarg\fRs are specified. -Braces and backslashes get added as necessary, so that the \fBindex\fR command -may be used on the result to re-extract the original arguments, and also -so that \fBeval\fR may be used to execute the resulting list, with -\fIarg1\fR comprising the command's name and the other \fIarg\fRs comprising -its arguments. \fBList\fR produces slightly different results than -\fBconcat\fR: \fBconcat\fR removes one level of grouping before forming -the list, while \fBlist\fR works directly from the original arguments. -For example, the command -.CS -\fBlist a b {c d e} {f {g h}}\fR -.CE -will return -.CS -\fBa b {c d e} {f {g h}}\fR -.CE -while \fBconcat\fR with the same arguments will return -.CS -\fBa b c d e f {g h}\fR -.CE - -.SH KEYWORDS -element, list diff --git a/doc/llength.n b/doc/llength.n deleted file mode 100644 index 1a58fb7..0000000 --- a/doc/llength.n +++ /dev/null @@ -1,26 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: llength.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH llength n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -llength \- Count the number of elements in a list -.SH SYNOPSIS -\fBllength \fIlist\fR -.BE - -.SH DESCRIPTION -.PP -Treats \fIlist\fR as a list and returns a decimal string giving -the number of elements in it. - -.SH KEYWORDS -element, list, length diff --git a/doc/load.n b/doc/load.n deleted file mode 100644 index 9d3e1eb..0000000 --- a/doc/load.n +++ /dev/null @@ -1,120 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: load.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH load n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -load \- Load machine code and initialize new commands. -.SH SYNOPSIS -\fBload \fIfileName\fR -.br -\fBload \fIfileName packageName\fR -.br -\fBload \fIfileName packageName interp\fR -.BE - -.SH DESCRIPTION -.PP -This command loads binary code from a file into the -application's address space and calls an initialization procedure -in the package to incorporate it into an interpreter. \fIfileName\fR -is the name of the file containing the code; its exact form varies -from system to system but on most systems it is a shared library, -such as a \fB.so\fR file under Solaris or a DLL under Windows. -\fIpackageName\fR is the name of the package, and is used to -compute the name of an initialization procedure. -\fIinterp\fR is the path name of the interpreter into which to load -the package (see the \fBinterp\fR manual entry for details); -if \fIinterp\fR is omitted, it defaults to the -interpreter in which the \fBload\fR command was invoked. -.PP -Once the file has been loaded into the application's address space, -one of two initialization procedures will be invoked in the new code. -Typically the initialization procedure will add new commands to a -Tcl interpreter. -The name of the initialization procedure is determined by -\fIpackageName\fR and whether or not the target interpreter -is a safe one. For normal interpreters the name of the initialization -procedure will have the form \fIpkg\fB_Init\fR, where \fIpkg\fR -is the same as \fIpackageName\fR except that the first letter is -converted to upper case and all other letters -are converted to lower case. For example, if \fIpackageName\fR is -\fBfoo\fR or \fBFOo\fR, the initialization procedure's name will -be \fBFoo_Init\fR. -.PP -If the target interpreter is a safe interpreter, then the name -of the initialization procedure will be \fIpkg\fB_SafeInit\fR -instead of \fIpkg\fB_Init\fR. -The \fIpkg\fB_SafeInit\fR function should be written carefully, so that it -initializes the safe interpreter only with partial functionality provided -by the package that is safe for use by untrusted code. For more information -on Safe\-Tcl, see the \fBsafe\fR manual entry. -.PP -The initialization procedure must match the following prototype: -.CS -typedef int Tcl_PackageInitProc(Tcl_Interp *\fIinterp\fR); -.CE -The \fIinterp\fR argument identifies the interpreter in which the -package is to be loaded. The initialization procedure must return -\fBTCL_OK\fR or \fBTCL_ERROR\fR to indicate whether or not it completed -successfully; in the event of an error it should set \fIinterp->result\fR -to point to an error message. The result of the \fBload\fR command -will be the result returned by the initialization procedure. -.PP -The actual loading of a file will only be done once for each \fIfileName\fR -in an application. If a given \fIfileName\fR is loaded into multiple -interpreters, then the first \fBload\fR will load the code and -call the initialization procedure; subsequent \fBload\fRs will -call the initialization procedure without loading the code again. -It is not possible to unload or reload a package. -.PP -The \fBload\fR command also supports packages that are statically -linked with the application, if those packages have been registered -by calling the \fBTcl_StaticPackage\fR procedure. -If \fIfileName\fR is an empty string, then \fIpackageName\fR must -be specified. -.PP -If \fIpackageName\fR is omitted or specified as an empty string, -Tcl tries to guess the name of the package. -This may be done differently on different platforms. -The default guess, which is used on most UNIX platforms, is to -take the last element of \fIfileName\fR, strip off the first -three characters if they are \fBlib\fR, and use any following -.VS -alphabetic and underline characters as the module name. -.VE -For example, the command \fBload libxyz4.2.so\fR uses the module -name \fBxyz\fR and the command \fBload bin/last.so {}\fR uses the -module name \fBlast\fR. -.VS "" br -.PP -If \fIfileName\fR is an empty string, then \fIpackageName\fR must -be specified. -The \fBload\fR command first searches for a statically loaded package -(one that has been registered by calling the \fBTcl_StaticPackage\fR -procedure) by that name; if one is found, it is used. -Otherwise, the \fBload\fR command searches for a dynamically loaded -package by that name, and uses it if it is found. If several -different files have been \fBload\fRed with different versions of -the package, Tcl picks the file that was loaded first. -.VE - -.SH BUGS -.PP -If the same file is \fBload\fRed by different \fIfileName\fRs, it will -be loaded into the process's address space multiple times. The -behavior of this varies from system to system (some systems may -detect the redundant loads, others may not). - -.SH "SEE ALSO" -\fBinfo sharedlibextension\fR, Tcl_StaticPackage, safe(n) - -.SH KEYWORDS -binary code, loading, safe interpreter, shared library diff --git a/doc/lrange.n b/doc/lrange.n deleted file mode 100644 index 45d671d..0000000 --- a/doc/lrange.n +++ /dev/null @@ -1,39 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: lrange.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH lrange n 7.4 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -lrange \- Return one or more adjacent elements from a list -.SH SYNOPSIS -\fBlrange \fIlist first last\fR -.BE - -.SH DESCRIPTION -.PP -\fIList\fR must be a valid Tcl list. This command will -return a new list consisting of elements -\fIfirst\fR through \fIlast\fR, inclusive. -\fIFirst\fR or \fIlast\fR -may be \fBend\fR (or any abbreviation of it) to refer to the last -element of the list. -If \fIfirst\fR is less than zero, it is treated as if it were zero. -If \fIlast\fR is greater than or equal to the number of elements -in the list, then it is treated as if it were \fBend\fR. -If \fIfirst\fR is greater than \fIlast\fR then an empty string -is returned. -Note: ``\fBlrange \fIlist first first\fR'' does not always produce the -same result as ``\fBlindex \fIlist first\fR'' (although it often does -for simple fields that aren't enclosed in braces); it does, however, -produce exactly the same results as ``\fBlist [lindex \fIlist first\fB]\fR'' - -.SH KEYWORDS -element, list, range, sublist diff --git a/doc/lreplace.n b/doc/lreplace.n deleted file mode 100644 index 9977a90..0000000 --- a/doc/lreplace.n +++ /dev/null @@ -1,43 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: lreplace.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH lreplace n 7.4 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -lreplace \- Replace elements in a list with new elements -.SH SYNOPSIS -\fBlreplace \fIlist first last \fR?\fIelement element ...\fR? -.BE - -.SH DESCRIPTION -.PP -\fBLreplace\fR returns a new list formed by replacing one or more elements of -\fIlist\fR with the \fIelement\fR arguments. -\fIFirst\fR gives the index in \fIlist\fR of the first element -to be replaced (0 refers to the first element). -If \fIfirst\fR is less than zero then it refers to the first -element of \fIlist\fR; the element indicated by \fIfirst\fR -must exist in the list. -\fILast\fR gives the index in \fIlist\fR of the last element -to be replaced. -If \fIlast\fR is less than \fIfirst\fR then no elements are deleted; -the new elements are simply inserted before \fIfirst\fR. -\fIFirst\fR or \fIlast\fR may be \fBend\fR -(or any abbreviation of it) to refer to the last element of the list. -The \fIelement\fR arguments specify zero or more new arguments to -be added to the list in place of those that were deleted. -Each \fIelement\fR argument will become a separate element of -the list. -If no \fIelement\fR arguments are specified, then the elements -between \fIfirst\fR and \fIlast\fR are simply deleted. - -.SH KEYWORDS -element, list, replace diff --git a/doc/lsearch.n b/doc/lsearch.n deleted file mode 100644 index bcede70..0000000 --- a/doc/lsearch.n +++ /dev/null @@ -1,45 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: lsearch.n,v 1.2 1998/09/14 18:39:53 stanton Exp $ -'\" -.so man.macros -.TH lsearch n 7.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -lsearch \- See if a list contains a particular element -.SH SYNOPSIS -\fBlsearch \fR?\fImode\fR? \fIlist pattern\fR -.BE - -.SH DESCRIPTION -.PP -This command searches the elements of \fIlist\fR to see if one -of them matches \fIpattern\fR. -If so, the command returns the index of the first matching -element. -If not, the command returns \fB\-1\fR. -The \fImode\fR argument indicates how the elements of the list are to -be matched against \fIpattern\fR and it must have one of the following -values: -.TP -\fB\-exact\fR -The list element must contain exactly the same string as \fIpattern\fR. -.TP -\fB\-glob\fR -\fIPattern\fR is a glob-style pattern which is matched against each list -element using the same rules as the \fBstring match\fR command. -.TP -\fB\-regexp\fR -\fIPattern\fR is treated as a regular expression and matched against -each list element using the same rules as the \fBregexp\fR command. -.PP -If \fImode\fR is omitted then it defaults to \fB\-glob\fR. - -.SH KEYWORDS -list, match, pattern, regular expression, search, string diff --git a/doc/lsort.n b/doc/lsort.n deleted file mode 100644 index bc0b658..0000000 --- a/doc/lsort.n +++ /dev/null @@ -1,89 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 1999 Scriptics Corporation -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: lsort.n,v 1.4 1999/02/05 01:49:03 stanton Exp $ -'\" -.so man.macros -.TH lsort n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -lsort \- Sort the elements of a list -.SH SYNOPSIS -\fBlsort \fR?\fIoptions\fR? \fIlist\fR -.BE - -.SH DESCRIPTION -.PP -This command sorts the elements of \fIlist\fR, returning a new -list in sorted order. The implementation of the \fBlsort\fR command -uses the merge\-sort algorithm which is a stable sort that has O(n log -n) performance characteristics. -.PP -By default ASCII sorting is used with the result returned in -increasing order. However, any of the following options may be -specified before \fIlist\fR to control the sorting process (unique -abbreviations are accepted): -.TP 20 -\fB\-ascii\fR -Use string comparison with ASCII collation order. This is -the default. -.VS 8.0 br -.TP 20 -\fB\-dictionary\fR -Use dictionary-style comparison. This is the same as \fB\-ascii\fR -except (a) case is ignored except as a tie-breaker and (b) if two -strings contain embedded numbers, the numbers compare as integers, -not characters. For example, in \fB\-dictionary\fR mode, \fBbigBoy\fR -sorts between \fBbigbang\fR and \fBbigboy\fR, and \fBx10y\fR -sorts between \fBx9y\fR and \fBx11y\fR. -.VE -.TP 20 -\fB\-integer\fR -Convert list elements to integers and use integer comparison. -.TP 20 -\fB\-real\fR -Convert list elements to floating-point values and use floating -comparison. -.TP 20 -\fB\-command\0\fIcommand\fR -Use \fIcommand\fR as a comparison command. -To compare two elements, evaluate a Tcl script consisting of -\fIcommand\fR with the two elements appended as additional -arguments. The script should return an integer less than, -equal to, or greater than zero if the first element is to -be considered less than, equal to, or greater than the second, -respectively. -.TP 20 -\fB\-increasing\fR -Sort the list in increasing order (``smallest'' items first). -This is the default. -.TP 20 -\fB\-decreasing\fR -Sort the list in decreasing order (``largest'' items first). -.VS 8.0 br -.TP 20 -\fB\-index\0\fIindex\fR -If this option is specified, each of the elements of \fIlist\fR must -itself be a proper Tcl sublist. Instead of sorting based on whole sublists, -\fBlsort\fR will extract the \fIindex\fR'th element from each sublist -and sort based on the given element. The keyword \fBend\fP is allowed -for the \fIindex\fP to sort on the last sublist element. For example, -.RS -.CS -lsort -integer -index 1 {{First 24} {Second 18} {Third 30}} -.CE -returns \fB{Second 18} {First 24} {Third 30}\fR. -This option is much more efficient than using \fB\-command\fR -to achieve the same effect. -.RE -.VE - - -.SH KEYWORDS -element, list, order, sort diff --git a/doc/man.macros b/doc/man.macros deleted file mode 100644 index bdf69ff..0000000 --- a/doc/man.macros +++ /dev/null @@ -1,236 +0,0 @@ -'\" The definitions below are for supplemental macros used in Tcl/Tk -'\" manual entries. -'\" -'\" .AP type name in/out ?indent? -'\" Start paragraph describing an argument to a library procedure. -'\" type is type of argument (int, etc.), in/out is either "in", "out", -'\" or "in/out" to describe whether procedure reads or modifies arg, -'\" and indent is equivalent to second arg of .IP (shouldn't ever be -'\" needed; use .AS below instead) -'\" -'\" .AS ?type? ?name? -'\" Give maximum sizes of arguments for setting tab stops. Type and -'\" name are examples of largest possible arguments that will be passed -'\" to .AP later. If args are omitted, default tab stops are used. -'\" -'\" .BS -'\" Start box enclosure. From here until next .BE, everything will be -'\" enclosed in one large box. -'\" -'\" .BE -'\" End of box enclosure. -'\" -'\" .CS -'\" Begin code excerpt. -'\" -'\" .CE -'\" End code excerpt. -'\" -'\" .VS ?version? ?br? -'\" Begin vertical sidebar, for use in marking newly-changed parts -'\" of man pages. The first argument is ignored and used for recording -'\" the version when the .VS was added, so that the sidebars can be -'\" found and removed when they reach a certain age. If another argument -'\" is present, then a line break is forced before starting the sidebar. -'\" -'\" .VE -'\" End of vertical sidebar. -'\" -'\" .DS -'\" Begin an indented unfilled display. -'\" -'\" .DE -'\" End of indented unfilled display. -'\" -'\" .SO -'\" Start of list of standard options for a Tk widget. The -'\" options follow on successive lines, in four columns separated -'\" by tabs. -'\" -'\" .SE -'\" End of list of standard options for a Tk widget. -'\" -'\" .OP cmdName dbName dbClass -'\" Start of description of a specific option. cmdName gives the -'\" option's name as specified in the class command, dbName gives -'\" the option's name in the option database, and dbClass gives -'\" the option's class in the option database. -'\" -'\" .UL arg1 arg2 -'\" Print arg1 underlined, then print arg2 normally. -'\" -'\" RCS: @(#) $Id: man.macros,v 1.3 1999/04/16 00:46:35 stanton Exp $ -'\" -'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. -.if t .wh -1.3i ^B -.nr ^l \n(.l -.ad b -'\" # Start an argument description -.de AP -.ie !"\\$4"" .TP \\$4 -.el \{\ -. ie !"\\$2"" .TP \\n()Cu -. el .TP 15 -.\} -.ta \\n()Au \\n()Bu -.ie !"\\$3"" \{\ -\&\\$1 \\fI\\$2\\fP (\\$3) -.\".b -.\} -.el \{\ -.br -.ie !"\\$2"" \{\ -\&\\$1 \\fI\\$2\\fP -.\} -.el \{\ -\&\\fI\\$1\\fP -.\} -.\} -.. -'\" # define tabbing values for .AP -.de AS -.nr )A 10n -.if !"\\$1"" .nr )A \\w'\\$1'u+3n -.nr )B \\n()Au+15n -.\" -.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n -.nr )C \\n()Bu+\\w'(in/out)'u+2n -.. -.AS Tcl_Interp Tcl_CreateInterp in/out -'\" # BS - start boxed text -'\" # ^y = starting y location -'\" # ^b = 1 -.de BS -.br -.mk ^y -.nr ^b 1u -.if n .nf -.if n .ti 0 -.if n \l'\\n(.lu\(ul' -.if n .fi -.. -'\" # BE - end boxed text (draw box now) -.de BE -.nf -.ti 0 -.mk ^t -.ie n \l'\\n(^lu\(ul' -.el \{\ -.\" Draw four-sided box normally, but don't draw top of -.\" box if the box started on an earlier page. -.ie !\\n(^b-1 \{\ -\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' -.\} -.el \}\ -\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' -.\} -.\} -.fi -.br -.nr ^b 0 -.. -'\" # VS - start vertical sidebar -'\" # ^Y = starting y location -'\" # ^v = 1 (for troff; for nroff this doesn't matter) -.de VS -.if !"\\$2"" .br -.mk ^Y -.ie n 'mc \s12\(br\s0 -.el .nr ^v 1u -.. -'\" # VE - end of vertical sidebar -.de VE -.ie n 'mc -.el \{\ -.ev 2 -.nf -.ti 0 -.mk ^t -\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' -.sp -1 -.fi -.ev -.\} -.nr ^v 0 -.. -'\" # Special macro to handle page bottom: finish off current -'\" # box/sidebar if in box/sidebar mode, then invoked standard -'\" # page bottom macro. -.de ^B -.ev 2 -'ti 0 -'nf -.mk ^t -.if \\n(^b \{\ -.\" Draw three-sided box if this is the box's first page, -.\" draw two sides but no top otherwise. -.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c -.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c -.\} -.if \\n(^v \{\ -.nr ^x \\n(^tu+1v-\\n(^Yu -\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c -.\} -.bp -'fi -.ev -.if \\n(^b \{\ -.mk ^y -.nr ^b 2 -.\} -.if \\n(^v \{\ -.mk ^Y -.\} -.. -'\" # DS - begin display -.de DS -.RS -.nf -.sp -.. -'\" # DE - end display -.de DE -.fi -.RE -.sp -.. -'\" # SO - start of list of standard options -.de SO -.SH "STANDARD OPTIONS" -.LP -.nf -.ta 4c 8c 12c -.ft B -.. -'\" # SE - end of list of standard options -.de SE -.fi -.ft R -.LP -See the \\fBoptions\\fR manual entry for details on the standard options. -.. -'\" # OP - start of full description for a single option -.de OP -.LP -.nf -.ta 4c -Command-Line Name: \\fB\\$1\\fR -Database Name: \\fB\\$2\\fR -Database Class: \\fB\\$3\\fR -.fi -.IP -.. -'\" # CS - begin code excerpt -.de CS -.RS -.nf -.ta .25i .5i .75i 1i -.. -'\" # CE - end code excerpt -.de CE -.fi -.RE -.. -.de UL -\\$1\l'|0\(ul'\\$2 -.. diff --git a/doc/msgcat.n b/doc/msgcat.n deleted file mode 100644 index e04d2a6..0000000 --- a/doc/msgcat.n +++ /dev/null @@ -1,207 +0,0 @@ -'\" -'\" Copyright (c) 1998 Mark Harrison. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) msgcat.n -'\" -.so man.macros -.TH "msgcat" n 8.1 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -msgcat \- Tcl message catalog -.SH SYNOPSIS -\fB::msgcat::mc src-string\fR -.sp -\fB::msgcat::mclocale \fR?\fInewLocale\fR? -.sp -\fB::msgcat::mcpreferences\fR -.sp -\fB::msgcat::mcload \fIdirname\fR -.sp -\fB::msgcat::mcset \fIlocale src-string \fR?\fItranslate-string\fR? -.sp -\fB::msgcat::mcunknown \fIlocale src-string\fR -.BE - -.SH DESCRIPTION -.PP -The \fBmsgcat\fR package provides a set of functions -that can be used to manage multi-lingual user interfaces. -Text strings are defined in a ``message catalog'' which -is independent from the application, and -which can be edited or localized without modifying -the application source code. New languages -or locales are provided by adding a new file to -the message catalog. -.PP -Use of the message catalog is optional by any application -or package, but is encouraged if the application or package -wishes to be enabled for multi-lingual applications. - -.SH COMMANDS -.TP -\fB::msgcat::mc src-string\fR -Returns a translation of \fIsrc-string\fR according to the -user's current locale. If no translation string -exists, \fB::msgcat::mcunknown\fR is called and the string -returned from \fB::msgcat::mcunknown\fR is returned. -.PP -\fB::msgcat::mc\fR is the main function used to localize an -application. Instead of using an English string directly, an -applicaton can pass the English string through \fB::msgcat::mc\fR and -use the result. If an application is written for a single language in -this fashion, then it is easy to add support for additional languages -later simply by defining new message catalog entries. -.TP -\fB::msgcat::mclocale \fR?\fInewLocale\fR? -This function sets the locale to \fInewLocale\fR. If \fInewLocale\fR -is omitted, the current locale is returned, otherwise the new locale -is returned. The initial locale defaults to the locale specified in -the user's environment. See \fBLOCALE AND SUBLOCALE SPECIFICATION\fR -below for a description of the locale string format. -.TP -\fB::msgcat::mcpreferences\fR -Returns an ordered list of the locales preferred by -the user, based on the user's language specification. -The list is ordered from most specific to least -preference. If the user has specified LANG=en_US_funky, -this procedure would return {en_US_funky en_US en}. -.TP -\fB::msgcat::mcload \fIdirname\fR -Searches the specified directory for files that match -the language specifications returned by \fB::msgcat::mcpreferences\fR. -Each file located is sourced. The file extension is ``.msg''. -The number of message files which matched the specification -and were loaded is returned. -.TP -\fB::msgcat::mcset \fIlocale src-string \fR?\fItranslate-string\fR? -Sets the translation for \fIsrc-string\fR to \fItranslate-string\fR -in the specified \fIlocale\fR. If \fItranslate-string\fR is not -specified, \fIsrc-string\fR is used for both. The function -return \fItranslate-string\fR. -.TP -\fB::msgcat::mcunknown \fIlocale src-string\fR -This routine is called by \fB::msgcat::mc\fR in the case when -a translation for \fIsrc-string\fR is not defined in the -current locale. The default action is to return -\fIsrc-string\fR. This procedure can be redefined by the -application, for example to log error messages for each unknown -string. The \fB::msgcat::mcunknown\fB procedure is invoked at the -same stack context as the call to \fB::msgcat::mc\fR. The return vaue -of \fB::msgcat::mcunknown\fB is used as the return vaue for the call -to \fB::msgcat::mc\fR. - -.SH "LOCALE AND SUBLOCALE SPECIFICATION" -.PP -The locale is specified by a locale string. -The locale string consists of -a language code, an optional country code, and an optional -system-specific code, each separated by ``_''. The country and language -codes are specified in standards ISO-639 and ISO-3166. -For example, the locale ``en'' specifies English and - ``en_US'' specifes U.S. English. -.PP -The locale defaults to the value in \fBenv(LANG)\fR at the time the -\fBmsgcat\fR package is loaded. If \fBenv(LANG)\fR is not defined, then the -locale defaults to ``C''. -.PP -When a locale is specified by the user, a ``best match'' search is -performed during string translation. For example, if a user specifies -en_UK_Funky, the locales ``en_UK_Funky'', ``en_UK'', and ``en'' are -searched in order until a matching translation string is found. If no -translation string is available, then \fB::msgcat::unknown\fR is -called. - -.SH "NAMESPACES AND MESSAGE CATALOGS" -.PP -Strings stored in the message catalog are stored relative -to the namespace from which they were added. This allows -multiple packages to use the same strings without fear -of collisions with other packages. It also allows the -source string to be shorter and less prone to typographical -error. -.PP -For example, executing the code -.CS -mcset en hello "hello from ::" -namespace eval foo {mcset en hello "hello from ::foo"} -puts [mc hello] -namespace eval foo {puts [mc hello]} -.CE -will print -.CS -hello from :: -hello from ::foo -.CE - -.SH "LOCATION AND FORMAT OF MESSAGE FILES" -.PP -Message files can be located in any directory, subject -to the following conditions: -.IP [1] -All message files for a package are in the same directory. -.IP [2] -The message file name is a locale specifier followed -by ``.msg''. For example: -.CS -es.msg -- spanish -en_UK.msg -- UK English -.CE -.IP [3] -The file contains a series of calls to mcset, setting the -necessary translation strings for the language. For example: -.CS -::msgcat::mcset es "Free Beer!" "Cerveza Gracias!" -.CE - -.SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" -.PP -If a package is installed into a subdirectory of the -\fBtcl_pkgPath\fR and loaded via \fBpackage require\fR, the -following procedure is recommended. -.IP [1] -During package installation, create a subdirectory -\fBmsgs\fR under your package directory. -.IP [2] -Copy your *.msg files into that directory. -.IP [3] - Add the following command to your package -initialization script: -.CS -# load language files, stored in msgs subdirectory -::msgcat::mcload [file join [file dirname [info script]] msgs] -.CE - -.SH "POSTITIONAL CODES FOR FORMAT AND SCAN COMMANDS" -.PP -It is possible that a message string used as an argument -to \fBformat\fR might have positionally dependent parameters that -might need to be repositioned. For example, it might be -syntactically desirable to rearrange the sentence structure -while translating. -.CS -format "We produced %d units in location %s" $num $city -format "In location %s we produced %d units" $city $num -.CE -.PP -This can be handled by using the positional -parameters: -.CS -format "We produced %1\\\\$d units in location %2\\\\$s" $num $city -format "In location %2\\\\$s we produced %1\\\\$d units" $num $city -.CE -.PP -Similarly, positional parameters can be used with \fBscan\fR to -extract values from internationalized strings. - -.SH "SEE ALSO" -format(n), scan(n), namespace(n), package(n) - -.SH CREDITS -.PP -The message catalog code was developed by Mark Harrison. -.SH KEYWORDS -internationalization, i18n, localization, l10n, message, text, translation diff --git a/doc/namespace.n b/doc/namespace.n deleted file mode 100644 index eeb45f5..0000000 --- a/doc/namespace.n +++ /dev/null @@ -1,563 +0,0 @@ -'\" -'\" Copyright (c) 1993-1997 Bell Labs Innovations for Lucent Technologies -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: namespace.n,v 1.3 1999/04/16 00:46:35 stanton Exp $ -'\" -.so man.macros -.TH namespace n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -namespace \- create and manipulate contexts for commands and variables -.SH SYNOPSIS -\fBnamespace \fR?\fIoption\fR? ?\fIarg ...\fR? -.BE - -.SH DESCRIPTION -.PP -The \fBnamespace\fR command lets you create, access, and destroy -separate contexts for commands and variables. -See the section \fBWHAT IS A NAMESPACE?\fR below -for a brief overview of namespaces. -The legal \fIoption\fR's are listed below. -Note that you can abbreviate the \fIoption\fR's. -.TP -\fBnamespace children \fR?\fInamespace\fR? ?\fIpattern\fR? -Returns a list of all child namespaces that belong to the -namespace \fInamespace\fR. -If \fInamespace\fR is not specified, -then the children are returned for the current namespace. -This command returns fully-qualified names, -which start with \fB::\fR. -If the optional \fIpattern\fR is given, -then this command returns only the names that match the glob-style pattern. -The actual pattern used is determined as follows: -a pattern that starts with \fB::\fR is used directly, -otherwise the namespace \fInamespace\fR -(or the fully-qualified name of the current namespace) -is prepended onto the the pattern. -.TP -\fBnamespace code \fIscript\fR -Captures the current namespace context for later execution -of the script \fIscript\fR. -It returns a new script in which \fIscript\fR has been wrapped -in a \fBnamespace code\fR command. -The new script has two important properties. -First, it can be evaluated in any namespace and will cause -\fIscript\fR to be evaluated in the current namespace -(the one where the \fBnamespace code\fR command was invoked). -Second, additional arguments can be appended to the resulting script -and they will be passed to \fIscript\fR as additional arguments. -For example, suppose the command -\fBset script [namespace code {foo bar}]\fR -is invoked in namespace \fB::a::b\fR. -Then \fBeval "$script x y"\fR -can be executed in any namespace (assuming the value of -\fBscript\fR has been passed in properly) -and will have the same effect as the command -\fBnamespace eval ::a::b {foo bar x y}\fR. -This command is needed because -extensions like Tk normally execute callback scripts -in the global namespace. -A scoped command captures a command together with its namespace context -in a way that allows it to be executed properly later. -See the section \fBSCOPED VALUES\fR for some examples -of how this is used to create callback scripts. -.TP -\fBnamespace current\fR -Returns the fully-qualified name for the current namespace. -The actual name of the global namespace is ``'' -(i.e., an empty string), -but this command returns \fB::\fR for the global namespace -as a convenience to programmers. -.TP -\fBnamespace delete \fR?\fInamespace namespace ...\fR? -Each namespace \fInamespace\fR is deleted -and all variables, procedures, and child namespaces -contained in the namespace are deleted. -If a procedure is currently executing inside the namespace, -the namespace will be kept alive until the procedure returns; -however, the namespace is marked to prevent other code from -looking it up by name. -If a namespace doesn't exist, this command returns an error. -If no namespace names are given, this command does nothing. -.TP -\fBnamespace eval\fR \fInamespace arg\fR ?\fIarg ...\fR? -Activates a namespace called \fInamespace\fR and evaluates some code -in that context. -If the namespace does not already exist, it is created. -If more than one \fIarg\fR argument is specified, -the arguments are concatenated together with a space between each one -in the same fashion as the \fBeval\fR command, -and the result is evaluated. -.br -.sp -If \fInamespace\fR has leading namespace qualifiers -and any leading namespaces do not exist, -they are automatically created. -.TP -\fBnamespace export \fR?\-\fBclear\fR? ?\fIpattern pattern ...\fR? -Specifies which commands are exported from a namespace. -The exported commands are those that can be later imported -into another namespace using a \fBnamespace import\fR command. -Both commands defined in a namespace and -commands the namespace has previously imported -can be exported by a namespace. -The commands do not have to be defined -at the time the \fBnamespace export\fR command is executed. -Each \fIpattern\fR may contain glob-style special characters, -but it may not include any namespace qualifiers. -That is, the pattern can only specify commands -in the current (exporting) namespace. -Each \fIpattern\fR is appended onto the namespace's list of export patterns. -If the \-\fBclear\fR flag is given, -the namespace's export pattern list is reset to empty before any -\fIpattern\fR arguments are appended. -If no \fIpattern\fRs are given and the \-\fBclear\fR flag isn't given, -this command returns the namespace's current export list. -.TP -\fBnamespace forget \fR?\fIpattern pattern ...\fR? -Removes previously imported commands from a namespace. -Each \fIpattern\fR is a qualified name such as -\fBfoo::x\fR or \fBa::b::p*\fR. -Qualified names contain \fB::\fRs and qualify a name -with the name of one or more namespaces. -Each \fIpattern\fR is qualified with the name of an exporting namespace -and may have glob-style special characters in the command name -at the end of the qualified name. -Glob characters may not appear in a namespace name. -This command first finds the matching exported commands. -It then checks whether any of those those commands -were previously imported by the current namespace. -If so, this command deletes the corresponding imported commands. -In effect, this un-does the action of a \fBnamespace import\fR command. -.TP -\fBnamespace import \fR?\fB\-force\fR? ?\fIpattern\fR \fIpattern ...\fR? -Imports commands into a namespace. -Each \fIpattern\fR is a qualified name like -\fBfoo::x\fR or \fBa::p*\fR. -That is, it includes the name of an exporting namespace -and may have glob-style special characters in the command name -at the end of the qualified name. -Glob characters may not appear in a namespace name. -All the commands that match a \fIpattern\fR string -and which are currently exported from their namespace -are added to the current namespace. -This is done by creating a new command in the current namespace -that points to the exported command in its original namespace; -when the new imported command is called, it invokes the exported command. -This command normally returns an error -if an imported command conflicts with an existing command. -However, if the \-\fBforce\fR option is given, -imported commands will silently replace existing commands. -The \fBnamespace import\fR command has snapshot semantics: -that is, only requested commands that are currently defined -in the exporting namespace are imported. -In other words, you can import only the commands that are in a namespace -at the time when the \fBnamespace import\fR command is executed. -If another command is defined and exported in this namespace later on, -it will not be imported. -.TP -\fBnamespace inscope\fR \fInamespace arg\fR ?\fIarg ...\fR? -Executes a script in the context of a particular namespace. -This command is not expected to be used directly by programmers; -calls to it are generated implicitly when applications -use \fBnamespace code\fR commands to create callback scripts -that the applications then register with, e.g., Tk widgets. -The \fBnamespace inscope\fR command is much like the \fBnamespace eval\fR -command except that it has \fBlappend\fR semantics -and the namespace must already exist. -It treats the first argument as a list, -and appends any arguments after the first -onto the end as proper list elements. -\fBnamespace inscope ::foo a x y z\fR -is equivalent to -\fBnamespace eval ::foo [concat a [list x y z]]\fR -This \fBlappend\fR semantics is important because many callback scripts -are actually prefixes. -.TP -\fBnamespace origin \fIcommand\fR -Returns the fully-qualified name of the original command -to which the imported command \fIcommand\fR refers. -When a command is imported into a namespace, -a new command is created in that namespace -that points to the actual command in the exporting namespace. -If a command is imported into a sequence of namespaces -\fIa, b,...,n\fR where each successive namespace -just imports the command from the previous namespace, -this command returns the fully-qualified name of the original command -in the first namespace, \fIa\fR. -If \fIcommand\fR does not refer to an imported command, -the command's own fully-qualified name is returned. -.TP -\fBnamespace parent\fR ?\fInamespace\fR? -Returns the fully-qualified name of the parent namespace -for namespace \fInamespace\fR. -If \fInamespace\fR is not specified, -the fully-qualified name of the current namespace's parent is returned. -.TP -\fBnamespace qualifiers\fR \fIstring\fR -Returns any leading namespace qualifiers for \fIstring\fR. -Qualifiers are namespace names separated by \fB::\fRs. -For the \fIstring\fR \fB::foo::bar::x\fR, -this command returns \fB::foo::bar\fR, -and for \fB::\fR it returns \fB``''\fR (an empty string). -This command is the complement of the \fBnamespace tail\fR command. -Note that it does not check whether the -namespace names are, in fact, -the names of currently defined namespaces. -.TP -\fBnamespace tail\fR \fIstring\fR -Returns the simple name at the end of a qualified string. -Qualifiers are namespace names separated by \fB::\fRs. -For the \fIstring\fR \fB::foo::bar::x\fR, -this command returns \fBx\fR, -and for \fB::\fR it returns \fB``''\fR (an empty string). -This command is the complement of the \fBnamespace qualifiers\fR command. -It does not check whether the namespace names are, in fact, -the names of currently defined namespaces. -.TP -\fBnamespace which\fR ?\-\fBcommand\fR? ?\-\fBvariable\fR? \fIname\fR -Looks up \fIname\fR as either a command or variable -and returns its fully-qualified name. -For example, if \fIname\fR does not exist in the current namespace -but does exist in the global namespace, -this command returns a fully-qualified name in the global namespace. -If the command or variable does not exist, -this command returns an empty string. -If no flag is given, \fIname\fR is treated as a command name. -See the section \fBNAME RESOLUTION\fR below for an explanation of -the rules regarding name resolution. - -.SH "WHAT IS A NAMESPACE?" -.PP -A namespace is a collection of commands and variables. -It encapsulates the commands and variables to ensure that they -won't interfere with the commands and variables of other namespaces. -Tcl has always had one such collection, -which we refer to as the \fIglobal namespace\fR. -The global namespace holds all global variables and commands. -The \fBnamespace eval\fR command lets you create new namespaces. -For example, -.CS -\fBnamespace eval Counter { - namespace export bump - variable num 0 - - proc bump {} { - variable num - incr num - } -}\fR -.CE -creates a new namespace containing the variable \fBnum\fR and -the procedure \fBbump\fR. -The commands and variables in this namespace are separate from -other commands and variables in the same program. -If there is a command named \fBbump\fR in the global namespace, -for example, it will be different from the command \fBbump\fR -in the \fBCounter\fR namespace. -.PP -Namespace variables resemble global variables in Tcl. -They exist outside of the procedures in a namespace -but can be accessed in a procedure via the \fBvariable\fR command, -as shown in the example above. -.PP -Namespaces are dynamic. -You can add and delete commands and variables at any time, -so you can build up the contents of a -namespace over time using a series of \fBnamespace eval\fR commands. -For example, the following series of commands has the same effect -as the namespace definition shown above: -.CS -\fBnamespace eval Counter { - variable num 0 - proc bump {} { - variable num - return [incr num] - } -} -namespace eval Counter { - proc test {args} { - return $args - } -} -namespace eval Counter { - rename test "" -}\fR -.CE -Note that the \fBtest\fR procedure is added to the \fBCounter\fR namespace, -and later removed via the \fBrename\fR command. -.PP -Namespaces can have other namespaces within them, -so they nest hierarchically. -A nested namespace is encapsulated inside its parent namespace -and can not interfere with other namespaces. - -.SH "QUALIFIED NAMES" -.PP -Each namespace has a textual name such as -\fBhistory\fR or \fB::safe::interp\fR. -Since namespaces may nest, -qualified names are used to refer to -commands, variables, and child namespaces contained inside namespaces. -Qualified names are similar to the hierarchical path names for -Unix files or Tk widgets, -except that \fB::\fR is used as the separator -instead of \fB/\fR or \fB.\fR. -The topmost or global namespace has the name ``'' (i.e., an empty string), -although \fB::\fR is a synonym. -As an example, the name \fB::safe::interp::create\fR -refers to the command \fBcreate\fR in the namespace \fBinterp\fR -that is a child of of namespace \fB::safe\fR, -which in turn is a child of the global namespace \fB::\fR. -.PP -If you want to access commands and variables from another namespace, -you must use some extra syntax. -Names must be qualified by the namespace that contains them. -From the global namespace, -we might access the \fBCounter\fR procedures like this: -.CS -\fBCounter::bump 5 -Counter::Reset\fR -.CE -We could access the current count like this: -.CS -\fBputs "count = $Counter::num"\fR -.CE -When one namespace contains another, you may need more than one -qualifier to reach its elements. -If we had a namespace \fBFoo\fR that contained the namespace \fBCounter\fR, -you could invoke its \fBbump\fR procedure -from the global namespace like this: -.CS -\fBFoo::Counter::bump 3\fR -.CE -.PP -You can also use qualified names when you create and rename commands. -For example, you could add a procedure to the \fBFoo\fR -namespace like this: -.CS -\fBproc Foo::Test {args} {return $args}\fR -.CE -And you could move the same procedure to another namespace like this: -.CS -\fBrename Foo::Test Bar::Test\fR -.CE -.PP -There are a few remaining points about qualified names -that we should cover. -Namespaces have nonempty names except for the global namespace. -\fB::\fR is disallowed in simple command, variable, and namespace names -except as a namespace separator. -Extra \fB:\fRs in a qualified name are ignored; -that is, two or more \fB:\fRs are treated as a namespace separator. -A trailing \fB::\fR in a qualified variable or command name -refers to the variable or command named {}. -However, a trailing \fB::\fR in a qualified namespace name is ignored. - -.SH "NAME RESOLUTION" -.PP -In general, all Tcl commands that take variable and command names -support qualified names. -This means you can give qualified names to such commands as -\fBset\fR, \fBproc\fR, \fBrename\fR, and \fBinterp alias\fR. -If you provide a fully-qualified name that starts with a \fB::\fR, -there is no question about what command, variable, or namespace -you mean. -However, if the name does not start with a \fB::\fR -(i.e., is \fIrelative\fR), -Tcl follows a fixed rule for looking it up: -Command and variable names are always resolved -by looking first in the current namespace, -and then in the global namespace. -Namespace names, on the other hand, are always resolved -by looking in only the current namespace. -.PP -In the following example, -.CS -\fBset traceLevel 0 -namespace eval Debug { - printTrace $traceLevel -}\fR -.CE -Tcl looks for \fBtraceLevel\fR in the namespace \fBDebug\fR -and then in the global namespace. -It looks up the command \fBprintTrace\fR in the same way. -If a variable or command name is not found in either context, -the name is undefined. -To make this point absolutely clear, consider the following example: -.CS -\fBset traceLevel 0 -namespace eval Foo { - variable traceLevel 3 - - namespace eval Debug { - printTrace $traceLevel - } -}\fR -.CE -Here Tcl looks for \fBtraceLevel\fR first in the namespace \fBFoo::Debug\fR. -Since it is not found there, Tcl then looks for it -in the global namespace. -The variable \fBFoo::traceLevel\fR is completely ignored -during the name resolution process. -.PP -You can use the \fBnamespace which\fR command to clear up any question -about name resolution. -For example, the command: -.CS -\fBnamespace eval Foo::Debug {namespace which \-variable traceLevel}\fR -.CE -returns \fB::traceLevel\fR. -On the other hand, the command, -.CS -\fBnamespace eval Foo {namespace which \-variable traceLevel}\fR -.CE -returns \fB::Foo::traceLevel\fR. -.PP -As mentioned above, -namespace names are looked up differently -than the names of variables and commands. -Namespace names are always resolved in the current namespace. -This means, for example, -that a \fBnamespace eval\fR command that creates a new namespace -always creates a child of the current namespace -unless the new namespace name begins with a \fB::\fR. -.PP -Tcl has no access control to limit what variables, commands, -or namespaces you can reference. -If you provide a qualified name that resolves to an element -by the name resolution rule above, -you can access the element. -.PP -You can access a namespace variable -from a procedure in the same namespace -by using the \fBvariable\fR command. -Much like the \fBglobal\fR command, -this creates a local link to the namespace variable. -If necessary, it also creates the variable in the current namespace -and initializes it. -Note that the \fBglobal\fR command only creates links -to variables in the global namespace. -It is not necessary to use a \fBvariable\fR command -if you always refer to the namespace variable using an -appropriate qualified name. - -.SH "IMPORTING COMMANDS" -.PP -Namespaces are often used to represent libraries. -Some library commands are used so frequently -that it is a nuisance to type their qualified names. -For example, suppose that all of the commands in a package -like BLT are contained in a namespace called \fBBlt\fR. -Then you might access these commands like this: -.CS -\fBBlt::graph .g \-background red -Blt::table . .g 0,0\fR -.CE -If you use the \fBgraph\fR and \fBtable\fR commands frequently, -you may want to access them without the \fBBlt::\fR prefix. -You can do this by importing the commands into the current namespace, -like this: -.CS -\fBnamespace import Blt::*\fR -.CE -This adds all exported commands from the \fBBlt\fR namespace -into the current namespace context, so you can write code like this: -.CS -\fBgraph .g \-background red -table . .g 0,0\fR -.CE -The \fBnamespace import\fR command only imports commands -from a namespace that that namespace exported -with a \fBnamespace export\fR command. -.PP -Importing \fIevery\fR command from a namespace is generally -a bad idea since you don't know what you will get. -It is better to import just the specific commands you need. -For example, the command -.CS -\fBnamespace import Blt::graph Blt::table\fR -.CE -imports only the \fBgraph\fR and \fBtable\fR commands into the -current context. -.PP -If you try to import a command that already exists, you will get an -error. This prevents you from importing the same command from two -different packages. But from time to time (perhaps when debugging), -you may want to get around this restriction. You may want to -reissue the \fBnamespace import\fR command to pick up new commands -that have appeared in a namespace. In that case, you can use the -\fB\-force\fR option, and existing commands will be silently overwritten: -.CS -\fBnamespace import \-force Blt::graph Blt::table\fR -.CE -If for some reason, you want to stop using the imported commands, -you can remove them with an \fBnamespace forget\fR command, like this: -.CS -\fBnamespace forget Blt::*\fR -.CE -This searches the current namespace for any commands imported from \fBBlt\fR. -If it finds any, it removes them. Otherwise, it does nothing. -After this, the \fBBlt\fR commands must be accessed with the \fBBlt::\fR -prefix. -.PP -When you delete a command from the exporting namespace like this: -.CS -\fBrename Blt::graph ""\fR -.CE -the command is automatically removed from all namespaces that import it. - -.SH "EXPORTING COMMANDS" -You can export commands from a namespace like this: -.CS -\fBnamespace eval Counter { - namespace export bump reset - variable Num 0 - variable Max 100 - - proc bump {{by 1}} { - variable Num - incr Num $by - Check - return $Num - } - proc reset {} { - variable Num - set Num 0 - } - proc Check {} { - variable Num - variable Max - if {$Num > $Max} { - error "too high!" - } - } -}\fR -.CE -The procedures \fBbump\fR and \fBreset\fR are exported, -so they are included when you import from the \fBCounter\fR namespace, -like this: -.CS -\fBnamespace import Counter::*\fR -.CE -However, the \fBCheck\fR procedure is not exported, -so it is ignored by the import operation. -.PP -The \fBnamespace import\fR command only imports commands -that were declared as exported by their namespace. -The \fBnamespace export\fR command specifies what commands -may be imported by other namespaces. -If a \fBnamespace import\fR command specifies a command -that is not exported, the command is not imported. - -.SH "SEE ALSO" -variable(n) - -.SH KEYWORDS -exported, internal, variable diff --git a/doc/open.n b/doc/open.n deleted file mode 100644 index 03e4339..0000000 --- a/doc/open.n +++ /dev/null @@ -1,249 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: open.n,v 1.4 1999/04/16 00:46:35 stanton Exp $ -'\" -.so man.macros -.TH open n 7.6 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -open \- Open a file-based or command pipeline channel -.SH SYNOPSIS -.sp -\fBopen \fIfileName\fR -.br -\fBopen \fIfileName access\fR -.br -\fBopen \fIfileName access permissions\fR -.BE - -.SH DESCRIPTION -.PP -.VS -This command opens a file, serial port, or command pipeline and returns a -.VE -channel identifier that may be used in future invocations of commands like -\fBread\fR, \fBputs\fR, and \fBclose\fR. -If the first character of \fIfileName\fR is not \fB|\fR then -the command opens a file: -\fIfileName\fR gives the name of the file to open, and it must conform to the -conventions described in the \fBfilename\fR manual entry. -.PP -The \fIaccess\fR argument, if present, indicates the way in which the file -(or command pipeline) is to be accessed. -In the first form \fIaccess\fR may have any of the following values: -.TP 15 -\fBr\fR -Open the file for reading only; the file must already exist. This is the -default value if \fIaccess\fR is not specified. -.TP 15 -\fBr+\fR -Open the file for both reading and writing; the file must -already exist. -.TP 15 -\fBw\fR -Open the file for writing only. Truncate it if it exists. If it doesn't -exist, create a new file. -.TP 15 -\fBw+\fR -Open the file for reading and writing. Truncate it if it exists. -If it doesn't exist, create a new file. -.TP 15 -\fBa\fR -Open the file for writing only. The file must already exist, and the file -is positioned so that new data is appended to the file. -.TP 15 -\fBa+\fR -Open the file for reading and writing. If the file doesn't exist, -create a new empty file. -Set the initial access position to the end of the file. -.PP -In the second form, \fIaccess\fR consists of a list of any of the -following flags, all of which have the standard POSIX meanings. -One of the flags must be either \fBRDONLY\fR, \fBWRONLY\fR or \fBRDWR\fR. -.TP 15 -\fBRDONLY\fR -Open the file for reading only. -.TP 15 -\fBWRONLY\fR -Open the file for writing only. -.TP 15 -\fBRDWR\fR -Open the file for both reading and writing. -.TP 15 -\fBAPPEND\fR -Set the file pointer to the end of the file prior to each write. -.TP 15 -\fBCREAT\fR -Create the file if it doesn't already exist (without this flag it -is an error for the file not to exist). -.TP 15 -\fBEXCL\fR -If \fBCREAT\fR is also specified, an error is returned if the -file already exists. -.TP 15 -\fBNOCTTY\fR -If the file is a terminal device, this flag prevents the file from -becoming the controlling terminal of the process. -.TP 15 -\fBNONBLOCK\fR -Prevents the process from blocking while opening the file, and -possibly in subsequent I/O operations. The exact behavior of -this flag is system- and device-dependent; its use is discouraged -(it is better to use the \fBfconfigure\fR command to put a file -in nonblocking mode). -For details refer to your system documentation on the \fBopen\fR system -call's \fBO_NONBLOCK\fR flag. -.TP 15 -\fBTRUNC\fR -If the file exists it is truncated to zero length. -.PP -If a new file is created as part of opening it, \fIpermissions\fR -(an integer) is used to set the permissions for the new file in -conjunction with the process's file mode creation mask. -\fIPermissions\fR defaults to 0666. -.SH "COMMAND PIPELINES" -.PP -If the first character of \fIfileName\fR is ``|'' then the -remaining characters of \fIfileName\fR are treated as a list of arguments -that describe a command pipeline to invoke, in the same style as the -arguments for \fBexec\fR. -In this case, the channel identifier returned by \fBopen\fR may be used -to write to the command's input pipe or read from its output pipe, -depending on the value of \fIaccess\fR. -If write-only access is used (e.g. \fIaccess\fR is \fBw\fR), then -standard output for the pipeline is directed to the current standard -output unless overridden by the command. -If read-only access is used (e.g. \fIaccess\fR is \fBr\fR), -standard input for the pipeline is taken from the current standard -input unless overridden by the command. -.SH "SERIAL COMMUNICATIONS" -.VS -.PP -If \fIfileName\fR refers to a serial port, then the specified serial port -is opened and initialized in a platform-dependent manner. Acceptable -values for the \fIfileName\fR to use to open a serial port are described in -the PORTABILITY ISSUES section. - -.SH "CONFIGURATION OPTIONS" -The \fBfconfigure\fR command can be used to query and set the following -configuration option for open serial ports: -.TP -\fB\-mode \fIbaud\fB,\fIparity\fB,\fIdata\fB,\fIstop\fR -. -This option is a set of 4 comma-separated values: the baud rate, parity, -number of data bits, and number of stop bits for this serial port. The -\fIbaud\fR rate is a simple integer that specifies the connection speed. -\fIParity\fR is one of the following letters: \fBn\fR, \fBo\fR, \fBe\fR, -\fBm\fR, \fBs\fR; respectively signifying the parity options of ``none'', -``odd'', ``even'', ``mark'', or ``space''. \fIData\fR is the number of -data bits and should be an integer from 5 to 8, while \fIstop\fR is the -number of stop bits and should be the integer 1 or 2. -.VE - -.VS -.SH "PORTABILITY ISSUES" -.sp -.TP -\fBWindows \fR(all versions) -. -Valid values for \fIfileName\fR to open a serial port are of the form -\fBcom\fIX\fB:\fR, where \fIX\fR is a number, generally from 1 to 4. An -attempt to open a serial port that does not exist will fail. -.TP -\fBWindows NT\fR -. -When running Tcl interactively, there may be some strange interactions -between the real console, if one is present, and a command pipeline that uses -standard input or output. If a command pipeline is opened for reading, some -of the lines entered at the console will be sent to the command pipeline and -some will be sent to the Tcl evaluator. If a command pipeline is opened for -writing, keystrokes entered into the console are not visible until the the -pipe is closed. This behavior occurs whether the command pipeline is -executing 16-bit or 32-bit applications. These problems only occur because -both Tcl and the child application are competing for the console at -the same time. If the command pipeline is started from a script, so that Tcl -is not accessing the console, or if the command pipeline does not use -standard input or output, but is redirected from or to a file, then the -above problems do not occur. -.TP -\fBWindows 95\fR -. -A command pipeline that executes a 16-bit DOS application cannot be opened -for both reading and writing, since 16-bit DOS applications that receive -standard input from a pipe and send standard output to a pipe run -synchronously. Command pipelines that do not execute 16-bit DOS -applications run asynchronously and can be opened for both reading and -writing. -.sp -When running Tcl interactively, there may be some strange interactions -between the real console, if one is present, and a command pipeline that uses -standard input or output. If a command pipeline is opened for reading from -a 32-bit application, some of the keystrokes entered at the console will be -sent to the command pipeline and some will be sent to the Tcl evaluator. If -a command pipeline is opened for writing to a 32-bit application, no output -is visible on the console until the the pipe is closed. These problems only -occur because both Tcl and the child application are competing for the -console at the same time. If the command pipeline is started from a script, -so that Tcl is not accessing the console, or if the command pipeline does -not use standard input or output, but is redirected from or to a file, then -the above problems do not occur. -.sp -Whether or not Tcl is running interactively, if a command pipeline is opened -for reading from a 16-bit DOS application, the call to \fBopen\fR will not -return until end-of-file has been received from the command pipeline's -standard output. If a command pipeline is opened for writing to a 16-bit DOS -application, no data will be sent to the command pipeline's standard output -until the pipe is actually closed. This problem occurs because 16-bit DOS -applications are run synchronously, as described above. -.TP -\fBWindows 3.X\fR -. -A command pipeline can execute 16-bit or 32-bit DOS or Windows -applications, but the call to \fBopen\fR will not return until the last -program in the pipeline has finished executing; command pipelines run -synchronously. If the pipeline is opened with write access (either just -writing or both reading and writing) the first application in the -pipeline will instead see an immediate end-of-file; any data the caller -writes to the open pipe will instead be discarded. -.sp -Since Tcl cannot be run with a real console under Windows 3.X, there are -no interactions between command pipelines and the console. -.TP -\fBMacintosh\fR -. -Opening a serial port is not currently implemented under Macintosh. -.sp -Opening a command pipeline is not supported under Macintosh, since -applications do not support the concept of standard input or output. -.TP -\fBUnix\fR\0\0\0\0\0\0\0 -. -Valid values for \fIfileName\fR to open a serial port are generally of the -form \fB/dev/tty\fIX\fR, where \fIX\fR is \fBa\fR or \fBb\fR, but the name -of any pseudo-file that maps to a serial port may be used. -.sp -When running Tcl interactively, there may be some strange interactions -between the console, if one is present, and a command pipeline that uses -standard input. If a command pipeline is opened for reading, some -of the lines entered at the console will be sent to the command pipeline and -some will be sent to the Tcl evaluator. This problem only occurs because -both Tcl and the child application are competing for the console at the -same time. If the command pipeline is started from a script, so that Tcl is -not accessing the console, or if the command pipeline does not use standard -input, but is redirected from a file, then the above problem does not occur. -.LP -See the PORTABILITY ISSUES section of the \fBexec\fR command for additional -information not specific to command pipelines about executing -applications on the various platforms -.SH "SEE ALSO" -close(n), filename(n), gets(n), read(n), puts(n), exec(n) -.VE -.SH KEYWORDS -access mode, append, create, file, non-blocking, open, permissions, -pipeline, process, serial diff --git a/doc/package.n b/doc/package.n deleted file mode 100644 index f4d9f84..0000000 --- a/doc/package.n +++ /dev/null @@ -1,193 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: package.n,v 1.3 1999/03/10 05:52:45 stanton Exp $ -'\" -.so man.macros -.TH package n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -package \- Facilities for package loading and version control -.SH SYNOPSIS -.nf -\fBpackage forget \fIpackage\fR -\fBpackage ifneeded \fIpackage version\fR ?\fIscript\fR? -\fBpackage names\fR -\fBpackage present \fR?\fB\-exact\fR? \fIpackage \fR?\fIversion\fR? -\fBpackage provide \fIpackage \fR?\fIversion\fR? -\fBpackage require \fR?\fB\-exact\fR? \fIpackage \fR?\fIversion\fR? -\fBpackage unknown \fR?\fIcommand\fR? -\fBpackage vcompare \fIversion1 version2\fR -\fBpackage versions \fIpackage\fR -\fBpackage vsatisfies \fIversion1 version2\fR -.fi -.BE - -.SH DESCRIPTION -.PP -This command keeps a simple database of the packages available for -use by the current interpreter and how to load them into the -interpreter. -It supports multiple versions of each package and arranges -for the correct version of a package to be loaded based on what -is needed by the application. -This command also detects and reports version clashes. -Typically, only the \fBpackage require\fR and \fBpackage provide\fR -commands are invoked in normal Tcl scripts; the other commands are used -primarily by system scripts that maintain the package database. -.PP -The behavior of the \fBpackage\fR command is determined by its first argument. -The following forms are permitted: -.TP -\fBpackage forget \fIpackage\fR -Removes all information about \fIpackage\fR from this interpreter, -including information provided by both \fBpackage ifneeded\fR and -\fBpackage provide\fR. -.TP -\fBpackage ifneeded \fIpackage version\fR ?\fIscript\fR? -This command typically appears only in system configuration -scripts to set up the package database. -It indicates that a particular version of -a particular package is available if needed, and that the package -can be added to the interpreter by executing \fIscript\fR. -The script is saved in a database for use by subsequent -\fBpackage require\fR commands; typically, \fIscript\fR -sets up auto-loading for the commands in the package (or calls -\fBload\fR and/or \fBsource\fR directly), then invokes -\fBpackage provide\fR to indicate that the package is present. -There may be information in the database for several different -versions of a single package. -If the database already contains information for \fIpackage\fR -and \fIversion\fR, the new \fIscript\fR replaces the existing -one. -If the \fIscript\fR argument is omitted, the current script for -version \fIversion\fR of package \fIpackage\fR is returned, -or an empty string if no \fBpackage ifneeded\fR command has -been invoked for this \fIpackage\fR and \fIversion\fR. -.TP -\fBpackage names\fR -Returns a list of the names of all packages in the -interpreter for which a version has been provided (via -\fBpackage provide\fR) or for which a \fBpackage ifneeded\fR -script is available. -The order of elements in the list is arbitrary. -.TP -\fBpackage present \fR?\fB\-exact\fR? \fIpackage \fR?\fIversion\fR? -This command is equivalent to \fBpackage require\fR except that it -does not try and load the package if it is not already loaded. -.TP -\fBpackage provide \fIpackage \fR?\fIversion\fR? -This command is invoked to indicate that version \fIversion\fR -of package \fIpackage\fR is now present in the interpreter. -It is typically invoked once as part of an \fBifneeded\fR script, -and again by the package itself when it is finally loaded. -An error occurs if a different version of \fIpackage\fR has been -provided by a previous \fBpackage provide\fR command. -If the \fIversion\fR argument is omitted, then the command -returns the version number that is currently provided, or an -empty string if no \fBpackage provide\fR command has been -invoked for \fIpackage\fR in this interpreter. -.TP -\fBpackage require \fR?\fB\-exact\fR? \fIpackage \fR?\fIversion\fR? -This command is typically invoked by Tcl code that wishes to use -a particular version of a particular package. The arguments -indicate which package is wanted, and the command ensures that -a suitable version of the package is loaded into the interpreter. -If the command succeeds, it returns the version number that is -loaded; otherwise it generates an error. -If both the \fB\-exact\fR -switch and the \fIversion\fR argument are specified then only the -given version is acceptable. If \fB\-exact\fR is omitted but -\fIversion\fR is specified, then versions later than \fIversion\fR -are also acceptable as long as they have the same major version -number as \fIversion\fR. -If both \fB\-exact\fR and \fIversion\fR are omitted then any -version whatsoever is acceptable. -If a version of \fIpackage\fR has already been provided (by invoking -the \fBpackage provide\fR command), then its version number must -satisfy the criteria given by \fB\-exact\fR and \fIversion\fR and -the command returns immediately. -Otherwise, the command searches the database of information provided by -previous \fBpackage ifneeded\fR commands to see if an acceptable -version of the package is available. -If so, the script for the highest acceptable version number is invoked; -it must do whatever is necessary to load the package, -including calling \fBpackage provide\fR for the package. -If the \fBpackage ifneeded\fR database does not contain an acceptable -version of the package and a \fBpackage unknown\fR command has been -specified for the interpreter then that command is invoked; when -it completes, Tcl checks again to see if the package is now provided -or if there is a \fBpackage ifneeded\fR script for it. -If all of these steps fail to provide an acceptable version of the -package, then the command returns an error. -.TP -\fBpackage unknown \fR?\fIcommand\fR? -This command supplies a ``last resort'' command to invoke during -\fBpackage require\fR if no suitable version of a package can be found -in the \fBpackage ifneeded\fR database. -If the \fIcommand\fR argument is supplied, it contains the first part -of a command; when the command is invoked during a \fBpackage require\fR -command, Tcl appends two additional arguments giving the desired package -name and version. -For example, if \fIcommand\fR is \fBfoo bar\fR and later the command -\fBpackage require test 2.4\fR is invoked, then Tcl will execute -the command \fBfoo bar test 2.4\fR to load the package. -If no version number is supplied to the \fBpackage require\fR command, -then the version argument for the invoked command will be an empty string. -If the \fBpackage unknown\fR command is invoked without a \fIcommand\fR -argument, then the current \fBpackage unknown\fR script is returned, -or an empty string if there is none. -If \fIcommand\fR is specified as an empty string, then the current -\fBpackage unknown\fR script is removed, if there is one. -.TP -\fBpackage vcompare \fIversion1 version2\fR -Compares the two version numbers given by \fIversion1\fR and \fIversion2\fR. -Returns -1 if \fIversion1\fR is an earlier version than \fIversion2\fR, -0 if they are equal, and 1 if \fIversion1\fR is later than \fBversion2\fR. -.TP -\fBpackage versions \fIpackage\fR -Returns a list of all the version numbers of \fIpackage\fR -for which information has been provided by \fBpackage ifneeded\fR -commands. -.TP -\fBpackage vsatisfies \fIversion1 version2\fR -Returns 1 if scripts written for \fIversion2\fR will work unchanged -with \fIversion1\fR (i.e. \fIversion1\fR is equal to or greater -than \fIversion2\fR and they both have the same major version -number), 0 otherwise. - -.SH "VERSION NUMBERS" -.PP -Version numbers consist of one or more decimal numbers separated -by dots, such as 2 or 1.162 or 3.1.13.1. -The first number is called the major version number. -Larger numbers correspond to later versions of a package, with -leftmost numbers having greater significance. -For example, version 2.1 is later than 1.3 and version -3.4.6 is later than 3.3.5. -Missing fields are equivalent to zeroes: version 1.3 is the -same as version 1.3.0 and 1.3.0.0, so it is earlier than 1.3.1 or 1.3.0.2. -A later version number is assumed to be upwards compatible with -an earlier version number as long as both versions have the same -major version number. -For example, Tcl scripts written for version 2.3 of a package should -work unchanged under versions 2.3.2, 2.4, and 2.5.1. -Changes in the major version number signify incompatible changes: -if code is written to use version 2.1 of a package, it is not guaranteed -to work unmodified with either version 1.7.3 or version 3.1. - -.SH "PACKAGE INDICES" -.PP -The recommended way to use packages in Tcl is to invoke \fBpackage require\fR -and \fBpackage provide\fR commands in scripts, and use the procedure -\fBpkg_mkIndex\fR to create package index files. -Once you've done this, packages will be loaded automatically -in response to \fBpackage require\fR commands. -See the documentation for \fBpkg_mkIndex\fR for details. - -.SH KEYWORDS -package, version diff --git a/doc/pid.n b/doc/pid.n deleted file mode 100644 index 41f47ce..0000000 --- a/doc/pid.n +++ /dev/null @@ -1,34 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: pid.n,v 1.2 1998/09/14 18:39:54 stanton Exp $ -'\" -.so man.macros -.TH pid n 7.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -pid \- Retrieve process id(s) -.SH SYNOPSIS -\fBpid \fR?\fIfileId\fR? -.BE - -.SH DESCRIPTION -.PP -If the \fIfileId\fR argument is given then it should normally -refer to a process pipeline created with the \fBopen\fR command. -In this case the \fBpid\fR command will return a list whose elements -are the process identifiers of all the processes in the pipeline, -in order. -The list will be empty if \fIfileId\fR refers to an open file -that isn't a process pipeline. -If no \fIfileId\fR argument is given then \fBpid\fR returns the process -identifier of the current process. -All process identifiers are returned as decimal strings. - -.SH KEYWORDS -file, pipeline, process identifier diff --git a/doc/pkgMkIndex.n b/doc/pkgMkIndex.n deleted file mode 100644 index bf211e1..0000000 --- a/doc/pkgMkIndex.n +++ /dev/null @@ -1,240 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: pkgMkIndex.n,v 1.6 1998/12/02 01:42:18 welch Exp $ -'\" -.so man.macros -.TH pkg_mkIndex n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -pkg_mkIndex \- Build an index for automatic loading of packages -.SH SYNOPSIS -.nf -.VS 8.0.3 -\fBpkg_mkIndex ?\fI-direct\fR? ?\fI-load pkgPat\fR? ?\fI-verbose\fR? \fIdir\fR ?\fIpattern pattern ...\fR? -.VE -.fi -.BE - -.SH DESCRIPTION -.PP -\fBPkg_mkIndex\fR is a utility procedure that is part of the standard -Tcl library. -It is used to create index files that allow packages to be loaded -automatically when \fBpackage require\fR commands are executed. -To use \fBpkg_mkIndex\fR, follow these steps: -.IP [1] -Create the package(s). -Each package may consist of one or more Tcl script files or binary files. -Binary files must be suitable for loading with the \fBload\fR command -with a single argument; for example, if the file is \fBtest.so\fR it must -be possible to load this file with the command \fBload test.so\fR. -Each script file must contain a \fBpackage provide\fR command to declare -the package and version number, and each binary file must contain -a call to \fBTcl_PkgProvide\fR. -.IP [2] -Create the index by invoking \fBpkg_mkIndex\fR. -The \fIdir\fR argument gives the name of a directory and each -\fIpattern\fR argument is a \fBglob\fR-style pattern that selects -script or binary files in \fIdir\fR. -.VS 8.0.3 -The default pattern is \fB*.tcl\fR and \fB*.[info sharedlibextension]\fR. -.VE -.sp 1 -\fBPkg_mkIndex\fR will create a file \fBpkgIndex.tcl\fR in \fIdir\fR -with package information about all the files given by the \fIpattern\fR -arguments. -It does this by loading each file into a slave -interpreter and seeing what packages -and new commands appear (this is why it is essential to have -\fBpackage provide\fR commands or \fBTcl_PkgProvide\fR calls -in the files, as described above). -If you have a package split among scripts and binary files, -or if you have dependencies among files, -you may have to use the \fB-load\fP option -or adjust the order in which \fBpkg_mkIndex\fR processes -the files. See COMPLEX CASES below. - -.IP [3] -Install the package as a subdirectory of one of the directories given by -the \fBtcl_pkgPath\fR variable. If \fB$tcl_pkgPath\fR contains more -than one directory, machine-dependent packages (e.g., those that -contain binary shared libraries) should normally be installed -under the first directory and machine-independent packages (e.g., -those that contain only Tcl scripts) should be installed under the -second directory. -The subdirectory should include -the package's script and/or binary files as well as the \fBpkgIndex.tcl\fR -file. As long as the package is installed as a subdirectory of a -directory in \fB$tcl_pkgPath\fR it will automatically be found during -\fBpackage require\fR commands. -.sp 1 -If you install the package anywhere else, then you must ensure that -the directory containing the package is in the \fBauto_path\fR global variable -or an immediate subdirectory of one of the directories in \fBauto_path\fR. -\fBAuto_path\fR contains a list of directories that are searched -by both the auto-loader and the package loader; by default it -includes \fB$tcl_pkgPath\fR. -The package loader also checks all of the subdirectories of the -directories in \fBauto_path\fR. -You can add a directory to \fBauto_path\fR explicitly in your -application, or you can add the directory to your \fBTCLLIBPATH\fR -environment variable: if this environment variable is present, -Tcl initializes \fBauto_path\fR from it during application startup. -.IP [4] -Once the above steps have been taken, all you need to do to use a -package is to invoke \fBpackage require\fR. -For example, if versions 2.1, 2.3, and 3.1 of package \fBTest\fR -have been indexed by \fBpkg_mkIndex\fR, the command -\fBpackage require Test\fR will make version 3.1 available -and the command \fBpackage require \-exact Test 2.1\fR will -make version 2.1 available. -There may be many versions of a package in the various index files -in \fBauto_path\fR, but only one will actually be loaded in a given -interpreter, based on the first call to \fBpackage require\fR. -Different versions of a package may be loaded in different -interpreters. - -.SH OPTIONS -The optional switches are: -.TP 15 -\fB\-direct\fR -The generated index -will manage to load the package immediately upon \fBpackage require\fR -instead of delaying loading until actual use of one of the commands. -.TP 15 -\fB\-load \fIpkgPat\fR -The index process will pre-load any packages that exist in the -current interpreter and match \fIpkgPat\fP into the slave interpreter used to -generate the index. The pattern match uses string match rules. -See COMPLEX CASES below. -.TP 15 -\fB\-verbose\fR -Generate output during the indexing process. Output is via -the \fBtclLog\fP procedure, which by default prints to stderr. -.TP 15 -\fB\-\-\fR -End of the flags, in case \fIdir\fP begins with a dash. - -.SH "PACKAGES AND THE AUTO-LOADER" -.PP -The package management facilities overlap somewhat with the auto-loader, -in that both arrange for files to be loaded on-demand. -However, package management is a higher-level mechanism that uses -the auto-loader for the last step in the loading process. -It is generally better to index a package with \fBpkg_mkIndex\fR -rather than \fBauto_mkindex\fR because the package mechanism provides -version control: several versions of a package can be made available -in the index files, with different applications using different -versions based on \fBpackage require\fR commands. -In contrast, \fBauto_mkindex\fR does not understand versions so -it can only handle a single version of each package. -It is probably not a good idea to index a given package with both -\fBpkg_mkIndex\fR and \fBauto_mkindex\fR. -If you use \fBpkg_mkIndex\fR to index a package, its commands cannot -be invoked until \fBpackage require\fR has been used to select a -version; in contrast, packages indexed with \fBauto_mkindex\fR -can be used immediately since there is no version control. - -.SH "HOW IT WORKS" -.PP -\fBPkg_mkIndex\fR depends on the \fBpackage unknown\fR command, -the \fBpackage ifneeded\fR command, and the auto-loader. -The first time a \fBpackage require\fR command is invoked, -the \fBpackage unknown\fR script is invoked. -This is set by Tcl initialization to a script that -evaluates all of the \fBpkgIndex.tcl\fR files in the -\fBauto_path\fR. -The \fBpkgIndex.tcl\fR files contain \fBpackage ifneeded\fR -commands for each version of each available package; these commands -invoke \fBpackage provide\fR commands to announce the -availability of the package, and they setup auto-loader -information to load the files of the package. -.VS 8.0.3 -Unless the \fI-direct\fR flag was provided when the \fBpkgIndex.tcl\fR -was generated, -.VE -a given file of a given version of a given package isn't -actually loaded until the first time one of its commands -is invoked. -Thus, after invoking \fBpackage require\fR you -.VS 8.0.3 -may -.VE -not see -the package's commands in the interpreter, but you will be able -to invoke the commands and they will be auto-loaded. - -.VS 8.0.3 -.SH "DIRECT LOADING" -.PP -Some packages, for instance packages which use namespaces and export -commands or those which require special initialization, might select -that their package files be loaded immediately upon \fBpackage require\fR -instead of delaying the actual loading to the first use of one of the -package's command. This mode is enabled when generating the package -index by specifying the \fI-direct\fR argument. -.VE - -.SH "COMPLEX CASES" -Most complex cases of dependencies among scripts -and binary files, and packages being split among scripts and -binary files are handled OK. However, you may have to adjust -the order in which files are processed by \fBpkg_mkIndex\fR. -These issues are described in detail below. -.PP -If each script or file contains one package, and packages -are only contained in one file, then things are easy. -You simply specify all files to be indexed in any order -with some glob patterns. -.PP -In general, it is OK for scripts to have dependencies on other -packages. -If scripts contain \fBpackage require\fP commands, these are -stubbed out in the interpreter used to process the scripts, -so these do not cause problems. -If scripts call into other packages in global code, -these calls are handled by a stub \fBunknown\fP command. -However, if scripts make variable references to other package's -variables in global code, these will cause errors. That is -also bad coding style. -.PP -If binary files have dependencies on other packages, things -can become tricky because it is not possible to stub out -C-level API's such as \fBTcl_PkgRequire\fP API -when loading a binary file. -For example, suppose the BLT package requires Tk, and expresses -this with a call to \fBTcl_PkgRequire\fP in its \fBBlt_Init\fP routine. -To support this, you must run \fBpkg_mkIndex\fR in an interpreter that -has Tk loaded. You can achieve this with the -\fB-load \fIpkgPat\fR option. If you specify this option, -\fBpkg_mkIndex\fR will load any packages listed by -\fBinfo loaded\fP and that match \fIpkgPat\fP -into the interpreter used to process files. -In most cases this will satisfy the \fBTcl_PkgRequire\fP calls -made by binary files. -.PP -If you are indexing two binary files and one depends on the other, -you should specify the one that has dependencies last. -This way the one without dependencies will get loaded and indexed, -and then the package it provides -will be available when the second file is processed. -You may also need to load the first package into the -temporary interpreter used to create the index by using -the \fB-load\fP flag; -it won't hurt to specify package patterns that are not yet loaded. -.PP -If you have a package that is split across scripts and a binary file, -then you should avoid the \fB-load\fP flag. The problem is that -if you load a package before computing the index it masks any -other files that provide part of the same package. -If you must use \fB-load\fP, -then you must specify the scripts first; otherwise the package loaded from -the binary file may mask the package defined by the scripts. - -.SH KEYWORDS -auto-load, index, package, version diff --git a/doc/proc.n b/doc/proc.n deleted file mode 100644 index 90b7709..0000000 --- a/doc/proc.n +++ /dev/null @@ -1,74 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: proc.n,v 1.2 1998/09/14 18:39:54 stanton Exp $ -'\" -.so man.macros -.TH proc n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -proc \- Create a Tcl procedure -.SH SYNOPSIS -\fBproc \fIname args body\fR -.BE - -.SH DESCRIPTION -.PP -The \fBproc\fR command creates a new Tcl procedure named -\fIname\fR, replacing -any existing command or procedure there may have been by that name. -Whenever the new command is invoked, the contents of \fIbody\fR will -be executed by the Tcl interpreter. -Normally, \fIname\fR is unqualified -(does not include the names of any containing namespaces), -and the new procedure is created in the current namespace. -If \fIname\fR includes any namespace qualifiers, -the procedure is created in the specified namespace. -\fIArgs\fR specifies the formal arguments to the -procedure. It consists of a list, possibly empty, each of whose -elements specifies -one argument. Each argument specifier is also a list with either -one or two fields. If there is only a single field in the specifier -then it is the name of the argument; if there are two fields, then -the first is the argument name and the second is its default value. -.PP -When \fIname\fR is invoked a local variable -will be created for each of the formal arguments to the procedure; its -value will be the value of corresponding argument in the invoking command -or the argument's default value. -Arguments with default values need not be -specified in a procedure invocation. However, there must be enough -actual arguments for all the -formal arguments that don't have defaults, and there must not be any extra -actual arguments. There is one special case to permit procedures with -variable numbers of arguments. If the last formal argument has the name -\fBargs\fR, then a call to the procedure may contain more actual arguments -than the procedure has formals. In this case, all of the actual arguments -starting at the one that would be assigned to \fBargs\fR are combined into -a list (as if the \fBlist\fR command had been used); this combined value -is assigned to the local variable \fBargs\fR. -.PP -When \fIbody\fR is being executed, variable names normally refer to -local variables, which are created automatically when referenced and -deleted when the procedure returns. One local variable is automatically -created for each of the procedure's arguments. -Global variables can only be accessed by invoking -the \fBglobal\fR command or the \fBupvar\fR command. -Namespace variables can only be accessed by invoking -the \fBvariable\fR command or the \fBupvar\fR command. -.PP -The \fBproc\fR command returns an empty string. When a procedure is -invoked, the procedure's return value is the value specified in a -\fBreturn\fR command. If the procedure doesn't execute an explicit -\fBreturn\fR, then its return value is the value of the last command -executed in the procedure's body. -If an error occurs while executing the procedure -body, then the procedure-as-a-whole will return that same error. - -.SH KEYWORDS -argument, procedure diff --git a/doc/puts.n b/doc/puts.n deleted file mode 100644 index 99e61a4..0000000 --- a/doc/puts.n +++ /dev/null @@ -1,69 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: puts.n,v 1.3 1999/04/16 00:46:35 stanton Exp $ -'\" -.so man.macros -.TH puts n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -puts \- Write to a channel -.SH SYNOPSIS -\fBputs \fR?\fB\-nonewline\fR? ?\fIchannelId\fR? \fIstring\fR -.BE - -.SH DESCRIPTION -.PP -Writes the characters given by \fIstring\fR to the channel given -by \fIchannelId\fR. -\fIChannelId\fR must be a channel identifier such as returned from a -previous invocation of \fBopen\fR or \fBsocket\fR. It must have been opened -for output. If no \fIchannelId\fR is specified then it defaults to -\fBstdout\fR. \fBPuts\fR normally outputs a newline character after -\fIstring\fR, but this feature may be suppressed by specifying the -\fB\-nonewline\fR switch. -.PP -Newline characters in the output are translated by \fBputs\fR to -platform-specific end-of-line sequences according to the current -value of the \fB\-translation\fR option for the channel (for example, -on PCs newlines are normally replaced with carriage-return-linefeed -sequences; on Macintoshes newlines are normally replaced with -carriage-returns). -See the \fBfconfigure\fR manual entry for a discussion on ways in -which \fBfconfigure\fR will alter output. -.PP -Tcl buffers output internally, so characters written with \fBputs\fR -may not appear immediately on the output file or device; Tcl will -normally delay output until the buffer is full or the channel is -closed. -You can force output to appear immediately with the \fBflush\fR -command. -.PP -When the output buffer fills up, the \fBputs\fR command will normally -block until all the buffered data has been accepted for output by the -operating system. -If \fIchannelId\fR is in nonblocking mode then the \fBputs\fR command -will not block even if the operating system cannot accept the data. -Instead, Tcl continues to buffer the data and writes it in the -background as fast as the underlying file or device can accept it. -The application must use the Tcl event loop for nonblocking output -to work; otherwise Tcl never finds out that the file or device is -ready for more output data. -It is possible for an arbitrarily large amount of data to be -buffered for a channel in nonblocking mode, which could consume a -large amount of memory. -To avoid wasting memory, nonblocking I/O should normally -be used in an event-driven fashion with the \fBfileevent\fR command -(don't invoke \fBputs\fR unless you have recently been notified -via a file event that the channel is ready for more output data). - -.SH "SEE ALSO" -fileevent(n) - -.SH KEYWORDS -channel, newline, output, write diff --git a/doc/pwd.n b/doc/pwd.n deleted file mode 100644 index 8aa6611..0000000 --- a/doc/pwd.n +++ /dev/null @@ -1,25 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: pwd.n,v 1.2 1998/09/14 18:39:54 stanton Exp $ -'\" -.so man.macros -.TH pwd n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -pwd \- Return the current working directory -.SH SYNOPSIS -\fBpwd\fR -.BE - -.SH DESCRIPTION -.PP -Returns the path name of the current working directory. - -.SH KEYWORDS -working directory diff --git a/doc/read.n b/doc/read.n deleted file mode 100644 index 21d9549..0000000 --- a/doc/read.n +++ /dev/null @@ -1,50 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: read.n,v 1.3 1999/04/16 00:46:35 stanton Exp $ -'\" -.so man.macros -.TH read n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -read \- Read from a channel -.SH SYNOPSIS -\fBread \fR?\fB\-nonewline\fR? \fIchannelId\fR -.sp -\fBread \fIchannelId numBytes\fR -.BE - -.SH DESCRIPTION -.PP -In the first form, the \fBread\fR command reads all of the data from -\fIchannelId\fR up to the end of the file. -If the \fB\-nonewline\fR switch is specified then the last character -of the file is discarded if it is a newline. -In the second form, the extra argument specifies how many bytes to -read. Exactly that many bytes will be read and returned, unless -there are fewer than \fInumBytes\fR left in the file; in this case -all the remaining bytes are returned. -.PP -If \fIchannelId\fR is in nonblocking mode, the command may not read -as many bytes as requested: once all available input has been read, -the command will return the data that is available rather than blocking -for more input. -The \fB\-nonewline\fR switch is ignored if the command returns -before reaching the end of the file. -.PP -\fBRead\fR translates end-of-line sequences in the input into -newline characters according to the \fB\-translation\fR option -for the channel. -See the \fBfconfigure\fR manual entry for a discussion on ways in -which \fBfconfigure\fR will alter input. - -.SH "SEE ALSO" -eof(n), fblocked(n), fconfigure(n) - -.SH KEYWORDS -blocking, channel, end of line, end of file, nonblocking, read, translation diff --git a/doc/regexp.n b/doc/regexp.n deleted file mode 100644 index 0d08dcf..0000000 --- a/doc/regexp.n +++ /dev/null @@ -1,1048 +0,0 @@ -'\" -'\" Copyright (c) 1998 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: regexp.n,v 1.3 1999/04/16 00:46:35 stanton Exp $ -'\" -.so man.macros -.TH regexp n 8.1 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -regexp \- Match a regular expression against a string - -.SH SYNOPSIS -\fBregexp \fR?\fIswitches\fR? \fIexp string \fR?\fImatchVar\fR? ?\fIsubMatchVar subMatchVar ...\fR? -.BE - -.SH DESCRIPTION -.PP -Determines whether the regular expression \fIexp\fR matches part or -all of \fIstring\fR and returns 1 if it does, 0 if it doesn't. -.LP -If additional arguments are specified after \fIstring\fR then they -are treated as the names of variables in which to return -information about which part(s) of \fIstring\fR matched \fIexp\fR. -\fIMatchVar\fR will be set to the range of \fIstring\fR that -matched all of \fIexp\fR. The first \fIsubMatchVar\fR will contain -the characters in \fIstring\fR that matched the leftmost parenthesized -subexpression within \fIexp\fR, the next \fIsubMatchVar\fR will -contain the characters that matched the next parenthesized -subexpression to the right in \fIexp\fR, and so on. -.PP -If the initial arguments to \fBregexp\fR start with \fB\-\fR then -they are treated as switches. The following switches are -currently supported: -.TP 15 -\fB\-nocase\fR -Causes upper-case characters in \fIstring\fR to be treated as -lower case during the matching process. -.TP 15 -\fB\-indices\fR -Changes what is stored in the \fIsubMatchVar\fRs. -Instead of storing the matching characters from \fIstring\fR, -each variable -will contain a list of two decimal strings giving the indices -in \fIstring\fR of the first and last characters in the matching -range of characters. -.VS 8.1 -.TP 15 -\fB\-expanded\fR -Enables use of the expanded regular expression syntax where -whitespace and comments are ignored. This is the same as specifying -the \fB(?x)\fR embedded option (see METASYNTAX, below). -.TP 15 -\fB\-line\fR -Enables newline-sensitive matching. By default, newline is a -completely ordinary character with no special meaning. With this -flag, `[^' bracket expressions and `.' never match newline, `^' -matches an empty string after any newline in addition to its normal -function, and `$' matches an empty string before any newline in -addition to its normal function. This flag is equivalent to -specifying both \fB\-linestop\fR and \fB\-lineanchor\fR, or the -\fB(?n)\fR embedded option (see METASYNTAX, below). -.TP 15 -\fB\-linestop\fR -Changes the behavior of `[^' bracket expressions and `.' so that they -stop at newlines. This is the same as specifying the \fB(?p)\fR -embedded option (see METASYNTAX, below). -.TP 15 -\fB\-lineanchor\fR -Changes the behavior of `^' and `$' (the ``anchors'') so they match the -beginning and end of a line respectively. This is the same as -specifying the \fB(?w)\fR embedded option (see METASYNTAX, below). -.TP 15 -\fB\-about\fR -Instead of attempting to match the regular expression, returns a list -containing information about the regular expression. The first -element of the list is a subexpression count. The second element is a -list of property names that describe various attributes of the regular -expression. This switch is primarily intended for debugging purposes. -.VE 8.1 -.TP 15 -\fB\-\|\-\fR -Marks the end of switches. The argument following this one will -be treated as \fIexp\fR even if it starts with a \fB\-\fR. -.PP -If there are more \fIsubMatchVar\fR's than parenthesized -subexpressions within \fIexp\fR, or if a particular subexpression -in \fIexp\fR doesn't match the string (e.g. because it was in a -portion of the expression that wasn't matched), then the corresponding -\fIsubMatchVar\fR will be set to ``\fB\-1 \-1\fR'' if \fB\-indices\fR -has been specified or to an empty string otherwise. - -.SH "DIFFERENT FLAVORS OF REs" -.VS 8.1 -Regular expressions (``RE''s), as defined by POSIX, come in two -flavors: \fIextended\fR REs (``EREs'') and \fIbasic\fR REs (``BREs''). -EREs are roughly those of the traditional \fIegrep\fR, while BREs are -roughly those of the traditional \fIed\fR . This implementation adds -a third flavor, \fIadvanced\fR REs (``AREs''), basically EREs with -some significant extensions. -.PP -This manual page primarily describes AREs. BREs mostly exist for -backward compatibility in some old programs; they will be discussed at -the end. POSIX EREs are almost an exact subset of AREs. Features of -AREs that are not present in EREs will be indicated. - -.SH "REGULAR EXPRESSION SYNTAX" -.PP -Tcl regular expressions are implemented using the package written by -Henry Spencer, based on the 1003.2 spec and some (not quite all) of -the Perl5 extensions (thanks, Henry!). Much of the description of -regular expressions below is copied verbatim from his manual entry. -.PP -An ARE is one or more \fIbranches\fR, -separated by `\fB|\fR', -matching anything that matches any of the branches. -.PP -A branch is zero or more \fIconstraints\fR or \fIquantified atoms\fR, -concatenated. -It matches a match for the first, followed by a match for the second, etc; -an empty branch matches the empty string. -.PP -A quantified atom is an \fIatom\fR possibly followed -by a single \fIquantifier\fR. -Without a quantifier, it matches a match for the atom. -The quantifiers, -and what a so-quantified atom matches, are: -.RS 2 -.TP 6 -\fB*\fR -a sequence of 0 or more matches of the atom -.TP -\fB+\fR -a sequence of 1 or more matches of the atom -.TP -\fB?\fR -a sequence of 0 or 1 matches of the atom -.TP -\fB{\fIm\fB}\fR -a sequence of exactly \fIm\fR matches of the atom -.TP -\fB{\fIm\fB,}\fR -a sequence of \fIm\fR or more matches of the atom -.TP -\fB{\fIm\fB,\fIn\fB}\fR -a sequence of \fIm\fR through \fIn\fR (inclusive) matches of the atom; -\fIm\fR may not exceed \fIn\fR -.TP -\fB*? +? ?? {\fIm\fB}? {\fIm\fB,}? {\fIm\fB,\fIn\fB}?\fR -\fInon-greedy\fR quantifiers, -which match the same possibilities, -but prefer the smallest number rather than the largest number -of matches (see MATCHING) -.RE -.PP -The forms using -\fB{\fR and \fB}\fR -are known as \fIbound\fRs. -The numbers -\fIm\fR and \fIn\fR are unsigned decimal integers -with permissible values from 0 to 255 inclusive. -.PP -An atom is one of: -.RS 2 -.TP 6 -\fB(\fIre\fB)\fR -(where \fIre\fR is any regular expression) -matches a match for -\fIre\fR, with the match noted for possible reporting -.TP -\fB(?:\fIre\fB)\fR -as previous, -but does no reporting -(a ``non-capturing'' set of parentheses) -.TP -\fB()\fR -matches an empty string, -noted for possible reporting -.TP -\fB(?:)\fR -matches an empty string, -without reporting -.TP -\fB[\fIchars\fB]\fR -a \fIbracket expression\fR, -matching any one of the \fIchars\fR (see BRACKET EXPRESSIONS for more detail) -.TP - \fB.\fR -matches any single character -.TP -\fB\e\fIk\fR -(where \fIk\fR is a non-alphanumeric character) -matches that character taken as an ordinary character, -e.g. \e\e matches a backslash character -.TP -\fB\e\fIc\fR -where \fIc\fR is alphanumeric -(possibly followed by other characters), -an \fIescape\fR (AREs only), -see ESCAPES below -.TP -\fB{\fR -when followed by a character other than a digit, -matches the character -`\fB{\fR'; -when followed by a digit, it is the beginning of a -\fIbound\fR (see above) -.TP -\fIx\fR -where \fIx\fR is -a single character with no other significance, matches that character. -.RE -.PP -A \fIconstraint\fR matches an empty string when specific conditions -are met. -A constraint may not be followed by a quantifier. -The simple constraints are as follows; some more constraints are -described later, under ESCAPES. -.RS 2 -.TP 8 -\fB^\fR -matches at the beginning of a line -.TP -\fB$\fR -matches at the end of a line -.TP -\fB(?=\fIre\fB)\fR -\fIpositive lookahead\fR (AREs only), matches at any point -where a substring matching \fIre\fR begins -.TP -\fB(?!\fIre\fB)\fR -\fInegative lookahead\fR (AREs only), matches at any point -where no substring matching \fIre\fR begins -.RE -.PP -The lookahead constraints may not contain back references (see later), -and all parentheses within them are considered non-capturing. -.PP -An RE may not end with -`\fB\e\fR'. - -.SH "BRACKET EXPRESSIONS" -A \fIbracket expression\fR is a list of characters enclosed in -`\fB[\|]\fR'. -It normally matches any single character from the list (but see below). -If the list begins with -`\fB^\fR', -it matches any single character -(but see below) \fInot\fR from the rest of the list. -.PP -If two characters in the list are separated by -`\fB\-\fR', -this is shorthand -for the full \fIrange\fR of characters between those two (inclusive) in the -collating sequence, -e.g. -\fB[0\-9]\fR -in ASCII matches any decimal digit. -Two ranges may not share an -endpoint, so e.g. -\fBa\-c\-e\fR -is illegal. -Ranges are very collating-sequence-dependent, -and portable programs should avoid relying on them. -.PP -To include a literal -\fB]\fR -or -\fB\-\fR -in the list, -the simplest method is to -enclose it in -\fB[.\fR -and -\fB.]\fR -to make it a collating element (see below). -Alternatively, -make it the first character -(following a possible -`\fB^\fR'), -or (AREs only) precede it with -`\fB\e\fR'. -Alternatively, for -`\fB\-\fR', -make it the last character, -or the second endpoint of a range. -To use a literal -\fB\-\fR -as the first endpoint of a range, -make it a collating element -or (AREs only) precede it with -`\fB\e\fR'. -With the exception of these, some combinations using -\fB[\fR -(see next -paragraphs), and escapes, -all other special characters lose their -special significance within a bracket expression. -.PP -Within a bracket expression, a collating element (a character, -a multi-character sequence that collates as if it were a single character, -or a collating-sequence name for either) -enclosed in -\fB[.\fR -and -\fB.]\fR -stands for the -sequence of characters of that collating element. -The sequence is a single element of the bracket expression's list. -A bracket expression in a locale which has -multi-character collating elements -can thus match more than one character. -Most insidiously, if -\fB^\fR -is used, -this can happen even if no multi-character collating -elements appear in the bracket expression! -If the collating sequence includes a -\fBch\fR -multi-character collating element, -then the RE -\fB[[.ch.]]*c\fR -matches the first five characters -of -`\fBchchcc\fR', -and the RE -\fB[^c]b\fR -matches all of -`\fBchb\fR'. -.PP -Within a bracket expression, a collating element enclosed in -\fB[=\fR -and -\fB=]\fR -is an equivalence class, standing for the sequences of characters -of all collating elements equivalent to that one, including itself. -(If there are no other equivalent collating elements, -the treatment is as if the enclosing delimiters were -`\fB[.\fR'\& -and -`\fB.]\fR'.) -For example, if -\fBo\fR -and -\fB\o'o^'\fR -are the members of an equivalence class, -then -`\fB[[=o=]]\fR', -`\fB[[=\o'o^'=]]\fR', -and -`\fB[o\o'o^']\fR'\& -are all synonymous. -An equivalence class may not be an endpoint -of a range. -.PP -Within a bracket expression, the name of a \fIcharacter class\fR enclosed -in -\fB[:\fR -and -\fB:]\fR -stands for the list of all characters -(not all collating elements!) -belonging to that -class. -Standard character class names are: -.PP -.RS -.ne 5 -.nf -.ta 3c 6c 9c -\fBalnum digit punct -alpha graph space -blank lower upper -cntrl print xdigit\fR -.fi -.RE -.PP -These stand for the character classes defined in -\fIctype\fR(3). -A locale may provide others. -A character class may not be used as an endpoint of a range. -.PP -There are two special cases of bracket expressions: -the bracket expressions -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -are constraints, matching empty strings at -the beginning and end of a word respectively. -'\" note, discussion of escapes below references this definition of word -A word is defined as a sequence of -word characters -which is neither preceded nor followed by -word characters. -A word character is an -\fIalnum\fR -character (as defined by -\fIctype\fR(3)) -or an underscore -(\fB_\fR). -These special bracket expressions are deprecated; -users of AREs should use constraint escapes instead (see below). -.SH ESCAPES -Escapes (AREs only), which begin with a -\fB\e\fR -followed by an alphanumeric character, -come in several varieties: -character entry, class shorthands, constraint escapes, and back references. -A -\fB\e\fR -followed by an alphanumeric character but not constituting -a valid escape is illegal in AREs. -In EREs, there are no escapes: -outside a bracket expression, -a -\fB\e\fR -followed by an alphanumeric character merely stands for that -character as an ordinary character, -and inside a bracket expression, -\fB\e\fR -is an ordinary character. -(The latter is the one actual incompatibility between EREs and AREs.) -.PP -Character-entry escapes (AREs only) exist to make it easier to specify -non-printing and otherwise inconvenient characters in REs: -.RS 2 -.TP 5 -\fB\ea\fR -alert, aka bell, character, as in C -.TP -\fB\eb\fR -backspace, as in C -.TP -\fB\eB\fR -synonym for -\fB\e\fR -to help reduce backslash doubling in some -applications where there are multiple levels of backslash processing -.TP -\fB\ec\fIX\fR -(where X is any character) the character whose -low-order 5 bits are the same as those of -\fIX\fR, -and whose other bits are all zero -.TP -\fB\ee\fR -the character whose collating-sequence name -is -`\fBESC\fR', -or failing that, the character with octal value 033 -.TP -\fB\ef\fR -formfeed, as in C -.TP -\fB\en\fR -newline, as in C -.TP -\fB\er\fR -carriage return, as in C -.TP -\fB\et\fR -horizontal tab, as in C -.TP -\fB\eu\fIwxyz\fR -(where -\fIwxyz\fR -is exactly four hexadecimal digits) -the Unicode character -\fBU+\fIwxyz\fR -in the local byte ordering -.TP -\fB\eU\fIstuvwxyz\fR -(where -\fIstuvwxyz\fR -is exactly eight hexadecimal digits) -reserved for a somewhat-hypothetical Unicode extension to 32 bits -.TP -\fB\ev\fR -vertical tab, as in C -are all available. -.TP -\fB\ex\fIhhh\fR -(where -\fIhhh\fR -is any sequence of hexadecimal digits) -the character whose hexadecimal value is -\fB0x\fIhhh\fR -(a single character no matter how many hexadecimal digits are used). -.TP -\fB\e0\fR -the character whose value is -\fB0\fR -.TP -\fB\e\fIxy\fR -(where -\fIxy\fR -is exactly two octal digits, -and is not a -\fIback reference\fR (see below)) -the character whose octal value is -\fB0\fIxy\fR -.TP -\fB\e\fIxyz\fR -(where -\fIxyz\fR -is exactly three octal digits, -and is not a -back reference (see below)) -the character whose octal value is -\fB0\fIxyz\fR -.RE -.PP -Hexadecimal digits are -`\fB0\fR'-`\fB9\fR', -`\fBa\fR'-`\fBf\fR', -and -`\fBA\fR'-`\fBF\fR'. -Octal digits are -`\fB0\fR'-`\fB7\fR'. -.PP -The character-entry escapes are always taken as ordinary characters. -For example, -\fB\e135\fR -is -\fB]\fR -in ASCII, -but -\fB\e135\fR -does not terminate a bracket expression. -Beware, however, that some applications (e.g., C compilers) interpret -such sequences themselves before the regular-expression package -gets to see them, which may require doubling (quadrupling, etc.) the -`\fB\e\fR'. -.PP -Class-shorthand escapes (AREs only) provide shorthands for certain commonly-used -character classes: -.RS 2 -.TP 10 -\fB\ed\fR -\fB[[:digit:]]\fR -.TP -\fB\es\fR -\fB[[:space:]]\fR -.TP -\fB\ew\fR -\fB[[:alnum:]_]\fR -(note underscore) -.TP -\fB\eD\fR -\fB[^[:digit:]]\fR -.TP -\fB\eS\fR -\fB[^[:space:]]\fR -.TP -\fB\eW\fR -\fB[^[:alnum:]_]\fR -(note underscore) -.RE -.PP -Within bracket expressions, -`\fB\ed\fR', -`\fB\es\fR', -and -`\fB\ew\fR'\& -lose their outer brackets, -and -`\fB\eD\fR', -`\fB\eS\fR', -and -`\fB\eW\fR'\& -are illegal. -.PP -A constraint escape (AREs only) is a constraint, -matching the empty string if specific conditions are met, -written as an escape: -.RS 2 -.TP 6 -\fB\eA\fR -matches only at the beginning of the string -(see MATCHING, below, for how this differs from -`\fB^\fR') -.TP -\fB\em\fR -matches only at the beginning of a word -.TP -\fB\eM\fR -matches only at the end of a word -.TP -\fB\ey\fR -matches only at the beginning or end of a word -.TP -\fB\eY\fR -matches only at a point which is not the beginning or end of a word -.TP -\fB\eZ\fR -matches only at the end of the string -(see MATCHING, below, for how this differs from -`\fB$\fR') -.TP -\fB\e\fIm\fR -(where -\fIm\fR -is a nonzero digit) a \fIback reference\fR, see below -.TP -\fB\e\fImnn\fR -(where -\fIm\fR -is a nonzero digit, and -\fInn\fR -is some more digits, -and the decimal value -\fImnn\fR -is not greater than the number of closing capturing parentheses seen so far) -a \fIback reference\fR, see below -.RE -.PP -A word is defined as in the specification of -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -above. -Constraint escapes are illegal within bracket expressions. -.PP -A back reference (AREs only) matches the same string matched by the parenthesized -subexpression specified by the number, -so that (e.g.) -\fB([bc])\e1\fR -matches -\fBbb\fR -or -\fBcc\fR -but not -`\fBbc\fR'. -The subexpression must entirely precede the back reference in the RE. -Subexpressions are numbered in the order of their leading parentheses. -Non-capturing parentheses do not define subexpressions. -.PP -There is an inherent historical ambiguity between octal character-entry -escapes and back references, which is resolved by heuristics, -as hinted at above. -A leading zero always indicates an octal escape. -A single non-zero digit, not followed by another digit, -is always taken as a back reference. -A multi-digit sequence not starting with a zero is taken as a back -reference if it comes after a suitable subexpression -(i.e. the number is in the legal range for a back reference), -and otherwise is taken as octal. -.SH "METASYNTAX" -In addition to the main syntax described above, there are some special -forms and miscellaneous syntactic facilities available. -.PP -Normally the flavor of RE being used is specified by -application-dependent means. -However, this can be overridden by a \fIdirector\fR. -If an RE of any flavor begins with -`\fB***:\fR', -the rest of the RE is an ARE. -If an RE of any flavor begins with -`\fB***=\fR', -the rest of the RE is taken to be a literal string, -with all characters considered ordinary characters. -.PP -An ARE may begin with \fIembedded options\fR: -a sequence -\fB(?\fIxyz\fB)\fR -(where -\fIxyz\fR -is one or more alphabetic characters) -specifies options affecting the rest of the RE. -These supplement, and can override, -any options specified by the application. -The available option letters are: -.RS 2 -.TP 3 -\fBb\fR -rest of RE is a BRE -.TP 3 -\fBc\fR -case-sensitive matching (usual default) -.TP 3 -\fBe\fR -rest of RE is an ERE -.TP 3 -\fBi\fR -case-insensitive matching (see MATCHING, below) -.TP 3 -\fBm\fR -historical synonym for -\fBn\fR -.TP 3 -\fBn\fR -newline-sensitive matching (see MATCHING, below) -.TP 3 -\fBp\fR -partial newline-sensitive matching (see MATCHING, below) -.TP 3 -\fBq\fR -rest of RE is a literal (``quoted'') string, all ordinary characters -.TP 3 -\fBs\fR -non-newline-sensitive matching (usual default) -.TP 3 -\fBt\fR -tight syntax (usual default; see below) -.TP 3 -\fBw\fR -inverse partial newline-sensitive (``weird'') matching (see MATCHING, below) -.TP 3 -\fBx\fR -expanded syntax (see below) -.RE -.PP -Embedded options take effect at the -\fB)\fR -terminating the sequence. -They are available only at the start of an ARE, -and may not be used later within it. -.PP -In addition to the usual (\fItight\fR) RE syntax, in which all characters are -significant, there is an \fIexpanded\fR syntax, -available in all flavors of RE -with the \fB-expanded\fR switch, or in AREs with the embedded x option. -In the expanded syntax, -white-space characters are ignored -and all characters between a -\fB#\fR -and the following newline (or the end of the RE) are ignored, -permitting paragraphing and commenting a complex RE. -There are three exceptions to that basic rule: -.RS 2 -.PP -a white-space character or `\fB#\fR' preceded by `\fB\e\fR' is retained -.PP -white space or `\fB#\fR' within a bracket expression is retained -.PP -white space and comments are illegal within multi-character symbols -like the ARE `\fB(?:\fR' or the BRE `\fB\e(\fR' -.RE -.PP -Expanded-syntax -white-space characters are blank, tab, newline, etc. (any character -defined as \fIspace\fR by -\fIctype\fR(3)). -Exactly how a multi-line expanded-syntax RE -can be entered interactively by a user, -if at all, is application-specific; -expanded syntax is primarily a scripting facility. -.PP -Finally, in an ARE, -outside bracket expressions, the sequence -`\fB(?#\fIttt\fB)\fR' -(where -\fIttt\fR -is any text not containing a -`\fB)\fR') -is a comment, -completely ignored. -Again, this is not allowed between the characters of -multi-character symbols like -`\fB(?:\fR'. -Such comments are more a historical artifact than a useful facility, -and their use is deprecated; -use the expanded syntax instead. -.PP -\fINone\fR of these metasyntax extensions is available if the application -(or an initial -\fB***=\fR -director) -has specified that the user's input be treated as a literal string -rather than as an RE. -.SH MATCHING -In the event that an RE could match more than one substring of a given -string, -the RE matches the one starting earliest in the string. -If the RE could match more than one substring starting at that point, -its choice is determined by its \fIpreference\fR: -either the longest substring, or the shortest. -.PP -Most atoms, and all constraints, have no preference. -A parenthesized RE has the same preference (possibly none) as the RE. -A quantified atom with quantifier -\fB{\fIm\fB}\fR -or -\fB{\fIm\fB}?\fR -has the same preference (possibly none) as the atom itself. -A quantified atom with other normal quantifiers (including -\fB{\fIm\fB,\fIn\fB}\fR -with -\fIm\fR -equal to -\fIn\fR) -prefers longest match. -A quantified atom with other non-greedy quantifiers (including -\fB{\fIm\fB,\fIn\fB}?\fR -with -\fIm\fR -equal to -\fIn\fR) -prefers shortest match. -A branch has the same preference as the first quantified atom in it -which has a preference. -An RE consisting of two or more branches connected by the -\fB|\fR -operator prefers longest match. -.PP -Subject to the constraints imposed by the rules for matching the whole RE, -subexpressions also match the longest or shortest possible substrings, -based on their preferences, -with subexpressions starting earlier in the RE taking priority over -ones starting later. -Note that outer subexpressions thus take priority over -their component subexpressions. -.PP -Note that the quantifiers -\fB{1,1}\fR -and -\fB{1,1}?\fR -can be used to force longest and shortest preference, respectively, -on a subexpression or a whole RE. -.PP -Match lengths are measured in characters, not collating elements. -An empty string is considered longer than no match at all. -For example, -\fBbb*\fR -matches the three middle characters of -`\fBabbbc\fR', -\fB(week|wee)(night|knights)\fR -matches all ten characters of -`\fBweeknights\fR', -when -\fB(.*).*\fR -is matched against -\fBabc\fR -the parenthesized subexpression -matches all three characters, and -when -\fB(a*)*\fR -is matched against -\fBbc\fR -both the whole RE and the parenthesized -subexpression match an empty string. -.PP -If case-independent matching is specified, -the effect is much as if all case distinctions had vanished from the -alphabet. -When an alphabetic that exists in multiple cases appears as an -ordinary character outside a bracket expression, it is effectively -transformed into a bracket expression containing both cases, -so that -\fBx\fR -becomes -`\fB[xX]\fR'. -When it appears inside a bracket expression, all case counterparts -of it are added to the bracket expression, so that -\fB[x]\fR -becomes -\fB[xX]\fR -and -\fB[^x]\fR -becomes -`\fB[^xX]\fR'. -.PP -If newline-sensitive matching is specified, -\fB.\fR -and bracket expressions using -\fB^\fR -will never match the newline character -(so that matches will never cross newlines unless the RE -explicitly arranges it) -and -\fB^\fR -and -\fB$\fR -will match the empty string after and before a newline -respectively, in addition to matching at beginning and end of string -respectively. -ARE -\fB\eA\fR -and -\fB\eZ\fR -continue to match beginning or end of string \fIonly\fR. -.PP -If partial newline-sensitive matching is specified, -this affects -\fB.\fR -and bracket expressions -as with newline-sensitive matching, but not -\fB^\fR -and -`\fB$\fR'. -.PP -If inverse partial newline-sensitive matching is specified, -this affects -\fB^\fR -and -\fB$\fR -as with -newline-sensitive matching, -but not -\fB.\fR -and bracket expressions. -This isn't very useful but is provided for symmetry. -.SH "LIMITS AND COMPATIBILITY" -No particular limit is imposed on the length of REs. -Programs intended to be highly portable should not employ REs longer -than 256 bytes, -as a POSIX-compliant implementation can refuse to accept such REs. -.PP -The only feature of AREs that is actually incompatible with -POSIX EREs is that -\fB\e\fR -does not lose its special -significance inside bracket expressions. -All other ARE features use syntax which is illegal or has -undefined or unspecified effects in POSIX EREs; -the -\fB***\fR -syntax of directors likewise is outside the POSIX -syntax for both BREs and EREs. -.PP -Many of the ARE extensions are borrowed from Perl, but some have -been changed to clean them up, and a few Perl extensions are not present. -Incompatibilities of note include -`\fB\eb\fR', -`\fB\eB\fR', -the lack of special treatment for a trailing newline, -the addition of complemented bracket expressions to the things -affected by newline-sensitive matching, -the restrictions on parentheses and back references in lookahead constraints, -and the longest/shortest-match (rather than first-match) matching semantics. -.PP -The matching rules for REs containing both normal and non-greedy quantifiers -have changed since early beta-test versions of this package. -(The new rules are much simpler and cleaner, -but don't work as hard at guessing the user's real intentions.) -.PP -Henry Spencer's original 1986 \fIregexp\fR package, -still in widespread use (e.g., in pre-8.1 releases of Tcl), -implemented an early version of today's EREs. -There are four incompatibilities between \fIregexp\fR's near-EREs -(`RREs' for short) and AREs. -In roughly increasing order of significance: -.PP -.RS -In AREs, -\fB\e\fR -followed by an alphanumeric character is either an -escape or an error, -while in RREs, it was just another way of writing the -alphanumeric. -This should not be a problem because there was no reason to write -such a sequence in RREs. -.PP -\fB{\fR -followed by a digit in an ARE is the beginning of a bound, -while in RREs, -\fB{\fR -was always an ordinary character. -Such sequences should be rare, -and will often result in an error because following characters -will not look like a valid bound. -.PP -In AREs, -\fB\e\fR -remains a special character within -`\fB[\|]\fR', -so a literal -\fB\e\fR -within -\fB[\|]\fR -must be written -`\fB\e\e\fR'. -\fB\e\e\fR -also gives a literal -\fB\e\fR -within -\fB[\|]\fR -in RREs, -but only truly paranoid programmers routinely doubled the backslash. -.PP -AREs report the longest/shortest match for the RE, -rather than the first found in a specified search order. -This may affect some RREs which were written in the expectation that -the first match would be reported. -(The careful crafting of RREs to optimize the search order for fast -matching is obsolete (AREs examine all possible matches -in parallel, and their performance is largely insensitive to their -complexity) but cases where the search order was exploited to deliberately -find a match which was \fInot\fR the longest/shortest will need rewriting.) -.RE - -.SH "BASIC REGULAR EXPRESSIONS" -BREs differ from EREs in several respects. -`\fB|\fR', -`\fB+\fR', -and -\fB?\fR -are ordinary characters and there is no equivalent -for their functionality. -The delimiters for bounds are -\fB\e{\fR -and -`\fB\e}\fR', -with -\fB{\fR -and -\fB}\fR -by themselves ordinary characters. -The parentheses for nested subexpressions are -\fB\e(\fR -and -`\fB\e)\fR', -with -\fB(\fR -and -\fB)\fR -by themselves ordinary characters. -\fB^\fR -is an ordinary character except at the beginning of the -RE or the beginning of a parenthesized subexpression, -\fB$\fR -is an ordinary character except at the end of the -RE or the end of a parenthesized subexpression, -and -\fB*\fR -is an ordinary character if it appears at the beginning of the -RE or the beginning of a parenthesized subexpression -(after a possible leading -`\fB^\fR'). -Finally, -single-digit back references are available, -and -\fB\e<\fR -and -\fB\e>\fR -are synonyms for -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -respectively; -no other escapes are available. - -.VE 8.1 -.SH KEYWORDS -match, regular expression, string diff --git a/doc/registry.n b/doc/registry.n deleted file mode 100644 index f0e199f..0000000 --- a/doc/registry.n +++ /dev/null @@ -1,168 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: registry.n,v 1.4 1999/04/16 00:46:35 stanton Exp $ -'\" -.so man.macros -.TH registry n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -registry \- Manipulate the Windows registry -.SH SYNOPSIS -.sp -\fBpackage require registry 1.0\fR -.sp -\fBregistry \fIoption\fR \fIkeyName\fR ?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -The \fBregistry\fR package provides a general set of operations for -manipulating the Windows registry. The package implements the -\fBregistry\fR Tcl command. This command is only supported on the -Windows platform. Warning: this command should be used with caution -as a corrupted registry can leave your system in an unusable state. -.PP -\fIKeyName\fR is the name of a registry key. Registry keys must be -one of the following forms: -.IP -\fB\e\e\fIhostname\fB\e\fIrootname\fB\e\fIkeypath\fR -.IP -\fIrootname\fB\e\fIkeypath\fR -.IP -\fIrootname\fR -.PP -\fIHostname\fR specifies the name of any valid Windows -host that exports its registry. The \fIrootname\fR component must be -one of \fBHKEY_LOCAL_MACHINE\fR, \fBHKEY_USERS\fR, -.VS -\fBHKEY_CLASSES_ROOT\fR, \fBHKEY_CURRENT_USER\fR, -\fBHKEY_CURRENT_CONFIG\fR, \fBHKEY_PERFORMANCE_DATA\fR, or -\fBHKEY_DYN_DATA\fR. The \fIkeypath\fR can be one or more -.VE -registry key names separated by backslash (\fB\e\fR) characters. -.PP -\fIOption\fR indicates what to do with the registry key name. Any -unique abbreviation for \fIoption\fR is acceptable. The valid options -are: -.TP -\fBregistry delete \fIkeyName\fR ?\fIvalueName\fR? -. -If the optional \fIvalueName\fR argument is present, the specified -value under \fIkeyName\fR will be deleted from the registry. If the -optional \fIvalueName\fR is omitted, the specified key and any subkeys -or values beneath it in the registry heirarchy will be deleted. If -the key could not be deleted then an error is generated. If the key -did not exist, the command has no effect. -.TP -\fBregistry get \fIkeyName valueName\fR -. -Returns the data associated with the value \fIvalueName\fR under the key -\fIkeyName\fR. If either the key or the value does not exist, then an -error is generated. For more details on the format of the returned -data, see SUPPORTED TYPES, below. -.TP -\fBregistry keys \fIkeyName\fR ?\fIpattern\fR? -. -If \fIpattern\fR isn't specified, returns a list of names of all the -subkeys of \fIkeyName\fR. If \fIpattern\fR is specified, only those -names matching \fIpattern\fR are returned. Matching is determined -using the same rules as for \fBstring\fR \fBmatch\fR. If the -specified \fIkeyName\fR does not exist, then an error is generated. -.TP -\fBregistry set \fIkeyName\fR ?\fIvalueName data \fR?\fItype\fR?? -. -If \fIvalueName\fR isn't specified, creates the key \fIkeyName\fR if -it doesn't already exist. If \fIvalueName\fR is specified, creates -the key \fIkeyName\fR and value \fIvalueName\fR if necessary. The -contents of \fIvalueName\fR are set to \fIdata\fR with the type -indicated by \fItype\fR. If \fItype\fR isn't specified, the type -\fBsz\fR is assumed. For more details on the data and type arguments, -see SUPPORTED TYPES below. -.TP -\fBregistry type \fIkeyName valueName\fR -. -Returns the type of the value \fIvalueName\fR in the key -\fIkeyName\fR. For more information on the possible types, see -SUPPORTED TYPES, below. -.TP -\fBregistry values \fIkeyName\fR ?\fIpattern\fR? -. -If \fIpattern\fR isn't specified, returns a list of names of all the -values of \fIkeyName\fR. If \fIpattern\fR is specified, only those -names matching \fIpattern\fR are returned. Matching is determined -using the same rules as for \fBstring\fR \fBmatch\fR. - -.SH "SUPPORTED TYPES" -Each value under a key in the registry contains some data of a -particular type in a type-specific representation. The \fBregistry\fR -command converts between this internal representation and one that can -be manipulated by Tcl scripts. In most cases, the data is simply -returned as a Tcl string. The type indicates the intended use for the -data, but does not actually change the representation. For some -types, the \fBregistry\fR command returns the data in a different form to -make it easier to manipulate. The following types are recognized by the -registry command: -.TP 17 -\fBbinary\fR -. -The registry value contains arbitrary binary data. The data is represented -exactly in Tcl, including any embedded nulls. -.TP -\fBnone\fR -. -The registry value contains arbitrary binary data with no defined -type. The data is represented exactly in Tcl, including any embedded -nulls. -.TP -\fBsz\fR -. -The registry value contains a null-terminated string. The data is -represented in Tcl as a string. -.TP -\fBexpand_sz\fR -. -The registry value contains a null-terminated string that contains -unexpanded references to environment variables in the normal Windows -style (for example, "%PATH%"). The data is represented in Tcl as a -string. -.TP -\fBdword\fR -. -The registry value contains a little-endian 32-bit number. The data is -represented in Tcl as a decimal string. -.TP -\fBdword_big_endian\fR -. -The registry value contains a big-endian 32-bit number. The data is -represented in Tcl as a decimal string. -.TP -\fBlink\fR -. -The registry value contains a symbolic link. The data is represented -exactly in Tcl, including any embedded nulls. -.TP -\fBmulti_sz\fR -. -The registry value contains an array of null-terminated strings. The -data is represented in Tcl as a list of strings. -.TP -\fBresource_list\fR -. -The registry value contains a device-driver resource list. The data -is represented exactly in Tcl, including any embedded nulls. -.PP -In addition to the symbolically named types listed above, unknown -types are identified using a 32-bit integer that corresponds to the -type code returned by the system interfaces. In this case, the data -is represented exactly in Tcl, including any embedded nulls. - -.SH "PORTABILITY ISSUES" -The registry command is only available on Windows. - -.SH KEYWORDS -registry diff --git a/doc/regsub.n b/doc/regsub.n deleted file mode 100644 index 516a417..0000000 --- a/doc/regsub.n +++ /dev/null @@ -1,72 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: regsub.n,v 1.2 1998/09/14 18:39:54 stanton Exp $ -'\" -.so man.macros -.TH regsub n 7.4 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -regsub \- Perform substitutions based on regular expression pattern matching -.SH SYNOPSIS -\fBregsub \fR?\fIswitches\fR? \fIexp string subSpec varName\fR -.BE - -.SH DESCRIPTION -.PP -This command matches the regular expression \fIexp\fR against -\fIstring\fR, -and it copies \fIstring\fR to the variable whose name is -given by \fIvarName\fR. -If there is a match, then while copying \fIstring\fR to \fIvarName\fR -the portion of \fIstring\fR that -matched \fIexp\fR is replaced with \fIsubSpec\fR. -If \fIsubSpec\fR contains a ``&'' or ``\e0'', then it is replaced -in the substitution with the portion of \fIstring\fR that -matched \fIexp\fR. -If \fIsubSpec\fR contains a ``\e\fIn\fR'', where \fIn\fR is a digit -between 1 and 9, then it is replaced in the substitution with -the portion of \fIstring\fR that matched the \fIn\fR-th -parenthesized subexpression of \fIexp\fR. -Additional backslashes may be used in \fIsubSpec\fR to prevent special -interpretation of ``&'' or ``\e0'' or ``\e\fIn\fR'' or -backslash. -The use of backslashes in \fIsubSpec\fR tends to interact badly -with the Tcl parser's use of backslashes, so it's generally -safest to enclose \fIsubSpec\fR in braces if it includes -backslashes. -.LP -If the initial arguments to \fBregexp\fR start with \fB\-\fR then -they are treated as switches. The following switches are -currently supported: -.TP 10 -\fB\-all\fR -All ranges in \fIstring\fR that match \fIexp\fR are found and -substitution is performed for each of these ranges. -Without this switch only the first -matching range is found and substituted. -If \fB\-all\fR is specified, then ``&'' and ``\e\fIn\fR'' -sequences are handled for each substitution using the information -from the corresponding match. -.TP 10 -\fB\-nocase\fR -Upper-case characters in \fIstring\fR will be converted to lower-case -before matching against \fIexp\fR; however, substitutions specified -by \fIsubSpec\fR use the original unconverted form of \fIstring\fR. -.TP 10 -\fB\-\|\-\fR -Marks the end of switches. The argument following this one will -be treated as \fIexp\fR even if it starts with a \fB\-\fR. -.PP -The command returns a count of the number of matching ranges that -were found and replaced. -See the manual entry for \fBregexp\fR for details on the interpretation -of regular expressions. - -.SH KEYWORDS -match, pattern, regular expression, substitute diff --git a/doc/rename.n b/doc/rename.n deleted file mode 100644 index d7617e3..0000000 --- a/doc/rename.n +++ /dev/null @@ -1,32 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: rename.n,v 1.2 1998/09/14 18:39:54 stanton Exp $ -'\" -.so man.macros -.TH rename n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -rename \- Rename or delete a command -.SH SYNOPSIS -\fBrename \fIoldName newName\fR -.BE - -.SH DESCRIPTION -.PP -Rename the command that used to be called \fIoldName\fR so that it -is now called \fInewName\fR. -If \fInewName\fR is an empty string then \fIoldName\fR is deleted. -\fIoldName\fR and \fInewName\fR may include namespace qualifiers -(names of containing namespaces). -If a command is renamed into a different namespace, -future invocations of it will execute in the new namespace. -The \fBrename\fR command returns an empty string as result. - -.SH KEYWORDS -command, delete, namespace, rename diff --git a/doc/resource.n b/doc/resource.n deleted file mode 100644 index 428591b..0000000 --- a/doc/resource.n +++ /dev/null @@ -1,155 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" RCS: @(#) $Id: resource.n,v 1.4 1999/04/16 00:46:36 stanton Exp $ -'\" -.so man.macros -.TH resource n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -resource \- Manipulate Macintosh resources -.SH SYNOPSIS -\fBresource \fIoption\fR ?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -The \fBresource\fR command provides some generic operations for -dealing with Macintosh resources. This command is only supported on -the Macintosh platform. Each Macintosh file consists of two -\fIforks\fR: a \fIdata\fR fork and a \fIresource\fR fork. You use the -normal open, puts, close, etc. commands to manipulate the data fork. -You must use this command, however, to interact with the resource -fork. \fIOption\fR indicates what resource command to perform. Any -unique abbreviation for \fIoption\fR is acceptable. The valid options -are: -.TP -\fBresource close \fIrsrcRef\fR -Closes the given resource reference (obtained from \fBresource -open\fR). Resources from that resource file will no longer be -available. -.TP -\fBresource delete\fR ?\fIoptions\fR? \fIresourceType\fR -This command will delete the resource specified by \fIoptions\fR and -type \fIresourceType\fR (see RESOURCE TYPES below). The options -give you several ways to specify the resource to be deleted. -.RS -.TP -\fB\-id\fR \fIresourceId\fR -If the \fB-id\fR option is given the id \fIresourceId\fR (see RESOURCE -IDS below) is used to specify the resource to be deleted. The id must -be a number - to specify a name use the \fB\-name\fR option. -.TP -\fB\-name\fR \fIresourceName\fR -If \fB-name\fR is specified, the resource named -\fIresourceName\fR will be deleted. If the \fB-id\fR is also -provided, then there must be a resource with BOTH this name and -this id. If no name is provided, then the id will be used regardless -of the name of the actual resource. -.TP -\fB\-file\fR \fIresourceRef\fR -If the \fB-file\fR option is specified then the resource will be -deleted from the file pointed to by \fIresourceRef\fR. Otherwise the -first resource with the given \fIresourceName\fR and or -\fIresourceId\fR which is found on the resource file path will be -deleted. To inspect the file path, use the \fIresource files\fR command. -.RE -.TP -\fBresource files ?\fIresourceRef\fR? -If \fIresourceRef\fRis not provided, this command returns a Tcl list -of the resource references for all the currently open resource files. -The list is in the normal Macintosh search order for resources. If -\fIresourceRef\fR is specified, the command will -return the path to the file whose resource fork is represented by that -token. -.TP -\fBresource list \fIresourceType\fR ?\fIresourceRef\fR? -List all of the resources ids of type \fIresourceType\fR (see RESOURCE -TYPES below). If \fIresourceRef\fR is specified then the command will -limit the search to that particular resource file. Otherwise, all -resource files currently opened by the application will be searched. -A Tcl list of either the resource name's or resource id's of the found -resources will be returned. See the RESOURCE IDS section below for -more details about what a resource id is. -.TP -\fBresource open \fIfileName\fR ?\fIaccess\fR? -Open the resource for the file \fIfileName\fR. Standard file access -permissions may also be specified (see the manual entry for \fBopen\fR -for details). A resource reference (\fIresourceRef\fR) is returned -that can be used by the other resource commands. An error can occur -if the file doesn't exist or the file does not have a resource fork. -However, if you open the file with write permissions the file and/or -resource fork will be created instead of generating an error. -.TP -\fBresource read \fIresourceType\fR \fIresourceId\fR ?\fIresourceRef\fR? -Read the entire resource of type \fIresourceType\fR (see RESOURCE -TYPES below) and the name or id of \fIresourceId\fR (see RESOURCE IDS -below) into memory and return the result. If \fIresourceRef\fR is -specified we limit our search to that resource file, otherwise we -search all open resource forks in the application. It is important to -note that most Macintosh resource use a binary format and the data -returned from this command may have embedded NULLs or other non-ASCII -data. -.TP -\fBresource types ?\fIresourceRef\fR? -This command returns a Tcl list of all resource types (see RESOURCE -TYPES below) found in the resource file pointed to by -\fIresourceRef\fR. If \fIresourceRef\fR is not specified it will -return all the resource types found in every resource file currently -opened by the application. -.TP -\fBresource write\fR ?\fIoptions\fR? \fIresourceType\fR \fIdata\fR -This command will write the passed in \fIdata\fR as a new resource of -type \fIresourceType\fR (see RESOURCE TYPES below). Several options -are available that describe where and how the resource is stored. -.RS -.TP -\fB\-id\fR \fIresourceId\fR -If the \fB-id\fR option is given the id \fIresourceId\fR (see RESOURCE -IDS below) is used for the new resource, otherwise a unique id will be -generated that will not conflict with any existing resource. However, -the id must be a number - to specify a name use the \fB\-name\fR option. -.TP -\fB\-name\fR \fIresourceName\fR -If \fB-name\fR is specified the resource will be named -\fIresourceName\fR, otherwise it will have the empty string as the -name. -.TP -\fB\-file\fR \fIresourceRef\fR -If the \fB-file\fR option is specified then the resource will be -written in the file pointed to by \fIresourceRef\fR, otherwise the -most resently open resource will be used. -.TP -\fB\-force\fR -If the target resource already exists, then by default Tcl will not -overwrite it, but raise an error instead. Use the -force flag to -force overwriting the extant resource. -.RE - -.SH "RESOURCE TYPES" -Resource types are defined as a four character string that is then -mapped to an underlying id. For example, \fBTEXT\fR refers to the -Macintosh resource type for text. The type \fBSTR#\fR is a list of -counted strings. All Macintosh resources must be of some type. See -Macintosh documentation for a more complete list of resource types -that are commonly used. - -.SH "RESOURCE IDS" -For this command the notion of a resource id actually refers to two -ideas in Macintosh resources. Every place you can use a resource Id -you can use either the resource name or a resource number. Names are -always searched or returned in preference to numbers. For example, -the \fBresource list\fR command will return names if they exist or -numbers if the name is NULL. - -.SH "SEE ALSO" -open - -.SH "PORTABILITY ISSUES" -The resource command is only available on Macintosh. - -.SH KEYWORDS -open, resource diff --git a/doc/return.n b/doc/return.n deleted file mode 100644 index d3a3635..0000000 --- a/doc/return.n +++ /dev/null @@ -1,89 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: return.n,v 1.2 1998/09/14 18:39:54 stanton Exp $ -'\" -.so man.macros -.TH return n 7.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -return \- Return from a procedure -.SH SYNOPSIS -\fBreturn \fR?\fB\-code \fIcode\fR? ?\fB\-errorinfo \fIinfo\fR? ?\fB\-errorcode\fI code\fR? ?\fIstring\fR? -.BE - -.SH DESCRIPTION -.PP -Return immediately from the current procedure -(or top-level command or \fBsource\fR command), -with \fIstring\fR as the return value. If \fIstring\fR is not specified then -an empty string will be returned as result. - -.SH "EXCEPTIONAL RETURNS" -.PP -In the usual case where the \fB\-code\fR option isn't -specified the procedure will return normally (its completion -code will be TCL_OK). -However, the \fB\-code\fR option may be used to generate an -exceptional return from the procedure. -\fICode\fR may have any of the following values: -.TP 10 -\fBok\fR -Normal return: same as if the option is omitted. -.TP 10 -\fBerror\fR -Error return: same as if the \fBerror\fR command were used to -terminate the procedure, except for handling of \fBerrorInfo\fR -and \fBerrorCode\fR variables (see below). -.TP 10 -\fBreturn\fR -The current procedure will return with a completion code of -TCL_RETURN, so that the procedure that invoked it will return -also. -.TP 10 -\fBbreak\fR -The current procedure will return with a completion code of -TCL_BREAK, which will terminate the innermost nested loop in -the code that invoked the current procedure. -.TP 10 -\fBcontinue\fR -The current procedure will return with a completion code of -TCL_CONTINUE, which will terminate the current iteration of -the innermost nested loop in the code that invoked the current -procedure. -.TP 10 -\fIvalue\fR -\fIValue\fR must be an integer; it will be returned as the -completion code for the current procedure. -.LP -The \fB\-code\fR option is rarely used. -It is provided so that procedures that implement -new control structures can reflect exceptional conditions back to -their callers. -.PP -Two additional options, \fB\-errorinfo\fR and \fB\-errorcode\fR, -may be used to provide additional information during error -returns. -These options are ignored unless \fIcode\fR is \fBerror\fR. -.PP -The \fB\-errorinfo\fR option specifies an initial stack -trace for the \fBerrorInfo\fR variable; if it is not specified then -the stack trace left in \fBerrorInfo\fR will include the call to -the procedure and higher levels on the stack but it will not include -any information about the context of the error within the procedure. -Typically the \fIinfo\fR value is supplied from the value left -in \fBerrorInfo\fR after a \fBcatch\fR command trapped an error within -the procedure. -.PP -If the \fB\-errorcode\fR option is specified then \fIcode\fR provides -a value for the \fBerrorCode\fR variable. -If the option is not specified then \fBerrorCode\fR will -default to \fBNONE\fR. - -.SH KEYWORDS -break, continue, error, procedure, return diff --git a/doc/safe.n b/doc/safe.n deleted file mode 100644 index 749a57b..0000000 --- a/doc/safe.n +++ /dev/null @@ -1,350 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: safe.n,v 1.3 1999/04/16 00:46:36 stanton Exp $ -'\" -.so man.macros -.TH "Safe Tcl" n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -Safe\ Base \- A mechanism for creating and manipulating safe interpreters. -.SH SYNOPSIS -\fB::safe::interpCreate\fR ?\fIslave\fR? ?\fIoptions...\fR? -.sp -\fB::safe::interpInit\fR \fIslave\fR ?\fIoptions...\fR? -.sp -\fB::safe::interpConfigure\fR \fIslave\fR ?\fIoptions...\fR? -.sp -\fB::safe::interpDelete\fR \fIslave\fR -.sp -\fB::safe::interpAddToAccessPath\fR \fIslave\fR \fIdirectory\fR -.sp -\fB::safe::interpFindInAccessPath\fR \fIslave\fR \fIdirectory\fR -.sp -\fB::safe::setLogCmd\fR ?\fIcmd arg...\fR? -.SH OPTIONS -.PP -?\fB\-accessPath\fR \fIpathList\fR? -?\fB\-statics\fR \fIboolean\fR? ?\fB\-noStatics\fR? -?\fB\-nested\fR \fIboolean\fR? ?\fB\-nestedLoadOk\fR? -?\fB\-deleteHook\fR \fIscript\fR? -.BE - -.SH DESCRIPTION -Safe Tcl is a mechanism for executing untrusted Tcl scripts -safely and for providing mediated access by such scripts to -potentially dangerous functionality. -.PP -The Safe Base ensures that untrusted Tcl scripts cannot harm the -hosting application. -The Safe Base prevents integrity and privacy attacks. Untrusted Tcl -scripts are prevented from corrupting the state of the hosting -application or computer. Untrusted scripts are also prevented from -disclosing information stored on the hosting computer or in the -hosting application to any party. -.PP -The Safe Base allows a master interpreter to create safe, restricted -interpreters that contain a set of predefined aliases for the \fBsource\fR, -\fBload\fR, \fBfile\fR, \fBencoding\fR, and \fBexit\fR commands and -are able to use the auto-loading and package mechanisms. -.PP -No knowledge of the file system structure is leaked to the -safe interpreter, because it has access only to a virtualized path -containing tokens. When the safe interpreter requests to source a file, it -uses the token in the virtual path as part of the file name to source; the -master interpreter transparently -translates the token into a real directory name and executes the -requested operation (see the section \fBSECURITY\fR below for details). -Different levels of security can be selected by using the optional flags -of the commands described below. -.PP -All commands provided in the master interpreter by the Safe Base reside in -the \fBsafe\fR namespace: - -.SH COMMANDS -The following commands are provided in the master interpreter: -.TP -\fB::safe::interpCreate\fR ?\fIslave\fR? ?\fIoptions...\fR? -Creates a safe interpreter, installs the aliases described in the section -\fBALIASES\fR and initializes the auto-loading and package mechanism as -specified by the supplied \fBoptions\fR. -See the \fBOPTIONS\fR section below for a description of the -optional arguments. -If the \fIslave\fR argument is omitted, a name will be generated. -\fB::safe::interpCreate\fR always returns the interpreter name. -.TP -\fB::safe::interpInit\fR \fIslave\fR ?\fIoptions...\fR? -This command is similar to \fBinterpCreate\fR except it that does not -create the safe interpreter. \fIslave\fR must have been created by some -other means, like \fBinterp create \-safe\fR. -.TP -\fB::safe::interpConfigure\fR \fIslave\fR ?\fIoptions...\fR? -If no \fIoptions\fR are given, returns the settings for all options for the -named safe interpreter as a list of options and their current values -for that \fIslave\fR. -If a single additional argument is provided, -it will return a list of 2 elements \fIname\fR and \fIvalue\fR where -\fIname\fR is the full name of that option and \fIvalue\fR the current value -for that option and the \fIslave\fR. -If more than two additional arguments are provided, it will reconfigure the -safe interpreter and change each and only the provided options. -See the section on \fBOPTIONS\fR below for options description. -Example of use: -.RS -.CS -# Create a new interp with the same configuration as "$i0" : -set i1 [eval safe::interpCreate [safe::interpConfigure $i0]] -# Get the current deleteHook -set dh [safe::interpConfigure $i0 \-del] -# Change (only) the statics loading ok attribute of an interp -# and its deleteHook (leaving the rest unchanged) : -safe::interpConfigure $i0 \-delete {foo bar} \-statics 0 ; -.CE -.RE -.TP -\fB::safe::interpDelete\fR \fIslave\fR -Deletes the safe interpreter and cleans up the corresponding -master interpreter data structures. -If a \fIdeleteHook\fR script was specified for this interpreter it is -evaluated before the interpreter is deleted, with the name of the -interpreter as an additional argument. -.TP -\fB::safe::interpFindInAccessPath\fR \fIslave\fR \fIdirectory\fR -This command finds and returns the token for the real directory -\fIdirectory\fR in the safe interpreter's current virtual access path. -It generates an error if the directory is not found. -Example of use: -.RS -.CS -$slave eval [list set tk_library [::safe::interpFindInAccessPath $name $tk_library]] -.CE -.RE -.TP -\fB::safe::interpAddToAccessPath\fR \fIslave\fR \fIdirectory\fR -This command adds \fIdirectory\fR to the virtual path maintained for the -safe interpreter in the master, and returns the token that can be used in -the safe interpreter to obtain access to files in that directory. -If the directory is already in the virtual path, it only returns the token -without adding the directory to the virtual path again. -Example of use: -.RS -.CS -$slave eval [list set tk_library [::safe::interpAddToAccessPath $name $tk_library]] -.CE -.RE -.TP -\fB::safe::setLogCmd\fR ?\fIcmd arg...\fR? -This command installs a script that will be called when interesting -life cycle events occur for a safe interpreter. -When called with no arguments, it returns the currently installed script. -When called with one argument, an empty string, the currently installed -script is removed and logging is turned off. -The script will be invoked with one additional argument, a string -describing the event of interest. -The main purpose is to help in debugging safe interpreters. -Using this facility you can get complete error messages while the safe -interpreter gets only generic error messages. -This prevents a safe interpreter from seeing messages about failures -and other events that might contain sensitive information such as real -directory names. -.RS -Example of use: -.CS -::safe::setLogCmd puts stderr -.CE -Below is the output of a sample session in which a safe interpreter -attempted to source a file not found in its virtual access path. -Note that the safe interpreter only received an error message saying that -the file was not found: -.CS -NOTICE for slave interp10 : Created -NOTICE for slave interp10 : Setting accessPath=(/foo/bar) staticsok=1 nestedok=0 deletehook=() -NOTICE for slave interp10 : auto_path in interp10 has been set to {$p(:0:)} -ERROR for slave interp10 : /foo/bar/init.tcl: no such file or directory -.CE -.RE - -.SH OPTIONS -The following options are common to -\fB::safe::interpCreate\fR, \fB::safe::interpInit\fR, -and \fB::safe::interpConfigure\fR. -Any option name can be abbreviated to its minimal -non-ambiguous name. -Option names are not case sensitive. -.TP -\fB\-accessPath\fR \fIdirectoryList\fR -This option sets the list of directories from which the safe interpreter -can \fBsource\fR and \fBload\fR files. -If this option is not specified, or if it is given as the -empty list, the safe interpreter will use the same directories as its -master for auto-loading. -See the section \fBSECURITY\fR below for more detail about virtual paths, -tokens and access control. -.TP -\fB\-statics\fR \fIboolean\fR -This option specifies if the safe interpreter will be allowed -to load statically linked packages (like \fBload {} Tk\fR). -The default value is \fBtrue\fR : -safe interpreters are allowed to load statically linked packages. -.TP -\fB\-noStatics\fR -This option is a convenience shortcut for \fB-statics false\fR and -thus specifies that the safe interpreter will not be allowed -to load statically linked packages. -.TP -\fB\-nested\fR \fIboolean\fR -This option specifies if the safe interpreter will be allowed -to load packages into its own sub-interpreters. -The default value is \fBfalse\fR : -safe interpreters are not allowed to load packages into -their own sub-interpreters. -.TP -\fB\-nestedLoadOk\fR -This option is a convenience shortcut for \fB-nested true\fR and -thus specifies the safe interpreter will be allowed -to load packages into its own sub-interpreters. -.TP -\fB\-deleteHook\fR \fIscript\fR -When this option is given an non empty \fIscript\fR, it will be -evaluated in the master with the name of -the safe interpreter as an additional argument -just before actually deleting the safe interpreter. -Giving an empty value removes any currently installed deletion hook -script for that safe interpreter. -The default value (\fB{}\fR) is not to have any deletion call back. -.SH ALIASES -The following aliases are provided in a safe interpreter: -.TP -\fBsource\fR \fIfileName\fR -The requested file, a Tcl source file, is sourced into the safe interpreter -if it is found. -The \fBsource\fR alias can only source files from directories in -the virtual path for the safe interpreter. The \fBsource\fR alias requires -the safe interpreter to -use one of the token names in its virtual path to denote the directory in -which the file to be sourced can be found. -See the section on \fBSECURITY\fR for more discussion of restrictions on -valid filenames. -.TP -\fBload\fR \fIfileName\fR -The requested file, a shared object file, is dynamically loaded into the -safe interpreter if it is found. -The filename must contain a token name mentioned in the virtual path for -the safe interpreter for it to be found successfully. -Additionally, the shared object file must contain a safe entry point; see -the manual page for the \fBload\fR command for more details. -.TP -\fBfile\fR ?\fIsubCmd args...\fR? -The \fBfile\fR alias provides access to a safe subset of the subcommands of -the \fBfile\fR command; it allows only \fBdirname\fR, \fBjoin\fR, -\fBextension\fR, \fBroot\fR, \fBtail\fR, \fBpathname\fR and \fBsplit\fR -subcommands. For more details on what these subcommands do see the manual -page for the \fBfile\fR command. -.TP -\fBencoding\fR ?\fIsubCmd args...\fR? -The \fBenconding\fR alias provides access to a safe subset of the -subcommands of the \fBencoding\fR command; it disallows setting of -the system encoding, but allows all other subcommands including -\fBsystem\fR to check the current encoding. -.TP -\fBexit\fR -The calling interpreter is deleted and its computation is stopped, but the -Tcl process in which this interpreter exists is not terminated. - -.SH SECURITY -The Safe Base does not attempt to completely prevent annoyance and -denial of service attacks. These forms of attack prevent the -application or user from temporarily using the computer to perform -useful work, for example by consuming all available CPU time or -all available screen real estate. -These attacks, while aggravating, are deemed to be of lesser importance -in general than integrity and privacy attacks that the Safe Base -is to prevent. -.PP -The commands available in a safe interpreter, in addition to -the safe set as defined in \fBinterp\fR manual page, are mediated aliases -for \fBsource\fR, \fBload\fR, \fBexit\fR, and safe subsets of -\fBfile\fR and \fBencoding\fR. The safe interpreter can also auto-load -code and it can request that packages be loaded. -.PP -Because some of these commands access the local file system, there is a -potential for information leakage about its directory structure. -To prevent this, commands that take file names as arguments in a safe -interpreter use tokens instead of the real directory names. -These tokens are translated to the real directory name while a request to, -e.g., source a file is mediated by the master interpreter. -This virtual path system is maintained in the master interpreter for each safe -interpreter created by \fB::safe::interpCreate\fR or initialized by -\fB::safe::interpInit\fR and -the path maps tokens accessible in the safe interpreter into real path -names on the local file system thus preventing safe interpreters -from gaining knowledge about the -structure of the file system of the host on which the interpreter is -executing. -The only valid file names arguments -for the \fBsource\fR and \fBload\fR aliases provided to the slave -are path in the form of -\fB[file join \fR\fItoken filename\fR\fB]\fR (ie, when using the -native file path formats: \fItoken\fR\fB/\fR\fIfilename\fR -on Unix, \fItoken\fR\fB\\\fIfilename\fR on Windows, -and \fItoken\fR\fB:\fR\fIfilename\fR on the Mac), -where \fItoken\fR is representing one of the directories -of the \fIaccessPath\fR list and \fIfilename\fR is -one file in that directory (no sub directories access are allowed). -.PP -When a token is used in a safe interpreter in a request to source or -load a file, the token is checked and -translated to a real path name and the file to be -sourced or loaded is located on the file system. -The safe interpreter never gains knowledge of the actual path name under -which the file is stored on the file system. -.PP -To further prevent potential information leakage from sensitive files that -are accidentally included in the set of files that can be sourced by a safe -interpreter, the \fBsource\fR alias restricts access to files -meeting the following constraints: the file name must -fourteen characters or shorter, must not contain more than one dot ("\fB.\fR"), -must end up with the extension \fB.tcl\fR or be called \fBtclIndex\fR. -.PP -Each element of the initial access path -list will be assigned a token that will be set in -the slave \fBauto_path\fR and the first element of that list will be set as -the \fBtcl_library\fR for that slave. -.PP -If the access path argument is not given or is the empty list, -the default behavior is to let the slave access the same packages -as the master has access to (Or to be more precise: -only packages written in Tcl (which by definition can't be dangerous -as they run in the slave interpreter) and C extensions that -provides a Safe_Init entry point). For that purpose, the master's -\fBauto_path\fR will be used to construct the slave access path. -In order that the slave successfully loads the Tcl library files -(which includes the auto-loading mechanism itself) the \fBtcl_library\fR will be -added or moved to the first position if necessary, in the -slave access path, so the slave -\fBtcl_library\fR will be the same as the master's (its real -path will still be invisible to the slave though). -In order that auto-loading works the same for the slave and -the master in this by default case, the first-level -sub directories of each directory in the master \fBauto_path\fR will -also be added (if not already included) to the slave access path. -You can always specify a more -restrictive path for which sub directories will never be searched by -explicitly specifying your directory list with the \fB\-accessPath\fR flag -instead of relying on this default mechanism. -.PP -When the \fIaccessPath\fR is changed after the first creation or -initialization (ie through \fBinterpConfigure -accessPath \fR\fIlist\fR), -an \fBauto_reset\fR is automatically evaluated in the safe interpreter -to synchronize its \fBauto_index\fR with the new token list. - -.SH "SEE ALSO" -interp(n), library(n), load(n), package(n), source(n), unknown(n) - -.SH KEYWORDS -alias, auto\-loading, auto_mkindex, load, master interpreter, safe -interpreter, slave interpreter, source diff --git a/doc/scan.n b/doc/scan.n deleted file mode 100644 index 123ec5b..0000000 --- a/doc/scan.n +++ /dev/null @@ -1,182 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: scan.n,v 1.3 1999/04/16 00:46:36 stanton Exp $ -'\" -.so man.macros -.TH scan n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -scan \- Parse string using conversion specifiers in the style of sscanf -.SH SYNOPSIS -\fBscan \fIstring format varName \fR?\fIvarName ...\fR? -.BE - -.SH INTRODUCTION -.PP -This command parses fields from an input string in the same fashion -as the ANSI C \fBsscanf\fR procedure and returns a count of the number -of conversions performed, or -1 if the end of the input string is -reached before any conversions have been performed. -\fIString\fR gives the input to be parsed and \fIformat\fR indicates -how to parse it, using \fB%\fR conversion specifiers as in \fBsscanf\fR. -Each \fIvarName\fR gives the name of a variable; when a field is -scanned from \fIstring\fR the result is converted back into a string -and assigned to the corresponding variable. - -.SH "DETAILS ON SCANNING" -.PP -\fBScan\fR operates by scanning \fIstring\fR and \fIformat\fR together. -If the next character in \fIformat\fR is a blank or tab then it -matches any number of white space characters in \fIstring\fR (including -zero). -Otherwise, if it isn't a \fB%\fR character then it -must match the next character of \fIstring\fR. -When a \fB%\fR is encountered in \fIformat\fR, it indicates -the start of a conversion specifier. -A conversion specifier contains up to four fields after the \fB%\fR: -a \fB*\fR, which indicates that the converted value is to be discarded -.VS 8.1 -instead of assigned to a variable; a XPG3 position specifier; a number -.VE 8.1 -indicating a maximum field width; and a conversion character. -All of these fields are optional except for the conversion character. -The fields that are present must appear in the order given above. -.PP -When \fBscan\fR finds a conversion specifier in \fIformat\fR, it -first skips any white-space characters in \fIstring\fR (unless the -specifier is \fB[\fR or \fBc\fR). -Then it converts the next input characters according to the -conversion specifier and stores the result in the variable given -by the next argument to \fBscan\fR. -.VS 8.1 -.PP -If the \fB%\fR is followed by a decimal number and a \fB$\fR, as in -``\fB%2$d\fR'', then the variable to use is not taken from the next -sequential argument. Instead, it is taken from the argument indicated -by the number, where 1 corresponds to the first \fIvarName\fR. If -there are any positional specifiers in \fIformat\fR then all of the -specifiers must be positional. Every \fIvarName\fR on the argument -list must correspond to exactly one conversion specifier or an error -is generated. -.VE 8.1 -.PP -The following conversion characters are supported: -.TP 10 -\fBd\fR -The input field must be a decimal integer. -It is read in and the value is stored in the variable as a decimal string. -.TP 10 -\fBo\fR -The input field must be an octal integer. It is read in and the -value is stored in the variable as a decimal string. -.TP 10 -\fBx\fR -The input field must be a hexadecimal integer. It is read in -and the value is stored in the variable as a decimal string. -.VS 8.1 -.TP 10 -\fBu\fR -The input field must be a decimal integer. The value is stored in the -variable as an unsigned decimal integer string. -.TP 10 -\fBi\fR -The input field must be an integer. The base (i.e. decimal, octal, or -hexadecimal) is determined in the same fashion as described in -\fBexpr\fR. The value is stored in the variable as a decimal string. -.VE 8.1 -.TP 10 -\fBc\fR -A single character is read in and its binary value is stored in -the variable as a decimal string. -Initial white space is not skipped in this case, so the input -field may be a white-space character. -This conversion is different from the ANSI standard in that the -input field always consists of a single character and no field -width may be specified. -.TP 10 -\fBs\fR -The input field consists of all the characters up to the next -white-space character; the characters are copied to the variable. -.TP 10 -\fBe\fR or \fBf\fR or \fBg\fR -The input field must be a floating-point number consisting -of an optional sign, a string of decimal digits possibly -containing a decimal point, and an optional exponent consisting -of an \fBe\fR or \fBE\fR followed by an optional sign and a string of -decimal digits. -It is read in and stored in the variable as a floating-point string. -.TP 10 -\fB[\fIchars\fB]\fR -The input field consists of any number of characters in -\fIchars\fR. -The matching string is stored in the variable. -If the first character between the brackets is a \fB]\fR then -it is treated as part of \fIchars\fR rather than the closing -bracket for the set. -.VS 8.1 -If \fIchars\fR -contains a sequence of the form \fIa\fB\-\fIb\fR then any -character between \fIa\fR and \fIb\fR (inclusive) will match. -If the first or last character between the brackets is a \fB\-\fR, then -it is treated as part of \fIchars\fR rather than indicating a range. -.VE 8.1 -.TP 10 -\fB[^\fIchars\fB]\fR -The input field consists of any number of characters not in -\fIchars\fR. -The matching string is stored in the variable. -If the character immediately following the \fB^\fR is a \fB]\fR then it is -treated as part of the set rather than the closing bracket for -the set. -.VS 8.1 -If \fIchars\fR -contains a sequence of the form \fIa\fB\-\fIb\fR then any -character between \fIa\fR and \fIb\fR (inclusive) will be excluded -from the set. -If the first or last character between the brackets is a \fB\-\fR, then -it is treated as part of \fIchars\fR rather than indicating a range. -.TP 10 -\fBn\fR -No input is consumed from the input string. Instead, the total number -of chacters scanned from the input string so far is stored in the variable. -.VE 8.1 -.LP -The number of characters read from the input for a conversion is the -largest number that makes sense for that particular conversion (e.g. -as many decimal digits as possible for \fB%d\fR, as -many octal digits as possible for \fB%o\fR, and so on). -The input field for a given conversion terminates either when a -white-space character is encountered or when the maximum field -width has been reached, whichever comes first. -If a \fB*\fR is present in the conversion specifier -then no variable is assigned and the next scan argument is not consumed. - -.SH "DIFFERENCES FROM ANSI SSCANF" -.PP -The behavior of the \fBscan\fR command is the same as the behavior of -the ANSI C \fBsscanf\fR procedure except for the following differences: -.VS 8.1 -.IP [1] -\fB%p\fR conversion specifier is not currently -supported. -.VE 8.1 -.IP [2] -For \fB%c\fR conversions a single character value is -converted to a decimal string, which is then assigned to the -corresponding \fIvarName\fR; -no field width may be specified for this conversion. -.IP [3] -The \fBl\fR, \fBh\fR, and \fBL\fR modifiers are ignored; integer -values are always converted as if there were no modifier present -and real values are always converted as if the \fBl\fR modifier -were present (i.e. type \fBdouble\fR is used for the internal -representation). - -.SH KEYWORDS -conversion specifier, parse, scan diff --git a/doc/seek.n b/doc/seek.n deleted file mode 100644 index 3620e83..0000000 --- a/doc/seek.n +++ /dev/null @@ -1,55 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: seek.n,v 1.2 1998/09/14 18:39:55 stanton Exp $ -'\" -.so man.macros -.TH seek n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -seek \- Change the access position for an open channel -.SH SYNOPSIS -\fBseek \fIchannelId offset \fR?\fIorigin\fR? -.BE - -.SH DESCRIPTION -.PP -Changes the current access position for \fIchannelId\fR. -\fIChannelId\fR must be a channel identifier such as returned from a -previous invocation of \fBopen\fR or \fBsocket\fR. -The \fIoffset\fR and \fIorigin\fR -arguments specify the position at which the next read or write will occur -for \fIchannelId\fR. \fIOffset\fR must be an integer (which may be -negative) and \fIorigin\fR must be one of the following: -.TP 10 -\fBstart\fR -The new access position will be \fIoffset\fR bytes from the start -of the underlying file or device. -.TP 10 -\fBcurrent\fR -The new access position will be \fIoffset\fR bytes from the current -access position; a negative \fIoffset\fR moves the access position -backwards in the underlying file or device. -.TP 10 -\fBend\fR -The new access position will be \fIoffset\fR bytes from the end of -the file or device. A negative \fIoffset\fR places the access position -before the end of file, and a positive \fIoffset\fR places the access -position after the end of file. -.LP -The \fIorigin\fR argument defaults to \fBstart\fR. -.PP -The command flushes all buffered output for the channel before the command -returns, even if the channel is in nonblocking mode. -It also discards any buffered and unread input. -This command returns an empty string. -An error occurs if this command is applied to channels whose underlying -file or device does not support seeking. - -.SH KEYWORDS -access position, file, seek diff --git a/doc/set.n b/doc/set.n deleted file mode 100644 index b9d1bb5..0000000 --- a/doc/set.n +++ /dev/null @@ -1,48 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: set.n,v 1.2 1998/09/14 18:39:55 stanton Exp $ -'\" -.so man.macros -.TH set n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -set \- Read and write variables -.SH SYNOPSIS -\fBset \fIvarName \fR?\fIvalue\fR? -.BE - -.SH DESCRIPTION -.PP -Returns the value of variable \fIvarName\fR. -If \fIvalue\fR is specified, then set -the value of \fIvarName\fR to \fIvalue\fR, creating a new variable -if one doesn't already exist, and return its value. -If \fIvarName\fR contains an open parenthesis and ends with a -close parenthesis, then it refers to an array element: the characters -before the first open parenthesis are the name of the array, -and the characters between the parentheses are the index within the array. -Otherwise \fIvarName\fR refers to a scalar variable. -Normally, \fIvarName\fR is unqualified -(does not include the names of any containing namespaces), -and the variable of that name in the current namespace is read or written. -If \fIvarName\fR includes namespace qualifiers -(in the array name if it refers to an array element), -the variable in the specified namespace is read or written. -.PP -If no procedure is active, -then \fIvarName\fR refers to a namespace variable -(global variable if the current namespace is the global namespace). -If a procedure is active, then \fIvarName\fR refers to a parameter -or local variable of the procedure unless the \fBglobal\fR command -was invoked to declare \fIvarName\fR to be global, -or unless a \fBvariable\fR command -was invoked to declare \fIvarName\fR to be a namespace variable. - -.SH KEYWORDS -read, write, variable diff --git a/doc/socket.n b/doc/socket.n deleted file mode 100644 index d73883f..0000000 --- a/doc/socket.n +++ /dev/null @@ -1,134 +0,0 @@ -'\" -'\" Copyright (c) 1996 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. -'\" -'\" RCS: @(#) $Id: socket.n,v 1.4 1999/04/16 00:46:36 stanton Exp $ -.so man.macros -.TH socket n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -socket \- Open a TCP network connection -.SH SYNOPSIS -.sp -\fBsocket \fR?\fIoptions\fR? \fIhost port\fR -.sp -\fBsocket\fR \fB\-server \fIcommand\fR ?\fIoptions\fR? \fIport\fR -.BE - -.SH DESCRIPTION -.PP -This command opens a network socket and returns a channel -identifier that may be used in future invocations of commands like -\fBread\fR, \fBputs\fR and \fBflush\fR. -At present only the TCP network protocol is supported; future -releases may include support for additional protocols. -The \fBsocket\fR command may be used to open either the client or -server side of a connection, depending on whether the \fB\-server\fR -switch is specified. - -.SH "CLIENT SOCKETS" -.PP -If the \fB\-server\fR option is not specified, then the client side of a -connection is opened and the command returns a channel identifier -that can be used for both reading and writing. -\fIPort\fR and \fIhost\fR specify a port -to connect to; there must be a server accepting connections on -this port. \fIPort\fR is an integer port number and \fIhost\fR -is either a domain-style name such as \fBwww.sunlabs.com\fR or -a numerical IP address such as \fB127.0.0.1\fR. -Use \fIlocalhost\fR to refer to the host on which the command is invoked. -.PP -The following options may also be present before \fIhost\fR -to specify additional information about the connection: -.TP -\fB\-myaddr\fI addr\fR -\fIAddr\fR gives the domain-style name or numerical IP address of -the client-side network interface to use for the connection. -This option may be useful if the client machine has multiple network -interfaces. If the option is omitted then the client-side interface -will be chosen by the system software. -.TP -\fB\-myport\fI port\fR -\fIPort\fR specifies an integer port number to use for the client's -side of the connection. If this option is omitted, the client's -port number will be chosen at random by the system software. -.TP -\fB\-async\fR -The \fB\-async\fR option will cause the client socket to be connected -asynchronously. This means that the socket will be created immediately but -may not yet be connected to the server, when the call to \fBsocket\fR -returns. When a \fBgets\fR or \fBflush\fR is done on the socket before the -connection attempt succeeds or fails, if the socket is in blocking mode, the -operation will wait until the connection is completed or fails. If the -socket is in nonblocking mode and a \fBgets\fR or \fBflush\fR is done on -the socket before the connection attempt succeeds or fails, the operation -returns immediately and \fBfblocked\fR on the socket returns 1. - -.SH "SERVER SOCKETS" -.PP -If the \fB\-server\fR option is specified then the new socket -will be a server for the port given by \fIport\fR. -Tcl will automatically accept connections to the given port. -For each connection Tcl will create a new channel that may be used to -communicate with the client. Tcl then invokes \fIcommand\fR -with three additional arguments: the name of the new channel, the -address, in network address notation, of the client's host, and -the client's port number. -.PP -The following additional option may also be specified before \fIhost\fR: -.TP -\fB\-myaddr\fI addr\fR -\fIAddr\fR gives the domain-style name or numerical IP address of -the server-side network interface to use for the connection. -This option may be useful if the server machine has multiple network -interfaces. If the option is omitted then the server socket is bound -to the special address INADDR_ANY so that it can accept connections from -any interface. -.PP -Server channels cannot be used for input or output; their sole use is to -accept new client connections. The channels created for each incoming -client connection are opened for input and output. Closing the server -channel shuts down the server so that no new connections will be -accepted; however, existing connections will be unaffected. -.PP -Server sockets depend on the Tcl event mechanism to find out when -new connections are opened. If the application doesn't enter the -event loop, for example by invoking the \fBvwait\fR command or -calling the C procedure \fBTcl_DoOneEvent\fR, then no connections -will be accepted. - -.SH CONFIGURATION OPTIONS -The \fBfconfigure\fR command can be used to query several readonly -configuration options for socket channels: -.VS 8.0.5 -.TP -\fB\-error\fR -This option gets the current error status of the given socket. This -is useful when you need to determine if an asynchronous connect -operation succeeded. If there was an error, the error message is -returned. If there was no error, an empty string is returned. -.VE 8.0.5 -.TP -\fB\-sockname\fR -This option returns a list of three elements, the address, the host name -and the port number for the socket. If the host name cannot be computed, -the second element is identical to the address, the first element of the -list. -.TP -\fB\-peername\fR -This option is not supported by server sockets. For client and accepted -sockets, this option returns a list of three elements; these are the -address, the host name and the port to which the peer socket is connected -or bound. If the host name cannot be computed, the second element of the -list is identical to the address, its first element. -.PP - -.SH "SEE ALSO" -flush(n), open(n), read(n) - -.SH KEYWORDS -bind, channel, connection, domain name, host, network address, socket, tcp diff --git a/doc/source.n b/doc/source.n deleted file mode 100644 index 024ab7b..0000000 --- a/doc/source.n +++ /dev/null @@ -1,44 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: source.n,v 1.2 1998/09/14 18:39:55 stanton Exp $ -'\" -.so man.macros -.TH source n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -source \- Evaluate a file or resource as a Tcl script -.SH SYNOPSIS -\fBsource \fIfileName\fR -.sp -\fBsource\fR \fB\-rsrc \fIresourceName \fR?\fIfileName\fR? -.sp -\fBsource\fR \fB\-rsrcid \fIresourceId \fR?\fIfileName\fR? -.BE - -.SH DESCRIPTION -.PP -This command takes the contents of the specified file or resource -and passes it to the Tcl interpreter as a text script. The return -value from \fBsource\fR is the return value of the last command -executed in the script. If an error occurs in evaluating the contents -of the script then the \fBsource\fR command will return that error. -If a \fBreturn\fR command is invoked from within the script then the -remainder of the file will be skipped and the \fBsource\fR command -will return normally with the result from the \fBreturn\fR command. - -The \fI\-rsrc\fR and \fI\-rsrcid\fR forms of this command are only -available on Macintosh computers. These versions of the command -allow you to source a script from a \fBTEXT\fR resource. You may specify -what \fBTEXT\fR resource to source by either name or id. By default Tcl -searches all open resource files, which include the current -application and any loaded C extensions. Alternatively, you may -specify the \fIfileName\fR where the \fBTEXT\fR resource can be found. - -.SH KEYWORDS -file, script diff --git a/doc/split.n b/doc/split.n deleted file mode 100644 index 04773b0..0000000 --- a/doc/split.n +++ /dev/null @@ -1,44 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: split.n,v 1.2 1998/09/14 18:39:55 stanton Exp $ -'\" -.so man.macros -.TH split n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -split \- Split a string into a proper Tcl list -.SH SYNOPSIS -\fBsplit \fIstring \fR?\fIsplitChars\fR? -.BE - -.SH DESCRIPTION -.PP -Returns a list created by splitting \fIstring\fR at each character -that is in the \fIsplitChars\fR argument. -Each element of the result list will consist of the -characters from \fIstring\fR that lie between instances of the -characters in \fIsplitChars\fR. -Empty list elements will be generated if \fIstring\fR contains -adjacent characters in \fIsplitChars\fR, or if the first or last -character of \fIstring\fR is in \fIsplitChars\fR. -If \fIsplitChars\fR is an empty string then each character of -\fIstring\fR becomes a separate element of the result list. -\fISplitChars\fR defaults to the standard white-space characters. -For example, -.CS -\fBsplit "comp.unix.misc" .\fR -.CE -returns \fB"comp unix misc"\fR and -.CS -\fBsplit "Hello world" {}\fR -.CE -returns \fB"H e l l o { } w o r l d"\fR. - -.SH KEYWORDS -list, split, string diff --git a/doc/string.n b/doc/string.n deleted file mode 100644 index 42d6e0b..0000000 --- a/doc/string.n +++ /dev/null @@ -1,143 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: string.n,v 1.3 1999/04/16 00:46:36 stanton Exp $ -'\" -.so man.macros -.TH string n 7.6 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -string \- Manipulate strings -.SH SYNOPSIS -\fBstring \fIoption arg \fR?\fIarg ...?\fR -.BE - -.SH DESCRIPTION -.PP -Performs one of several string operations, depending on \fIoption\fR. -The legal \fIoption\fRs (which may be abbreviated) are: -.TP -\fBstring compare \fIstring1 string2\fR -Perform a character-by-character comparison of strings \fIstring1\fR and -\fIstring2\fR in the same way as the C \fBstrcmp\fR procedure. Return -\-1, 0, or 1, depending on whether \fIstring1\fR is lexicographically -less than, equal to, or greater than \fIstring2\fR. -.TP -\fBstring first \fIstring1 string2\fR -Search \fIstring2\fR for a sequence of characters that exactly match -the characters in \fIstring1\fR. If found, return the index of the -first character in the first such match within \fIstring2\fR. If not -found, return \-1. -.TP -\fBstring index \fIstring charIndex\fR -Returns the \fIcharIndex\fR'th character of the \fIstring\fR -argument. A \fIcharIndex\fR of 0 corresponds to the first -character of the string. -If \fIcharIndex\fR is less than 0 or greater than -or equal to the length of the string then an empty string is -returned. -.TP -\fBstring last \fIstring1 string2\fR -Search \fIstring2\fR for a sequence of characters that exactly match -the characters in \fIstring1\fR. If found, return the index of the -first character in the last such match within \fIstring2\fR. If there -is no match, then return \-1. -.TP -\fBstring length \fIstring\fR -Returns a decimal string giving the number of characters in \fIstring\fR. -.TP -\fBstring match \fIpattern\fR \fIstring\fR -See if \fIpattern\fR matches \fIstring\fR; return 1 if it does, 0 -if it doesn't. Matching is done in a fashion similar to that -used by the C-shell. For the two strings to match, their contents -must be identical except that the following special sequences -may appear in \fIpattern\fR: -.RS -.IP \fB*\fR 10 -Matches any sequence of characters in \fIstring\fR, -including a null string. -.IP \fB?\fR 10 -Matches any single character in \fIstring\fR. -.IP \fB[\fIchars\fB]\fR 10 -Matches any character in the set given by \fIchars\fR. If a sequence -of the form -\fIx\fB\-\fIy\fR appears in \fIchars\fR, then any character -between \fIx\fR and \fIy\fR, inclusive, will match. -.IP \fB\e\fIx\fR 10 -Matches the single character \fIx\fR. This provides a way of -avoiding the special interpretation of the characters -\fB*?[]\e\fR in \fIpattern\fR. -.RE -.TP -\fBstring range \fIstring first last\fR -Returns a range of consecutive characters from \fIstring\fR, starting -with the character whose index is \fIfirst\fR and ending with the -character whose index is \fIlast\fR. An index of 0 refers to the -first character of the string. -An index of \fBend\fR (or any -abbreviation of it) refers to the last character of the string. -If \fIfirst\fR is less than zero then it is treated as if it were zero, and -if \fIlast\fR is greater than or equal to the length of the string then -it is treated as if it were \fBend\fR. If \fIfirst\fR is greater than -\fIlast\fR then an empty string is returned. -.VS -.TP -\fBstring tolower \fIstring\fR -Returns a value equal to \fIstring\fR except that all upper (or title) -case letters have been converted to lower case. -.TP -\fBstring totitle \fIstring\fR -Returns a value equal to \fIstring\fR except that the first character -in \fIstring\fR is converted to its Unicode title case variant (or upper -case if there is no title case variant) and the rest of the string is -converted to lower case. -.TP -\fBstring toupper \fIstring\fR -Returns a value equal to \fIstring\fR except that all lower (or title) -case letters have been converted to upper case. -.VE -.TP -\fBstring trim \fIstring\fR ?\fIchars\fR? -Returns a value equal to \fIstring\fR except that any leading -or trailing characters from the set given by \fIchars\fR are -removed. -If \fIchars\fR is not specified then white space is removed -(spaces, tabs, newlines, and carriage returns). -.TP -\fBstring trimleft \fIstring\fR ?\fIchars\fR? -Returns a value equal to \fIstring\fR except that any -leading characters from the set given by \fIchars\fR are -removed. -If \fIchars\fR is not specified then white space is removed -(spaces, tabs, newlines, and carriage returns). -.TP -\fBstring trimright \fIstring\fR ?\fIchars\fR? -Returns a value equal to \fIstring\fR except that any -trailing characters from the set given by \fIchars\fR are -removed. -If \fIchars\fR is not specified then white space is removed -(spaces, tabs, newlines, and carriage returns). -.VS -.TP -\fBstring wordend \fIstring index\fR -Returns the index of the character just after the last one in the word -containing character \fIindex\fR of \fIstring\fR. A word is -considered to be any contiguous range of alphanumeric (Unicode letters -or decimal digits) or underscore (Unicode connector punctuation) -characters, or any single character other than these. -.TP -\fBstring wordstart \fIstring index\fR -Returns the index of the first character in the word containing -character \fIindex\fR of \fIstring\fR. A word is considered to be any -contiguous range of alphanumeric (Unicode letters or decimal digits) -or underscore (Unicode connector punctuation) characters, or any -single character other than these. -.VE - -.SH KEYWORDS -case conversion, compare, index, match, pattern, string, word diff --git a/doc/subst.n b/doc/subst.n deleted file mode 100644 index 8675c22..0000000 --- a/doc/subst.n +++ /dev/null @@ -1,48 +0,0 @@ -'\" -'\" Copyright (c) 1994 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: subst.n,v 1.2 1998/09/14 18:39:55 stanton Exp $ -'\" -.so man.macros -.TH subst n 7.4 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -subst \- Perform backslash, command, and variable substitutions -.SH SYNOPSIS -\fBsubst \fR?\fB\-nobackslashes\fR? ?\fB\-nocommands\fR? ?\fB\-novariables\fR? \fIstring\fR -.BE - -.SH DESCRIPTION -.PP -This command performs variable substitutions, command substitutions, -and backslash substitutions on its \fIstring\fR argument and -returns the fully-substituted result. -The substitutions are performed in exactly the same way as for -Tcl commands. -As a result, the \fIstring\fR argument is actually substituted twice, -once by the Tcl parser in the usual fashion for Tcl commands, and -again by the \fIsubst\fR command. -.PP -If any of the \fB\-nobackslashes\fR, \fB\-nocommands\fR, or -\fB\-novariables\fR are specified, then the corresponding substitutions -are not performed. -For example, if \fB\-nocommands\fR is specified, no command substitution -is performed: open and close brackets are treated as ordinary characters -with no special interpretation. -.PP -Note: when it performs its substitutions, \fIsubst\fR does not -give any special treatment to double quotes or curly braces. For -example, the script -.CS -\fBset a 44 -subst {xyz {$a}}\fR -.CE -returns ``\fBxyz {44}\fR'', not ``\fBxyz {$a}\fR''. - -.SH KEYWORDS -backslash substitution, command substitution, variable substitution diff --git a/doc/switch.n b/doc/switch.n deleted file mode 100644 index 503a5ba..0000000 --- a/doc/switch.n +++ /dev/null @@ -1,107 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: switch.n,v 1.2 1998/09/14 18:39:55 stanton Exp $ -'\" -.so man.macros -.TH switch n 7.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -switch \- Evaluate one of several scripts, depending on a given value -.SH SYNOPSIS -\fBswitch \fR?\fIoptions\fR?\fI string pattern body \fR?\fIpattern body \fR...? -.sp -\fBswitch \fR?\fIoptions\fR?\fI string \fR{\fIpattern body \fR?\fIpattern body \fR...?} -.BE - -.SH DESCRIPTION -.PP -The \fBswitch\fR command matches its \fIstring\fR argument against each of -the \fIpattern\fR arguments in order. -As soon as it finds a \fIpattern\fR that matches \fIstring\fR it -evaluates the following \fIbody\fR argument by passing it recursively -to the Tcl interpreter and returns the result of that evaluation. -If the last \fIpattern\fR argument is \fBdefault\fR then it matches -anything. -If no \fIpattern\fR argument -matches \fIstring\fR and no default is given, then the \fBswitch\fR -command returns an empty string. -.PP -If the initial arguments to \fBswitch\fR start with \fB\-\fR then -they are treated as options. The following options are -currently supported: -.TP 10 -\fB\-exact\fR -Use exact matching when comparing \fIstring\fR to a pattern. This -is the default. -.TP 10 -\fB\-glob\fR -When matching \fIstring\fR to the patterns, use glob-style matching -(i.e. the same as implemented by the \fBstring match\fR command). -.TP 10 -\fB\-regexp\fR -When matching \fIstring\fR to the patterns, use regular -expression matching -(i.e. the same as implemented by the \fBregexp\fR command). -.TP 10 -\fB\-\|\-\fR -Marks the end of options. The argument following this one will -be treated as \fIstring\fR even if it starts with a \fB\-\fR. -.PP -Two syntaxes are provided for the \fIpattern\fR and \fIbody\fR arguments. -The first uses a separate argument for each of the patterns and commands; -this form is convenient if substitutions are desired on some of the -patterns or commands. -The second form places all of the patterns and commands together into -a single argument; the argument must have proper list structure, with -the elements of the list being the patterns and commands. -The second form makes it easy to construct multi-line switch commands, -since the braces around the whole list make it unnecessary to include a -backslash at the end of each line. -Since the \fIpattern\fR arguments are in braces in the second form, -no command or variable substitutions are performed on them; this makes -the behavior of the second form different than the first form in some -cases. -.PP -If a \fIbody\fR is specified as ``\fB\-\fR'' it means that the \fIbody\fR -for the next pattern should also be used as the body for this -pattern (if the next pattern also has a body of ``\fB\-\fR'' -then the body after that is used, and so on). -This feature makes it possible to share a single \fIbody\fR among -several patterns. -.PP -Below are some examples of \fBswitch\fR commands: -.CS -\fBswitch\0abc\0a\0\-\0b\0{format 1}\0abc\0{format 2}\0default\0{format 3}\fR -.CE -will return \fB2\fR, -.CS -\fBswitch\0\-regexp\0aaab { - ^a.*b$\0\- - b\0{format 1} - a*\0{format 2} - default\0{format 3} -}\fR -.CE -will return \fB1\fR, and -.CS -\fBswitch\0xyz { - a - \- - b - {format 1} - a* - {format 2} - default - {format 3} -}\fR -.CE -will return \fB3\fR. - -.SH KEYWORDS -switch, match, regular expression diff --git a/doc/tclsh.1 b/doc/tclsh.1 deleted file mode 100644 index 8918a23..0000000 --- a/doc/tclsh.1 +++ /dev/null @@ -1,118 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: tclsh.1,v 1.2 1998/09/14 18:39:55 stanton Exp $ -'\" -.so man.macros -.TH tclsh 1 "" Tcl "Tcl Applications" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tclsh \- Simple shell containing Tcl interpreter -.SH SYNOPSIS -\fBtclsh\fR ?\fIfileName arg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -\fBTclsh\fR is a shell-like application that reads Tcl commands -from its standard input or from a file and evaluates them. -If invoked with no arguments then it runs interactively, reading -Tcl commands from standard input and printing command results and -error messages to standard output. -It runs until the \fBexit\fR command is invoked or until it -reaches end-of-file on its standard input. -If there exists a file \fB.tclshrc\fR in the home directory of -the user, \fBtclsh\fR evaluates the file as a Tcl script -just before reading the first command from standard input. - -.SH "SCRIPT FILES" -.PP -If \fBtclsh\fR is invoked with arguments then the first argument -is the name of a script file and any additional arguments -are made available to the script as variables (see below). -Instead of reading commands from standard input \fBtclsh\fR will -read Tcl commands from the named file; \fBtclsh\fR will exit -when it reaches the end of the file. -There is no automatic evaluation of \fB.tclshrc\fR in this -case, but the script file can always \fBsource\fR it if desired. -.PP -If you create a Tcl script in a file whose first line is -.CS -\fB#!/usr/local/bin/tclsh\fR -.CE -then you can invoke the script file directly from your shell if -you mark the file as executable. -This assumes that \fBtclsh\fR has been installed in the default -location in /usr/local/bin; if it's installed somewhere else -then you'll have to modify the above line to match. -Many UNIX systems do not allow the \fB#!\fR line to exceed about -30 characters in length, so be sure that the \fBtclsh\fR -executable can be accessed with a short file name. -.PP -An even better approach is to start your script files with the -following three lines: -.CS -\fB#!/bin/sh -# the next line restarts using tclsh \e -exec tclsh "$0" "$@"\fR -.CE -This approach has three advantages over the approach in the previous -paragraph. First, the location of the \fBtclsh\fR binary doesn't have -to be hard-wired into the script: it can be anywhere in your shell -search path. Second, it gets around the 30-character file name limit -in the previous approach. -Third, this approach will work even if \fBtclsh\fR is -itself a shell script (this is done on some systems in order to -handle multiple architectures or operating systems: the \fBtclsh\fR -script selects one of several binaries to run). The three lines -cause both \fBsh\fR and \fBtclsh\fR to process the script, but the -\fBexec\fR is only executed by \fBsh\fR. -\fBsh\fR processes the script first; it treats the second -line as a comment and executes the third line. -The \fBexec\fR statement cause the shell to stop processing and -instead to start up \fBtclsh\fR to reprocess the entire script. -When \fBtclsh\fR starts up, it treats all three lines as comments, -since the backslash at the end of the second line causes the third -line to be treated as part of the comment on the second line. - -.SH "VARIABLES" -.PP -\fBTclsh\fR sets the following Tcl variables: -.TP 15 -\fBargc\fR -Contains a count of the number of \fIarg\fR arguments (0 if none), -not including the name of the script file. -.TP 15 -\fBargv\fR -Contains a Tcl list whose elements are the \fIarg\fR arguments, -in order, or an empty string if there are no \fIarg\fR arguments. -.TP 15 -\fBargv0\fR -Contains \fIfileName\fR if it was specified. -Otherwise, contains the name by which \fBtclsh\fR was invoked. -.TP 15 -\fBtcl_interactive\fR -Contains 1 if \fBtclsh\fR is running interactively (no -\fIfileName\fR was specified and standard input is a terminal-like -device), 0 otherwise. - -.SH PROMPTS -.PP -When \fBtclsh\fR is invoked interactively it normally prompts for each -command with ``\fB% \fR''. You can change the prompt by setting the -variables \fBtcl_prompt1\fR and \fBtcl_prompt2\fR. If variable -\fBtcl_prompt1\fR exists then it must consist of a Tcl script -to output a prompt; instead of outputting a prompt \fBtclsh\fR -will evaluate the script in \fBtcl_prompt1\fR. -The variable \fBtcl_prompt2\fR is used in a similar way when -a newline is typed but the current command isn't yet complete; -if \fBtcl_prompt2\fR isn't set then no prompt is output for -incomplete commands. - -.SH KEYWORDS -argument, interpreter, prompt, script file, shell diff --git a/doc/tclvars.n b/doc/tclvars.n deleted file mode 100644 index 2e68519..0000000 --- a/doc/tclvars.n +++ /dev/null @@ -1,367 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: tclvars.n,v 1.3 1999/04/16 00:46:36 stanton Exp $ -'\" -.so man.macros -.TH tclvars n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tclvars \- Variables used by Tcl -.BE - -.SH DESCRIPTION -.PP -The following global variables are created and managed automatically -by the Tcl library. Except where noted below, these variables should -normally be treated as read-only by application-specific code and by users. -.TP -\fBenv\fR -This variable is maintained by Tcl as an array -whose elements are the environment variables for the process. -Reading an element will return the value of the corresponding -environment variable. -Setting an element of the array will modify the corresponding -environment variable or create a new one if it doesn't already -exist. -Unsetting an element of \fBenv\fR will remove the corresponding -environment variable. -Changes to the \fBenv\fR array will affect the environment -passed to children by commands like \fBexec\fR. -If the entire \fBenv\fR array is unset then Tcl will stop -monitoring \fBenv\fR accesses and will not update environment -variables. -.RS -.VS 8.0 -Under Windows, the environment variables PATH and COMSPEC in any -capitalization are converted automatically to upper case. For instance, the -PATH variable could be exported by the operating system as ``path'', -``Path'', ``PaTh'', etc., causing otherwise simple Tcl code to have to -support many special cases. All other environment variables inherited by -Tcl are left unmodified. -.VE -.RE -.RS -On the Macintosh, the environment variable is constructed by Tcl as no -global environment variable exists. The environment variables that -are created for Tcl include: -.TP -\fBLOGIN\fR -This holds the Chooser name of the Macintosh. -.TP -\fBUSER\fR -This also holds the Chooser name of the Macintosh. -.TP -\fBSYS_FOLDER\fR -The path to the system directory. -.TP -\fBAPPLE_M_FOLDER\fR -The path to the Apple Menu directory. -.TP -\fBCP_FOLDER\fR -The path to the control panels directory. -.TP -\fBDESK_FOLDER\fR -The path to the desk top directory. -.TP -\fBEXT_FOLDER\fR -The path to the system extensions directory. -.TP -\fBPREF_FOLDER\fR -The path to the preferences directory. -.TP -\fBPRINT_MON_FOLDER\fR -The path to the print monitor directory. -.TP -\fBSHARED_TRASH_FOLDER\fR -The path to the network trash directory. -.TP -\fBTRASH_FOLDER\fR -The path to the trash directory. -.TP -\fBSTART_UP_FOLDER\fR -The path to the start up directory. -.TP -\fBPWD\fR -The path to the application's default directory. -.PP -You can also create your own environment variables for the Macintosh. -A file named \fITcl Environment Variables\fR may be placed in the -preferences folder in the Mac system folder. Each line of this file -should be of the form \fIVAR_NAME=var_data\fR. -.PP -The last alternative is to place environment variables in a 'STR#' -resource named \fITcl Environment Variables\fR of the application. This -is considered a little more ``Mac like'' than a Unix style Environment -Variable file. Each entry in the 'STR#' resource has the same format -as above. The source code file \fItclMacEnv.c\fR contains the -implementation of the env mechanisms. This file contains many -#define's that allow customization of the env mechanisms to fit your -applications needs. -.RE -.TP -\fBerrorCode\fR -After an error has occurred, this variable will be set to hold -additional information about the error in a form that is easy -to process with programs. -\fBerrorCode\fR consists of a Tcl list with one or more elements. -The first element of the list identifies a general class of -errors, and determines the format of the rest of the list. -The following formats for \fBerrorCode\fR are used by the -Tcl core; individual applications may define additional formats. -.RS -.TP -\fBARITH\fI code msg\fR -This format is used when an arithmetic error occurs (e.g. an attempt -to divide by zero in the \fBexpr\fR command). -\fICode\fR identifies the precise error and \fImsg\fR provides a -human-readable description of the error. \fICode\fR will be either -DIVZERO (for an attempt to divide by zero), -DOMAIN (if an argument is outside the domain of a function, such as acos(\-3)), -IOVERFLOW (for integer overflow), -OVERFLOW (for a floating-point overflow), -or UNKNOWN (if the cause of the error cannot be determined). -.TP -\fBCHILDKILLED\fI pid sigName msg\fR -This format is used when a child process has been killed because of -a signal. The second element of \fBerrorCode\fR will be the -process's identifier (in decimal). -The third element will be the symbolic name of the signal that caused -the process to terminate; it will be one of the names from the -include file signal.h, such as \fBSIGPIPE\fR. -The fourth element will be a short human-readable message -describing the signal, such as ``write on pipe with no readers'' -for \fBSIGPIPE\fR. -.TP -\fBCHILDSTATUS\fI pid code\fR -This format is used when a child process has exited with a non-zero -exit status. The second element of \fBerrorCode\fR will be the -process's identifier (in decimal) and the third element will be the exit -code returned by the process (also in decimal). -.TP -\fBCHILDSUSP\fI pid sigName msg\fR -This format is used when a child process has been suspended because -of a signal. -The second element of \fBerrorCode\fR will be the process's identifier, -in decimal. -The third element will be the symbolic name of the signal that caused -the process to suspend; this will be one of the names from the -include file signal.h, such as \fBSIGTTIN\fR. -The fourth element will be a short human-readable message -describing the signal, such as ``background tty read'' -for \fBSIGTTIN\fR. -.TP -\fBNONE\fR -This format is used for errors where no additional information is -available for an error besides the message returned with the -error. In these cases \fBerrorCode\fR will consist of a list -containing a single element whose contents are \fBNONE\fR. -.TP -\fBPOSIX \fIerrName msg\fR -If the first element of \fBerrorCode\fR is \fBPOSIX\fR, then -the error occurred during a POSIX kernel call. -The second element of the list will contain the symbolic name -of the error that occurred, such as \fBENOENT\fR; this will -be one of the values defined in the include file errno.h. -The third element of the list will be a human-readable -message corresponding to \fIerrName\fR, such as -``no such file or directory'' for the \fBENOENT\fR case. -.PP -To set \fBerrorCode\fR, applications should use library -procedures such as \fBTcl_SetErrorCode\fR and \fBTcl_PosixError\fR, -or they may invoke the \fBerror\fR command. -If one of these methods hasn't been used, then the Tcl -interpreter will reset the variable to \fBNONE\fR after -the next error. -.RE -.TP -\fBerrorInfo\fR -After an error has occurred, this string will contain one or more lines -identifying the Tcl commands and procedures that were being executed -when the most recent error occurred. -Its contents take the form of a stack trace showing the various -nested Tcl commands that had been invoked at the time of the error. -.TP -\fBtcl_library\fR -This variable holds the name of a directory containing the -system library of Tcl scripts, such as those used for auto-loading. -The value of this variable is returned by the \fBinfo library\fR command. -See the \fBlibrary\fR manual entry for details of the facilities -provided by the Tcl script library. -Normally each application or package will have its own application-specific -script library in addition to the Tcl script library; -each application should set a global variable with a name like -\fB$\fIapp\fB_library\fR (where \fIapp\fR is the application's name) -to hold the network file name for that application's library directory. -The initial value of \fBtcl_library\fR is set when an interpreter -is created by searching several different directories until one is -found that contains an appropriate Tcl startup script. -If the \fBTCL_LIBRARY\fR environment variable exists, then -the directory it names is checked first. -If \fBTCL_LIBRARY\fR isn't set or doesn't refer to an appropriate -directory, then Tcl checks several other directories based on a -compiled-in default location, the location of the binary containing -the application, and the current working directory. -.TP -\fBtcl_patchLevel\fR -When an interpreter is created Tcl initializes this variable to -hold a string giving the current patch level for Tcl, such as -\fB7.3p2\fR for Tcl 7.3 with the first two official patches, or -\fB7.4b4\fR for the fourth beta release of Tcl 7.4. -The value of this variable is returned by the \fBinfo patchlevel\fR -command. -.VS 8.0 br -.TP -\fBtcl_pkgPath\fR -This variable holds a list of directories indicating where packages are -normally installed. It typically contains either one or two entries; -if it contains two entries, the first is normally a directory for -platform-dependent packages (e.g., shared library binaries) and the -second is normally a directory for platform-independent packages (e.g., -script files). Typically a package is installed as a subdirectory of one -of the entries in \fB$tcl_pkgPath\fR. The directories in -\fB$tcl_pkgPath\fR are included by default in the \fBauto_path\fR -variable, so they and their immediate subdirectories are automatically -searched for packages during \fBpackage require\fR commands. Note: -\fBtcl_pkgPath\fR it not intended to be modified by the application. -Its value is added to \fBauto_path\fR at startup; changes to -\fBtcl_pkgPath\fR are not reflected in \fBauto_path\fR. If you -want Tcl to search additional directories for packages you should add -the names of those directories to \fBauto_path\fR, not \fBtcl_pkgPath\fR. -.VE -.TP -\fBtcl_platform\fR -This is an associative array whose elements contain information about -the platform on which the application is running, such as the name of -the operating system, its current release number, and the machine's -instruction set. The elements listed below will always -be defined, but they may have empty strings as values if Tcl couldn't -retrieve any relevant information. In addition, extensions -and applications may add additional values to the array. The -predefined elements are: -.RS -.VS -.TP -\fBbyteOrder\fR -The native byte order of this machine: either \fBlittleEndian\fR or -\fBbigEndian\fR. -.VE -.TP -\fBmachine\fR -The instruction set executed by this machine, such as -\fBintel\fR, \fBPPC\fR, \fB68k\fR, or \fBsun4m\fR. On UNIX machines, this -is the value returned by \fBuname -m\fR. -.TP -\fBos\fR -The name of the operating system running on this machine, -such as \fBWindows 95\fR, \fBWindows NT\fR, \fBMacOS\fR, or \fBSunOS\fR. -On UNIX machines, this is the value returned by \fBuname -s\fR. -On Windows 95 and Windows 98, the value returned will be \fBWindows -95\fR to provide better backwards compatibility to Windows 95; to -distinguish between the two, check the \fBosVersion\fR. -.TP -\fBosVersion\fR -The version number for the operating system running on this machine. -On UNIX machines, this is the value returned by \fBuname -r\fR. On -Windows 95, the version will be 4.0; on Windows 98, the version will -be 4.10. -.TP -\fBplatform\fR -Either \fBwindows\fR, \fBmacintosh\fR, or \fBunix\fR. This identifies the -general operating environment of the machine. -.TP -\fBuser\fR -Either \fBwindows\fR, \fBmacintosh\fR, or \fBunix\fR. This identifies the -current user based on the login information available on the platform. -This comes from the USER or LOGNAME environment variable on Unix, -and the value from GetUserName on Windows and Macintosh. -.RE -.TP -\fBtcl_precision\fR -.VS -This variable controls the number of digits to generate -when converting floating-point values to strings. It defaults -to 12. -17 digits is ``perfect'' for IEEE floating-point in that it allows -double-precision values to be converted to strings and back to -binary with no loss of information. However, using 17 digits prevents -any rounding, which produces longer, less intuitive results. For example, -\fBexpr 1.4\fR returns 1.3999999999999999 with \fBtcl_precision\fR -set to 17, vs. 1.4 if \fBtcl_precision\fR is 12. -.RS -All interpreters in a process share a single \fBtcl_precision\fR value: -changing it in one interpreter will affect all other interpreters as -well. However, safe interpreters are not allowed to modify the -variable. -.RE -.VE -.TP -\fBtcl_rcFileName\fR -This variable is used during initialization to indicate the name of a -user-specific startup file. If it is set by application-specific -initialization, then the Tcl startup code will check for the existence -of this file and \fBsource\fR it if it exists. For example, for \fBwish\fR -the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR -for Windows. -.TP -\fBtcl_rcRsrcName\fR -This variable is only used on Macintosh systems. The variable is used -during initialization to indicate the name of a user-specific -\fBTEXT\fR resource located in the application or extension resource -forks. If it is set by application-specific initialization, then the -Tcl startup code will check for the existence of this resource and -\fBsource\fR it if it exists. For example, the Macintosh \fBwish\fR -application has the variable is set to \fBtclshrc\fR. -.TP -\fBtcl_traceCompile\fR -The value of this variable can be set to control -how much tracing information -is displayed during bytecode compilation. -By default, tcl_traceCompile is zero and no information is displayed. -Setting tcl_traceCompile to 1 generates a one line summary in stdout -whenever a procedure or top level command is compiled. -Setting it to 2 generates a detailed listing in stdout of the -bytecode instructions emitted during every compilation. -This variable is useful in -tracking down suspected problems with the Tcl compiler. -It is also occasionally useful when converting -existing code to use Tcl8.0. -.TP -\fBtcl_traceExec\fR -The value of this variable can be set to control -how much tracing information -is displayed during bytecode execution. -By default, tcl_traceExec is zero and no information is displayed. -Setting tcl_traceExec to 1 generates a one line trace in stdout -on each call to a Tcl procedure. -Setting it to 2 generates a line of output -whenever any Tcl command is invoked -that contains the name of the command and its arguments. -Setting it to 3 produces a detailed trace showing the result of -executing each bytecode instruction. -Note that when tcl_traceExec is 2 or 3, -commands such as set and incr -that have been entirely replaced by a sequence -of bytecode instructions are not shown. -Setting this variable is useful in -tracking down suspected problems with the bytecode compiler -and interpreter. -It is also occasionally useful when converting -code to use Tcl8.0. -.TP -\fBtcl_version\fR -When an interpreter is created Tcl initializes this variable to -hold the version number for this version of Tcl in the form \fIx.y\fR. -Changes to \fIx\fR represent major changes with probable -incompatibilities and changes to \fIy\fR represent small enhancements and -bug fixes that retain backward compatibility. -The value of this variable is returned by the \fBinfo tclversion\fR -command. - -.SH KEYWORDS -arithmetic, bytecode, compiler, error, environment, POSIX, precision, subprocess, variables diff --git a/doc/tell.n b/doc/tell.n deleted file mode 100644 index fbbef62..0000000 --- a/doc/tell.n +++ /dev/null @@ -1,28 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: tell.n,v 1.2 1998/09/14 18:39:55 stanton Exp $ -'\" -.so man.macros -.TH tell n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tell \- Return current access position for an open channel -.SH SYNOPSIS -\fBtell \fIchannelId\fR -.BE - -.SH DESCRIPTION -.PP -Returns a decimal string giving the current access position in -\fIchannelId\fR. -The value returned is -1 for channels that do not support -seeking. - -.SH KEYWORDS -access position, channel, seeking diff --git a/doc/time.n b/doc/time.n deleted file mode 100644 index f08505a..0000000 --- a/doc/time.n +++ /dev/null @@ -1,33 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: time.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH time n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -time \- Time the execution of a script -.SH SYNOPSIS -\fBtime \fIscript\fR ?\fIcount\fR? -.BE - -.SH DESCRIPTION -.PP -This command will call the Tcl interpreter \fIcount\fR -times to evaluate \fIscript\fR (or once if \fIcount\fR isn't -specified). It will then return a string of the form -.CS -\fB503 microseconds per iteration\fR -.CE -which indicates the average amount of time required per iteration, -in microseconds. -Time is measured in elapsed time, not CPU time. - -.SH KEYWORDS -script, time diff --git a/doc/trace.n b/doc/trace.n deleted file mode 100644 index 317205a..0000000 --- a/doc/trace.n +++ /dev/null @@ -1,158 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: trace.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH trace n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -trace \- Monitor variable accesses -.SH SYNOPSIS -\fBtrace \fIoption\fR ?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command causes Tcl commands to be executed whenever certain operations are -invoked. At present, only variable tracing is implemented. The -legal \fIoption\fR's (which may be abbreviated) are: -.TP -\fBtrace variable \fIname ops command\fR -Arrange for \fIcommand\fR to be executed whenever variable \fIname\fR -is accessed in one of the ways given by \fIops\fR. \fIName\fR may -refer to a normal variable, an element of an array, or to an array -as a whole (i.e. \fIname\fR may be just the name of an array, with no -parenthesized index). If \fIname\fR refers to a whole array, then -\fIcommand\fR is invoked whenever any element of the array is -manipulated. -.RS -.PP -\fIOps\fR indicates which operations are of interest, and consists of -one or more of the following letters: -.TP -\fBr\fR -Invoke \fIcommand\fR whenever the variable is read. -.TP -\fBw\fR -Invoke \fIcommand\fR whenever the variable is written. -.TP -\fBu\fR -Invoke \fIcommand\fR whenever the variable is unset. Variables -can be unset explicitly with the \fBunset\fR command, or -implicitly when procedures return (all of their local variables -are unset). Variables are also unset when interpreters are -deleted, but traces will not be invoked because there is no -interpreter in which to execute them. -.PP -When the trace triggers, three arguments are appended to -\fIcommand\fR so that the actual command is as follows: -.CS -\fIcommand name1 name2 op\fR -.CE -\fIName1\fR and \fIname2\fR give the name(s) for the variable -being accessed: if the variable is a scalar then \fIname1\fR -gives the variable's name and \fIname2\fR is an empty string; -if the variable is an array element then \fIname1\fR gives the -name of the array and name2 gives the index into the array; -if an entire array is being deleted and the trace was registered -on the overall array, rather than a single element, then \fIname1\fR -gives the array name and \fIname2\fR is an empty string. -\fIName1\fR and \fIname2\fR are not necessarily the same as the -name used in the \fBtrace variable\fR command: the \fBupvar\fR -command allows a procedure to reference a variable under a -different name. -\fIOp\fR indicates what operation is being performed on the -variable, and is one of \fBr\fR, \fBw\fR, or \fBu\fR as -defined above. -.PP -\fICommand\fR executes in the same context as the code that invoked -the traced operation: if the variable was accessed as part of a -Tcl procedure, then \fIcommand\fR will have access to the same -local variables as code in the procedure. This context may be -different than the context in which the trace was created. -If \fIcommand\fR invokes a procedure (which it normally does) then -the procedure will have to use \fBupvar\fR or \fBuplevel\fR if it -wishes to access the traced variable. -Note also that \fIname1\fR may not necessarily be the same as the name -used to set the trace on the variable; differences can occur if -the access is made through a variable defined with the \fBupvar\fR -command. -.PP -For read and write traces, \fIcommand\fR can modify -the variable to affect the result of the traced operation. -If \fIcommand\fR modifies the value of a variable during a -read or write trace, then the new value will be returned as the -result of the traced operation. -The return value from \fIcommand\fR is ignored except that -if it returns an error of any sort then the traced operation -also returns an error with -the same error message returned by the trace command -(this mechanism can be used to implement read-only variables, for -example). -For write traces, \fIcommand\fR is invoked after the variable's -value has been changed; it can write a new value into the variable -to override the original value specified in the write operation. -To implement read-only variables, \fIcommand\fR will have to restore -the old value of the variable. -.PP -While \fIcommand\fR is executing during a read or write trace, traces -on the variable are temporarily disabled. -This means that reads and writes invoked by -\fIcommand\fR will occur directly, without invoking \fIcommand\fR -(or any other traces) again. -However, if \fIcommand\fR unsets the variable then unset traces -will be invoked. -.PP -When an unset trace is invoked, the variable has already been -deleted: it will appear to be undefined with no traces. -If an unset occurs because of a procedure return, then the -trace will be invoked in the variable context of the procedure -being returned to: the stack frame of the returning procedure -will no longer exist. -Traces are not disabled during unset traces, so if an unset trace -command creates a new trace and accesses the variable, the -trace will be invoked. -Any errors in unset traces are ignored. -.PP -If there are multiple traces on a variable they are invoked -in order of creation, most-recent first. -If one trace returns an error, then no further traces are -invoked for the variable. -If an array element has a trace set, and there is also a trace -set on the array as a whole, the trace on the overall array -is invoked before the one on the element. -.PP -Once created, the trace remains in effect either until the -trace is removed with the \fBtrace vdelete\fR command described -below, until the variable is unset, or until the interpreter -is deleted. -Unsetting an element of array will remove any traces on that -element, but will not remove traces on the overall array. -.PP -This command returns an empty string. -.RE -.TP -\fBtrace vdelete \fIname ops command\fR -If there is a trace set on variable \fIname\fR with the -operations and command given by \fIops\fR and \fIcommand\fR, -then the trace is removed, so that \fIcommand\fR will never -again be invoked. -Returns an empty string. -.TP -\fBtrace vinfo \fIname\fR -Returns a list containing one element for each trace -currently set on variable \fIname\fR. -Each element of the list is itself a list containing two -elements, which are the \fIops\fR and \fIcommand\fR associated -with the trace. -If \fIname\fR doesn't exist or doesn't have any traces set, then -the result of the command will be an empty string. - -.SH KEYWORDS -read, variable, write, trace, unset diff --git a/doc/unknown.n b/doc/unknown.n deleted file mode 100644 index 19f5ac1..0000000 --- a/doc/unknown.n +++ /dev/null @@ -1,75 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: unknown.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH unknown n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -unknown \- Handle attempts to use non-existent commands -.SH SYNOPSIS -\fBunknown \fIcmdName \fR?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command is invoked by the Tcl interpreter whenever a script -tries to invoke a command that doesn't exist. The implementation -of \fBunknown\fR isn't part of the Tcl core; instead, it is a -library procedure defined by default when Tcl starts up. You -can override the default \fBunknown\fR to change its functionality. -.PP -If the Tcl interpreter encounters a command name for which there -is not a defined command, then Tcl checks for the existence of -a command named \fBunknown\fR. -If there is no such command, then the interpreter returns an -error. -If the \fBunknown\fR command exists, then it is invoked with -arguments consisting of the fully-substituted name and arguments -for the original non-existent command. -The \fBunknown\fR command typically does things like searching -through library directories for a command procedure with the name -\fIcmdName\fR, or expanding abbreviated command names to full-length, -or automatically executing unknown commands as sub-processes. -In some cases (such as expanding abbreviations) \fBunknown\fR will -change the original command slightly and then (re-)execute it. -The result of the \fBunknown\fR command is used as the result for -the original non-existent command. -.PP -The default implementation of \fBunknown\fR behaves as follows. -It first calls the \fBauto_load\fR library procedure to load the command. -If this succeeds, then it executes the original command with its -original arguments. -If the auto-load fails then \fBunknown\fR calls \fBauto_execok\fR -to see if there is an executable file by the name \fIcmd\fR. -If so, it invokes the Tcl \fBexec\fR command -with \fIcmd\fR and all the \fIargs\fR as arguments. -If \fIcmd\fR can't be auto-executed, \fBunknown\fR checks to -see if the command was invoked at top-level and outside of any -script. If so, then \fBunknown\fR takes two additional steps. -First, it sees if \fIcmd\fR has one of the following three forms: -\fB!!\fR, \fB!\fIevent\fR, or \fB^\fIold\fB^\fInew\fR?\fB^\fR?. -If so, then \fBunknown\fR carries out history substitution -in the same way that \fBcsh\fR would for these constructs. -Finally, \fBunknown\fR checks to see if \fIcmd\fR is -a unique abbreviation for an existing Tcl command. -If so, it expands the command name and executes the command with -the original arguments. -If none of the above efforts has been able to execute -the command, \fBunknown\fR generates an error return. -If the global variable \fBauto_noload\fR is defined, then the auto-load -step is skipped. -If the global variable \fBauto_noexec\fR is defined then the -auto-exec step is skipped. -Under normal circumstances the return value from \fBunknown\fR -is the return value from the command that was eventually -executed. - -.SH KEYWORDS -error, non-existent command diff --git a/doc/unset.n b/doc/unset.n deleted file mode 100644 index ef93132..0000000 --- a/doc/unset.n +++ /dev/null @@ -1,34 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: unset.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH unset n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -unset \- Delete variables -.SH SYNOPSIS -\fBunset \fIname \fR?\fIname name ...\fR? -.BE - -.SH DESCRIPTION -.PP -This command removes one or more variables. -Each \fIname\fR is a variable name, specified in any of the -ways acceptable to the \fBset\fR command. -If a \fIname\fR refers to an element of an array then that -element is removed without affecting the rest of the array. -If a \fIname\fR consists of an array name with no parenthesized -index, then the entire array is deleted. -The \fBunset\fR command returns an empty string as result. -An error occurs if any of the variables doesn't exist, and any variables -after the non-existent one are not deleted. - -.SH KEYWORDS -remove, variable diff --git a/doc/update.n b/doc/update.n deleted file mode 100644 index 863e8c8..0000000 --- a/doc/update.n +++ /dev/null @@ -1,48 +0,0 @@ -'\" -'\" Copyright (c) 1990-1992 The Regents of the University of California. -'\" 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. -'\" -'\" RCS: @(#) $Id: update.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH update n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -update \- Process pending events and idle callbacks -.SH SYNOPSIS -\fBupdate\fR ?\fBidletasks\fR? -.BE - -.SH DESCRIPTION -.PP -This command is used to bring the application ``up to date'' -by entering the event loop repeated until all pending events -(including idle callbacks) have been processed. -.PP -If the \fBidletasks\fR keyword is specified as an argument to the -command, then no new events or errors are processed; only idle -callbacks are invoked. -This causes operations that are normally deferred, such as display -updates and window layout calculations, to be performed immediately. -.PP -The \fBupdate idletasks\fR command is useful in scripts where -changes have been made to the application's state and you want those -changes to appear on the display immediately, rather than waiting -for the script to complete. Most display updates are performed as -idle callbacks, so \fBupdate idletasks\fR will cause them to run. -However, there are some kinds of updates that only happen in -response to events, such as those triggered by window size changes; -these updates will not occur in \fBupdate idletasks\fR. -.PP -The \fBupdate\fR command with no options is useful in scripts where -you are performing a long-running computation but you still want -the application to respond to events such as user interactions; if -you occasionally call \fBupdate\fR then user input will be processed -during the next call to \fBupdate\fR. - -.SH KEYWORDS -event, flush, handler, idle, update diff --git a/doc/uplevel.n b/doc/uplevel.n deleted file mode 100644 index 83290d3..0000000 --- a/doc/uplevel.n +++ /dev/null @@ -1,80 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: uplevel.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH uplevel n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -uplevel \- Execute a script in a different stack frame -.SH SYNOPSIS -\fBuplevel \fR?\fIlevel\fR?\fI arg \fR?\fIarg ...\fR? -.BE - -.SH DESCRIPTION -.PP -All of the \fIarg\fR arguments are concatenated as if they had -been passed to \fBconcat\fR; the result is then evaluated in the -variable context indicated by \fIlevel\fR. \fBUplevel\fR returns -the result of that evaluation. -.PP -If \fIlevel\fR is an integer then -it gives a distance (up the procedure calling stack) to move before -executing the command. If \fIlevel\fR consists of \fB#\fR followed by -a number then the number gives an absolute level number. If \fIlevel\fR -is omitted then it defaults to \fB1\fR. \fILevel\fR cannot be -defaulted if the first \fIcommand\fR argument starts with a digit or \fB#\fR. -.PP -For example, suppose that procedure \fBa\fR was invoked -from top-level, and that it called \fBb\fR, and that \fBb\fR called \fBc\fR. -Suppose that \fBc\fR invokes the \fBuplevel\fR command. If \fIlevel\fR -is \fB1\fR or \fB#2\fR or omitted, then the command will be executed -in the variable context of \fBb\fR. If \fIlevel\fR is \fB2\fR or \fB#1\fR -then the command will be executed in the variable context of \fBa\fR. -If \fIlevel\fR is \fB3\fR or \fB#0\fR then the command will be executed -at top-level (only global variables will be visible). -.PP -The \fBuplevel\fR command causes the invoking procedure to disappear -from the procedure calling stack while the command is being executed. -In the above example, suppose \fBc\fR invokes the command -.CS -\fBuplevel 1 {set x 43; d}\fR -.CE -where \fBd\fR is another Tcl procedure. The \fBset\fR command will -modify the variable \fBx\fR in \fBb\fR's context, and \fBd\fR will execute -at level 3, as if called from \fBb\fR. If it in turn executes -the command -.CS -\fBuplevel {set x 42}\fR -.CE -then the \fBset\fR command will modify the same variable \fBx\fR in \fBb\fR's -context: the procedure \fBc\fR does not appear to be on the call stack -when \fBd\fR is executing. The command ``\fBinfo level\fR'' may -be used to obtain the level of the current procedure. -.PP -\fBUplevel\fR makes it possible to implement new control -constructs as Tcl procedures (for example, \fBuplevel\fR could -be used to implement the \fBwhile\fR construct as a Tcl procedure). -.PP -\fBnamespace eval\fR is another way (besides procedure calls) -that the Tcl naming context can change. -It adds a call frame to the stack to represent the namespace context. -This means each \fBnamespace eval\fR command -counts as another call level for \fBuplevel\fR and \fBupvar\fR commands. -For example, \fBinfo level 1\fR will return a list -describing a command that is either -the outermost procedure call or the outermost \fBnamespace eval\fR command. -Also, \fBuplevel #0\fR evaluates a script -at top-level in the outermost namespace (the global namespace). - -.SH "SEE ALSO" -namespace(n) - -.SH KEYWORDS -context, level, namespace, stack frame, variables diff --git a/doc/upvar.n b/doc/upvar.n deleted file mode 100644 index f62d646..0000000 --- a/doc/upvar.n +++ /dev/null @@ -1,92 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: upvar.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH upvar n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -upvar \- Create link to variable in a different stack frame -.SH SYNOPSIS -\fBupvar \fR?\fIlevel\fR? \fIotherVar myVar \fR?\fIotherVar myVar \fR...? -.BE - -.SH DESCRIPTION -.PP -This command arranges for one or more local variables in the current -procedure to refer to variables in an enclosing procedure call or -to global variables. -\fILevel\fR may have any of the forms permitted for the \fBuplevel\fR -command, and may be omitted if the first letter of the first \fIotherVar\fR -isn't \fB#\fR or a digit (it defaults to \fB1\fR). -For each \fIotherVar\fR argument, \fBupvar\fR makes the variable -by that name in the procedure frame given by \fIlevel\fR (or at -global level, if \fIlevel\fR is \fB#0\fR) accessible -in the current procedure by the name given in the corresponding -\fImyVar\fR argument. -The variable named by \fIotherVar\fR need not exist at the time of the -call; it will be created the first time \fImyVar\fR is referenced, just like -an ordinary variable. There must not exist a variable by the -name \fImyVar\fR at the time \fBupvar\fR is invoked. -\fIMyVar\fR is always treated as the name of a variable, not an -array element. Even if the name looks like an array element, -such as \fBa(b)\fR, a regular variable is created. -\fIOtherVar\fR may refer to a scalar variable, an array, -or an array element. -\fBUpvar\fR returns an empty string. -.PP -The \fBupvar\fR command simplifies the implementation of call-by-name -procedure calling and also makes it easier to build new control constructs -as Tcl procedures. -For example, consider the following procedure: -.CS -\fBproc add2 name { - upvar $name x - set x [expr $x+2] -}\fR -.CE -\fBAdd2\fR is invoked with an argument giving the name of a variable, -and it adds two to the value of that variable. -Although \fBadd2\fR could have been implemented using \fBuplevel\fR -instead of \fBupvar\fR, \fBupvar\fR makes it simpler for \fBadd2\fR -to access the variable in the caller's procedure frame. -.PP -\fBnamespace eval\fR is another way (besides procedure calls) -that the Tcl naming context can change. -It adds a call frame to the stack to represent the namespace context. -This means each \fBnamespace eval\fR command -counts as another call level for \fBuplevel\fR and \fBupvar\fR commands. -For example, \fBinfo level 1\fR will return a list -describing a command that is either -the outermost procedure call or the outermost \fBnamespace eval\fR command. -Also, \fBuplevel #0\fR evaluates a script -at top-level in the outermost namespace (the global namespace). -.PP -.VS -If an upvar variable is unset (e.g. \fBx\fR in \fBadd2\fR above), the -\fBunset\fR operation affects the variable it is linked to, not the -upvar variable. There is no way to unset an upvar variable except -by exiting the procedure in which it is defined. However, it is -possible to retarget an upvar variable by executing another \fBupvar\fR -command. - -.SH BUGS -.PP -If \fIotherVar\fR refers to an element of an array, then variable -traces set for the entire array will not be invoked when \fImyVar\fR -is accessed (but traces on the particular element will still be -invoked). In particular, if the array is \fBenv\fR, then changes -made to \fImyVar\fR will not be passed to subprocesses correctly. -.VE - -.SH "SEE ALSO" -namespace(n) - -.SH KEYWORDS -context, frame, global, level, namespace, procedure, variable diff --git a/doc/variable.n b/doc/variable.n deleted file mode 100644 index 3b742a9..0000000 --- a/doc/variable.n +++ /dev/null @@ -1,63 +0,0 @@ -'\" -'\" Copyright (c) 1993-1997 Bell Labs Innovations for Lucent Technologies -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: variable.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH variable n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -variable \- create and initialize a namespace variable -.SH SYNOPSIS -\fBvariable \fR?\fIname value...\fR? \fIname \fR?\fIvalue\fR? -.BE - -.SH DESCRIPTION -.PP -This command is normally used within a -\fBnamespace eval\fR command to create one or more variables -within a namespace. -Each variable \fIname\fR is initialized with \fIvalue\fR. -The \fIvalue\fR for the last variable is optional. -.PP -If a variable \fIname\fR does not exist, it is created. -In this case, if \fIvalue\fR is specified, -it is assigned to the newly created variable. -If no \fIvalue\fR is specified, the new variable is left undefined. -If the variable already exists, -it is set to \fIvalue\fR if \fIvalue\fR is specified -or left unchanged if no \fIvalue\fR is given. -Normally, \fIname\fR is unqualified -(does not include the names of any containing namespaces), -and the variable is created in the current namespace. -If \fIname\fR includes any namespace qualifiers, -the variable is created in the specified namespace. -.PP -If the \fBvariable\fR command is executed inside a Tcl procedure, -it creates local variables -linked to the corresponding namespace variables. -In this way the \fBvariable\fR command resembles the \fBglobal\fR command, -although the \fBglobal\fR command -only links to variables in the global namespace. -If any \fIvalue\fRs are given, -they are used to modify the values of the associated namespace variables. -If a namespace variable does not exist, -it is created and optionally initialized. -.PP -A \fIname\fR argument cannot reference an element within an array. -Instead, \fIname\fR should reference the entire array, -and the initialization \fIvalue\fR should be left off. -After the variable has been declared, -elements within the array can be set using ordinary -\fBset\fR or \fBarray\fR commands. - -.SH "SEE ALSO" -global(n), namespace(n) - -.SH KEYWORDS -global, namespace, procedure, variable diff --git a/doc/vwait.n b/doc/vwait.n deleted file mode 100644 index a355b54..0000000 --- a/doc/vwait.n +++ /dev/null @@ -1,38 +0,0 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: vwait.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH vwait n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -vwait \- Process events until a variable is written -.SH SYNOPSIS -\fBvwait\fR \fIvarName\fR -.BE - -.SH DESCRIPTION -.PP -This command enters the Tcl event loop to process events, blocking -the application if no events are ready. It continues processing -events until some event handler sets the value of variable -\fIvarName\fR. Once \fIvarName\fR has been set, the \fBvwait\fR -command will return as soon as the event handler that modified -\fIvarName\fR completes. -.PP -In some cases the \fBvwait\fR command may not return immediately -after \fIvarName\fR is set. This can happen if the event handler -that sets \fIvarName\fR does not complete immediately. For example, -if an event handler sets \fIvarName\fR and then itself calls -\fBvwait\fR to wait for a different variable, then it may not return -for a long time. During this time the top-level \fBvwait\fR is -blocked waiting for the event handler to complete, so it cannot -return either. - -.SH KEYWORDS -event, variable, wait diff --git a/doc/while.n b/doc/while.n deleted file mode 100644 index dabe116..0000000 --- a/doc/while.n +++ /dev/null @@ -1,55 +0,0 @@ -'\" -'\" Copyright (c) 1993 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. -'\" -'\" RCS: @(#) $Id: while.n,v 1.2 1998/09/14 18:39:56 stanton Exp $ -'\" -.so man.macros -.TH while n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -while \- Execute script repeatedly as long as a condition is met -.SH SYNOPSIS -\fBwhile \fItest body\fR -.BE - -.SH DESCRIPTION -.PP -The \fBwhile\fR command evaluates \fItest\fR as an expression -(in the same way that \fBexpr\fR evaluates its argument). -The value of the expression must a proper boolean -value; if it is a true value -then \fIbody\fR is executed by passing it to the Tcl interpreter. -Once \fIbody\fR has been executed then \fItest\fR is evaluated -again, and the process repeats until eventually \fItest\fR -evaluates to a false boolean value. \fBContinue\fR -commands may be executed inside \fIbody\fR to terminate the current -iteration of the loop, and \fBbreak\fR -commands may be executed inside \fIbody\fR to cause immediate -termination of the \fBwhile\fR command. The \fBwhile\fR command -always returns an empty string. -.PP -Note: \fItest\fR should almost always be enclosed in braces. If not, -variable substitutions will be made before the \fBwhile\fR -command starts executing, which means that variable changes -made by the loop body will not be considered in the expression. -This is likely to result in an infinite loop. If \fItest\fR is -enclosed in braces, variable substitutions are delayed until the -expression is evaluated (before -each loop iteration), so changes in the variables will be visible. -For an example, try the following script with and without the braces -around \fB$x<10\fR: -.CS -set x 0 -while {$x<10} { - puts "x is $x" - incr x -} -.CE - -.SH KEYWORDS -boolean value, loop, test, while diff --git a/generic/README b/generic/README deleted file mode 100644 index 209ba44..0000000 --- a/generic/README +++ /dev/null @@ -1,5 +0,0 @@ -This directory contains Tcl source files that work on all the platforms -where Tcl runs (e.g. UNIX, PCs, and Macintoshes). Platform-specific -sources are in the directories ../unix, ../win, and ../mac. - -RCS: @(#) $Id: README,v 1.2 1998/09/14 18:39:56 stanton Exp $ diff --git a/generic/regc_color.c b/generic/regc_color.c deleted file mode 100644 index e86fea0..0000000 --- a/generic/regc_color.c +++ /dev/null @@ -1,742 +0,0 @@ -/* - * colorings of characters - * This file is #included by regcomp.c. - * - * Note that there are some incestuous relationships between this code and - * NFA arc maintenance, which perhaps ought to be cleaned up sometime. - */ - - - -#define CISERR() VISERR(cm->v) -#define CERR(e) VERR(cm->v, (e)) - - - -/* - - initcm - set up new colormap - ^ static VOID initcm(struct vars *, struct colormap *); - */ -static VOID -initcm(v, cm) -struct vars *v; -struct colormap *cm; -{ - int i; - int j; - union tree *t; - union tree *nextt; - struct colordesc *cd; - - cm->magic = CMMAGIC; - cm->v = v; - - cm->ncds = NINLINECDS; - cm->cd = cm->cdspace; - cm->max = 0; - cm->free = 0; - - cd = cm->cd; /* cm->cd[WHITE] */ - cd->sub = NOSUB; - cd->arcs = NULL; - cd->flags = 0; - cd->nchrs = CHR_MAX - CHR_MIN + 1; - - /* upper levels of tree */ - for (t = &cm->tree[0], j = NBYTS-1; j > 0; t = nextt, j--) { - nextt = t + 1; - for (i = BYTTAB-1; i >= 0; i--) - t->tptr[i] = nextt; - } - /* bottom level is solid white */ - t = &cm->tree[NBYTS-1]; - for (i = BYTTAB-1; i >= 0; i--) - t->tcolor[i] = WHITE; - cd->block = t; -} - -/* - - freecm - free dynamically-allocated things in a colormap - ^ static VOID freecm(struct colormap *); - */ -static VOID -freecm(cm) -struct colormap *cm; -{ - size_t i; - union tree *cb; - - cm->magic = 0; - if (NBYTS > 1) - cmtreefree(cm, cm->tree, 0); - for (i = 1; i < cm->max; i++) /* skip WHITE */ - if (!UNUSEDCOLOR(&cm->cd[i])) { - cb = cm->cd[i].block; - if (cb != NULL) - FREE(cb); - } - if (cm->cd != cm->cdspace) - FREE(cm->cd); -} - -/* - - cmtreefree - free a non-terminal part of a colormap tree - ^ static VOID cmtreefree(struct colormap *, union tree *, int); - */ -static VOID -cmtreefree(cm, tree, level) -struct colormap *cm; -union tree *tree; -int level; /* level number (top == 0) of this block */ -{ - int i; - union tree *t; - union tree *fillt = &cm->tree[level+1]; - union tree *cb; - - assert(level < NBYTS-1); /* this level has pointers */ - for (i = BYTTAB-1; i >= 0; i--) { - t = tree->tptr[i]; - assert(t != NULL); - if (t != fillt) { - if (level < NBYTS-2) { /* more pointer blocks below */ - cmtreefree(cm, t, level+1); - FREE(t); - } else { /* color block below */ - cb = cm->cd[t->tcolor[0]].block; - if (t != cb) /* not a solid block */ - FREE(t); - } - } - } -} - -/* - - setcolor - set the color of a character in a colormap - ^ static color setcolor(struct colormap *, pchr, pcolor); - */ -static color /* previous color */ -setcolor(cm, c, co) -struct colormap *cm; -pchr c; -pcolor co; -{ - uchr uc = c; - int shift; - int level; - int b; - int bottom; - union tree *t; - union tree *newt; - union tree *fillt; - union tree *lastt; - union tree *cb; - color prev; - - assert(cm->magic == CMMAGIC); - if (CISERR() || co == COLORLESS) - return COLORLESS; - - t = cm->tree; - for (level = 0, shift = BYTBITS * (NBYTS - 1); shift > 0; - level++, shift -= BYTBITS) { - b = (uc >> shift) & BYTMASK; - lastt = t; - t = lastt->tptr[b]; - assert(t != NULL); - fillt = &cm->tree[level+1]; - bottom = (shift <= BYTBITS) ? 1 : 0; - cb = (bottom) ? cm->cd[t->tcolor[0]].block : fillt; - if (t == fillt || t == cb) { /* must allocate a new block */ - newt = (union tree *)MALLOC((bottom) ? - sizeof(struct colors) : sizeof(struct ptrs)); - if (newt == NULL) { - CERR(REG_ESPACE); - return COLORLESS; - } - if (bottom) - memcpy(VS(newt->tcolor), VS(t->tcolor), - BYTTAB*sizeof(color)); - else - memcpy(VS(newt->tptr), VS(t->tptr), - BYTTAB*sizeof(union tree *)); - t = newt; - lastt->tptr[b] = t; - } - } - - b = uc & BYTMASK; - prev = t->tcolor[b]; - t->tcolor[b] = (color)co; - return prev; -} - -/* - - maxcolor - report largest color number in use - ^ static color maxcolor(struct colormap *); - */ -static color -maxcolor(cm) -struct colormap *cm; -{ - if (CISERR()) - return COLORLESS; - - return (color)cm->max; -} - -/* - - newcolor - find a new color (must be subject of setcolor at once) - * Beware: may relocate the colordescs. - ^ static color newcolor(struct colormap *); - */ -static color /* COLORLESS for error */ -newcolor(cm) -struct colormap *cm; -{ - struct colordesc *cd; - struct colordesc *new; - size_t n; - - if (CISERR()) - return COLORLESS; - - if (cm->free != 0) { - assert(cm->free > 0); - assert((size_t)cm->free < cm->ncds); - cd = &cm->cd[cm->free]; - assert(UNUSEDCOLOR(cd)); - assert(cd->arcs == NULL); - cm->free = cd->sub; - } else if (cm->max < cm->ncds - 1) { - cm->max++; - cd = &cm->cd[cm->max]; - } else { - /* oops, must allocate more */ - n = cm->ncds * 2; - if (cm->cd == cm->cdspace) { - new = (struct colordesc *)MALLOC(n * - sizeof(struct colordesc)); - if (new != NULL) - memcpy(VS(new), VS(cm->cdspace), cm->ncds * - sizeof(struct colordesc)); - } else - new = (struct colordesc *)REALLOC(cm->cd, - n * sizeof(struct colordesc)); - if (new == NULL) { - CERR(REG_ESPACE); - return COLORLESS; - } - cm->cd = new; - cm->ncds = n; - assert(cm->max < cm->ncds - 1); - cm->max++; - cd = &cm->cd[cm->max]; - } - - cd->nchrs = 0; - cd->sub = NOSUB; - cd->arcs = NULL; - cd->flags = 0; - cd->block = NULL; - - return (color)(cd - cm->cd); -} - -/* - - freecolor - free a color (must have no arcs or subcolor) - ^ static VOID freecolor(struct colormap *, pcolor); - */ -static VOID -freecolor(cm, co) -struct colormap *cm; -pcolor co; -{ - struct colordesc *cd = &cm->cd[co]; - color pco, nco; /* for freelist scan */ - - assert(co >= 0); - if (co == WHITE) - return; - - assert(cd->arcs == NULL); - assert(cd->sub == NOSUB); - assert(cd->nchrs == 0); - cd->flags = FREECOL; - if (cd->block != NULL) { - FREE(cd->block); - cd->block = NULL; /* just paranoia */ - } - - if ((size_t)co == cm->max) { - while (cm->max > WHITE && UNUSEDCOLOR(&cm->cd[cm->max])) - cm->max--; - assert(cm->max >= 0); - while ((size_t)cm->free > cm->max) - cm->free = cm->cd[cm->free].sub; - if (cm->free > 0) { - assert(cm->free < cm->max); - pco = cm->free; - nco = cm->cd[pco].sub; - while (nco > 0) - if ((size_t)nco > cm->max) { - /* take this one out of freelist */ - nco = cm->cd[nco].sub; - cm->cd[pco].sub = nco; - } else { - assert(nco < cm->max); - pco = nco; - nco = cm->cd[pco].sub; - } - } - } else { - cd->sub = cm->free; - cm->free = (color)(cd - cm->cd); - } -} - -/* - - pseudocolor - allocate a false color, to be managed by other means - ^ static color pseudocolor(struct colormap *); - */ -static color -pseudocolor(cm) -struct colormap *cm; -{ - color co; - - co = newcolor(cm); - if (CISERR()) - return COLORLESS; - cm->cd[co].nchrs = 1; - cm->cd[co].flags = PSEUDO; - return co; -} - -/* - - subcolor - allocate a new subcolor (if necessary) to this chr - ^ static color subcolor(struct colormap *, pchr c); - */ -static color -subcolor(cm, c) -struct colormap *cm; -pchr c; -{ - color co; /* current color of c */ - color sco; /* new subcolor */ - - co = GETCOLOR(cm, c); - sco = newsub(cm, co); - if (sco == COLORLESS) { - return COLORLESS; - } - if (co == sco) /* already in an open subcolor */ - return co; /* rest is redundant */ - cm->cd[co].nchrs--; - cm->cd[sco].nchrs++; - setcolor(cm, c, sco); - return sco; -} - -/* - - newsub - allocate a new subcolor (if necessary) for a color - ^ static color newsub(struct colormap *, pcolor); - */ -static color -newsub(cm, co) -struct colormap *cm; -pcolor co; -{ - color sco; /* new subcolor */ - - sco = cm->cd[co].sub; - if (sco == NOSUB) { /* color has no open subcolor */ - if (cm->cd[co].nchrs == 1) /* optimization */ - return co; - sco = newcolor(cm); /* must create subcolor */ - if (sco == COLORLESS) - return COLORLESS; - cm->cd[co].sub = sco; - cm->cd[sco].sub = sco; /* open subcolor points to self */ - } - assert(sco != NOSUB); - - return sco; -} - -/* - - subrange - allocate new subcolors to this range of chrs, fill in arcs - ^ static VOID subrange(struct vars *, pchr, pchr, struct state *, - ^ struct state *); - */ -static VOID -subrange(v, from, to, lp, rp) -struct vars *v; -pchr from; -pchr to; -struct state *lp; -struct state *rp; -{ - uchr uf; - int i; - - assert(from <= to); - - /* first, align "from" on a tree-block boundary */ - uf = (uchr)from; - i = (int)( ((uf + BYTTAB-1) & (uchr)~BYTMASK) - uf ); - for (; from <= to && i > 0; i--, from++) - newarc(v->nfa, PLAIN, subcolor(v->cm, from), lp, rp); - if (from > to) /* didn't reach a boundary */ - return; - - /* deal with whole blocks */ - for (; to - from >= BYTTAB; from += BYTTAB) - subblock(v, from, lp, rp); - - /* clean up any remaining partial table */ - for (; from <= to; from++) - newarc(v->nfa, PLAIN, subcolor(v->cm, from), lp, rp); -} - -/* - - subblock - allocate new subcolors for one tree block of chrs, fill in arcs - ^ static VOID subblock(struct vars *, pchr, struct state *, struct state *); - */ -static VOID -subblock(v, start, lp, rp) -struct vars *v; -pchr start; /* first of BYTTAB chrs */ -struct state *lp; -struct state *rp; -{ - uchr uc = start; - struct colormap *cm = v->cm; - int shift; - int level; - int i; - int b; - union tree *t; - union tree *cb; - union tree *fillt; - union tree *lastt; - int previ; - int ndone; - color co; - color sco; - - assert((uc & BYTMASK) == 0); - - /* find its color block, making new pointer blocks as needed */ - t = cm->tree; - fillt = NULL; - for (level = 0, shift = BYTBITS * (NBYTS - 1); shift > 0; - level++, shift -= BYTBITS) { - b = (uc >> shift) & BYTMASK; - lastt = t; - t = lastt->tptr[b]; - assert(t != NULL); - fillt = &cm->tree[level+1]; - if (t == fillt && shift > BYTBITS) { /* need new ptr block */ - t = (union tree *)MALLOC(sizeof(struct ptrs)); - if (t == NULL) { - CERR(REG_ESPACE); - return; - } - memcpy(VS(t->tptr), VS(fillt->tptr), - BYTTAB*sizeof(union tree *)); - lastt->tptr[b] = t; - } - } - - /* special cases: fill block or solid block */ - co = t->tcolor[0]; - cb = cm->cd[co].block; - if (t == fillt || t == cb) { - /* either way, we want a subcolor solid block */ - sco = newsub(cm, co); - t = cm->cd[sco].block; - if (t == NULL) { /* must set it up */ - t = (union tree *)MALLOC(sizeof(struct colors)); - if (t == NULL) { - CERR(REG_ESPACE); - return; - } - for (i = 0; i < BYTTAB; i++) - t->tcolor[i] = sco; - cm->cd[sco].block = t; - } - /* find loop must have run at least once */ - lastt->tptr[b] = t; - newarc(v->nfa, PLAIN, sco, lp, rp); - cm->cd[co].nchrs -= BYTTAB; - cm->cd[sco].nchrs += BYTTAB; - return; - } - - /* general case, a mixed block to be altered */ - i = 0; - while (i < BYTTAB) { - co = t->tcolor[i]; - sco = newsub(cm, co); - newarc(v->nfa, PLAIN, sco, lp, rp); - previ = i; - do { - t->tcolor[i++] = sco; - } while (i < BYTTAB && t->tcolor[i] == co); - ndone = i - previ; - cm->cd[co].nchrs -= ndone; - cm->cd[sco].nchrs += ndone; - } -} - -/* - - okcolors - promote subcolors to full colors - ^ static VOID okcolors(struct nfa *, struct colormap *); - */ -static VOID -okcolors(nfa, cm) -struct nfa *nfa; -struct colormap *cm; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - struct colordesc *scd; - struct arc *a; - color co; - color sco; - - for (cd = cm->cd, co = 0; cd < end; cd++, co++) { - sco = cd->sub; - if (UNUSEDCOLOR(cd) || sco == NOSUB) { - /* has no subcolor, no further action */ - } else if (sco == co) { - /* is subcolor, let parent deal with it */ - } else if (cd->nchrs == 0) { - /* parent empty, its arcs change color to subcolor */ - cd->sub = NOSUB; - scd = &cm->cd[sco]; - assert(scd->nchrs > 0); - assert(scd->sub == sco); - scd->sub = NOSUB; - while ((a = cd->arcs) != NULL) { - assert(a->co == co); - /* uncolorchain(cm, a); */ - cd->arcs = a->colorchain; - a->co = sco; - /* colorchain(cm, a); */ - a->colorchain = scd->arcs; - scd->arcs = a; - } - freecolor(cm, co); - } else { - /* parent's arcs must gain parallel subcolor arcs */ - cd->sub = NOSUB; - scd = &cm->cd[sco]; - assert(scd->nchrs > 0); - assert(scd->sub == sco); - scd->sub = NOSUB; - for (a = cd->arcs; a != NULL; a = a->colorchain) { - assert(a->co == co); - newarc(nfa, a->type, sco, a->from, a->to); - } - } - } -} - -/* - - colorchain - add this arc to the color chain of its color - ^ static VOID colorchain(struct colormap *, struct arc *); - */ -static VOID -colorchain(cm, a) -struct colormap *cm; -struct arc *a; -{ - struct colordesc *cd = &cm->cd[a->co]; - - a->colorchain = cd->arcs; - cd->arcs = a; -} - -/* - - uncolorchain - delete this arc from the color chain of its color - ^ static VOID uncolorchain(struct colormap *, struct arc *); - */ -static VOID -uncolorchain(cm, a) -struct colormap *cm; -struct arc *a; -{ - struct colordesc *cd = &cm->cd[a->co]; - struct arc *aa; - - aa = cd->arcs; - if (aa == a) /* easy case */ - cd->arcs = a->colorchain; - else { - for (; aa != NULL && aa->colorchain != a; aa = aa->colorchain) - continue; - assert(aa != NULL); - aa->colorchain = a->colorchain; - } - a->colorchain = NULL; /* paranoia */ -} - -/* - - singleton - is this character in its own color? - ^ static int singleton(struct colormap *, pchr c); - */ -#if 0 -static int /* predicate */ -singleton(cm, c) -struct colormap *cm; -pchr c; -{ - color co; /* color of c */ - - co = GETCOLOR(cm, c); - if (cm->cd[co].nchrs == 1 && cm->cd[co].sub == NOSUB) - return 1; - return 0; -} -#endif -/* - - rainbow - add arcs of all full colors (but one) between specified states - ^ static VOID rainbow(struct nfa *, struct colormap *, int, pcolor, - ^ struct state *, struct state *); - */ -static VOID -rainbow(nfa, cm, type, but, from, to) -struct nfa *nfa; -struct colormap *cm; -int type; -pcolor but; /* COLORLESS if no exceptions */ -struct state *from; -struct state *to; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - color co; - - for (cd = cm->cd, co = 0; cd < end && !CISERR(); cd++, co++) - if (!UNUSEDCOLOR(cd) && cd->sub != co && co != but && - !(cd->flags&PSEUDO)) - newarc(nfa, type, co, from, to); -} - -/* - - colorcomplement - add arcs of complementary colors - * The calling sequence ought to be reconciled with cloneouts(). - ^ static VOID colorcomplement(struct nfa *, struct colormap *, int, - ^ struct state *, struct state *, struct state *); - */ -static VOID -colorcomplement(nfa, cm, type, of, from, to) -struct nfa *nfa; -struct colormap *cm; -int type; -struct state *of; /* complements of this guy's PLAIN outarcs */ -struct state *from; -struct state *to; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - color co; - - assert(of != from); - for (cd = cm->cd, co = 0; cd < end && !CISERR(); cd++, co++) - if (!UNUSEDCOLOR(cd) && !(cd->flags&PSEUDO)) - if (findarc(of, PLAIN, co) == NULL) - newarc(nfa, type, co, from, to); -} - - - -#ifdef REG_DEBUG - -/* - - dumpcolors - debugging output - ^ static VOID dumpcolors(struct colormap *, FILE *); - */ -static VOID -dumpcolors(cm, f) -struct colormap *cm; -FILE *f; -{ - struct colordesc *cd; - struct colordesc *end; - color co; - chr c; - char *has; - - fprintf(f, "max %ld\n", (long)cm->max); - if (NBYTS > 1) - fillcheck(cm, cm->tree, 0, f); - end = CDEND(cm); - for (cd = cm->cd + 1, co = 1; cd < end; cd++, co++) /* skip 0 */ - if (!UNUSEDCOLOR(cd)) { - assert(cd->nchrs > 0); - has = (cd->block != NULL) ? "#" : ""; - if (cd->flags&PSEUDO) - fprintf(f, "#%2ld%s(ps): ", (long)co, has); - else - fprintf(f, "#%2ld%s(%2d): ", (long)co, - has, cd->nchrs); - /* it's hard to do this more efficiently */ - for (c = CHR_MIN; c < CHR_MAX; c++) - if (GETCOLOR(cm, c) == co) - dumpchr(c, f); - assert(c == CHR_MAX); - if (GETCOLOR(cm, c) == co) - dumpchr(c, f); - fprintf(f, "\n"); - } -} - -/* - - fillcheck - check proper filling of a tree - ^ static VOID fillcheck(struct colormap *, union tree *, int, FILE *); - */ -static VOID -fillcheck(cm, tree, level, f) -struct colormap *cm; -union tree *tree; -int level; /* level number (top == 0) of this block */ -FILE *f; -{ - int i; - union tree *t; - union tree *fillt = &cm->tree[level+1]; - - assert(level < NBYTS-1); /* this level has pointers */ - for (i = BYTTAB-1; i >= 0; i--) { - t = tree->tptr[i]; - if (t == NULL) - fprintf(f, "NULL found in filled tree!\n"); - else if (t == fillt) - {} - else if (level < NBYTS-2) /* more pointer blocks below */ - fillcheck(cm, t, level+1, f); - } -} - -/* - - dumpchr - print a chr - * Kind of char-centric but works well enough for debug use. - ^ static VOID dumpchr(pchr, FILE *); - */ -static VOID -dumpchr(c, f) -pchr c; -FILE *f; -{ - if (c == '\\') - fprintf(f, "\\\\"); - else if (c > ' ' && c <= '~') - putc((char)c, f); - else - fprintf(f, "\\u%04lx", (long)c); -} - -#endif /* ifdef REG_DEBUG */ diff --git a/generic/regc_cvec.c b/generic/regc_cvec.c deleted file mode 100644 index c79e741..0000000 --- a/generic/regc_cvec.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Utility functions for handling cvecs - * This file is #included by regcomp.c. - */ - -/* - - newcvec - allocate a new cvec - ^ static struct cvec *newcvec(int, int, int); - */ -static struct cvec * -newcvec(nchrs, nranges, nmcces) -int nchrs; /* to hold this many chrs... */ -int nranges; /* ... and this many ranges... */ -int nmcces; /* ... and this many MCCEs */ -{ - size_t n; - size_t nc; - struct cvec *cv; - - nc = (size_t)nchrs + (size_t)nmcces*(MAXMCCE+1) + (size_t)nranges*2; - n = sizeof(struct cvec) + (size_t)(nmcces-1)*sizeof(chr *) + - nc*sizeof(chr); - cv = (struct cvec *)MALLOC(n); - if (cv == NULL) - return NULL; - cv->chrspace = nc; - cv->chrs = (chr *)&cv->mcces[nmcces]; /* chrs just after MCCE ptrs */ - cv->mccespace = nmcces; - cv->ranges = cv->chrs + nchrs + nmcces*(MAXMCCE+1); - cv->rangespace = nranges; - return clearcvec(cv); -} - -/* - - clearcvec - clear a possibly-new cvec - * Returns pointer as convenience. - ^ static struct cvec *clearcvec(struct cvec *); - */ -static struct cvec * -clearcvec(cv) -struct cvec *cv; -{ - int i; - - assert(cv != NULL); - cv->nchrs = 0; - assert(cv->chrs == (chr *)&cv->mcces[cv->mccespace]); - cv->nmcces = 0; - cv->nmccechrs = 0; - cv->nranges = 0; - for (i = 0; i < cv->mccespace; i++) - cv->mcces[i] = NULL; - - return cv; -} - -/* - - addchr - add a chr to a cvec - ^ static VOID addchr(struct cvec *, pchr); - */ -static VOID -addchr(cv, c) -struct cvec *cv; -pchr c; -{ - assert(cv->nchrs < cv->chrspace - cv->nmccechrs); - cv->chrs[cv->nchrs++] = (chr)c; -} - -/* - - addrange - add a range to a cvec - ^ static VOID addrange(struct cvec *, pchr, pchr); - */ -static VOID -addrange(cv, from, to) -struct cvec *cv; -pchr from; -pchr to; -{ - assert(cv->nranges < cv->rangespace); - cv->ranges[cv->nranges*2] = (chr)from; - cv->ranges[cv->nranges*2 + 1] = (chr)to; - cv->nranges++; -} - -#ifdef USE_MCCE -/* - - addmcce - add an MCCE to a cvec - ^ static VOID addmcce(struct cvec *, chr *, chr *); - */ -static VOID -addmcce(cv, startp, endp) -struct cvec *cv; -chr *startp; /* beginning of text */ -chr *endp; /* just past end of text */ -{ - int n = endp - startp; - int i; - chr *s; - chr *d; - - assert(n > 0); - assert(cv->nchrs + n < cv->chrspace - cv->nmccechrs); - assert(cv->nmcces < cv->mccespace); - d = &cv->chrs[cv->chrspace - cv->nmccechrs - n - 1]; - cv->mcces[cv->nmcces++] = d; - for (s = startp, i = n; i > 0; s++, i--) - *d++ = *s; - *d++ = 0; /* endmarker */ - assert(d == &cv->chrs[cv->chrspace - cv->nmccechrs]); - cv->nmccechrs += n + 1; -} -#endif - -/* - - haschr - does a cvec contain this chr? - ^ static int haschr(struct cvec *, pchr); - */ -static int /* predicate */ -haschr(cv, c) -struct cvec *cv; -pchr c; -{ - int i; - chr *p; - - for (p = cv->chrs, i = cv->nchrs; i > 0; p++, i--) - if (*p == c) - return 1; - for (p = cv->ranges, i = cv->nranges; i > 0; p += 2, i--) - if (*p <= c && c <= *(p+1)) - return 1; - return 0; -} - -/* - - getcvec - get a cvec, remembering it as v->cv - ^ static struct cvec *getcvec(struct vars *, int, int, int); - */ -static struct cvec * -getcvec(v, nchrs, nranges, nmcces) -struct vars *v; -int nchrs; /* to hold this many chrs... */ -int nranges; /* ... and this many ranges... */ -int nmcces; /* ... and this many MCCEs */ -{ - if (v->cv != NULL && nchrs <= v->cv->chrspace && - nranges <= v->cv->rangespace && - nmcces <= v->cv->mccespace) - return clearcvec(v->cv); - - if (v->cv != NULL) - freecvec(v->cv); - v->cv = newcvec(nchrs, nranges, nmcces); - if (v->cv == NULL) - ERR(REG_ESPACE); - - return v->cv; -} - -/* - - freecvec - free a cvec - ^ static VOID freecvec(struct cvec *); - */ -static VOID -freecvec(cv) -struct cvec *cv; -{ - FREE(cv); -} diff --git a/generic/regc_lex.c b/generic/regc_lex.c deleted file mode 100644 index 5b93e0b..0000000 --- a/generic/regc_lex.c +++ /dev/null @@ -1,1010 +0,0 @@ -/* - * lexical analyzer - * This file is #included by regcomp.c. - */ - -/* scanning macros (know about v) */ -#define ATEOS() (v->now >= v->stop) -#define HAVE(n) (v->stop - v->now >= (n)) -#define NEXT1(c) (!ATEOS() && *v->now == CHR(c)) -#define NEXT2(a,b) (HAVE(2) && *v->now == CHR(a) && *(v->now+1) == CHR(b)) -#define NEXT3(a,b,c) (HAVE(3) && *v->now == CHR(a) && \ - *(v->now+1) == CHR(b) && \ - *(v->now+2) == CHR(c)) -#define SET(c) (v->nexttype = (c)) -#define SETV(c, n) (v->nexttype = (c), v->nextvalue = (n)) -#define RET(c) return (SET(c), 1) -#define RETV(c, n) return (SETV(c, n), 1) -#define FAILW(e) return (ERR(e), 0) /* ERR does SET(EOS) */ -#define LASTTYPE(t) (v->lasttype == (t)) - -/* lexical contexts */ -#define L_ERE 1 /* mainline ERE/ARE */ -#define L_BRE 2 /* mainline BRE */ -#define L_Q 3 /* REG_QUOTE */ -#define L_EBND 4 /* ERE/ARE bound */ -#define L_BBND 5 /* BRE bound */ -#define L_BRACK 6 /* brackets */ -#define L_CEL 7 /* collating element */ -#define L_ECL 8 /* equivalence class */ -#define L_CCL 9 /* character class */ -#define INTOCON(c) (v->lexcon = (c)) -#define INCON(con) (v->lexcon == (con)) - -/* construct pointer past end of chr array */ -#define ENDOF(array) ((array) + sizeof(array)/sizeof(chr)) - -/* - - lexstart - set up lexical stuff, scan leading options - ^ static VOID lexstart(struct vars *); - */ -static VOID -lexstart(v) -struct vars *v; -{ - prefixes(v); /* may turn on new type bits etc. */ - NOERR(); - - if (v->cflags®_QUOTE) { - assert(!(v->cflags&(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE))); - INTOCON(L_Q); - } else if (v->cflags®_EXTENDED) { - assert(!(v->cflags®_QUOTE)); - INTOCON(L_ERE); - } else { - assert(!(v->cflags&(REG_QUOTE|REG_ADVF))); - INTOCON(L_BRE); - } - - v->nexttype = EMPTY; /* remember we were at the start */ - next(v); /* set up the first token */ -} - -/* - - prefixes - implement various special prefixes - ^ static VOID prefixes(struct vars *); - */ -static VOID -prefixes(v) -struct vars *v; -{ - /* literal string doesn't get any of this stuff */ - if (v->cflags®_QUOTE) - return; - - /* initial "***" gets special things */ - if (HAVE(4) && NEXT3('*', '*', '*')) - switch (*(v->now + 3)) { - case CHR('?'): /* "***?" error, msg shows version */ - ERR(REG_BADPAT); - return; /* proceed no further */ - break; - case CHR('='): /* "***=" shifts to literal string */ - NOTE(REG_UNONPOSIX); - v->cflags |= REG_QUOTE; - v->cflags &= ~(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE); - v->now += 4; - return; /* and there can be no more prefixes */ - break; - case CHR(':'): /* "***:" shifts to AREs */ - NOTE(REG_UNONPOSIX); - v->cflags |= REG_ADVANCED; - v->now += 4; - break; - default: /* otherwise *** is just an error */ - ERR(REG_BADRPT); - return; - break; - } - - /* BREs and EREs don't get embedded options */ - if ((v->cflags®_ADVANCED) != REG_ADVANCED) - return; - - /* embedded options (AREs only) */ - if (HAVE(3) && NEXT2('(', '?') && iscalpha(*(v->now + 2))) { - NOTE(REG_UNONPOSIX); - v->now += 2; - for (; !ATEOS() && iscalpha(*v->now); v->now++) - switch (*v->now) { - case CHR('b'): /* BREs (but why???) */ - v->cflags &= ~(REG_ADVANCED|REG_QUOTE); - break; - case CHR('c'): /* case sensitive */ - v->cflags &= ~REG_ICASE; - break; - case CHR('e'): /* plain EREs */ - v->cflags |= REG_EXTENDED; - v->cflags &= ~(REG_ADVF|REG_QUOTE); - break; - case CHR('i'): /* case insensitive */ - v->cflags |= REG_ICASE; - break; - case CHR('m'): /* Perloid synonym for n */ - case CHR('n'): /* \n affects ^ $ . [^ */ - v->cflags |= REG_NEWLINE; - break; - case CHR('p'): /* ~Perl, \n affects . [^ */ - v->cflags |= REG_NLSTOP; - v->cflags &= ~REG_NLANCH; - break; - case CHR('q'): /* literal string */ - v->cflags |= REG_QUOTE; - v->cflags &= ~REG_ADVANCED; - break; - case CHR('s'): /* single line, \n ordinary */ - v->cflags &= ~REG_NEWLINE; - break; - case CHR('t'): /* tight syntax */ - v->cflags &= ~REG_EXPANDED; - break; - case CHR('w'): /* weird, \n affects ^ $ only */ - v->cflags &= ~REG_NLSTOP; - v->cflags |= REG_NLANCH; - break; - case CHR('x'): /* expanded syntax */ - v->cflags |= REG_EXPANDED; - break; - default: - ERR(REG_BADOPT); - return; - } - if (!NEXT1(')')) { - ERR(REG_BADOPT); - return; - } - v->now++; - if (v->cflags®_QUOTE) - v->cflags &= ~(REG_EXPANDED|REG_NEWLINE); - } -} - -/* - - lexnest - "call a subroutine", interpolating string at the lexical level - * Note, this is not a very general facility. There are a number of - * implicit assumptions about what sorts of strings can be subroutines. - ^ static VOID lexnest(struct vars *, chr *, chr *); - */ -static VOID -lexnest(v, beginp, endp) -struct vars *v; -chr *beginp; /* start of interpolation */ -chr *endp; /* one past end of interpolation */ -{ - assert(v->savenow == NULL); /* only one level of nesting */ - v->savenow = v->now; - v->savestop = v->stop; - v->now = beginp; - v->stop = endp; -} - -/* - * string constants to interpolate as expansions of things like \d - */ -static chr backd[] = { /* \d */ - CHR('['), CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr backD[] = { /* \D */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr brbackd[] = { /* \d within brackets */ - CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']') -}; -static chr backs[] = { /* \s */ - CHR('['), CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr backS[] = { /* \S */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr brbacks[] = { /* \s within brackets */ - CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']') -}; -static chr backw[] = { /* \w */ - CHR('['), CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_'), CHR(']') -}; -static chr backW[] = { /* \W */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_'), CHR(']') -}; -static chr brbackw[] = { /* \w within brackets */ - CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_') -}; - -/* - - lexword - interpolate a bracket expression for word characters - * Possibly ought to inquire whether there is a "word" character class. - ^ static VOID lexword(struct vars *); - */ -static VOID -lexword(v) -struct vars *v; -{ - lexnest(v, backw, ENDOF(backw)); -} - -/* - - next - get next token - ^ static int next(struct vars *); - */ -static int /* 1 normal, 0 failure */ -next(v) -struct vars *v; -{ - chr c; - - /* errors yield an infinite sequence of failures */ - if (ISERR()) - return 0; /* the error has set nexttype to EOS */ - - /* remember flavor of last token */ - v->lasttype = v->nexttype; - - /* if we're nested and we've hit end, return to outer level */ - if (v->savenow != NULL && ATEOS()) { - v->now = v->savenow; - v->stop = v->savestop; - v->savenow = v->savestop = NULL; - } - - /* skip white space etc. if appropriate (not in literal or []) */ - if (v->cflags®_EXPANDED) - switch (v->lexcon) { - case L_ERE: - case L_BRE: - case L_EBND: - case L_BBND: - skip(v); - break; - } - - /* handle EOS, depending on context */ - if (ATEOS()) { - switch (v->lexcon) { - case L_ERE: - case L_BRE: - case L_Q: - RET(EOS); - break; - case L_EBND: - case L_BBND: - FAILW(REG_EBRACE); - break; - case L_BRACK: - case L_CEL: - case L_ECL: - case L_CCL: - FAILW(REG_EBRACK); - break; - } - assert(NOTREACHED); - } - - /* okay, time to actually get a character */ - c = *v->now++; - - /* deal with the easy contexts, punt EREs to code below */ - switch (v->lexcon) { - case L_BRE: /* punt BREs to separate function */ - return brenext(v, c); - break; - case L_ERE: /* see below */ - break; - case L_Q: /* literal strings are easy */ - RETV(PLAIN, c); - break; - case L_BBND: /* bounds are fairly simple */ - case L_EBND: - switch (c) { - case CHR('0'): case CHR('1'): case CHR('2'): case CHR('3'): - case CHR('4'): case CHR('5'): case CHR('6'): case CHR('7'): - case CHR('8'): case CHR('9'): - RETV(DIGIT, (chr)DIGITVAL(c)); - break; - case CHR(','): - RET(','); - break; - case CHR('}'): /* ERE bound ends with } */ - if (INCON(L_EBND)) { - INTOCON(L_ERE); - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('}', 0); - } - RETV('}', 1); - } else - FAILW(REG_BADBR); - break; - case CHR('\\'): /* BRE bound ends with \} */ - if (INCON(L_BBND) && NEXT1('}')) { - v->now++; - INTOCON(L_BRE); - RET('}'); - } else - FAILW(REG_BADBR); - break; - default: - FAILW(REG_BADBR); - break; - } - assert(NOTREACHED); - break; - case L_BRACK: /* brackets are not too hard */ - switch (c) { - case CHR(']'): - if (LASTTYPE('[')) - RETV(PLAIN, c); - else { - INTOCON((v->cflags®_EXTENDED) ? - L_ERE : L_BRE); - RET(']'); - } - break; - case CHR('\\'): - NOTE(REG_UBBS); - if (!(v->cflags®_ADVF)) - RETV(PLAIN, c); - NOTE(REG_UNONPOSIX); - if (ATEOS()) - FAILW(REG_EESCAPE); - (DISCARD)lexescape(v); - switch (v->nexttype) { /* not all escapes okay here */ - case PLAIN: - return 1; - break; - case CCLASS: - switch (v->nextvalue) { - case 'd': - lexnest(v, brbackd, ENDOF(brbackd)); - break; - case 's': - lexnest(v, brbacks, ENDOF(brbacks)); - break; - case 'w': - lexnest(v, brbackw, ENDOF(brbackw)); - break; - default: - FAILW(REG_EESCAPE); - break; - } - /* lexnest done, back up and try again */ - v->nexttype = v->lasttype; - return next(v); - break; - } - /* not one of the acceptable escapes */ - FAILW(REG_EESCAPE); - break; - case CHR('-'): - if (LASTTYPE('[') || NEXT1(']')) - RETV(PLAIN, c); - else - RETV(RANGE, c); - break; - case CHR('['): - if (ATEOS()) - FAILW(REG_EBRACK); - switch (*v->now++) { - case CHR('.'): - INTOCON(L_CEL); - /* might or might not be locale-specific */ - RET(COLLEL); - break; - case CHR('='): - INTOCON(L_ECL); - NOTE(REG_ULOCALE); - RET(ECLASS); - break; - case CHR(':'): - INTOCON(L_CCL); - NOTE(REG_ULOCALE); - RET(CCLASS); - break; - default: /* oops */ - v->now--; - RETV(PLAIN, c); - break; - } - assert(NOTREACHED); - break; - default: - RETV(PLAIN, c); - break; - } - assert(NOTREACHED); - break; - case L_CEL: /* collating elements are easy */ - if (c == CHR('.') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, '.'); - } else - RETV(PLAIN, c); - break; - case L_ECL: /* ditto equivalence classes */ - if (c == CHR('=') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, '='); - } else - RETV(PLAIN, c); - break; - case L_CCL: /* ditto character classes */ - if (c == CHR(':') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, ':'); - } else - RETV(PLAIN, c); - break; - default: - assert(NOTREACHED); - break; - } - - /* that got rid of everything except EREs and AREs */ - assert(INCON(L_ERE)); - - /* deal with EREs and AREs, except for backslashes */ - switch (c) { - case CHR('|'): - RET('|'); - break; - case CHR('*'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('*', 0); - } - RETV('*', 1); - break; - case CHR('+'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('+', 0); - } - RETV('+', 1); - break; - case CHR('?'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('?', 0); - } - RETV('?', 1); - break; - case CHR('{'): /* bounds start or plain character */ - if (v->cflags®_EXPANDED) - skip(v); - if (ATEOS() || !iscdigit(*v->now)) { - NOTE(REG_UBRACES); - NOTE(REG_UUNSPEC); - RETV(PLAIN, c); - } else { - NOTE(REG_UBOUNDS); - INTOCON(L_EBND); - RET('{'); - } - assert(NOTREACHED); - break; - case CHR('('): /* parenthesis, or advanced extension */ - if ((v->cflags®_ADVF) && NEXT1('?')) { - NOTE(REG_UNONPOSIX); - v->now++; - switch (*v->now++) { - case CHR(':'): /* non-capturing paren */ - RETV('(', 0); - break; - case CHR('#'): /* comment */ - while (!ATEOS() && *v->now != CHR(')')) - v->now++; - if (!ATEOS()) - v->now++; - assert(v->nexttype == v->lasttype); - return next(v); - break; - case CHR('='): /* positive lookahead */ - NOTE(REG_ULOOKAHEAD); - RETV(LACON, 1); - break; - case CHR('!'): /* negative lookahead */ - NOTE(REG_ULOOKAHEAD); - RETV(LACON, 0); - break; - default: - FAILW(REG_BADRPT); - break; - } - assert(NOTREACHED); - } - if (v->cflags®_NOSUB) - RETV('(', 0); /* all parens non-capturing */ - else - RETV('(', 1); - break; - case CHR(')'): - if (LASTTYPE('(')) { - NOTE(REG_UUNSPEC); - } - RETV(')', c); - break; - case CHR('['): /* easy except for [[:<:]] and [[:>:]] */ - if (HAVE(6) && *(v->now+0) == CHR('[') && - *(v->now+1) == CHR(':') && - (*(v->now+2) == CHR('<') || - *(v->now+2) == CHR('>')) && - *(v->now+3) == CHR(':') && - *(v->now+4) == CHR(']') && - *(v->now+5) == CHR(']')) { - c = *(v->now+2); - v->now += 6; - NOTE(REG_UNONPOSIX); - RET((c == CHR('<')) ? '<' : '>'); - } - INTOCON(L_BRACK); - if (NEXT1('^')) { - v->now++; - RETV('[', 0); - } - RETV('[', 1); - break; - case CHR('.'): - RET('.'); - break; - case CHR('^'): - RET('^'); - break; - case CHR('$'): - RET('$'); - break; - case CHR('\\'): /* mostly punt backslashes to code below */ - if (ATEOS()) - FAILW(REG_EESCAPE); - break; - default: /* ordinary character */ - RETV(PLAIN, c); - break; - } - - /* ERE/ARE backslash handling; backslash already eaten */ - assert(!ATEOS()); - if (!(v->cflags®_ADVF)) { /* only AREs have non-trivial escapes */ - if (iscalnum(*v->now)) { - NOTE(REG_UBSALNUM); - NOTE(REG_UUNSPEC); - } - RETV(PLAIN, *v->now++); - } - (DISCARD)lexescape(v); - if (ISERR()) - FAILW(REG_EESCAPE); - if (v->nexttype == CCLASS) { /* fudge at lexical level */ - switch (v->nextvalue) { - case 'd': lexnest(v, backd, ENDOF(backd)); break; - case 'D': lexnest(v, backD, ENDOF(backD)); break; - case 's': lexnest(v, backs, ENDOF(backs)); break; - case 'S': lexnest(v, backS, ENDOF(backS)); break; - case 'w': lexnest(v, backw, ENDOF(backw)); break; - case 'W': lexnest(v, backW, ENDOF(backW)); break; - default: - assert(NOTREACHED); - FAILW(REG_ASSERT); - break; - } - /* lexnest done, back up and try again */ - v->nexttype = v->lasttype; - return next(v); - } - /* otherwise, lexescape has already done the work */ - return !ISERR(); -} - -/* - - lexescape - parse an ARE backslash escape (backslash already eaten) - * Note slightly nonstandard use of the CCLASS type code. - ^ static int lexescape(struct vars *); - */ -static int /* not actually used, but convenient for RETV */ -lexescape(v) -struct vars *v; -{ - chr c; - static chr alert[] = { - CHR('a'), CHR('l'), CHR('e'), CHR('r'), CHR('t') - }; - static chr esc[] = { - CHR('E'), CHR('S'), CHR('C') - }; - chr *save; - - assert(v->cflags®_ADVF); - - assert(!ATEOS()); - c = *v->now++; - if (!iscalnum(c)) - RETV(PLAIN, c); - - NOTE(REG_UNONPOSIX); - switch (c) { - case CHR('a'): - RETV(PLAIN, chrnamed(v, alert, ENDOF(alert), CHR('\007'))); - break; - case CHR('A'): - RETV(SBEGIN, 0); - break; - case CHR('b'): - RETV(PLAIN, CHR('\b')); - break; - case CHR('B'): - RETV(PLAIN, CHR('\\')); - break; - case CHR('c'): - NOTE(REG_UUNPORT); - if (ATEOS()) - FAILW(REG_EESCAPE); - RETV(PLAIN, (chr)(*v->now++ & 037)); - break; - case CHR('d'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'd'); - break; - case CHR('D'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'D'); - break; - case CHR('e'): - NOTE(REG_UUNPORT); - RETV(PLAIN, chrnamed(v, esc, ENDOF(esc), CHR('\033'))); - break; - case CHR('f'): - RETV(PLAIN, CHR('\f')); - break; - case CHR('m'): - RET('<'); - break; - case CHR('M'): - RET('>'); - break; - case CHR('n'): - RETV(PLAIN, CHR('\n')); - break; - case CHR('r'): - RETV(PLAIN, CHR('\r')); - break; - case CHR('s'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 's'); - break; - case CHR('S'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'S'); - break; - case CHR('t'): - RETV(PLAIN, CHR('\t')); - break; - case CHR('u'): - c = lexdigits(v, 16, 4, 4); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('U'): - c = lexdigits(v, 16, 8, 8); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('v'): - RETV(PLAIN, CHR('\v')); - break; - case CHR('w'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'w'); - break; - case CHR('W'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'W'); - break; - case CHR('x'): - NOTE(REG_UUNPORT); - c = lexdigits(v, 16, 1, 255); /* REs >255 long outside spec */ - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('y'): - NOTE(REG_ULOCALE); - RETV(WBDRY, 0); - break; - case CHR('Y'): - NOTE(REG_ULOCALE); - RETV(NWBDRY, 0); - break; - case CHR('Z'): - RETV(SEND, 0); - break; - case CHR('1'): case CHR('2'): case CHR('3'): case CHR('4'): - case CHR('5'): case CHR('6'): case CHR('7'): case CHR('8'): - case CHR('9'): - save = v->now; - v->now--; /* put first digit back */ - c = lexdigits(v, 10, 1, 255); /* REs >255 long outside spec */ - if (ISERR()) - FAILW(REG_EESCAPE); - /* ugly heuristic (first test is "exactly 1 digit?") */ - if (v->now - save == 0 || (int)c <= v->nsubexp) { - NOTE(REG_UBACKREF); - RETV(BACKREF, (chr)c); - } - /* oops, doesn't look like it's a backref after all... */ - v->now = save; - /* and fall through into octal number */ - case CHR('0'): - NOTE(REG_UUNPORT); - v->now--; /* put first digit back */ - c = lexdigits(v, 8, 1, 3); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - default: - assert(iscalpha(c)); - FAILW(REG_EESCAPE); /* unknown alphabetic escape */ - break; - } - assert(NOTREACHED); -} - -/* - - lexdigits - slurp up digits and return chr value - ^ static chr lexdigits(struct vars *, int, int, int); - */ -static chr /* chr value; errors signalled via ERR */ -lexdigits(v, base, minlen, maxlen) -struct vars *v; -int base; -int minlen; -int maxlen; -{ - uchr n; /* unsigned to avoid overflow misbehavior */ - int len; - chr c; - int d; - CONST uchr ub = (uchr) base; - - n = 0; - for (len = 0; len < maxlen && !ATEOS(); len++) { - c = *v->now++; - switch (c) { - case CHR('0'): case CHR('1'): case CHR('2'): case CHR('3'): - case CHR('4'): case CHR('5'): case CHR('6'): case CHR('7'): - case CHR('8'): case CHR('9'): - d = DIGITVAL(c); - break; - case CHR('a'): case CHR('A'): d = 10; break; - case CHR('b'): case CHR('B'): d = 11; break; - case CHR('c'): case CHR('C'): d = 12; break; - case CHR('d'): case CHR('D'): d = 13; break; - case CHR('e'): case CHR('E'): d = 14; break; - case CHR('f'): case CHR('F'): d = 15; break; - default: - v->now--; /* oops, not a digit at all */ - d = -1; - break; - } - - if (d >= base) { /* not a plausible digit */ - v->now--; - d = -1; - } - if (d < 0) - break; /* NOTE BREAK OUT */ - n = n*ub + (uchr)d; - } - if (len < minlen) - ERR(REG_EESCAPE); - - return (chr)n; -} - -/* - - brenext - get next BRE token - * This is much like EREs except for all the stupid backslashes and the - * context-dependency of some things. - ^ static int brenext(struct vars *, pchr); - */ -static int /* 1 normal, 0 failure */ -brenext(v, pc) -struct vars *v; -pchr pc; -{ - chr c = (chr)pc; - - switch (c) { - case CHR('*'): - if (LASTTYPE(EMPTY) || LASTTYPE('(') || LASTTYPE('^')) - RETV(PLAIN, c); - RET('*'); - break; - case CHR('['): - if (HAVE(6) && *(v->now+0) == CHR('[') && - *(v->now+1) == CHR(':') && - (*(v->now+2) == CHR('<') || - *(v->now+2) == CHR('>')) && - *(v->now+3) == CHR(':') && - *(v->now+4) == CHR(']') && - *(v->now+5) == CHR(']')) { - c = *(v->now+2); - v->now += 6; - NOTE(REG_UNONPOSIX); - RET((c == CHR('<')) ? '<' : '>'); - } - INTOCON(L_BRACK); - if (NEXT1('^')) { - v->now++; - RETV('[', 0); - } - RETV('[', 1); - break; - case CHR('.'): - RET('.'); - break; - case CHR('^'): - if (LASTTYPE(EMPTY)) - RET('^'); - if (LASTTYPE('(')) { - NOTE(REG_UUNSPEC); - RET('^'); - } - RETV(PLAIN, c); - break; - case CHR('$'): - if (v->cflags®_EXPANDED) - skip(v); - if (ATEOS()) - RET('$'); - if (NEXT2('\\', ')')) { - NOTE(REG_UUNSPEC); - RET('$'); - } - RETV(PLAIN, c); - break; - case CHR('\\'): - break; /* see below */ - default: - RETV(PLAIN, c); - break; - } - - assert(c == CHR('\\')); - - if (ATEOS()) - FAILW(REG_EESCAPE); - - c = *v->now++; - switch (c) { - case CHR('{'): - INTOCON(L_BBND); - NOTE(REG_UBOUNDS); - RET('{'); - break; - case CHR('('): - RETV('(', 1); - break; - case CHR(')'): - RETV(')', c); - break; - case CHR('<'): - NOTE(REG_UNONPOSIX); - RET('<'); - break; - case CHR('>'): - NOTE(REG_UNONPOSIX); - RET('>'); - break; - case CHR('1'): case CHR('2'): case CHR('3'): case CHR('4'): - case CHR('5'): case CHR('6'): case CHR('7'): case CHR('8'): - case CHR('9'): - NOTE(REG_UBACKREF); - RETV(BACKREF, (chr)DIGITVAL(c)); - break; - default: - if (iscalnum(c)) { - NOTE(REG_UBSALNUM); - NOTE(REG_UUNSPEC); - } - RETV(PLAIN, c); - break; - } - - assert(NOTREACHED); -} - -/* - - skip - skip white space and comments in expanded form - ^ static VOID skip(struct vars *); - */ -static VOID -skip(v) -struct vars *v; -{ - chr *start = v->now; - - assert(v->cflags®_EXPANDED); - - for (;;) { - while (!ATEOS() && iscspace(*v->now)) - v->now++; - if (ATEOS() || *v->now != CHR('#')) - break; /* NOTE BREAK OUT */ - assert(NEXT1('#')); - while (!ATEOS() && *v->now != CHR('\n')) - v->now++; - /* leave the newline to be picked up by the iscspace loop */ - } - - if (v->now != start) - NOTE(REG_UNONPOSIX); -} - -/* - - newline - return the chr for a newline - * This helps confine use of CHR to this source file. - ^ static chr newline(NOPARMS); - */ -static chr -newline() -{ - return CHR('\n'); -} - -/* - - chrnamed - return the chr known by a given (chr string) name - * The code is a bit clumsy, but this routine gets only such specialized - * use that it hardly matters. - ^ static chr chrnamed(struct vars *, chr *, chr *, pchr); - */ -static chr -chrnamed(v, startp, endp, lastresort) -struct vars *v; -chr *startp; /* start of name */ -chr *endp; /* just past end of name */ -pchr lastresort; /* what to return if name lookup fails */ -{ - celt c; - int errsave; - int e; - struct cvec *cv; - - errsave = v->err; - v->err = 0; - c = element(v, startp, endp); - e = v->err; - v->err = errsave; - - if (e != 0) - return (chr)lastresort; - - cv = range(v, c, c, 0); - if (cv->nchrs == 0) - return (chr)lastresort; - return cv->chrs[0]; -} diff --git a/generic/regc_locale.c b/generic/regc_locale.c deleted file mode 100644 index 82e83e2..0000000 --- a/generic/regc_locale.c +++ /dev/null @@ -1,781 +0,0 @@ -/* - * regc_locale.c -- - * - * This file contains the Unicode locale specific regexp routines. - * This file is #included by regcomp.c. - * - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: regc_locale.c,v 1.2 1999/04/16 00:46:37 stanton Exp $ - */ - -/* ASCII character-name table */ - -static struct cname { - char *name; - char code; -} cnames[] = { - {"NUL", '\0'}, - {"SOH", '\001'}, - {"STX", '\002'}, - {"ETX", '\003'}, - {"EOT", '\004'}, - {"ENQ", '\005'}, - {"ACK", '\006'}, - {"BEL", '\007'}, - {"alert", '\007'}, - {"BS", '\010'}, - {"backspace", '\b'}, - {"HT", '\011'}, - {"tab", '\t'}, - {"LF", '\012'}, - {"newline", '\n'}, - {"VT", '\013'}, - {"vertical-tab", '\v'}, - {"FF", '\014'}, - {"form-feed", '\f'}, - {"CR", '\015'}, - {"carriage-return", '\r'}, - {"SO", '\016'}, - {"SI", '\017'}, - {"DLE", '\020'}, - {"DC1", '\021'}, - {"DC2", '\022'}, - {"DC3", '\023'}, - {"DC4", '\024'}, - {"NAK", '\025'}, - {"SYN", '\026'}, - {"ETB", '\027'}, - {"CAN", '\030'}, - {"EM", '\031'}, - {"SUB", '\032'}, - {"ESC", '\033'}, - {"IS4", '\034'}, - {"FS", '\034'}, - {"IS3", '\035'}, - {"GS", '\035'}, - {"IS2", '\036'}, - {"RS", '\036'}, - {"IS1", '\037'}, - {"US", '\037'}, - {"space", ' '}, - {"exclamation-mark", '!'}, - {"quotation-mark", '"'}, - {"number-sign", '#'}, - {"dollar-sign", '$'}, - {"percent-sign", '%'}, - {"ampersand", '&'}, - {"apostrophe", '\''}, - {"left-parenthesis", '('}, - {"right-parenthesis", ')'}, - {"asterisk", '*'}, - {"plus-sign", '+'}, - {"comma", ','}, - {"hyphen", '-'}, - {"hyphen-minus", '-'}, - {"period", '.'}, - {"full-stop", '.'}, - {"slash", '/'}, - {"solidus", '/'}, - {"zero", '0'}, - {"one", '1'}, - {"two", '2'}, - {"three", '3'}, - {"four", '4'}, - {"five", '5'}, - {"six", '6'}, - {"seven", '7'}, - {"eight", '8'}, - {"nine", '9'}, - {"colon", ':'}, - {"semicolon", ';'}, - {"less-than-sign", '<'}, - {"equals-sign", '='}, - {"greater-than-sign", '>'}, - {"question-mark", '?'}, - {"commercial-at", '@'}, - {"left-square-bracket", '['}, - {"backslash", '\\'}, - {"reverse-solidus", '\\'}, - {"right-square-bracket", ']'}, - {"circumflex", '^'}, - {"circumflex-accent", '^'}, - {"underscore", '_'}, - {"low-line", '_'}, - {"grave-accent", '`'}, - {"left-brace", '{'}, - {"left-curly-bracket", '{'}, - {"vertical-line", '|'}, - {"right-brace", '}'}, - {"right-curly-bracket", '}'}, - {"tilde", '~'}, - {"DEL", '\177'}, - {NULL, 0} -}; - -/* Unicode character-class tables */ - -typedef struct crange { - chr start; - chr end; -} crange; - -static crange alphaTable[] = { - {0X0041, 0X005A}, {0X0061, 0X007A}, {0X00AA, 0X00AA}, {0X00B5, 0X00B5}, - {0X00BA, 0X00BA}, {0X00C0, 0X00D6}, {0X00D8, 0X00F6}, {0X00F8, 0X01F5}, - {0X01FA, 0X0217}, {0X0250, 0X02A8}, {0X02B0, 0X02B8}, {0X02BB, 0X02C1}, - {0X02E0, 0X02E4}, {0X037A, 0X037A}, {0x0386, 0x0386}, {0X0388, 0X038A}, - {0X038C, 0X038C}, {0X038E, 0X03A1}, {0X03A3, 0X03CE}, {0X03D0, 0X03D6}, - {0X03DA, 0X03DA}, {0X03DC, 0X03DC}, {0X03DE, 0X03DE}, {0X03E0, 0X03E0}, - {0X03E2, 0X03F3}, {0X0401, 0X040C}, {0X040E, 0X044F}, {0X0451, 0X045C}, - {0X045E, 0X0481}, {0X0490, 0X04C4}, {0X04C7, 0X04C8}, {0X04CB, 0X04CC}, - {0X04D0, 0X04EB}, {0X04EE, 0X04F5}, {0X04F8, 0X04F9}, {0x0531, 0x0556}, - {0x0559, 0x0559}, {0x0561, 0x0587}, {0X05D0, 0X05EA}, {0X05F0, 0X05F2}, - {0X0621, 0X063A}, {0x0641, 0x0652}, {0X0670, 0X06B7}, {0X06BA, 0X06BE}, - {0X06C0, 0X06CE}, {0X06D0, 0X06D3}, {0X06D5, 0X06DC}, {0X06E1, 0X06E8}, - {0X06ED, 0X06ED}, {0x0901, 0x0903}, {0x0905, 0x0939}, {0X093D, 0X094C}, - {0x0958, 0x0963}, {0x0981, 0x0983}, {0X0985, 0X098C}, {0X098F, 0X0990}, - {0X0993, 0X09A8}, {0X09AA, 0X09B0}, {0X09B2, 0X09B2}, {0X09B6, 0X09B9}, - {0X09BE, 0X09C4}, {0X09C7, 0X09C8}, {0X09CB, 0X09CC}, {0X09D7, 0X09D7}, - {0X09DC, 0X09DD}, {0X09DF, 0X09E3}, {0X09F0, 0X09F1}, {0X0A02, 0X0A02}, - {0X0A05, 0X0A0A}, {0X0A0F, 0X0A10}, {0X0A13, 0X0A28}, {0X0A2A, 0X0A30}, - {0X0A32, 0X0A33}, {0X0A35, 0X0A36}, {0X0A38, 0X0A39}, {0X0A3E, 0X0A42}, - {0X0A47, 0X0A48}, {0X0A4B, 0X0A4C}, {0X0A59, 0X0A5C}, {0X0A5E, 0X0A5E}, - {0X0A70, 0X0A74}, {0X0A81, 0X0A83}, {0X0A85, 0X0A8B}, {0X0A8D, 0X0A8D}, - {0X0A8F, 0X0A91}, {0X0A93, 0X0AA8}, {0X0AAA, 0X0AB0}, {0X0AB2, 0X0AB3}, - {0X0AB5, 0X0AB9}, {0X0ABD, 0X0AC5}, {0X0AC7, 0X0AC9}, {0X0ACB, 0X0ACC}, - {0X0AE0, 0X0AE0}, {0X0B01, 0X0B03}, {0X0B05, 0X0B0C}, {0X0B0F, 0X0B10}, - {0X0B13, 0X0B28}, {0X0B2A, 0X0B30}, {0X0B32, 0X0B33}, {0X0B36, 0X0B39}, - {0X0B3D, 0X0B43}, {0X0B47, 0X0B48}, {0X0B4B, 0X0B4C}, {0X0B56, 0X0B57}, - {0X0B5C, 0X0B5D}, {0X0B5F, 0X0B61}, {0X0B82, 0X0B83}, {0X0B85, 0X0B8A}, - {0X0B8E, 0X0B90}, {0X0B92, 0X0B95}, {0X0B99, 0X0B9A}, {0X0B9C, 0X0B9C}, - {0X0B9E, 0X0B9F}, {0X0BA3, 0X0BA4}, {0X0BA8, 0X0BAA}, {0X0BAE, 0X0BB5}, - {0X0BB7, 0X0BB9}, {0X0BBE, 0X0BC2}, {0X0BC6, 0X0BC8}, {0X0BCA, 0X0BCC}, - {0X0BD7, 0X0BD7}, {0X0C01, 0X0C03}, {0X0C05, 0X0C0C}, {0X0C0E, 0X0C10}, - {0X0C12, 0X0C28}, {0X0C2A, 0X0C33}, {0X0C35, 0X0C39}, {0X0C3E, 0X0C44}, - {0X0C46, 0X0C48}, {0X0C4A, 0X0C4C}, {0X0C55, 0X0C56}, {0X0C60, 0X0C61}, - {0X0C82, 0X0C83}, {0X0C85, 0X0C8C}, {0X0C8E, 0X0C90}, {0X0C92, 0X0CA8}, - {0X0CAA, 0X0CB3}, {0X0CB5, 0X0CB9}, {0X0CBE, 0X0CC4}, {0X0CC6, 0X0CC8}, - {0X0CCA, 0X0CCC}, {0X0CD5, 0X0CD6}, {0X0CDE, 0X0CDE}, {0X0CE0, 0X0CE1}, - {0X0D02, 0X0D03}, {0X0D05, 0X0D0C}, {0X0D0E, 0X0D10}, {0X0D12, 0X0D28}, - {0X0D2A, 0X0D39}, {0X0D3E, 0X0D43}, {0X0D46, 0X0D48}, {0X0D4A, 0X0D4C}, - {0X0D57, 0X0D57}, {0X0D60, 0X0D61}, {0X0E01, 0X0E2E}, {0X0E30, 0X0E3A}, - {0X0E40, 0X0E45}, {0X0E47, 0X0E47}, {0X0E4D, 0X0E4D}, {0X0E81, 0X0E82}, - {0X0E84, 0X0E84}, {0X0E87, 0X0E88}, {0X0E8A, 0X0E8A}, {0X0E8D, 0X0E8D}, - {0X0E94, 0X0E97}, {0X0E99, 0X0E9F}, {0X0EA1, 0X0EA3}, {0X0EA5, 0X0EA5}, - {0X0EA7, 0X0EA7}, {0X0EAA, 0X0EAB}, {0X0EAD, 0X0EAE}, {0X0EB0, 0X0EB9}, - {0X0EBB, 0X0EBD}, {0X0EC0, 0X0EC4}, {0X0ECD, 0X0ECD}, {0X0EDC, 0X0EDD}, - {0X0F40, 0X0F47}, {0X0F49, 0X0F69}, {0X0F71, 0X0F81}, {0X0F90, 0X0F95}, - {0X0F97, 0X0F97}, {0X0F99, 0X0FAD}, {0X0FB1, 0X0FB7}, {0X0FB9, 0X0FB9}, - {0X10A0, 0X10C5}, {0X10D0, 0X10F6}, {0x1100, 0x1159}, {0X115F, 0X11A2}, - {0X11A8, 0X11F9}, {0X1E00, 0X1E9B}, {0X1EA0, 0X1EF9}, {0X1F00, 0X1F15}, - {0X1F18, 0X1F1D}, {0X1F20, 0X1F45}, {0X1F48, 0X1F4D}, {0X1F50, 0X1F57}, - {0X1F59, 0X1F59}, {0X1F5B, 0X1F5B}, {0X1F5D, 0X1F5D}, {0X1F5F, 0X1F7D}, - {0X1F80, 0X1FB4}, {0X1FB6, 0X1FBC}, {0X1FBE, 0X1FBE}, {0X1FC2, 0X1FC4}, - {0X1FC6, 0X1FCC}, {0X1FD0, 0X1FD3}, {0X1FD6, 0X1FDB}, {0X1FE0, 0X1FEC}, - {0X1FF2, 0X1FF4}, {0X1FF6, 0X1FFC}, {0X207F, 0X207F}, {0x2102, 0x2102}, - {0x2107, 0x2107}, {0X210A, 0X2113}, {0x2115, 0x2115}, {0X2118, 0X211D}, - {0x2124, 0x2124}, {0x2126, 0x2126}, {0x2128, 0x2128}, {0X212A, 0X2131}, - {0x2133, 0x2138}, {0x2160, 0x2182}, {0x3041, 0x3094}, {0X30A1, 0X30FA}, - {0X3105, 0X312C}, {0X3131, 0X318E}, {0XAC00, 0XD7A3}, {0XFB00, 0XFB06}, - {0XFB13, 0XFB17}, {0XFB1F, 0XFB28}, {0XFB2A, 0XFB36}, {0XFB38, 0XFB3C}, - {0XFB3E, 0XFB3E}, {0XFB40, 0XFB41}, {0XFB43, 0XFB44}, {0XFB46, 0XFBB1}, - {0XFBD3, 0XFD3D}, {0XFD50, 0XFD8F}, {0XFD92, 0XFDC7}, {0XFDF0, 0XFDFB}, - {0XFE70, 0XFE72}, {0XFE74, 0XFE74}, {0XFE76, 0XFEFC}, {0XFF21, 0XFF3A}, - {0XFF41, 0XFF5A}, {0XFF66, 0XFF6F}, {0XFF71, 0XFF9D}, {0XFFA0, 0XFFBE}, - {0XFFC2, 0XFFC7}, {0XFFCA, 0XFFCF}, {0XFFD2, 0XFFD7}, {0XFFDA, 0XFFDC} -}; - -#define NUM_ALPHA (sizeof(alphaTable)/sizeof(crange)) - -static crange digitTable[] = { - {0x0030, 0x0039} -}; - -#define NUM_DIGIT (sizeof(digitTable)/sizeof(crange)) - -static crange punctTable[] = { - {0x0021, 0x0023}, {0X0025, 0X002A}, {0X002C, 0X002F}, {0X003A, 0X003B}, - {0X003F, 0X0040}, {0X005B, 0X005D}, {0X005F, 0X005F}, {0X007B, 0X007B}, - {0X007D, 0X007D}, {0X00A1, 0X00A1}, {0X00AB, 0X00AB}, {0X00AD, 0X00AD}, - {0X00BB, 0X00BB}, {0X00BF, 0X00BF}, {0X02BC, 0X02BC}, {0x0374, 0x0375}, - {0X037E, 0X037E}, {0x0387, 0x0387}, {0X055A, 0X055F}, {0x0589, 0x0589}, - {0X05BE, 0X05BE}, {0X05C0, 0X05C0}, {0X05C3, 0X05C3}, {0X05F3, 0X05F4}, - {0X060C, 0X060C}, {0X061B, 0X061B}, {0X061F, 0X061F}, {0X066A, 0X066D}, - {0X06D4, 0X06D4}, {0x0964, 0x0965}, {0x0970, 0x0970}, {0X0E2F, 0X0E2F}, - {0X0E5A, 0X0E5B}, {0X0EAF, 0X0EAF}, {0X0F04, 0X0F12}, {0X0F3A, 0X0F3F}, - {0X0F85, 0X0F85}, {0X10FB, 0X10FB}, {0x2010, 0x2027}, {0x2030, 0x2043}, - {0x2045, 0x2046}, {0X207D, 0X207E}, {0X208D, 0X208E}, {0X2329, 0X232A}, - {0x3001, 0x3003}, {0x3006, 0x3006}, {0x3008, 0x3011}, {0X3014, 0X301F}, - {0x3030, 0x3030}, {0X30FB, 0X30FB}, {0XFD3E, 0XFD3F}, {0XFE30, 0XFE44}, - {0XFE49, 0XFE52}, {0XFE54, 0XFE61}, {0XFE63, 0XFE63}, {0XFE68, 0XFE68}, - {0XFE6A, 0XFE6B}, {0XFF01, 0XFF03}, {0XFF05, 0XFF0A}, {0XFF0C, 0XFF0F}, - {0XFF1A, 0XFF1B}, {0XFF1F, 0XFF20}, {0XFF3B, 0XFF3D}, {0XFF3F, 0XFF3F}, - {0XFF5B, 0XFF5B}, {0XFF5D, 0XFF5D}, {0XFF61, 0XFF65} -}; - -#define NUM_PUNCT (sizeof(punctTable)/sizeof(crange)) - -static crange spaceTable[] = { - {0x0000, 0x0000}, {0x0009, 0x000D}, {0x0020, 0x0020}, {0x00A0, 0x00A0}, - {0x2000, 0x200F}, {0x2028, 0x202E}, {0X206A, 0X206F}, {0x3000, 0x3000}, - {0xFEFF, 0xFEFF} -}; - -#define NUM_SPACE (sizeof(spaceTable)/sizeof(crange)) - -static crange upperRangeTable[] = { - {0x0041, 0x005a}, {0x00c0, 0x00d6}, {0x00d8, 0x00de}, {0x0189, 0x018b}, - {0x018e, 0x0191}, {0x0388, 0x038a}, {0x0391, 0x03a1}, {0x03a3, 0x03ab}, - {0x03d2, 0x03d4}, {0x0401, 0x040c}, {0x040e, 0x042f}, {0x0531, 0x0556}, - {0x10a0, 0x10c5}, {0x1f08, 0x1f0f}, {0x1f18, 0x1f1d}, {0x1f28, 0x1f2f}, - {0x1f38, 0x1f3f}, {0x1f48, 0x1f4d}, {0x1f68, 0x1f6f}, {0x1f88, 0x1f8f}, - {0x1f98, 0x1f9f}, {0x1fa8, 0x1faf}, {0x1fb8, 0x1fbc}, {0x1fc8, 0x1fcc}, - {0x1fd8, 0x1fdb}, {0x1fe8, 0x1fec}, {0x1ff8, 0x1ffc}, {0x210b, 0x210d}, - {0x2110, 0x2112}, {0x2118, 0x211d}, {0x212a, 0x212d}, {0x2130, 0x2131}, - {0xff21, 0xff3a} -}; - -#define NUM_UPPER_RANGE (sizeof(upperRangeTable)/sizeof(crange)) - -static chr upperCharTable[] = { - 0x0100, 0x0102, 0x0104, 0x0106, 0x0108, 0x010a, 0x010c, 0x010e, 0x0110, - 0x0112, 0x0114, 0x0116, 0x0118, 0x011a, 0x011c, 0x011e, 0x0120, 0x0122, - 0x0124, 0x0126, 0x0128, 0x012a, 0x012c, 0x012e, 0x0130, 0x0132, 0x0134, - 0x0136, 0x0139, 0x013b, 0x013d, 0x013f, 0x0141, 0x0143, 0x0145, 0x0147, - 0x014a, 0x014c, 0x014e, 0x0150, 0x0152, 0x0154, 0x0156, 0x0158, 0x015a, - 0x015c, 0x015e, 0x0160, 0x0162, 0x0164, 0x0166, 0x0168, 0x016a, 0x016c, - 0x016e, 0x0170, 0x0172, 0x0174, 0x0176, 0x0178, 0x0179, 0x017b, 0x017d, - 0x0181, 0x0182, 0x0184, 0x0186, 0x0187, 0x0193, 0x0194, 0x0196, 0x0197, - 0x0198, 0x019c, 0x019d, 0x019f, 0x01a0, 0x01a2, 0x01a4, 0x01a6, 0x01a7, - 0x01a9, 0x01ac, 0x01ae, 0x01af, 0x01b1, 0x01b2, 0x01b3, 0x01b5, 0x01b7, - 0x01b8, 0x01bc, 0x01c4, 0x01c7, 0x01ca, 0x01cd, 0x01cf, 0x01d1, 0x01d3, - 0x01d5, 0x01d7, 0x01d9, 0x01db, 0x01de, 0x01e0, 0x01e2, 0x01e4, 0x01e6, - 0x01e8, 0x01ea, 0x01ec, 0x01ee, 0x01f1, 0x01f4, 0x01fa, 0x01fc, 0x01fe, - 0x0200, 0x0202, 0x0204, 0x0206, 0x0208, 0x020a, 0x020c, 0x020e, 0x0210, - 0x0212, 0x0214, 0x0216, 0x0386, 0x038c, 0x038e, 0x038f, 0x03da, 0x03dc, - 0x03de, 0x03e0, 0x03e2, 0x03e4, 0x03e6, 0x03e8, 0x03ea, 0x03ec, 0x03ee, - 0x0460, 0x0462, 0x0464, 0x0466, 0x0468, 0x046a, 0x046c, 0x046e, 0x0470, - 0x0472, 0x0474, 0x0476, 0x0478, 0x047a, 0x047c, 0x047e, 0x0480, 0x0490, - 0x0492, 0x0494, 0x0496, 0x0498, 0x049a, 0x049c, 0x049e, 0x04a0, 0x04a2, - 0x04a4, 0x04a6, 0x04a8, 0x04aa, 0x04ac, 0x04ae, 0x04b0, 0x04b2, 0x04b4, - 0x04b6, 0x04b8, 0x04ba, 0x04bc, 0x04be, 0x04c1, 0x04c3, 0x04c7, 0x04cb, - 0x04d0, 0x04d2, 0x04d4, 0x04d6, 0x04d8, 0x04da, 0x04dc, 0x04de, 0x04e0, - 0x04e2, 0x04e4, 0x04e6, 0x04e8, 0x04ea, 0x04ee, 0x04f0, 0x04f2, 0x04f4, - 0x04f8, 0x1e00, 0x1e02, 0x1e04, 0x1e06, 0x1e08, 0x1e0a, 0x1e0c, 0x1e0e, - 0x1e10, 0x1e12, 0x1e14, 0x1e16, 0x1e18, 0x1e1a, 0x1e1c, 0x1e1e, 0x1e20, - 0x1e22, 0x1e24, 0x1e26, 0x1e28, 0x1e2a, 0x1e2c, 0x1e2e, 0x1e30, 0x1e32, - 0x1e34, 0x1e36, 0x1e38, 0x1e3a, 0x1e3c, 0x1e3e, 0x1e40, 0x1e42, 0x1e44, - 0x1e46, 0x1e48, 0x1e4a, 0x1e4c, 0x1e4e, 0x1e50, 0x1e52, 0x1e54, 0x1e56, - 0x1e58, 0x1e5a, 0x1e5c, 0x1e5e, 0x1e60, 0x1e62, 0x1e64, 0x1e66, 0x1e68, - 0x1e6a, 0x1e6c, 0x1e6e, 0x1e70, 0x1e72, 0x1e74, 0x1e76, 0x1e78, 0x1e7a, - 0x1e7c, 0x1e7e, 0x1e80, 0x1e82, 0x1e84, 0x1e86, 0x1e88, 0x1e8a, 0x1e8c, - 0x1e8e, 0x1e90, 0x1e92, 0x1e94, 0x1ea0, 0x1ea2, 0x1ea4, 0x1ea6, 0x1ea8, - 0x1eaa, 0x1eac, 0x1eae, 0x1eb0, 0x1eb2, 0x1eb4, 0x1eb6, 0x1eb8, 0x1eba, - 0x1ebc, 0x1ebe, 0x1ec0, 0x1ec2, 0x1ec4, 0x1ec6, 0x1ec8, 0x1eca, 0x1ecc, - 0x1ece, 0x1ed0, 0x1ed2, 0x1ed4, 0x1ed6, 0x1ed8, 0x1eda, 0x1edc, 0x1ede, - 0x1ee0, 0x1ee2, 0x1ee4, 0x1ee6, 0x1ee8, 0x1eea, 0x1eec, 0x1eee, 0x1ef0, - 0x1ef2, 0x1ef4, 0x1ef6, 0x1ef8, 0x1f59, 0x1f5b, 0x1f5d, 0x1f5f, 0x1fbe, - 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x2133 -}; - -#define NUM_UPPER_CHAR (sizeof(upperCharTable)/sizeof(chr)) - -static crange lowerRangeTable[] = { - {0x0061, 0x007a}, {0x00df, 0x00f6}, {0x00f8, 0x00ff}, {0x0199, 0x019b}, - {0x0250, 0x02a8}, {0x03ac, 0x03ce}, {0x03ef, 0x03f2}, {0x0430, 0x044f}, - {0x0451, 0x045c}, {0x0561, 0x0587}, {0x10d0, 0x10f6}, {0x1e95, 0x1e9b}, - {0x1f00, 0x1f07}, {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, {0x1f30, 0x1f37}, - {0x1f40, 0x1f45}, {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, {0x1f70, 0x1f7d}, - {0x1f80, 0x1f87}, {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4}, - {0x1fd0, 0x1fd3}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4}, {0xfb00, 0xfb06}, - {0xfb13, 0xfb17}, {0xff41, 0xff5a} -}; - -#define NUM_LOWER_RANGE (sizeof(lowerRangeTable)/sizeof(crange)) - -static chr lowerCharTable[] = { - 0x00aa, 0x00b5, 0x00ba, 0x0101, 0x0103, 0x0105, 0x0107, 0x0109, 0x010b, - 0x010d, 0x010f, 0x0111, 0x0113, 0x0115, 0x0117, 0x0119, 0x011b, 0x011d, - 0x011f, 0x0121, 0x0123, 0x0125, 0x0127, 0x0129, 0x012b, 0x012d, 0x012f, - 0x0131, 0x0133, 0x0135, 0x0138, 0x013a, 0x013c, 0x013e, 0x0140, 0x0142, - 0x0144, 0x0146, 0x0149, 0x014b, 0x014d, 0x014f, 0x0151, 0x0153, 0x0155, - 0x0157, 0x0159, 0x015b, 0x015d, 0x015f, 0x0161, 0x0163, 0x0165, 0x0167, - 0x0169, 0x016b, 0x016d, 0x016f, 0x0171, 0x0173, 0x0175, 0x0177, 0x017a, - 0x017c, 0x017e, 0x017f, 0x0180, 0x0183, 0x0185, 0x0188, 0x018c, 0x018d, - 0x0192, 0x0195, 0x019e, 0x01a1, 0x01a3, 0x01a5, 0x01a8, 0x01ab, 0x01ad, - 0x01b0, 0x01b4, 0x01b6, 0x01b9, 0x01ba, 0x01bd, 0x01c6, 0x01c9, 0x01cc, - 0x01ce, 0x01d0, 0x01d2, 0x01d4, 0x01d6, 0x01d8, 0x01da, 0x01dd, 0x01df, - 0x01e1, 0x01e3, 0x01e5, 0x01e7, 0x01e9, 0x01eb, 0x01ed, 0x01f0, 0x01f3, - 0x01f5, 0x01fb, 0x01fd, 0x01ff, 0x0201, 0x0203, 0x0205, 0x0207, 0x0209, - 0x020b, 0x020d, 0x020f, 0x0211, 0x0213, 0x0215, 0x0217, 0x0390, 0x03d0, - 0x03d1, 0x03d5, 0x03d6, 0x03e3, 0x03e5, 0x03e7, 0x03e9, 0x03eb, 0x03ed, - 0x045e, 0x045f, 0x0461, 0x0463, 0x0465, 0x0467, 0x0469, 0x046b, 0x046d, - 0x046f, 0x0471, 0x0473, 0x0475, 0x0477, 0x0479, 0x047b, 0x047d, 0x047f, - 0x0481, 0x0491, 0x0493, 0x0495, 0x0497, 0x0499, 0x049b, 0x049d, 0x049f, - 0x04a1, 0x04a3, 0x04a5, 0x04a7, 0x04a9, 0x04ab, 0x04ad, 0x04af, 0x04b1, - 0x04b3, 0x04b5, 0x04b7, 0x04b9, 0x04bb, 0x04bd, 0x04bf, 0x04c2, 0x04c4, - 0x04c8, 0x04cc, 0x04d1, 0x04d3, 0x04d5, 0x04d7, 0x04d9, 0x04db, 0x04dd, - 0x04df, 0x04e1, 0x04e3, 0x04e5, 0x04e7, 0x04e9, 0x04eb, 0x04ef, 0x04f1, - 0x04f3, 0x04f5, 0x04f9, 0x1e01, 0x1e03, 0x1e05, 0x1e07, 0x1e09, 0x1e0b, - 0x1e0d, 0x1e0f, 0x1e11, 0x1e13, 0x1e15, 0x1e17, 0x1e19, 0x1e1b, 0x1e1d, - 0x1e1f, 0x1e21, 0x1e23, 0x1e25, 0x1e27, 0x1e29, 0x1e2b, 0x1e2d, 0x1e2f, - 0x1e31, 0x1e33, 0x1e35, 0x1e37, 0x1e39, 0x1e3b, 0x1e3d, 0x1e3f, 0x1e41, - 0x1e43, 0x1e45, 0x1e47, 0x1e49, 0x1e4b, 0x1e4d, 0x1e4f, 0x1e51, 0x1e53, - 0x1e55, 0x1e57, 0x1e59, 0x1e5b, 0x1e5d, 0x1e5f, 0x1e61, 0x1e63, 0x1e65, - 0x1e67, 0x1e69, 0x1e6b, 0x1e6d, 0x1e6f, 0x1e71, 0x1e73, 0x1e75, 0x1e77, - 0x1e79, 0x1e7b, 0x1e7d, 0x1e7f, 0x1e81, 0x1e83, 0x1e85, 0x1e87, 0x1e89, - 0x1e8b, 0x1e8d, 0x1e8f, 0x1e91, 0x1e93, 0x1ea1, 0x1ea3, 0x1ea5, 0x1ea7, - 0x1ea9, 0x1eab, 0x1ead, 0x1eaf, 0x1eb1, 0x1eb3, 0x1eb5, 0x1eb7, 0x1eb9, - 0x1ebb, 0x1ebd, 0x1ebf, 0x1ec1, 0x1ec3, 0x1ec5, 0x1ec7, 0x1ec9, 0x1ecb, - 0x1ecd, 0x1ecf, 0x1ed1, 0x1ed3, 0x1ed5, 0x1ed7, 0x1ed9, 0x1edb, 0x1edd, - 0x1edf, 0x1ee1, 0x1ee3, 0x1ee5, 0x1ee7, 0x1ee9, 0x1eeb, 0x1eed, 0x1eef, - 0x1ef1, 0x1ef3, 0x1ef5, 0x1ef7, 0x1ef9, 0x1fb6, 0x1fb7, 0x1fc2, 0x1fc3, - 0x1fc4, 0x1fc6, 0x1fc7, 0x1fd6, 0x1fd7, 0x1ff6, 0x1ff7, 0x207f, 0x210a, - 0x210e, 0x210f, 0x2113, 0x212e, 0x212f, 0x2134 -}; - -#define NUM_LOWER_CHAR (sizeof(lowerCharTable)/sizeof(chr)) - -/* - * The graph table includes the set of characters that are neither ISO control - * characters nor in the space table. - */ - -static crange graphTable[] = { - {0x0021, 0x007e}, {0x00a1, 0x1fff}, {0x2010, 0x2027}, {0x202f, 0x2069}, - {0x2070, 0x2fff}, {0x3001, 0xfefe}, {0xff00, 0xffff} -}; - -#define NUM_GRAPH (sizeof(graphTable)/sizeof(crange)) -#define CH NOCELT - -/* - - nmcces - how many distinct MCCEs are there? - ^ static int nmcces(struct vars *); - */ -static int -nmcces(v) -struct vars *v; -{ - return 0; -} - -/* - - nleaders - how many chrs can be first chrs of MCCEs? - ^ static int nleaders(struct vars *); - */ -static int -nleaders(v) -struct vars *v; -{ - return 0; -} - -/* - - allmcces - return a cvec with all the MCCEs of the locale - ^ static struct cvec *allmcces(struct vars *, struct cvec *); - */ -static struct cvec * -allmcces(v, cv) -struct vars *v; -struct cvec *cv; /* this is supposed to have enough room */ -{ - return clearcvec(cv); -} - -/* - - element - map collating-element name to celt - ^ static celt element(struct vars *, chr *, chr *); - */ -static celt -element(v, startp, endp) -struct vars *v; -chr *startp; /* points to start of name */ -chr *endp; /* points just past end of name */ -{ - struct cname *cn; - size_t len; - Tcl_DString ds; - char *np; - - /* generic: one-chr names stand for themselves */ - assert(startp < endp); - len = endp - startp; - if (len == 1) - return *startp; - - NOTE(REG_ULOCALE); - - /* search table */ - Tcl_DStringInit(&ds); - np = Tcl_UniCharToUtfDString(startp, (int)len, &ds); - for (cn = cnames; cn->name != NULL; cn++) - if (strlen(cn->name) == len && strncmp(cn->name, np, len) == 0) - break; /* NOTE BREAK OUT */ - Tcl_DStringFree(&ds); - if (cn->name != NULL) - return CHR(cn->code); - - /* couldn't find it */ - ERR(REG_ECOLLATE); - return 0; -} - -/* - - range - supply cvec for a range, including legality check - ^ static struct cvec *range(struct vars *, celt, celt, int); - */ -static struct cvec * -range(v, a, b, cases) -struct vars *v; -celt a; -celt b; /* might equal a */ -int cases; /* case-independent? */ -{ - int nchrs; - struct cvec *cv; - celt c, lc, uc, tc; - - if (a != b && !before(a, b)) { - ERR(REG_ERANGE); - return NULL; - } - - if (!cases) { /* easy version */ - cv = getcvec(v, 0, 1, 0); - NOERRN(); - addrange(cv, a, b); - return cv; - } - - /* - * When case-independent, it's hard to decide when cvec ranges are - * usable, so for now at least, we won't try. We allocate enough - * space for two case variants plus a little extra for the two - * title case variants. - */ - - nchrs = (b - a + 1)*2 + 4; - - cv = getcvec(v, nchrs, 0, 0); - NOERRN(); - - for (c = a; c <= b; c++) { - addchr(cv, c); - lc = Tcl_UniCharToLower((chr)c); - uc = Tcl_UniCharToUpper((chr)c); - tc = Tcl_UniCharToTitle((chr)c); - if (c != lc) { - addchr(cv, lc); - } - if (c != uc) { - addchr(cv, uc); - } - if (c != tc && tc != uc) { - addchr(cv, tc); - } - } - - return cv; -} - -/* - - before - is celt x before celt y, for purposes of range legality? - ^ static int before(celt, celt); - */ -static int /* predicate */ -before(x, y) -celt x; -celt y; -{ - /* trivial because no MCCEs */ - if (x < y) - return 1; - return 0; -} - -/* - - eclass - supply cvec for an equivalence class - * Must include case counterparts on request. - ^ static struct cvec *eclass(struct vars *, celt, int); - */ -static struct cvec * -eclass(v, c, cases) -struct vars *v; -celt c; -int cases; /* all cases? */ -{ - struct cvec *cv; - - /* crude fake equivalence class for testing */ - if ((v->cflags®_FAKEEC) && c == 'x') { - cv = getcvec(v, 4, 0, 0); - addchr(cv, (chr)'x'); - addchr(cv, (chr)'y'); - if (cases) { - addchr(cv, (chr)'X'); - addchr(cv, (chr)'Y'); - } - return cv; - } - - /* otherwise, none */ - if (cases) - return allcases(v, c); - cv = getcvec(v, 1, 0, 0); - assert(cv != NULL); - addchr(cv, (chr)c); - return cv; -} - -/* - - cclass - supply cvec for a character class - * Must include case counterparts on request. - ^ static struct cvec *cclass(struct vars *, chr *, chr *, int); - */ -static struct cvec * -cclass(v, startp, endp, cases) -struct vars *v; -chr *startp; /* where the name starts */ -chr *endp; /* just past the end of the name */ -int cases; /* case-independent? */ -{ - size_t len; - struct cvec *cv = NULL; - Tcl_DString ds; - char *np, **namePtr; - int i, index; - - /* - * The following arrays define the valid character class names. - */ - - static char *classNames[] = { - "alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower", - "print", "punct", "space", "upper", "xdigit", NULL - }; - - enum classes { - CC_ALNUM, CC_ALPHA, CC_BLANK, CC_CNTRL, CC_DIGIT, CC_GRAPH, CC_LOWER, - CC_PRINT, CC_PUNCT, CC_SPACE, CC_UPPER, CC_XDIGIT - }; - - - /* - * Extract the class name - */ - - len = endp - startp; - Tcl_DStringInit(&ds); - np = Tcl_UniCharToUtfDString(startp, (int)len, &ds); - - /* - * Remap lower and upper to alpha if the match is case insensitive. - */ - - if (cases && len == 5 && (strncmp("lower", np, 5) == 0 - || strncmp("upper", np, 5) == 0)) { - np = "alpha"; - } - - /* - * Map the name to the corresponding enumerated value. - */ - - index = -1; - for (namePtr = classNames, i = 0; *namePtr != NULL; namePtr++, i++) { - if ((strlen(*namePtr) == len) && (strncmp(*namePtr, np, len) == 0)) { - index = i; - break; - } - } - Tcl_DStringInit(&ds); - if (index == -1) { - ERR(REG_ECTYPE); - return NULL; - } - - /* - * Now compute the character class contents. - */ - - switch((enum classes) index) { - case CC_PRINT: - case CC_ALNUM: - cv = getcvec(v, 0, NUM_DIGIT + NUM_ALPHA, 0); - if (cv) { - for (i = 0; i < NUM_ALPHA; i++) { - addrange(cv, alphaTable[i].start, alphaTable[i].end); - } - for (i = 0; i < NUM_DIGIT; i++) { - addrange(cv, digitTable[i].start, digitTable[i].end); - } - } - break; - case CC_ALPHA: - cv = getcvec(v, 0, NUM_ALPHA, 0); - if (cv) { - for (i = 0; i < NUM_ALPHA; i++) { - addrange(cv, alphaTable[i].start, alphaTable[i].end); - } - } - break; - case CC_BLANK: - cv = getcvec(v, 2, 0, 0); - addchr(cv, '\t'); - addchr(cv, ' '); - break; - case CC_CNTRL: - cv = getcvec(v, 0, 2, 0); - addrange(cv, 0x0, 0x1f); - addrange(cv, 0x7f, 0x9f); - break; - case CC_DIGIT: - cv = getcvec(v, 0, NUM_DIGIT, 0); - if (cv) { - for (i = 0; i < NUM_DIGIT; i++) { - addrange(cv, digitTable[i].start, digitTable[i].end); - } - } - break; - case CC_PUNCT: - cv = getcvec(v, 0, NUM_PUNCT, 0); - if (cv) { - for (i = 0; i < NUM_PUNCT; i++) { - addrange(cv, punctTable[i].start, punctTable[i].end); - } - } - break; - case CC_XDIGIT: - cv = getcvec(v, 0, NUM_DIGIT+2, 0); - if (cv) { - for (i = 0; i < NUM_DIGIT; i++) { - addrange(cv, digitTable[i].start, digitTable[i].end); - } - addrange(cv, 'a', 'f'); - addrange(cv, 'A', 'F'); - } - break; - case CC_SPACE: - cv = getcvec(v, 0, NUM_SPACE, 0); - if (cv) { - for (i = 0; i < NUM_SPACE; i++) { - addrange(cv, spaceTable[i].start, spaceTable[i].end); - } - } - break; - case CC_LOWER: - cv = getcvec(v, NUM_LOWER_CHAR, NUM_LOWER_RANGE, 0); - if (cv) { - for (i = 0; i < NUM_LOWER_RANGE; i++) { - addrange(cv, lowerRangeTable[i].start, - lowerRangeTable[i].end); - } - for (i = 0; i < NUM_LOWER_CHAR; i++) { - addchr(cv, lowerCharTable[i]); - } - } - break; - case CC_UPPER: - cv = getcvec(v, NUM_UPPER_CHAR, NUM_UPPER_RANGE, 0); - if (cv) { - for (i = 0; i < NUM_UPPER_RANGE; i++) { - addrange(cv, upperRangeTable[i].start, - upperRangeTable[i].end); - } - for (i = 0; i < NUM_UPPER_CHAR; i++) { - addchr(cv, upperCharTable[i]); - } - } - break; - case CC_GRAPH: - cv = getcvec(v, 0, NUM_GRAPH, 0); - if (cv) { - for (i = 0; i < NUM_GRAPH; i++) { - addrange(cv, graphTable[i].start, graphTable[i].end); - } - } - break; - } - if (cv == NULL) { - ERR(REG_ESPACE); - } - return cv; -} - -/* - - allcases - supply cvec for all case counterparts of a chr (including itself) - * This is a shortcut, preferably an efficient one, for simple characters; - * messy cases are done via range(). - ^ static struct cvec *allcases(struct vars *, pchr); - */ -static struct cvec * -allcases(v, pc) -struct vars *v; -pchr pc; -{ - struct cvec *cv; - chr c = (chr)pc; - chr lc, uc, tc; - - lc = Tcl_UniCharToLower((chr)c); - uc = Tcl_UniCharToUpper((chr)c); - tc = Tcl_UniCharToTitle((chr)c); - - if (tc != uc) { - cv = getcvec(v, 3, 0, 0); - addchr(cv, tc); - } else { - cv = getcvec(v, 2, 0, 0); - } - addchr(cv, lc); - if (lc != uc) { - addchr(cv, uc); - } - return cv; -} - -/* - - cmp - chr-substring compare - * Backrefs need this. It should preferably be efficient. - * Note that it does not need to report anything except equal/unequal. - * Note also that the length is exact, and the comparison should not - * stop at embedded NULs! - ^ static int cmp(CONST chr *, CONST chr *, size_t); - */ -static int /* 0 for equal, nonzero for unequal */ -cmp(x, y, len) -CONST chr *x; -CONST chr *y; -size_t len; /* exact length of comparison */ -{ - return memcmp(VS(x), VS(y), len*sizeof(chr)); -} - -/* - - casecmp - case-independent chr-substring compare - * REG_ICASE backrefs need this. It should preferably be efficient. - * Note that it does not need to report anything except equal/unequal. - * Note also that the length is exact, and the comparison should not - * stop at embedded NULs! - ^ static int casecmp(CONST chr *, CONST chr *, size_t); - */ -static int /* 0 for equal, nonzero for unequal */ -casecmp(x, y, len) -CONST chr *x; -CONST chr *y; -size_t len; /* exact length of comparison */ -{ - size_t i; - CONST chr *xp; - CONST chr *yp; - - for (xp = x, yp = y, i = len; i > 0; i--) - if (Tcl_UniCharToLower(*xp++) != Tcl_UniCharToLower(*yp++)) - return 1; - return 0; -} diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c deleted file mode 100644 index 80e9ac7..0000000 --- a/generic/regc_nfa.c +++ /dev/null @@ -1,1528 +0,0 @@ -/* - * NFA utilities. - * This file is #included by regcomp.c. - * - * One or two things that technically ought to be in here - * are actually in color.c, thanks to some incestuous relationships in - * the color chains. - */ - -#define NISERR() VISERR(nfa->v) -#define NERR(e) VERR(nfa->v, (e)) - - -/* - - newnfa - set up an NFA - ^ static struct nfa *newnfa(struct vars *, struct colormap *, struct nfa *); - */ -static struct nfa * /* the NFA, or NULL */ -newnfa(v, cm, parent) -struct vars *v; -struct colormap *cm; -struct nfa *parent; /* NULL if primary NFA */ -{ - struct nfa *nfa; - - nfa = (struct nfa *)MALLOC(sizeof(struct nfa)); - if (nfa == NULL) - return NULL; - - nfa->states = NULL; - nfa->slast = NULL; - nfa->free = NULL; - nfa->nstates = 0; - nfa->cm = cm; - nfa->v = v; - nfa->bos[0] = nfa->bos[1] = COLORLESS; - nfa->eos[0] = nfa->eos[1] = COLORLESS; - nfa->post = newfstate(nfa, '@'); /* number 0 */ - nfa->pre = newfstate(nfa, '>'); /* number 1 */ - nfa->parent = parent; - - nfa->init = newstate(nfa); /* may become invalid later */ - nfa->final = newstate(nfa); - if (ISERR()) { - freenfa(nfa); - return NULL; - } - rainbow(nfa, nfa->cm, PLAIN, COLORLESS, nfa->pre, nfa->init); - newarc(nfa, '^', 1, nfa->pre, nfa->init); - newarc(nfa, '^', 0, nfa->pre, nfa->init); - rainbow(nfa, nfa->cm, PLAIN, COLORLESS, nfa->final, nfa->post); - newarc(nfa, '$', 1, nfa->final, nfa->post); - newarc(nfa, '$', 0, nfa->final, nfa->post); - - if (ISERR()) { - freenfa(nfa); - return NULL; - } - return nfa; -} - -/* - - freenfa - free an entire NFA - ^ static VOID freenfa(struct nfa *); - */ -static VOID -freenfa(nfa) -struct nfa *nfa; -{ - struct state *s; - - while ((s = nfa->states) != NULL) { - s->nins = s->nouts = 0; /* don't worry about arcs */ - freestate(nfa, s); - } - while ((s = nfa->free) != NULL) { - nfa->free = s->next; - destroystate(nfa, s); - } - - nfa->slast = NULL; - nfa->nstates = -1; - nfa->pre = NULL; - nfa->post = NULL; - FREE(nfa); -} - -/* - - newfstate - allocate an NFA state, with specified flag value - ^ static struct state *newfstate(struct nfa *, int flag); - */ -static struct state * /* NULL on error */ -newfstate(nfa, flag) -struct nfa *nfa; -int flag; -{ - struct state *s; - int i; - - if (nfa->free != NULL) { - s = nfa->free; - nfa->free = s->next; - } else { - s = (struct state *)MALLOC(sizeof(struct state)); - if (s == NULL) { - NERR(REG_ESPACE); - return NULL; - } - s->oas.next = NULL; - s->free = &s->oas.a[0]; - for (i = 0; i < ABSIZE; i++) { - s->oas.a[i].type = 0; - s->oas.a[i].freechain = &s->oas.a[i+1]; - } - s->oas.a[ABSIZE-1].freechain = NULL; - } - - assert(nfa->nstates >= 0); - s->no = nfa->nstates++; - s->flag = (char)flag; - if (nfa->states == NULL) - nfa->states = s; - s->nins = 0; - s->ins = NULL; - s->nouts = 0; - s->outs = NULL; - s->tmp = NULL; - s->next = NULL; - if (nfa->slast != NULL) { - assert(nfa->slast->next == NULL); - nfa->slast->next = s; - } - s->prev = nfa->slast; - nfa->slast = s; - return s; -} - -/* - - newstate - allocate an ordinary NFA state - ^ static struct state *newstate(struct nfa *); - */ -static struct state * /* NULL on error */ -newstate(nfa) -struct nfa *nfa; -{ - return newfstate(nfa, 0); -} - -/* - - dropstate - delete a state's inarcs and outarcs and free it - ^ static VOID dropstate(struct nfa *, struct state *); - */ -static VOID -dropstate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - - while ((a = s->ins) != NULL) - freearc(nfa, a); - while ((a = s->outs) != NULL) - freearc(nfa, a); - freestate(nfa, s); -} - -/* - - freestate - free a state, which has no in-arcs or out-arcs - ^ static VOID freestate(struct nfa *, struct state *); - */ -static VOID -freestate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - assert(s != NULL); - assert(s->nins == 0 && s->nouts == 0); - - s->no = FREESTATE; - s->flag = 0; - if (s->next != NULL) - s->next->prev = s->prev; - else { - assert(s == nfa->slast); - nfa->slast = s->prev; - } - if (s->prev != NULL) - s->prev->next = s->next; - else { - assert(s == nfa->states); - nfa->states = s->next; - } - s->prev = NULL; - s->next = nfa->free; /* don't delete it, put it on the free list */ - nfa->free = s; -} - -/* - - destroystate - really get rid of an already-freed state - ^ static VOID destroystate(struct nfa *, struct state *); - */ -static VOID -destroystate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arcbatch *ab; - struct arcbatch *abnext; - - assert(s->no == FREESTATE); - for (ab = s->oas.next; ab != NULL; ab = abnext) { - abnext = ab->next; - FREE(ab); - } - s->ins = NULL; - s->outs = NULL; - s->next = NULL; - FREE(s); -} - -/* - - newarc - set up a new arc within an NFA - ^ static VOID newarc(struct nfa *, int, pcolor, struct state *, - ^ struct state *); - */ -static VOID -newarc(nfa, t, co, from, to) -struct nfa *nfa; -int t; -pcolor co; -struct state *from; -struct state *to; -{ - struct arc *a; - - assert(from != NULL && to != NULL); - - /* check for duplicates */ - for (a = from->outs; a != NULL; a = a->outchain) - if (a->type == t && a->co == co && a->to == to) - return; - - a = allocarc(nfa, from); - if (NISERR()) - return; - assert(a != NULL); - - a->type = t; - a->co = (color)co; - a->to = to; - a->from = from; - - /* - * Put the new arc on the beginning, not the end, of the chains. - * Not only is this easier, it has the very useful side effect that - * deleting the most-recently-added arc is the cheapest case rather - * than the most expensive one. - */ - a->inchain = to->ins; - to->ins = a; - a->outchain = from->outs; - from->outs = a; - - from->nouts++; - to->nins++; - - if (COLORED(a) && nfa->parent == NULL) - colorchain(nfa->cm, a); - - return; -} - -/* - - allocarc - allocate a new out-arc within a state - ^ static struct arc *allocarc(struct nfa *, struct state *); - */ -static struct arc * /* NULL for failure */ -allocarc(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - struct arcbatch *new; - int i; - - /* if none at hand, get more */ - if (s->free == NULL) { - new = (struct arcbatch *)MALLOC(sizeof(struct arcbatch)); - if (new == NULL) { - NERR(REG_ESPACE); - return NULL; - } - new->next = s->oas.next; - s->oas.next = new; - - for (i = 0; i < ABSIZE; i++) { - new->a[i].type = 0; - new->a[i].freechain = &new->a[i+1]; - } - new->a[ABSIZE-1].freechain = NULL; - s->free = &new->a[0]; - } - assert(s->free != NULL); - - a = s->free; - s->free = a->freechain; - return a; -} - -/* - - freearc - free an arc - ^ static VOID freearc(struct nfa *, struct arc *); - */ -static VOID -freearc(nfa, victim) -struct nfa *nfa; -struct arc *victim; -{ - struct state *from = victim->from; - struct state *to = victim->to; - struct arc *a; - - assert(victim->type != 0); - - /* take it off color chain if necessary */ - if (COLORED(victim) && nfa->parent == NULL) - uncolorchain(nfa->cm, victim); - - /* take it off source's out-chain */ - assert(from != NULL); - assert(from->outs != NULL); - a = from->outs; - if (a == victim) /* simple case: first in chain */ - from->outs = victim->outchain; - else { - for (; a != NULL && a->outchain != victim; a = a->outchain) - continue; - assert(a != NULL); - a->outchain = victim->outchain; - } - from->nouts--; - - /* take it off target's in-chain */ - assert(to != NULL); - assert(to->ins != NULL); - a = to->ins; - if (a == victim) /* simple case: first in chain */ - to->ins = victim->inchain; - else { - for (; a != NULL && a->inchain != victim; a = a->inchain) - continue; - assert(a != NULL); - a->inchain = victim->inchain; - } - to->nins--; - - /* clean up and place on free list */ - victim->type = 0; - victim->from = NULL; /* precautions... */ - victim->to = NULL; - victim->inchain = NULL; - victim->outchain = NULL; - victim->freechain = from->free; - from->free = victim; -} - -/* - - findarc - find arc, if any, from given source with given type and color - * If there is more than one such arc, the result is random. - ^ static struct arc *findarc(struct state *, int, pcolor); - */ -static struct arc * -findarc(s, type, co) -struct state *s; -int type; -pcolor co; -{ - struct arc *a; - - for (a = s->outs; a != NULL; a = a->outchain) - if (a->type == type && a->co == co) - return a; - return NULL; -} - -/* - - cparc - allocate a new arc within an NFA, copying details from old one - ^ static VOID cparc(struct nfa *, struct arc *, struct state *, - ^ struct state *); - */ -static VOID -cparc(nfa, oa, from, to) -struct nfa *nfa; -struct arc *oa; -struct state *from; -struct state *to; -{ - newarc(nfa, oa->type, oa->co, from, to); -} - -/* - - moveins - move all in arcs of a state to another state - * You might think this could be done better by just updating the - * existing arcs, and you would be right if it weren't for the desire - * for duplicate suppression, which makes it easier to just make new - * ones to exploit the suppression built into newarc. - ^ static VOID moveins(struct nfa *, struct state *, struct state *); - */ -static VOID -moveins(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - while ((a = old->ins) != NULL) { - cparc(nfa, a, a->from, new); - freearc(nfa, a); - } - assert(old->nins == 0); - assert(old->ins == NULL); -} - -/* - - copyins - copy all in arcs of a state to another state - ^ static VOID copyins(struct nfa *, struct state *, struct state *); - */ -static VOID -copyins(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - for (a = old->ins; a != NULL; a = a->inchain) - cparc(nfa, a, a->from, new); -} - -/* - - moveouts - move all out arcs of a state to another state - ^ static VOID moveouts(struct nfa *, struct state *, struct state *); - */ -static VOID -moveouts(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - while ((a = old->outs) != NULL) { - cparc(nfa, a, new, a->to); - freearc(nfa, a); - } -} - -/* - - copyouts - copy all out arcs of a state to another state - ^ static VOID copyouts(struct nfa *, struct state *, struct state *); - */ -static VOID -copyouts(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - for (a = old->outs; a != NULL; a = a->outchain) - cparc(nfa, a, new, a->to); -} - -/* - - cloneouts - copy out arcs of a state to another state pair, modifying type - ^ static VOID cloneouts(struct nfa *, struct state *, struct state *, - ^ struct state *, int); - */ -static VOID -cloneouts(nfa, old, from, to, type) -struct nfa *nfa; -struct state *old; -struct state *from; -struct state *to; -int type; -{ - struct arc *a; - - assert(old != from); - - for (a = old->outs; a != NULL; a = a->outchain) - newarc(nfa, type, a->co, from, to); -} - -/* - - delsub - delete a sub-NFA, updating subre pointers if necessary - * This uses a recursive traversal of the sub-NFA, marking already-seen - * states using their tmp pointer. - ^ static VOID delsub(struct nfa *, struct state *, struct state *); - */ -static VOID -delsub(nfa, lp, rp) -struct nfa *nfa; -struct state *lp; /* the sub-NFA goes from here... */ -struct state *rp; /* ...to here, *not* inclusive */ -{ - assert(lp != rp); - - rp->tmp = rp; /* mark end */ - - deltraverse(nfa, lp, lp); - assert(lp->nouts == 0 && rp->nins == 0); /* did the job */ - assert(lp->no != FREESTATE && rp->no != FREESTATE); /* no more */ - - rp->tmp = NULL; /* unmark end */ - lp->tmp = NULL; /* and begin, marked by deltraverse */ -} - -/* - - deltraverse - the recursive heart of delsub - * This routine's basic job is to destroy all out-arcs of the state. - ^ static VOID deltraverse(struct nfa *, struct state *, struct state *); - */ -static VOID -deltraverse(nfa, leftend, s) -struct nfa *nfa; -struct state *leftend; -struct state *s; -{ - struct arc *a; - struct state *to; - - if (s->nouts == 0) - return; /* nothing to do */ - if (s->tmp != NULL) - return; /* already in progress */ - - s->tmp = s; /* mark as in progress */ - - while ((a = s->outs) != NULL) { - to = a->to; - deltraverse(nfa, leftend, to); - assert(to->nouts == 0 || to->tmp != NULL); - freearc(nfa, a); - if (to->nins == 0 && to->tmp == NULL) { - assert(to->nouts == 0); - freestate(nfa, to); - } - } - - assert(s->no != FREESTATE); /* we're still here */ - assert(s == leftend || s->nins != 0); /* and still reachable */ - assert(s->nouts == 0); /* but have no outarcs */ - - s->tmp = NULL; /* we're done here */ -} - -/* - - dupnfa - duplicate sub-NFA - * Another recursive traversal, this time using tmp to point to duplicates - * as well as mark already-seen states. (You knew there was a reason why - * it's a state pointer, didn't you? :-)) - ^ static VOID dupnfa(struct nfa *, struct state *, struct state *, - ^ struct state *, struct state *); - */ -static VOID -dupnfa(nfa, start, stop, from, to) -struct nfa *nfa; -struct state *start; /* duplicate of subNFA starting here */ -struct state *stop; /* and stopping here */ -struct state *from; /* stringing duplicate from here */ -struct state *to; /* to here */ -{ - if (start == stop) { - newarc(nfa, EMPTY, 0, from, to); - return; - } - - stop->tmp = to; - duptraverse(nfa, start, from); - /* done, except for clearing out the tmp pointers */ - - stop->tmp = NULL; - cleartraverse(nfa, start); -} - -/* - - duptraverse - recursive heart of dupnfa - ^ static VOID duptraverse(struct nfa *, struct state *, struct state *); - */ -static VOID -duptraverse(nfa, s, stmp) -struct nfa *nfa; -struct state *s; -struct state *stmp; /* s's duplicate, or NULL */ -{ - struct arc *a; - - if (s->tmp != NULL) - return; /* already done */ - - s->tmp = (stmp == NULL) ? newstate(nfa) : stmp; - if (s->tmp == NULL) { - assert(NISERR()); - return; - } - - for (a = s->outs; a != NULL && !NISERR(); a = a->outchain) { - duptraverse(nfa, a->to, (struct state *)NULL); - assert(a->to->tmp != NULL); - cparc(nfa, a, s->tmp, a->to->tmp); - } -} - -/* - - cleartraverse - recursive cleanup for algorithms that leave tmp ptrs set - ^ static VOID cleartraverse(struct nfa *, struct state *); - */ -static VOID -cleartraverse(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - - if (s->tmp == NULL) - return; - s->tmp = NULL; - - for (a = s->outs; a != NULL; a = a->outchain) - cleartraverse(nfa, a->to); -} - -/* - - specialcolors - fill in special colors for an NFA - ^ static VOID specialcolors(struct nfa *); - */ -static VOID -specialcolors(nfa) -struct nfa *nfa; -{ - /* false colors for BOS, BOL, EOS, EOL */ - if (nfa->parent == NULL) { - nfa->bos[0] = pseudocolor(nfa->cm); - nfa->bos[1] = pseudocolor(nfa->cm); - nfa->eos[0] = pseudocolor(nfa->cm); - nfa->eos[1] = pseudocolor(nfa->cm); - } else { - assert(nfa->parent->bos[0] != COLORLESS); - nfa->bos[0] = nfa->parent->bos[0]; - assert(nfa->parent->bos[1] != COLORLESS); - nfa->bos[1] = nfa->parent->bos[1]; - assert(nfa->parent->eos[0] != COLORLESS); - nfa->eos[0] = nfa->parent->eos[0]; - assert(nfa->parent->eos[1] != COLORLESS); - nfa->eos[1] = nfa->parent->eos[1]; - } -} - -/* - - optimize - optimize an NFA - ^ static int optimize(struct nfa *, FILE *); - */ -static int /* re_info bits */ -optimize(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - int verbose = (f != NULL) ? 1 : 0; - - if (verbose) - fprintf(f, "\ninitial cleanup:\n"); - cleanup(nfa); /* may simplify situation */ - if (verbose) - dumpnfa(nfa, f); - if (verbose) - fprintf(f, "\nempties:\n"); - fixempties(nfa, f); /* get rid of EMPTY arcs */ - if (verbose) - fprintf(f, "\nconstraints:\n"); - pullback(nfa, f); /* pull back constraints backward */ - pushfwd(nfa, f); /* push fwd constraints forward */ - if (verbose) - fprintf(f, "\nfinal cleanup:\n"); - cleanup(nfa); /* final tidying */ - return analyze(nfa); /* and analysis */ -} - -/* - - pullback - pull back constraints backward to (with luck) eliminate them - ^ static VOID pullback(struct nfa *, FILE *); - */ -static VOID -pullback(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and pull until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->outs; a != NULL && !NISERR(); a = nexta) { - nexta = a->outchain; - if (a->type == '^' || a->type == BEHIND) - if (pull(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); - if (NISERR()) - return; - - for (a = nfa->pre->outs; a != NULL; a = nexta) { - nexta = a->outchain; - if (a->type == '^') { - assert(a->co == 0 || a->co == 1); - newarc(nfa, PLAIN, nfa->bos[a->co], a->from, a->to); - freearc(nfa, a); - } - } -} - -/* - - pull - pull a back constraint backward past its source state - * A significant property of this function is that it deletes at most - * one state -- the constraint's from state -- and only if the constraint - * was that state's last outarc. - ^ static int pull(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -pull(nfa, con) -struct nfa *nfa; -struct arc *con; -{ - struct state *from = con->from; - struct state *to = con->to; - struct arc *a; - struct arc *nexta; - struct state *s; - - if (from == to) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } - if (from->flag) /* can't pull back beyond start */ - return 0; - if (from->nins == 0) { /* unreachable */ - freearc(nfa, con); - return 1; - } - - /* first, clone from state if necessary to avoid other outarcs */ - if (from->nouts > 1) { - s = newstate(nfa); - if (NISERR()) - return 0; - assert(to != from); /* con is not an inarc */ - copyins(nfa, from, s); /* duplicate inarcs */ - cparc(nfa, con, s, to); /* move constraint arc */ - freearc(nfa, con); - from = s; - con = from->outs; - } - assert(from->nouts == 1); - - /* propagate the constraint into the from state's inarcs */ - for (a = from->ins; a != NULL; a = nexta) { - nexta = a->inchain; - switch (combine(con, a)) { - case INCOMPATIBLE: /* destroy the arc */ - freearc(nfa, a); - break; - case SATISFIED: /* no action needed */ - break; - case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) - return 0; - cparc(nfa, a, s, to); /* anticipate move */ - cparc(nfa, con, a->from, s); - if (NISERR()) - return 0; - freearc(nfa, a); - break; - default: - assert(NOTREACHED); - break; - } - } - - /* remaining inarcs, if any, incorporate the constraint */ - moveins(nfa, from, to); - dropstate(nfa, from); /* will free the constraint */ - return 1; -} - -/* - - pushfwd - push forward constraints forward to (with luck) eliminate them - ^ static VOID pushfwd(struct nfa *, FILE *); - */ -static VOID -pushfwd(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and push until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->ins; a != NULL && !NISERR(); a = nexta) { - nexta = a->inchain; - if (a->type == '$' || a->type == AHEAD) - if (push(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); - if (NISERR()) - return; - - for (a = nfa->post->ins; a != NULL; a = nexta) { - nexta = a->inchain; - if (a->type == '$') { - assert(a->co == 0 || a->co == 1); - newarc(nfa, PLAIN, nfa->eos[a->co], a->from, a->to); - freearc(nfa, a); - } - } -} - -/* - - push - push a forward constraint forward past its destination state - * A significant property of this function is that it deletes at most - * one state -- the constraint's to state -- and only if the constraint - * was that state's last inarc. - ^ static int push(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -push(nfa, con) -struct nfa *nfa; -struct arc *con; -{ - struct state *from = con->from; - struct state *to = con->to; - struct arc *a; - struct arc *nexta; - struct state *s; - - if (to == from) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } - if (to->flag) /* can't push forward beyond end */ - return 0; - if (to->nouts == 0) { /* dead end */ - freearc(nfa, con); - return 1; - } - - /* first, clone to state if necessary to avoid other inarcs */ - if (to->nins > 1) { - s = newstate(nfa); - if (NISERR()) - return 0; - copyouts(nfa, to, s); /* duplicate outarcs */ - cparc(nfa, con, from, s); /* move constraint */ - freearc(nfa, con); - to = s; - con = to->ins; - } - assert(to->nins == 1); - - /* propagate the constraint into the to state's outarcs */ - for (a = to->outs; a != NULL; a = nexta) { - nexta = a->outchain; - switch (combine(con, a)) { - case INCOMPATIBLE: /* destroy the arc */ - freearc(nfa, a); - break; - case SATISFIED: /* no action needed */ - break; - case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) - return 0; - cparc(nfa, con, s, a->to); /* anticipate move */ - cparc(nfa, a, from, s); - if (NISERR()) - return 0; - freearc(nfa, a); - break; - default: - assert(NOTREACHED); - break; - } - } - - /* remaining outarcs, if any, incorporate the constraint */ - moveouts(nfa, to, from); - dropstate(nfa, to); /* will free the constraint */ - return 1; -} - -/* - - combine - constraint lands on an arc, what happens? - ^ #def INCOMPATIBLE 1 // destroys arc - ^ #def SATISFIED 2 // constraint satisfied - ^ #def COMPATIBLE 3 // compatible but not satisfied yet - ^ static int combine(struct arc *, struct arc *); - */ -static int -combine(con, a) -struct arc *con; -struct arc *a; -{ -# define CA(ct,at) (((ct)<type, a->type)) { - case CA('^', PLAIN): /* newlines are handled separately */ - case CA('$', PLAIN): - return INCOMPATIBLE; - break; - case CA(AHEAD, PLAIN): /* color constraints meet colors */ - case CA(BEHIND, PLAIN): - if (con->co == a->co) - return SATISFIED; - return INCOMPATIBLE; - break; - case CA('^', '^'): /* collision, similar constraints */ - case CA('$', '$'): - case CA(AHEAD, AHEAD): - case CA(BEHIND, BEHIND): - if (con->co == a->co) /* true duplication */ - return SATISFIED; - return INCOMPATIBLE; - break; - case CA('^', BEHIND): /* collision, dissimilar constraints */ - case CA(BEHIND, '^'): - case CA('$', AHEAD): - case CA(AHEAD, '$'): - return INCOMPATIBLE; - break; - case CA('^', '$'): /* constraints passing each other */ - case CA('^', AHEAD): - case CA(BEHIND, '$'): - case CA(BEHIND, AHEAD): - case CA('$', '^'): - case CA('$', BEHIND): - case CA(AHEAD, '^'): - case CA(AHEAD, BEHIND): - case CA('^', LACON): - case CA(BEHIND, LACON): - case CA('$', LACON): - case CA(AHEAD, LACON): - return COMPATIBLE; - break; - } - assert(NOTREACHED); - return INCOMPATIBLE; /* for benefit of blind compilers */ -} - -/* - - fixempties - get rid of EMPTY arcs - ^ static VOID fixempties(struct nfa *, FILE *); - */ -static VOID -fixempties(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and eliminate empties until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->outs; a != NULL && !NISERR(); a = nexta) { - nexta = a->outchain; - if (a->type == EMPTY && unempty(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); -} - -/* - - unempty - optimize out an EMPTY arc, if possible - * Actually, as it stands this function always succeeds, but the return - * value is kept with an eye on possible future changes. - ^ static int unempty(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -unempty(nfa, a) -struct nfa *nfa; -struct arc *a; -{ - struct state *from = a->from; - struct state *to = a->to; - int usefrom; /* work on from, as opposed to to? */ - - assert(a->type == EMPTY); - assert(from != nfa->pre && to != nfa->post); - - if (from == to) { /* vacuous loop */ - freearc(nfa, a); - return 1; - } - - /* decide which end to work on */ - usefrom = 1; /* default: attack from */ - if (from->nouts > to->nins) - usefrom = 0; - else if (from->nouts == to->nins) { - /* decide on secondary issue: move/copy fewest arcs */ - if (from->nins > to->nouts) - usefrom = 0; - } - - freearc(nfa, a); - if (usefrom) { - if (from->nouts == 0) { - /* was the state's only outarc */ - moveins(nfa, from, to); - freestate(nfa, from); - } else - copyins(nfa, from, to); - } else { - if (to->nins == 0) { - /* was the state's only inarc */ - moveouts(nfa, to, from); - freestate(nfa, to); - } else - copyouts(nfa, to, from); - } - - return 1; -} - -/* - - cleanup - clean up NFA after optimizations - ^ static VOID cleanup(struct nfa *); - */ -static VOID -cleanup(nfa) -struct nfa *nfa; -{ - struct state *s; - struct state *nexts; - int n; - - /* clear out unreachable or dead-end states */ - /* use pre to mark reachable, then post to mark can-reach-post */ - markreachable(nfa, nfa->pre, (struct state *)NULL, nfa->pre); - markcanreach(nfa, nfa->post, nfa->pre, nfa->post); - for (s = nfa->states; s != NULL; s = nexts) { - nexts = s->next; - if (s->tmp != nfa->post && !s->flag) - dropstate(nfa, s); - } - assert(nfa->post->nins == 0 || nfa->post->tmp == nfa->post); - cleartraverse(nfa, nfa->pre); - assert(nfa->post->nins == 0 || nfa->post->tmp == NULL); - /* the nins==0 (final unreachable) case will be caught later */ - - /* renumber surviving states */ - n = 0; - for (s = nfa->states; s != NULL; s = s->next) - s->no = n++; - nfa->nstates = n; -} - -/* - - markreachable - recursive marking of reachable states - ^ static VOID markreachable(struct nfa *, struct state *, struct state *, - ^ struct state *); - */ -static VOID -markreachable(nfa, s, okay, mark) -struct nfa *nfa; -struct state *s; -struct state *okay; /* consider only states with this mark */ -struct state *mark; /* the value to mark with */ -{ - struct arc *a; - - if (s->tmp != okay) - return; - s->tmp = mark; - - for (a = s->outs; a != NULL; a = a->outchain) - markreachable(nfa, a->to, okay, mark); -} - -/* - - markcanreach - recursive marking of states which can reach here - ^ static VOID markcanreach(struct nfa *, struct state *, struct state *, - ^ struct state *); - */ -static VOID -markcanreach(nfa, s, okay, mark) -struct nfa *nfa; -struct state *s; -struct state *okay; /* consider only states with this mark */ -struct state *mark; /* the value to mark with */ -{ - struct arc *a; - - if (s->tmp != okay) - return; - s->tmp = mark; - - for (a = s->ins; a != NULL; a = a->inchain) - markcanreach(nfa, a->from, okay, mark); -} - -/* - - analyze - ascertain potentially-useful facts about an optimized NFA - ^ static int analyze(struct nfa *); - */ -static int /* re_info bits to be ORed in */ -analyze(nfa) -struct nfa *nfa; -{ - struct arc *a; - struct arc *aa; - - if (nfa->pre->outs == NULL) - return REG_UIMPOSSIBLE; - for (a = nfa->pre->outs; a != NULL; a = a->outchain) - for (aa = a->to->outs; aa != NULL; aa = aa->outchain) - if (aa->to == nfa->post) - return REG_UEMPTYMATCH; - return 0; -} - -/* - - compact - compact an NFA - ^ static VOID compact(struct nfa *, struct cnfa *); - */ -static VOID -compact(nfa, cnfa) -struct nfa *nfa; -struct cnfa *cnfa; -{ - struct state *s; - struct arc *a; - size_t nstates; - size_t narcs; - struct carc *ca; - struct carc *first; - - assert (!NISERR()); - - nstates = 0; - narcs = 0; - for (s = nfa->states; s != NULL; s = s->next) { - nstates++; - narcs += 1 + s->nouts + 1; - /* 1 as a fake for flags, nouts for arcs, 1 as endmarker */ - } - - cnfa->states = (struct carc **)MALLOC(nstates * sizeof(struct carc *)); - cnfa->arcs = (struct carc *)MALLOC(narcs * sizeof(struct carc)); - if (cnfa->states == NULL || cnfa->arcs == NULL) { - if (cnfa->states != NULL) - FREE(cnfa->states); - if (cnfa->arcs != NULL) - FREE(cnfa->arcs); - NERR(REG_ESPACE); - return; - } - cnfa->nstates = nstates; - cnfa->pre = nfa->pre->no; - cnfa->post = nfa->post->no; - cnfa->bos[0] = nfa->bos[0]; - cnfa->bos[1] = nfa->bos[1]; - cnfa->eos[0] = nfa->eos[0]; - cnfa->eos[1] = nfa->eos[1]; - cnfa->ncolors = maxcolor(nfa->cm) + 1; - cnfa->flags = 0; - - ca = cnfa->arcs; - for (s = nfa->states; s != NULL; s = s->next) { - assert((size_t)s->no < nstates); - cnfa->states[s->no] = ca; - ca->co = 0; /* clear and skip flags "arc" */ - ca++; - first = ca; - for (a = s->outs; a != NULL; a = a->outchain) - switch (a->type) { - case PLAIN: - ca->co = a->co; - ca->to = a->to->no; - ca++; - break; - case LACON: - assert(s->no != cnfa->pre); - ca->co = (color)(cnfa->ncolors + a->co); - ca->to = a->to->no; - ca++; - cnfa->flags |= HASLACONS; - break; - default: - assert(NOTREACHED); - break; - } - carcsort(first, ca-1); - ca->co = COLORLESS; - ca->to = 0; - ca++; - } - assert(ca == &cnfa->arcs[narcs]); - assert(cnfa->nstates != 0); - - /* mark no-progress states */ - for (a = nfa->pre->outs; a != NULL; a = a->outchain) - cnfa->states[a->to->no]->co = 1; - cnfa->states[nfa->pre->no]->co = 1; -} - -/* - - carcsort - sort compacted-NFA arcs by color - * Really dumb algorithm, but if the list is long enough for that to matter, - * you're in real trouble anyway. - ^ static VOID carcsort(struct carc *, struct carc *); - */ -static VOID -carcsort(first, last) -struct carc *first; -struct carc *last; -{ - struct carc *p; - struct carc *q; - struct carc tmp; - - if (last - first <= 1) - return; - - for (p = first; p <= last; p++) - for (q = p; q <= last; q++) - if (p->co > q->co || - (p->co == q->co && p->to > q->to)) { - assert(p != q); - tmp = *p; - *p = *q; - *q = tmp; - } -} - -/* - - freecnfa - free a compacted NFA - ^ static VOID freecnfa(struct cnfa *); - */ -static VOID -freecnfa(cnfa) -struct cnfa *cnfa; -{ - assert(cnfa->nstates != 0); /* not empty already */ - cnfa->nstates = 0; - FREE(cnfa->states); - FREE(cnfa->arcs); -} - -/* - - dumpnfa - dump an NFA in human-readable form - ^ static VOID dumpnfa(struct nfa *, FILE *); - */ -static VOID -dumpnfa(nfa, f) -struct nfa *nfa; -FILE *f; -{ -#ifdef REG_DEBUG - struct state *s; - - fprintf(f, "pre %d, post %d", nfa->pre->no, nfa->post->no); - if (nfa->bos[0] != COLORLESS) - fprintf(f, ", bos [%ld]", (long)nfa->bos[0]); - if (nfa->bos[1] != COLORLESS) - fprintf(f, ", bol [%ld]", (long)nfa->bos[1]); - if (nfa->eos[0] != COLORLESS) - fprintf(f, ", eos [%ld]", (long)nfa->eos[0]); - if (nfa->eos[1] != COLORLESS) - fprintf(f, ", eol [%ld]", (long)nfa->eos[1]); - fprintf(f, "\n"); - for (s = nfa->states; s != NULL; s = s->next) - dumpstate(s, f); - if (nfa->parent == NULL) - dumpcolors(nfa->cm, f); - fflush(f); -#endif -} - -#ifdef REG_DEBUG /* subordinates of dumpnfa */ - -/* - - dumpstate - dump an NFA state in human-readable form - ^ static VOID dumpstate(struct state *, FILE *); - */ -static VOID -dumpstate(s, f) -struct state *s; -FILE *f; -{ - struct arc *a; - - fprintf(f, "%d%s%c", s->no, (s->tmp != NULL) ? "T" : "", - (s->flag) ? s->flag : '.'); - if (s->prev != NULL && s->prev->next != s) - fprintf(f, "\tstate chain bad\n"); - if (s->nouts == 0) - fprintf(f, "\tno out arcs\n"); - else - dumparcs(s, f); - fflush(f); - for (a = s->ins; a != NULL; a = a->inchain) { - if (a->to != s) - fprintf(f, "\tlink from %d to %d on %d's in-chain\n", - a->from->no, a->to->no, s->no); - } -} - -/* - - dumparcs - dump out-arcs in human-readable form - ^ static VOID dumparcs(struct state *, FILE *); - */ -static VOID -dumparcs(s, f) -struct state *s; -FILE *f; -{ - int pos; - - assert(s->nouts > 0); - /* printing arcs in reverse order is usually clearer */ - pos = dumprarcs(s->outs, s, f, 1); - if (pos != 1) - fprintf(f, "\n"); -} - -/* - - dumprarcs - dump remaining outarcs, recursively, in reverse order - ^ static int dumprarcs(struct arc *, struct state *, FILE *, int); - */ -static int /* resulting print position */ -dumprarcs(a, s, f, pos) -struct arc *a; -struct state *s; -FILE *f; -int pos; /* initial print position */ -{ - if (a->outchain != NULL) - pos = dumprarcs(a->outchain, s, f, pos); - dumparc(a, s, f); - if (pos == 5) { - fprintf(f, "\n"); - pos = 1; - } else - pos++; - return pos; -} - -/* - - dumparc - dump one outarc in readable form, including prefixing tab - ^ static VOID dumparc(struct arc *, struct state *, FILE *); - */ -static VOID -dumparc(a, s, f) -struct arc *a; -struct state *s; -FILE *f; -{ - struct arc *aa; - struct arcbatch *ab; - - fprintf(f, "\t"); - switch (a->type) { - case PLAIN: - fprintf(f, "[%ld]", (long)a->co); - break; - case AHEAD: - fprintf(f, ">%ld>", (long)a->co); - break; - case BEHIND: - fprintf(f, "<%ld<", (long)a->co); - break; - case LACON: - fprintf(f, ":%ld:", (long)a->co); - break; - case '^': - case '$': - fprintf(f, "%c%d", a->type, (int)a->co); - break; - case EMPTY: - break; - default: - fprintf(f, "0x%x/0%lo", a->type, (long)a->co); - break; - } - if (a->from != s) - fprintf(f, "?%d?", a->from->no); - for (ab = &a->from->oas; ab != NULL; ab = ab->next) { - for (aa = &ab->a[0]; aa < &ab->a[ABSIZE]; aa++) - if (aa == a) - break; /* NOTE BREAK OUT */ - if (aa < &ab->a[ABSIZE]) /* propagate break */ - break; /* NOTE BREAK OUT */ - } - if (ab == NULL) - fprintf(f, "?!?"); /* not in allocated space */ - fprintf(f, "->"); - if (a->to == NULL) { - fprintf(f, "NULL"); - return; - } - fprintf(f, "%d", a->to->no); - for (aa = a->to->ins; aa != NULL; aa = aa->inchain) - if (aa == a) - break; /* NOTE BREAK OUT */ - if (aa == NULL) - fprintf(f, "?!?"); /* missing from in-chain */ -} - -#endif /* ifdef REG_DEBUG */ - -/* - - dumpcnfa - dump a compacted NFA in human-readable form - ^ static VOID dumpcnfa(struct cnfa *, FILE *); - */ -static VOID -dumpcnfa(cnfa, f) -struct cnfa *cnfa; -FILE *f; -{ -#ifdef REG_DEBUG - int st; - - fprintf(f, "pre %d, post %d", cnfa->pre, cnfa->post); - if (cnfa->bos[0] != COLORLESS) - fprintf(f, ", bos [%ld]", (long)cnfa->bos[0]); - if (cnfa->bos[1] != COLORLESS) - fprintf(f, ", bol [%ld]", (long)cnfa->bos[1]); - if (cnfa->eos[0] != COLORLESS) - fprintf(f, ", eos [%ld]", (long)cnfa->eos[0]); - if (cnfa->eos[1] != COLORLESS) - fprintf(f, ", eol [%ld]", (long)cnfa->eos[1]); - if (cnfa->flags&HASLACONS) - fprintf(f, ", haslacons"); - fprintf(f, "\n"); - for (st = 0; st < cnfa->nstates; st++) - dumpcstate(st, cnfa->states[st], cnfa, f); - fflush(f); -#endif -} - -#ifdef REG_DEBUG /* subordinates of dumpcnfa */ - -/* - - dumpcstate - dump a compacted-NFA state in human-readable form - ^ static VOID dumpcstate(int, struct carc *, struct cnfa *, FILE *); - */ -static VOID -dumpcstate(st, ca, cnfa, f) -int st; -struct carc *ca; -struct cnfa *cnfa; -FILE *f; -{ - int i; - int pos; - - fprintf(f, "%d%s", st, (ca[0].co) ? ":" : "."); - pos = 1; - for (i = 1; ca[i].co != COLORLESS; i++) { - if (ca[i].co < cnfa->ncolors) - fprintf(f, "\t[%ld]->%d", (long)ca[i].co, ca[i].to); - else - fprintf(f, "\t:%ld:->%d", (long)ca[i].co-cnfa->ncolors, - ca[i].to); - if (pos == 5) { - fprintf(f, "\n"); - pos = 1; - } else - pos++; - } - if (i == 1 || pos != 1) - fprintf(f, "\n"); - fflush(f); -} - -#endif /* ifdef REG_DEBUG */ diff --git a/generic/regcomp.c b/generic/regcomp.c deleted file mode 100644 index 8e1b61c..0000000 --- a/generic/regcomp.c +++ /dev/null @@ -1,2124 +0,0 @@ -/* - * re_*comp and friends - compile REs - * This file #includes several others (see the bottom). - */ - -#include "regguts.h" - -/* - * forward declarations, up here so forward datatypes etc. are defined early - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regcomp.c === */ -int compile _ANSI_ARGS_((regex_t *, CONST chr *, size_t, int)); -static VOID moresubs _ANSI_ARGS_((struct vars *, int)); -static int freev _ANSI_ARGS_((struct vars *, int)); -static VOID makescan _ANSI_ARGS_((struct vars *, struct nfa *)); -static struct subre *parse _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *)); -static struct subre *parsebranch _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *, int)); -static VOID parseqatom _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *, struct subre *)); -static VOID nonword _ANSI_ARGS_((struct vars *, int, struct state *, struct state *)); -static VOID word _ANSI_ARGS_((struct vars *, int, struct state *, struct state *)); -static int scannum _ANSI_ARGS_((struct vars *)); -static VOID repeat _ANSI_ARGS_((struct vars *, struct state *, struct state *, int, int)); -static VOID bracket _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static VOID cbracket _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static VOID brackpart _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static chr *scanplain _ANSI_ARGS_((struct vars *)); -static VOID leaders _ANSI_ARGS_((struct vars *, struct cvec *)); -static VOID onechr _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *)); -static VOID dovec _ANSI_ARGS_((struct vars *, struct cvec *, struct state *, struct state *)); -static celt nextleader _ANSI_ARGS_((struct vars *, pchr, pchr)); -static VOID wordchrs _ANSI_ARGS_((struct vars *)); -static struct subre *subre _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *)); -static VOID freesubre _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID freesrnode _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID optst _ANSI_ARGS_((struct vars *, struct subre *)); -static int numst _ANSI_ARGS_((struct subre *, int)); -static VOID markst _ANSI_ARGS_((struct subre *)); -static VOID cleanst _ANSI_ARGS_((struct vars *)); -static int nfatree _ANSI_ARGS_((struct vars *, struct subre *, FILE *)); -static int nfanode _ANSI_ARGS_((struct vars *, struct subre *, FILE *)); -static int newlacon _ANSI_ARGS_((struct vars *, struct state *, struct state *, int)); -static VOID freelacons _ANSI_ARGS_((struct subre *, int)); -static VOID rfree _ANSI_ARGS_((regex_t *)); -static VOID dump _ANSI_ARGS_((regex_t *, FILE *)); -static VOID dumpst _ANSI_ARGS_((struct subre *, FILE *, int)); -static VOID stdump _ANSI_ARGS_((struct subre *, FILE *, int, int)); -/* === regc_lex.c === */ -static VOID lexstart _ANSI_ARGS_((struct vars *)); -static VOID prefixes _ANSI_ARGS_((struct vars *)); -static VOID lexnest _ANSI_ARGS_((struct vars *, chr *, chr *)); -static VOID lexword _ANSI_ARGS_((struct vars *)); -static int next _ANSI_ARGS_((struct vars *)); -static int lexescape _ANSI_ARGS_((struct vars *)); -static chr lexdigits _ANSI_ARGS_((struct vars *, int, int, int)); -static int brenext _ANSI_ARGS_((struct vars *, pchr)); -static VOID skip _ANSI_ARGS_((struct vars *)); -static chr newline _ANSI_ARGS_((NOPARMS)); -static chr chrnamed _ANSI_ARGS_((struct vars *, chr *, chr *, pchr)); -/* === regc_color.c === */ -static VOID initcm _ANSI_ARGS_((struct vars *, struct colormap *)); -static VOID freecm _ANSI_ARGS_((struct colormap *)); -static VOID cmtreefree _ANSI_ARGS_((struct colormap *, union tree *, int)); -static color setcolor _ANSI_ARGS_((struct colormap *, pchr, pcolor)); -static color maxcolor _ANSI_ARGS_((struct colormap *)); -static color newcolor _ANSI_ARGS_((struct colormap *)); -static VOID freecolor _ANSI_ARGS_((struct colormap *, pcolor)); -static color pseudocolor _ANSI_ARGS_((struct colormap *)); -static color subcolor _ANSI_ARGS_((struct colormap *, pchr c)); -static color newsub _ANSI_ARGS_((struct colormap *, pcolor)); -static VOID subrange _ANSI_ARGS_((struct vars *, pchr, pchr, struct state *, struct state *)); -static VOID subblock _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *)); -static VOID okcolors _ANSI_ARGS_((struct nfa *, struct colormap *)); -static VOID colorchain _ANSI_ARGS_((struct colormap *, struct arc *)); -static VOID uncolorchain _ANSI_ARGS_((struct colormap *, struct arc *)); -#if 0 -static int singleton _ANSI_ARGS_((struct colormap *, pchr c)); -#endif -static VOID rainbow _ANSI_ARGS_((struct nfa *, struct colormap *, int, pcolor, struct state *, struct state *)); -static VOID colorcomplement _ANSI_ARGS_((struct nfa *, struct colormap *, int, struct state *, struct state *, struct state *)); -#ifdef REG_DEBUG -static VOID dumpcolors _ANSI_ARGS_((struct colormap *, FILE *)); -static VOID fillcheck _ANSI_ARGS_((struct colormap *, union tree *, int, FILE *)); -static VOID dumpchr _ANSI_ARGS_((pchr, FILE *)); -#endif -/* === regc_nfa.c === */ -static struct nfa *newnfa _ANSI_ARGS_((struct vars *, struct colormap *, struct nfa *)); -static VOID freenfa _ANSI_ARGS_((struct nfa *)); -static struct state *newfstate _ANSI_ARGS_((struct nfa *, int flag)); -static struct state *newstate _ANSI_ARGS_((struct nfa *)); -static VOID dropstate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID freestate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID destroystate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID newarc _ANSI_ARGS_((struct nfa *, int, pcolor, struct state *, struct state *)); -static struct arc *allocarc _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID freearc _ANSI_ARGS_((struct nfa *, struct arc *)); -static struct arc *findarc _ANSI_ARGS_((struct state *, int, pcolor)); -static VOID cparc _ANSI_ARGS_((struct nfa *, struct arc *, struct state *, struct state *)); -static VOID moveins _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID copyins _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID moveouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID copyouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID cloneouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *, int)); -static VOID delsub _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID deltraverse _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID dupnfa _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *, struct state *)); -static VOID duptraverse _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID cleartraverse _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID specialcolors _ANSI_ARGS_((struct nfa *)); -static int optimize _ANSI_ARGS_((struct nfa *, FILE *)); -static VOID pullback _ANSI_ARGS_((struct nfa *, FILE *)); -static int pull _ANSI_ARGS_((struct nfa *, struct arc *)); -static VOID pushfwd _ANSI_ARGS_((struct nfa *, FILE *)); -static int push _ANSI_ARGS_((struct nfa *, struct arc *)); -#define INCOMPATIBLE 1 /* destroys arc */ -#define SATISFIED 2 /* constraint satisfied */ -#define COMPATIBLE 3 /* compatible but not satisfied yet */ -static int combine _ANSI_ARGS_((struct arc *, struct arc *)); -static VOID fixempties _ANSI_ARGS_((struct nfa *, FILE *)); -static int unempty _ANSI_ARGS_((struct nfa *, struct arc *)); -static VOID cleanup _ANSI_ARGS_((struct nfa *)); -static VOID markreachable _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *)); -static VOID markcanreach _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *)); -static int analyze _ANSI_ARGS_((struct nfa *)); -static VOID compact _ANSI_ARGS_((struct nfa *, struct cnfa *)); -static VOID carcsort _ANSI_ARGS_((struct carc *, struct carc *)); -static VOID freecnfa _ANSI_ARGS_((struct cnfa *)); -static VOID dumpnfa _ANSI_ARGS_((struct nfa *, FILE *)); -#ifdef REG_DEBUG -static VOID dumpstate _ANSI_ARGS_((struct state *, FILE *)); -static VOID dumparcs _ANSI_ARGS_((struct state *, FILE *)); -static int dumprarcs _ANSI_ARGS_((struct arc *, struct state *, FILE *, int)); -static VOID dumparc _ANSI_ARGS_((struct arc *, struct state *, FILE *)); -#endif -static VOID dumpcnfa _ANSI_ARGS_((struct cnfa *, FILE *)); -#ifdef REG_DEBUG -static VOID dumpcstate _ANSI_ARGS_((int, struct carc *, struct cnfa *, FILE *)); -#endif -/* === regc_cvec.c === */ -static struct cvec *newcvec _ANSI_ARGS_((int, int, int)); -static struct cvec *clearcvec _ANSI_ARGS_((struct cvec *)); -static VOID addchr _ANSI_ARGS_((struct cvec *, pchr)); -static VOID addrange _ANSI_ARGS_((struct cvec *, pchr, pchr)); -#ifdef USE_MCCE -static VOID addmcce _ANSI_ARGS_((struct cvec *, chr *, chr *)); -#endif -static int haschr _ANSI_ARGS_((struct cvec *, pchr)); -static struct cvec *getcvec _ANSI_ARGS_((struct vars *, int, int, int)); -static VOID freecvec _ANSI_ARGS_((struct cvec *)); -/* === regc_locale.c === */ -static int nmcces _ANSI_ARGS_((struct vars *)); -static int nleaders _ANSI_ARGS_((struct vars *)); -static struct cvec *allmcces _ANSI_ARGS_((struct vars *, struct cvec *)); -static celt element _ANSI_ARGS_((struct vars *, chr *, chr *)); -static struct cvec *range _ANSI_ARGS_((struct vars *, celt, celt, int)); -static int before _ANSI_ARGS_((celt, celt)); -static struct cvec *eclass _ANSI_ARGS_((struct vars *, celt, int)); -static struct cvec *cclass _ANSI_ARGS_((struct vars *, chr *, chr *, int)); -static struct cvec *allcases _ANSI_ARGS_((struct vars *, pchr)); -static int cmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t)); -static int casecmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* internal variables, bundled for easy passing around */ -struct vars { - regex_t *re; - chr *now; /* scan pointer into string */ - chr *stop; /* end of string */ - chr *savenow; /* saved now and stop for "subroutine call" */ - chr *savestop; - int err; /* error code (0 if none) */ - int cflags; /* copy of compile flags */ - int lasttype; /* type of previous token */ - int nexttype; /* type of next token */ - chr nextvalue; /* value (if any) of next token */ - int lexcon; /* lexical context type (see lex.c) */ - int nsubexp; /* subexpression count */ - struct subre **subs; /* subRE pointer vector */ - size_t nsubs; /* length of vector */ - struct subre *sub10[10]; /* initial vector, enough for most */ - struct nfa *nfa; /* the NFA */ - struct colormap *cm; /* character color map */ - color nlcolor; /* color of newline */ - struct state *wordchrs; /* state in nfa holding word-char outarcs */ - struct subre *tree; /* subexpression tree */ - struct subre *treechain; /* all tree nodes allocated */ - struct subre *treefree; /* any free tree nodes */ - int ntree; /* number of tree nodes */ - struct cvec *cv; /* interface cvec */ - struct cvec *cv2; /* utility cvec */ - struct cvec *mcces; /* collating-element information */ -# define ISCELEADER(v,c) (v->mcces != NULL && haschr(v->mcces, (c))) - struct state *mccepbegin; /* in nfa, start of MCCE prototypes */ - struct state *mccepend; /* in nfa, end of MCCE prototypes */ - struct subre *lacons; /* lookahead-constraint vector */ - int nlacons; /* size of lacons */ - int usedshorter; /* used short-preferring quantifiers */ - int unmatchable; /* can never match */ -}; - -/* parsing macros; most know that `v' is the struct vars pointer */ -#define NEXT() (next(v)) /* advance by one token */ -#define SEE(t) (v->nexttype == (t)) /* is next token this? */ -#define EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */ -#define VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */ -#define ISERR() VISERR(v) -#define VERR(vv,e) ((vv)->nexttype = EOS, ((vv)->err) ? (vv)->err :\ - ((vv)->err = (e))) -#define ERR(e) VERR(v, e) /* record an error */ -#define NOERR() {if (ISERR()) return;} /* if error seen, return */ -#define NOERRN() {if (ISERR()) return NULL;} /* NOERR with retval */ -#define NOERRZ() {if (ISERR()) return 0;} /* NOERR with retval */ -#define INSIST(c, e) ((c) ? 0 : ERR(e)) /* if condition false, error */ -#define NOTE(b) (v->re->re_info |= (b)) /* note visible condition */ -#define EMPTYARC(x, y) newarc(v->nfa, EMPTY, 0, x, y) - -/* token type codes, some also used as NFA arc types */ -#define EMPTY 'n' /* no token present */ -#define EOS 'e' /* end of string */ -#define PLAIN 'p' /* ordinary character */ -#define DIGIT 'd' /* digit (in bound) */ -#define BACKREF 'b' /* back reference */ -#define COLLEL 'I' /* start of [. */ -#define ECLASS 'E' /* start of [= */ -#define CCLASS 'C' /* start of [: */ -#define END 'X' /* end of [. [= [: */ -#define RANGE 'R' /* - within [] which might be range delim. */ -#define LACON 'L' /* lookahead constraint subRE */ -#define AHEAD 'a' /* color-lookahead arc */ -#define BEHIND 'r' /* color-lookbehind arc */ -#define WBDRY 'w' /* word boundary constraint */ -#define NWBDRY 'W' /* non-word-boundary constraint */ -#define SBEGIN 'A' /* beginning of string (even if not BOL) */ -#define SEND 'Z' /* end of string (even if not EOL) */ -#define PREFER 'P' /* length preference */ - -/* is an arc colored, and hence on a color chain? */ -#define COLORED(a) ((a)->type == PLAIN || (a)->type == AHEAD || \ - (a)->type == BEHIND) - - - -/* static function list */ -static struct fns functions = { - rfree, /* regfree insides */ -}; - - - -/* - - compile - compile regular expression - ^ int compile(regex_t *, CONST chr *, size_t, int); - */ -int -compile(re, string, len, flags) -regex_t *re; -CONST chr *string; -size_t len; -int flags; -{ - struct vars var; - struct vars *v = &var; - struct guts *g; - int i; - size_t j; - FILE *debug = (flags®_PROGRESS) ? stdout : (FILE *)NULL; -# define CNOERR() { if (ISERR()) return freev(v, v->err); } - - /* sanity checks */ - - if (re == NULL || string == NULL) - return REG_INVARG; - if ((flags®_QUOTE) && - (flags&(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE))) - return REG_INVARG; - if (!(flags®_EXTENDED) && (flags®_ADVF)) - return REG_INVARG; - - /* initial setup (after which freev() is callable) */ - v->re = re; - v->now = (chr *)string; - v->stop = v->now + len; - v->savenow = v->savestop = NULL; - v->err = 0; - v->cflags = flags; - v->nsubexp = 0; - v->subs = v->sub10; - v->nsubs = 10; - for (j = 0; j < v->nsubs; j++) - v->subs[j] = NULL; - v->nfa = NULL; - v->cm = NULL; - v->nlcolor = COLORLESS; - v->wordchrs = NULL; - v->tree = NULL; - v->treechain = NULL; - v->treefree = NULL; - v->cv = NULL; - v->cv2 = NULL; - v->mcces = NULL; - v->lacons = NULL; - v->nlacons = 0; - re->re_magic = REMAGIC; - re->re_info = 0; /* bits get set during parse */ - re->re_csize = sizeof(chr); - re->re_guts = NULL; - re->re_fns = VS(&functions); - - /* more complex setup, malloced things */ - re->re_guts = VS(MALLOC(sizeof(struct guts))); - if (re->re_guts == NULL) - return freev(v, REG_ESPACE); - g = (struct guts *)re->re_guts; - g->tree = NULL; - initcm(v, &g->cmap); - v->cm = &g->cmap; - g->lacons = NULL; - g->nlacons = 0; - ZAPCNFA(g->search); - v->nfa = newnfa(v, v->cm, (struct nfa *)NULL); - CNOERR(); - v->cv = newcvec(100, 20, 10); - if (v->cv == NULL) - return freev(v, REG_ESPACE); - i = nmcces(v); - if (i > 0) { - v->mcces = newcvec(nleaders(v), 0, i); - CNOERR(); - v->mcces = allmcces(v, v->mcces); - leaders(v, v->mcces); - } - CNOERR(); - - /* parsing */ - lexstart(v); /* also handles prefixes */ - if ((v->cflags®_NLSTOP) || (v->cflags®_NLANCH)) { - /* assign newline a unique color */ - v->nlcolor = subcolor(v->cm, newline()); - okcolors(v->nfa, v->cm); - } - CNOERR(); - v->tree = parse(v, EOS, PLAIN, v->nfa->init, v->nfa->final); - assert(SEE(EOS)); /* even if error; ISERR() => SEE(EOS) */ - CNOERR(); - assert(v->tree != NULL); - - /* finish setup of nfa and its subre tree */ - specialcolors(v->nfa); - CNOERR(); - if (debug != NULL) { - dumpnfa(v->nfa, debug); - dumpst(v->tree, debug, 1); - } - v->usedshorter = 0; - v->unmatchable = 0; - optst(v, v->tree); - v->ntree = numst(v->tree, 1); - markst(v->tree); - cleanst(v); - if (debug != NULL) { - fprintf(debug, "-->\n"); - dumpst(v->tree, debug, 1); - } - - /* build compacted NFAs for tree, lacons, fast search */ - re->re_info |= nfatree(v, v->tree, debug); - if (debug != NULL) { - fprintf(debug, "---->\n"); - dumpst(v->tree, debug, 1); - } - CNOERR(); - if (re->re_info®_UIMPOSSIBLE) - v->unmatchable = 1; - assert(v->nlacons == 0 || v->lacons != NULL); - for (i = 1; i < v->nlacons; i++) - nfanode(v, &v->lacons[i], debug); - CNOERR(); - (DISCARD)optimize(v->nfa, debug); - CNOERR(); - makescan(v, v->nfa); - CNOERR(); - compact(v->nfa, &g->search); - CNOERR(); - - /* looks okay, package it up */ - re->re_nsub = v->nsubexp; - v->re = NULL; /* freev no longer frees re */ - g->magic = GUTSMAGIC; - g->cflags = v->cflags; - g->info = re->re_info; - g->nsub = re->re_nsub; - g->tree = v->tree; - v->tree = NULL; - g->ntree = v->ntree; - g->compare = (v->cflags®_ICASE) ? casecmp : cmp; - g->lacons = v->lacons; - v->lacons = NULL; - g->nlacons = v->nlacons; - g->usedshorter = v->usedshorter; - g->unmatchable = v->unmatchable; - - if (flags®_DUMP) - dump(re, stdout); - - assert(v->err == 0); - return freev(v, 0); -} - -/* - - moresubs - enlarge subRE vector - ^ static VOID moresubs(struct vars *, int); - */ -static VOID -moresubs(v, wanted) -struct vars *v; -int wanted; /* want enough room for this one */ -{ - struct subre **p; - size_t n; - - assert(wanted > 0 && (size_t)wanted >= v->nsubs); - n = (size_t)wanted * 3 / 2 + 1; - if (v->subs == v->sub10) { - p = (struct subre **)MALLOC(n * sizeof(struct subre *)); - if (p != NULL) - memcpy(VS(p), VS(v->subs), - v->nsubs * sizeof(struct subre *)); - } else - p = (struct subre**)REALLOC(v->subs, n*sizeof(struct subre *)); - if (p == NULL) { - ERR(REG_ESPACE); - return; - } - v->subs = p; - for (p = &v->subs[v->nsubs]; v->nsubs < n; p++, v->nsubs++) - *p = NULL; - assert(v->nsubs == n); - assert((size_t)wanted < v->nsubs); -} - -/* - - freev - free vars struct's substructures where necessary - * Optionally does error-number setting, and always returns error code - * (if any), to make error-handling code terser. - ^ static int freev(struct vars *, int); - */ -static int -freev(v, err) -struct vars *v; -int err; -{ - if (v->re != NULL) - rfree(v->re); - if (v->subs != v->sub10) - FREE(v->subs); - if (v->nfa != NULL) - freenfa(v->nfa); - if (v->tree != NULL) - freesubre(v, v->tree); - if (v->treechain != NULL) - cleanst(v); - if (v->cv != NULL) - freecvec(v->cv); - if (v->cv2 != NULL) - freecvec(v->cv2); - if (v->mcces != NULL) - freecvec(v->mcces); - if (v->lacons != NULL) - freelacons(v->lacons, v->nlacons); - ERR(err); /* nop if err==0 */ - - return v->err; -} - -/* - - makescan - turn an NFA into a fast-scan NFA (implicit prepend of .*?) - * NFA must have been optimize()d already. - ^ static VOID makescan(struct vars *, struct nfa *); - */ -static VOID -makescan(v, nfa) -struct vars *v; -struct nfa *nfa; -{ - struct arc *a; - struct arc *b; - struct state *pre = nfa->pre; - struct state *s; - struct state *s2; - struct state *slist; - - /* no loops are needed if it's anchored */ - for (a = pre->outs; a != NULL; a = a->outchain) { - assert(a->type == PLAIN); - if (a->co != nfa->bos[0] && a->co != nfa->bos[1]) - break; - } - if (a != NULL) { - /* add implicit .* in front */ - rainbow(nfa, v->cm, PLAIN, COLORLESS, pre, pre); - - /* and ^* and \Z* too -- not always necessary, but harmless */ - newarc(nfa, PLAIN, nfa->bos[0], pre, pre); - newarc(nfa, PLAIN, nfa->bos[1], pre, pre); - } - - /* - * Now here's the subtle part. Because many REs have no lookback - * constraints, often knowing when you were in the pre state tells - * you little; it's the next state(s) that are informative. But - * some of them may have other inarcs, i.e. it may be possible to - * make actual progress and then return to one of them. We must - * de-optimize such cases, splitting each such state into progress - * and no-progress states. - */ - - /* first, make a list of the states */ - slist = NULL; - for (a = pre->outs; a != NULL; a = a->outchain) { - s = a->to; - for (b = s->ins; b != NULL; b = b->inchain) - if (b->from != pre) - break; - if (b != NULL) { /* must be split */ - s->tmp = slist; - slist = s; - } - } - - /* do the splits */ - for (s = slist; s != NULL; s = s2) { - s2 = newstate(nfa); - copyouts(nfa, s, s2); - for (a = s->ins; a != NULL; a = b) { - b = a->inchain; - if (a->from != pre) { - cparc(nfa, a, a->from, s2); - freearc(nfa, a); - } - } - s2 = s->tmp; - s->tmp = NULL; /* clean up while we're at it */ - } -} - -/* - - parse - parse an RE - * This is actually just the top level, which parses a bunch of branches - * tied together with '|'. They appear in the tree as the left children - * of a chain of '|' subres. - ^ static struct subre *parse(struct vars *, int, int, struct state *, - ^ struct state *); - */ -static struct subre * -parse(v, stopper, type, init, final) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *init; /* initial state */ -struct state *final; /* final state */ -{ - struct state *left; /* scaffolding for branch */ - struct state *right; - struct subre *branches; /* top level */ - struct subre *branch; /* current branch */ - struct subre *t; /* temporary */ - int firstbranch; /* is this the first branch? */ - - assert(stopper == ')' || stopper == EOS); - - branches = subre(v, '|', LONGER, init, final); - NOERRN(); - branch = branches; - firstbranch = 1; - do { /* a branch */ - if (!firstbranch) { - /* need a place to hang it */ - branch->right = subre(v, '|', LONGER, init, final); - NOERRN(); - branch = branch->right; - } - firstbranch = 0; - left = newstate(v->nfa); - right = newstate(v->nfa); - NOERRN(); - EMPTYARC(init, left); - EMPTYARC(right, final); - NOERRN(); - branch->left = parsebranch(v, stopper, type, left, right, 0); - NOERRN(); - branch->flags |= UP(branch->flags | branch->left->flags); - if ((branch->flags &~ branches->flags) != 0) /* new flags */ - for (t = branches; t != branch; t = t->right) - t->flags |= branch->flags; - } while (EAT('|')); - assert(SEE(stopper) || SEE(EOS)); - - if (!SEE(stopper)) { - assert(stopper == ')' && SEE(EOS)); - ERR(REG_EPAREN); - } - - /* optimize out simple cases */ - if (branch == branches) { /* only one branch */ - assert(branch->right == NULL); - t = branch->left; - branch->left = NULL; - freesubre(v, branches); - branches = t; - } else if (!MESSY(branches->flags)) { /* no interesting innards */ - freesubre(v, branches->left); - branches->left = NULL; - freesubre(v, branches->right); - branches->right = NULL; - branches->op = '='; - } - - return branches; -} - -/* - - parsebranch - parse one branch of an RE - * This mostly manages concatenation, working closely with parseqatom(). - * Concatenated things are bundled up as much as possible, with separate - * ',' nodes introduced only when necessary due to substructure. - ^ static struct subre *parsebranch(struct vars *, int, int, struct state *, - ^ struct state *, int); - */ -static struct subre * -parsebranch(v, stopper, type, left, right, partial) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *left; /* leftmost state */ -struct state *right; /* rightmost state */ -int partial; /* is this only part of a branch? */ -{ - struct state *lp; /* left end of current construct */ - int seencontent; /* is there anything in this branch yet? */ - struct subre *t; - - lp = left; - seencontent = 0; - t = subre(v, '=', 0, left, right); /* op '=' is tentative */ - NOERRN(); - while (!SEE('|') && !SEE(stopper) && !SEE(EOS)) { - if (seencontent) { /* implicit concat operator */ - lp = newstate(v->nfa); - NOERRN(); - moveins(v->nfa, right, lp); - } - seencontent = 1; - - /* NB, recursion in parseqatom() may swallow rest of branch */ - parseqatom(v, stopper, type, lp, right, t); - } - - if (!seencontent) { /* empty branch */ - if (!partial) - NOTE(REG_UUNSPEC); - assert(lp == left); - EMPTYARC(left, right); - } - - return t; -} - -/* - - parseqatom - parse one quantified atom or constraint of an RE - * The bookkeeping near the end cooperates very closely with parsebranch(); - * in particular, it contains a recursion that can involve parsing the rest - * of the branch, making this function's name somewhat inaccurate. - ^ static VOID parseqatom(struct vars *, int, int, struct state *, - ^ struct state *, struct subre *); - */ -static VOID -parseqatom(v, stopper, type, lp, rp, top) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *lp; /* left state to hang it on */ -struct state *rp; /* right state to hang it on */ -struct subre *top; /* subtree top */ -{ - struct state *s; /* temporaries for new states */ - struct state *s2; -# define ARCV(t, val) newarc(v->nfa, t, val, lp, rp) - int m, n; - struct subre *atom; /* atom's subtree */ - struct subre *t; - int cap; /* capturing parens? */ - int pos; /* positive lookahead? */ - int subno; /* capturing-parens or backref number */ - int atomtype; - int qprefer; /* quantifier short/long preference */ - int f; - struct subre **atomp; /* where the pointer to atom is */ - - /* initial bookkeeping */ - atom = NULL; - assert(lp->nouts == 0); /* must string new code */ - assert(rp->nins == 0); /* between lp and rp */ - subno = 0; /* just to shut lint up */ - - /* an atom or constraint... */ - atomtype = v->nexttype; - switch (atomtype) { - /* first, constraints, which end by returning */ - case '^': - ARCV('^', 1); - if (v->cflags®_NLANCH) - ARCV(BEHIND, v->nlcolor); - NEXT(); - return; - break; - case '$': - ARCV('$', 1); - if (v->cflags®_NLANCH) - ARCV(AHEAD, v->nlcolor); - NEXT(); - return; - break; - case SBEGIN: - ARCV('^', 1); /* BOL */ - ARCV('^', 0); /* or BOS */ - NEXT(); - return; - break; - case SEND: - ARCV('$', 1); /* EOL */ - ARCV('$', 0); /* or EOS */ - NEXT(); - return; - break; - case '<': - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - return; - break; - case '>': - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case WBDRY: - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case NWBDRY: - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case LACON: /* lookahead constraint */ - pos = v->nextvalue; - NEXT(); - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - t = parse(v, ')', LACON, s, s2); - freesubre(v, t); /* internal structure irrelevant */ - assert(SEE(')') || ISERR()); - NEXT(); - n = newlacon(v, s, s2, pos); - NOERR(); - ARCV(LACON, n); - return; - break; - /* then errors, to get them out of the way */ - case '*': - case '+': - case '?': - case '{': - ERR(REG_BADRPT); - return; - break; - default: - ERR(REG_ASSERT); - return; - break; - /* then plain characters, and minor variants on that theme */ - case ')': /* unbalanced paren */ - if ((v->cflags®_ADVANCED) != REG_EXTENDED) { - ERR(REG_EPAREN); - return; - } - /* legal in EREs due to specification botch */ - NOTE(REG_UPBOTCH); - /* fallthrough into case PLAIN */ - case PLAIN: - onechr(v, v->nextvalue, lp, rp); - okcolors(v->nfa, v->cm); - NOERR(); - NEXT(); - break; - case '[': - if (v->nextvalue == 1) - bracket(v, lp, rp); - else - cbracket(v, lp, rp); - assert(SEE(']') || ISERR()); - NEXT(); - break; - case '.': - rainbow(v->nfa, v->cm, PLAIN, - (v->cflags®_NLSTOP) ? v->nlcolor : COLORLESS, - lp, rp); - NEXT(); - break; - /* and finally the ugly stuff */ - case '(': /* value flags as capturing or non */ - cap = (type == LACON) ? 0 : v->nextvalue; - if (cap) { - v->nsubexp++; - subno = v->nsubexp; - if ((size_t)subno >= v->nsubs) - moresubs(v, subno); - assert((size_t)subno < v->nsubs); - } else - atomtype = PLAIN; /* something that's not '(' */ - NEXT(); - /* need new endpoints because tree will contain pointers */ - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - EMPTYARC(lp, s); - EMPTYARC(s2, rp); - NOERR(); - atom = parse(v, ')', PLAIN, s, s2); - assert(SEE(')') || ISERR()); - NEXT(); - NOERR(); - if (cap) { - v->subs[subno] = atom; - t = subre(v, '(', atom->flags|CAP, lp, rp); - NOERR(); - t->subno = subno; - t->left = atom; - atom = t; - } - /* postpone everything else pending possible {0} */ - break; - case BACKREF: /* the Feature From The Black Lagoon */ - INSIST(type != LACON, REG_ESUBREG); - INSIST(v->nextvalue < v->nsubs, REG_ESUBREG); - INSIST(v->subs[v->nextvalue] != NULL, REG_ESUBREG); - NOERR(); - assert(v->nextvalue > 0); - atom = subre(v, 'b', BACKR, lp, rp); - subno = v->nextvalue; - atom->subno = subno; - EMPTYARC(lp, rp); /* temporarily, so there's something */ - NEXT(); - break; - } - - /* ...and an atom may be followed by a quantifier */ - switch (v->nexttype) { - case '*': - m = 0; - n = INFINITY; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '+': - m = 1; - n = INFINITY; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '?': - m = 0; - n = 1; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '{': - NEXT(); - m = scannum(v); - if (EAT(',')) { - if (SEE(DIGIT)) - n = scannum(v); - else - n = INFINITY; - if (m > n) { - ERR(REG_BADBR); - return; - } - /* {m,n} exercises preference, even if it's {m,m} */ - qprefer = (v->nextvalue) ? LONGER : SHORTER; - } else { - n = m; - /* {m} passes operand's preference through */ - qprefer = 0; - } - if (!SEE('}')) { /* catches errors too */ - ERR(REG_BADBR); - return; - } - NEXT(); - break; - default: /* no quantifier */ - m = n = 1; - qprefer = 0; - break; - } - - /* annoying special case: {0} or {0,0} cancels everything */ - if (m == 0 && n == 0) { - if (atom != NULL) - freesubre(v, atom); - if (atomtype == '(') - v->subs[subno] = NULL; - delsub(v->nfa, lp, rp); - EMPTYARC(lp, rp); - return; - } - - /* if not a messy case, avoid hard part */ - assert(!MESSY(top->flags)); - f = top->flags | qprefer | ((atom != NULL) ? atom->flags : 0); - if (atomtype != '(' && atomtype != BACKREF && !MESSY(UP(f))) { - if (!(m == 1 && n == 1)) - repeat(v, lp, rp, m, n); - if (atom != NULL) - freesubre(v, atom); - top->flags = f; - return; - } - - /* - * hard part: something messy - * That is, capturing parens, back reference, short/long clash, or - * an atom with substructure containing one of those. - */ - - /* now we'll need a subre for the contents even if they're boring */ - if (atom == NULL) { - atom = subre(v, '=', 0, lp, rp); - NOERR(); - } - - /* - * prepare a general-purpose state skeleton - * - * ---> [s] ---prefix---> [begin] ---atom---> [end] ----rest---> [rp] - * / / - * [lp] ----> [s2] ----bypass--------------------- - * - * where bypass is an empty, and prefix is some repetitions of atom - */ - s = newstate(v->nfa); /* first, new endpoints for the atom */ - s2 = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s2); - NOERR(); - atom->begin = s; - atom->end = s2; - s = newstate(v->nfa); /* and spots for prefix and bypass */ - s2 = newstate(v->nfa); - NOERR(); - EMPTYARC(lp, s); - EMPTYARC(lp, s2); - NOERR(); - - /* break remaining subRE into x{...} and what follows */ - t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp); - t->left = atom; - atomp = &t->left; - /* here we should recurse... but we must postpone that to the end */ - - /* split top into prefix and remaining */ - assert(top->op == '=' && top->left == NULL && top->right == NULL); - top->left = subre(v, '=', top->flags, top->begin, lp); - top->op = '.'; - top->right = t; - - /* if it's a backref, now is the time to replicate the subNFA */ - if (atomtype == BACKREF) { - assert(atom->begin->nouts == 1); /* just the EMPTY */ - delsub(v->nfa, atom->begin, atom->end); - assert(v->subs[subno] != NULL); - /* and here's why the recursion got postponed: it must */ - /* wait until the skeleton is filled in, because it may */ - /* hit a backref that wants to copy the filled-in skeleton */ - dupnfa(v->nfa, v->subs[subno]->begin, v->subs[subno]->end, - atom->begin, atom->end); - NOERR(); - } - - /* it's quantifier time; first, turn x{0,...} into x{1,...}|empty */ - if (m == 0) { - EMPTYARC(s2, atom->end); /* the bypass */ - assert(PREF(qprefer) != 0); - f = COMBINE(qprefer, atom->flags); - t = subre(v, '|', f, lp, atom->end); - NOERR(); - t->left = atom; - t->right = subre(v, '|', PREF(f), s2, atom->end); - NOERR(); - t->right->left = subre(v, '=', 0, s2, atom->end); - NOERR(); - *atomp = t; - atomp = &t->left; - m = 1; - } - - /* deal with the rest of the quantifier */ - if (atomtype == BACKREF) { - /* special case: backrefs have internal quantifiers */ - EMPTYARC(s, atom->begin); /* empty prefix */ - /* just stuff everything into atom */ - repeat(v, atom->begin, atom->end, m, n); - atom->min = (short)m; - atom->max = (short)n; - atom->flags |= COMBINE(qprefer, atom->flags); - } else if (m == 1 && n == 1) { - /* no/vacuous quantifier: done */ - EMPTYARC(s, atom->begin); /* empty prefix */ - } else { - /* turn x{m,n} into x{m-1,n-1}x, with capturing */ - /* parens in only second x */ - dupnfa(v->nfa, atom->begin, atom->end, s, atom->begin); - assert(m >= 1 && m != INFINITY && n >= 1); - repeat(v, s, atom->begin, m-1, (n == INFINITY) ? n : n-1); - f = COMBINE(qprefer, atom->flags); - t = subre(v, '.', f, s, atom->end); /* prefix and atom */ - NOERR(); - t->left = subre(v, '=', PREF(f), s, atom->begin); - NOERR(); - t->right = atom; - *atomp = t; - } - - /* and finally, look after that postponed recursion */ - t = top->right; - if (!(SEE('|') || SEE(stopper) || SEE(EOS))) - t->right = parsebranch(v, stopper, type, atom->end, rp, 1); - else { - EMPTYARC(atom->end, rp); - t->right = subre(v, '=', 0, atom->end, rp); - } - assert(SEE('|') || SEE(stopper) || SEE(EOS)); - t->flags |= COMBINE(t->flags, t->right->flags); - top->flags |= COMBINE(top->flags, t->flags); -} - -/* - - nonword - generate arcs for non-word-character ahead or behind - ^ static VOID nonword(struct vars *, int, struct state *, struct state *); - */ -static VOID -nonword(v, dir, lp, rp) -struct vars *v; -int dir; /* AHEAD or BEHIND */ -struct state *lp; -struct state *rp; -{ - int anchor = (dir == AHEAD) ? '$' : '^'; - - assert(dir == AHEAD || dir == BEHIND); - newarc(v->nfa, anchor, 1, lp, rp); - newarc(v->nfa, anchor, 0, lp, rp); - colorcomplement(v->nfa, v->cm, dir, v->wordchrs, lp, rp); - /* (no need for special attention to \n) */ -} - -/* - - word - generate arcs for word character ahead or behind - ^ static VOID word(struct vars *, int, struct state *, struct state *); - */ -static VOID -word(v, dir, lp, rp) -struct vars *v; -int dir; /* AHEAD or BEHIND */ -struct state *lp; -struct state *rp; -{ - assert(dir == AHEAD || dir == BEHIND); - cloneouts(v->nfa, v->wordchrs, lp, rp, dir); - /* (no need for special attention to \n) */ -} - -/* - - scannum - scan a number - ^ static int scannum(struct vars *); - */ -static int /* value, <= DUPMAX */ -scannum(v) -struct vars *v; -{ - int n = 0; - - while (SEE(DIGIT) && n < DUPMAX) { - n = n*10 + v->nextvalue; - NEXT(); - } - if (SEE(DIGIT) || n > DUPMAX) { - ERR(REG_BADBR); - return 0; - } - return n; -} - -/* - - repeat - replicate subNFA for quantifiers - * The duplication sequences used here are chosen carefully so that any - * pointers starting out pointing into the subexpression end up pointing into - * the last occurrence. (Note that it may not be strung between the same - * left and right end states, however!) This used to be important for the - * subRE tree, although the important bits are now handled by the in-line - * code in parse(), and when this is called, it doesn't matter any more. - ^ static VOID repeat(struct vars *, struct state *, struct state *, int, int); - */ -static VOID -repeat(v, lp, rp, m, n) -struct vars *v; -struct state *lp; -struct state *rp; -int m; -int n; -{ -# define SOME 2 -# define INF 3 -# define PAIR(x, y) ((x)*4 + (y)) -# define REDUCE(x) ( ((x) == INFINITY) ? INF : (((x) > 1) ? SOME : (x)) ) - CONST int rm = REDUCE(m); - CONST int rn = REDUCE(n); - struct state *s; - struct state *s2; - - switch (PAIR(rm, rn)) { - case PAIR(0, 0): /* empty string */ - delsub(v->nfa, lp, rp); - EMPTYARC(lp, rp); - break; - case PAIR(0, 1): /* do as x| */ - EMPTYARC(lp, rp); - break; - case PAIR(0, SOME): /* do as x{1,n}| */ - repeat(v, lp, rp, 1, n); - NOERR(); - EMPTYARC(lp, rp); - break; - case PAIR(0, INF): /* loop x around */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s); - EMPTYARC(lp, s); - EMPTYARC(s, rp); - break; - case PAIR(1, 1): /* no action required */ - break; - case PAIR(1, SOME): /* do as x{0,n-1}x = (x{1,n-1}|)x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, 1, n-1); - NOERR(); - EMPTYARC(lp, s); - break; - case PAIR(1, INF): /* add loopback arc */ - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s2); - EMPTYARC(lp, s); - EMPTYARC(s2, rp); - EMPTYARC(s2, s); - break; - case PAIR(SOME, SOME): /* do as x{m-1,n-1}x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, m-1, n-1); - break; - case PAIR(SOME, INF): /* do as x{m-1,}x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, m-1, n); - break; - default: - ERR(REG_ASSERT); - break; - } -} - -/* - - bracket - handle non-complemented bracket expression - * Also called from cbracket for complemented bracket expressions. - ^ static VOID bracket(struct vars *, struct state *, struct state *); - */ -static VOID -bracket(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - assert(SEE('[')); - NEXT(); - while (!SEE(']') && !SEE(EOS)) - brackpart(v, lp, rp); - assert(SEE(']') || ISERR()); - okcolors(v->nfa, v->cm); -} - -/* - - cbracket - handle complemented bracket expression - * We do it by calling bracket() with dummy endpoints, and then complementing - * the result. The alternative would be to invoke rainbow(), and then delete - * arcs as the b.e. is seen... but that gets messy. - ^ static VOID cbracket(struct vars *, struct state *, struct state *); - */ -static VOID -cbracket(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - struct state *left = newstate(v->nfa); - struct state *right = newstate(v->nfa); - struct state *s; - struct arc *a; /* arc from lp */ - struct arc *ba; /* arc from left, from bracket() */ - struct arc *pa; /* MCCE-prototype arc */ - color co; - chr *p; - int i; - - NOERR(); - bracket(v, left, right); - if (v->cflags®_NLSTOP) - newarc(v->nfa, PLAIN, v->nlcolor, left, right); - NOERR(); - - assert(lp->nouts == 0); /* all outarcs will be ours */ - - /* easy part of complementing */ - colorcomplement(v->nfa, v->cm, PLAIN, left, lp, rp); - NOERR(); - if (v->mcces == NULL) { /* no MCCEs -- we're done */ - dropstate(v->nfa, left); - assert(right->nins == 0); - freestate(v->nfa, right); - return; - } - - /* but complementing gets messy in the presence of MCCEs... */ - NOTE(REG_ULOCALE); - for (p = v->mcces->chrs, i = v->mcces->nchrs; i > 0; p++, i--) { - co = GETCOLOR(v->cm, *p); - a = findarc(lp, PLAIN, co); - ba = findarc(left, PLAIN, co); - if (ba == NULL) { - assert(a != NULL); - freearc(v->nfa, a); - } else { - assert(a == NULL); - } - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - pa = findarc(v->mccepbegin, PLAIN, co); - assert(pa != NULL); - if (ba == NULL) { /* easy case, need all of them */ - cloneouts(v->nfa, pa->to, s, rp, PLAIN); - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, pa->to, s, rp); - } else { /* must be selective */ - if (findarc(ba->to, '$', 1) == NULL) { - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, pa->to, - s, rp); - } - for (pa = pa->to->outs; pa != NULL; pa = pa->outchain) - if (findarc(ba->to, PLAIN, pa->co) == NULL) - newarc(v->nfa, PLAIN, pa->co, s, rp); - if (s->nouts == 0) /* limit of selectivity: none */ - dropstate(v->nfa, s); /* frees arc too */ - } - NOERR(); - } - - delsub(v->nfa, left, right); - assert(left->nouts == 0); - freestate(v->nfa, left); - assert(right->nins == 0); - freestate(v->nfa, right); -} - -/* - - brackpart - handle one item (or range) within a bracket expression - ^ static VOID brackpart(struct vars *, struct state *, struct state *); - */ -static VOID -brackpart(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - celt startc; - celt endc; - struct cvec *cv; - chr *startp; - chr *endp; - chr c[1]; - - /* parse something, get rid of special cases, take shortcuts */ - switch (v->nexttype) { - case RANGE: /* a-b-c or other botch */ - ERR(REG_ERANGE); - return; - break; - case PLAIN: - c[0] = v->nextvalue; - NEXT(); - /* shortcut for ordinary chr (not range, not MCCE leader) */ - if (!SEE(RANGE) && !ISCELEADER(v, c[0])) { - onechr(v, c[0], lp, rp); - return; - } - startc = element(v, c, c+1); - NOERR(); - break; - case COLLEL: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - startc = element(v, startp, endp); - NOERR(); - break; - case ECLASS: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - startc = element(v, startp, endp); - NOERR(); - cv = eclass(v, startc, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); - return; - break; - case CCLASS: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECTYPE); - NOERR(); - cv = cclass(v, startp, endp, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); - return; - break; - default: - ERR(REG_ASSERT); - return; - break; - } - - if (SEE(RANGE)) { - NEXT(); - switch (v->nexttype) { - case PLAIN: - case RANGE: - c[0] = v->nextvalue; - NEXT(); - endc = element(v, c, c+1); - NOERR(); - break; - case COLLEL: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - endc = element(v, startp, endp); - NOERR(); - break; - default: - ERR(REG_ERANGE); - return; - break; - } - } else - endc = startc; - - /* - * Ranges are unportable. Actually, standard C does - * guarantee that digits are contiguous, but making - * that an exception is just too complicated. - */ - if (startc != endc) - NOTE(REG_UUNPORT); - cv = range(v, startc, endc, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); -} - -/* - - scanplain - scan PLAIN contents of [. etc. - * Certain bits of trickery in lex.c know that this code does not try - * to look past the final bracket of the [. etc. - ^ static chr *scanplain(struct vars *); - */ -static chr * /* just after end of sequence */ -scanplain(v) -struct vars *v; -{ - chr *endp; - - assert(SEE(COLLEL) || SEE(ECLASS) || SEE(CCLASS)); - NEXT(); - - endp = v->now; - while (SEE(PLAIN)) { - endp = v->now; - NEXT(); - } - - assert(SEE(END) || ISERR()); - NEXT(); - - return endp; -} - -/* - - leaders - process a cvec of collating elements to also include leaders - * Also gives all characters involved their own colors, which is almost - * certainly necessary, and sets up little disconnected subNFA. - ^ static VOID leaders(struct vars *, struct cvec *); - */ -static VOID -leaders(v, cv) -struct vars *v; -struct cvec *cv; -{ - int mcce; - chr *p; - chr leader; - struct state *s; - struct arc *a; - - v->mccepbegin = newstate(v->nfa); - v->mccepend = newstate(v->nfa); - NOERR(); - - for (mcce = 0; mcce < cv->nmcces; mcce++) { - p = cv->mcces[mcce]; - leader = *p; - if (!haschr(cv, leader)) { - addchr(cv, leader); - s = newstate(v->nfa); - newarc(v->nfa, PLAIN, subcolor(v->cm, leader), - v->mccepbegin, s); - okcolors(v->nfa, v->cm); - } else { - a = findarc(v->mccepbegin, PLAIN, - GETCOLOR(v->cm, leader)); - assert(a != NULL); - s = a->to; - assert(s != v->mccepend); - } - p++; - assert(*p != 0 && *(p+1) == 0); /* only 2-char MCCEs for now */ - newarc(v->nfa, PLAIN, subcolor(v->cm, *p), s, v->mccepend); - okcolors(v->nfa, v->cm); - } -} - -/* - - onechr - fill in arcs for a plain character, and possible case complements - * This is mostly a shortcut for efficient handling of the common case. - ^ static VOID onechr(struct vars *, pchr, struct state *, struct state *); - */ -static VOID -onechr(v, c, lp, rp) -struct vars *v; -pchr c; -struct state *lp; -struct state *rp; -{ - if (!(v->cflags®_ICASE)) { - newarc(v->nfa, PLAIN, subcolor(v->cm, c), lp, rp); - return; - } - - /* rats, need general case anyway... */ - dovec(v, allcases(v, c), lp, rp); -} - -/* - - dovec - fill in arcs for each element of a cvec - * This one has to handle the messy cases, like MCCEs and MCCE leaders. - ^ static VOID dovec(struct vars *, struct cvec *, struct state *, - ^ struct state *); - */ -static VOID -dovec(v, cv, lp, rp) -struct vars *v; -struct cvec *cv; -struct state *lp; -struct state *rp; -{ - chr ch, from, to; - celt ce; - chr *p; - int i; - color co; - struct cvec *leads; - struct arc *a; - struct arc *pa; /* arc in prototype */ - struct state *s; - struct state *ps; /* state in prototype */ - - /* need a place to store leaders, if any */ - if (nmcces(v) > 0) { - assert(v->mcces != NULL); - if (v->cv2 == NULL || v->cv2->nchrs < v->mcces->nchrs) { - if (v->cv2 != NULL) - free(v->cv2); - v->cv2 = newcvec(v->mcces->nchrs, 0, v->mcces->nmcces); - NOERR(); - leads = v->cv2; - } else - leads = clearcvec(v->cv2); - } else - leads = NULL; - - /* first, get the ordinary characters out of the way */ - for (p = cv->chrs, i = cv->nchrs; i > 0; p++, i--) { - ch = *p; - if (!ISCELEADER(v, ch)) - newarc(v->nfa, PLAIN, subcolor(v->cm, ch), lp, rp); - else { - assert(singleton(v->cm, ch)); - assert(leads != NULL); - if (!haschr(leads, ch)) - addchr(leads, ch); - } - } - - /* and the ranges */ - for (p = cv->ranges, i = cv->nranges; i > 0; p += 2, i--) { - from = *p; - to = *(p+1); - while (from <= to && (ce = nextleader(v, from, to)) != NOCELT) { - if (from < ce) - subrange(v, from, ce - 1, lp, rp); - assert(singleton(v->cm, ce)); - assert(leads != NULL); - if (!haschr(leads, ce)) - addchr(leads, ce); - from = ce + 1; - } - if (from <= to) - subrange(v, from, to, lp, rp); - } - - if ((leads == NULL || leads->nchrs == 0) && cv->nmcces == 0) - return; - - /* deal with the MCCE leaders */ - NOTE(REG_ULOCALE); - for (p = leads->chrs, i = leads->nchrs; i > 0; p++, i--) { - co = GETCOLOR(v->cm, *p); - a = findarc(lp, PLAIN, co); - if (a != NULL) - s = a->to; - else { - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - } - pa = findarc(v->mccepbegin, PLAIN, co); - assert(pa != NULL); - ps = pa->to; - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, ps, s, rp); - NOERR(); - } - - /* and the MCCEs */ - for (i = 0; i < cv->nmcces; i++) { - p = cv->mcces[i]; - assert(singleton(v->cm, *p)); - ch = *p++; - co = GETCOLOR(v->cm, ch); - a = findarc(lp, PLAIN, co); - if (a != NULL) - s = a->to; - else { - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - } - assert(*p != 0); /* at least two chars */ - assert(singleton(v->cm, *p)); - ch = *p++; - co = GETCOLOR(v->cm, ch); - assert(*p == 0); /* and only two, for now */ - newarc(v->nfa, PLAIN, co, s, rp); - NOERR(); - } -} - -/* - - nextleader - find next MCCE leader within range - ^ static celt nextleader(struct vars *, pchr, pchr); - */ -static celt /* NOCELT means none */ -nextleader(v, from, to) -struct vars *v; -pchr from; -pchr to; -{ - int i; - chr *p; - chr ch; - celt it = NOCELT; - - if (v->mcces == NULL) - return it; - - for (i = v->mcces->nchrs, p = v->mcces->chrs; i > 0; i--, p++) { - ch = *p; - if (from <= ch && ch <= to) - if (it == NOCELT || ch < it) - it = ch; - } - return it; -} - -/* - - wordchrs - set up word-chr list for word-boundary stuff, if needed - * The list is kept as a bunch of arcs between two dummy states; it's - * disposed of by the unreachable-states sweep in NFA optimization. - * Does NEXT(). Must not be called from any unusual lexical context. - * This should be reconciled with the \w etc. handling in lex.c, and - * should be cleaned up to reduce dependencies on input scanning. - ^ static VOID wordchrs(struct vars *); - */ -static VOID -wordchrs(v) -struct vars *v; -{ - struct state *left; - struct state *right; - - if (v->wordchrs != NULL) { - NEXT(); /* for consistency */ - return; - } - - left = newstate(v->nfa); - right = newstate(v->nfa); - NOERR(); - /* fine point: implemented with [::], and lexer will set REG_ULOCALE */ - lexword(v); - NEXT(); - assert(v->savenow != NULL && SEE('[')); - bracket(v, left, right); - assert((v->savenow != NULL && SEE(']')) || ISERR()); - NEXT(); - NOERR(); - v->wordchrs = left; -} - -/* - - subre - allocate a subre - ^ static struct subre *subre(struct vars *, int, int, struct state *, - ^ struct state *); - */ -static struct subre * -subre(v, op, flags, begin, end) -struct vars *v; -int op; -int flags; -struct state *begin; -struct state *end; -{ - struct subre *ret; - - ret = v->treefree; - if (ret != NULL) - v->treefree = ret->left; - else { - ret = (struct subre *)MALLOC(sizeof(struct subre)); - if (ret == NULL) { - ERR(REG_ESPACE); - return NULL; - } - ret->chain = v->treechain; - v->treechain = ret; - } - - assert(strchr("|.b(=", op) != NULL); - - ret->op = op; - ret->flags = flags; - ret->retry = 0; - ret->subno = 0; - ret->min = ret->max = 1; - ret->left = NULL; - ret->right = NULL; - ret->begin = begin; - ret->end = end; - ZAPCNFA(ret->cnfa); - - return ret; -} - -/* - - freesubre - free a subRE subtree - ^ static VOID freesubre(struct vars *, struct subre *); - */ -static VOID -freesubre(v, sr) -struct vars *v; /* might be NULL */ -struct subre *sr; -{ - if (sr == NULL) - return; - - if (sr->left != NULL) - freesubre(v, sr->left); - if (sr->right != NULL) - freesubre(v, sr->right); - - freesrnode(v, sr); -} - -/* - - freesrnode - free one node in a subRE subtree - ^ static VOID freesrnode(struct vars *, struct subre *); - */ -static VOID -freesrnode(v, sr) -struct vars *v; /* might be NULL */ -struct subre *sr; -{ - if (sr == NULL) - return; - - if (!NULLCNFA(sr->cnfa)) - freecnfa(&sr->cnfa); - sr->flags = 0; - - if (v != NULL) { - sr->left = v->treefree; - v->treefree = sr; - } else - FREE(sr); -} - -/* - - optst - optimize a subRE subtree - ^ static VOID optst(struct vars *, struct subre *); - */ -static VOID -optst(v, t) -struct vars *v; -struct subre *t; -{ - if (t == NULL) - return; - - /* preference cleanup and analysis */ - if (t->flags&SHORTER) - v->usedshorter = 1; - - /* recurse through children */ - if (t->left != NULL) - optst(v, t->left); - if (t->right != NULL) - optst(v, t->right); -} - -/* - - numst - number tree nodes (assigning retry indexes) - ^ static int numst(struct subre *, int); - */ -static int /* next number */ -numst(t, start) -struct subre *t; -int start; /* starting point for subtree numbers */ -{ - int i; - - assert(t != NULL); - - i = start; - t->retry = (short)i++; - if (t->left != NULL) - i = numst(t->left, i); - if (t->right != NULL) - i = numst(t->right, i); - return i; -} - -/* - - markst - mark tree nodes as INUSE - ^ static VOID markst(struct subre *); - */ -static VOID -markst(t) -struct subre *t; -{ - assert(t != NULL); - - t->flags |= INUSE; - if (t->left != NULL) - markst(t->left); - if (t->right != NULL) - markst(t->right); -} - -/* - - cleanst - free any tree nodes not marked INUSE - ^ static VOID cleanst(struct vars *); - */ -static VOID -cleanst(v) -struct vars *v; -{ - struct subre *t; - struct subre *next; - - for (t = v->treechain; t != NULL; t = next) { - next = t->chain; - if (!(t->flags&INUSE)) - FREE(t); - } - v->treechain = NULL; - v->treefree = NULL; /* just on general principles */ -} - -/* - - nfatree - turn a subRE subtree into a tree of compacted NFAs - ^ static int nfatree(struct vars *, struct subre *, FILE *); - */ -static int /* optimize results from top node */ -nfatree(v, t, f) -struct vars *v; -struct subre *t; -FILE *f; /* for debug output */ -{ - assert(t != NULL && t->begin != NULL); - - if (t->left != NULL) - (DISCARD)nfatree(v, t->left, f); - if (t->right != NULL) - (DISCARD)nfatree(v, t->right, f); - - return nfanode(v, t, f); -} - -/* - - nfanode - do one NFA for nfatree - ^ static int nfanode(struct vars *, struct subre *, FILE *); - */ -static int /* optimize results */ -nfanode(v, t, f) -struct vars *v; -struct subre *t; -FILE *f; /* for debug output */ -{ - struct nfa *nfa; - int ret = 0; - - assert(t->begin != NULL); - - nfa = newnfa(v, v->cm, v->nfa); - NOERRZ(); - dupnfa(nfa, t->begin, t->end, nfa->init, nfa->final); - if (!ISERR()) { - specialcolors(nfa); - ret = optimize(nfa, f); - } - if (!ISERR()) - compact(nfa, &t->cnfa); - - freenfa(nfa); - return ret; -} - -/* - - newlacon - allocate a lookahead-constraint subRE - ^ static int newlacon(struct vars *, struct state *, struct state *, int); - */ -static int /* lacon number */ -newlacon(v, begin, end, pos) -struct vars *v; -struct state *begin; -struct state *end; -int pos; -{ - int n; - struct subre *sub; - - if (v->nlacons == 0) { - v->lacons = (struct subre *)MALLOC(2 * sizeof(struct subre)); - n = 1; /* skip 0th */ - v->nlacons = 2; - } else { - v->lacons = (struct subre *)REALLOC(v->lacons, - (v->nlacons+1)*sizeof(struct subre)); - n = v->nlacons++; - } - if (v->lacons == NULL) { - ERR(REG_ESPACE); - return 0; - } - sub = &v->lacons[n]; - sub->begin = begin; - sub->end = end; - sub->subno = pos; - ZAPCNFA(sub->cnfa); - return n; -} - -/* - - freelacons - free lookahead-constraint subRE vector - ^ static VOID freelacons(struct subre *, int); - */ -static VOID -freelacons(subs, n) -struct subre *subs; -int n; -{ - struct subre *sub; - int i; - - assert(n > 0); - for (sub = subs + 1, i = n - 1; i > 0; sub++, i--) /* no 0th */ - if (!NULLCNFA(sub->cnfa)) - freecnfa(&sub->cnfa); - FREE(subs); -} - -/* - - rfree - free a whole RE (insides of regfree) - ^ static VOID rfree(regex_t *); - */ -static VOID -rfree(re) -regex_t *re; -{ - struct guts *g; - - if (re == NULL || re->re_magic != REMAGIC) - return; - - re->re_magic = 0; /* invalidate RE */ - g = (struct guts *)re->re_guts; - re->re_guts = NULL; - re->re_fns = NULL; - g->magic = 0; - freecm(&g->cmap); - if (g->tree != NULL) - freesubre((struct vars *)NULL, g->tree); - if (g->lacons != NULL) - freelacons(g->lacons, g->nlacons); - if (!NULLCNFA(g->search)) - freecnfa(&g->search); - FREE(g); -} - -/* - - dump - dump an RE in human-readable form - ^ static VOID dump(regex_t *, FILE *); - */ -static VOID -dump(re, f) -regex_t *re; -FILE *f; -{ -#ifdef REG_DEBUG - struct guts *g; - int i; - - if (re->re_magic != REMAGIC) - fprintf(f, "bad magic number (0x%x not 0x%x)\n", re->re_magic, - REMAGIC); - if (re->re_guts == NULL) { - fprintf(f, "NULL guts!!!\n"); - return; - } - g = (struct guts *)re->re_guts; - if (g->magic != GUTSMAGIC) - fprintf(f, "bad guts magic number (0x%x not 0x%x)\n", g->magic, - GUTSMAGIC); - - fprintf(f, "nsub %d, info 0%o, csize %d, ntree %d, usedshort %d\n", - re->re_nsub, re->re_info, re->re_csize, g->ntree, - g->usedshorter); - - dumpcolors(&g->cmap, f); - if (!NULLCNFA(g->search)) { - printf("search:\n"); - dumpcnfa(&g->search, f); - } - for (i = 1; i < g->nlacons; i++) { - fprintf(f, "la%d (%s):\n", i, - (g->lacons[i].subno) ? "positive" : "negative"); - dumpcnfa(&g->lacons[i].cnfa, f); - } - dumpst(g->tree, f, 0); -#endif -} - -/* - - dumpst - dump a subRE tree - ^ static VOID dumpst(struct subre *, FILE *, int); - */ -static VOID -dumpst(t, f, nfapresent) -struct subre *t; -FILE *f; -int nfapresent; /* is the original NFA still around? */ -{ - if (t == NULL) - fprintf(f, "null tree\n"); - else - stdump(t, f, nfapresent, 0); - fflush(f); -} - -/* - - stdump - recursive guts of dumpst - ^ static VOID stdump(struct subre *, FILE *, int, int); - */ -static VOID -stdump(t, f, nfapresent, level) -struct subre *t; -FILE *f; -int nfapresent; /* is the original NFA still around? */ -int level; -{ - int i; -# define RTSEP " " - - for (i = 0; i < level; i++) - fprintf(f, RTSEP); - fprintf(f, "%c (", t->op); - if (t->flags&LONGER) - fprintf(f, "L"); - if (t->flags&SHORTER) - fprintf(f, "S"); - if (t->flags&MIXED) - fprintf(f, "M"); - if (t->flags&CAP) - fprintf(f, "c"); - if (t->flags&BACKR) - fprintf(f, "b"); - if (!(t->flags&INUSE)) - fprintf(f, "!u"); - fprintf(f, ") r%d", t->retry); - if (t->subno != 0) - fprintf(f, " #%d", t->subno); - if (t->min != 1 || t->max != 1) { - fprintf(f, "{%d,", t->min); - if (t->max != INFINITY) - fprintf(f, "%d", t->max); - fprintf(f, "}"); - } - if (nfapresent) - fprintf(f, " %ld-%ld", (long)t->begin->no, (long)t->end->no); - if (!NULLCNFA(t->cnfa)) - fprintf(f, ":"); - fprintf(f, "\n"); - if (t->left != NULL) - stdump(t->left, f, nfapresent, level+1); - if (!NULLCNFA(t->cnfa)) - dumpcnfa(&t->cnfa, f); - if (t->right != NULL) - stdump(t->right, f, nfapresent, level+1); -} - -#include "regc_lex.c" -#include "regc_color.c" -#include "regc_nfa.c" -#include "regc_cvec.c" -#include "regc_locale.c" diff --git a/generic/regcustom.h b/generic/regcustom.h deleted file mode 100644 index b1d53a9..0000000 --- a/generic/regcustom.h +++ /dev/null @@ -1,85 +0,0 @@ -/* headers (which also pick up the standard ones, or equivalents) */ -#include "tclInt.h" - -/* overrides for regguts.h definitions */ -/* function-pointer declarations */ -#define FUNCPTR(name, args) (*name) _ANSI_ARGS_(args) -#define MALLOC(n) ckalloc(n) -#define FREE(p) ckfree(VS(p)) -#define REALLOC(p,n) ckrealloc(VS(p),n) - - - -/* - * Do not insert extras between the "begin" and "end" lines -- this - * chunk is automatically extracted to be fitted into regex.h. - */ -/* --- begin --- */ -/* ensure certain things don't sneak in from system headers */ -#ifdef __REG_WIDE_T -#undef __REG_WIDE_T -#endif -#ifdef __REG_WIDE_COMPILE -#undef __REG_WIDE_COMPILE -#endif -#ifdef __REG_WIDE_EXEC -#undef __REG_WIDE_EXEC -#endif -#ifdef __REG_REGOFF_T -#undef __REG_REGOFF_T -#endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif -/* interface types */ -#define __REG_WIDE_T Tcl_UniChar -#define __REG_REGOFF_T long /* not really right, but good enough... */ -#define __REG_VOID_T VOID -#define __REG_CONST CONST -/* names and declarations */ -#define __REG_WIDE_COMPILE TclReComp -#define __REG_WIDE_EXEC TclReExec -#ifndef __REG_NOFRONT -#define __REG_NOFRONT /* don't want regcomp() and regexec() */ -#endif -#ifndef __REG_NOCHAR -#define __REG_NOCHAR /* or the char versions */ -#endif -#define regfree TclReFree -#define regerror TclReError -/* --- end --- */ - - - -/* internal character type and related */ -typedef Tcl_UniChar chr; /* the type itself */ -typedef int pchr; /* what it promotes to */ -typedef unsigned uchr; /* unsigned type that will hold a chr */ -typedef int celt; /* type to hold chr, MCCE number, or NOCELT */ -#define NOCELT (-1) /* celt value which is not valid chr or MCCE */ -#define CHR(c) (UCHAR(c)) /* turn char literal into chr literal */ -#define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */ -#define CHRBITS 16 /* bits in a chr; must not use sizeof */ -#define CHR_MIN 0x0000 /* smallest and largest chr; the value */ -#define CHR_MAX 0xffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ - -/* functions operating on chr */ -#define iscalnum(x) Tcl_UniCharIsAlnum(x) -#define iscalpha(x) Tcl_UniCharIsAlpha(x) -#define iscdigit(x) Tcl_UniCharIsDigit(x) -#define iscspace(x) Tcl_UniCharIsSpace(x) - -/* name the external functions */ -#define compile TclReComp -#define exec TclReExec - -/* enable/disable debugging code (by whether REG_DEBUG is defined or not) */ -#ifdef notdef -#define REG_DEBUG /* */ -#endif - -/* and pick up the standard header */ -#include "regex.h" diff --git a/generic/rege_dfa.c b/generic/rege_dfa.c deleted file mode 100644 index eb31ffc6..0000000 --- a/generic/rege_dfa.c +++ /dev/null @@ -1,627 +0,0 @@ -/* - * DFA routines - * This file is #included by regexec.c. - */ - -/* - - longest - longest-preferred matching engine - ^ static chr *longest(struct vars *, struct dfa *, chr *, chr *); - */ -static chr * /* endpoint, or NULL */ -longest(v, d, start, stop) -struct vars *v; /* used only for debug and exec flags */ -struct dfa *d; -chr *start; /* where the match should start */ -chr *stop; /* match must end at or before here */ -{ - chr *cp; - chr *realstop = (stop == v->stop) ? stop : stop + 1; - color co; - struct sset *css; - struct sset *ss; - chr *post; - int i; - struct colormap *cm = d->cm; - - /* initialize */ - css = initialize(v, d, start); - cp = start; - - /* startup */ - FDEBUG(("+++ startup +++\n")); - if (cp == v->start) { - co = d->cnfa->bos[(v->eflags®_NOTBOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - } else { - co = GETCOLOR(cm, *(cp - 1)); - FDEBUG(("char %c, color %ld\n", (char)*(cp-1), (long)co)); - } - css = miss(v, d, css, co, cp, start); - if (css == NULL) - return NULL; - css->lastseen = cp; - - /* main loop */ - if (v->eflags®_FTRACE) - while (cp < realstop) { - FDEBUG(("+++ at c%d +++\n", css - d->ssets)); - co = GETCOLOR(cm, *cp); - FDEBUG(("char %c, color %ld\n", (char)*cp, (long)co)); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - } - else - while (cp < realstop) { - co = GETCOLOR(cm, *cp); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - } - - /* shutdown */ - FDEBUG(("+++ shutdown at c%d +++\n", css - d->ssets)); - if (cp == v->stop && stop == v->stop) { - co = d->cnfa->eos[(v->eflags®_NOTEOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - ss = miss(v, d, css, co, cp, start); - /* special case: match ended at eol? */ - if (ss != NULL && (ss->flags&POSTSTATE)) - return cp; - else if (ss != NULL) - ss->lastseen = cp; /* to be tidy */ - } - - /* find last match, if any */ - post = d->lastpost; - for (ss = d->ssets, i = 0; i < d->nssused; ss++, i++) - if ((ss->flags&POSTSTATE) && post != ss->lastseen && - (post == NULL || post < ss->lastseen)) - post = ss->lastseen; - if (post != NULL) /* found one */ - return post - 1; - - return NULL; -} - -/* - - shortest - shortest-preferred matching engine - ^ static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *, - ^ chr **); - */ -static chr * /* endpoint, or NULL */ -shortest(v, d, start, min, max, coldp) -struct vars *v; /* used only for debug and exec flags */ -struct dfa *d; -chr *start; /* where the match should start */ -chr *min; /* match must end at or after here */ -chr *max; /* match must end at or before here */ -chr **coldp; /* store coldstart pointer here, if nonNULL */ -{ - chr *cp; - chr *realmin = (min == v->stop) ? min : min + 1; - chr *realmax = (max == v->stop) ? max : max + 1; - color co; - struct sset *css; - struct sset *ss; - struct colormap *cm = d->cm; - chr *nopr; - int i; - - /* initialize */ - css = initialize(v, d, start); - cp = start; - - /* startup */ - FDEBUG(("--- startup ---\n")); - if (cp == v->start) { - co = d->cnfa->bos[(v->eflags®_NOTBOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - } else { - co = GETCOLOR(cm, *(cp - 1)); - FDEBUG(("char %c, color %ld\n", (char)*(cp-1), (long)co)); - } - css = miss(v, d, css, co, cp, start); - if (css == NULL) - return NULL; - css->lastseen = cp; - ss = css; - - /* main loop */ - if (v->eflags®_FTRACE) - while (cp < realmax) { - FDEBUG(("--- at c%d ---\n", css - d->ssets)); - co = GETCOLOR(cm, *cp); - FDEBUG(("char %c, color %ld\n", (char)*cp, (long)co)); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - if ((ss->flags&POSTSTATE) && cp >= realmin) - break; /* NOTE BREAK OUT */ - } - else - while (cp < realmax) { - co = GETCOLOR(cm, *cp); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - if ((ss->flags&POSTSTATE) && cp >= realmin) - break; /* NOTE BREAK OUT */ - } - - if (ss == NULL) - return NULL; - else if (ss->flags&POSTSTATE) { - assert(cp >= realmin); - cp--; - } else if (cp == v->stop && max == v->stop) { - co = d->cnfa->eos[(v->eflags®_NOTEOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - ss = miss(v, d, css, co, cp, start); - /* match might have ended at eol */ - } - - if (ss == NULL || !(ss->flags&POSTSTATE)) - return NULL; - - /* find last no-progress state set, if any */ - nopr = d->lastnopr; - for (ss = d->ssets, i = 0; i < d->nssused; ss++, i++) - if ((ss->flags&NOPROGRESS) && nopr != ss->lastseen && - (nopr == NULL || nopr < ss->lastseen)) - nopr = ss->lastseen; - assert(nopr != NULL); - if (coldp != NULL) - *coldp = (nopr == v->start) ? nopr : nopr-1; - return cp; -} - -/* - - newdfa - set up a fresh DFA - ^ static struct dfa *newdfa(struct vars *, struct cnfa *, - ^ struct colormap *, struct smalldfa *); - */ -static struct dfa * -newdfa(v, cnfa, cm, small) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -struct smalldfa *small; /* preallocated space, may be NULL */ -{ - struct dfa *d; - size_t nss = cnfa->nstates * 2; - int wordsper = (cnfa->nstates + UBITS - 1) / UBITS; - struct smalldfa *smallwas = small; - - assert(cnfa != NULL && cnfa->nstates != 0); - - if (nss <= FEWSTATES && cnfa->ncolors <= FEWCOLORS) { - assert(wordsper == 1); - if (small == NULL) { - small = (struct smalldfa *)MALLOC( - sizeof(struct smalldfa)); - if (small == NULL) { - ERR(REG_ESPACE); - return NULL; - } - } - d = &small->dfa; - d->ssets = small->ssets; - d->statesarea = small->statesarea; - d->work = &d->statesarea[nss]; - d->outsarea = small->outsarea; - d->incarea = small->incarea; - d->cptsmalloced = 0; - d->mallocarea = (smallwas == NULL) ? (char *)small : NULL; - } else { - d = (struct dfa *)MALLOC(sizeof(struct dfa)); - if (d == NULL) { - ERR(REG_ESPACE); - return NULL; - } - d->ssets = (struct sset *)MALLOC(nss * sizeof(struct sset)); - d->statesarea = (unsigned *)MALLOC((nss+WORK) * wordsper * - sizeof(unsigned)); - d->work = &d->statesarea[nss * wordsper]; - d->outsarea = (struct sset **)MALLOC(nss * cnfa->ncolors * - sizeof(struct sset *)); - d->incarea = (struct arcp *)MALLOC(nss * cnfa->ncolors * - sizeof(struct arcp)); - d->cptsmalloced = 1; - d->mallocarea = (char *)d; - if (d->ssets == NULL || d->statesarea == NULL || - d->outsarea == NULL || d->incarea == NULL) { - freedfa(d); - ERR(REG_ESPACE); - return NULL; - } - } - - d->nssets = (v->eflags®_SMALL) ? 7 : nss; - d->nssused = 0; - d->nstates = cnfa->nstates; - d->ncolors = cnfa->ncolors; - d->wordsper = wordsper; - d->cnfa = cnfa; - d->cm = cm; - d->lastpost = NULL; - d->lastnopr = NULL; - d->search = d->ssets; - - /* initialization of sset fields is done as needed */ - - return d; -} - -/* - - freedfa - free a DFA - ^ static VOID freedfa(struct dfa *); - */ -static VOID -freedfa(d) -struct dfa *d; -{ - if (d->cptsmalloced) { - if (d->ssets != NULL) - FREE(d->ssets); - if (d->statesarea != NULL) - FREE(d->statesarea); - if (d->outsarea != NULL) - FREE(d->outsarea); - if (d->incarea != NULL) - FREE(d->incarea); - } - - if (d->mallocarea != NULL) - FREE(d->mallocarea); -} - -/* - - hash - construct a hash code for a bitvector - * There are probably better ways, but they're more expensive. - ^ static unsigned hash(unsigned *, int); - */ -static unsigned -hash(uv, n) -unsigned *uv; -int n; -{ - int i; - unsigned h; - - h = 0; - for (i = 0; i < n; i++) - h ^= uv[i]; - return h; -} - -/* - - initialize - hand-craft a cache entry for startup, otherwise get ready - ^ static struct sset *initialize(struct vars *, struct dfa *, chr *); - */ -static struct sset * -initialize(v, d, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *start; -{ - struct sset *ss; - int i; - - /* is previous one still there? */ - if (d->nssused > 0 && (d->ssets[0].flags&STARTER)) - ss = &d->ssets[0]; - else { /* no, must (re)build it */ - ss = getvacant(v, d, start, start); - for (i = 0; i < d->wordsper; i++) - ss->states[i] = 0; - BSET(ss->states, d->cnfa->pre); - ss->hash = HASH(ss->states, d->wordsper); - assert(d->cnfa->pre != d->cnfa->post); - ss->flags = STARTER|LOCKED|NOPROGRESS; - /* lastseen dealt with below */ - } - - for (i = 0; i < d->nssused; i++) - d->ssets[i].lastseen = NULL; - ss->lastseen = start; /* maybe untrue, but harmless */ - d->lastpost = NULL; - d->lastnopr = NULL; - return ss; -} - -/* - - miss - handle a cache miss - ^ static struct sset *miss(struct vars *, struct dfa *, struct sset *, - ^ pcolor, chr *, chr *); - */ -static struct sset * /* NULL if goes to empty set */ -miss(v, d, css, co, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -struct sset *css; -pcolor co; -chr *cp; /* next chr */ -chr *start; /* where the attempt got started */ -{ - struct cnfa *cnfa = d->cnfa; - int i; - unsigned h; - struct carc *ca; - struct sset *p; - int ispost; - int noprogress; - int gotstate; - int dolacons; - int didlacons; - - /* for convenience, we can be called even if it might not be a miss */ - if (css->outs[co] != NULL) { - FDEBUG(("hit\n")); - return css->outs[co]; - } - FDEBUG(("miss\n")); - - /* first, what set of states would we end up in? */ - for (i = 0; i < d->wordsper; i++) - d->work[i] = 0; - ispost = 0; - noprogress = 1; - gotstate = 0; - for (i = 0; i < d->nstates; i++) - if (ISBSET(css->states, i)) - for (ca = cnfa->states[i]+1; ca->co != COLORLESS; ca++) - if (ca->co == co) { - BSET(d->work, ca->to); - gotstate = 1; - if (ca->to == cnfa->post) - ispost = 1; - if (!cnfa->states[ca->to]->co) - noprogress = 0; - FDEBUG(("%d -> %d\n", i, ca->to)); - } - dolacons = (gotstate) ? (cnfa->flags&HASLACONS) : 0; - didlacons = 0; - while (dolacons) { /* transitive closure */ - dolacons = 0; - for (i = 0; i < d->nstates; i++) - if (ISBSET(d->work, i)) - for (ca = cnfa->states[i]+1; ca->co != COLORLESS; - ca++) - if (ca->co > cnfa->ncolors && - !ISBSET(d->work, ca->to) && - lacon(v, cnfa, cp, - ca->co)) { - BSET(d->work, ca->to); - dolacons = 1; - didlacons = 1; - if (ca->to == cnfa->post) - ispost = 1; - if (!cnfa->states[ca->to]->co) - noprogress = 0; - FDEBUG(("%d :> %d\n",i,ca->to)); - } - } - if (!gotstate) - return NULL; - h = HASH(d->work, d->wordsper); - - /* next, is that in the cache? */ - for (p = d->ssets, i = d->nssused; i > 0; p++, i--) - if (HIT(h, d->work, p, d->wordsper)) { -#ifndef xxx -p->hash == h && -memcmp(VS(d->work), VS(p->states), - d->wordsper*sizeof(unsigned)) == 0) { -#endif - FDEBUG(("cached c%d\n", p - d->ssets)); - break; /* NOTE BREAK OUT */ - } - if (i == 0) { /* nope, need a new cache entry */ - p = getvacant(v, d, cp, start); - assert(p != css); - for (i = 0; i < d->wordsper; i++) - p->states[i] = d->work[i]; - p->hash = h; - p->flags = (ispost) ? POSTSTATE : 0; - if (noprogress) - p->flags |= NOPROGRESS; - /* lastseen to be dealt with by caller */ - } - - if (!didlacons) { /* lookahead conds. always cache miss */ - css->outs[co] = p; - css->inchain[co] = p->ins; - p->ins.ss = css; - p->ins.co = (color)co; - } - return p; -} - -/* - - lacon - lookahead-constraint checker for miss() - ^ static int lacon(struct vars *, struct cnfa *, chr *, pcolor); - */ -static int /* predicate: constraint satisfied? */ -lacon(v, pcnfa, cp, co) -struct vars *v; -struct cnfa *pcnfa; /* parent cnfa */ -chr *cp; -pcolor co; /* "color" of the lookahead constraint */ -{ - int n; - struct subre *sub; - struct dfa *d; - struct smalldfa sd; - chr *end; - - n = co - pcnfa->ncolors; - assert(n < v->g->nlacons && v->g->lacons != NULL); - FDEBUG(("=== testing lacon %d\n", n)); - sub = &v->g->lacons[n]; - d = newdfa(v, &sub->cnfa, &v->g->cmap, &sd); - if (d == NULL) { - ERR(REG_ESPACE); - return 0; - } - end = longest(v, d, cp, v->stop); - freedfa(d); - FDEBUG(("=== lacon %d match %d\n", n, (end != NULL))); - return (sub->subno) ? (end != NULL) : (end == NULL); -} - -/* - - getvacant - get a vacant state set - * This routine clears out the inarcs and outarcs, but does not otherwise - * clear the innards of the state set -- that's up to the caller. - ^ static struct sset *getvacant(struct vars *, struct dfa *, chr *, chr *); - */ -static struct sset * -getvacant(v, d, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *cp; -chr *start; -{ - int i; - struct sset *ss; - struct sset *p; - struct arcp ap; - struct arcp lastap; - color co; - - ss = pickss(v, d, cp, start); - assert(!(ss->flags&LOCKED)); - - /* clear out its inarcs, including self-referential ones */ - ap = ss->ins; - while ((p = ap.ss) != NULL) { - co = ap.co; - FDEBUG(("zapping c%d's %ld outarc\n", p - d->ssets, (long)co)); - p->outs[co] = NULL; - ap = p->inchain[co]; - p->inchain[co].ss = NULL; /* paranoia */ - } - ss->ins.ss = NULL; - - /* take it off the inarc chains of the ssets reached by its outarcs */ - for (i = 0; i < d->ncolors; i++) { - p = ss->outs[i]; - assert(p != ss); /* not self-referential */ - if (p == NULL) - continue; /* NOTE CONTINUE */ - FDEBUG(("del outarc %d from c%d's in chn\n", i, p - d->ssets)); - if (p->ins.ss == ss && p->ins.co == i) - p->ins = ss->inchain[i]; - else { - assert(p->ins.ss != NULL); - for (ap = p->ins; ap.ss != NULL && - !(ap.ss == ss && ap.co == i); - ap = ap.ss->inchain[ap.co]) - lastap = ap; - assert(ap.ss != NULL); - lastap.ss->inchain[lastap.co] = ss->inchain[i]; - } - ss->outs[i] = NULL; - ss->inchain[i].ss = NULL; - } - - /* if ss was a success state, may need to remember location */ - if ((ss->flags&POSTSTATE) && ss->lastseen != d->lastpost && - (d->lastpost == NULL || d->lastpost < ss->lastseen)) - d->lastpost = ss->lastseen; - - /* likewise for a no-progress state */ - if ((ss->flags&NOPROGRESS) && ss->lastseen != d->lastnopr && - (d->lastnopr == NULL || d->lastnopr < ss->lastseen)) - d->lastnopr = ss->lastseen; - - return ss; -} - -/* - - pickss - pick the next stateset to be used - ^ static struct sset *pickss(struct vars *, struct dfa *, chr *, chr *); - */ -static struct sset * -pickss(v, d, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *cp; -chr *start; -{ - int i; - struct sset *ss; - struct sset *end; - chr *ancient; - - /* shortcut for cases where cache isn't full */ - if (d->nssused < d->nssets) { - i = d->nssused; - d->nssused++; - ss = &d->ssets[i]; - FDEBUG(("new c%d\n", i)); - /* set up innards */ - ss->states = &d->statesarea[i * d->wordsper]; - ss->flags = 0; - ss->ins.ss = NULL; - ss->ins.co = WHITE; /* give it some value */ - ss->outs = &d->outsarea[i * d->ncolors]; - ss->inchain = &d->incarea[i * d->ncolors]; - for (i = 0; i < d->ncolors; i++) { - ss->outs[i] = NULL; - ss->inchain[i].ss = NULL; - } - return ss; - } - - /* look for oldest, or old enough anyway */ - if (cp - start > d->nssets*2/3) /* oldest 33% are expendable */ - ancient = cp - d->nssets*2/3; - else - ancient = start; - for (ss = d->search, end = &d->ssets[d->nssets]; ss < end; ss++) - if ((ss->lastseen == NULL || ss->lastseen < ancient) && - !(ss->flags&LOCKED)) { - d->search = ss + 1; - FDEBUG(("replacing c%d\n", ss - d->ssets)); - return ss; - } - for (ss = d->ssets, end = d->search; ss < end; ss++) - if ((ss->lastseen == NULL || ss->lastseen < ancient) && - !(ss->flags&LOCKED)) { - d->search = ss + 1; - FDEBUG(("replacing c%d\n", ss - d->ssets)); - return ss; - } - - /* nobody's old enough?!? -- something's really wrong */ - FDEBUG(("can't find victim to replace!\n")); - assert(NOTREACHED); - ERR(REG_ASSERT); - return d->ssets; -} diff --git a/generic/regerror.c b/generic/regerror.c deleted file mode 100644 index 6779e51..0000000 --- a/generic/regerror.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * regerror - error-code expansion - */ - -#include "regguts.h" - -/* unknown-error explanation */ -static char unk[] = "*** unknown regex error code 0x%x ***"; - -/* struct to map among codes, code names, and explanations */ -static struct rerr { - int code; - char *name; - char *explain; -} rerrs[] = { - /* the actual table is built from regex.h */ -# include "regerrs.h" - { -1, "", "oops" }, /* explanation special-cased in code */ -}; - -/* - - regerror - the interface to error numbers - */ -/* ARGSUSED */ -size_t /* actual space needed (including NUL) */ -regerror(errcode, preg, errbuf, errbuf_size) -int errcode; /* error code, or REG_ATOI or REG_ITOA */ -CONST regex_t *preg; /* associated regex_t (unused at present) */ -char *errbuf; /* result buffer (unless errbuf_size==0) */ -size_t errbuf_size; /* available space in errbuf, can be 0 */ -{ - struct rerr *r; - char *msg; - char convbuf[sizeof(unk)+50]; /* 50 = plenty for int */ - size_t len; - int icode; - - switch (errcode) { - case REG_ATOI: /* convert name to number */ - for (r = rerrs; r->code >= 0; r++) - if (strcmp(r->name, errbuf) == 0) - break; - sprintf(convbuf, "%d", r->code); /* -1 for unknown */ - msg = convbuf; - break; - case REG_ITOA: /* convert number to name */ - icode = atoi(errbuf); /* not our problem if this fails */ - for (r = rerrs; r->code >= 0; r++) - if (r->code == icode) - break; - if (r->code >= 0) - msg = r->name; - else { /* unknown; tell him the number */ - sprintf(convbuf, "REG_%u", (unsigned)icode); - msg = convbuf; - } - break; - default: /* a real, normal error code */ - for (r = rerrs; r->code >= 0; r++) - if (r->code == errcode) - break; - if (r->code >= 0) - msg = r->explain; - else { /* unknown; say so */ - sprintf(convbuf, unk, errcode); - msg = convbuf; - } - break; - } - - len = strlen(msg) + 1; /* space needed, including NUL */ - if (errbuf_size > 0) { - if (errbuf_size > len) - strcpy(errbuf, msg); - else { /* truncate to fit */ - strncpy(errbuf, msg, errbuf_size-1); - errbuf[errbuf_size-1] = '\0'; - } - } - - return len; -} diff --git a/generic/regerrs.h b/generic/regerrs.h deleted file mode 100644 index 1b6552c..0000000 --- a/generic/regerrs.h +++ /dev/null @@ -1,18 +0,0 @@ -{ REG_OKAY, "REG_OKAY", "no errors detected" }, -{ REG_NOMATCH, "REG_NOMATCH", "failed to match" }, -{ REG_BADPAT, "REG_BADPAT", "invalid regexp (reg version 0.2)" }, -{ REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element" }, -{ REG_ECTYPE, "REG_ECTYPE", "invalid character class" }, -{ REG_EESCAPE, "REG_EESCAPE", "invalid escape \\ sequence" }, -{ REG_ESUBREG, "REG_ESUBREG", "invalid backreference number" }, -{ REG_EBRACK, "REG_EBRACK", "brackets [] not balanced" }, -{ REG_EPAREN, "REG_EPAREN", "parentheses () not balanced" }, -{ REG_EBRACE, "REG_EBRACE", "braces {} not balanced" }, -{ REG_BADBR, "REG_BADBR", "invalid repetition count(s)" }, -{ REG_ERANGE, "REG_ERANGE", "invalid character range" }, -{ REG_ESPACE, "REG_ESPACE", "out of memory" }, -{ REG_BADRPT, "REG_BADRPT", "quantifier operand invalid" }, -{ REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug" }, -{ REG_INVARG, "REG_INVARG", "invalid argument to regex function" }, -{ REG_MIXED, "REG_MIXED", "character widths of regex and string differ" }, -{ REG_BADOPT, "REG_BADOPT", "invalid embedded option" }, diff --git a/generic/regex.h b/generic/regex.h deleted file mode 100644 index 2f3ebfa..0000000 --- a/generic/regex.h +++ /dev/null @@ -1,308 +0,0 @@ -#ifndef _REGEX_H_ -#define _REGEX_H_ /* never again */ -/* - * regular expressions - * - * Prototypes etc. marked with "^" within comments get gathered up (and - * possibly edited) by the regfwd program and inserted near the bottom of - * this file. - * - * We offer the option of declaring one wide-character version of the - * RE functions as well as the char versions. To do that, define - * __REG_WIDE_T to the type of wide characters (unfortunately, there - * is no consensus that wchar_t is suitable) and __REG_WIDE_COMPILE and - * __REG_WIDE_EXEC to the names to be used for the compile and execute - * functions (suggestion: re_Xcomp and re_Xexec, where X is a letter - * suggestive of the wide type, e.g. re_ucomp and re_uexec for Unicode). - * For cranky old compilers, it may be necessary to do something like: - * #define __REG_WIDE_COMPILE(a,b,c,d) re_Xcomp(a,b,c,d) - * #define __REG_WIDE_EXEC(a,b,c,d,e,f,g) re_Xexec(a,b,c,d,e,f,g) - * rather than just #defining the names as parameterless macros. - * - * For some specialized purposes, it may be desirable to suppress the - * declarations of the "front end" functions, regcomp() and regexec(), - * or of the char versions of the compile and execute functions. To - * suppress the front-end functions, define __REG_NOFRONT. To suppress - * the char versions, define __REG_NOCHAR. - * - * The right place to do those defines (and some others you may want, see - * below) would be . If you don't have control of that file, - * the right place to add your own defines to this file is marked below. - * This is normally done automatically, by the makefile and regmkhdr, based - * on the contents of regcustom.h. - */ - - - -/* - * voodoo for C++ - */ -#ifdef __cplusplus -extern "C" { -#endif - - - -/* - * Add your own defines, if needed, here. - */ - - - -/* - * Location where a chunk of regcustom.h is automatically spliced into - * this file (working from its prototype, regproto.h). - */ -/* --- begin --- */ -/* ensure certain things don't sneak in from system headers */ -#ifdef __REG_WIDE_T -#undef __REG_WIDE_T -#endif -#ifdef __REG_WIDE_COMPILE -#undef __REG_WIDE_COMPILE -#endif -#ifdef __REG_WIDE_EXEC -#undef __REG_WIDE_EXEC -#endif -#ifdef __REG_REGOFF_T -#undef __REG_REGOFF_T -#endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif -/* interface types */ -#define __REG_WIDE_T Tcl_UniChar -#define __REG_REGOFF_T long /* not really right, but good enough... */ -#define __REG_VOID_T VOID -#define __REG_CONST CONST -/* names and declarations */ -#define __REG_WIDE_COMPILE TclReComp -#define __REG_WIDE_EXEC TclReExec -#ifndef __REG_NOFRONT -#define __REG_NOFRONT /* don't want regcomp() and regexec() */ -#endif -#ifndef __REG_NOCHAR -#define __REG_NOCHAR /* or the char versions */ -#endif -#define regfree TclReFree -#define regerror TclReError -/* --- end --- */ - - -/* - * interface types etc. - */ - -/* - * regoff_t has to be large enough to hold either off_t or ssize_t, - * and must be signed; it's only a guess that long is suitable, so we - * offer an override. - */ -#ifdef __REG_REGOFF_T -typedef __REG_REGOFF_T regoff_t; -#else -typedef long regoff_t; -#endif - -/* - * For benefit of old compilers, we offer the option of - * overriding the `void' type used to declare nonexistent return types. - */ -#ifdef __REG_VOID_T -typedef __REG_VOID_T re_void; -#else -typedef void re_void; -#endif - -/* - * Also for benefit of old compilers, can supply a macro - * which expands to a substitute for `const'. - */ -#ifndef __REG_CONST -#define __REG_CONST const -#endif - - - -/* - * other interface types - */ - -/* the biggie, a compiled RE (or rather, a front end to same) */ -typedef struct { - int re_magic; /* magic number */ - size_t re_nsub; /* number of subexpressions */ - int re_info; /* information about RE */ -# define REG_UBACKREF 000001 -# define REG_ULOOKAHEAD 000002 -# define REG_UBOUNDS 000004 -# define REG_UBRACES 000010 -# define REG_UBSALNUM 000020 -# define REG_UPBOTCH 000040 -# define REG_UBBS 000100 -# define REG_UNONPOSIX 000200 -# define REG_UUNSPEC 000400 -# define REG_UUNPORT 001000 -# define REG_ULOCALE 002000 -# define REG_UEMPTYMATCH 004000 -# define REG_UIMPOSSIBLE 010000 - int re_csize; /* sizeof(character) */ - char *re_endp; /* backward compatibility kludge */ - /* the rest is opaque pointers to hidden innards */ - char *re_guts; /* `char *' is more portable than `void *' */ - char *re_fns; -} regex_t; - -/* result reporting (may acquire more fields later) */ -typedef struct { - regoff_t rm_so; /* start of substring */ - regoff_t rm_eo; /* end of substring */ -} regmatch_t; - -/* supplementary control and reporting (placeholder for later work) */ -typedef struct { - int rm_dummy; -} rm_detail_t; - - - -/* - * compilation - ^ #ifndef __REG_NOCHAR - ^ int re_comp(regex_t *, __REG_CONST char *, size_t, int); - ^ #endif - ^ #ifndef __REG_NOFRONT - ^ int regcomp(regex_t *, __REG_CONST char *, int); - ^ #endif - ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); - ^ #endif - */ -#define REG_BASIC 000000 /* BREs (convenience) */ -#define REG_EXTENDED 000001 /* EREs */ -#define REG_ADVF 000002 /* advanced features in EREs */ -#define REG_ADVANCED 000003 /* AREs (which are also EREs) */ -#define REG_QUOTE 000004 /* no special characters, none */ -#define REG_NOSPEC REG_QUOTE /* historical synonym */ -#define REG_ICASE 000010 /* ignore case */ -#define REG_NOSUB 000020 /* don't care about subexpressions */ -#define REG_EXPANDED 000040 /* expanded format, white space & comments */ -#define REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */ -#define REG_NLANCH 000200 /* ^ matches after \n, $ before */ -#define REG_NEWLINE 000300 /* newlines are line terminators */ -#define REG_PEND 000400 /* ugh -- backward-compatibility hack */ -#define REG_DUMP 004000 /* none of your business :-) */ -#define REG_FAKEEC 010000 /* none of your business :-) */ -#define REG_PROGRESS 020000 /* none of your business :-) */ - - - -/* - * execution - ^ #ifndef __REG_NOCHAR - ^ int re_exec(regex_t *, __REG_CONST char *, size_t, - ^ rm_detail_t *, size_t, regmatch_t [], int); - ^ #endif - ^ #ifndef __REG_NOFRONT - ^ int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); - ^ #endif - ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, - ^ rm_detail_t *, size_t, regmatch_t [], int); - ^ #endif - */ -#define REG_NOTBOL 0001 /* BOS is not BOL */ -#define REG_NOTEOL 0002 /* EOS is not EOL */ -#define REG_STARTEND 0004 /* backward compatibility kludge */ -#define REG_FTRACE 0010 /* none of your business */ -#define REG_MTRACE 0020 /* none of your business */ -#define REG_SMALL 0040 /* none of your business */ - - - -/* - * misc generics (may be more functions here eventually) - ^ re_void regfree(regex_t *); - */ - - - -/* - * error reporting - * Be careful if modifying the list of error codes -- the table used by - * regerror() is generated automatically from this file! - * - * Note that there is no wide-char variant of regerror at this time; what - * kind of character is used for error reports is independent of what kind - * is used in matching. - * - ^ extern size_t regerror(int, __REG_CONST regex_t *, char *, size_t); - */ -#define REG_OKAY 0 /* no errors detected */ -#define REG_NOMATCH 1 /* failed to match */ -#define REG_BADPAT 2 /* invalid regexp */ -#define REG_ECOLLATE 3 /* invalid collating element */ -#define REG_ECTYPE 4 /* invalid character class */ -#define REG_EESCAPE 5 /* invalid escape \ sequence */ -#define REG_ESUBREG 6 /* invalid backreference number */ -#define REG_EBRACK 7 /* brackets [] not balanced */ -#define REG_EPAREN 8 /* parentheses () not balanced */ -#define REG_EBRACE 9 /* braces {} not balanced */ -#define REG_BADBR 10 /* invalid repetition count(s) */ -#define REG_ERANGE 11 /* invalid character range */ -#define REG_ESPACE 12 /* out of memory */ -#define REG_BADRPT 13 /* quantifier operand invalid */ -#define REG_ASSERT 15 /* "can't happen" -- you found a bug */ -#define REG_INVARG 16 /* invalid argument to regex function */ -#define REG_MIXED 17 /* character widths of regex and string differ */ -#define REG_BADOPT 18 /* invalid embedded option */ -/* two specials for debugging and testing */ -#define REG_ATOI 101 /* convert error-code name to number */ -#define REG_ITOA 102 /* convert error-code number to name */ - - - -/* - * the prototypes, as possibly munched by regfwd - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regproto.h === */ -#ifndef __REG_NOCHAR -int re_comp _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, int)); -#endif -#ifndef __REG_NOFRONT -int regcomp _ANSI_ARGS_((regex_t *, __REG_CONST char *, int)); -#endif -#ifdef __REG_WIDE_T -int __REG_WIDE_COMPILE _ANSI_ARGS_((regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int)); -#endif -#ifndef __REG_NOCHAR -int re_exec _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -#endif -#ifndef __REG_NOFRONT -int regexec _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, regmatch_t [], int)); -#endif -#ifdef __REG_WIDE_T -int __REG_WIDE_EXEC _ANSI_ARGS_((regex_t *, __REG_CONST __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -#endif -re_void regfree _ANSI_ARGS_((regex_t *)); -extern size_t regerror _ANSI_ARGS_((int, __REG_CONST regex_t *, char *, size_t)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* - * more C++ voodoo - */ -#ifdef __cplusplus -} -#endif - - - -#endif diff --git a/generic/regexec.c b/generic/regexec.c deleted file mode 100644 index 088d12b..0000000 --- a/generic/regexec.c +++ /dev/null @@ -1,952 +0,0 @@ -/* - * re_*exec and friends - match REs - */ - -#include "regguts.h" - - - -/* internal variables, bundled for easy passing around */ -struct vars { - regex_t *re; - struct guts *g; - int eflags; /* copies of arguments */ - size_t nmatch; - regmatch_t *pmatch; - chr *start; /* start of string */ - chr *stop; /* just past end of string */ - int err; /* error code if any (0 none) */ - regoff_t *mem; /* memory vector for backtracking */ -}; -#define VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */ -#define ISERR() VISERR(v) -#define VERR(vv,e) (((vv)->err) ? (vv)->err : ((vv)->err = (e))) -#define ERR(e) VERR(v, e) /* record an error */ -#define NOERR() {if (ISERR()) return;} /* if error seen, return */ -#define OFF(p) ((p) - v->start) -#define LOFF(p) ((long)OFF(p)) - - - -/* lazy-DFA representation */ -struct arcp { /* "pointer" to an outarc */ - struct sset *ss; - color co; -}; - -struct sset { /* state set */ - unsigned *states; /* pointer to bitvector */ - unsigned hash; /* hash of bitvector */ -# define HASH(bv, nw) (((nw) == 1) ? *(bv) : hash(bv, nw)) -# define HIT(h,bv,ss,nw) ((ss)->hash == (h) && ((nw) == 1 || \ - memcmp(VS(bv), VS((ss)->states), (nw)*sizeof(unsigned)) == 0)) - int flags; -# define STARTER 01 /* the initial state set */ -# define POSTSTATE 02 /* includes the goal state */ -# define LOCKED 04 /* locked in cache */ -# define NOPROGRESS 010 /* zero-progress state set */ - struct arcp ins; /* chain of inarcs pointing here */ - chr *lastseen; /* last entered on arrival here */ - struct sset **outs; /* outarc vector indexed by color */ - struct arcp *inchain; /* chain-pointer vector for outarcs */ -}; - -struct dfa { - int nssets; /* size of cache */ - int nssused; /* how many entries occupied yet */ - int nstates; /* number of states */ - int ncolors; /* length of outarc and inchain vectors */ - int wordsper; /* length of state-set bitvectors */ - struct sset *ssets; /* state-set cache */ - unsigned *statesarea; /* bitvector storage */ - unsigned *work; /* pointer to work area within statesarea */ - struct sset **outsarea; /* outarc-vector storage */ - struct arcp *incarea; /* inchain storage */ - struct cnfa *cnfa; - struct colormap *cm; - chr *lastpost; /* location of last cache-flushed success */ - chr *lastnopr; /* location of last cache-flushed NOPROGRESS */ - struct sset *search; /* replacement-search-pointer memory */ - int cptsmalloced; /* were the areas individually malloced? */ - char *mallocarea; /* self, or master malloced area, or NULL */ -}; - -#define WORK 1 /* number of work bitvectors needed */ - -/* setup for non-malloc allocation for small cases */ -#define FEWSTATES 20 /* must be less than UBITS */ -#define FEWCOLORS 15 -struct smalldfa { - struct dfa dfa; - struct sset ssets[FEWSTATES*2]; - unsigned statesarea[FEWSTATES*2 + WORK]; - struct sset *outsarea[FEWSTATES*2 * FEWCOLORS]; - struct arcp incarea[FEWSTATES*2 * FEWCOLORS]; -}; - - - - -/* - * forward declarations - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regexec.c === */ -int exec _ANSI_ARGS_((regex_t *, CONST chr *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -static int find _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *)); -static int cfind _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *)); -static VOID zapsubs _ANSI_ARGS_((regmatch_t *, size_t)); -static VOID zapmem _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID subset _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int dissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int condissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int altdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int cdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int ccondissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int crevdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int cbrdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int caltdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -/* === rege_dfa.c === */ -static chr *longest _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *)); -static chr *shortest _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *, chr *, chr **)); -static struct dfa *newdfa _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *, struct smalldfa *)); -static VOID freedfa _ANSI_ARGS_((struct dfa *)); -static unsigned hash _ANSI_ARGS_((unsigned *, int)); -static struct sset *initialize _ANSI_ARGS_((struct vars *, struct dfa *, chr *)); -static struct sset *miss _ANSI_ARGS_((struct vars *, struct dfa *, struct sset *, pcolor, chr *, chr *)); -static int lacon _ANSI_ARGS_((struct vars *, struct cnfa *, chr *, pcolor)); -static struct sset *getvacant _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *)); -static struct sset *pickss _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* - - exec - match regular expression - ^ int exec(regex_t *, CONST chr *, size_t, rm_detail_t *, - ^ size_t, regmatch_t [], int); - */ -int -exec(re, string, len, details, nmatch, pmatch, flags) -regex_t *re; -CONST chr *string; -size_t len; -rm_detail_t *details; /* hook for future elaboration */ -size_t nmatch; -regmatch_t pmatch[]; -int flags; -{ - struct vars var; - register struct vars *v = &var; - int st; - size_t n; - int complications; -# define LOCALMAT 20 - regmatch_t mat[LOCALMAT]; -# define LOCALMEM 40 - regoff_t mem[LOCALMEM]; - - /* sanity checks */ - if (re == NULL || string == NULL || re->re_magic != REMAGIC) - return REG_INVARG; - if (re->re_csize != sizeof(chr)) - return REG_MIXED; - - /* setup */ - v->re = re; - v->g = (struct guts *)re->re_guts; - if (v->g->unmatchable) - return REG_NOMATCH; - complications = (v->g->info®_UBACKREF) ? 1 : 0; - if (v->g->usedshorter) - complications = 1; - v->eflags = flags; - if (v->g->cflags®_NOSUB) - nmatch = 0; /* override client */ - v->nmatch = nmatch; - if (complications && v->nmatch < v->g->nsub + 1) { - /* need work area bigger than what user gave us */ - if (v->g->nsub + 1 <= LOCALMAT) - v->pmatch = mat; - else - v->pmatch = (regmatch_t *)MALLOC((v->g->nsub + 1) * - sizeof(regmatch_t)); - if (v->pmatch == NULL) - return REG_ESPACE; - v->nmatch = v->g->nsub + 1; - } else - v->pmatch = pmatch; - v->start = (chr *)string; - v->stop = (chr *)string + len; - v->err = 0; - if (complications) { - assert(v->g->ntree >= 0); - n = (size_t)v->g->ntree; - if (n <= LOCALMEM) - v->mem = mem; - else - v->mem = (regoff_t *)MALLOC(n*sizeof(regoff_t)); - if (v->mem == NULL) { - if (v->pmatch != pmatch && v->pmatch != mat) - FREE(v->pmatch); - return REG_ESPACE; - } - } else - v->mem = NULL; - - /* do it */ - assert(v->g->tree != NULL); - if (complications) - st = cfind(v, &v->g->tree->cnfa, &v->g->cmap); - else - st = find(v, &v->g->tree->cnfa, &v->g->cmap); - - /* copy (portion of) match vector over if necessary */ - if (st == REG_OKAY && v->pmatch != pmatch && nmatch > 0) { - zapsubs(pmatch, nmatch); - n = (nmatch < v->nmatch) ? nmatch : v->nmatch; - memcpy(VS(pmatch), VS(v->pmatch), n*sizeof(regmatch_t)); - } - - /* clean up */ - if (v->pmatch != pmatch && v->pmatch != mat) - FREE(v->pmatch); - if (v->mem != NULL && v->mem != mem) - FREE(v->mem); - return st; -} - -/* - - find - find a match for the main NFA (no-complications case) - ^ static int find(struct vars *, struct cnfa *, struct colormap *); - */ -static int -find(v, cnfa, cm) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -{ - struct smalldfa da; - struct dfa *d = newdfa(v, cnfa, cm, &da); - struct smalldfa sa; - struct dfa *s = newdfa(v, &v->g->search, cm, &sa); - chr *begin; - chr *end; - chr *open; /* open and close of range of possible starts */ - chr *close; - - if (d == NULL) - return v->err; - if (s == NULL) { - freedfa(d); - return v->err; - } - - close = v->start; - do { - MDEBUG(("\nsearch at %ld\n", LOFF(close))); - close = shortest(v, s, close, close, v->stop, &open); - if (close == NULL) - break; /* NOTE BREAK */ - if (v->nmatch == 0) { - /* don't need exact location */ - freedfa(d); - freedfa(s); - return REG_OKAY; - } - MDEBUG(("between %ld and %ld\n", LOFF(open), LOFF(close))); - for (begin = open; begin <= close; begin++) { - MDEBUG(("\nfind trying at %ld\n", LOFF(begin))); - end = longest(v, d, begin, v->stop); - if (end != NULL) { - assert(v->nmatch > 0); - v->pmatch[0].rm_so = OFF(begin); - v->pmatch[0].rm_eo = OFF(end); - freedfa(d); - freedfa(s); - if (v->nmatch > 1) { - zapsubs(v->pmatch, v->nmatch); - return dissect(v, v->g->tree, begin, - end); - } - if (ISERR()) - return v->err; - return REG_OKAY; - } - } - } while (close < v->stop); - - freedfa(d); - freedfa(s); - if (ISERR()) - return v->err; - return REG_NOMATCH; -} - -/* - - cfind - find a match for the main NFA (with complications) - ^ static int cfind(struct vars *, struct cnfa *, struct colormap *); - */ -static int -cfind(v, cnfa, cm) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -{ - struct smalldfa da; - struct dfa *d = newdfa(v, cnfa, cm, &da); - struct smalldfa sa; - struct dfa *s = newdfa(v, &v->g->search, cm, &sa); - chr *begin; - chr *end; - chr *open; /* open and close of range of possible starts */ - chr *close; - chr *estart; - chr *estop; - int er; - int shorter = v->g->tree->flags&SHORTER; - - if (d == NULL) - return v->err; - if (s == NULL) { - freedfa(d); - return v->err; - } - - close = v->start; - do { - MDEBUG(("\ncsearch at %ld\n", LOFF(close))); - close = shortest(v, s, close, close, v->stop, &open); - if (close == NULL) - break; /* NOTE BREAK */ - MDEBUG(("cbetween %ld and %ld\n", LOFF(open), LOFF(close))); - for (begin = open; begin <= close; begin++) { - MDEBUG(("\ncfind trying at %ld\n", LOFF(begin))); - estart = begin; - estop = v->stop; - for (;;) { - if (shorter) - end = shortest(v, d, begin, estart, - estop, (chr **)NULL); - else - end = longest(v, d, begin, estop); - if (end == NULL) - break; /* NOTE BREAK OUT */ - MDEBUG(("tentative end %ld\n", LOFF(end))); - zapsubs(v->pmatch, v->nmatch); - zapmem(v, v->g->tree); - er = cdissect(v, v->g->tree, begin, end); - switch (er) { - case REG_OKAY: - if (v->nmatch > 0) { - v->pmatch[0].rm_so = OFF(begin); - v->pmatch[0].rm_eo = OFF(end); - } - freedfa(d); - freedfa(s); - if (ISERR()) - return v->err; - return REG_OKAY; - break; - case REG_NOMATCH: - /* go around and try again */ - if ((shorter) ? end == estop : - end == begin) { - /* no point in trying again */ - freedfa(s); - freedfa(d); - return REG_NOMATCH; - } - if (shorter) - estart = end + 1; - else - estop = end - 1; - break; - default: - freedfa(d); - freedfa(s); - return er; - break; - } - } - } - } while (close < v->stop); - - freedfa(d); - freedfa(s); - if (ISERR()) - return v->err; - return REG_NOMATCH; -} - -/* - - zapsubs - initialize the subexpression matches to "no match" - ^ static VOID zapsubs(regmatch_t *, size_t); - */ -static VOID -zapsubs(p, n) -regmatch_t *p; -size_t n; -{ - size_t i; - - for (i = n-1; i > 0; i--) { - p[i].rm_so = -1; - p[i].rm_eo = -1; - } -} - -/* - - zapmem - initialize the retry memory of a subtree to zeros - ^ static VOID zapmem(struct vars *, struct subre *); - */ -static VOID -zapmem(v, t) -struct vars *v; -struct subre *t; -{ - if (t == NULL) - return; - - assert(v->mem != NULL); - v->mem[t->retry] = 0; - if (t->op == '(') { - assert(t->subno > 0); - v->pmatch[t->subno].rm_so = -1; - v->pmatch[t->subno].rm_eo = -1; - } - - if (t->left != NULL) - zapmem(v, t->left); - if (t->right != NULL) - zapmem(v, t->right); -} - -/* - - subset - set any subexpression relevant to a successful subre - ^ static VOID subset(struct vars *, struct subre *, chr *, chr *); - */ -static VOID -subset(v, sub, begin, end) -struct vars *v; -struct subre *sub; -chr *begin; -chr *end; -{ - int n = sub->subno; - - assert(n > 0); - if ((size_t)n >= v->nmatch) - return; - - MDEBUG(("setting %d\n", n)); - v->pmatch[n].rm_so = OFF(begin); - v->pmatch[n].rm_eo = OFF(end); -} - -/* - - dissect - determine subexpression matches (uncomplicated case) - ^ static int dissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -dissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - assert(t != NULL); - MDEBUG(("dissect %ld-%ld\n", LOFF(begin), LOFF(end))); - - switch (t->op) { - case '=': /* terminal node */ - assert(t->left == NULL && t->right == NULL); - return REG_OKAY; /* no action, parent did the work */ - break; - case '|': /* alternation */ - assert(t->left != NULL); - return altdissect(v, t, begin, end); - break; - case 'b': /* back ref -- shouldn't be calling us! */ - return REG_ASSERT; - break; - case '.': /* concatenation */ - assert(t->left != NULL && t->right != NULL); - return condissect(v, t, begin, end); - break; - case '(': /* capturing */ - assert(t->left != NULL && t->right == NULL); - assert(t->subno > 0); - subset(v, t, begin, end); - return dissect(v, t->left, begin, end); - break; - default: - return REG_ASSERT; - break; - } -} - -/* - - condissect - determine concatenation subexpression matches (uncomplicated) - ^ static int condissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -condissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct smalldfa da; - struct dfa *d; - struct smalldfa d2a; - struct dfa *d2; - chr *mid; - int i; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &da); - if (ISERR()) - return v->err; - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, &d2a); - if (ISERR()) { - freedfa(d); - return v->err; - } - - /* pick a tentative midpoint */ - mid = longest(v, d, begin, end); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - - /* iterate until satisfaction or failure */ - while (longest(v, d2, mid, end) != end) { - /* that midpoint didn't work, find a new one */ - if (mid == begin) { - /* all possibilities exhausted! */ - MDEBUG(("no midpoint!\n")); - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - mid = longest(v, d, begin, mid-1); - if (mid == NULL) { - /* failed to find a new one! */ - MDEBUG(("failed midpoint!\n")); - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - MDEBUG(("new midpoint %ld\n", LOFF(mid))); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - i = dissect(v, t->left, begin, mid); - if (i != REG_OKAY) - return i; - return dissect(v, t->right, mid, end); -} - -/* - - altdissect - determine alternative subexpression matches (uncomplicated) - ^ static int altdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -altdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct smalldfa da; - struct dfa *d; - int i; - - assert(t != NULL); - assert(t->op == '|'); - - for (i = 0; t != NULL; t = t->right, i++) { - MDEBUG(("trying %dth\n", i)); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &da); - if (ISERR()) - return v->err; - if (longest(v, d, begin, end) == end) { - MDEBUG(("success\n")); - freedfa(d); - return dissect(v, t->left, begin, end); - } - freedfa(d); - } - return REG_ASSERT; /* none of them matched?!? */ -} - -/* - - cdissect - determine subexpression matches (with complications) - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int cdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -cdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - int er; - - assert(t != NULL); - MDEBUG(("cdissect %ld-%ld\n", LOFF(begin), LOFF(end))); - - switch (t->op) { - case '=': /* terminal node */ - assert(t->left == NULL && t->right == NULL); - return REG_OKAY; /* no action, parent did the work */ - break; - case '|': /* alternation */ - assert(t->left != NULL); - return caltdissect(v, t, begin, end); - break; - case 'b': /* back ref -- shouldn't be calling us! */ - assert(t->left == NULL && t->right == NULL); - return cbrdissect(v, t, begin, end); - break; - case '.': /* concatenation */ - assert(t->left != NULL && t->right != NULL); - return ccondissect(v, t, begin, end); - break; - case '(': /* capturing */ - assert(t->left != NULL && t->right == NULL); - assert(t->subno > 0); - er = cdissect(v, t->left, begin, end); - if (er == REG_OKAY) - subset(v, t, begin, end); - return er; - break; - default: - return REG_ASSERT; - break; - } -} - -/* - - ccondissect - concatenation subexpression matches (with complications) - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int ccondissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -ccondissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct smalldfa da; - struct dfa *d; - struct smalldfa d2a; - struct dfa *d2; - chr *mid; - int er; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - - if (t->left->flags&SHORTER) /* reverse scan */ - return crevdissect(v, t, begin, end); - - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &da); - if (ISERR()) - return v->err; - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, &d2a); - if (ISERR()) { - freedfa(d); - return v->err; - } - MDEBUG(("cconcat %d\n", t->retry)); - - /* pick a tentative midpoint */ - if (v->mem[t->retry] == 0) { - mid = longest(v, d, begin, end); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - } else { - mid = begin + (v->mem[t->retry] - 1); - MDEBUG(("working midpoint %ld\n", LOFF(mid))); - } - - /* iterate until satisfaction or failure */ - for (;;) { - /* try this midpoint on for size */ - er = cdissect(v, t->left, begin, mid); - if (er == REG_OKAY && longest(v, d2, mid, end) == end && - (er = cdissect(v, t->right, mid, end)) == - REG_OKAY) - break; /* NOTE BREAK OUT */ - if (er != REG_OKAY && er != REG_NOMATCH) { - freedfa(d); - freedfa(d2); - return er; - } - - /* that midpoint didn't work, find a new one */ - if (mid == begin) { - /* all possibilities exhausted */ - MDEBUG(("%d no midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - mid = longest(v, d, begin, mid-1); - if (mid == NULL) { - /* failed to find a new one */ - MDEBUG(("%d failed midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("%d: new midpoint %ld\n", t->retry, LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - zapmem(v, t->left); - zapmem(v, t->right); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - return REG_OKAY; -} - -/* - - crevdissect - determine shortest-first subexpression matches - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int crevdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -crevdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct smalldfa da; - struct dfa *d; - struct smalldfa d2a; - struct dfa *d2; - chr *mid; - int er; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - assert(t->left->flags&SHORTER); - - /* concatenation -- need to split the substring between parts */ - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &da); - if (ISERR()) - return v->err; - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, &d2a); - if (ISERR()) { - freedfa(d); - return v->err; - } - MDEBUG(("crev %d\n", t->retry)); - - /* pick a tentative midpoint */ - if (v->mem[t->retry] == 0) { - mid = shortest(v, d, begin, begin, end, (chr **)NULL); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - } else { - mid = begin + (v->mem[t->retry] - 1); - MDEBUG(("working midpoint %ld\n", LOFF(mid))); - } - - /* iterate until satisfaction or failure */ - for (;;) { - /* try this midpoint on for size */ - er = cdissect(v, t->left, begin, mid); - if (er == REG_OKAY && longest(v, d2, mid, end) == end && - (er = cdissect(v, t->right, mid, end)) == - REG_OKAY) - break; /* NOTE BREAK OUT */ - if (er != REG_OKAY && er != REG_NOMATCH) { - freedfa(d); - freedfa(d2); - return er; - } - - /* that midpoint didn't work, find a new one */ - if (mid == end) { - /* all possibilities exhausted */ - MDEBUG(("%d no midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - mid = shortest(v, d, begin, mid+1, end, (chr **)NULL); - if (mid == NULL) { - /* failed to find a new one */ - MDEBUG(("%d failed midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("%d: new midpoint %ld\n", t->retry, LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - zapmem(v, t->left); - zapmem(v, t->right); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - return REG_OKAY; -} - -/* - - cbrdissect - determine backref subexpression matches - ^ static int cbrdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -cbrdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - int i; - int n = t->subno; - size_t len; - chr *paren; - chr *p; - chr *stop; - int min = t->min; - int max = t->max; - - assert(t != NULL); - assert(t->op == 'b'); - assert(n >= 0); - assert((size_t)n < v->nmatch); - - MDEBUG(("cbackref n%d %d{%d-%d}\n", t->retry, n, min, max)); - - if (v->pmatch[n].rm_so == -1) - return REG_NOMATCH; - paren = v->start + v->pmatch[n].rm_so; - len = v->pmatch[n].rm_eo - v->pmatch[n].rm_so; - - /* no room to maneuver -- retries are pointless */ - if (v->mem[t->retry]) - return REG_NOMATCH; - v->mem[t->retry] = 1; - - /* special-case zero-length string */ - if (len == 0) { - if (begin == end) - return REG_OKAY; - return REG_NOMATCH; - } - - /* and too-short string */ - assert(end >= begin); - if ((size_t)(end - begin) < len) - return REG_NOMATCH; - stop = end - len; - - /* count occurrences */ - i = 0; - for (p = begin; p <= stop && (i < max || max == INFINITY); p += len) { - if ((*v->g->compare)(paren, p, len) != 0) - break; - i++; - } - MDEBUG(("cbackref found %d\n", i)); - - /* and sort it out */ - if (p != end) /* didn't consume all of it */ - return REG_NOMATCH; - if (min <= i && (i <= max || max == INFINITY)) - return REG_OKAY; - return REG_NOMATCH; /* out of range */ -} - -/* - - caltdissect - determine alternative subexpression matches (w. complications) - ^ static int caltdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -caltdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct smalldfa da; - struct dfa *d; - int er; -# define UNTRIED 0 /* not yet tried at all */ -# define TRYING 1 /* top matched, trying submatches */ -# define TRIED 2 /* top didn't match or submatches exhausted */ - - if (t == NULL) - return REG_NOMATCH; - assert(t->op == '|'); - if (v->mem[t->retry] == TRIED) - return caltdissect(v, t->right, begin, end); - - MDEBUG(("calt n%d\n", t->retry)); - assert(t->left != NULL); - - if (v->mem[t->retry] == UNTRIED) { - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &da); - if (ISERR()) - return v->err; - if (longest(v, d, begin, end) != end) { - freedfa(d); - v->mem[t->retry] = TRIED; - return caltdissect(v, t->right, begin, end); - } - freedfa(d); - MDEBUG(("calt matched\n")); - v->mem[t->retry] = TRYING; - } - - er = cdissect(v, t->left, begin, end); - if (er != REG_NOMATCH) - return er; - - v->mem[t->retry] = TRIED; - return caltdissect(v, t->right, begin, end); -} - - - -#include "rege_dfa.c" diff --git a/generic/regfree.c b/generic/regfree.c deleted file mode 100644 index a5c3f0b..0000000 --- a/generic/regfree.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * regfree - free an RE - * - * You might think that this could be incorporated into regcomp.c, and - * that would be a reasonable idea... except that this is a generic - * function (with a generic name), applicable to all compiled REs - * regardless of the size of their characters, whereas the stuff in - * regcomp.c gets compiled once per character size. - */ - -#include "regguts.h" - -/* - - regfree - free an RE (generic function, punts to RE-specific function) - * - * Ignoring invocation with NULL is a convenience. - */ -VOID -regfree(re) -regex_t *re; -{ - if (re == NULL) - return; - (*((struct fns *)re->re_fns)->free)(re); -} diff --git a/generic/regfronts.c b/generic/regfronts.c deleted file mode 100644 index a9bd556..0000000 --- a/generic/regfronts.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * regcomp and regexec - front ends to re_ routines - * - * Mostly for implementation of backward-compatibility kludges. Note - * that these routines exist ONLY in char versions. - */ - -#include "regguts.h" - -/* - - regcomp - compile regular expression - */ -int -regcomp(re, str, flags) -regex_t *re; -CONST char *str; -int flags; -{ - size_t len; - int f = flags; - - if (f®_PEND) { - len = re->re_endp - str; - f &= ~REG_PEND; - } else - len = strlen(str); - - return re_comp(re, str, len, f); -} - -/* - - regexec - execute regular expression - */ -int -regexec(re, str, nmatch, pmatch, flags) -regex_t *re; -CONST char *str; -size_t nmatch; -regmatch_t pmatch[]; -int flags; -{ - CONST char *start; - size_t len; - int f = flags; - - if (f®_STARTEND) { - start = str + pmatch[0].rm_so; - len = pmatch[0].rm_eo - pmatch[0].rm_so; - f &= ~REG_STARTEND; - } else { - start = str; - len = strlen(str); - } - - return re_exec(re, start, len, nmatch, pmatch, f); -} diff --git a/generic/regguts.h b/generic/regguts.h deleted file mode 100644 index badd8d4..0000000 --- a/generic/regguts.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Internal interface definitions, etc., for the regex package - */ - - - -/* - * Environmental customization. It should not (I hope) be necessary to - * alter the file you are now reading -- regcustom.h should handle it all, - * given care here and elsewhere. - */ -#include "regcustom.h" - - - -/* - * Things that regcustom.h might override. - */ - -/* standard header files (NULL is a reasonable indicator for them) */ -#ifndef NULL -#include -#include -#include -#include -#include -#endif - -/* assertions */ -#ifndef assert -#ifndef REG_DEBUG -#define NDEBUG -#include -#endif -#endif - -/* voids */ -#ifndef VOID -#define VOID void /* for function return values */ -#endif -#ifndef DISCARD -#define DISCARD VOID /* for throwing values away */ -#endif -#ifndef PVOID -#define PVOID VOID * /* generic pointer */ -#endif -#ifndef VS -#define VS(x) ((PVOID)(x)) /* cast something to generic ptr */ -#endif -#ifndef NOPARMS -#define NOPARMS VOID /* for empty parm lists */ -#endif - -/* function-pointer declarator */ -#ifndef FUNCPTR -#if __STDC__ >= 1 -#define FUNCPTR(name, args) (*name)args -#else -#define FUNCPTR(name, args) (*name)() -#endif -#endif - -/* memory allocation */ -#ifndef MALLOC -#define MALLOC(n) malloc(n) -#endif -#ifndef REALLOC -#define REALLOC(p, n) realloc(VS(p), n) -#endif -#ifndef FREE -#define FREE(p) free(VS(p)) -#endif - -/* want size of a char in bits, and max value in bounded quantifiers */ -#ifndef CHAR_BIT -#include -#endif -#ifndef _POSIX2_RE_DUP_MAX -#define _POSIX2_RE_DUP_MAX 255 /* normally from */ -#endif - - - -/* - * misc - */ - -#define NOTREACHED 0 -#define xxx 1 - -#define DUPMAX _POSIX2_RE_DUP_MAX -#define INFINITY (DUPMAX+1) - -#define REMAGIC 0xfed7 /* magic number for main struct */ - - - -/* - * debugging facilities - */ -#ifdef REG_DEBUG -/* FDEBUG does finite-state tracing */ -#define FDEBUG(arglist) { if (v->eflags®_FTRACE) printf arglist; } -/* MDEBUG does higher-level tracing */ -#define MDEBUG(arglist) { if (v->eflags®_MTRACE) printf arglist; } -#else -#define FDEBUG(arglist) {} -#define MDEBUG(arglist) {} -#endif - - - -/* - * bitmap manipulation - */ -#define UBITS (CHAR_BIT * sizeof(unsigned)) -#define BSET(uv, sn) ((uv)[(sn)/UBITS] |= (unsigned)1 << ((sn)%UBITS)) -#define ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS))) - - - -/* - * We dissect a chr into byts for colormap table indexing. Here we define - * a byt, which will be the same as a byte on most machines... The exact - * size of a byt is not critical, but about 8 bits is good, and extraction - * of 8-bit chunks is sometimes especially fast. - */ -#ifndef BYTBITS -#define BYTBITS 8 /* bits in a byt */ -#endif -#define BYTTAB (1<flags&FREECOL) - union tree *block; /* block of solid color, if any */ -}; - -/* the color map itself */ -struct colormap { - int magic; -# define CMMAGIC 0x876 - struct vars *v; /* for compile error reporting */ - size_t ncds; /* number of colordescs */ - size_t max; /* highest in use */ - color free; /* beginning of free chain (if non-0) */ - struct colordesc *cd; -# define CDEND(cm) (&(cm)->cd[(cm)->max + 1]) -# define NINLINECDS ((size_t)10) - struct colordesc cdspace[NINLINECDS]; - union tree tree[NBYTS]; /* tree top, plus fill blocks */ -}; - -/* optimization magic to do fast chr->color mapping */ -#define B0(c) ((c) & BYTMASK) -#define B1(c) (((c)>>BYTBITS) & BYTMASK) -#define B2(c) (((c)>>(2*BYTBITS)) & BYTMASK) -#define B3(c) (((c)>>(3*BYTBITS)) & BYTMASK) -#if NBYTS == 1 -#define GETCOLOR(cm, c) ((cm)->tree->tcolor[B0(c)]) -#endif -/* beware, for NBYTS>1, GETCOLOR() is unsafe -- 2nd arg used repeatedly */ -#if NBYTS == 2 -#define GETCOLOR(cm, c) ((cm)->tree->tptr[B1(c)]->tcolor[B0(c)]) -#endif -#if NBYTS == 4 -#define GETCOLOR(cm, c) ((cm)->tree->tptr[B3(c)]->tptr[B2(c)]->tptr[B1(c)]->tcolor[B0(c)]) -#endif - - - -/* - * Interface definitions for locale-interface functions in locale.c. - * Multi-character collating elements (MCCEs) cause most of the trouble. - */ -struct cvec { - int nchrs; /* number of chrs */ - int chrspace; /* number of chrs possible */ - chr *chrs; /* pointer to vector of chrs */ - int nranges; /* number of ranges (chr pairs) */ - int rangespace; /* number of chrs possible */ - chr *ranges; /* pointer to vector of chr pairs */ - int nmcces; /* number of MCCEs */ - int mccespace; /* number of MCCEs possible */ - int nmccechrs; /* number of chrs used for MCCEs */ - chr *mcces[1]; /* pointers to 0-terminated MCCEs */ - /* and both batches of chrs are on the end */ -}; - -/* caution: this value cannot be changed easily */ -#define MAXMCCE 2 /* length of longest MCCE */ - - - -/* - * definitions for NFA internal representation - * - * Having a "from" pointer within each arc may seem redundant, but it - * saves a lot of hassle. - */ -struct state; - -struct arc { - int type; -# define ARCFREE '\0' - color co; - struct state *from; /* where it's from (and contained within) */ - struct state *to; /* where it's to */ - struct arc *outchain; /* *from's outs chain or free chain */ -# define freechain outchain - struct arc *inchain; /* *to's ins chain */ - struct arc *colorchain; /* color's arc chain */ -}; - -struct arcbatch { /* for bulk allocation of arcs */ - struct arcbatch *next; -# define ABSIZE 10 - struct arc a[ABSIZE]; -}; - -struct state { - int no; -# define FREESTATE (-1) - char flag; /* marks special states */ - int nins; /* number of inarcs */ - struct arc *ins; /* chain of inarcs */ - int nouts; /* number of outarcs */ - struct arc *outs; /* chain of outarcs */ - struct arc *free; /* chain of free arcs */ - struct state *tmp; /* temporary for traversal algorithms */ - struct state *next; /* chain for traversing all */ - struct state *prev; /* back chain */ - struct arcbatch oas; /* first arcbatch, avoid malloc in easy case */ -}; - -struct nfa { - struct state *pre; /* pre-initial state */ - struct state *init; /* initial state */ - struct state *final; /* final state */ - struct state *post; /* post-final state */ - int nstates; /* for numbering states */ - struct state *states; /* state-chain header */ - struct state *slast; /* tail of the chain */ - struct state *free; /* free list */ - struct colormap *cm; /* the color map */ - color bos[2]; /* colors, if any, assigned to BOS and BOL */ - color eos[2]; /* colors, if any, assigned to EOS and EOL */ - struct vars *v; /* simplifies compile error reporting */ - struct nfa *parent; /* parent NFA, if any */ -}; - - - -/* - * definitions for compacted NFA - */ -struct carc { - color co; /* COLORLESS is list terminator */ - int to; /* state number */ -}; - -struct cnfa { - int nstates; /* number of states */ - int ncolors; /* number of colors */ - int flags; -# define HASLACONS 01 /* uses lookahead constraints */ - int pre; /* setup state number */ - int post; /* teardown state number */ - color bos[2]; /* colors, if any, assigned to BOS and BOL */ - color eos[2]; /* colors, if any, assigned to EOS and EOL */ - struct carc **states; /* vector of pointers to outarc lists */ - struct carc *arcs; /* the area for the lists */ -}; -#define ZAPCNFA(cnfa) ((cnfa).nstates = 0) -#define NULLCNFA(cnfa) ((cnfa).nstates == 0) - - - -/* - * subexpression tree - */ -struct subre { - char op; /* '|', '.' (concat), 'b' (backref), '(', '=' */ - char flags; -# define LONGER 01 /* prefers longer match */ -# define SHORTER 02 /* prefers shorter match */ -# define MIXED 04 /* mixed preference below */ -# define CAP 010 /* capturing parens below */ -# define BACKR 020 /* back reference below */ -# define INUSE 0100 /* in use in final tree */ -# define LOCAL 03 /* bits which may not propagate up */ -# define LMIX(f) ((f)<<2) /* LONGER -> MIXED */ -# define SMIX(f) ((f)<<1) /* SHORTER -> MIXED */ -# define UP(f) (((f)&~LOCAL) | (LMIX(f) & SMIX(f) & MIXED)) -# define MESSY(f) ((f)&(MIXED|CAP|BACKR)) -# define PREF(f) ((f)&LOCAL) -# define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2)) -# define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2)) - short retry; /* index into retry memory */ - int subno; /* subexpression number (for 'b' and '(') */ - short min; /* min repetitions, for backref only */ - short max; /* max repetitions, for backref only */ - struct subre *left; /* left child, if any (also freelist chain) */ - struct subre *right; /* right child, if any */ - struct state *begin; /* outarcs from here... */ - struct state *end; /* ...ending in inarcs here */ - struct cnfa cnfa; /* compacted NFA, if any */ - struct subre *chain; /* for bookkeeping and error cleanup */ -}; - - - -/* - * table of function pointers for generic manipulation functions - * A regex_t's re_fns points to one of these. - */ -struct fns { - VOID FUNCPTR(free, (regex_t *)); -}; - - - -/* - * the insides of a regex_t, hidden behind a void * - */ -struct guts { - int magic; -# define GUTSMAGIC 0xfed9 - int cflags; /* copy of compile flags */ - int info; /* copy of re_info */ - size_t nsub; /* copy of re_nsub */ - struct subre *tree; - struct cnfa search; /* for fast preliminary search */ - int ntree; - struct colormap cmap; - int FUNCPTR(compare, (CONST chr *, CONST chr *, size_t)); - struct subre *lacons; /* lookahead-constraint vector */ - int nlacons; /* size of lacons */ - int usedshorter; /* used non-greedy quantifiers? */ - int unmatchable; /* cannot match anything? */ -}; diff --git a/generic/tcl.decls b/generic/tcl.decls deleted file mode 100644 index 671f5ff..0000000 --- a/generic/tcl.decls +++ /dev/null @@ -1,1321 +0,0 @@ -# tcl.decls -- -# -# This file contains the declarations for all supported public -# functions that are exported by the Tcl library via the stubs table. -# This file is used to generate the tclDecls.h, tclPlatDecls.h, -# tclStub.c, and tclPlatStub.c files. -# -# -# 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. -# -# RCS: @(#) $Id: tcl.decls,v 1.8 1999/04/16 00:46:41 stanton Exp $ - -library tcl - -# Define the tcl interface with several sub interfaces: -# tclPlat - platform specific public -# tclInt - generic private -# tclPlatInt - platform specific private - -interface tcl -hooks {tclPlat tclInt tclIntPlat} - -# Declare each of the functions in the public Tcl interface. Note that -# the an index should never be reused for a different function in order -# to preserve backwards compatibility. - -declare 0 generic { - int Tcl_PkgProvideEx(Tcl_Interp *interp, char *name, char *version, \ - ClientData clientData) -} -declare 1 generic { - char * Tcl_PkgRequireEx(Tcl_Interp *interp, char *name, char *version, \ - int exact, ClientData *clientDataPtr) -} -declare 2 generic { - void Tcl_Panic(char *format, ...) -} -declare 3 generic { - char * Tcl_Alloc(unsigned int size) -} -declare 4 generic { - void Tcl_Free(char *ptr) -} -declare 5 generic { - char * Tcl_Realloc(char *ptr, unsigned int size) -} -declare 6 generic { - char * Tcl_DbCkalloc(unsigned int size, char *file, int line) -} -declare 7 generic { - int Tcl_DbCkfree(char *ptr, char *file, int line) -} -declare 8 generic { - char * Tcl_DbCkrealloc(char *ptr, unsigned int size, char *file, int line) -} - -# Tcl_CreateFileHandler and Tcl_DeleteFileHandler are only available on unix, -# but they are part of the old generic interface, so we include them here for -# compatibility reasons. - -declare 9 unix { - void Tcl_CreateFileHandler(int fd, int mask, Tcl_FileProc *proc, \ - ClientData clientData) -} -declare 10 unix { - void Tcl_DeleteFileHandler(int fd) -} - -declare 11 generic { - void Tcl_SetTimer(Tcl_Time *timePtr) -} -declare 12 generic { - void Tcl_Sleep(int ms) -} -declare 13 generic { - int Tcl_WaitForEvent(Tcl_Time *timePtr) -} -declare 14 generic { - int Tcl_AppendAllObjTypes(Tcl_Interp *interp, Tcl_Obj *objPtr) -} -declare 15 generic { - void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...) -} -declare 16 generic { - void Tcl_AppendToObj(Tcl_Obj *objPtr, char *bytes, int length) -} -declare 17 generic { - Tcl_Obj * Tcl_ConcatObj(int objc, Tcl_Obj *CONST objv[]) -} -declare 18 generic { - int Tcl_ConvertToType(Tcl_Interp *interp, Tcl_Obj *objPtr, \ - Tcl_ObjType *typePtr) -} -declare 19 generic { - void Tcl_DbDecrRefCount(Tcl_Obj *objPtr, char *file, int line) -} -declare 20 generic { - void Tcl_DbIncrRefCount(Tcl_Obj *objPtr, char *file, int line) -} -declare 21 generic { - int Tcl_DbIsShared(Tcl_Obj *objPtr, char *file, int line) -} -declare 22 generic { - Tcl_Obj * Tcl_DbNewBooleanObj(int boolValue, char *file, int line) -} -declare 23 generic { - Tcl_Obj * Tcl_DbNewByteArrayObj(unsigned char *bytes, int length, \ - char *file, int line) -} -declare 24 generic { - Tcl_Obj * Tcl_DbNewDoubleObj(double doubleValue, char *file, int line) -} -declare 25 generic { - Tcl_Obj * Tcl_DbNewListObj(int objc, Tcl_Obj *CONST objv[], char *file, \ - int line) -} -declare 26 generic { - Tcl_Obj * Tcl_DbNewLongObj(long longValue, char *file, int line) -} -declare 27 generic { - Tcl_Obj * Tcl_DbNewObj(char *file, int line) -} -declare 28 generic { - Tcl_Obj * Tcl_DbNewStringObj(CONST char *bytes, int length, \ - char *file, int line) -} -declare 29 generic { - Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr) -} -declare 30 generic { - void TclFreeObj(Tcl_Obj *objPtr) -} -declare 31 generic { - int Tcl_GetBoolean(Tcl_Interp *interp, char *str, int *boolPtr) -} -declare 32 generic { - int Tcl_GetBooleanFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, \ - int *boolPtr) -} -declare 33 generic { - unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *lengthPtr) -} -declare 34 generic { - int Tcl_GetDouble(Tcl_Interp *interp, char *str, double *doublePtr) -} -declare 35 generic { - int Tcl_GetDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, \ - double *doublePtr) -} -declare 36 generic { - int Tcl_GetIndexFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, \ - char **tablePtr, char *msg, int flags, int *indexPtr) -} -declare 37 generic { - int Tcl_GetInt(Tcl_Interp *interp, char *str, int *intPtr) -} -declare 38 generic { - int Tcl_GetIntFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr) -} -declare 39 generic { - int Tcl_GetLongFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr) -} -declare 40 generic { - Tcl_ObjType * Tcl_GetObjType(char *typeName) -} -declare 41 generic { - char * Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr) -} -declare 42 generic { - void Tcl_InvalidateStringRep(Tcl_Obj *objPtr) -} -declare 43 generic { - int Tcl_ListObjAppendList(Tcl_Interp *interp, Tcl_Obj *listPtr, \ - Tcl_Obj *elemListPtr) -} -declare 44 generic { - int Tcl_ListObjAppendElement(Tcl_Interp *interp, Tcl_Obj *listPtr, \ - Tcl_Obj *objPtr) -} -declare 45 generic { - int Tcl_ListObjGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, \ - int *objcPtr, Tcl_Obj ***objvPtr) -} -declare 46 generic { - int Tcl_ListObjIndex(Tcl_Interp *interp, Tcl_Obj *listPtr, int index, \ - Tcl_Obj **objPtrPtr) -} -declare 47 generic { - int Tcl_ListObjLength(Tcl_Interp *interp, Tcl_Obj *listPtr, int *intPtr) -} -declare 48 generic { - int Tcl_ListObjReplace(Tcl_Interp *interp, Tcl_Obj *listPtr, int first, \ - int count, int objc, Tcl_Obj *CONST objv[]) -} -declare 49 generic { - Tcl_Obj * Tcl_NewBooleanObj(int boolValue) -} -declare 50 generic { - Tcl_Obj * Tcl_NewByteArrayObj(unsigned char *bytes, int length) -} -declare 51 generic { - Tcl_Obj * Tcl_NewDoubleObj(double doubleValue) -} -declare 52 generic { - Tcl_Obj * Tcl_NewIntObj(int intValue) -} -declare 53 generic { - Tcl_Obj * Tcl_NewListObj(int objc, Tcl_Obj *CONST objv[]) -} -declare 54 generic { - Tcl_Obj * Tcl_NewLongObj(long longValue) -} -declare 55 generic { - Tcl_Obj * Tcl_NewObj(void) -} -declare 56 generic { - Tcl_Obj *Tcl_NewStringObj(CONST char *bytes, int length) -} -declare 57 generic { - void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue) -} -declare 58 generic { - unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length) -} -declare 59 generic { - void Tcl_SetByteArrayObj(Tcl_Obj *objPtr, unsigned char *bytes, int length) -} -declare 60 generic { - void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue) -} -declare 61 generic { - void Tcl_SetIntObj(Tcl_Obj *objPtr, int intValue) -} -declare 62 generic { - void Tcl_SetListObj(Tcl_Obj *objPtr, int objc, Tcl_Obj *CONST objv[]) -} -declare 63 generic { - void Tcl_SetLongObj(Tcl_Obj *objPtr, long longValue) -} -declare 64 generic { - void Tcl_SetObjLength(Tcl_Obj *objPtr, int length) -} -declare 65 generic { - void Tcl_SetStringObj(Tcl_Obj *objPtr, char *bytes, int length) -} -declare 66 generic { - void Tcl_AddErrorInfo(Tcl_Interp *interp, CONST char *message) -} -declare 67 generic { - void Tcl_AddObjErrorInfo(Tcl_Interp *interp, CONST char *message, \ - int length) -} -declare 68 generic { - void Tcl_AllowExceptions(Tcl_Interp *interp) -} -declare 69 generic { - void Tcl_AppendElement(Tcl_Interp *interp, CONST char *string) -} -declare 70 generic { - void Tcl_AppendResult(Tcl_Interp *interp, ...) -} -declare 71 generic { - Tcl_AsyncHandler Tcl_AsyncCreate(Tcl_AsyncProc *proc, \ - ClientData clientData) -} -declare 72 generic { - void Tcl_AsyncDelete(Tcl_AsyncHandler async) -} -declare 73 generic { - int Tcl_AsyncInvoke(Tcl_Interp *interp, int code) -} -declare 74 generic { - void Tcl_AsyncMark(Tcl_AsyncHandler async) -} -declare 75 generic { - int Tcl_AsyncReady(void) -} -declare 76 generic { - void Tcl_BackgroundError(Tcl_Interp *interp) -} -declare 77 generic { - char Tcl_Backslash(CONST char *src, int *readPtr) -} -declare 78 generic { - int Tcl_BadChannelOption(Tcl_Interp *interp, char *optionName, \ - char *optionList) -} -declare 79 generic { - void Tcl_CallWhenDeleted(Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, \ - ClientData clientData) -} -declare 80 generic { - void Tcl_CancelIdleCall(Tcl_IdleProc *idleProc, ClientData clientData) -} -declare 81 generic { - int Tcl_Close(Tcl_Interp *interp, Tcl_Channel chan) -} -declare 82 generic { - int Tcl_CommandComplete(char *cmd) -} -declare 83 generic { - char * Tcl_Concat(int argc, char **argv) -} -declare 84 generic { - int Tcl_ConvertElement(CONST char *src, char *dst, int flags) -} -declare 85 generic { - int Tcl_ConvertCountedElement(CONST char *src, int length, char *dst, \ - int flags) -} -declare 86 generic { - int Tcl_CreateAlias(Tcl_Interp *slave, char *slaveCmd, \ - Tcl_Interp *target, char *targetCmd, int argc, char **argv) -} -declare 87 generic { - int Tcl_CreateAliasObj(Tcl_Interp *slave, char *slaveCmd, \ - Tcl_Interp *target, char *targetCmd, int objc, \ - Tcl_Obj *CONST objv[]) -} -declare 88 generic { - Tcl_Channel Tcl_CreateChannel(Tcl_ChannelType *typePtr, char *chanName, \ - ClientData instanceData, int mask) -} -declare 89 generic { - void Tcl_CreateChannelHandler(Tcl_Channel chan, int mask, \ - Tcl_ChannelProc *proc, ClientData clientData) -} -declare 90 generic { - void Tcl_CreateCloseHandler(Tcl_Channel chan, Tcl_CloseProc *proc, \ - ClientData clientData) -} -declare 91 generic { - Tcl_Command Tcl_CreateCommand(Tcl_Interp *interp, char *cmdName, \ - Tcl_CmdProc *proc, ClientData clientData, \ - Tcl_CmdDeleteProc *deleteProc) -} -declare 92 generic { - void Tcl_CreateEventSource(Tcl_EventSetupProc *setupProc, \ - Tcl_EventCheckProc *checkProc, ClientData clientData) -} -declare 93 generic { - void Tcl_CreateExitHandler(Tcl_ExitProc *proc, ClientData clientData) -} -declare 94 generic { - Tcl_Interp * Tcl_CreateInterp(void) -} -declare 95 generic { - void Tcl_CreateMathFunc(Tcl_Interp *interp, char *name, int numArgs, \ - Tcl_ValueType *argTypes, Tcl_MathProc *proc, ClientData clientData) -} -declare 96 generic { - Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp, char *cmdName, \ - Tcl_ObjCmdProc *proc, ClientData clientData, \ - Tcl_CmdDeleteProc *deleteProc) -} -declare 97 generic { - Tcl_Interp * Tcl_CreateSlave(Tcl_Interp *interp, char *slaveName, \ - int isSafe) -} -declare 98 generic { - Tcl_TimerToken Tcl_CreateTimerHandler(int milliseconds, \ - Tcl_TimerProc *proc, ClientData clientData) -} -declare 99 generic { - Tcl_Trace Tcl_CreateTrace(Tcl_Interp *interp, int level, \ - Tcl_CmdTraceProc *proc, ClientData clientData) -} -declare 100 generic { - void Tcl_DeleteAssocData(Tcl_Interp *interp, char *name) -} -declare 101 generic { - void Tcl_DeleteChannelHandler(Tcl_Channel chan, Tcl_ChannelProc *proc, \ - ClientData clientData) -} -declare 102 generic { - void Tcl_DeleteCloseHandler(Tcl_Channel chan, Tcl_CloseProc *proc, \ - ClientData clientData) -} -declare 103 generic { - int Tcl_DeleteCommand(Tcl_Interp *interp, char *cmdName) -} -declare 104 generic { - int Tcl_DeleteCommandFromToken(Tcl_Interp *interp, Tcl_Command command) -} -declare 105 generic { - void Tcl_DeleteEvents(Tcl_EventDeleteProc *proc, ClientData clientData) -} -declare 106 generic { - void Tcl_DeleteEventSource(Tcl_EventSetupProc *setupProc, \ - Tcl_EventCheckProc *checkProc, ClientData clientData) -} -declare 107 generic { - void Tcl_DeleteExitHandler(Tcl_ExitProc *proc, ClientData clientData) -} -declare 108 generic { - void Tcl_DeleteHashEntry(Tcl_HashEntry *entryPtr) -} -declare 109 generic { - void Tcl_DeleteHashTable(Tcl_HashTable *tablePtr) -} -declare 110 generic { - void Tcl_DeleteInterp(Tcl_Interp *interp) -} -declare 111 generic { - void Tcl_DetachPids(int numPids, Tcl_Pid *pidPtr) -} -declare 112 generic { - void Tcl_DeleteTimerHandler(Tcl_TimerToken token) -} -declare 113 generic { - void Tcl_DeleteTrace(Tcl_Interp *interp, Tcl_Trace trace) -} -declare 114 generic { - void Tcl_DontCallWhenDeleted(Tcl_Interp *interp, \ - Tcl_InterpDeleteProc *proc, ClientData clientData) -} -declare 115 generic { - int Tcl_DoOneEvent(int flags) -} -declare 116 generic { - void Tcl_DoWhenIdle(Tcl_IdleProc *proc, ClientData clientData) -} -declare 117 generic { - char * Tcl_DStringAppend(Tcl_DString *dsPtr, CONST char *str, int length) -} -declare 118 generic { - char * Tcl_DStringAppendElement(Tcl_DString *dsPtr, CONST char *string) -} -declare 119 generic { - void Tcl_DStringEndSublist(Tcl_DString *dsPtr) -} -declare 120 generic { - void Tcl_DStringFree(Tcl_DString *dsPtr) -} -declare 121 generic { - void Tcl_DStringGetResult(Tcl_Interp *interp, Tcl_DString *dsPtr) -} -declare 122 generic { - void Tcl_DStringInit(Tcl_DString *dsPtr) -} -declare 123 generic { - void Tcl_DStringResult(Tcl_Interp *interp, Tcl_DString *dsPtr) -} -declare 124 generic { - void Tcl_DStringSetLength(Tcl_DString *dsPtr, int length) -} -declare 125 generic { - void Tcl_DStringStartSublist(Tcl_DString *dsPtr) -} -declare 126 generic { - int Tcl_Eof(Tcl_Channel chan) -} -declare 127 generic { - char * Tcl_ErrnoId(void) -} -declare 128 generic { - char * Tcl_ErrnoMsg(int err) -} -declare 129 generic { - int Tcl_Eval(Tcl_Interp *interp, char *string) -} -declare 130 generic { - int Tcl_EvalFile(Tcl_Interp *interp, char *fileName) -} -declare 131 generic { - int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr) -} -declare 132 generic { - void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc) -} -declare 133 generic { - void Tcl_Exit(int status) -} -declare 134 generic { - int Tcl_ExposeCommand(Tcl_Interp *interp, char *hiddenCmdToken, \ - char *cmdName) -} -declare 135 generic { - int Tcl_ExprBoolean(Tcl_Interp *interp, char *str, int *ptr) -} -declare 136 generic { - int Tcl_ExprBooleanObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *ptr) -} -declare 137 generic { - int Tcl_ExprDouble(Tcl_Interp *interp, char *str, double *ptr) -} -declare 138 generic { - int Tcl_ExprDoubleObj(Tcl_Interp *interp, Tcl_Obj *objPtr, double *ptr) -} -declare 139 generic { - int Tcl_ExprLong(Tcl_Interp *interp, char *str, long *ptr) -} -declare 140 generic { - int Tcl_ExprLongObj(Tcl_Interp *interp, Tcl_Obj *objPtr, long *ptr) -} -declare 141 generic { - int Tcl_ExprObj(Tcl_Interp *interp, Tcl_Obj *objPtr, \ - Tcl_Obj **resultPtrPtr) -} -declare 142 generic { - int Tcl_ExprString(Tcl_Interp *interp, char *string) -} -declare 143 generic { - void Tcl_Finalize(void) -} -declare 144 generic { - void Tcl_FindExecutable(CONST char *argv0) -} -declare 145 generic { - Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr, \ - Tcl_HashSearch *searchPtr) -} -declare 146 generic { - int Tcl_Flush(Tcl_Channel chan) -} -declare 147 generic { - void Tcl_FreeResult(Tcl_Interp *interp) -} -declare 148 generic { - int Tcl_GetAlias(Tcl_Interp *interp, char *slaveCmd, \ - Tcl_Interp **targetInterpPtr, char **targetCmdPtr, int *argcPtr, \ - char ***argvPtr) -} -declare 149 generic { - int Tcl_GetAliasObj(Tcl_Interp *interp, char *slaveCmd, \ - Tcl_Interp **targetInterpPtr, char **targetCmdPtr, int *objcPtr, \ - Tcl_Obj ***objv) -} -declare 150 generic { - ClientData Tcl_GetAssocData(Tcl_Interp *interp, char *name, \ - Tcl_InterpDeleteProc **procPtr) -} -declare 151 generic { - Tcl_Channel Tcl_GetChannel(Tcl_Interp *interp, char *chanName, \ - int *modePtr) -} -declare 152 generic { - int Tcl_GetChannelBufferSize(Tcl_Channel chan) -} -declare 153 generic { - int Tcl_GetChannelHandle(Tcl_Channel chan, int direction, \ - ClientData *handlePtr) -} -declare 154 generic { - ClientData Tcl_GetChannelInstanceData(Tcl_Channel chan) -} -declare 155 generic { - int Tcl_GetChannelMode(Tcl_Channel chan) -} -declare 156 generic { - char * Tcl_GetChannelName(Tcl_Channel chan) -} -declare 157 generic { - int Tcl_GetChannelOption(Tcl_Interp *interp, Tcl_Channel chan, \ - char *optionName, Tcl_DString *dsPtr) -} -declare 158 generic { - Tcl_ChannelType * Tcl_GetChannelType(Tcl_Channel chan) -} -declare 159 generic { - int Tcl_GetCommandInfo(Tcl_Interp *interp, char *cmdName, \ - Tcl_CmdInfo *infoPtr) -} -declare 160 generic { - char * Tcl_GetCommandName(Tcl_Interp *interp, Tcl_Command command) -} -declare 161 generic { - int Tcl_GetErrno(void) -} -declare 162 generic { - char * Tcl_GetHostName(void) -} -declare 163 generic { - int Tcl_GetInterpPath(Tcl_Interp *askInterp, Tcl_Interp *slaveInterp) -} -declare 164 generic { - Tcl_Interp * Tcl_GetMaster(Tcl_Interp *interp) -} -declare 165 generic { - CONST char * Tcl_GetNameOfExecutable(void) -} -declare 166 generic { - Tcl_Obj * Tcl_GetObjResult(Tcl_Interp *interp) -} - -# Tcl_GetOpenFile is only available on unix, but it is a part of the old -# generic interface, so we inlcude it here for compatibility reasons. - -declare 167 unix { - int Tcl_GetOpenFile(Tcl_Interp *interp, char *str, int write, \ - int checkUsage, ClientData *filePtr) -} - -declare 168 generic { - Tcl_PathType Tcl_GetPathType(char *path) -} -declare 169 generic { - int Tcl_Gets(Tcl_Channel chan, Tcl_DString *dsPtr) -} -declare 170 generic { - int Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr) -} -declare 171 generic { - int Tcl_GetServiceMode(void) -} -declare 172 generic { - Tcl_Interp * Tcl_GetSlave(Tcl_Interp *interp, char *slaveName) -} -declare 173 generic { - Tcl_Channel Tcl_GetStdChannel(int type) -} -declare 174 generic { - char * Tcl_GetStringResult(Tcl_Interp *interp) -} -declare 175 generic { - char * Tcl_GetVar(Tcl_Interp *interp, char *varName, int flags) -} -declare 176 generic { - char * Tcl_GetVar2(Tcl_Interp *interp, char *part1, char *part2, int flags) -} -declare 177 generic { - int Tcl_GlobalEval(Tcl_Interp *interp, char *command) -} -declare 178 generic { - int Tcl_GlobalEvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr) -} -declare 179 generic { - int Tcl_HideCommand(Tcl_Interp *interp, char *cmdName, \ - char *hiddenCmdToken) -} -declare 180 generic { - int Tcl_Init(Tcl_Interp *interp) -} -declare 181 generic { - void Tcl_InitHashTable(Tcl_HashTable *tablePtr, int keyType) -} -declare 182 generic { - int Tcl_InputBlocked(Tcl_Channel chan) -} -declare 183 generic { - int Tcl_InputBuffered(Tcl_Channel chan) -} -declare 184 generic { - int Tcl_InterpDeleted(Tcl_Interp *interp) -} -declare 185 generic { - int Tcl_IsSafe(Tcl_Interp *interp) -} -declare 186 generic { - char * Tcl_JoinPath(int argc, char **argv, Tcl_DString *resultPtr) -} -declare 187 generic { - int Tcl_LinkVar(Tcl_Interp *interp, char *varName, char *addr, int type) -} - -# This slot is reserved for use by the plus patch: -# declare 188 generic { -# Tcl_MainLoop -# } - -declare 189 generic { - Tcl_Channel Tcl_MakeFileChannel(ClientData handle, int mode) -} -declare 190 generic { - int Tcl_MakeSafe(Tcl_Interp *interp) -} -declare 191 generic { - Tcl_Channel Tcl_MakeTcpClientChannel(ClientData tcpSocket) -} -declare 192 generic { - char * Tcl_Merge(int argc, char **argv) -} -declare 193 generic { - Tcl_HashEntry * Tcl_NextHashEntry(Tcl_HashSearch *searchPtr) -} -declare 194 generic { - void Tcl_NotifyChannel(Tcl_Channel channel, int mask) -} -declare 195 generic { - Tcl_Obj * Tcl_ObjGetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, \ - Tcl_Obj *part2Ptr, int flags) -} -declare 196 generic { - Tcl_Obj * Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, \ - Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags) -} -declare 197 generic { - Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp, int argc, \ - char **argv, int flags) -} -declare 198 generic { - Tcl_Channel Tcl_OpenFileChannel(Tcl_Interp *interp, char *fileName, \ - char *modeString, int permissions) -} -declare 199 generic { - Tcl_Channel Tcl_OpenTcpClient(Tcl_Interp *interp, int port, \ - char *address, char *myaddr, int myport, int async) -} -declare 200 generic { - Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port, char *host, \ - Tcl_TcpAcceptProc *acceptProc, ClientData callbackData) -} -declare 201 generic { - void Tcl_Preserve(ClientData data) -} -declare 202 generic { - void Tcl_PrintDouble(Tcl_Interp *interp, double value, char *dst) -} -declare 203 generic { - int Tcl_PutEnv(CONST char *string) -} -declare 204 generic { - char * Tcl_PosixError(Tcl_Interp *interp) -} -declare 205 generic { - void Tcl_QueueEvent(Tcl_Event *evPtr, Tcl_QueuePosition position) -} -declare 206 generic { - int Tcl_Read(Tcl_Channel chan, char *bufPtr, int toRead) -} -declare 207 generic { - void Tcl_ReapDetachedProcs(void) -} -declare 208 generic { - int Tcl_RecordAndEval(Tcl_Interp *interp, char *cmd, int flags) -} -declare 209 generic { - int Tcl_RecordAndEvalObj(Tcl_Interp *interp, Tcl_Obj *cmdPtr, int flags) -} -declare 210 generic { - void Tcl_RegisterChannel(Tcl_Interp *interp, Tcl_Channel chan) -} -declare 211 generic { - void Tcl_RegisterObjType(Tcl_ObjType *typePtr) -} -declare 212 generic { - Tcl_RegExp Tcl_RegExpCompile(Tcl_Interp *interp, char *string) -} -declare 213 generic { - int Tcl_RegExpExec(Tcl_Interp *interp, Tcl_RegExp regexp, \ - CONST char *str, CONST char *start) -} -declare 214 generic { - int Tcl_RegExpMatch(Tcl_Interp *interp, char *str, char *pattern) -} -declare 215 generic { - void Tcl_RegExpRange(Tcl_RegExp regexp, int index, char **startPtr, \ - char **endPtr) -} -declare 216 generic { - void Tcl_Release(ClientData clientData) -} -declare 217 generic { - void Tcl_ResetResult(Tcl_Interp *interp) -} -declare 218 generic { - int Tcl_ScanElement(CONST char *str, int *flagPtr) -} -declare 219 generic { - int Tcl_ScanCountedElement(CONST char *str, int length, int *flagPtr) -} -declare 220 generic { - int Tcl_Seek(Tcl_Channel chan, int offset, int mode) -} -declare 221 generic { - int Tcl_ServiceAll(void) -} -declare 222 generic { - int Tcl_ServiceEvent(int flags) -} -declare 223 generic { - void Tcl_SetAssocData(Tcl_Interp *interp, char *name, \ - Tcl_InterpDeleteProc *proc, ClientData clientData) -} -declare 224 generic { - void Tcl_SetChannelBufferSize(Tcl_Channel chan, int sz) -} -declare 225 generic { - int Tcl_SetChannelOption(Tcl_Interp *interp, Tcl_Channel chan, \ - char *optionName, char *newValue) -} -declare 226 generic { - int Tcl_SetCommandInfo(Tcl_Interp *interp, char *cmdName, \ - Tcl_CmdInfo *infoPtr) -} -declare 227 generic { - void Tcl_SetErrno(int err) -} -declare 228 generic { - void Tcl_SetErrorCode(Tcl_Interp *interp, ...) -} -declare 229 generic { - void Tcl_SetMaxBlockTime(Tcl_Time *timePtr) -} -declare 230 generic { - void Tcl_SetPanicProc(Tcl_PanicProc *panicProc) -} -declare 231 generic { - int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth) -} -declare 232 generic { - void Tcl_SetResult(Tcl_Interp *interp, char *str, \ - Tcl_FreeProc *freeProc) -} -declare 233 generic { - int Tcl_SetServiceMode(int mode) -} -declare 234 generic { - void Tcl_SetObjErrorCode(Tcl_Interp *interp, Tcl_Obj *errorObjPtr) -} -declare 235 generic { - void Tcl_SetObjResult(Tcl_Interp *interp, Tcl_Obj *resultObjPtr) -} -declare 236 generic { - void Tcl_SetStdChannel(Tcl_Channel channel, int type) -} -declare 237 generic { - char * Tcl_SetVar(Tcl_Interp *interp, char *varName, char *newValue, \ - int flags) -} -declare 238 generic { - char * Tcl_SetVar2(Tcl_Interp *interp, char *part1, char *part2, \ - char *newValue, int flags) -} -declare 239 generic { - char * Tcl_SignalId(int sig) -} -declare 240 generic { - char * Tcl_SignalMsg(int sig) -} -declare 241 generic { - void Tcl_SourceRCFile(Tcl_Interp *interp) -} -declare 242 generic { - int Tcl_SplitList(Tcl_Interp *interp, CONST char *listStr, int *argcPtr, \ - char ***argvPtr) -} -declare 243 generic { - void Tcl_SplitPath(CONST char *path, int *argcPtr, char ***argvPtr) -} -declare 244 generic { - void Tcl_StaticPackage(Tcl_Interp *interp, char *pkgName, \ - Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc) -} -declare 245 generic { - int Tcl_StringMatch(CONST char *str, CONST char *pattern) -} -declare 246 generic { - int Tcl_Tell(Tcl_Channel chan) -} -declare 247 generic { - int Tcl_TraceVar(Tcl_Interp *interp, char *varName, int flags, \ - Tcl_VarTraceProc *proc, ClientData clientData) -} -declare 248 generic { - int Tcl_TraceVar2(Tcl_Interp *interp, char *part1, char *part2, \ - int flags, Tcl_VarTraceProc *proc, ClientData clientData) -} -declare 249 generic { - char * Tcl_TranslateFileName(Tcl_Interp *interp, char *name, \ - Tcl_DString *bufferPtr) -} -declare 250 generic { - int Tcl_Ungets(Tcl_Channel chan, char *str, int len, int atHead) -} -declare 251 generic { - void Tcl_UnlinkVar(Tcl_Interp *interp, char *varName) -} -declare 252 generic { - int Tcl_UnregisterChannel(Tcl_Interp *interp, Tcl_Channel chan) -} -declare 253 generic { - int Tcl_UnsetVar(Tcl_Interp *interp, char *varName, int flags) -} -declare 254 generic { - int Tcl_UnsetVar2(Tcl_Interp *interp, char *part1, char *part2, int flags) -} -declare 255 generic { - void Tcl_UntraceVar(Tcl_Interp *interp, char *varName, int flags, \ - Tcl_VarTraceProc *proc, ClientData clientData) -} -declare 256 generic { - void Tcl_UntraceVar2(Tcl_Interp *interp, char *part1, char *part2, \ - int flags, Tcl_VarTraceProc *proc, ClientData clientData) -} -declare 257 generic { - void Tcl_UpdateLinkedVar(Tcl_Interp *interp, char *varName) -} -declare 258 generic { - int Tcl_UpVar(Tcl_Interp *interp, char *frameName, char *varName, \ - char *localName, int flags) -} -declare 259 generic { - int Tcl_UpVar2(Tcl_Interp *interp, char *frameName, char *part1, \ - char *part2, char *localName, int flags) -} -declare 260 generic { - int Tcl_VarEval(Tcl_Interp *interp, ...) -} -declare 261 generic { - ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, char *varName, \ - int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData) -} -declare 262 generic { - ClientData Tcl_VarTraceInfo2(Tcl_Interp *interp, char *part1, \ - char *part2, int flags, Tcl_VarTraceProc *procPtr, \ - ClientData prevClientData) -} -declare 263 generic { - int Tcl_Write(Tcl_Channel chan, char *s, int slen) -} -declare 264 generic { - void Tcl_WrongNumArgs(Tcl_Interp *interp, int objc, \ - Tcl_Obj *CONST objv[], char *message) -} -declare 265 generic { - int Tcl_DumpActiveMemory(char *fileName) -} -declare 266 generic { - void Tcl_ValidateAllMemory(char *file, int line) -} -declare 267 generic { - void Tcl_AppendResultVA(Tcl_Interp *interp, va_list argList) -} -declare 268 generic { - void Tcl_AppendStringsToObjVA(Tcl_Obj *objPtr, va_list argList) -} -declare 269 generic { - char * Tcl_HashStats(Tcl_HashTable *tablePtr) -} -declare 270 generic { - char * Tcl_ParseVar(Tcl_Interp *interp, char *str, char **termPtr) -} -declare 271 generic { - char * Tcl_PkgPresent(Tcl_Interp *interp, char *name, char *version, \ - int exact) -} -declare 272 generic { - char * Tcl_PkgPresentEx(Tcl_Interp *interp, char *name, char *version, \ - int exact, ClientData *clientDataPtr) -} -declare 273 generic { - int Tcl_PkgProvide(Tcl_Interp *interp, char *name, char *version) -} -declare 274 generic { - char * Tcl_PkgRequire(Tcl_Interp *interp, char *name, char *version, \ - int exact) -} -declare 275 generic { - void Tcl_SetErrorCodeVA(Tcl_Interp *interp, va_list argList) -} -declare 276 generic { - int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList) -} -declare 277 generic { - Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options) -} -declare 278 generic { - void Tcl_PanicVA(char *format, va_list argList) -} -declare 279 generic { - void Tcl_GetVersion(int *major, int *minor, int *patchLevel, int *type) -} -declare 280 generic { - void Tcl_InitMemory(Tcl_Interp *interp) -} - -# Reserved for future use (8.0.x vs. 8.1) -# declare 281 generic { -# } -# declare 282 generic { -# } -# declare 283 generic { -# } -# declare 284 generic { -# } -# declare 285 generic { -# } - - -# Added in 8.1: - -declare 286 generic { - void Tcl_AppendObjToObj(Tcl_Obj *objPtr, Tcl_Obj *appendObjPtr) -} -declare 287 generic { - Tcl_Encoding Tcl_CreateEncoding(Tcl_EncodingType *typePtr) -} -declare 288 generic { - void Tcl_CreateThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData) -} -declare 289 generic { - void Tcl_DeleteThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData) -} -declare 290 generic { - void Tcl_DiscardResult(Tcl_SavedResult *statePtr) -} -declare 291 generic { - int Tcl_EvalEx(Tcl_Interp *interp, char *script, int numBytes, int flags) -} -declare 292 generic { - int Tcl_EvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], \ - int flags) -} -declare 293 generic { - int Tcl_EvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags) -} -declare 294 generic { - void Tcl_ExitThread(int status) -} -declare 295 generic { - int Tcl_ExternalToUtf(Tcl_Interp *interp, Tcl_Encoding encoding, \ - CONST char *src, int srcLen, int flags, \ - Tcl_EncodingState *statePtr, char *dst, int dstLen, \ - int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr) -} -declare 296 generic { - char * Tcl_ExternalToUtfDString(Tcl_Encoding encoding, CONST char *src, \ - int srcLen, Tcl_DString *dsPtr) -} -declare 297 generic { - void Tcl_FinalizeThread(void) -} -declare 298 generic { - void Tcl_FinalizeNotifier(ClientData clientData) -} -declare 299 generic { - void Tcl_FreeEncoding(Tcl_Encoding encoding) -} -declare 300 generic { - Tcl_ThreadId Tcl_GetCurrentThread(void) -} -declare 301 generic { - Tcl_Encoding Tcl_GetEncoding(Tcl_Interp *interp, CONST char *name) -} -declare 302 generic { - char * Tcl_GetEncodingName(Tcl_Encoding encoding) -} -declare 303 generic { - void Tcl_GetEncodingNames(Tcl_Interp *interp) -} -declare 304 generic { - int Tcl_GetIndexFromObjStruct(Tcl_Interp *interp, Tcl_Obj *objPtr, \ - char **tablePtr, int offset, char *msg, int flags, int *indexPtr) -} -declare 305 generic { - VOID * Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, int size) -} -declare 306 generic { - Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, char *part1, char *part2, \ - int flags) -} -declare 307 generic { - ClientData Tcl_InitNotifier(void) -} -declare 308 generic { - void Tcl_MutexLock(Tcl_Mutex *mutexPtr) -} -declare 309 generic { - void Tcl_MutexUnlock(Tcl_Mutex *mutexPtr) -} -declare 310 generic { - void Tcl_ConditionNotify(Tcl_Condition *condPtr) -} -declare 311 generic { - void Tcl_ConditionWait(Tcl_Condition *condPtr, Tcl_Mutex *mutexPtr, \ - Tcl_Time *timePtr) -} -declare 312 generic { - int Tcl_NumUtfChars(CONST char *src, int len) -} -declare 313 generic { - int Tcl_ReadChars(Tcl_Channel channel, Tcl_Obj *objPtr, int charsToRead, \ - int appendFlag) -} -declare 314 generic { - void Tcl_RestoreResult(Tcl_Interp *interp, Tcl_SavedResult *statePtr) -} -declare 315 generic { - void Tcl_SaveResult(Tcl_Interp *interp, Tcl_SavedResult *statePtr) -} -declare 316 generic { - int Tcl_SetSystemEncoding(Tcl_Interp *interp, CONST char *name) -} -declare 317 generic { - Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, char *part1, char *part2, \ - Tcl_Obj *newValuePtr, int flags) -} -declare 318 generic { - void Tcl_ThreadAlert(Tcl_ThreadId threadId) -} -declare 319 generic { - void Tcl_ThreadQueueEvent(Tcl_ThreadId threadId, Tcl_Event* evPtr, \ - Tcl_QueuePosition position) -} -declare 320 generic { - Tcl_UniChar Tcl_UniCharAtIndex(CONST char *src, int index) -} -declare 321 generic { - Tcl_UniChar Tcl_UniCharToLower(int ch) -} -declare 322 generic { - Tcl_UniChar Tcl_UniCharToTitle(int ch) -} -declare 323 generic { - Tcl_UniChar Tcl_UniCharToUpper(int ch) -} -declare 324 generic { - int Tcl_UniCharToUtf(int ch, char *buf) -} -declare 325 generic { - char * Tcl_UtfAtIndex(CONST char *src, int index) -} -declare 326 generic { - int Tcl_UtfCharComplete(CONST char *src, int len) -} -declare 327 generic { - int Tcl_UtfBackslash(CONST char *src, int *readPtr, char *dst) -} -declare 328 generic { - char * Tcl_UtfFindFirst(CONST char *src, int ch) -} -declare 329 generic { - char * Tcl_UtfFindLast(CONST char *src, int ch) -} -declare 330 generic { - char * Tcl_UtfNext(CONST char *src) -} -declare 331 generic { - char * Tcl_UtfPrev(CONST char *src, CONST char *start) -} -declare 332 generic { - int Tcl_UtfToExternal(Tcl_Interp *interp, Tcl_Encoding encoding, \ - CONST char *src, int srcLen, int flags, \ - Tcl_EncodingState *statePtr, char *dst, int dstLen, \ - int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr) -} -declare 333 generic { - char * Tcl_UtfToExternalDString(Tcl_Encoding encoding, CONST char *src, \ - int srcLen, Tcl_DString *dsPtr) -} -declare 334 generic { - int Tcl_UtfToLower(char *src) -} -declare 335 generic { - int Tcl_UtfToTitle(char *src) -} -declare 336 generic { - int Tcl_UtfToUniChar(CONST char *src, Tcl_UniChar *chPtr) -} -declare 337 generic { - int Tcl_UtfToUpper(char *src) -} -declare 338 generic { - int Tcl_WriteChars(Tcl_Channel chan, CONST char *src, int srcLen) -} -declare 339 generic { - int Tcl_WriteObj(Tcl_Channel chan, Tcl_Obj *objPtr) -} -declare 340 generic { - char * Tcl_GetString(Tcl_Obj *objPtr) -} -declare 341 generic { - char * Tcl_GetDefaultEncodingDir(void) -} -declare 342 generic { - void Tcl_SetDefaultEncodingDir(char *path) -} -declare 343 generic { - void Tcl_AlertNotifier(ClientData clientData) -} -declare 344 generic { - void Tcl_ServiceModeHook(int mode) -} -declare 345 generic { - int Tcl_UniCharIsAlnum(int ch) -} -declare 346 generic { - int Tcl_UniCharIsAlpha(int ch) -} -declare 347 generic { - int Tcl_UniCharIsDigit(int ch) -} -declare 348 generic { - int Tcl_UniCharIsLower(int ch) -} -declare 349 generic { - int Tcl_UniCharIsSpace(int ch) -} -declare 350 generic { - int Tcl_UniCharIsUpper(int ch) -} -declare 351 generic { - int Tcl_UniCharIsWordChar(int ch) -} -declare 352 generic { - int Tcl_UniCharLen(Tcl_UniChar *str) -} -declare 353 generic { - int Tcl_UniCharNcmp(const Tcl_UniChar *cs, const Tcl_UniChar *ct, size_t n) -} -declare 354 generic { - char * Tcl_UniCharToUtfDString(CONST Tcl_UniChar *string, int numChars, \ - Tcl_DString *dsPtr) -} -declare 355 generic { - Tcl_UniChar * Tcl_UtfToUniCharDString(CONST char *string, int length, \ - Tcl_DString *dsPtr) -} -declare 356 generic { - Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, Tcl_Obj *patObj, int flags) -} - -declare 357 generic { - Tcl_Obj *Tcl_EvalTokens (Tcl_Interp *interp, Tcl_Token *tokenPtr, \ - int count) -} -declare 358 generic { - void Tcl_FreeParse (Tcl_Parse *parsePtr) -} -declare 359 generic { - void Tcl_LogCommandInfo (Tcl_Interp *interp, char *script, \ - char *command, int length) -} -declare 360 generic { - int Tcl_ParseBraces (Tcl_Interp *interp, char *string, \ - int numBytes, Tcl_Parse *parsePtr,int append, char **termPtr) -} -declare 361 generic { - int Tcl_ParseCommand (Tcl_Interp *interp, char *string, int numBytes, \ - int nested, Tcl_Parse *parsePtr) -} -declare 362 generic { - int Tcl_ParseExpr(Tcl_Interp *interp, char *string, int numBytes, \ - Tcl_Parse *parsePtr) -} -declare 363 generic { - int Tcl_ParseQuotedString(Tcl_Interp *interp, char *string, int numBytes, \ - Tcl_Parse *parsePtr, int append, char **termPtr) -} -declare 364 generic { - int Tcl_ParseVarName (Tcl_Interp *interp, char *string, \ - int numBytes, Tcl_Parse *parsePtr, int append) -} -declare 365 generic { - char *Tcl_GetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr) -} -declare 366 generic { - int Tcl_Chdir(CONST char *dirName) -} - -############################################################################## - -# Define the platform specific public Tcl interface. These functions are -# only available on the designated platform. - -interface tclPlat - -###################### -# Windows declarations - -# Added in Tcl 8.1 - -declare 0 win { - TCHAR * Tcl_WinUtfToTChar(CONST char *str, int len, Tcl_DString *dsPtr) -} -declare 1 win { - char * Tcl_WinTCharToUtf(CONST TCHAR *str, int len, Tcl_DString *dsPtr) -} - -################## -# Mac declarations - -# This is needed by the shells to handle Macintosh events. - -declare 0 mac { - void Tcl_MacSetEventProc(Tcl_MacConvertEventPtr procPtr) -} - -# These routines are useful for handling using scripts from resources -# in the application shell - -declare 1 mac { - char * Tcl_MacConvertTextResource(Handle resource) -} -declare 2 mac { - int Tcl_MacEvalResource(Tcl_Interp *interp, char *resourceName, \ - int resourceNumber, char *fileName) -} -declare 3 mac { - Handle Tcl_MacFindResource(Tcl_Interp *interp, long resourceType, \ - char *resourceName, int resourceNumber, char *resFileRef, \ - int * releaseIt) -} - -# These routines support the new OSType object type (i.e. the packed 4 -# character type and creator codes). - -declare 4 mac { - int Tcl_GetOSTypeFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, \ - OSType *osTypePtr) -} -declare 5 mac { - void Tcl_SetOSTypeObj(Tcl_Obj *objPtr, OSType osType) -} -declare 6 mac { - Tcl_Obj * Tcl_NewOSTypeObj(OSType osType) -} - -# These are not in MSL 2.1.2, so we need to export them from the -# Tcl shared library. They are found in the compat directory -# except the panic routine which is found in tclMacPanic.h. - -declare 7 mac { - int strncasecmp(CONST char *s1, CONST char *s2, size_t n) -} -declare 8 mac { - int strcasecmp(CONST char *s1, CONST char *s2) -} diff --git a/generic/tcl.h b/generic/tcl.h deleted file mode 100644 index 2a8be54..0000000 --- a/generic/tcl.h +++ /dev/null @@ -1,1520 +0,0 @@ -/* - * tcl.h -- - * - * This header file describes the externally-visible facilities - * of the Tcl interpreter. - * - * Copyright (c) 1987-1994 The Regents of the University of California. - * Copyright (c) 1993-1996 Lucent Technologies. - * Copyright (c) 1994-1998 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. - * - * RCS: @(#) $Id: tcl.h,v 1.39 1999/04/16 00:46:42 stanton Exp $ - */ - -#ifndef _TCL -#define _TCL - -/* - * The following defines are used to indicate the various release levels. - */ - -#define TCL_ALPHA_RELEASE 0 -#define TCL_BETA_RELEASE 1 -#define TCL_FINAL_RELEASE 2 - -/* - * When version numbers change here, must also go into the following files - * and update the version numbers: - * - * library/init.tcl (only if major.minor changes, not patchlevel) - * unix/configure.in - * win/makefile.bc (only if major.minor changes, not patchlevel) - * win/makefile.vc (only if major.minor changes, not patchlevel) - * win/pkgIndex.tcl (for tclregNN.dll, not patchlevel) - * README - * mac/README - * win/README.binary - * win/README (only if major.minor changes, not patchlevel) - * unix/README (only if major.minor changes, not patchlevel) - */ - -#define TCL_MAJOR_VERSION 8 -#define TCL_MINOR_VERSION 1 -#define TCL_RELEASE_LEVEL TCL_BETA_RELEASE -#define TCL_RELEASE_SERIAL 3 - -#define TCL_VERSION "8.1" -#define TCL_PATCH_LEVEL "8.1b3" - -/* - * The following definitions set up the proper options for Windows - * compilers. We use this method because there is no autoconf equivalent. - */ - -#ifndef __WIN32__ -# if defined(_WIN32) || defined(WIN32) -# define __WIN32__ -# endif -#endif - -#ifdef __WIN32__ -# ifndef STRICT -# define STRICT -# endif -# ifndef USE_PROTOTYPE -# define USE_PROTOTYPE 1 -# endif -# ifndef HAS_STDARG -# define HAS_STDARG 1 -# endif -# ifndef USE_PROTOTYPE -# define USE_PROTOTYPE 1 -# endif - -/* - * Under Windows we need to call Tcl_Alloc in all cases to avoid competing - * C run-time library issues. - */ - -# ifndef USE_TCLALLOC -# define USE_TCLALLOC 1 -# endif -#endif /* __WIN32__ */ - -/* - * The following definitions set up the proper options for Macintosh - * compilers. We use this method because there is no autoconf equivalent. - */ - -#ifdef MAC_TCL -# ifndef HAS_STDARG -# define HAS_STDARG 1 -# endif -# ifndef USE_TCLALLOC -# define USE_TCLALLOC 1 -# endif -# ifndef NO_STRERROR -# define NO_STRERROR 1 -# endif -# define INLINE -#endif - -/* - * Utility macros: STRINGIFY takes an argument and wraps it in "" (double - * quotation marks), JOIN joins two arguments. - */ - -#define VERBATIM(x) x -#ifdef _MSC_VER -# define STRINGIFY(x) STRINGIFY1(x) -# define STRINGIFY1(x) #x -# define JOIN(a,b) JOIN1(a,b) -# define JOIN1(a,b) a##b -#else -# ifdef RESOURCE_INCLUDED -# define STRINGIFY(x) STRINGIFY1(x) -# define STRINGIFY1(x) #x -# define JOIN(a,b) JOIN1(a,b) -# define JOIN1(a,b) a##b -# else -# ifdef __STDC__ -# define STRINGIFY(x) #x -# define JOIN(a,b) a##b -# else -# define STRINGIFY(x) "x" -# define JOIN(a,b) VERBATIM(a)VERBATIM(b) -# endif -# endif -#endif - -/* - * Special macro to define mutexes, that doesn't do anything - * if we are not using threads. - */ - -#ifdef TCL_THREADS -#define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name; -#else -#define TCL_DECLARE_MUTEX(name) -#endif - -/* - * Macros that eliminate the overhead of the thread synchronization - * functions when compiling without thread support. - */ - -#ifndef TCL_THREADS -#define Tcl_MutexLock(mutexPtr) -#define Tcl_MutexUnlock(mutexPtr) -#define Tcl_ConditionNotify(condPtr) -#define Tcl_ConditionWait(condPtr, mutexPtr, timePtr) -#endif /* TCL_THREADS */ - -/* - * A special definition used to allow this header file to be included - * in resource files so that they can get obtain version information from - * this file. Resource compilers don't like all the C stuff, like typedefs - * and procedure declarations, that occur below. - */ - -#ifndef RESOURCE_INCLUDED - -#ifndef BUFSIZ -#include -#endif - -/* - * Definitions that allow Tcl functions with variable numbers of - * arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS - * is used in procedure prototypes. TCL_VARARGS_DEF is used to declare - * the arguments in a function definiton: it takes the type and name of - * the first argument and supplies the appropriate argument declaration - * string for use in the function definition. TCL_VARARGS_START - * initializes the va_list data structure and returns the first argument. - */ - -#if defined(__STDC__) || defined(HAS_STDARG) -# include - -# define TCL_VARARGS(type, name) (type name, ...) -# define TCL_VARARGS_DEF(type, name) (type name, ...) -# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name) -#else -# include - -# ifdef __cplusplus -# define TCL_VARARGS(type, name) (type name, ...) -# define TCL_VARARGS_DEF(type, name) (type va_alist, ...) -# else -# define TCL_VARARGS(type, name) () -# define TCL_VARARGS_DEF(type, name) (va_alist) -# endif -# define TCL_VARARGS_START(type, name, list) \ - (va_start(list), va_arg(list, type)) -#endif - -/* - * Macros used to declare a function to be exported by a DLL. - * Used by Windows, maps to no-op declarations on non-Windows systems. - * The default build on windows is for a DLL, which causes the DLLIMPORT - * and DLLEXPORT macros to be nonempty. To build a static library, the - * macro STATIC_BUILD should be defined. - */ - -#ifdef STATIC_BUILD -# define DLLIMPORT -# define DLLEXPORT -#else -# if defined(__WIN32__) && (defined(_MSC_VER) || (defined(__GNUC__) && defined(__declspec))) -# define DLLIMPORT __declspec(dllimport) -# define DLLEXPORT __declspec(dllexport) -# else -# define DLLIMPORT -# define DLLEXPORT -# endif -#endif - -/* - * These macros are used to control whether functions are being declared for - * import or export. If a function is being declared while it is being built - * to be included in a shared library, then it should have the DLLEXPORT - * storage class. If is being declared for use by a module that is going to - * link against the shared library, then it should have the DLLIMPORT storage - * class. If the symbol is beind declared for a static build or for use from a - * stub library, then the storage class should be empty. - * - * The convention is that a macro called BUILD_xxxx, where xxxx is the - * name of a library we are building, is set on the compile line for sources - * that are to be placed in the library. When this macro is set, the - * storage class will be set to DLLEXPORT. At the end of the header file, the - * storage class will be reset to DLLIMPORt. - */ - -#undef TCL_STORAGE_CLASS -#ifdef BUILD_tcl -# define TCL_STORAGE_CLASS DLLEXPORT -#else -# ifdef USE_TCL_STUBS -# define TCL_STORAGE_CLASS -# else -# define TCL_STORAGE_CLASS DLLIMPORT -# endif -#endif - -/* - * Definitions that allow this header file to be used either with or - * without ANSI C features like function prototypes. - */ - -#undef _ANSI_ARGS_ -#undef CONST -#ifndef INLINE -# define INLINE -#endif - -#if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE) -# define _USING_PROTOTYPES_ 1 -# define _ANSI_ARGS_(x) x -# define CONST const -#else -# define _ANSI_ARGS_(x) () -# define CONST -#endif - -#ifdef __cplusplus -# define EXTERN extern "C" TCL_STORAGE_CLASS -#else -# define EXTERN extern TCL_STORAGE_CLASS -#endif - -/* - * Macro to use instead of "void" for arguments that must have - * type "void *" in ANSI C; maps them to type "char *" in - * non-ANSI systems. - */ -#ifndef __WIN32__ -#ifndef VOID -# ifdef __STDC__ -# define VOID void -# else -# define VOID char -# endif -#endif -#else /* __WIN32__ */ -/* - * The following code is copied from winnt.h - */ -#ifndef VOID -#define VOID void -typedef char CHAR; -typedef short SHORT; -typedef long LONG; -#endif -#endif /* __WIN32__ */ - -/* - * Miscellaneous declarations. - */ - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef _CLIENTDATA -# if defined(__STDC__) || defined(__cplusplus) - typedef void *ClientData; -# else - typedef int *ClientData; -# endif /* __STDC__ */ -#define _CLIENTDATA -#endif - -/* - * Data structures defined opaquely in this module. The definitions below - * just provide dummy types. A few fields are made visible in Tcl_Interp - * structures, namely those used for returning a string result from - * commands. Direct access to the result field is discouraged in Tcl 8.0. - * The interpreter result is either an object or a string, and the two - * values are kept consistent unless some C code sets interp->result - * directly. Programmers should use either the procedure Tcl_GetObjResult() - * or Tcl_GetStringResult() to read the interpreter's result. See the - * SetResult man page for details. - * - * Note: any change to the Tcl_Interp definition below must be mirrored - * in the "real" definition in tclInt.h. - * - * Note: Tcl_ObjCmdProc procedures do not directly set result and freeProc. - * Instead, they set a Tcl_Obj member in the "real" structure that can be - * accessed with Tcl_GetObjResult() and Tcl_SetObjResult(). - */ - -typedef struct Tcl_Interp { - char *result; /* If the last command returned a string - * result, this points to it. */ - void (*freeProc) _ANSI_ARGS_((char *blockPtr)); - /* Zero means the string result is - * statically allocated. TCL_DYNAMIC means - * it was allocated with ckalloc and should - * be freed with ckfree. Other values give - * the address of procedure to invoke to - * free the result. Tcl_Eval must free it - * before executing next command. */ - int errorLine; /* When TCL_ERROR is returned, this gives - * the line number within the command where - * the error occurred (1 if first line). */ -} Tcl_Interp; - -typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; -typedef struct Tcl_Channel_ *Tcl_Channel; -typedef struct Tcl_Command_ *Tcl_Command; -typedef struct Tcl_Condition_ *Tcl_Condition; -typedef struct Tcl_EncodingState_ *Tcl_EncodingState; -typedef struct Tcl_Encoding_ *Tcl_Encoding; -typedef struct Tcl_Event Tcl_Event; -typedef struct Tcl_Mutex_ *Tcl_Mutex; -typedef struct Tcl_Pid_ *Tcl_Pid; -typedef struct Tcl_RegExp_ *Tcl_RegExp; -typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey; -typedef struct Tcl_ThreadId_ *Tcl_ThreadId; -typedef struct Tcl_TimerToken_ *Tcl_TimerToken; -typedef struct Tcl_Trace_ *Tcl_Trace; -typedef struct Tcl_Var_ *Tcl_Var; - -/* - * When a TCL command returns, the interpreter contains a result from the - * command. Programmers are strongly encouraged to use one of the - * procedures Tcl_GetObjResult() or Tcl_GetStringResult() to read the - * interpreter's result. See the SetResult man page for details. Besides - * this result, the command procedure returns an integer code, which is - * one of the following: - * - * TCL_OK Command completed normally; the interpreter's - * result contains the command's result. - * TCL_ERROR The command couldn't be completed successfully; - * the interpreter's result describes what went wrong. - * TCL_RETURN The command requests that the current procedure - * return; the interpreter's result contains the - * procedure's return value. - * TCL_BREAK The command requests that the innermost loop - * be exited; the interpreter's result is meaningless. - * TCL_CONTINUE Go on to the next iteration of the current loop; - * the interpreter's result is meaningless. - */ - -#define TCL_OK 0 -#define TCL_ERROR 1 -#define TCL_RETURN 2 -#define TCL_BREAK 3 -#define TCL_CONTINUE 4 - -#define TCL_RESULT_SIZE 200 - -/* - * Argument descriptors for math function callbacks in expressions: - */ - -typedef enum {TCL_INT, TCL_DOUBLE, TCL_EITHER} Tcl_ValueType; -typedef struct Tcl_Value { - Tcl_ValueType type; /* Indicates intValue or doubleValue is - * valid, or both. */ - long intValue; /* Integer value. */ - double doubleValue; /* Double-precision floating value. */ -} Tcl_Value; - -/* - * Forward declaration of Tcl_Obj to prevent an error when the forward - * reference to Tcl_Obj is encountered in the procedure types declared - * below. - */ - -struct Tcl_Obj; - -/* - * Procedure types defined by Tcl: - */ - -typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); -typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int code)); -typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask)); -typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data)); -typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData)); -typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char *argv[])); -typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc, - ClientData cmdClientData, int argc, char *argv[])); -typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, - struct Tcl_Obj *dupPtr)); -typedef int (Tcl_EncodingConvertProc)_ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, - char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -typedef void (Tcl_EncodingFreeProc)_ANSI_ARGS_((ClientData clientData)); -typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags)); -typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData, - int flags)); -typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr, - ClientData clientData)); -typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData, - int flags)); -typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData)); -typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask)); -typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData)); -typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); -typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr)); -typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData)); -typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp)); -typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr)); -typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData)); -typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[])); -typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); -typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(char *, format)); -typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData, - Tcl_Channel chan, char *address, int port)); -typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData)); -typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp, - struct Tcl_Obj *objPtr)); -typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); -typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *part1, char *part2, int flags)); - -/* - * The following structure represents a type of object, which is a - * particular internal representation for an object plus a set of - * procedures that provide standard operations on objects of that type. - */ - -typedef struct Tcl_ObjType { - char *name; /* Name of the type, e.g. "int". */ - Tcl_FreeInternalRepProc *freeIntRepProc; - /* Called to free any storage for the type's - * internal rep. NULL if the internal rep - * does not need freeing. */ - Tcl_DupInternalRepProc *dupIntRepProc; - /* Called to create a new object as a copy - * of an existing object. */ - Tcl_UpdateStringProc *updateStringProc; - /* Called to update the string rep from the - * type's internal representation. */ - Tcl_SetFromAnyProc *setFromAnyProc; - /* Called to convert the object's internal - * rep to this type. Frees the internal rep - * of the old type. Returns TCL_ERROR on - * failure. */ -} Tcl_ObjType; - -/* - * One of the following structures exists for each object in the Tcl - * system. An object stores a value as either a string, some internal - * representation, or both. - */ - -typedef struct Tcl_Obj { - int refCount; /* When 0 the object will be freed. */ - char *bytes; /* This points to the first byte of the - * object's string representation. The array - * must be followed by a null byte (i.e., at - * offset length) but may also contain - * embedded null characters. The array's - * storage is allocated by ckalloc. NULL - * means the string rep is invalid and must - * be regenerated from the internal rep. - * Clients should use Tcl_GetStringFromObj - * or Tcl_GetString to get a pointer to the - * byte array as a readonly value. */ - int length; /* The number of bytes at *bytes, not - * including the terminating null. */ - Tcl_ObjType *typePtr; /* Denotes the object's type. Always - * corresponds to the type of the object's - * internal rep. NULL indicates the object - * has no internal rep (has no type). */ - union { /* The internal representation: */ - long longValue; /* - an long integer value */ - double doubleValue; /* - a double-precision floating value */ - VOID *otherValuePtr; /* - another, type-specific value */ - struct { /* - internal rep as two pointers */ - VOID *ptr1; - VOID *ptr2; - } twoPtrValue; - } internalRep; -} Tcl_Obj; - -/* - * Macros to increment and decrement a Tcl_Obj's reference count, and to - * test whether an object is shared (i.e. has reference count > 1). - * Note: clients should use Tcl_DecrRefCount() when they are finished using - * an object, and should never call TclFreeObj() directly. TclFreeObj() is - * only defined and made public in tcl.h to support Tcl_DecrRefCount's macro - * definition. Note also that Tcl_DecrRefCount() refers to the parameter - * "obj" twice. This means that you should avoid calling it with an - * expression that is expensive to compute or has side effects. - */ - -EXTERN void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); -EXTERN void Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); -EXTERN int Tcl_IsShared _ANSI_ARGS_((Tcl_Obj *objPtr)); - -#ifdef TCL_MEM_DEBUG -# define Tcl_IncrRefCount(objPtr) \ - Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__) -# define Tcl_DecrRefCount(objPtr) \ - Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__) -# define Tcl_IsShared(objPtr) \ - Tcl_DbIsShared(objPtr, __FILE__, __LINE__) -#else -# define Tcl_IncrRefCount(objPtr) \ - ++(objPtr)->refCount -# define Tcl_DecrRefCount(objPtr) \ - if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr) -# define Tcl_IsShared(objPtr) \ - ((objPtr)->refCount > 1) -#endif - -/* - * Macros and definitions that help to debug the use of Tcl objects. - * When TCL_MEM_DEBUG is defined, the Tcl_New declarations are - * overridden to call debugging versions of the object creation procedures. - */ - -#ifdef TCL_MEM_DEBUG -# define Tcl_NewBooleanObj(val) \ - Tcl_DbNewBooleanObj(val, __FILE__, __LINE__) -# define Tcl_NewByteArrayObj(bytes, len) \ - Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__) -# define Tcl_NewDoubleObj(val) \ - Tcl_DbNewDoubleObj(val, __FILE__, __LINE__) -# define Tcl_NewIntObj(val) \ - Tcl_DbNewLongObj(val, __FILE__, __LINE__) -# define Tcl_NewListObj(objc, objv) \ - Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__) -# define Tcl_NewLongObj(val) \ - Tcl_DbNewLongObj(val, __FILE__, __LINE__) -# define Tcl_NewObj() \ - Tcl_DbNewObj(__FILE__, __LINE__) -# define Tcl_NewStringObj(bytes, len) \ - Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__) -#endif /* TCL_MEM_DEBUG */ - -/* - * The following structure contains the state needed by - * Tcl_SaveResult. No-one outside of Tcl should access any of these - * fields. This structure is typically allocated on the stack. - */ - -typedef struct Tcl_SavedResult { - char *result; - Tcl_FreeProc *freeProc; - Tcl_Obj *objResultPtr; - char *appendResult; - int appendAvl; - int appendUsed; - char resultSpace[TCL_RESULT_SIZE+1]; -} Tcl_SavedResult; - - -/* - * The following definitions support Tcl's namespace facility. - * Note: the first five fields must match exactly the fields in a - * Namespace structure (see tcl.h). - */ - -typedef struct Tcl_Namespace { - char *name; /* The namespace's name within its parent - * namespace. This contains no ::'s. The - * name of the global namespace is "" - * although "::" is an synonym. */ - char *fullName; /* The namespace's fully qualified name. - * This starts with ::. */ - ClientData clientData; /* Arbitrary value associated with this - * namespace. */ - Tcl_NamespaceDeleteProc* deleteProc; - /* Procedure invoked when deleting the - * namespace to, e.g., free clientData. */ - struct Tcl_Namespace* parentPtr; - /* Points to the namespace that contains - * this one. NULL if this is the global - * namespace. */ -} Tcl_Namespace; - -/* - * The following structure represents a call frame, or activation record. - * A call frame defines a naming context for a procedure call: its local - * scope (for local variables) and its namespace scope (used for non-local - * variables; often the global :: namespace). A call frame can also define - * the naming context for a namespace eval or namespace inscope command: - * the namespace in which the command's code should execute. The - * Tcl_CallFrame structures exist only while procedures or namespace - * eval/inscope's are being executed, and provide a Tcl call stack. - * - * A call frame is initialized and pushed using Tcl_PushCallFrame and - * popped using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be - * provided by the Tcl_PushCallFrame caller, and callers typically allocate - * them on the C call stack for efficiency. For this reason, Tcl_CallFrame - * is defined as a structure and not as an opaque token. However, most - * Tcl_CallFrame fields are hidden since applications should not access - * them directly; others are declared as "dummyX". - * - * WARNING!! The structure definition must be kept consistent with the - * CallFrame structure in tclInt.h. If you change one, change the other. - */ - -typedef struct Tcl_CallFrame { - Tcl_Namespace *nsPtr; - int dummy1; - int dummy2; - char *dummy3; - char *dummy4; - char *dummy5; - int dummy6; - char *dummy7; - char *dummy8; - int dummy9; - char* dummy10; -} Tcl_CallFrame; - -/* - * Information about commands that is returned by Tcl_GetCommandInfo and - * passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based - * command procedure while proc is a traditional Tcl argc/argv - * string-based procedure. Tcl_CreateObjCommand and Tcl_CreateCommand - * ensure that both objProc and proc are non-NULL and can be called to - * execute the command. However, it may be faster to call one instead of - * the other. The member isNativeObjectProc is set to 1 if an - * object-based procedure was registered by Tcl_CreateObjCommand, and to - * 0 if a string-based procedure was registered by Tcl_CreateCommand. - * The other procedure is typically set to a compatibility wrapper that - * does string-to-object or object-to-string argument conversions then - * calls the other procedure. - */ - -typedef struct Tcl_CmdInfo { - int isNativeObjectProc; /* 1 if objProc was registered by a call to - * Tcl_CreateObjCommand; 0 otherwise. - * Tcl_SetCmdInfo does not modify this - * field. */ - Tcl_ObjCmdProc *objProc; /* Command's object-based procedure. */ - ClientData objClientData; /* ClientData for object proc. */ - Tcl_CmdProc *proc; /* Command's string-based procedure. */ - ClientData clientData; /* ClientData for string proc. */ - Tcl_CmdDeleteProc *deleteProc; - /* Procedure to call when command is - * deleted. */ - ClientData deleteData; /* Value to pass to deleteProc (usually - * the same as clientData). */ - Tcl_Namespace *namespacePtr; /* Points to the namespace that contains - * this command. Note that Tcl_SetCmdInfo - * will not change a command's namespace; - * use Tcl_RenameCommand to do that. */ - -} Tcl_CmdInfo; - -/* - * The structure defined below is used to hold dynamic strings. The only - * field that clients should use is the string field, and they should - * never modify it. - */ - -#define TCL_DSTRING_STATIC_SIZE 200 -typedef struct Tcl_DString { - char *string; /* Points to beginning of string: either - * staticSpace below or a malloced array. */ - int length; /* Number of non-NULL characters in the - * string. */ - int spaceAvl; /* Total number of bytes available for the - * string and its terminating NULL char. */ - char staticSpace[TCL_DSTRING_STATIC_SIZE]; - /* Space to use in common case where string - * is small. */ -} Tcl_DString; - -#define Tcl_DStringLength(dsPtr) ((dsPtr)->length) -#define Tcl_DStringValue(dsPtr) ((dsPtr)->string) -#define Tcl_DStringTrunc Tcl_DStringSetLength - -/* - * Definitions for the maximum number of digits of precision that may - * be specified in the "tcl_precision" variable, and the number of - * bytes of buffer space required by Tcl_PrintDouble. - */ - -#define TCL_MAX_PREC 17 -#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10) - -/* - * Definition for a number of bytes of buffer space sufficient to hold the - * string representation of an integer in base 10 (assuming the existence - * of 64-bit integers). - */ - -#define TCL_INTEGER_SPACE 24 - -/* - * Flag that may be passed to Tcl_ConvertElement to force it not to - * output braces (careful! if you change this flag be sure to change - * the definitions at the front of tclUtil.c). - */ - -#define TCL_DONT_USE_BRACES 1 - -/* - * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow - * abbreviated strings. - */ - -#define TCL_EXACT 1 - -/* - * Flag values passed to Tcl_RecordAndEval and/or Tcl_EvalObj. - * WARNING: these bit choices must not conflict with the bit choices - * for evalFlag bits in tclInt.h!! - */ - -#define TCL_NO_EVAL 0x10000 -#define TCL_EVAL_GLOBAL 0x20000 -#define TCL_EVAL_DIRECT 0x40000 - -/* - * Special freeProc values that may be passed to Tcl_SetResult (see - * the man page for details): - */ - -#define TCL_VOLATILE ((Tcl_FreeProc *) 1) -#define TCL_STATIC ((Tcl_FreeProc *) 0) -#define TCL_DYNAMIC ((Tcl_FreeProc *) 3) - -/* - * Flag values passed to variable-related procedures. - */ - -#define TCL_GLOBAL_ONLY 1 -#define TCL_NAMESPACE_ONLY 2 -#define TCL_APPEND_VALUE 4 -#define TCL_LIST_ELEMENT 8 -#define TCL_TRACE_READS 0x10 -#define TCL_TRACE_WRITES 0x20 -#define TCL_TRACE_UNSETS 0x40 -#define TCL_TRACE_DESTROYED 0x80 -#define TCL_INTERP_DESTROYED 0x100 -#define TCL_LEAVE_ERR_MSG 0x200 -#define TCL_TRACE_ARRAY 0x800 - -/* - * The TCL_PARSE_PART1 flag is deprecated and has no effect. - * The part1 is now always parsed whenever the part2 is NULL. - * (This is to avoid a common error when converting code to - * use the new object based APIs and forgetting to give the - * flag) - */ -#ifndef TCL_NO_DEPRECATED -#define TCL_PARSE_PART1 0x400 -#endif - - -/* - * Types for linked variables: - */ - -#define TCL_LINK_INT 1 -#define TCL_LINK_DOUBLE 2 -#define TCL_LINK_BOOLEAN 3 -#define TCL_LINK_STRING 4 -#define TCL_LINK_READ_ONLY 0x80 - -/* - * Forward declaration of Tcl_HashTable. Needed by some C++ compilers - * to prevent errors when the forward reference to Tcl_HashTable is - * encountered in the Tcl_HashEntry structure. - */ - -#ifdef __cplusplus -struct Tcl_HashTable; -#endif - -/* - * Structure definition for an entry in a hash table. No-one outside - * Tcl should access any of these fields directly; use the macros - * defined below. - */ - -typedef struct Tcl_HashEntry { - struct Tcl_HashEntry *nextPtr; /* Pointer to next entry in this - * hash bucket, or NULL for end of - * chain. */ - struct Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */ - struct Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to - * first entry in this entry's chain: - * used for deleting the entry. */ - ClientData clientData; /* Application stores something here - * with Tcl_SetHashValue. */ - union { /* Key has one of these forms: */ - char *oneWordValue; /* One-word value for key. */ - int words[1]; /* Multiple integer words for key. - * The actual size will be as large - * as necessary for this table's - * keys. */ - char string[4]; /* String for key. The actual size - * will be as large as needed to hold - * the key. */ - } key; /* MUST BE LAST FIELD IN RECORD!! */ -} Tcl_HashEntry; - -/* - * Structure definition for a hash table. Must be in tcl.h so clients - * can allocate space for these structures, but clients should never - * access any fields in this structure. - */ - -#define TCL_SMALL_HASH_TABLE 4 -typedef struct Tcl_HashTable { - Tcl_HashEntry **buckets; /* Pointer to bucket array. Each - * element points to first entry in - * bucket's hash chain, or NULL. */ - Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; - /* Bucket array used for small tables - * (to avoid mallocs and frees). */ - int numBuckets; /* Total number of buckets allocated - * at **bucketPtr. */ - int numEntries; /* Total number of entries present - * in table. */ - int rebuildSize; /* Enlarge table when numEntries gets - * to be this large. */ - int downShift; /* Shift count used in hashing - * function. Designed to use high- - * order bits of randomized keys. */ - int mask; /* Mask value used in hashing - * function. */ - int keyType; /* Type of keys used in this table. - * It's either TCL_STRING_KEYS, - * TCL_ONE_WORD_KEYS, or an integer - * giving the number of ints that - * is the size of the key. - */ - Tcl_HashEntry *(*findProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr, - CONST char *key)); - Tcl_HashEntry *(*createProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr, - CONST char *key, int *newPtr)); -} Tcl_HashTable; - -/* - * Structure definition for information used to keep track of searches - * through hash tables: - */ - -typedef struct Tcl_HashSearch { - Tcl_HashTable *tablePtr; /* Table being searched. */ - int nextIndex; /* Index of next bucket to be - * enumerated after present one. */ - Tcl_HashEntry *nextEntryPtr; /* Next entry to be enumerated in the - * the current bucket. */ -} Tcl_HashSearch; - -/* - * Acceptable key types for hash tables: - */ - -#define TCL_STRING_KEYS 0 -#define TCL_ONE_WORD_KEYS 1 - -/* - * Macros for clients to use to access fields of hash entries: - */ - -#define Tcl_GetHashValue(h) ((h)->clientData) -#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value)) -#define Tcl_GetHashKey(tablePtr, h) \ - ((char *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS) ? (h)->key.oneWordValue \ - : (h)->key.string)) - -/* - * Macros to use for clients to use to invoke find and create procedures - * for hash tables: - */ - -#define Tcl_FindHashEntry(tablePtr, key) \ - (*((tablePtr)->findProc))(tablePtr, key) -#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \ - (*((tablePtr)->createProc))(tablePtr, key, newPtr) - -/* - * Flag values to pass to Tcl_DoOneEvent to disable searches - * for some kinds of events: - */ - -#define TCL_DONT_WAIT (1<<1) -#define TCL_WINDOW_EVENTS (1<<2) -#define TCL_FILE_EVENTS (1<<3) -#define TCL_TIMER_EVENTS (1<<4) -#define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */ -#define TCL_ALL_EVENTS (~TCL_DONT_WAIT) - -/* - * The following structure defines a generic event for the Tcl event - * system. These are the things that are queued in calls to Tcl_QueueEvent - * and serviced later by Tcl_DoOneEvent. There can be many different - * kinds of events with different fields, corresponding to window events, - * timer events, etc. The structure for a particular event consists of - * a Tcl_Event header followed by additional information specific to that - * event. - */ - -struct Tcl_Event { - Tcl_EventProc *proc; /* Procedure to call to service this event. */ - struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */ -}; - -/* - * Positions to pass to Tcl_QueueEvent: - */ - -typedef enum { - TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK -} Tcl_QueuePosition; - -/* - * Values to pass to Tcl_SetServiceMode to specify the behavior of notifier - * event routines. - */ - -#define TCL_SERVICE_NONE 0 -#define TCL_SERVICE_ALL 1 - -/* - * The following structure keeps is used to hold a time value, either as - * an absolute time (the number of seconds from the epoch) or as an - * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT. - * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT. - */ - -typedef struct Tcl_Time { - long sec; /* Seconds. */ - long usec; /* Microseconds. */ -} Tcl_Time; - -/* - * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler - * to indicate what sorts of events are of interest: - */ - -#define TCL_READABLE (1<<1) -#define TCL_WRITABLE (1<<2) -#define TCL_EXCEPTION (1<<3) - -/* - * Flag values to pass to Tcl_OpenCommandChannel to indicate the - * disposition of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, - * are also used in Tcl_GetStdChannel. - */ - -#define TCL_STDIN (1<<1) -#define TCL_STDOUT (1<<2) -#define TCL_STDERR (1<<3) -#define TCL_ENFORCE_MODE (1<<4) - -/* - * Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel - * should be closed. - */ - -#define TCL_CLOSE_READ (1<<1) -#define TCL_CLOSE_WRITE (1<<2) - -/* - * Value to use as the closeProc for a channel that supports the - * close2Proc interface. - */ - -#define TCL_CLOSE2PROC ((Tcl_DriverCloseProc *)1) - -/* - * Typedefs for the various operations in a channel type: - */ - -typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_(( - ClientData instanceData, int mode)); -typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData, - Tcl_Interp *interp)); -typedef int (Tcl_DriverClose2Proc) _ANSI_ARGS_((ClientData instanceData, - Tcl_Interp *interp, int flags)); -typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData, - char *buf, int toRead, int *errorCodePtr)); -typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData, - char *buf, int toWrite, int *errorCodePtr)); -typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData, - long offset, int mode, int *errorCodePtr)); -typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_(( - ClientData instanceData, Tcl_Interp *interp, - char *optionName, char *value)); -typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_(( - ClientData instanceData, Tcl_Interp *interp, - char *optionName, Tcl_DString *dsPtr)); -typedef void (Tcl_DriverWatchProc) _ANSI_ARGS_(( - ClientData instanceData, int mask)); -typedef int (Tcl_DriverGetHandleProc) _ANSI_ARGS_(( - ClientData instanceData, int direction, - ClientData *handlePtr)); - -/* - * The following declarations either map ckalloc and ckfree to - * malloc and free, or they map them to procedures with all sorts - * of debugging hooks defined in tclCkalloc.c. - */ - -#ifdef TCL_MEM_DEBUG - -# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__) -# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__) -# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__) - -#else /* !TCL_MEM_DEBUG */ - -/* - * If USE_TCLALLOC is true, then we need to call Tcl_Alloc instead of - * the native malloc/free. The only time USE_TCLALLOC should not be - * true is when compiling the Tcl/Tk libraries on Unix systems. In this - * case we can safely call the native malloc/free directly as a performance - * optimization. - */ - -# if USE_TCLALLOC -# define ckalloc(x) Tcl_Alloc(x) -# define ckfree(x) Tcl_Free(x) -# define ckrealloc(x,y) Tcl_Realloc(x,y) -# else -# define ckalloc(x) malloc(x) -# define ckfree(x) free(x) -# define ckrealloc(x,y) realloc(x,y) -# endif -# define Tcl_InitMemory(x) -# define Tcl_DumpActiveMemory(x) -# define Tcl_ValidateAllMemory(x,y) - -#endif /* !TCL_MEM_DEBUG */ - -/* - * Enum for different end of line translation and recognition modes. - */ - -typedef enum Tcl_EolTranslation { - TCL_TRANSLATE_AUTO, /* Eol == \r, \n and \r\n. */ - TCL_TRANSLATE_CR, /* Eol == \r. */ - TCL_TRANSLATE_LF, /* Eol == \n. */ - TCL_TRANSLATE_CRLF /* Eol == \r\n. */ -} Tcl_EolTranslation; - -/* - * struct Tcl_ChannelType: - * - * One such structure exists for each type (kind) of channel. - * It collects together in one place all the functions that are - * part of the specific channel type. - */ - -typedef struct Tcl_ChannelType { - char *typeName; /* The name of the channel type in Tcl - * commands. This storage is owned by - * channel type. */ - Tcl_DriverBlockModeProc *blockModeProc; - /* Set blocking mode for the - * raw channel. May be NULL. */ - Tcl_DriverCloseProc *closeProc; /* Procedure to call to close the - * channel, or TCL_CLOSE2PROC if the - * close2Proc should be used - * instead. */ - Tcl_DriverInputProc *inputProc; /* Procedure to call for input - * on channel. */ - Tcl_DriverOutputProc *outputProc; /* Procedure to call for output - * on channel. */ - Tcl_DriverSeekProc *seekProc; /* Procedure to call to seek - * on the channel. May be NULL. */ - Tcl_DriverSetOptionProc *setOptionProc; - /* Set an option on a channel. */ - Tcl_DriverGetOptionProc *getOptionProc; - /* Get an option from a channel. */ - Tcl_DriverWatchProc *watchProc; /* Set up the notifier to watch - * for events on this channel. */ - Tcl_DriverGetHandleProc *getHandleProc; - /* Get an OS handle from the channel - * or NULL if not supported. */ - Tcl_DriverClose2Proc *close2Proc; /* Procedure to call to close the - * channel if the device supports - * closing the read & write sides - * independently. */ -} Tcl_ChannelType; - -/* - * The following flags determine whether the blockModeProc above should - * set the channel into blocking or nonblocking mode. They are passed - * as arguments to the blockModeProc procedure in the above structure. - */ - -#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */ -#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking - * mode. */ - -/* - * Enum for different types of file paths. - */ - -typedef enum Tcl_PathType { - TCL_PATH_ABSOLUTE, - TCL_PATH_RELATIVE, - TCL_PATH_VOLUME_RELATIVE -} Tcl_PathType; - -/* - * The following structure represents a user-defined encoding. It collects - * together all the functions that are used by the specific encoding. - */ - -typedef struct Tcl_EncodingType { - CONST char *encodingName; /* The name of the encoding, e.g. "euc-jp". - * This name is the unique key for this - * encoding type. */ - Tcl_EncodingConvertProc *toUtfProc; - /* Procedure to convert from external - * encoding into UTF-8. */ - Tcl_EncodingConvertProc *fromUtfProc; - /* Procedure to convert from UTF-8 into - * external encoding. */ - Tcl_EncodingFreeProc *freeProc; - /* If non-NULL, procedure to call when this - * encoding is deleted. */ - ClientData clientData; /* Arbitrary value associated with encoding - * type. Passed to conversion procedures. */ - int nullSize; /* Number of zero bytes that signify - * end-of-string in this encoding. This - * number is used to determine the source - * string length when the srcLen argument is - * negative. Must be 1 or 2. */ -} Tcl_EncodingType; - -/* - * The following definitions are used as values for the conversion control - * flags argument when converting text from one character set to another: - * - * TCL_ENCODING_START: Signifies that the source buffer is the first - * block in a (potentially multi-block) input - * stream. Tells the conversion procedure to - * reset to an initial state and perform any - * initialization that needs to occur before the - * first byte is converted. If the source - * buffer contains the entire input stream to be - * converted, this flag should be set. - * - * TCL_ENCODING_END: Signifies that the source buffer is the last - * block in a (potentially multi-block) input - * stream. Tells the conversion routine to - * perform any finalization that needs to occur - * after the last byte is converted and then to - * reset to an initial state. If the source - * buffer contains the entire input stream to be - * converted, this flag should be set. - * - * TCL_ENCODING_STOPONERROR: If set, then the converter will return - * immediately upon encountering an invalid - * byte sequence or a source character that has - * no mapping in the target encoding. If clear, - * then the converter will skip the problem, - * substituting one or more "close" characters - * in the destination buffer and then continue - * to sonvert the source. - */ - -#define TCL_ENCODING_START 0x01 -#define TCL_ENCODING_END 0x02 -#define TCL_ENCODING_STOPONERROR 0x04 - -/* - *---------------------------------------------------------------- - * The following data structures and declarations are for the new - * Tcl parser. This stuff should all move to tcl.h eventually. - *---------------------------------------------------------------- - */ - -/* - * For each word of a command, and for each piece of a word such as a - * variable reference, one of the following structures is created to - * describe the token. - */ - -typedef struct Tcl_Token { - int type; /* Type of token, such as TCL_TOKEN_WORD; - * see below for valid types. */ - char *start; /* First character in token. */ - int size; /* Number of bytes in token. */ - int numComponents; /* If this token is composed of other - * tokens, this field tells how many of - * them there are (including components of - * components, etc.). The component tokens - * immediately follow this one. */ -} Tcl_Token; - -/* - * Type values defined for Tcl_Token structures. These values are - * defined as mask bits so that it's easy to check for collections of - * types. - * - * TCL_TOKEN_WORD - The token describes one word of a command, - * from the first non-blank character of - * the word (which may be " or {) up to but - * not including the space, semicolon, or - * bracket that terminates the word. - * NumComponents counts the total number of - * sub-tokens that make up the word. This - * includes, for example, sub-tokens of - * TCL_TOKEN_VARIABLE tokens. - * TCL_TOKEN_SIMPLE_WORD - This token is just like TCL_TOKEN_WORD - * except that the word is guaranteed to - * consist of a single TCL_TOKEN_TEXT - * sub-token. - * TCL_TOKEN_TEXT - The token describes a range of literal - * text that is part of a word. - * NumComponents is always 0. - * TCL_TOKEN_BS - The token describes a backslash sequence - * that must be collapsed. NumComponents - * is always 0. - * TCL_TOKEN_COMMAND - The token describes a command whose result - * must be substituted into the word. The - * token includes the enclosing brackets. - * NumComponents is always 0. - * TCL_TOKEN_VARIABLE - The token describes a variable - * substitution, including the dollar sign, - * variable name, and array index (if there - * is one) up through the right - * parentheses. NumComponents tells how - * many additional tokens follow to - * represent the variable name. The first - * token will be a TCL_TOKEN_TEXT token - * that describes the variable name. If - * the variable is an array reference then - * there will be one or more additional - * tokens, of type TCL_TOKEN_TEXT, - * TCL_TOKEN_BS, TCL_TOKEN_COMMAND, and - * TCL_TOKEN_VARIABLE, that describe the - * array index; numComponents counts the - * total number of nested tokens that make - * up the variable reference, including - * sub-tokens of TCL_TOKEN_VARIABLE tokens. - * TCL_TOKEN_SUB_EXPR - The token describes one subexpression of a - * expression, from the first non-blank - * character of the subexpression up to but not - * including the space, brace, or bracket - * that terminates the subexpression. - * NumComponents counts the total number of - * following subtokens that make up the - * subexpression; this includes all subtokens - * for any nested TCL_TOKEN_SUB_EXPR tokens. - * For example, a numeric value used as a - * primitive operand is described by a - * TCL_TOKEN_SUB_EXPR token followed by a - * TCL_TOKEN_TEXT token. A binary subexpression - * is described by a TCL_TOKEN_SUB_EXPR token - * followed by the TCL_TOKEN_OPERATOR token - * for the operator, then TCL_TOKEN_SUB_EXPR - * tokens for the left then the right operands. - * TCL_TOKEN_OPERATOR - The token describes one expression operator. - * An operator might be the name of a math - * function such as "abs". A TCL_TOKEN_OPERATOR - * token is always preceeded by one - * TCL_TOKEN_SUB_EXPR token for the operator's - * subexpression, and is followed by zero or - * more TCL_TOKEN_SUB_EXPR tokens for the - * operator's operands. NumComponents is - * always 0. - */ - -#define TCL_TOKEN_WORD 1 -#define TCL_TOKEN_SIMPLE_WORD 2 -#define TCL_TOKEN_TEXT 4 -#define TCL_TOKEN_BS 8 -#define TCL_TOKEN_COMMAND 16 -#define TCL_TOKEN_VARIABLE 32 -#define TCL_TOKEN_SUB_EXPR 64 -#define TCL_TOKEN_OPERATOR 128 - -/* - * A structure of the following type is filled in by Tcl_ParseCommand. - * It describes a single command parsed from an input string. - */ - -#define NUM_STATIC_TOKENS 20 - -typedef struct Tcl_Parse { - char *commentStart; /* Pointer to # that begins the first of - * one or more comments preceding the - * command. */ - int commentSize; /* Number of bytes in comments (up through - * newline character that terminates the - * last comment). If there were no - * comments, this field is 0. */ - char *commandStart; /* First character in first word of command. */ - int commandSize; /* Number of bytes in command, including - * first character of first word, up - * through the terminating newline, - * close bracket, or semicolon. */ - int numWords; /* Total number of words in command. May - * be 0. */ - Tcl_Token *tokenPtr; /* Pointer to first token representing - * the words of the command. Initially - * points to staticTokens, but may change - * to point to malloc-ed space if command - * exceeds space in staticTokens. */ - int numTokens; /* Total number of tokens in command. */ - int tokensAvailable; /* Total number of tokens available at - * *tokenPtr. */ - - /* - * The fields below are intended only for the private use of the - * parser. They should not be used by procedures that invoke - * Tcl_ParseCommand. - */ - - char *string; /* The original command string passed to - * Tcl_ParseCommand. */ - char *end; /* Points to the character just after the - * last one in the command string. */ - Tcl_Interp *interp; /* Interpreter to use for error reporting, - * or NULL. */ - char *term; /* Points to character in string that - * terminated most recent token. Filled in - * by ParseTokens. If an error occurs, - * points to beginning of region where the - * error occurred (e.g. the open brace if - * the close brace is missing). */ - int incomplete; /* This field is set to 1 by Tcl_ParseCommand - * if the command appears to be incomplete. - * This information is used by - * Tcl_CommandComplete. */ - Tcl_Token staticTokens[NUM_STATIC_TOKENS]; - /* Initial space for tokens for command. - * This space should be large enough to - * accommodate most commands; dynamic - * space is allocated for very large - * commands that don't fit here. */ -} Tcl_Parse; - -/* - * The following definitions are the error codes returned by the conversion - * routines: - * - * TCL_OK: All characters were converted. - * - * TCL_CONVERT_NOSPACE: The output buffer would not have been large - * enough for all of the converted data; as many - * characters as could fit were converted though. - * - * TCL_CONVERT_MULTIBYTE: The last few bytes in the source string were - * the beginning of a multibyte sequence, but - * more bytes were needed to complete this - * sequence. A subsequent call to the conversion - * routine should pass the beginning of this - * unconverted sequence plus additional bytes - * from the source stream to properly convert - * the formerly split-up multibyte sequence. - * - * TCL_CONVERT_SYNTAX: The source stream contained an invalid - * character sequence. This may occur if the - * input stream has been damaged or if the input - * encoding method was misidentified. This error - * is reported only if TCL_ENCODING_STOPONERROR - * was specified. - * - * TCL_CONVERT_UNKNOWN: The source string contained a character - * that could not be represented in the target - * encoding. This error is reported only if - * TCL_ENCODING_STOPONERROR was specified. - */ - -#define TCL_CONVERT_MULTIBYTE -1 -#define TCL_CONVERT_SYNTAX -2 -#define TCL_CONVERT_UNKNOWN -3 -#define TCL_CONVERT_NOSPACE -4 - -/* - * The maximum number of bytes that are necessary to represent a single - * Unicode character in UTF-8. - */ - -#define TCL_UTF_MAX 3 - -/* - * This represents a Unicode character. - */ - -typedef unsigned short Tcl_UniChar; - -/* - * Deprecated Tcl procedures: - */ - -#ifndef TCL_NO_DEPRECATED -#define Tcl_EvalObj(interp,objPtr) Tcl_EvalObjEx((interp),(objPtr),0) -#define Tcl_GlobalEvalObj(interp,objPtr) \ - Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL) -#endif - -/* - * These function have been renamed. The old names are deprecated, but we - * define these macros for backwards compatibilty. - */ - -#define Tcl_Ckalloc Tcl_Alloc -#define Tcl_Ckfree Tcl_Free -#define Tcl_Ckrealloc Tcl_Realloc -#define Tcl_Return Tcl_SetResult -#define Tcl_TildeSubst Tcl_TranslateFileName -#define panic Tcl_Panic -#define panicVA Tcl_PanicVA - -/* - * The following constant is used to test for older versions of Tcl - * in the stubs tables. - * - * Jan Nijtman's plus patch uses 0xFCA1BACF, so we need to pick a different - * value since the stubs tables don't match. - */ - -#define TCL_STUB_MAGIC 0xFCA3BACF - -/* - * The following function is required to be defined in all stubs aware - * extensions. The function is actually implemented in the stub - * library, not the main Tcl library, although there is a trivial - * implementation in the main library in case an extension is statically - * linked into an application. - */ - -EXTERN char * Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, - char *version, int exact)); - -#ifndef USE_TCL_STUBS - -/* - * When not using stubs, make it a macro. - */ - -#define Tcl_InitStubs(interp, version, exact) \ - Tcl_PkgRequire(interp, "Tcl", version, exact) - -#endif - - -/* - * Include the public function declarations that are accessible via - * the stubs table. - */ - -#include "tclDecls.h" - -/* - * Public functions that are not accessible via the stubs table. - */ - -EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv, - Tcl_AppInitProc *appInitProc)); - -/* - * Convenience declaration of Tcl_AppInit for backwards compatibility. - * This function is not *implemented* by the tcl library, so the storage - * class is neither DLLEXPORT nor DLLIMPORT - */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS - -EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp)); - -#endif /* RESOURCE_INCLUDED */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLIMPORT - -#endif /* _TCL */ diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c deleted file mode 100644 index c44cf9f..0000000 --- a/generic/tclAlloc.c +++ /dev/null @@ -1,717 +0,0 @@ -/* - * tclAlloc.c -- - * - * This is a very fast storage allocator. It allocates blocks of a - * small number of different sizes, and keeps free lists of each size. - * Blocks that don't exactly fit are passed up to the next larger size. - * Blocks over a certain size are directly allocated from the system. - * - * Copyright (c) 1983 Regents of the University of California. - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. - * - * Portions contributed by Chris Kingsley, Jack Jansen and Ray Johnson. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclAlloc.c,v 1.6 1999/04/16 00:46:42 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -#if USE_TCLALLOC - -#ifdef TCL_DEBUG -# define DEBUG -/* #define MSTATS */ -# define RCHECK -#endif - -typedef unsigned long caddr_t; - -/* - * The overhead on a block is at least 8 bytes. When free, this space - * contains a pointer to the next free block, and the bottom two bits must - * be zero. When in use, the first byte is set to MAGIC, and the second - * byte is the size index. The remaining bytes are for alignment. - * If range checking is enabled then a second word holds the size of the - * requested block, less 1, rounded up to a multiple of sizeof(RMAGIC). - * The order of elements is critical: ov_magic must overlay the low order - * bits of ov_next, and ov_magic can not be a valid ov_next bit pattern. - */ - -union overhead { - union overhead *ov_next; /* when free */ - unsigned char ov_padding[8]; /* Ensure the structure is 8-byte aligned. */ - struct { - unsigned char ovu_magic0; /* magic number */ - unsigned char ovu_index; /* bucket # */ - unsigned char ovu_unused; /* unused */ - unsigned char ovu_magic1; /* other magic number */ -#ifdef RCHECK - unsigned short ovu_rmagic; /* range magic number */ - unsigned long ovu_size; /* actual block size */ - unsigned short ovu_unused2; /* padding to 8-byte align */ -#endif - } ovu; -#define ov_magic0 ovu.ovu_magic0 -#define ov_magic1 ovu.ovu_magic1 -#define ov_index ovu.ovu_index -#define ov_rmagic ovu.ovu_rmagic -#define ov_size ovu.ovu_size -}; - - -#define MAGIC 0xef /* magic # on accounting info */ -#define RMAGIC 0x5555 /* magic # on range info */ - -#ifdef RCHECK -#define RSLOP sizeof (unsigned short) -#else -#define RSLOP 0 -#endif - -#define OVERHEAD (sizeof(union overhead) + RSLOP) - -/* - * nextf[i] is the pointer to the next free block of size 2^(i+3). The - * smallest allocatable block is 8 bytes. The overhead information - * precedes the data area returned to the user. - */ - -#define NBUCKETS 13 -#define MAXMALLOC (1<<(NBUCKETS+2)) -static union overhead *nextf[NBUCKETS]; - -/* - * The following structure is used to keep track of all system memory - * currently owned by Tcl. When finalizing, all this memory will - * be returned to the system. - */ - -struct block { - struct block *nextPtr; /* Linked list. */ - struct block *prevPtr; /* Linked list for big blocks, ensures 8-byte - * alignment for suballocated blocks. */ -}; - -static struct block *blockList; /* Tracks the suballocated blocks. */ -static struct block bigBlocks = { /* Big blocks aren't suballocated. */ - &bigBlocks, &bigBlocks -}; - -/* - * The allocator is protected by a special mutex that must be - * explicitly initialized. Futhermore, because Tcl_Alloc may be - * used before anything else in Tcl, we make this module self-initializing - * after all with the allocInit variable. - */ - -#ifdef TCL_THREADS -static TclpMutex allocMutex; -#endif -static int allocInit = 0; - - -#ifdef MSTATS - -/* - * nmalloc[i] is the difference between the number of mallocs and frees - * for a given block size. - */ - -static unsigned int nmalloc[NBUCKETS+1]; -#include -#endif - -#if defined(DEBUG) || defined(RCHECK) -#define ASSERT(p) if (!(p)) panic(# p) -#define RANGE_ASSERT(p) if (!(p)) panic(# p) -#else -#define ASSERT(p) -#define RANGE_ASSERT(p) -#endif - -/* - * Prototypes for functions used only in this file. - */ - -static void MoreCore _ANSI_ARGS_((int bucket)); - - -/* - *------------------------------------------------------------------------- - * - * TclInitAlloc -- - * - * Initialize the memory system. - * - * Results: - * None. - * - * Side effects: - * Initialize the mutex used to serialize allocations. - * - *------------------------------------------------------------------------- - */ - -void -TclInitAlloc() -{ - if (!allocInit) { - allocInit = 1; - TclpMutexInit(&allocMutex); - } -} - -/* - *------------------------------------------------------------------------- - * - * TclFinalizeAllocSubsystem -- - * - * Release all resources being used by this subsystem, including - * aggressively freeing all memory allocated by TclpAlloc() that - * has not yet been released with TclpFree(). - * - * After this function is called, all memory allocated with - * TclpAlloc() should be considered unusable. - * - * Results: - * None. - * - * Side effects: - * This subsystem is self-initializing, since memory can be - * allocated before Tcl is formally initialized. After this call, - * this subsystem has been reset to its initial state and is - * usable again. - * - *------------------------------------------------------------------------- - */ - -void -TclFinalizeAllocSubsystem() -{ - int i; - struct block *blockPtr, *nextPtr; - - TclpMutexLock(&allocMutex); - for (blockPtr = blockList; blockPtr != NULL; blockPtr = nextPtr) { - nextPtr = blockPtr->nextPtr; - TclpSysFree(blockPtr); - } - blockList = NULL; - - for (blockPtr = bigBlocks.nextPtr; blockPtr != &bigBlocks; ) { - nextPtr = blockPtr->nextPtr; - TclpSysFree(blockPtr); - blockPtr = nextPtr; - } - bigBlocks.nextPtr = &bigBlocks; - bigBlocks.prevPtr = &bigBlocks; - - for (i = 0; i < NBUCKETS; i++) { - nextf[i] = NULL; -#ifdef MSTATS - nmalloc[i] = 0; -#endif - } -#ifdef MSTATS - nmalloc[i] = 0; -#endif - TclpMutexUnlock(&allocMutex); -} - -/* - *---------------------------------------------------------------------- - * - * TclpAlloc -- - * - * Allocate more memory. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -TclpAlloc(nbytes) - unsigned int nbytes; /* Number of bytes to allocate. */ -{ - register union overhead *op; - register long bucket; - register unsigned amt; - struct block *bigBlockPtr; - - if (!allocInit) { - /* - * We have to make the "self initializing" because Tcl_Alloc - * may be used before any other part of Tcl. E.g., see - * main() for tclsh! - */ - - allocInit = 1; - TclpMutexInit(&allocMutex); - } - TclpMutexLock(&allocMutex); - /* - * First the simple case: we simple allocate big blocks directly - */ - if (nbytes + OVERHEAD >= MAXMALLOC) { - bigBlockPtr = (struct block *) TclpSysAlloc((unsigned) - (sizeof(struct block) + OVERHEAD + nbytes), 0); - if (bigBlockPtr == NULL) { - TclpMutexUnlock(&allocMutex); - return NULL; - } - bigBlockPtr->nextPtr = bigBlocks.nextPtr; - bigBlocks.nextPtr = bigBlockPtr; - bigBlockPtr->prevPtr = &bigBlocks; - bigBlockPtr->nextPtr->prevPtr = bigBlockPtr; - - op = (union overhead *) (bigBlockPtr + 1); - op->ov_magic0 = op->ov_magic1 = MAGIC; - op->ov_index = 0xff; -#ifdef MSTATS - nmalloc[NBUCKETS]++; -#endif -#ifdef RCHECK - /* - * Record allocated size of block and - * bound space with magic numbers. - */ - op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); - op->ov_rmagic = RMAGIC; - *(unsigned short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif - TclpMutexUnlock(&allocMutex); - return (void *)(op+1); - } - /* - * Convert amount of memory requested into closest block size - * stored in hash buckets which satisfies request. - * Account for space used per block for accounting. - */ -#ifndef RCHECK - amt = 8; /* size of first bucket */ - bucket = 0; -#else - amt = 16; /* size of first bucket */ - bucket = 1; -#endif - while (nbytes + OVERHEAD > amt) { - amt <<= 1; - if (amt == 0) { - TclpMutexUnlock(&allocMutex); - return (NULL); - } - bucket++; - } - ASSERT( bucket < NBUCKETS ); - - /* - * If nothing in hash bucket right now, - * request more memory from the system. - */ - if ((op = nextf[bucket]) == NULL) { - MoreCore(bucket); - if ((op = nextf[bucket]) == NULL) { - TclpMutexUnlock(&allocMutex); - return (NULL); - } - } - /* - * Remove from linked list - */ - nextf[bucket] = op->ov_next; - op->ov_magic0 = op->ov_magic1 = MAGIC; - op->ov_index = (unsigned char) bucket; -#ifdef MSTATS - nmalloc[bucket]++; -#endif -#ifdef RCHECK - /* - * Record allocated size of block and - * bound space with magic numbers. - */ - op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); - op->ov_rmagic = RMAGIC; - *(unsigned short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif - TclpMutexUnlock(&allocMutex); - return ((char *)(op + 1)); -} - -/* - *---------------------------------------------------------------------- - * - * MoreCore -- - * - * Allocate more memory to the indicated bucket. - * - * Assumes Mutex is already held. - * - * Results: - * None. - * - * Side effects: - * Attempts to get more memory from the system. - * - *---------------------------------------------------------------------- - */ - -static void -MoreCore(bucket) - int bucket; /* What bucket to allocat to. */ -{ - register union overhead *op; - register long sz; /* size of desired block */ - long amt; /* amount to allocate */ - int nblks; /* how many blocks we get */ - struct block *blockPtr; - - /* - * sbrk_size <= 0 only for big, FLUFFY, requests (about - * 2^30 bytes on a VAX, I think) or for a negative arg. - */ - sz = 1 << (bucket + 3); - ASSERT(sz > 0); - - amt = MAXMALLOC; - nblks = amt / sz; - ASSERT(nblks*sz == amt); - - blockPtr = (struct block *) TclpSysAlloc((unsigned) - (sizeof(struct block) + amt), 1); - /* no more room! */ - if (blockPtr == NULL) { - return; - } - blockPtr->nextPtr = blockList; - blockList = blockPtr; - - op = (union overhead *) (blockPtr + 1); - - /* - * Add new memory allocated to that on - * free list for this hash bucket. - */ - nextf[bucket] = op; - while (--nblks > 0) { - op->ov_next = (union overhead *)((caddr_t)op + sz); - op = (union overhead *)((caddr_t)op + sz); - } - op->ov_next = (union overhead *)NULL; -} - -/* - *---------------------------------------------------------------------- - * - * TclpFree -- - * - * Free memory. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -TclpFree(cp) - char *cp; /* Pointer to memory to free. */ -{ - register long size; - register union overhead *op; - struct block *bigBlockPtr; - - if (cp == NULL) { - return; - } - - TclpMutexLock(&allocMutex); - op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); - - ASSERT(op->ov_magic0 == MAGIC); /* make sure it was in use */ - ASSERT(op->ov_magic1 == MAGIC); - if (op->ov_magic0 != MAGIC || op->ov_magic1 != MAGIC) { - TclpMutexUnlock(&allocMutex); - return; - } - - RANGE_ASSERT(op->ov_rmagic == RMAGIC); - RANGE_ASSERT(*(unsigned short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); - size = op->ov_index; - if ( size == 0xff ) { -#ifdef MSTATS - nmalloc[NBUCKETS]--; -#endif - bigBlockPtr = (struct block *) op - 1; - bigBlockPtr->prevPtr->nextPtr = bigBlockPtr->nextPtr; - bigBlockPtr->nextPtr->prevPtr = bigBlockPtr->prevPtr; - TclpSysFree(bigBlockPtr); - TclpMutexUnlock(&allocMutex); - return; - } - ASSERT(size < NBUCKETS); - op->ov_next = nextf[size]; /* also clobbers ov_magic */ - nextf[size] = op; -#ifdef MSTATS - nmalloc[size]--; -#endif - TclpMutexUnlock(&allocMutex); -} - -/* - *---------------------------------------------------------------------- - * - * TclpRealloc -- - * - * Reallocate memory. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -TclpRealloc(cp, nbytes) - char *cp; /* Pointer to alloced block. */ - unsigned int nbytes; /* New size of memory. */ -{ - int i; - union overhead *op; - struct block *bigBlockPtr; - int expensive; - unsigned long maxsize; - - if (cp == NULL) { - return (TclpAlloc(nbytes)); - } - - TclpMutexLock(&allocMutex); - - op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); - - ASSERT(op->ov_magic0 == MAGIC); /* make sure it was in use */ - ASSERT(op->ov_magic1 == MAGIC); - if (op->ov_magic0 != MAGIC || op->ov_magic1 != MAGIC) { - TclpMutexUnlock(&allocMutex); - return NULL; - } - - RANGE_ASSERT(op->ov_rmagic == RMAGIC); - RANGE_ASSERT(*(unsigned short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); - i = op->ov_index; - - /* - * If the block isn't in a bin, just realloc it. - */ - - if (i == 0xff) { - struct block *prevPtr, *nextPtr; - bigBlockPtr = (struct block *) op - 1; - prevPtr = bigBlockPtr->prevPtr; - nextPtr = bigBlockPtr->nextPtr; - bigBlockPtr = (struct block *) TclpSysRealloc(bigBlockPtr, - sizeof(struct block) + OVERHEAD + nbytes); - if (bigBlockPtr == NULL) { - TclpMutexUnlock(&allocMutex); - return NULL; - } - - if (prevPtr->nextPtr != bigBlockPtr) { - /* - * If the block has moved, splice the new block into the list where - * the old block used to be. - */ - - prevPtr->nextPtr = bigBlockPtr; - nextPtr->prevPtr = bigBlockPtr; - } - - op = (union overhead *) (bigBlockPtr + 1); -#ifdef MSTATS - nmalloc[NBUCKETS]++; -#endif -#ifdef RCHECK - /* - * Record allocated size of block and update magic number bounds. - */ - - op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); - *(unsigned short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif - TclpMutexUnlock(&allocMutex); - return (char *)(op+1); - } - maxsize = 1 << (i+3); - expensive = 0; - if ( nbytes + OVERHEAD > maxsize ) { - expensive = 1; - } else if ( i > 0 && nbytes + OVERHEAD < (maxsize/2) ) { - expensive = 1; - } - - if (expensive) { - void *newp; - - TclpMutexUnlock(&allocMutex); - - newp = TclpAlloc(nbytes); - if ( newp == NULL ) { - return NULL; - } - maxsize -= OVERHEAD; - if ( maxsize < nbytes ) - nbytes = maxsize; - memcpy((VOID *) newp, (VOID *) cp, (size_t) nbytes); - TclpFree(cp); - return newp; - } - - /* - * Ok, we don't have to copy, it fits as-is - */ -#ifdef RCHECK - op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); - *(unsigned short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif - TclpMutexUnlock(&allocMutex); - return(cp); -} - -/* - *---------------------------------------------------------------------- - * - * mstats -- - * - * Prints two lines of numbers, one showing the length of the - * free list for each size category, the second showing the - * number of mallocs - frees for each size category. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef MSTATS -void -mstats(s) - char *s; /* Where to write info. */ -{ - register int i, j; - register union overhead *p; - int totfree = 0, - totused = 0; - - TclpMutexLock(&allocMutex); - fprintf(stderr, "Memory allocation statistics %s\nTclpFree:\t", s); - for (i = 0; i < NBUCKETS; i++) { - for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) - fprintf(stderr, " %d", j); - totfree += j * (1 << (i + 3)); - } - fprintf(stderr, "\nused:\t"); - for (i = 0; i < NBUCKETS; i++) { - fprintf(stderr, " %d", nmalloc[i]); - totused += nmalloc[i] * (1 << (i + 3)); - } - fprintf(stderr, "\n\tTotal small in use: %d, total free: %d\n", - totused, totfree); - fprintf(stderr, "\n\tNumber of big (>%d) blocks in use: %d\n", - MAXMALLOC, nmalloc[NBUCKETS]); - TclpMutexUnlock(&allocMutex); -} -#endif - -#else /* !USE_TCLALLOC */ - -/* - *---------------------------------------------------------------------- - * - * TclpAlloc -- - * - * Allocate more memory. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -TclpAlloc(nbytes) - unsigned int nbytes; /* Number of bytes to allocate. */ -{ - return (char*) malloc(nbytes); -} - -/* - *---------------------------------------------------------------------- - * - * TclpFree -- - * - * Free memory. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -TclpFree(cp) - char *cp; /* Pointer to memory to free. */ -{ - free(cp); - return; -} - -/* - *---------------------------------------------------------------------- - * - * TclpRealloc -- - * - * Reallocate memory. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -TclpRealloc(cp, nbytes) - char *cp; /* Pointer to alloced block. */ - unsigned int nbytes; /* New size of memory. */ -{ - return (char*) realloc(cp, nbytes); -} - -#endif /* !USE_TCLALLOC */ diff --git a/generic/tclAsync.c b/generic/tclAsync.c deleted file mode 100644 index fc80385..0000000 --- a/generic/tclAsync.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - * tclAsync.c -- - * - * This file provides low-level support needed to invoke signal - * handlers in a safe way. The code here doesn't actually handle - * signals, though. This code is based on proposals made by - * Mark Diekhans and Don Libes. - * - * Copyright (c) 1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclAsync.c,v 1.4 1999/04/16 00:46:42 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * One of the following structures exists for each asynchronous - * handler: - */ - -typedef struct AsyncHandler { - int ready; /* Non-zero means this handler should - * be invoked in the next call to - * Tcl_AsyncInvoke. */ - struct AsyncHandler *nextPtr; /* Next in list of all handlers for - * the process. */ - Tcl_AsyncProc *proc; /* Procedure to call when handler - * is invoked. */ - ClientData clientData; /* Value to pass to handler when it - * is invoked. */ -} AsyncHandler; - -/* - * The variables below maintain a list of all existing handlers. - */ - -static AsyncHandler *firstHandler; /* First handler defined for process, - * or NULL if none. */ -static AsyncHandler *lastHandler; /* Last handler or NULL. */ - -TCL_DECLARE_MUTEX(asyncMutex) /* Process-wide async handler lock */ - -/* - * The variable below is set to 1 whenever a handler becomes ready and - * it is cleared to zero whenever Tcl_AsyncInvoke is called. It can be - * checked elsewhere in the application by calling Tcl_AsyncReady to see - * if Tcl_AsyncInvoke should be invoked. - */ - -static int asyncReady = 0; - -/* - * The variable below indicates whether Tcl_AsyncInvoke is currently - * working. If so then we won't set asyncReady again until - * Tcl_AsyncInvoke returns. - */ - -static int asyncActive = 0; - -/* - *---------------------------------------------------------------------- - * - * Tcl_AsyncCreate -- - * - * This procedure creates the data structures for an asynchronous - * handler, so that no memory has to be allocated when the handler - * is activated. - * - * Results: - * The return value is a token for the handler, which can be used - * to activate it later on. - * - * Side effects: - * Information about the handler is recorded. - * - *---------------------------------------------------------------------- - */ - -Tcl_AsyncHandler -Tcl_AsyncCreate(proc, clientData) - Tcl_AsyncProc *proc; /* Procedure to call when handler - * is invoked. */ - ClientData clientData; /* Argument to pass to handler. */ -{ - AsyncHandler *asyncPtr; - - asyncPtr = (AsyncHandler *) ckalloc(sizeof(AsyncHandler)); - asyncPtr->ready = 0; - asyncPtr->nextPtr = NULL; - asyncPtr->proc = proc; - asyncPtr->clientData = clientData; - Tcl_MutexLock(&asyncMutex); - if (firstHandler == NULL) { - firstHandler = asyncPtr; - } else { - lastHandler->nextPtr = asyncPtr; - } - lastHandler = asyncPtr; - Tcl_MutexUnlock(&asyncMutex); - return (Tcl_AsyncHandler) asyncPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AsyncMark -- - * - * This procedure is called to request that an asynchronous handler - * be invoked as soon as possible. It's typically called from - * an interrupt handler, where it isn't safe to do anything that - * depends on or modifies application state. - * - * Results: - * None. - * - * Side effects: - * The handler gets marked for invocation later. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AsyncMark(async) - Tcl_AsyncHandler async; /* Token for handler. */ -{ - Tcl_MutexLock(&asyncMutex); - ((AsyncHandler *) async)->ready = 1; - if (!asyncActive) { - asyncReady = 1; - TclpAsyncMark(async); - } - Tcl_MutexUnlock(&asyncMutex); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AsyncInvoke -- - * - * This procedure is called at a "safe" time at background level - * to invoke any active asynchronous handlers. - * - * Results: - * The return value is a normal Tcl result, which is intended to - * replace the code argument as the current completion code for - * interp. - * - * Side effects: - * Depends on the handlers that are active. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_AsyncInvoke(interp, code) - Tcl_Interp *interp; /* If invoked from Tcl_Eval just after - * completing a command, points to - * interpreter. Otherwise it is - * NULL. */ - int code; /* If interp is non-NULL, this gives - * completion code from command that - * just completed. */ -{ - AsyncHandler *asyncPtr; - Tcl_MutexLock(&asyncMutex); - - if (asyncReady == 0) { - Tcl_MutexUnlock(&asyncMutex); - return code; - } - asyncReady = 0; - asyncActive = 1; - if (interp == NULL) { - code = 0; - } - - /* - * Make one or more passes over the list of handlers, invoking - * at most one handler in each pass. After invoking a handler, - * go back to the start of the list again so that (a) if a new - * higher-priority handler gets marked while executing a lower - * priority handler, we execute the higher-priority handler - * next, and (b) if a handler gets deleted during the execution - * of a handler, then the list structure may change so it isn't - * safe to continue down the list anyway. - */ - - while (1) { - for (asyncPtr = firstHandler; asyncPtr != NULL; - asyncPtr = asyncPtr->nextPtr) { - if (asyncPtr->ready) { - break; - } - } - if (asyncPtr == NULL) { - break; - } - asyncPtr->ready = 0; - Tcl_MutexUnlock(&asyncMutex); - code = (*asyncPtr->proc)(asyncPtr->clientData, interp, code); - Tcl_MutexLock(&asyncMutex); - } - asyncActive = 0; - Tcl_MutexUnlock(&asyncMutex); - return code; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AsyncDelete -- - * - * Frees up all the state for an asynchronous handler. The handler - * should never be used again. - * - * Results: - * None. - * - * Side effects: - * The state associated with the handler is deleted. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AsyncDelete(async) - Tcl_AsyncHandler async; /* Token for handler to delete. */ -{ - AsyncHandler *asyncPtr = (AsyncHandler *) async; - AsyncHandler *prevPtr; - - Tcl_MutexLock(&asyncMutex); - if (firstHandler == asyncPtr) { - firstHandler = asyncPtr->nextPtr; - if (firstHandler == NULL) { - lastHandler = NULL; - } - } else { - prevPtr = firstHandler; - while (prevPtr->nextPtr != asyncPtr) { - prevPtr = prevPtr->nextPtr; - } - prevPtr->nextPtr = asyncPtr->nextPtr; - if (lastHandler == asyncPtr) { - lastHandler = prevPtr; - } - } - Tcl_MutexUnlock(&asyncMutex); - ckfree((char *) asyncPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AsyncReady -- - * - * This procedure can be used to tell whether Tcl_AsyncInvoke - * needs to be called. This procedure is the external interface - * for checking the internal asyncReady variable. - * - * Results: - * The return value is 1 whenever a handler is ready and is 0 - * when no handlers are ready. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_AsyncReady() -{ - return asyncReady; -} diff --git a/generic/tclBasic.c b/generic/tclBasic.c deleted file mode 100644 index e673a3c..0000000 --- a/generic/tclBasic.c +++ /dev/null @@ -1,4220 +0,0 @@ -/* - * tclBasic.c -- - * - * Contains the basic facilities for TCL command interpretation, - * including interpreter creation and deletion, command creation - * and deletion, and command parsing and execution. - * - * Copyright (c) 1987-1994 The Regents of the University of California. - * Copyright (c) 1994-1997 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. - * - * RCS: @(#) $Id: tclBasic.c,v 1.19 1999/04/16 00:46:42 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclCompile.h" -#ifndef TCL_GENERIC_ONLY -# include "tclPort.h" -#endif - -/* - * Static procedures in this file: - */ - -static void DeleteInterpProc _ANSI_ARGS_((Tcl_Interp *interp)); -static void ProcessUnexpectedResult _ANSI_ARGS_(( - Tcl_Interp *interp, int returnCode)); -static void RecordTracebackInfo _ANSI_ARGS_(( - Tcl_Interp *interp, Tcl_Obj *objPtr, - int numSrcBytes)); - -extern TclStubs tclStubs; - -/* - * The following structure defines the commands in the Tcl core. - */ - -typedef struct { - char *name; /* Name of object-based command. */ - Tcl_CmdProc *proc; /* String-based procedure for command. */ - Tcl_ObjCmdProc *objProc; /* Object-based procedure for command. */ - CompileProc *compileProc; /* Procedure called to compile command. */ - int isSafe; /* If non-zero, command will be present - * in safe interpreter. Otherwise it will - * be hidden. */ -} CmdInfo; - -/* - * The built-in commands, and the procedures that implement them: - */ - -static CmdInfo builtInCmds[] = { - /* - * Commands in the generic core. Note that at least one of the proc or - * objProc members should be non-NULL. This avoids infinitely recursive - * calls between TclInvokeObjectCommand and TclInvokeStringCommand if a - * command name is computed at runtime and results in the name of a - * compiled command. - */ - - {"append", (Tcl_CmdProc *) NULL, Tcl_AppendObjCmd, - (CompileProc *) NULL, 1}, - {"array", (Tcl_CmdProc *) NULL, Tcl_ArrayObjCmd, - (CompileProc *) NULL, 1}, - {"binary", (Tcl_CmdProc *) NULL, Tcl_BinaryObjCmd, - (CompileProc *) NULL, 1}, - {"break", (Tcl_CmdProc *) NULL, Tcl_BreakObjCmd, - TclCompileBreakCmd, 1}, - {"case", (Tcl_CmdProc *) NULL, Tcl_CaseObjCmd, - (CompileProc *) NULL, 1}, - {"catch", (Tcl_CmdProc *) NULL, Tcl_CatchObjCmd, - TclCompileCatchCmd, 1}, - {"clock", (Tcl_CmdProc *) NULL, Tcl_ClockObjCmd, - (CompileProc *) NULL, 1}, - {"concat", (Tcl_CmdProc *) NULL, Tcl_ConcatObjCmd, - (CompileProc *) NULL, 1}, - {"continue", (Tcl_CmdProc *) NULL, Tcl_ContinueObjCmd, - TclCompileContinueCmd, 1}, - {"encoding", (Tcl_CmdProc *) NULL, Tcl_EncodingObjCmd, - (CompileProc *) NULL, 0}, - {"error", (Tcl_CmdProc *) NULL, Tcl_ErrorObjCmd, - (CompileProc *) NULL, 1}, - {"eval", (Tcl_CmdProc *) NULL, Tcl_EvalObjCmd, - (CompileProc *) NULL, 1}, - {"exit", (Tcl_CmdProc *) NULL, Tcl_ExitObjCmd, - (CompileProc *) NULL, 0}, - {"expr", (Tcl_CmdProc *) NULL, Tcl_ExprObjCmd, - TclCompileExprCmd, 1}, - {"fcopy", (Tcl_CmdProc *) NULL, Tcl_FcopyObjCmd, - (CompileProc *) NULL, 1}, - {"fileevent", (Tcl_CmdProc *) NULL, Tcl_FileEventObjCmd, - (CompileProc *) NULL, 1}, - {"for", (Tcl_CmdProc *) NULL, Tcl_ForObjCmd, - TclCompileForCmd, 1}, - {"foreach", (Tcl_CmdProc *) NULL, Tcl_ForeachObjCmd, - TclCompileForeachCmd, 1}, - {"format", (Tcl_CmdProc *) NULL, Tcl_FormatObjCmd, - (CompileProc *) NULL, 1}, - {"global", (Tcl_CmdProc *) NULL, Tcl_GlobalObjCmd, - (CompileProc *) NULL, 1}, - {"if", (Tcl_CmdProc *) NULL, Tcl_IfObjCmd, - TclCompileIfCmd, 1}, - {"incr", (Tcl_CmdProc *) NULL, Tcl_IncrObjCmd, - TclCompileIncrCmd, 1}, - {"info", (Tcl_CmdProc *) NULL, Tcl_InfoObjCmd, - (CompileProc *) NULL, 1}, - {"join", (Tcl_CmdProc *) NULL, Tcl_JoinObjCmd, - (CompileProc *) NULL, 1}, - {"lappend", (Tcl_CmdProc *) NULL, Tcl_LappendObjCmd, - (CompileProc *) NULL, 1}, - {"lindex", (Tcl_CmdProc *) NULL, Tcl_LindexObjCmd, - (CompileProc *) NULL, 1}, - {"linsert", (Tcl_CmdProc *) NULL, Tcl_LinsertObjCmd, - (CompileProc *) NULL, 1}, - {"list", (Tcl_CmdProc *) NULL, Tcl_ListObjCmd, - (CompileProc *) NULL, 1}, - {"llength", (Tcl_CmdProc *) NULL, Tcl_LlengthObjCmd, - (CompileProc *) NULL, 1}, - {"load", (Tcl_CmdProc *) NULL, Tcl_LoadObjCmd, - (CompileProc *) NULL, 0}, - {"lrange", (Tcl_CmdProc *) NULL, Tcl_LrangeObjCmd, - (CompileProc *) NULL, 1}, - {"lreplace", (Tcl_CmdProc *) NULL, Tcl_LreplaceObjCmd, - (CompileProc *) NULL, 1}, - {"lsearch", (Tcl_CmdProc *) NULL, Tcl_LsearchObjCmd, - (CompileProc *) NULL, 1}, - {"lsort", (Tcl_CmdProc *) NULL, Tcl_LsortObjCmd, - (CompileProc *) NULL, 1}, - {"namespace", (Tcl_CmdProc *) NULL, Tcl_NamespaceObjCmd, - (CompileProc *) NULL, 1}, - {"package", (Tcl_CmdProc *) NULL, Tcl_PackageObjCmd, - (CompileProc *) NULL, 1}, - {"proc", (Tcl_CmdProc *) NULL, Tcl_ProcObjCmd, - (CompileProc *) NULL, 1}, - {"regexp", (Tcl_CmdProc *) NULL, Tcl_RegexpObjCmd, - (CompileProc *) NULL, 1}, - {"regsub", (Tcl_CmdProc *) NULL, Tcl_RegsubObjCmd, - (CompileProc *) NULL, 1}, - {"rename", (Tcl_CmdProc *) NULL, Tcl_RenameObjCmd, - (CompileProc *) NULL, 1}, - {"return", (Tcl_CmdProc *) NULL, Tcl_ReturnObjCmd, - (CompileProc *) NULL, 1}, - {"scan", (Tcl_CmdProc *) NULL, Tcl_ScanObjCmd, - (CompileProc *) NULL, 1}, - {"set", (Tcl_CmdProc *) NULL, Tcl_SetObjCmd, - TclCompileSetCmd, 1}, - {"split", (Tcl_CmdProc *) NULL, Tcl_SplitObjCmd, - (CompileProc *) NULL, 1}, - {"string", (Tcl_CmdProc *) NULL, Tcl_StringObjCmd, - (CompileProc *) NULL, 1}, - {"subst", (Tcl_CmdProc *) NULL, Tcl_SubstObjCmd, - (CompileProc *) NULL, 1}, - {"switch", (Tcl_CmdProc *) NULL, Tcl_SwitchObjCmd, - (CompileProc *) NULL, 1}, - {"trace", (Tcl_CmdProc *) NULL, Tcl_TraceObjCmd, - (CompileProc *) NULL, 1}, - {"unset", (Tcl_CmdProc *) NULL, Tcl_UnsetObjCmd, - (CompileProc *) NULL, 1}, - {"uplevel", (Tcl_CmdProc *) NULL, Tcl_UplevelObjCmd, - (CompileProc *) NULL, 1}, - {"upvar", (Tcl_CmdProc *) NULL, Tcl_UpvarObjCmd, - (CompileProc *) NULL, 1}, - {"variable", (Tcl_CmdProc *) NULL, Tcl_VariableObjCmd, - (CompileProc *) NULL, 1}, - {"while", (Tcl_CmdProc *) NULL, Tcl_WhileObjCmd, - TclCompileWhileCmd, 1}, - - /* - * Commands in the UNIX core: - */ - -#ifndef TCL_GENERIC_ONLY - {"after", (Tcl_CmdProc *) NULL, Tcl_AfterObjCmd, - (CompileProc *) NULL, 1}, - {"cd", (Tcl_CmdProc *) NULL, Tcl_CdObjCmd, - (CompileProc *) NULL, 0}, - {"close", (Tcl_CmdProc *) NULL, Tcl_CloseObjCmd, - (CompileProc *) NULL, 1}, - {"eof", (Tcl_CmdProc *) NULL, Tcl_EofObjCmd, - (CompileProc *) NULL, 1}, - {"fblocked", (Tcl_CmdProc *) NULL, Tcl_FblockedObjCmd, - (CompileProc *) NULL, 1}, - {"fconfigure", (Tcl_CmdProc *) NULL, Tcl_FconfigureObjCmd, - (CompileProc *) NULL, 0}, - {"file", (Tcl_CmdProc *) NULL, Tcl_FileObjCmd, - (CompileProc *) NULL, 0}, - {"flush", (Tcl_CmdProc *) NULL, Tcl_FlushObjCmd, - (CompileProc *) NULL, 1}, - {"gets", (Tcl_CmdProc *) NULL, Tcl_GetsObjCmd, - (CompileProc *) NULL, 1}, - {"glob", (Tcl_CmdProc *) NULL, Tcl_GlobObjCmd, - (CompileProc *) NULL, 0}, - {"open", (Tcl_CmdProc *) NULL, Tcl_OpenObjCmd, - (CompileProc *) NULL, 0}, - {"pid", (Tcl_CmdProc *) NULL, Tcl_PidObjCmd, - (CompileProc *) NULL, 1}, - {"puts", (Tcl_CmdProc *) NULL, Tcl_PutsObjCmd, - (CompileProc *) NULL, 1}, - {"pwd", (Tcl_CmdProc *) NULL, Tcl_PwdObjCmd, - (CompileProc *) NULL, 0}, - {"read", (Tcl_CmdProc *) NULL, Tcl_ReadObjCmd, - (CompileProc *) NULL, 1}, - {"seek", (Tcl_CmdProc *) NULL, Tcl_SeekObjCmd, - (CompileProc *) NULL, 1}, - {"socket", (Tcl_CmdProc *) NULL, Tcl_SocketObjCmd, - (CompileProc *) NULL, 0}, - {"tell", (Tcl_CmdProc *) NULL, Tcl_TellObjCmd, - (CompileProc *) NULL, 1}, - {"time", (Tcl_CmdProc *) NULL, Tcl_TimeObjCmd, - (CompileProc *) NULL, 1}, - {"update", (Tcl_CmdProc *) NULL, Tcl_UpdateObjCmd, - (CompileProc *) NULL, 1}, - {"vwait", (Tcl_CmdProc *) NULL, Tcl_VwaitObjCmd, - (CompileProc *) NULL, 1}, - -#ifdef MAC_TCL - {"beep", (Tcl_CmdProc *) NULL, Tcl_BeepObjCmd, - (CompileProc *) NULL, 0}, - {"echo", Tcl_EchoCmd, (Tcl_ObjCmdProc *) NULL, - (CompileProc *) NULL, 0}, - {"ls", (Tcl_CmdProc *) NULL, Tcl_LsObjCmd, - (CompileProc *) NULL, 0}, - {"resource", (Tcl_CmdProc *) NULL, Tcl_ResourceObjCmd, - (CompileProc *) NULL, 1}, - {"source", (Tcl_CmdProc *) NULL, Tcl_MacSourceObjCmd, - (CompileProc *) NULL, 0}, -#else - {"exec", (Tcl_CmdProc *) NULL, Tcl_ExecObjCmd, - (CompileProc *) NULL, 0}, - {"source", (Tcl_CmdProc *) NULL, Tcl_SourceObjCmd, - (CompileProc *) NULL, 0}, -#endif /* MAC_TCL */ - -#endif /* TCL_GENERIC_ONLY */ - {NULL, (Tcl_CmdProc *) NULL, (Tcl_ObjCmdProc *) NULL, - (CompileProc *) NULL, 0} -}; - - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateInterp -- - * - * Create a new TCL command interpreter. - * - * Results: - * The return value is a token for the interpreter, which may be - * used in calls to procedures like Tcl_CreateCmd, Tcl_Eval, or - * Tcl_DeleteInterp. - * - * Side effects: - * The command interpreter is initialized with an empty variable - * table and the built-in commands. - * - *---------------------------------------------------------------------- - */ - -Tcl_Interp * -Tcl_CreateInterp() -{ - Interp *iPtr; - Tcl_Interp *interp; - Command *cmdPtr; - BuiltinFunc *builtinFuncPtr; - MathFunc *mathFuncPtr; - Tcl_HashEntry *hPtr; - CmdInfo *cmdInfoPtr; - int i; - union { - char c[sizeof(short)]; - short s; - } order; -#ifdef TCL_COMPILE_STATS - ByteCodeStats *statsPtr; -#endif /* TCL_COMPILE_STATS */ - - TclInitSubsystems(NULL); - - /* - * Panic if someone updated the CallFrame structure without - * also updating the Tcl_CallFrame structure (or vice versa). - */ - - if (sizeof(Tcl_CallFrame) != sizeof(CallFrame)) { - /*NOTREACHED*/ - panic("Tcl_CallFrame and CallFrame are not the same size"); - } - - /* - * Initialize support for namespaces and create the global namespace - * (whose name is ""; an alias is "::"). This also initializes the - * Tcl object type table and other object management code. - */ - - iPtr = (Interp *) ckalloc(sizeof(Interp)); - interp = (Tcl_Interp *) iPtr; - - iPtr->result = iPtr->resultSpace; - iPtr->freeProc = NULL; - iPtr->errorLine = 0; - iPtr->objResultPtr = Tcl_NewObj(); - Tcl_IncrRefCount(iPtr->objResultPtr); - iPtr->handle = TclHandleCreate(iPtr); - iPtr->globalNsPtr = NULL; - iPtr->hiddenCmdTablePtr = NULL; - iPtr->interpInfo = NULL; - Tcl_InitHashTable(&iPtr->mathFuncTable, TCL_STRING_KEYS); - - iPtr->numLevels = 0; - iPtr->maxNestingDepth = 1000; - iPtr->framePtr = NULL; - iPtr->varFramePtr = NULL; - iPtr->activeTracePtr = NULL; - iPtr->returnCode = TCL_OK; - iPtr->errorInfo = NULL; - iPtr->errorCode = NULL; - - iPtr->appendResult = NULL; - iPtr->appendAvl = 0; - iPtr->appendUsed = 0; - - for (i = 0; i < NUM_REGEXPS; i++) { - iPtr->patterns[i] = NULL; - iPtr->patLengths[i] = -1; - iPtr->regexps[i] = NULL; - } - Tcl_InitHashTable(&iPtr->packageTable, TCL_STRING_KEYS); - iPtr->packageUnknown = NULL; - iPtr->cmdCount = 0; - iPtr->termOffset = 0; - TclInitLiteralTable(&(iPtr->literalTable)); - iPtr->compileEpoch = 0; - iPtr->compiledProcPtr = NULL; - iPtr->resolverPtr = NULL; - iPtr->evalFlags = 0; - iPtr->scriptFile = NULL; - iPtr->flags = 0; - iPtr->tracePtr = NULL; - iPtr->assocData = (Tcl_HashTable *) NULL; - iPtr->execEnvPtr = NULL; /* set after namespaces initialized */ - iPtr->emptyObjPtr = Tcl_NewObj(); /* another empty object */ - Tcl_IncrRefCount(iPtr->emptyObjPtr); - iPtr->resultSpace[0] = 0; - - iPtr->globalNsPtr = NULL; /* force creation of global ns below */ - iPtr->globalNsPtr = (Namespace *) Tcl_CreateNamespace(interp, "", - (ClientData) NULL, (Tcl_NamespaceDeleteProc *) NULL); - if (iPtr->globalNsPtr == NULL) { - panic("Tcl_CreateInterp: can't create global namespace"); - } - - /* - * Initialize support for code compilation and execution. We call - * TclCreateExecEnv after initializing namespaces since it tries to - * reference a Tcl variable (it links to the Tcl "tcl_traceExec" - * variable). - */ - - iPtr->execEnvPtr = TclCreateExecEnv(interp); - - /* - * Initialize the compilation and execution statistics kept for this - * interpreter. - */ - -#ifdef TCL_COMPILE_STATS - statsPtr = &(iPtr->stats); - statsPtr->numExecutions = 0; - statsPtr->numCompilations = 0; - statsPtr->numByteCodesFreed = 0; - (VOID *) memset(statsPtr->instructionCount, 0, - sizeof(statsPtr->instructionCount)); - - statsPtr->totalSrcBytes = 0.0; - statsPtr->totalByteCodeBytes = 0.0; - statsPtr->currentSrcBytes = 0.0; - statsPtr->currentByteCodeBytes = 0.0; - (VOID *) memset(statsPtr->srcCount, 0, sizeof(statsPtr->srcCount)); - (VOID *) memset(statsPtr->byteCodeCount, 0, - sizeof(statsPtr->byteCodeCount)); - (VOID *) memset(statsPtr->lifetimeCount, 0, - sizeof(statsPtr->lifetimeCount)); - - statsPtr->currentInstBytes = 0.0; - statsPtr->currentLitBytes = 0.0; - statsPtr->currentExceptBytes = 0.0; - statsPtr->currentAuxBytes = 0.0; - statsPtr->currentCmdMapBytes = 0.0; - - statsPtr->numLiteralsCreated = 0; - statsPtr->totalLitStringBytes = 0.0; - statsPtr->currentLitStringBytes = 0.0; - (VOID *) memset(statsPtr->literalCount, 0, - sizeof(statsPtr->literalCount)); -#endif /* TCL_COMPILE_STATS */ - - /* - * Initialise the stub table pointer. - */ - - iPtr->stubTable = &tclStubs; - - - /* - * Create the core commands. Do it here, rather than calling - * Tcl_CreateCommand, because it's faster (there's no need to check for - * a pre-existing command by the same name). If a command has a - * Tcl_CmdProc but no Tcl_ObjCmdProc, set the Tcl_ObjCmdProc to - * TclInvokeStringCommand. This is an object-based wrapper procedure - * that extracts strings, calls the string procedure, and creates an - * object for the result. Similarly, if a command has a Tcl_ObjCmdProc - * but no Tcl_CmdProc, set the Tcl_CmdProc to TclInvokeObjectCommand. - */ - - for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; - cmdInfoPtr++) { - int new; - Tcl_HashEntry *hPtr; - - if ((cmdInfoPtr->proc == (Tcl_CmdProc *) NULL) - && (cmdInfoPtr->objProc == (Tcl_ObjCmdProc *) NULL) - && (cmdInfoPtr->compileProc == (CompileProc *) NULL)) { - panic("Tcl_CreateInterp: builtin command with NULL string and object command procs and a NULL compile proc\n"); - } - - hPtr = Tcl_CreateHashEntry(&iPtr->globalNsPtr->cmdTable, - cmdInfoPtr->name, &new); - if (new) { - cmdPtr = (Command *) ckalloc(sizeof(Command)); - cmdPtr->hPtr = hPtr; - cmdPtr->nsPtr = iPtr->globalNsPtr; - cmdPtr->refCount = 1; - cmdPtr->cmdEpoch = 0; - cmdPtr->compileProc = cmdInfoPtr->compileProc; - if (cmdInfoPtr->proc == (Tcl_CmdProc *) NULL) { - cmdPtr->proc = TclInvokeObjectCommand; - cmdPtr->clientData = (ClientData) cmdPtr; - } else { - cmdPtr->proc = cmdInfoPtr->proc; - cmdPtr->clientData = (ClientData) NULL; - } - if (cmdInfoPtr->objProc == (Tcl_ObjCmdProc *) NULL) { - cmdPtr->objProc = TclInvokeStringCommand; - cmdPtr->objClientData = (ClientData) cmdPtr; - } else { - cmdPtr->objProc = cmdInfoPtr->objProc; - cmdPtr->objClientData = (ClientData) NULL; - } - cmdPtr->deleteProc = NULL; - cmdPtr->deleteData = (ClientData) NULL; - cmdPtr->deleted = 0; - cmdPtr->importRefPtr = NULL; - Tcl_SetHashValue(hPtr, cmdPtr); - } - } - - /* - * Register the builtin math functions. - */ - - i = 0; - for (builtinFuncPtr = builtinFuncTable; builtinFuncPtr->name != NULL; - builtinFuncPtr++) { - Tcl_CreateMathFunc((Tcl_Interp *) iPtr, builtinFuncPtr->name, - builtinFuncPtr->numArgs, builtinFuncPtr->argTypes, - (Tcl_MathProc *) NULL, (ClientData) 0); - hPtr = Tcl_FindHashEntry(&iPtr->mathFuncTable, - builtinFuncPtr->name); - if (hPtr == NULL) { - panic("Tcl_CreateInterp: Tcl_CreateMathFunc incorrectly registered '%s'", builtinFuncPtr->name); - return NULL; - } - mathFuncPtr = (MathFunc *) Tcl_GetHashValue(hPtr); - mathFuncPtr->builtinFuncIndex = i; - i++; - } - iPtr->flags |= EXPR_INITIALIZED; - - /* - * Do Multiple/Safe Interps Tcl init stuff - */ - - TclInterpInit(interp); - - /* - * We used to create the "errorInfo" and "errorCode" global vars at this - * point because so much of the Tcl implementation assumes they already - * exist. This is not quite enough, however, since they can be unset - * at any time. - * - * There are 2 choices: - * + Check every place where a GetVar of those is used - * and the NULL result is not checked (like in tclLoad.c) - * + Make SetVar,... NULL friendly - * We choose the second option because : - * + It is easy and low cost to check for NULL pointer before - * calling strlen() - * + It can be helpfull to other people using those API - * + Passing a NULL value to those closest 'meaning' is empty string - * (specially with the new objects where 0 bytes strings are ok) - * So the following init is commented out: -- dl - * - * (void) Tcl_SetVar2((Tcl_Interp *)iPtr, "errorInfo", (char *) NULL, - * "", TCL_GLOBAL_ONLY); - * (void) Tcl_SetVar2((Tcl_Interp *)iPtr, "errorCode", (char *) NULL, - * "NONE", TCL_GLOBAL_ONLY); - */ - -#ifndef TCL_GENERIC_ONLY - TclSetupEnv(interp); -#endif - - /* - * Compute the byte order of this machine. - */ - - order.s = 1; - Tcl_SetVar2(interp, "tcl_platform", "byteOrder", - ((order.c[0] == 1) ? "littleEndian" : "bigEndian"), - TCL_GLOBAL_ONLY); - - /* - * Set up other variables such as tcl_version and tcl_library - */ - - Tcl_SetVar(interp, "tcl_patchLevel", TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "tcl_version", TCL_VERSION, TCL_GLOBAL_ONLY); - Tcl_TraceVar2(interp, "tcl_precision", (char *) NULL, - TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - TclPrecTraceProc, (ClientData) NULL); - TclpSetVariables(interp); - - /* - * Register Tcl's version number. - */ - - Tcl_PkgProvideEx(interp, "Tcl", TCL_VERSION, (ClientData) &tclStubs); - -#ifdef Tcl_InitStubs -#undef Tcl_InitStubs -#endif - Tcl_InitStubs(interp, TCL_VERSION, 1); - - return interp; -} - -/* - *---------------------------------------------------------------------- - * - * TclHideUnsafeCommands -- - * - * Hides base commands that are not marked as safe from this - * interpreter. - * - * Results: - * TCL_OK if it succeeds, TCL_ERROR else. - * - * Side effects: - * Hides functionality in an interpreter. - * - *---------------------------------------------------------------------- - */ - -int -TclHideUnsafeCommands(interp) - Tcl_Interp *interp; /* Hide commands in this interpreter. */ -{ - register CmdInfo *cmdInfoPtr; - - if (interp == (Tcl_Interp *) NULL) { - return TCL_ERROR; - } - for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) { - if (!cmdInfoPtr->isSafe) { - Tcl_HideCommand(interp, cmdInfoPtr->name, cmdInfoPtr->name); - } - } - return TCL_OK; -} - -/* - *-------------------------------------------------------------- - * - * Tcl_CallWhenDeleted -- - * - * Arrange for a procedure to be called before a given - * interpreter is deleted. The procedure is called as soon - * as Tcl_DeleteInterp is called; if Tcl_CallWhenDeleted is - * called on an interpreter that has already been deleted, - * the procedure will be called when the last Tcl_Release is - * done on the interpreter. - * - * Results: - * None. - * - * Side effects: - * When Tcl_DeleteInterp is invoked to delete interp, - * proc will be invoked. See the manual entry for - * details. - * - *-------------------------------------------------------------- - */ - -void -Tcl_CallWhenDeleted(interp, proc, clientData) - Tcl_Interp *interp; /* Interpreter to watch. */ - Tcl_InterpDeleteProc *proc; /* Procedure to call when interpreter - * is about to be deleted. */ - ClientData clientData; /* One-word value to pass to proc. */ -{ - Interp *iPtr = (Interp *) interp; - static int assocDataCounter = 0; -#ifdef TCL_THREADS - static Tcl_Mutex assocMutex; -#endif - int new; - char buffer[32 + TCL_INTEGER_SPACE]; - AssocData *dPtr = (AssocData *) ckalloc(sizeof(AssocData)); - Tcl_HashEntry *hPtr; - - Tcl_MutexLock(&assocMutex); - sprintf(buffer, "Assoc Data Key #%d", assocDataCounter); - assocDataCounter++; - Tcl_MutexUnlock(&assocMutex); - - if (iPtr->assocData == (Tcl_HashTable *) NULL) { - iPtr->assocData = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - Tcl_InitHashTable(iPtr->assocData, TCL_STRING_KEYS); - } - hPtr = Tcl_CreateHashEntry(iPtr->assocData, buffer, &new); - dPtr->proc = proc; - dPtr->clientData = clientData; - Tcl_SetHashValue(hPtr, dPtr); -} - -/* - *-------------------------------------------------------------- - * - * Tcl_DontCallWhenDeleted -- - * - * Cancel the arrangement for a procedure to be called when - * a given interpreter is deleted. - * - * Results: - * None. - * - * Side effects: - * If proc and clientData were previously registered as a - * callback via Tcl_CallWhenDeleted, they are unregistered. - * If they weren't previously registered then nothing - * happens. - * - *-------------------------------------------------------------- - */ - -void -Tcl_DontCallWhenDeleted(interp, proc, clientData) - Tcl_Interp *interp; /* Interpreter to watch. */ - Tcl_InterpDeleteProc *proc; /* Procedure to call when interpreter - * is about to be deleted. */ - ClientData clientData; /* One-word value to pass to proc. */ -{ - Interp *iPtr = (Interp *) interp; - Tcl_HashTable *hTablePtr; - Tcl_HashSearch hSearch; - Tcl_HashEntry *hPtr; - AssocData *dPtr; - - hTablePtr = iPtr->assocData; - if (hTablePtr == (Tcl_HashTable *) NULL) { - return; - } - for (hPtr = Tcl_FirstHashEntry(hTablePtr, &hSearch); hPtr != NULL; - hPtr = Tcl_NextHashEntry(&hSearch)) { - dPtr = (AssocData *) Tcl_GetHashValue(hPtr); - if ((dPtr->proc == proc) && (dPtr->clientData == clientData)) { - ckfree((char *) dPtr); - Tcl_DeleteHashEntry(hPtr); - return; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetAssocData -- - * - * Creates a named association between user-specified data, a delete - * function and this interpreter. If the association already exists - * the data is overwritten with the new data. The delete function will - * be invoked when the interpreter is deleted. - * - * Results: - * None. - * - * Side effects: - * Sets the associated data, creates the association if needed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetAssocData(interp, name, proc, clientData) - Tcl_Interp *interp; /* Interpreter to associate with. */ - char *name; /* Name for association. */ - Tcl_InterpDeleteProc *proc; /* Proc to call when interpreter is - * about to be deleted. */ - ClientData clientData; /* One-word value to pass to proc. */ -{ - Interp *iPtr = (Interp *) interp; - AssocData *dPtr; - Tcl_HashEntry *hPtr; - int new; - - if (iPtr->assocData == (Tcl_HashTable *) NULL) { - iPtr->assocData = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - Tcl_InitHashTable(iPtr->assocData, TCL_STRING_KEYS); - } - hPtr = Tcl_CreateHashEntry(iPtr->assocData, name, &new); - if (new == 0) { - dPtr = (AssocData *) Tcl_GetHashValue(hPtr); - } else { - dPtr = (AssocData *) ckalloc(sizeof(AssocData)); - } - dPtr->proc = proc; - dPtr->clientData = clientData; - - Tcl_SetHashValue(hPtr, dPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteAssocData -- - * - * Deletes a named association of user-specified data with - * the specified interpreter. - * - * Results: - * None. - * - * Side effects: - * Deletes the association. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteAssocData(interp, name) - Tcl_Interp *interp; /* Interpreter to associate with. */ - char *name; /* Name of association. */ -{ - Interp *iPtr = (Interp *) interp; - AssocData *dPtr; - Tcl_HashEntry *hPtr; - - if (iPtr->assocData == (Tcl_HashTable *) NULL) { - return; - } - hPtr = Tcl_FindHashEntry(iPtr->assocData, name); - if (hPtr == (Tcl_HashEntry *) NULL) { - return; - } - dPtr = (AssocData *) Tcl_GetHashValue(hPtr); - if (dPtr->proc != NULL) { - (dPtr->proc) (dPtr->clientData, interp); - } - ckfree((char *) dPtr); - Tcl_DeleteHashEntry(hPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetAssocData -- - * - * Returns the client data associated with this name in the - * specified interpreter. - * - * Results: - * The client data in the AssocData record denoted by the named - * association, or NULL. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -ClientData -Tcl_GetAssocData(interp, name, procPtr) - Tcl_Interp *interp; /* Interpreter associated with. */ - char *name; /* Name of association. */ - Tcl_InterpDeleteProc **procPtr; /* Pointer to place to store address - * of current deletion callback. */ -{ - Interp *iPtr = (Interp *) interp; - AssocData *dPtr; - Tcl_HashEntry *hPtr; - - if (iPtr->assocData == (Tcl_HashTable *) NULL) { - return (ClientData) NULL; - } - hPtr = Tcl_FindHashEntry(iPtr->assocData, name); - if (hPtr == (Tcl_HashEntry *) NULL) { - return (ClientData) NULL; - } - dPtr = (AssocData *) Tcl_GetHashValue(hPtr); - if (procPtr != (Tcl_InterpDeleteProc **) NULL) { - *procPtr = dPtr->proc; - } - return dPtr->clientData; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InterpDeleted -- - * - * Returns nonzero if the interpreter has been deleted with a call - * to Tcl_DeleteInterp. - * - * Results: - * Nonzero if the interpreter is deleted, zero otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_InterpDeleted(interp) - Tcl_Interp *interp; -{ - return (((Interp *) interp)->flags & DELETED) ? 1 : 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteInterp -- - * - * Ensures that the interpreter will be deleted eventually. If there - * are no Tcl_Preserve calls in effect for this interpreter, it is - * deleted immediately, otherwise the interpreter is deleted when - * the last Tcl_Preserve is matched by a call to Tcl_Release. In either - * case, the procedure runs the currently registered deletion callbacks. - * - * Results: - * None. - * - * Side effects: - * The interpreter is marked as deleted. The caller may still use it - * safely if there are calls to Tcl_Preserve in effect for the - * interpreter, but further calls to Tcl_Eval etc in this interpreter - * will fail. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteInterp(interp) - Tcl_Interp *interp; /* Token for command interpreter (returned - * by a previous call to Tcl_CreateInterp). */ -{ - Interp *iPtr = (Interp *) interp; - - /* - * If the interpreter has already been marked deleted, just punt. - */ - - if (iPtr->flags & DELETED) { - return; - } - - /* - * Mark the interpreter as deleted. No further evals will be allowed. - */ - - iPtr->flags |= DELETED; - - /* - * Ensure that the interpreter is eventually deleted. - */ - - Tcl_EventuallyFree((ClientData) interp, - (Tcl_FreeProc *) DeleteInterpProc); -} - -/* - *---------------------------------------------------------------------- - * - * DeleteInterpProc -- - * - * Helper procedure to delete an interpreter. This procedure is - * called when the last call to Tcl_Preserve on this interpreter - * is matched by a call to Tcl_Release. The procedure cleans up - * all resources used in the interpreter and calls all currently - * registered interpreter deletion callbacks. - * - * Results: - * None. - * - * Side effects: - * Whatever the interpreter deletion callbacks do. Frees resources - * used by the interpreter. - * - *---------------------------------------------------------------------- - */ - -static void -DeleteInterpProc(interp) - Tcl_Interp *interp; /* Interpreter to delete. */ -{ - Interp *iPtr = (Interp *) interp; - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - Tcl_HashTable *hTablePtr; - ResolverScheme *resPtr, *nextResPtr; - int i; - - /* - * Punt if there is an error in the Tcl_Release/Tcl_Preserve matchup. - */ - - if (iPtr->numLevels > 0) { - panic("DeleteInterpProc called with active evals"); - } - - /* - * The interpreter should already be marked deleted; otherwise how - * did we get here? - */ - - if (!(iPtr->flags & DELETED)) { - panic("DeleteInterpProc called on interpreter not marked deleted"); - } - - TclHandleFree(iPtr->handle); - - /* - * Dismantle everything in the global namespace except for the - * "errorInfo" and "errorCode" variables. These remain until the - * namespace is actually destroyed, in case any errors occur. - * - * Dismantle the namespace here, before we clear the assocData. If any - * background errors occur here, they will be deleted below. - */ - - TclTeardownNamespace(iPtr->globalNsPtr); - - /* - * Delete all the hidden commands. - */ - - hTablePtr = iPtr->hiddenCmdTablePtr; - if (hTablePtr != NULL) { - /* - * Non-pernicious deletion. The deletion callbacks will not be - * allowed to create any new hidden or non-hidden commands. - * Tcl_DeleteCommandFromToken() will remove the entry from the - * hiddenCmdTablePtr. - */ - - hPtr = Tcl_FirstHashEntry(hTablePtr, &search); - for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - Tcl_DeleteCommandFromToken(interp, - (Tcl_Command) Tcl_GetHashValue(hPtr)); - } - Tcl_DeleteHashTable(hTablePtr); - ckfree((char *) hTablePtr); - } - /* - * Tear down the math function table. - */ - - for (hPtr = Tcl_FirstHashEntry(&iPtr->mathFuncTable, &search); - hPtr != NULL; - hPtr = Tcl_NextHashEntry(&search)) { - ckfree((char *) Tcl_GetHashValue(hPtr)); - } - Tcl_DeleteHashTable(&iPtr->mathFuncTable); - - /* - * Invoke deletion callbacks; note that a callback can create new - * callbacks, so we iterate. - */ - - while (iPtr->assocData != (Tcl_HashTable *) NULL) { - AssocData *dPtr; - - hTablePtr = iPtr->assocData; - iPtr->assocData = (Tcl_HashTable *) NULL; - for (hPtr = Tcl_FirstHashEntry(hTablePtr, &search); - hPtr != NULL; - hPtr = Tcl_FirstHashEntry(hTablePtr, &search)) { - dPtr = (AssocData *) Tcl_GetHashValue(hPtr); - Tcl_DeleteHashEntry(hPtr); - if (dPtr->proc != NULL) { - (*dPtr->proc)(dPtr->clientData, interp); - } - ckfree((char *) dPtr); - } - Tcl_DeleteHashTable(hTablePtr); - ckfree((char *) hTablePtr); - } - - /* - * Finish deleting the global namespace. - */ - - Tcl_DeleteNamespace((Tcl_Namespace *) iPtr->globalNsPtr); - - /* - * Free up the result *after* deleting variables, since variable - * deletion could have transferred ownership of the result string - * to Tcl. - */ - - Tcl_FreeResult(interp); - interp->result = NULL; - Tcl_DecrRefCount(iPtr->objResultPtr); - iPtr->objResultPtr = NULL; - if (iPtr->errorInfo != NULL) { - ckfree(iPtr->errorInfo); - iPtr->errorInfo = NULL; - } - if (iPtr->errorCode != NULL) { - ckfree(iPtr->errorCode); - iPtr->errorCode = NULL; - } - if (iPtr->appendResult != NULL) { - ckfree(iPtr->appendResult); - iPtr->appendResult = NULL; - } - for (i = 0; i < NUM_REGEXPS; i++) { - if (iPtr->patterns[i] == NULL) { - break; - } - ckfree(iPtr->patterns[i]); - ckfree((char *) iPtr->regexps[i]); - iPtr->regexps[i] = NULL; - } - TclFreePackageInfo(iPtr); - while (iPtr->tracePtr != NULL) { - Trace *nextPtr = iPtr->tracePtr->nextPtr; - - ckfree((char *) iPtr->tracePtr); - iPtr->tracePtr = nextPtr; - } - if (iPtr->execEnvPtr != NULL) { - TclDeleteExecEnv(iPtr->execEnvPtr); - } - Tcl_DecrRefCount(iPtr->emptyObjPtr); - iPtr->emptyObjPtr = NULL; - - resPtr = iPtr->resolverPtr; - while (resPtr) { - nextResPtr = resPtr->nextPtr; - ckfree(resPtr->name); - ckfree((char *) resPtr); - resPtr = nextResPtr; - } - - /* - * Free up literal objects created for scripts compiled by the - * interpreter. - */ - - TclDeleteLiteralTable(interp, &(iPtr->literalTable)); - ckfree((char *) iPtr); -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_HideCommand -- - * - * Makes a command hidden so that it cannot be invoked from within - * an interpreter, only from within an ancestor. - * - * Results: - * A standard Tcl result; also leaves a message in the interp's result - * if an error occurs. - * - * Side effects: - * Removes a command from the command table and create an entry - * into the hidden command table under the specified token name. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_HideCommand(interp, cmdName, hiddenCmdToken) - Tcl_Interp *interp; /* Interpreter in which to hide command. */ - char *cmdName; /* Name of command to hide. */ - char *hiddenCmdToken; /* Token name of the to-be-hidden command. */ -{ - Interp *iPtr = (Interp *) interp; - Tcl_Command cmd; - Command *cmdPtr; - Tcl_HashTable *hiddenCmdTablePtr; - Tcl_HashEntry *hPtr; - int new; - - if (iPtr->flags & DELETED) { - - /* - * The interpreter is being deleted. Do not create any new - * structures, because it is not safe to modify the interpreter. - */ - - return TCL_ERROR; - } - - /* - * Disallow hiding of commands that are currently in a namespace or - * renaming (as part of hiding) into a namespace. - * - * (because the current implementation with a single global table - * and the needed uniqueness of names cause problems with namespaces) - * - * we don't need to check for "::" in cmdName because the real check is - * on the nsPtr below. - * - * hiddenCmdToken is just a string which is not interpreted in any way. - * It may contain :: but the string is not interpreted as a namespace - * qualifier command name. Thus, hiding foo::bar to foo::bar and then - * trying to expose or invoke ::foo::bar will NOT work; but if the - * application always uses the same strings it will get consistent - * behaviour. - * - * But as we currently limit ourselves to the global namespace only - * for the source, in order to avoid potential confusion, - * lets prevent "::" in the token too. --dl - */ - - if (strstr(hiddenCmdToken, "::") != NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "cannot use namespace qualifiers as hidden command", - "token (rename)", (char *) NULL); - return TCL_ERROR; - } - - /* - * Find the command to hide. An error is returned if cmdName can't - * be found. Look up the command only from the global namespace. - * Full path of the command must be given if using namespaces. - */ - - cmd = Tcl_FindCommand(interp, cmdName, (Tcl_Namespace *) NULL, - /*flags*/ TCL_LEAVE_ERR_MSG | TCL_GLOBAL_ONLY); - if (cmd == (Tcl_Command) NULL) { - return TCL_ERROR; - } - cmdPtr = (Command *) cmd; - - /* - * Check that the command is really in global namespace - */ - - if ( cmdPtr->nsPtr != iPtr->globalNsPtr ) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can only hide global namespace commands", - " (use rename then hide)", (char *) NULL); - return TCL_ERROR; - } - - /* - * Initialize the hidden command table if necessary. - */ - - hiddenCmdTablePtr = iPtr->hiddenCmdTablePtr; - if (hiddenCmdTablePtr == NULL) { - hiddenCmdTablePtr = (Tcl_HashTable *) - ckalloc((unsigned) sizeof(Tcl_HashTable)); - Tcl_InitHashTable(hiddenCmdTablePtr, TCL_STRING_KEYS); - iPtr->hiddenCmdTablePtr = hiddenCmdTablePtr; - } - - /* - * It is an error to move an exposed command to a hidden command with - * hiddenCmdToken if a hidden command with the name hiddenCmdToken already - * exists. - */ - - hPtr = Tcl_CreateHashEntry(hiddenCmdTablePtr, hiddenCmdToken, &new); - if (!new) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "hidden command named \"", hiddenCmdToken, "\" already exists", - (char *) NULL); - return TCL_ERROR; - } - - /* - * Nb : This code is currently 'like' a rename to a specialy set apart - * name table. Changes here and in TclRenameCommand must - * be kept in synch untill the common parts are actually - * factorized out. - */ - - /* - * Remove the hash entry for the command from the interpreter command - * table. This is like deleting the command, so bump its command epoch; - * this invalidates any cached references that point to the command. - */ - - if (cmdPtr->hPtr != NULL) { - Tcl_DeleteHashEntry(cmdPtr->hPtr); - cmdPtr->hPtr = (Tcl_HashEntry *) NULL; - cmdPtr->cmdEpoch++; - } - - /* - * Now link the hash table entry with the command structure. - * We ensured above that the nsPtr was right. - */ - - cmdPtr->hPtr = hPtr; - Tcl_SetHashValue(hPtr, (ClientData) cmdPtr); - - /* - * If the command being hidden has a compile procedure, increment the - * interpreter's compileEpoch to invalidate its compiled code. This - * makes sure that we don't later try to execute old code compiled with - * command-specific (i.e., inline) bytecodes for the now-hidden - * command. This field is checked in Tcl_EvalObj and ObjInterpProc, - * and code whose compilation epoch doesn't match is recompiled. - */ - - if (cmdPtr->compileProc != NULL) { - iPtr->compileEpoch++; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ExposeCommand -- - * - * Makes a previously hidden command callable from inside the - * interpreter instead of only by its ancestors. - * - * Results: - * A standard Tcl result. If an error occurs, a message is left - * in the interp's result. - * - * Side effects: - * Moves commands from one hash table to another. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ExposeCommand(interp, hiddenCmdToken, cmdName) - Tcl_Interp *interp; /* Interpreter in which to make command - * callable. */ - char *hiddenCmdToken; /* Name of hidden command. */ - char *cmdName; /* Name of to-be-exposed command. */ -{ - Interp *iPtr = (Interp *) interp; - Command *cmdPtr; - Namespace *nsPtr; - Tcl_HashEntry *hPtr; - Tcl_HashTable *hiddenCmdTablePtr; - int new; - - if (iPtr->flags & DELETED) { - /* - * The interpreter is being deleted. Do not create any new - * structures, because it is not safe to modify the interpreter. - */ - - return TCL_ERROR; - } - - /* - * Check that we have a regular name for the command - * (that the user is not trying to do an expose and a rename - * (to another namespace) at the same time) - */ - - if (strstr(cmdName, "::") != NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can not expose to a namespace ", - "(use expose to toplevel, then rename)", - (char *) NULL); - return TCL_ERROR; - } - - /* - * Get the command from the hidden command table: - */ - - hPtr = NULL; - hiddenCmdTablePtr = iPtr->hiddenCmdTablePtr; - if (hiddenCmdTablePtr != NULL) { - hPtr = Tcl_FindHashEntry(hiddenCmdTablePtr, hiddenCmdToken); - } - if (hPtr == (Tcl_HashEntry *) NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown hidden command \"", hiddenCmdToken, - "\"", (char *) NULL); - return TCL_ERROR; - } - cmdPtr = (Command *) Tcl_GetHashValue(hPtr); - - - /* - * Check that we have a true global namespace - * command (enforced by Tcl_HideCommand() but let's double - * check. (If it was not, we would not really know how to - * handle it). - */ - if ( cmdPtr->nsPtr != iPtr->globalNsPtr ) { - /* - * This case is theoritically impossible, - * we might rather panic() than 'nicely' erroring out ? - */ - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "trying to expose a non global command name space command", - (char *) NULL); - return TCL_ERROR; - } - - /* This is the global table */ - nsPtr = cmdPtr->nsPtr; - - /* - * It is an error to overwrite an existing exposed command as a result - * of exposing a previously hidden command. - */ - - hPtr = Tcl_CreateHashEntry(&nsPtr->cmdTable, cmdName, &new); - if (!new) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "exposed command \"", cmdName, - "\" already exists", (char *) NULL); - return TCL_ERROR; - } - - /* - * Remove the hash entry for the command from the interpreter hidden - * command table. - */ - - if (cmdPtr->hPtr != NULL) { - Tcl_DeleteHashEntry(cmdPtr->hPtr); - cmdPtr->hPtr = NULL; - } - - /* - * Now link the hash table entry with the command structure. - * This is like creating a new command, so deal with any shadowing - * of commands in the global namespace. - */ - - cmdPtr->hPtr = hPtr; - - Tcl_SetHashValue(hPtr, (ClientData) cmdPtr); - - /* - * Not needed as we are only in the global namespace - * (but would be needed again if we supported namespace command hiding) - * - * TclResetShadowedCmdRefs(interp, cmdPtr); - */ - - - /* - * If the command being exposed has a compile procedure, increment - * interpreter's compileEpoch to invalidate its compiled code. This - * makes sure that we don't later try to execute old code compiled - * assuming the command is hidden. This field is checked in Tcl_EvalObj - * and ObjInterpProc, and code whose compilation epoch doesn't match is - * recompiled. - */ - - if (cmdPtr->compileProc != NULL) { - iPtr->compileEpoch++; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateCommand -- - * - * Define a new command in a command table. - * - * Results: - * The return value is a token for the command, which can - * be used in future calls to Tcl_GetCommandName. - * - * Side effects: - * If a command named cmdName already exists for interp, it is deleted. - * In the future, when cmdName is seen as the name of a command by - * Tcl_Eval, proc will be called. To support the bytecode interpreter, - * the command is created with a wrapper Tcl_ObjCmdProc - * (TclInvokeStringCommand) that eventially calls proc. When the - * command is deleted from the table, deleteProc will be called. - * See the manual entry for details on the calling sequence. - * - *---------------------------------------------------------------------- - */ - -Tcl_Command -Tcl_CreateCommand(interp, cmdName, proc, clientData, deleteProc) - Tcl_Interp *interp; /* Token for command interpreter returned by - * a previous call to Tcl_CreateInterp. */ - char *cmdName; /* Name of command. If it contains namespace - * qualifiers, the new command is put in the - * specified namespace; otherwise it is put - * in the global namespace. */ - Tcl_CmdProc *proc; /* Procedure to associate with cmdName. */ - ClientData clientData; /* Arbitrary value passed to string proc. */ - Tcl_CmdDeleteProc *deleteProc; - /* If not NULL, gives a procedure to call - * when this command is deleted. */ -{ - Interp *iPtr = (Interp *) interp; - ImportRef *oldRefPtr = NULL; - Namespace *nsPtr, *dummy1, *dummy2; - Command *cmdPtr, *refCmdPtr; - Tcl_HashEntry *hPtr; - char *tail; - int new; - ImportedCmdData *dataPtr; - - if (iPtr->flags & DELETED) { - /* - * The interpreter is being deleted. Don't create any new - * commands; it's not safe to muck with the interpreter anymore. - */ - - return (Tcl_Command) NULL; - } - - /* - * Determine where the command should reside. If its name contains - * namespace qualifiers, we put it in the specified namespace; - * otherwise, we always put it in the global namespace. - */ - - if (strstr(cmdName, "::") != NULL) { - TclGetNamespaceForQualName(interp, cmdName, (Namespace *) NULL, - CREATE_NS_IF_UNKNOWN, &nsPtr, &dummy1, &dummy2, &tail); - if ((nsPtr == NULL) || (tail == NULL)) { - return (Tcl_Command) NULL; - } - } else { - nsPtr = iPtr->globalNsPtr; - tail = cmdName; - } - - hPtr = Tcl_CreateHashEntry(&nsPtr->cmdTable, tail, &new); - if (!new) { - /* - * Command already exists. Delete the old one. - * Be careful to preserve any existing import links so we can - * restore them down below. That way, you can redefine a - * command and its import status will remain intact. - */ - - cmdPtr = (Command *) Tcl_GetHashValue(hPtr); - oldRefPtr = cmdPtr->importRefPtr; - cmdPtr->importRefPtr = NULL; - - Tcl_DeleteCommandFromToken(interp, (Tcl_Command) cmdPtr); - hPtr = Tcl_CreateHashEntry(&nsPtr->cmdTable, tail, &new); - if (!new) { - /* - * If the deletion callback recreated the command, just throw - * away the new command (if we try to delete it again, we - * could get stuck in an infinite loop). - */ - - ckfree((char*) Tcl_GetHashValue(hPtr)); - } - } - cmdPtr = (Command *) ckalloc(sizeof(Command)); - Tcl_SetHashValue(hPtr, cmdPtr); - cmdPtr->hPtr = hPtr; - cmdPtr->nsPtr = nsPtr; - cmdPtr->refCount = 1; - cmdPtr->cmdEpoch = 0; - cmdPtr->compileProc = (CompileProc *) NULL; - cmdPtr->objProc = TclInvokeStringCommand; - cmdPtr->objClientData = (ClientData) cmdPtr; - cmdPtr->proc = proc; - cmdPtr->clientData = clientData; - cmdPtr->deleteProc = deleteProc; - cmdPtr->deleteData = clientData; - cmdPtr->deleted = 0; - cmdPtr->importRefPtr = NULL; - - /* - * Plug in any existing import references found above. Be sure - * to update all of these references to point to the new command. - */ - - if (oldRefPtr != NULL) { - cmdPtr->importRefPtr = oldRefPtr; - while (oldRefPtr != NULL) { - refCmdPtr = oldRefPtr->importedCmdPtr; - dataPtr = (ImportedCmdData*)refCmdPtr->objClientData; - dataPtr->realCmdPtr = cmdPtr; - oldRefPtr = oldRefPtr->nextPtr; - } - } - - /* - * We just created a command, so in its namespace and all of its parent - * namespaces, it may shadow global commands with the same name. If any - * shadowed commands are found, invalidate all cached command references - * in the affected namespaces. - */ - - TclResetShadowedCmdRefs(interp, cmdPtr); - return (Tcl_Command) cmdPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateObjCommand -- - * - * Define a new object-based command in a command table. - * - * Results: - * The return value is a token for the command, which can - * be used in future calls to Tcl_GetCommandName. - * - * Side effects: - * If no command named "cmdName" already exists for interp, one is - * created. Otherwise, if a command does exist, then if the - * object-based Tcl_ObjCmdProc is TclInvokeStringCommand, we assume - * Tcl_CreateCommand was called previously for the same command and - * just set its Tcl_ObjCmdProc to the argument "proc"; otherwise, we - * delete the old command. - * - * In the future, during bytecode evaluation when "cmdName" is seen as - * the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based - * Tcl_ObjCmdProc proc will be called. When the command is deleted from - * the table, deleteProc will be called. See the manual entry for - * details on the calling sequence. - * - *---------------------------------------------------------------------- - */ - -Tcl_Command -Tcl_CreateObjCommand(interp, cmdName, proc, clientData, deleteProc) - Tcl_Interp *interp; /* Token for command interpreter (returned - * by previous call to Tcl_CreateInterp). */ - char *cmdName; /* Name of command. If it contains namespace - * qualifiers, the new command is put in the - * specified namespace; otherwise it is put - * in the global namespace. */ - Tcl_ObjCmdProc *proc; /* Object-based procedure to associate with - * name. */ - ClientData clientData; /* Arbitrary value to pass to object - * procedure. */ - Tcl_CmdDeleteProc *deleteProc; - /* If not NULL, gives a procedure to call - * when this command is deleted. */ -{ - Interp *iPtr = (Interp *) interp; - ImportRef *oldRefPtr = NULL; - Namespace *nsPtr, *dummy1, *dummy2; - Command *cmdPtr, *refCmdPtr; - Tcl_HashEntry *hPtr; - char *tail; - int new; - ImportedCmdData *dataPtr; - - if (iPtr->flags & DELETED) { - /* - * The interpreter is being deleted. Don't create any new - * commands; it's not safe to muck with the interpreter anymore. - */ - - return (Tcl_Command) NULL; - } - - /* - * Determine where the command should reside. If its name contains - * namespace qualifiers, we put it in the specified namespace; - * otherwise, we always put it in the global namespace. - */ - - if (strstr(cmdName, "::") != NULL) { - TclGetNamespaceForQualName(interp, cmdName, (Namespace *) NULL, - CREATE_NS_IF_UNKNOWN, &nsPtr, &dummy1, &dummy2, &tail); - if ((nsPtr == NULL) || (tail == NULL)) { - return (Tcl_Command) NULL; - } - } else { - nsPtr = iPtr->globalNsPtr; - tail = cmdName; - } - - hPtr = Tcl_CreateHashEntry(&nsPtr->cmdTable, tail, &new); - if (!new) { - cmdPtr = (Command *) Tcl_GetHashValue(hPtr); - - /* - * Command already exists. If its object-based Tcl_ObjCmdProc is - * TclInvokeStringCommand, we just set its Tcl_ObjCmdProc to the - * argument "proc". Otherwise, we delete the old command. - */ - - if (cmdPtr->objProc == TclInvokeStringCommand) { - cmdPtr->objProc = proc; - cmdPtr->objClientData = clientData; - cmdPtr->deleteProc = deleteProc; - cmdPtr->deleteData = clientData; - return (Tcl_Command) cmdPtr; - } - - /* - * Otherwise, we delete the old command. Be careful to preserve - * any existing import links so we can restore them down below. - * That way, you can redefine a command and its import status - * will remain intact. - */ - - oldRefPtr = cmdPtr->importRefPtr; - cmdPtr->importRefPtr = NULL; - - Tcl_DeleteCommandFromToken(interp, (Tcl_Command) cmdPtr); - hPtr = Tcl_CreateHashEntry(&nsPtr->cmdTable, tail, &new); - if (!new) { - /* - * If the deletion callback recreated the command, just throw - * away the new command (if we try to delete it again, we - * could get stuck in an infinite loop). - */ - - ckfree((char *) Tcl_GetHashValue(hPtr)); - } - } - cmdPtr = (Command *) ckalloc(sizeof(Command)); - Tcl_SetHashValue(hPtr, cmdPtr); - cmdPtr->hPtr = hPtr; - cmdPtr->nsPtr = nsPtr; - cmdPtr->refCount = 1; - cmdPtr->cmdEpoch = 0; - cmdPtr->compileProc = (CompileProc *) NULL; - cmdPtr->objProc = proc; - cmdPtr->objClientData = clientData; - cmdPtr->proc = TclInvokeObjectCommand; - cmdPtr->clientData = (ClientData) cmdPtr; - cmdPtr->deleteProc = deleteProc; - cmdPtr->deleteData = clientData; - cmdPtr->deleted = 0; - cmdPtr->importRefPtr = NULL; - - /* - * Plug in any existing import references found above. Be sure - * to update all of these references to point to the new command. - */ - - if (oldRefPtr != NULL) { - cmdPtr->importRefPtr = oldRefPtr; - while (oldRefPtr != NULL) { - refCmdPtr = oldRefPtr->importedCmdPtr; - dataPtr = (ImportedCmdData*)refCmdPtr->objClientData; - dataPtr->realCmdPtr = cmdPtr; - oldRefPtr = oldRefPtr->nextPtr; - } - } - - /* - * We just created a command, so in its namespace and all of its parent - * namespaces, it may shadow global commands with the same name. If any - * shadowed commands are found, invalidate all cached command references - * in the affected namespaces. - */ - - TclResetShadowedCmdRefs(interp, cmdPtr); - return (Tcl_Command) cmdPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclInvokeStringCommand -- - * - * "Wrapper" Tcl_ObjCmdProc used to call an existing string-based - * Tcl_CmdProc if no object-based procedure exists for a command. A - * pointer to this procedure is stored as the Tcl_ObjCmdProc in a - * Command structure. It simply turns around and calls the string - * Tcl_CmdProc in the Command structure. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * Besides those side effects of the called Tcl_CmdProc, - * TclInvokeStringCommand allocates and frees storage. - * - *---------------------------------------------------------------------- - */ - -int -TclInvokeStringCommand(clientData, interp, objc, objv) - ClientData clientData; /* Points to command's Command structure. */ - Tcl_Interp *interp; /* Current interpreter. */ - register int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Command *cmdPtr = (Command *) clientData; - register int i; - int result; - - /* - * This procedure generates an argv array for the string arguments. It - * starts out with stack-allocated space but uses dynamically-allocated - * storage if needed. - */ - -#define NUM_ARGS 20 - char *(argStorage[NUM_ARGS]); - char **argv = argStorage; - - /* - * Create the string argument array "argv". Make sure argv is large - * enough to hold the objc arguments plus 1 extra for the zero - * end-of-argv word. - */ - - if ((objc + 1) > NUM_ARGS) { - argv = (char **) ckalloc((unsigned)(objc + 1) * sizeof(char *)); - } - - for (i = 0; i < objc; i++) { - argv[i] = Tcl_GetString(objv[i]); - } - argv[objc] = 0; - - /* - * Invoke the command's string-based Tcl_CmdProc. - */ - - result = (*cmdPtr->proc)(cmdPtr->clientData, interp, objc, argv); - - /* - * Free the argv array if malloc'ed storage was used. - */ - - if (argv != argStorage) { - ckfree((char *) argv); - } - return result; -#undef NUM_ARGS -} - -/* - *---------------------------------------------------------------------- - * - * TclInvokeObjectCommand -- - * - * "Wrapper" Tcl_CmdProc used to call an existing object-based - * Tcl_ObjCmdProc if no string-based procedure exists for a command. - * A pointer to this procedure is stored as the Tcl_CmdProc in a - * Command structure. It simply turns around and calls the object - * Tcl_ObjCmdProc in the Command structure. - * - * Results: - * A standard Tcl string result value. - * - * Side effects: - * Besides those side effects of the called Tcl_CmdProc, - * TclInvokeStringCommand allocates and frees storage. - * - *---------------------------------------------------------------------- - */ - -int -TclInvokeObjectCommand(clientData, interp, argc, argv) - ClientData clientData; /* Points to command's Command structure. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - register char **argv; /* Argument strings. */ -{ - Command *cmdPtr = (Command *) clientData; - register Tcl_Obj *objPtr; - register int i; - int length, result; - - /* - * This procedure generates an objv array for object arguments that hold - * the argv strings. It starts out with stack-allocated space but uses - * dynamically-allocated storage if needed. - */ - -#define NUM_ARGS 20 - Tcl_Obj *(argStorage[NUM_ARGS]); - register Tcl_Obj **objv = argStorage; - - /* - * Create the object argument array "objv". Make sure objv is large - * enough to hold the objc arguments plus 1 extra for the zero - * end-of-objv word. - */ - - if ((argc + 1) > NUM_ARGS) { - objv = (Tcl_Obj **) - ckalloc((unsigned)(argc + 1) * sizeof(Tcl_Obj *)); - } - - for (i = 0; i < argc; i++) { - length = strlen(argv[i]); - TclNewObj(objPtr); - TclInitStringRep(objPtr, argv[i], length); - Tcl_IncrRefCount(objPtr); - objv[i] = objPtr; - } - objv[argc] = 0; - - /* - * Invoke the command's object-based Tcl_ObjCmdProc. - */ - - result = (*cmdPtr->objProc)(cmdPtr->objClientData, interp, argc, objv); - - /* - * Move the interpreter's object result to the string result, - * then reset the object result. - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - - /* - * Decrement the ref counts for the argument objects created above, - * then free the objv array if malloc'ed storage was used. - */ - - for (i = 0; i < argc; i++) { - objPtr = objv[i]; - Tcl_DecrRefCount(objPtr); - } - if (objv != argStorage) { - ckfree((char *) objv); - } - return result; -#undef NUM_ARGS -} - -/* - *---------------------------------------------------------------------- - * - * TclRenameCommand -- - * - * Called to give an existing Tcl command a different name. Both the - * old command name and the new command name can have "::" namespace - * qualifiers. If the new command has a different namespace context, - * the command will be moved to that namespace and will execute in - * the context of that new namespace. - * - * If the new command name is NULL or the null string, the command is - * deleted. - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * If anything goes wrong, an error message is returned in the - * interpreter's result object. - * - *---------------------------------------------------------------------- - */ - -int -TclRenameCommand(interp, oldName, newName) - Tcl_Interp *interp; /* Current interpreter. */ - char *oldName; /* Existing command name. */ - char *newName; /* New command name. */ -{ - Interp *iPtr = (Interp *) interp; - char *newTail; - Namespace *cmdNsPtr, *newNsPtr, *dummy1, *dummy2; - Tcl_Command cmd; - Command *cmdPtr; - Tcl_HashEntry *hPtr, *oldHPtr; - int new, result; - - /* - * Find the existing command. An error is returned if cmdName can't - * be found. - */ - - cmd = Tcl_FindCommand(interp, oldName, (Tcl_Namespace *) NULL, - /*flags*/ 0); - cmdPtr = (Command *) cmd; - if (cmdPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "can't ", - ((newName == NULL)||(*newName == '\0'))? "delete":"rename", - " \"", oldName, "\": command doesn't exist", (char *) NULL); - return TCL_ERROR; - } - cmdNsPtr = cmdPtr->nsPtr; - - /* - * If the new command name is NULL or empty, delete the command. Do this - * with Tcl_DeleteCommandFromToken, since we already have the command. - */ - - if ((newName == NULL) || (*newName == '\0')) { - Tcl_DeleteCommandFromToken(interp, cmd); - return TCL_OK; - } - - /* - * Make sure that the destination command does not already exist. - * The rename operation is like creating a command, so we should - * automatically create the containing namespaces just like - * Tcl_CreateCommand would. - */ - - TclGetNamespaceForQualName(interp, newName, (Namespace *) NULL, - CREATE_NS_IF_UNKNOWN, &newNsPtr, &dummy1, &dummy2, &newTail); - - if ((newNsPtr == NULL) || (newTail == NULL)) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't rename to \"", newName, "\": bad command name", - (char *) NULL); - return TCL_ERROR; - } - if (Tcl_FindHashEntry(&newNsPtr->cmdTable, newTail) != NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't rename to \"", newName, - "\": command already exists", (char *) NULL); - return TCL_ERROR; - } - - - /* - * Warning: any changes done in the code here are likely - * to be needed in Tcl_HideCommand() code too. - * (until the common parts are extracted out) --dl - */ - - /* - * Put the command in the new namespace so we can check for an alias - * loop. Since we are adding a new command to a namespace, we must - * handle any shadowing of the global commands that this might create. - */ - - oldHPtr = cmdPtr->hPtr; - hPtr = Tcl_CreateHashEntry(&newNsPtr->cmdTable, newTail, &new); - Tcl_SetHashValue(hPtr, (ClientData) cmdPtr); - cmdPtr->hPtr = hPtr; - cmdPtr->nsPtr = newNsPtr; - TclResetShadowedCmdRefs(interp, cmdPtr); - - /* - * Now check for an alias loop. If we detect one, put everything back - * the way it was and report the error. - */ - - result = TclPreventAliasLoop(interp, interp, (Tcl_Command) cmdPtr); - if (result != TCL_OK) { - Tcl_DeleteHashEntry(cmdPtr->hPtr); - cmdPtr->hPtr = oldHPtr; - cmdPtr->nsPtr = cmdNsPtr; - return result; - } - - /* - * The new command name is okay, so remove the command from its - * current namespace. This is like deleting the command, so bump - * the cmdEpoch to invalidate any cached references to the command. - */ - - Tcl_DeleteHashEntry(oldHPtr); - cmdPtr->cmdEpoch++; - - /* - * If the command being renamed has a compile procedure, increment the - * interpreter's compileEpoch to invalidate its compiled code. This - * makes sure that we don't later try to execute old code compiled for - * the now-renamed command. - */ - - if (cmdPtr->compileProc != NULL) { - iPtr->compileEpoch++; - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetCommandInfo -- - * - * Modifies various information about a Tcl command. Note that - * this procedure will not change a command's namespace; use - * Tcl_RenameCommand to do that. Also, the isNativeObjectProc - * member of *infoPtr is ignored. - * - * Results: - * If cmdName exists in interp, then the information at *infoPtr - * is stored with the command in place of the current information - * and 1 is returned. If the command doesn't exist then 0 is - * returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_SetCommandInfo(interp, cmdName, infoPtr) - Tcl_Interp *interp; /* Interpreter in which to look - * for command. */ - char *cmdName; /* Name of desired command. */ - Tcl_CmdInfo *infoPtr; /* Where to store information about - * command. */ -{ - Tcl_Command cmd; - Command *cmdPtr; - - cmd = Tcl_FindCommand(interp, cmdName, (Tcl_Namespace *) NULL, - /*flags*/ 0); - if (cmd == (Tcl_Command) NULL) { - return 0; - } - - /* - * The isNativeObjectProc and nsPtr members of *infoPtr are ignored. - */ - - cmdPtr = (Command *) cmd; - cmdPtr->proc = infoPtr->proc; - cmdPtr->clientData = infoPtr->clientData; - if (infoPtr->objProc == (Tcl_ObjCmdProc *) NULL) { - cmdPtr->objProc = TclInvokeStringCommand; - cmdPtr->objClientData = (ClientData) cmdPtr; - } else { - cmdPtr->objProc = infoPtr->objProc; - cmdPtr->objClientData = infoPtr->objClientData; - } - cmdPtr->deleteProc = infoPtr->deleteProc; - cmdPtr->deleteData = infoPtr->deleteData; - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetCommandInfo -- - * - * Returns various information about a Tcl command. - * - * Results: - * If cmdName exists in interp, then *infoPtr is modified to - * hold information about cmdName and 1 is returned. If the - * command doesn't exist then 0 is returned and *infoPtr isn't - * modified. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetCommandInfo(interp, cmdName, infoPtr) - Tcl_Interp *interp; /* Interpreter in which to look - * for command. */ - char *cmdName; /* Name of desired command. */ - Tcl_CmdInfo *infoPtr; /* Where to store information about - * command. */ -{ - Tcl_Command cmd; - Command *cmdPtr; - - cmd = Tcl_FindCommand(interp, cmdName, (Tcl_Namespace *) NULL, - /*flags*/ 0); - if (cmd == (Tcl_Command) NULL) { - return 0; - } - - /* - * Set isNativeObjectProc 1 if objProc was registered by a call to - * Tcl_CreateObjCommand. Otherwise set it to 0. - */ - - cmdPtr = (Command *) cmd; - infoPtr->isNativeObjectProc = - (cmdPtr->objProc != TclInvokeStringCommand); - infoPtr->objProc = cmdPtr->objProc; - infoPtr->objClientData = cmdPtr->objClientData; - infoPtr->proc = cmdPtr->proc; - infoPtr->clientData = cmdPtr->clientData; - infoPtr->deleteProc = cmdPtr->deleteProc; - infoPtr->deleteData = cmdPtr->deleteData; - infoPtr->namespacePtr = (Tcl_Namespace *) cmdPtr->nsPtr; - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetCommandName -- - * - * Given a token returned by Tcl_CreateCommand, this procedure - * returns the current name of the command (which may have changed - * due to renaming). - * - * Results: - * The return value is the name of the given command. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetCommandName(interp, command) - Tcl_Interp *interp; /* Interpreter containing the command. */ - Tcl_Command command; /* Token for command returned by a previous - * call to Tcl_CreateCommand. The command - * must not have been deleted. */ -{ - Command *cmdPtr = (Command *) command; - - if ((cmdPtr == NULL) || (cmdPtr->hPtr == NULL)) { - - /* - * This should only happen if command was "created" after the - * interpreter began to be deleted, so there isn't really any - * command. Just return an empty string. - */ - - return ""; - } - return Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetCommandFullName -- - * - * Given a token returned by, e.g., Tcl_CreateCommand or - * Tcl_FindCommand, this procedure appends to an object the command's - * full name, qualified by a sequence of parent namespace names. The - * command's fully-qualified name may have changed due to renaming. - * - * Results: - * None. - * - * Side effects: - * The command's fully-qualified name is appended to the string - * representation of objPtr. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_GetCommandFullName(interp, command, objPtr) - Tcl_Interp *interp; /* Interpreter containing the command. */ - Tcl_Command command; /* Token for command returned by a previous - * call to Tcl_CreateCommand. The command - * must not have been deleted. */ - Tcl_Obj *objPtr; /* Points to the object onto which the - * command's full name is appended. */ - -{ - Interp *iPtr = (Interp *) interp; - register Command *cmdPtr = (Command *) command; - char *name; - - /* - * Add the full name of the containing namespace, followed by the "::" - * separator, and the command name. - */ - - if (cmdPtr != NULL) { - if (cmdPtr->nsPtr != NULL) { - Tcl_AppendToObj(objPtr, cmdPtr->nsPtr->fullName, -1); - if (cmdPtr->nsPtr != iPtr->globalNsPtr) { - Tcl_AppendToObj(objPtr, "::", 2); - } - } - if (cmdPtr->hPtr != NULL) { - name = Tcl_GetHashKey(cmdPtr->hPtr->tablePtr, cmdPtr->hPtr); - Tcl_AppendToObj(objPtr, name, -1); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteCommand -- - * - * Remove the given command from the given interpreter. - * - * Results: - * 0 is returned if the command was deleted successfully. - * -1 is returned if there didn't exist a command by that name. - * - * Side effects: - * cmdName will no longer be recognized as a valid command for - * interp. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_DeleteCommand(interp, cmdName) - Tcl_Interp *interp; /* Token for command interpreter (returned - * by a previous Tcl_CreateInterp call). */ - char *cmdName; /* Name of command to remove. */ -{ - Tcl_Command cmd; - - /* - * Find the desired command and delete it. - */ - - cmd = Tcl_FindCommand(interp, cmdName, (Tcl_Namespace *) NULL, - /*flags*/ 0); - if (cmd == (Tcl_Command) NULL) { - return -1; - } - return Tcl_DeleteCommandFromToken(interp, cmd); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteCommandFromToken -- - * - * Removes the given command from the given interpreter. This procedure - * resembles Tcl_DeleteCommand, but takes a Tcl_Command token instead - * of a command name for efficiency. - * - * Results: - * 0 is returned if the command was deleted successfully. - * -1 is returned if there didn't exist a command by that name. - * - * Side effects: - * The command specified by "cmd" will no longer be recognized as a - * valid command for "interp". - * - *---------------------------------------------------------------------- - */ - -int -Tcl_DeleteCommandFromToken(interp, cmd) - Tcl_Interp *interp; /* Token for command interpreter returned by - * a previous call to Tcl_CreateInterp. */ - Tcl_Command cmd; /* Token for command to delete. */ -{ - Interp *iPtr = (Interp *) interp; - Command *cmdPtr = (Command *) cmd; - ImportRef *refPtr, *nextRefPtr; - Tcl_Command importCmd; - - /* - * The code here is tricky. We can't delete the hash table entry - * before invoking the deletion callback because there are cases - * where the deletion callback needs to invoke the command (e.g. - * object systems such as OTcl). However, this means that the - * callback could try to delete or rename the command. The deleted - * flag allows us to detect these cases and skip nested deletes. - */ - - if (cmdPtr->deleted) { - /* - * Another deletion is already in progress. Remove the hash - * table entry now, but don't invoke a callback or free the - * command structure. - */ - - Tcl_DeleteHashEntry(cmdPtr->hPtr); - cmdPtr->hPtr = NULL; - return 0; - } - - /* - * If the command being deleted has a compile procedure, increment the - * interpreter's compileEpoch to invalidate its compiled code. This - * makes sure that we don't later try to execute old code compiled with - * command-specific (i.e., inline) bytecodes for the now-deleted - * command. This field is checked in Tcl_EvalObj and ObjInterpProc, and - * code whose compilation epoch doesn't match is recompiled. - */ - - if (cmdPtr->compileProc != NULL) { - iPtr->compileEpoch++; - } - - cmdPtr->deleted = 1; - if (cmdPtr->deleteProc != NULL) { - /* - * Delete the command's client data. If this was an imported command - * created when a command was imported into a namespace, this client - * data will be a pointer to a ImportedCmdData structure describing - * the "real" command that this imported command refers to. - */ - - (*cmdPtr->deleteProc)(cmdPtr->deleteData); - } - - /* - * Bump the command epoch counter. This will invalidate all cached - * references that point to this command. - */ - - cmdPtr->cmdEpoch++; - - /* - * If this command was imported into other namespaces, then imported - * commands were created that refer back to this command. Delete these - * imported commands now. - */ - - for (refPtr = cmdPtr->importRefPtr; refPtr != NULL; - refPtr = nextRefPtr) { - nextRefPtr = refPtr->nextPtr; - importCmd = (Tcl_Command) refPtr->importedCmdPtr; - Tcl_DeleteCommandFromToken(interp, importCmd); - } - - /* - * Don't use hPtr to delete the hash entry here, because it's - * possible that the deletion callback renamed the command. - * Instead, use cmdPtr->hptr, and make sure that no-one else - * has already deleted the hash entry. - */ - - if (cmdPtr->hPtr != NULL) { - Tcl_DeleteHashEntry(cmdPtr->hPtr); - } - - /* - * Mark the Command structure as no longer valid. This allows - * TclExecuteByteCode to recognize when a Command has logically been - * deleted and a pointer to this Command structure cached in a CmdName - * object is invalid. TclExecuteByteCode will look up the command again - * in the interpreter's command hashtable. - */ - - cmdPtr->objProc = NULL; - - /* - * Now free the Command structure, unless there is another reference to - * it from a CmdName Tcl object in some ByteCode code sequence. In that - * case, delay the cleanup until all references are either discarded - * (when a ByteCode is freed) or replaced by a new reference (when a - * cached CmdName Command reference is found to be invalid and - * TclExecuteByteCode looks up the command in the command hashtable). - */ - - TclCleanupCommand(cmdPtr); - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclCleanupCommand -- - * - * This procedure frees up a Command structure unless it is still - * referenced from an interpreter's command hashtable or from a CmdName - * Tcl object representing the name of a command in a ByteCode - * instruction sequence. - * - * Results: - * None. - * - * Side effects: - * Memory gets freed unless a reference to the Command structure still - * exists. In that case the cleanup is delayed until the command is - * deleted or when the last ByteCode referring to it is freed. - * - *---------------------------------------------------------------------- - */ - -void -TclCleanupCommand(cmdPtr) - register Command *cmdPtr; /* Points to the Command structure to - * be freed. */ -{ - cmdPtr->refCount--; - if (cmdPtr->refCount <= 0) { - ckfree((char *) cmdPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateMathFunc -- - * - * Creates a new math function for expressions in a given - * interpreter. - * - * Results: - * None. - * - * Side effects: - * The function defined by "name" is created or redefined. If the - * function already exists then its definition is replaced; this - * includes the builtin functions. Redefining a builtin function forces - * all existing code to be invalidated since that code may be compiled - * using an instruction specific to the replaced function. In addition, - * redefioning a non-builtin function will force existing code to be - * invalidated if the number of arguments has changed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_CreateMathFunc(interp, name, numArgs, argTypes, proc, clientData) - Tcl_Interp *interp; /* Interpreter in which function is - * to be available. */ - char *name; /* Name of function (e.g. "sin"). */ - int numArgs; /* Nnumber of arguments required by - * function. */ - Tcl_ValueType *argTypes; /* Array of types acceptable for - * each argument. */ - Tcl_MathProc *proc; /* Procedure that implements the - * math function. */ - ClientData clientData; /* Additional value to pass to the - * function. */ -{ - Interp *iPtr = (Interp *) interp; - Tcl_HashEntry *hPtr; - MathFunc *mathFuncPtr; - int new, i; - - hPtr = Tcl_CreateHashEntry(&iPtr->mathFuncTable, name, &new); - if (new) { - Tcl_SetHashValue(hPtr, ckalloc(sizeof(MathFunc))); - } - mathFuncPtr = (MathFunc *) Tcl_GetHashValue(hPtr); - - if (!new) { - if (mathFuncPtr->builtinFuncIndex >= 0) { - /* - * We are redefining a builtin math function. Invalidate the - * interpreter's existing code by incrementing its - * compileEpoch member. This field is checked in Tcl_EvalObj - * and ObjInterpProc, and code whose compilation epoch doesn't - * match is recompiled. Newly compiled code will no longer - * treat the function as builtin. - */ - - iPtr->compileEpoch++; - } else { - /* - * A non-builtin function is being redefined. We must invalidate - * existing code if the number of arguments has changed. This - * is because existing code was compiled assuming that number. - */ - - if (numArgs != mathFuncPtr->numArgs) { - iPtr->compileEpoch++; - } - } - } - - mathFuncPtr->builtinFuncIndex = -1; /* can't be a builtin function */ - if (numArgs > MAX_MATH_ARGS) { - numArgs = MAX_MATH_ARGS; - } - mathFuncPtr->numArgs = numArgs; - for (i = 0; i < numArgs; i++) { - mathFuncPtr->argTypes[i] = argTypes[i]; - } - mathFuncPtr->proc = proc; - mathFuncPtr->clientData = clientData; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EvalObjEx -- - * - * Execute Tcl commands stored in a Tcl object. These commands are - * compiled into bytecodes if necessary. - * - * Results: - * The return value is one of the return codes defined in tcl.h - * (such as TCL_OK), and the interpreter's result contains a value - * to supplement the return code. - * - * Side effects: - * The object is converted, if necessary, to a ByteCode object that - * holds the bytecode instructions for the commands. Executing the - * commands will almost certainly have side effects that depend - * on those commands. - * - * Just as in Tcl_Eval, interp->termOffset is set to the offset of the - * last character executed in the objPtr's string. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_EvalObjEx(interp, objPtr, flags) - Tcl_Interp *interp; /* Token for command interpreter - * (returned by a previous call to - * Tcl_CreateInterp). */ - register Tcl_Obj *objPtr; /* Pointer to object containing - * commands to execute. */ - int flags; /* Collection of OR-ed bits that - * control the evaluation of the - * script. Supported values are - * TCL_EVAL_GLOBAL and - * TCL_EVAL_DIRECT. */ -{ - register Interp *iPtr = (Interp *) interp; - int evalFlags; /* Interp->evalFlags value when the - * procedure was called. */ - register ByteCode* codePtr; /* Tcl Internal type of bytecode. */ - int oldCount = iPtr->cmdCount; /* Used to tell whether any commands - * at all were executed. */ - int numSrcBytes; - int result; - CallFrame *savedVarFramePtr; /* Saves old copy of iPtr->varFramePtr - * in case TCL_EVAL_GLOBAL was set. */ - Namespace *namespacePtr; - - /* - * Prevent the object from being deleted as a side effect of evaling it. - */ - - Tcl_IncrRefCount(objPtr); - - if ((iPtr->flags & USE_EVAL_DIRECT) || (flags & TCL_EVAL_DIRECT)) { - /* - * We're not supposed to use the compiler or byte-code interpreter. - * Let Tcl_EvalEx evaluate the command directly (and probably - * more slowly). - */ - - char *p; - int length; - - p = Tcl_GetStringFromObj(objPtr, &length); - result = Tcl_EvalEx(interp, p, length, flags); - Tcl_DecrRefCount(objPtr); - return result; - } - - savedVarFramePtr = iPtr->varFramePtr; - if (flags & TCL_EVAL_GLOBAL) { - iPtr->varFramePtr = NULL; - } - - /* - * Reset both the interpreter's string and object results and clear out - * any error information. This makes sure that we return an empty - * result if there are no commands in the command string. - */ - - Tcl_ResetResult(interp); - - /* - * Check depth of nested calls to Tcl_Eval: if this gets too large, - * it's probably because of an infinite loop somewhere. - */ - - iPtr->numLevels++; - if (iPtr->numLevels > iPtr->maxNestingDepth) { - iPtr->numLevels--; - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "too many nested calls to Tcl_EvalObj (infinite loop?)", -1); - result = TCL_ERROR; - goto done; - } - - /* - * On the Mac, we will never reach the default recursion limit before - * blowing the stack. So we need to do a check here. - */ - - if (TclpCheckStackSpace() == 0) { - /*NOTREACHED*/ - iPtr->numLevels--; - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "too many nested calls to Tcl_EvalObj (infinite loop?)", -1); - result = TCL_ERROR; - goto done; - } - - /* - * If the interpreter has been deleted, return an error. - */ - - if (iPtr->flags & DELETED) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "attempt to call eval in deleted interpreter", -1); - Tcl_SetErrorCode(interp, "CORE", "IDELETE", - "attempt to call eval in deleted interpreter", - (char *) NULL); - result = TCL_ERROR; - goto done; - } - - /* - * Get the ByteCode from the object. If it exists, make sure it hasn't - * been invalidated by, e.g., someone redefining a command with a - * compile procedure (this might make the compiled code wrong). If - * necessary, convert the object to be a ByteCode object and compile it. - * Also, if the code was compiled in/for a different interpreter, - * or for a different namespace, or for the same namespace but - * with different name resolution rules, we recompile it. - * - * Precompiled objects, however, are immutable and therefore - * they are not recompiled, even if the epoch has changed. - */ - - if (iPtr->varFramePtr != NULL) { - namespacePtr = iPtr->varFramePtr->nsPtr; - } else { - namespacePtr = iPtr->globalNsPtr; - } - - if (objPtr->typePtr == &tclByteCodeType) { - codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; - - if (((Interp *) *codePtr->interpHandle != iPtr) - || (codePtr->compileEpoch != iPtr->compileEpoch) - || (codePtr->nsPtr != namespacePtr) - || (codePtr->nsEpoch != namespacePtr->resolverEpoch)) { - if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) { - if ((Interp *) *codePtr->interpHandle != iPtr) { - panic("Tcl_EvalObj: compiled script jumped interps"); - } - codePtr->compileEpoch = iPtr->compileEpoch; - } else { - tclByteCodeType.freeIntRepProc(objPtr); - } - } - } - if (objPtr->typePtr != &tclByteCodeType) { - iPtr->errorLine = 1; - result = tclByteCodeType.setFromAnyProc(interp, objPtr); - if (result != TCL_OK) { - goto done; - } - } else { - codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; - if (((Interp *) *codePtr->interpHandle != iPtr) - || (codePtr->compileEpoch != iPtr->compileEpoch)) { - (*tclByteCodeType.freeIntRepProc)(objPtr); - iPtr->errorLine = 1; - result = (*tclByteCodeType.setFromAnyProc)(interp, objPtr); - if (result != TCL_OK) { - iPtr->numLevels--; - return result; - } - } - } - codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; - - /* - * Extract then reset the compilation flags in the interpreter. - * Resetting the flags must be done after any compilation. - */ - - evalFlags = iPtr->evalFlags; - iPtr->evalFlags = 0; - - /* - * Execute the commands. If the code was compiled from an empty string, - * don't bother executing the code. - */ - - numSrcBytes = codePtr->numSrcBytes; - if ((numSrcBytes > 0) || (codePtr->flags & TCL_BYTECODE_PRECOMPILED)) { - /* - * Increment the code's ref count while it is being executed. If - * afterwards no references to it remain, free the code. - */ - - codePtr->refCount++; - result = TclExecuteByteCode(interp, codePtr); - codePtr->refCount--; - if (codePtr->refCount <= 0) { - TclCleanupByteCode(codePtr); - } - } else { - result = TCL_OK; - } - - /* - * If no commands at all were executed, check for asynchronous - * handlers so that they at least get one change to execute. - * This is needed to handle event loops written in Tcl with - * empty bodies. - */ - - if ((oldCount == iPtr->cmdCount) && Tcl_AsyncReady()) { - result = Tcl_AsyncInvoke(interp, result); - } - - /* - * Update the interpreter's evaluation level count. If we are again at - * the top level, process any unusual return code returned by the - * evaluated code. - */ - - if (iPtr->numLevels == 1) { - if (result == TCL_RETURN) { - result = TclUpdateReturnInfo(iPtr); - } - if ((result != TCL_OK) && (result != TCL_ERROR) - && ((evalFlags & TCL_ALLOW_EXCEPTIONS) == 0)) { - ProcessUnexpectedResult(interp, result); - result = TCL_ERROR; - } - } - - /* - * If an error occurred, record information about what was being - * executed when the error occurred. - */ - - if ((result == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) { - RecordTracebackInfo(interp, objPtr, numSrcBytes); - } - - /* - * Set the interpreter's termOffset member to the offset of the - * character just after the last one executed. We approximate the offset - * of the last character executed by using the number of characters - * compiled. - */ - - iPtr->termOffset = numSrcBytes; - iPtr->flags &= ~ERR_ALREADY_LOGGED; - - done: - TclDecrRefCount(objPtr); - iPtr->varFramePtr = savedVarFramePtr; - iPtr->numLevels--; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * ProcessUnexpectedResult -- - * - * Procedure called by Tcl_EvalObj to set the interpreter's result - * value to an appropriate error message when the code it evaluates - * returns an unexpected result code (not TCL_OK and not TCL_ERROR) to - * the topmost evaluation level. - * - * Results: - * None. - * - * Side effects: - * The interpreter result is set to an error message appropriate to - * the result code. - * - *---------------------------------------------------------------------- - */ - -static void -ProcessUnexpectedResult(interp, returnCode) - Tcl_Interp *interp; /* The interpreter in which the unexpected - * result code was returned. */ - int returnCode; /* The unexpected result code. */ -{ - Tcl_ResetResult(interp); - if (returnCode == TCL_BREAK) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "invoked \"break\" outside of a loop", -1); - } else if (returnCode == TCL_CONTINUE) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "invoked \"continue\" outside of a loop", -1); - } else { - char buf[30 + TCL_INTEGER_SPACE]; - - sprintf(buf, "command returned bad code: %d", returnCode); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } -} - -/* - *---------------------------------------------------------------------- - * - * RecordTracebackInfo -- - * - * Procedure called by Tcl_EvalObj to record information about what was - * being executed when the error occurred. - * - * Results: - * None. - * - * Side effects: - * Appends information about the script being evaluated to the - * interpreter's "errorInfo" variable. - * - *---------------------------------------------------------------------- - */ - -static void -RecordTracebackInfo(interp, objPtr, numSrcBytes) - Tcl_Interp *interp; /* The interpreter in which the error - * occurred. */ - Tcl_Obj *objPtr; /* Points to object containing script whose - * evaluation resulted in an error. */ - int numSrcBytes; /* Number of bytes compiled in script. */ -{ - Interp *iPtr = (Interp *) interp; - char buf[200]; - char *ellipsis, *bytes; - int length; - - /* - * Decide how much of the command to print in the error message - * (up to a certain number of bytes). - */ - - bytes = Tcl_GetStringFromObj(objPtr, &length); - length = TclMin(numSrcBytes, length); - - ellipsis = ""; - if (length > 150) { - length = 150; - ellipsis = " ..."; - } - - if (!(iPtr->flags & ERR_IN_PROGRESS)) { - sprintf(buf, "\n while executing\n\"%.*s%s\"", - length, bytes, ellipsis); - } else { - sprintf(buf, "\n invoked from within\n\"%.*s%s\"", - length, bytes, ellipsis); - } - Tcl_AddObjErrorInfo(interp, buf, -1); -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean -- - * - * Procedures to evaluate an expression and return its value in a - * particular form. - * - * Results: - * Each of the procedures below returns a standard Tcl result. If an - * error occurs then an error message is left in the interp's result. - * Otherwise the value of the expression, in the appropriate form, - * is stored at *ptr. If the expression had a result that was - * incompatible with the desired form then an error is returned. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_ExprLong(interp, string, ptr) - Tcl_Interp *interp; /* Context in which to evaluate the - * expression. */ - char *string; /* Expression to evaluate. */ - long *ptr; /* Where to store result. */ -{ - register Tcl_Obj *exprPtr; - Tcl_Obj *resultPtr; - int length = strlen(string); - int result = TCL_OK; - - if (length > 0) { - exprPtr = Tcl_NewStringObj(string, length); - Tcl_IncrRefCount(exprPtr); - result = Tcl_ExprObj(interp, exprPtr, &resultPtr); - if (result == TCL_OK) { - /* - * Store an integer based on the expression result. - */ - - if (resultPtr->typePtr == &tclIntType) { - *ptr = resultPtr->internalRep.longValue; - } else if (resultPtr->typePtr == &tclDoubleType) { - *ptr = (long) resultPtr->internalRep.doubleValue; - } else { - Tcl_SetResult(interp, - "expression didn't have numeric value", TCL_STATIC); - result = TCL_ERROR; - } - Tcl_DecrRefCount(resultPtr); /* discard the result object */ - } else { - /* - * Move the interpreter's object result to the string result, - * then reset the object result. - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - } - Tcl_DecrRefCount(exprPtr); /* discard the expression object */ - } else { - /* - * An empty string. Just set the result integer to 0. - */ - - *ptr = 0; - } - return result; -} - -int -Tcl_ExprDouble(interp, string, ptr) - Tcl_Interp *interp; /* Context in which to evaluate the - * expression. */ - char *string; /* Expression to evaluate. */ - double *ptr; /* Where to store result. */ -{ - register Tcl_Obj *exprPtr; - Tcl_Obj *resultPtr; - int length = strlen(string); - int result = TCL_OK; - - if (length > 0) { - exprPtr = Tcl_NewStringObj(string, length); - Tcl_IncrRefCount(exprPtr); - result = Tcl_ExprObj(interp, exprPtr, &resultPtr); - if (result == TCL_OK) { - /* - * Store a double based on the expression result. - */ - - if (resultPtr->typePtr == &tclIntType) { - *ptr = (double) resultPtr->internalRep.longValue; - } else if (resultPtr->typePtr == &tclDoubleType) { - *ptr = resultPtr->internalRep.doubleValue; - } else { - Tcl_SetResult(interp, - "expression didn't have numeric value", TCL_STATIC); - result = TCL_ERROR; - } - Tcl_DecrRefCount(resultPtr); /* discard the result object */ - } else { - /* - * Move the interpreter's object result to the string result, - * then reset the object result. - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - } - Tcl_DecrRefCount(exprPtr); /* discard the expression object */ - } else { - /* - * An empty string. Just set the result double to 0.0. - */ - - *ptr = 0.0; - } - return result; -} - -int -Tcl_ExprBoolean(interp, string, ptr) - Tcl_Interp *interp; /* Context in which to evaluate the - * expression. */ - char *string; /* Expression to evaluate. */ - int *ptr; /* Where to store 0/1 result. */ -{ - register Tcl_Obj *exprPtr; - Tcl_Obj *resultPtr; - int length = strlen(string); - int result = TCL_OK; - - if (length > 0) { - exprPtr = Tcl_NewStringObj(string, length); - Tcl_IncrRefCount(exprPtr); - result = Tcl_ExprObj(interp, exprPtr, &resultPtr); - if (result == TCL_OK) { - /* - * Store a boolean based on the expression result. - */ - - if (resultPtr->typePtr == &tclIntType) { - *ptr = (resultPtr->internalRep.longValue != 0); - } else if (resultPtr->typePtr == &tclDoubleType) { - *ptr = (resultPtr->internalRep.doubleValue != 0.0); - } else { - result = Tcl_GetBooleanFromObj(interp, resultPtr, ptr); - } - Tcl_DecrRefCount(resultPtr); /* discard the result object */ - } - if (result != TCL_OK) { - /* - * Move the interpreter's object result to the string result, - * then reset the object result. - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - } - Tcl_DecrRefCount(exprPtr); /* discard the expression object */ - } else { - /* - * An empty string. Just set the result boolean to 0 (false). - */ - - *ptr = 0; - } - return result; -} - -/* - *-------------------------------------------------------------- - * - * Tcl_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj -- - * - * Procedures to evaluate an expression in an object and return its - * value in a particular form. - * - * Results: - * Each of the procedures below returns a standard Tcl result - * object. If an error occurs then an error message is left in the - * interpreter's result. Otherwise the value of the expression, in the - * appropriate form, is stored at *ptr. If the expression had a result - * that was incompatible with the desired form then an error is - * returned. - * - * Side effects: - * None. - * - *-------------------------------------------------------------- - */ - -int -Tcl_ExprLongObj(interp, objPtr, ptr) - Tcl_Interp *interp; /* Context in which to evaluate the - * expression. */ - register Tcl_Obj *objPtr; /* Expression to evaluate. */ - long *ptr; /* Where to store long result. */ -{ - Tcl_Obj *resultPtr; - int result; - - result = Tcl_ExprObj(interp, objPtr, &resultPtr); - if (result == TCL_OK) { - if (resultPtr->typePtr == &tclIntType) { - *ptr = resultPtr->internalRep.longValue; - } else if (resultPtr->typePtr == &tclDoubleType) { - *ptr = (long) resultPtr->internalRep.doubleValue; - } else { - result = Tcl_GetLongFromObj(interp, resultPtr, ptr); - if (result != TCL_OK) { - return result; - } - } - Tcl_DecrRefCount(resultPtr); /* discard the result object */ - } - return result; -} - -int -Tcl_ExprDoubleObj(interp, objPtr, ptr) - Tcl_Interp *interp; /* Context in which to evaluate the - * expression. */ - register Tcl_Obj *objPtr; /* Expression to evaluate. */ - double *ptr; /* Where to store double result. */ -{ - Tcl_Obj *resultPtr; - int result; - - result = Tcl_ExprObj(interp, objPtr, &resultPtr); - if (result == TCL_OK) { - if (resultPtr->typePtr == &tclIntType) { - *ptr = (double) resultPtr->internalRep.longValue; - } else if (resultPtr->typePtr == &tclDoubleType) { - *ptr = resultPtr->internalRep.doubleValue; - } else { - result = Tcl_GetDoubleFromObj(interp, resultPtr, ptr); - if (result != TCL_OK) { - return result; - } - } - Tcl_DecrRefCount(resultPtr); /* discard the result object */ - } - return result; -} - -int -Tcl_ExprBooleanObj(interp, objPtr, ptr) - Tcl_Interp *interp; /* Context in which to evaluate the - * expression. */ - register Tcl_Obj *objPtr; /* Expression to evaluate. */ - int *ptr; /* Where to store 0/1 result. */ -{ - Tcl_Obj *resultPtr; - int result; - - result = Tcl_ExprObj(interp, objPtr, &resultPtr); - if (result == TCL_OK) { - if (resultPtr->typePtr == &tclIntType) { - *ptr = (resultPtr->internalRep.longValue != 0); - } else if (resultPtr->typePtr == &tclDoubleType) { - *ptr = (resultPtr->internalRep.doubleValue != 0.0); - } else { - result = Tcl_GetBooleanFromObj(interp, resultPtr, ptr); - } - Tcl_DecrRefCount(resultPtr); /* discard the result object */ - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclInvoke -- - * - * Invokes a Tcl command, given an argv/argc, from either the - * exposed or the hidden sets of commands in the given interpreter. - * NOTE: The command is invoked in the current stack frame of - * the interpreter, thus it can modify local variables. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Whatever the command does. - * - *---------------------------------------------------------------------- - */ - -int -TclInvoke(interp, argc, argv, flags) - Tcl_Interp *interp; /* Where to invoke the command. */ - int argc; /* Count of args. */ - register char **argv; /* The arg strings; argv[0] is the name of - * the command to invoke. */ - int flags; /* Combination of flags controlling the - * call: TCL_INVOKE_HIDDEN and - * TCL_INVOKE_NO_UNKNOWN. */ -{ - register Tcl_Obj *objPtr; - register int i; - int length, result; - - /* - * This procedure generates an objv array for object arguments that hold - * the argv strings. It starts out with stack-allocated space but uses - * dynamically-allocated storage if needed. - */ - -#define NUM_ARGS 20 - Tcl_Obj *(objStorage[NUM_ARGS]); - register Tcl_Obj **objv = objStorage; - - /* - * Create the object argument array "objv". Make sure objv is large - * enough to hold the objc arguments plus 1 extra for the zero - * end-of-objv word. - */ - - if ((argc + 1) > NUM_ARGS) { - objv = (Tcl_Obj **) - ckalloc((unsigned)(argc + 1) * sizeof(Tcl_Obj *)); - } - - for (i = 0; i < argc; i++) { - length = strlen(argv[i]); - objv[i] = Tcl_NewStringObj(argv[i], length); - Tcl_IncrRefCount(objv[i]); - } - objv[argc] = 0; - - /* - * Use TclObjInterpProc to actually invoke the command. - */ - - result = TclObjInvoke(interp, argc, objv, flags); - - /* - * Move the interpreter's object result to the string result, - * then reset the object result. - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - - /* - * Decrement the ref counts on the objv elements since we are done - * with them. - */ - - for (i = 0; i < argc; i++) { - objPtr = objv[i]; - Tcl_DecrRefCount(objPtr); - } - - /* - * Free the objv array if malloc'ed storage was used. - */ - - if (objv != objStorage) { - ckfree((char *) objv); - } - return result; -#undef NUM_ARGS -} - -/* - *---------------------------------------------------------------------- - * - * TclGlobalInvoke -- - * - * Invokes a Tcl command, given an argv/argc, from either the - * exposed or hidden sets of commands in the given interpreter. - * NOTE: The command is invoked in the global stack frame of - * the interpreter, thus it cannot see any current state on - * the stack for that interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Whatever the command does. - * - *---------------------------------------------------------------------- - */ - -int -TclGlobalInvoke(interp, argc, argv, flags) - Tcl_Interp *interp; /* Where to invoke the command. */ - int argc; /* Count of args. */ - register char **argv; /* The arg strings; argv[0] is the name of - * the command to invoke. */ - int flags; /* Combination of flags controlling the - * call: TCL_INVOKE_HIDDEN and - * TCL_INVOKE_NO_UNKNOWN. */ -{ - register Interp *iPtr = (Interp *) interp; - int result; - CallFrame *savedVarFramePtr; - - savedVarFramePtr = iPtr->varFramePtr; - iPtr->varFramePtr = NULL; - result = TclInvoke(interp, argc, argv, flags); - iPtr->varFramePtr = savedVarFramePtr; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclObjInvokeGlobal -- - * - * Object version: Invokes a Tcl command, given an objv/objc, from - * either the exposed or hidden set of commands in the given - * interpreter. - * NOTE: The command is invoked in the global stack frame of the - * interpreter, thus it cannot see any current state on the - * stack of that interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Whatever the command does. - * - *---------------------------------------------------------------------- - */ - -int -TclObjInvokeGlobal(interp, objc, objv, flags) - Tcl_Interp *interp; /* Interpreter in which command is to be - * invoked. */ - int objc; /* Count of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects; objv[0] points to the - * name of the command to invoke. */ - int flags; /* Combination of flags controlling the - * call: TCL_INVOKE_HIDDEN, - * TCL_INVOKE_NO_UNKNOWN, or - * TCL_INVOKE_NO_TRACEBACK. */ -{ - register Interp *iPtr = (Interp *) interp; - int result; - CallFrame *savedVarFramePtr; - - savedVarFramePtr = iPtr->varFramePtr; - iPtr->varFramePtr = NULL; - result = TclObjInvoke(interp, objc, objv, flags); - iPtr->varFramePtr = savedVarFramePtr; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclObjInvoke -- - * - * Invokes a Tcl command, given an objv/objc, from either the - * exposed or the hidden sets of commands in the given interpreter. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * Whatever the command does. - * - *---------------------------------------------------------------------- - */ - -int -TclObjInvoke(interp, objc, objv, flags) - Tcl_Interp *interp; /* Interpreter in which command is to be - * invoked. */ - int objc; /* Count of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects; objv[0] points to the - * name of the command to invoke. */ - int flags; /* Combination of flags controlling the - * call: TCL_INVOKE_HIDDEN, - * TCL_INVOKE_NO_UNKNOWN, or - * TCL_INVOKE_NO_TRACEBACK. */ -{ - register Interp *iPtr = (Interp *) interp; - Tcl_HashTable *hTblPtr; /* Table of hidden commands. */ - char *cmdName; /* Name of the command from objv[0]. */ - register Tcl_HashEntry *hPtr; - Tcl_Command cmd; - Command *cmdPtr; - int localObjc; /* Used to invoke "unknown" if the */ - Tcl_Obj **localObjv = NULL; /* command is not found. */ - register int i; - int length, result; - char *bytes; - - if (interp == (Tcl_Interp *) NULL) { - return TCL_ERROR; - } - - if ((objc < 1) || (objv == (Tcl_Obj **) NULL)) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "illegal argument vector", -1); - return TCL_ERROR; - } - - cmdName = Tcl_GetString(objv[0]); - if (flags & TCL_INVOKE_HIDDEN) { - /* - * We never invoke "unknown" for hidden commands. - */ - - hPtr = NULL; - hTblPtr = ((Interp *) interp)->hiddenCmdTablePtr; - if (hTblPtr != NULL) { - hPtr = Tcl_FindHashEntry(hTblPtr, cmdName); - } - if (hPtr == NULL) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "invalid hidden command name \"", cmdName, "\"", - (char *) NULL); - return TCL_ERROR; - } - cmdPtr = (Command *) Tcl_GetHashValue(hPtr); - } else { - cmdPtr = NULL; - cmd = Tcl_FindCommand(interp, cmdName, - (Tcl_Namespace *) NULL, /*flags*/ TCL_GLOBAL_ONLY); - if (cmd != (Tcl_Command) NULL) { - cmdPtr = (Command *) cmd; - } - if (cmdPtr == NULL) { - if (!(flags & TCL_INVOKE_NO_UNKNOWN)) { - cmd = Tcl_FindCommand(interp, "unknown", - (Tcl_Namespace *) NULL, /*flags*/ TCL_GLOBAL_ONLY); - if (cmd != (Tcl_Command) NULL) { - cmdPtr = (Command *) cmd; - } - if (cmdPtr != NULL) { - localObjc = (objc + 1); - localObjv = (Tcl_Obj **) - ckalloc((unsigned) (sizeof(Tcl_Obj *) * localObjc)); - localObjv[0] = Tcl_NewStringObj("unknown", -1); - Tcl_IncrRefCount(localObjv[0]); - for (i = 0; i < objc; i++) { - localObjv[i+1] = objv[i]; - } - objc = localObjc; - objv = localObjv; - } - } - - /* - * Check again if we found the command. If not, "unknown" is - * not present and we cannot help, or the caller said not to - * call "unknown" (they specified TCL_INVOKE_NO_UNKNOWN). - */ - - if (cmdPtr == NULL) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "invalid command name \"", cmdName, "\"", - (char *) NULL); - return TCL_ERROR; - } - } - } - - /* - * Invoke the command procedure. First reset the interpreter's string - * and object results to their default empty values since they could - * have gotten changed by earlier invocations. - */ - - Tcl_ResetResult(interp); - iPtr->cmdCount++; - result = (*cmdPtr->objProc)(cmdPtr->objClientData, interp, objc, objv); - - /* - * If an error occurred, record information about what was being - * executed when the error occurred. - */ - - if ((result == TCL_ERROR) - && ((flags & TCL_INVOKE_NO_TRACEBACK) == 0) - && ((iPtr->flags & ERR_ALREADY_LOGGED) == 0)) { - Tcl_DString ds; - - Tcl_DStringInit(&ds); - if (!(iPtr->flags & ERR_IN_PROGRESS)) { - Tcl_DStringAppend(&ds, "\n while invoking\n\"", -1); - } else { - Tcl_DStringAppend(&ds, "\n invoked from within\n\"", -1); - } - for (i = 0; i < objc; i++) { - bytes = Tcl_GetStringFromObj(objv[i], &length); - Tcl_DStringAppend(&ds, bytes, length); - if (i < (objc - 1)) { - Tcl_DStringAppend(&ds, " ", -1); - } else if (Tcl_DStringLength(&ds) > 100) { - Tcl_DStringSetLength(&ds, 100); - Tcl_DStringAppend(&ds, "...", -1); - break; - } - } - - Tcl_DStringAppend(&ds, "\"", -1); - Tcl_AddObjErrorInfo(interp, Tcl_DStringValue(&ds), -1); - Tcl_DStringFree(&ds); - iPtr->flags &= ~ERR_ALREADY_LOGGED; - } - - /* - * Free any locally allocated storage used to call "unknown". - */ - - if (localObjv != (Tcl_Obj **) NULL) { - Tcl_DecrRefCount(localObjv[0]); - ckfree((char *) localObjv); - } - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_ExprString -- - * - * Evaluate an expression in a string and return its value in string - * form. - * - * Results: - * A standard Tcl result. If the result is TCL_OK, then the interp's - * result is set to the string value of the expression. If the result - * is TCL_ERROR, then the interp's result contains an error message. - * - * Side effects: - * A Tcl object is allocated to hold a copy of the expression string. - * This expression object is passed to Tcl_ExprObj and then - * deallocated. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_ExprString(interp, string) - Tcl_Interp *interp; /* Context in which to evaluate the - * expression. */ - char *string; /* Expression to evaluate. */ -{ - register Tcl_Obj *exprPtr; - Tcl_Obj *resultPtr; - int length = strlen(string); - char buf[TCL_DOUBLE_SPACE]; - int result = TCL_OK; - - if (length > 0) { - TclNewObj(exprPtr); - TclInitStringRep(exprPtr, string, length); - Tcl_IncrRefCount(exprPtr); - - result = Tcl_ExprObj(interp, exprPtr, &resultPtr); - if (result == TCL_OK) { - /* - * Set the interpreter's string result from the result object. - */ - - if (resultPtr->typePtr == &tclIntType) { - sprintf(buf, "%ld", resultPtr->internalRep.longValue); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } else if (resultPtr->typePtr == &tclDoubleType) { - Tcl_PrintDouble((Tcl_Interp *) NULL, - resultPtr->internalRep.doubleValue, buf); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } else { - /* - * Set interpreter's string result from the result object. - */ - - Tcl_SetResult(interp, TclGetString(resultPtr), - TCL_VOLATILE); - } - Tcl_DecrRefCount(resultPtr); /* discard the result object */ - } else { - /* - * Move the interpreter's object result to the string result, - * then reset the object result. - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - } - Tcl_DecrRefCount(exprPtr); /* discard the expression object */ - } else { - /* - * An empty string. Just set the interpreter's result to 0. - */ - - Tcl_SetResult(interp, "0", TCL_VOLATILE); - } - return result; -} - -/* - *-------------------------------------------------------------- - * - * Tcl_ExprObj -- - * - * Evaluate an expression in a Tcl_Obj. - * - * Results: - * A standard Tcl object result. If the result is other than TCL_OK, - * then the interpreter's result contains an error message. If the - * result is TCL_OK, then a pointer to the expression's result value - * object is stored in resultPtrPtr. In that case, the object's ref - * count is incremented to reflect the reference returned to the - * caller; the caller is then responsible for the resulting object - * and must, for example, decrement the ref count when it is finished - * with the object. - * - * Side effects: - * Any side effects caused by subcommands in the expression, if any. - * The interpreter result is not modified unless there is an error. - * - *-------------------------------------------------------------- - */ - -int -Tcl_ExprObj(interp, objPtr, resultPtrPtr) - Tcl_Interp *interp; /* Context in which to evaluate the - * expression. */ - register Tcl_Obj *objPtr; /* Points to Tcl object containing - * expression to evaluate. */ - Tcl_Obj **resultPtrPtr; /* Where the Tcl_Obj* that is the expression - * result is stored if no errors occur. */ -{ - Interp *iPtr = (Interp *) interp; - CompileEnv compEnv; /* Compilation environment structure - * allocated in frame. */ - LiteralTable *localTablePtr = &(compEnv.localLitTable); - register ByteCode *codePtr = NULL; - /* Tcl Internal type of bytecode. - * Initialized to avoid compiler warning. */ - AuxData *auxDataPtr; - LiteralEntry *entryPtr; - Tcl_Obj *saveObjPtr; - char *string; - int length, i, result; - - /* - * First handle some common expressions specially. - */ - - string = Tcl_GetStringFromObj(objPtr, &length); - if (length == 1) { - if (*string == '0') { - *resultPtrPtr = Tcl_NewLongObj(0); - Tcl_IncrRefCount(*resultPtrPtr); - return TCL_OK; - } else if (*string == '1') { - *resultPtrPtr = Tcl_NewLongObj(1); - Tcl_IncrRefCount(*resultPtrPtr); - return TCL_OK; - } - } else if ((length == 2) && (*string == '!')) { - if (*(string+1) == '0') { - *resultPtrPtr = Tcl_NewLongObj(1); - Tcl_IncrRefCount(*resultPtrPtr); - return TCL_OK; - } else if (*(string+1) == '1') { - *resultPtrPtr = Tcl_NewLongObj(0); - Tcl_IncrRefCount(*resultPtrPtr); - return TCL_OK; - } - } - - /* - * Get the ByteCode from the object. If it exists, make sure it hasn't - * been invalidated by, e.g., someone redefining a command with a - * compile procedure (this might make the compiled code wrong). If - * necessary, convert the object to be a ByteCode object and compile it. - * Also, if the code was compiled in/for a different interpreter, we - * recompile it. - * - * Precompiled expressions, however, are immutable and therefore - * they are not recompiled, even if the epoch has changed. - * - */ - - if (objPtr->typePtr == &tclByteCodeType) { - codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; - if (((Interp *) *codePtr->interpHandle != iPtr) - || (codePtr->compileEpoch != iPtr->compileEpoch)) { - if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) { - if ((Interp *) *codePtr->interpHandle != iPtr) { - panic("Tcl_ExprObj: compiled expression jumped interps"); - } - codePtr->compileEpoch = iPtr->compileEpoch; - } else { - (*tclByteCodeType.freeIntRepProc)(objPtr); - objPtr->typePtr = (Tcl_ObjType *) NULL; - } - } - } - if (objPtr->typePtr != &tclByteCodeType) { - TclInitCompileEnv(interp, &compEnv, string, length); - result = TclCompileExpr(interp, string, length, &compEnv); - - /* - * Free the compilation environment's literal table bucket array if - * it was dynamically allocated. - */ - - if (localTablePtr->buckets != localTablePtr->staticBuckets) { - ckfree((char *) localTablePtr->buckets); - } - - if (result != TCL_OK) { - /* - * Compilation errors. Free storage allocated for compilation. - */ - -#ifdef TCL_COMPILE_DEBUG - TclVerifyLocalLiteralTable(&compEnv); -#endif /*TCL_COMPILE_DEBUG*/ - entryPtr = compEnv.literalArrayPtr; - for (i = 0; i < compEnv.literalArrayNext; i++) { - TclReleaseLiteral(interp, entryPtr->objPtr); - entryPtr++; - } -#ifdef TCL_COMPILE_DEBUG - TclVerifyGlobalLiteralTable(iPtr); -#endif /*TCL_COMPILE_DEBUG*/ - - auxDataPtr = compEnv.auxDataArrayPtr; - for (i = 0; i < compEnv.auxDataArrayNext; i++) { - if (auxDataPtr->type->freeProc != NULL) { - auxDataPtr->type->freeProc(auxDataPtr->clientData); - } - auxDataPtr++; - } - TclFreeCompileEnv(&compEnv); - return result; - } - - /* - * Successful compilation. If the expression yielded no - * instructions, push an zero object as the expression's result. - */ - - if (compEnv.codeNext == compEnv.codeStart) { - TclEmitPush(TclRegisterLiteral(&compEnv, "0", 1, /*onHeap*/ 0), - &compEnv); - } - - /* - * Add a "done" instruction as the last instruction and change the - * object into a ByteCode object. Ownership of the literal objects - * and aux data items is given to the ByteCode object. - */ - - compEnv.numSrcBytes = iPtr->termOffset; - TclEmitOpcode(INST_DONE, &compEnv); - TclInitByteCodeObj(objPtr, &compEnv); - TclFreeCompileEnv(&compEnv); - codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; -#ifdef TCL_COMPILE_DEBUG - if (tclTraceCompile == 2) { - TclPrintByteCodeObj(interp, objPtr); - } -#endif /* TCL_COMPILE_DEBUG */ - } - - /* - * Execute the expression after first saving the interpreter's result. - */ - - saveObjPtr = Tcl_GetObjResult(interp); - Tcl_IncrRefCount(saveObjPtr); - Tcl_ResetResult(interp); - - /* - * Increment the code's ref count while it is being executed. If - * afterwards no references to it remain, free the code. - */ - - codePtr->refCount++; - result = TclExecuteByteCode(interp, codePtr); - codePtr->refCount--; - if (codePtr->refCount <= 0) { - TclCleanupByteCode(codePtr); - objPtr->typePtr = NULL; - objPtr->internalRep.otherValuePtr = NULL; - } - - /* - * If the expression evaluated successfully, store a pointer to its - * value object in resultPtrPtr then restore the old interpreter result. - * We increment the object's ref count to reflect the reference that we - * are returning to the caller. We also decrement the ref count of the - * interpreter's result object after calling Tcl_SetResult since we - * next store into that field directly. - */ - - if (result == TCL_OK) { - *resultPtrPtr = iPtr->objResultPtr; - Tcl_IncrRefCount(iPtr->objResultPtr); - - Tcl_SetObjResult(interp, saveObjPtr); - } - Tcl_DecrRefCount(saveObjPtr); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateTrace -- - * - * Arrange for a procedure to be called to trace command execution. - * - * Results: - * The return value is a token for the trace, which may be passed - * to Tcl_DeleteTrace to eliminate the trace. - * - * Side effects: - * From now on, proc will be called just before a command procedure - * is called to execute a Tcl command. Calls to proc will have the - * following form: - * - * void - * proc(clientData, interp, level, command, cmdProc, cmdClientData, - * argc, argv) - * ClientData clientData; - * Tcl_Interp *interp; - * int level; - * char *command; - * int (*cmdProc)(); - * ClientData cmdClientData; - * int argc; - * char **argv; - * { - * } - * - * The clientData and interp arguments to proc will be the same - * as the corresponding arguments to this procedure. Level gives - * the nesting level of command interpretation for this interpreter - * (0 corresponds to top level). Command gives the ASCII text of - * the raw command, cmdProc and cmdClientData give the procedure that - * will be called to process the command and the ClientData value it - * will receive, and argc and argv give the arguments to the - * command, after any argument parsing and substitution. Proc - * does not return a value. - * - *---------------------------------------------------------------------- - */ - -Tcl_Trace -Tcl_CreateTrace(interp, level, proc, clientData) - Tcl_Interp *interp; /* Interpreter in which to create trace. */ - int level; /* Only call proc for commands at nesting - * level<=argument level (1=>top level). */ - Tcl_CmdTraceProc *proc; /* Procedure to call before executing each - * command. */ - ClientData clientData; /* Arbitrary value word to pass to proc. */ -{ - register Trace *tracePtr; - register Interp *iPtr = (Interp *) interp; - - /* - * Invalidate existing compiled code for this interpreter and arrange - * (by setting the DONT_COMPILE_CMDS_INLINE flag) that when compiling - * new code, no commands will be compiled inline (i.e., into an inline - * sequence of instructions). We do this because commands that were - * compiled inline will never result in a command trace being called. - */ - - iPtr->compileEpoch++; - iPtr->flags |= DONT_COMPILE_CMDS_INLINE; - - tracePtr = (Trace *) ckalloc(sizeof(Trace)); - tracePtr->level = level; - tracePtr->proc = proc; - tracePtr->clientData = clientData; - tracePtr->nextPtr = iPtr->tracePtr; - iPtr->tracePtr = tracePtr; - - return (Tcl_Trace) tracePtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteTrace -- - * - * Remove a trace. - * - * Results: - * None. - * - * Side effects: - * From now on there will be no more calls to the procedure given - * in trace. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteTrace(interp, trace) - Tcl_Interp *interp; /* Interpreter that contains trace. */ - Tcl_Trace trace; /* Token for trace (returned previously by - * Tcl_CreateTrace). */ -{ - register Interp *iPtr = (Interp *) interp; - register Trace *tracePtr = (Trace *) trace; - register Trace *tracePtr2; - - if (iPtr->tracePtr == tracePtr) { - iPtr->tracePtr = tracePtr->nextPtr; - ckfree((char *) tracePtr); - } else { - for (tracePtr2 = iPtr->tracePtr; tracePtr2 != NULL; - tracePtr2 = tracePtr2->nextPtr) { - if (tracePtr2->nextPtr == tracePtr) { - tracePtr2->nextPtr = tracePtr->nextPtr; - ckfree((char *) tracePtr); - break; - } - } - } - - if (iPtr->tracePtr == NULL) { - /* - * When compiling new code, allow commands to be compiled inline. - */ - - iPtr->flags &= ~DONT_COMPILE_CMDS_INLINE; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AddErrorInfo -- - * - * Add information to the "errorInfo" variable that describes the - * current error. - * - * Results: - * None. - * - * Side effects: - * The contents of message are added to the "errorInfo" variable. - * If Tcl_Eval has been called since the current value of errorInfo - * was set, errorInfo is cleared before adding the new message. - * If we are just starting to log an error, errorInfo is initialized - * from the error message in the interpreter's result. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AddErrorInfo(interp, message) - Tcl_Interp *interp; /* Interpreter to which error information - * pertains. */ - CONST char *message; /* Message to record. */ -{ - Tcl_AddObjErrorInfo(interp, message, -1); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AddObjErrorInfo -- - * - * Add information to the "errorInfo" variable that describes the - * current error. This routine differs from Tcl_AddErrorInfo by - * taking a byte pointer and length. - * - * Results: - * None. - * - * Side effects: - * "length" bytes from "message" are added to the "errorInfo" variable. - * If "length" is negative, use bytes up to the first NULL byte. - * If Tcl_EvalObj has been called since the current value of errorInfo - * was set, errorInfo is cleared before adding the new message. - * If we are just starting to log an error, errorInfo is initialized - * from the error message in the interpreter's result. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AddObjErrorInfo(interp, message, length) - Tcl_Interp *interp; /* Interpreter to which error information - * pertains. */ - CONST char *message; /* Points to the first byte of an array of - * bytes of the message. */ - int length; /* The number of bytes in the message. - * If < 0, then append all bytes up to a - * NULL byte. */ -{ - register Interp *iPtr = (Interp *) interp; - Tcl_Obj *messagePtr; - - /* - * If we are just starting to log an error, errorInfo is initialized - * from the error message in the interpreter's result. - */ - - if (!(iPtr->flags & ERR_IN_PROGRESS)) { /* just starting to log error */ - iPtr->flags |= ERR_IN_PROGRESS; - - if (iPtr->result[0] == 0) { - (void) Tcl_SetVar2Ex(interp, "errorInfo", NULL, iPtr->objResultPtr, - TCL_GLOBAL_ONLY); - } else { /* use the string result */ - Tcl_SetVar2(interp, "errorInfo", (char *) NULL, interp->result, - TCL_GLOBAL_ONLY); - } - - /* - * If the errorCode variable wasn't set by the code that generated - * the error, set it to "NONE". - */ - - if (!(iPtr->flags & ERROR_CODE_SET)) { - (void) Tcl_SetVar2(interp, "errorCode", (char *) NULL, "NONE", - TCL_GLOBAL_ONLY); - } - } - - /* - * Now append "message" to the end of errorInfo. - */ - - if (length != 0) { - messagePtr = Tcl_NewStringObj(message, length); - Tcl_IncrRefCount(messagePtr); - Tcl_SetVar2Ex(interp, "errorInfo", NULL, messagePtr, - (TCL_GLOBAL_ONLY | TCL_APPEND_VALUE)); - Tcl_DecrRefCount(messagePtr); /* free msg object appended above */ - } -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_VarEvalVA -- - * - * Given a variable number of string arguments, concatenate them - * all together and execute the result as a Tcl command. - * - * Results: - * A standard Tcl return result. An error message or other result may - * be left in the interp's result. - * - * Side effects: - * Depends on what was done by the command. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_VarEvalVA (interp, argList) - Tcl_Interp *interp; /* Interpreter in which to evaluate command. */ - va_list argList; /* Variable argument list. */ -{ - Tcl_DString buf; - char *string; - int result; - - /* - * Copy the strings one after the other into a single larger - * string. Use stack-allocated space for small commands, but if - * the command gets too large than call ckalloc to create the - * space. - */ - - Tcl_DStringInit(&buf); - while (1) { - string = va_arg(argList, char *); - if (string == NULL) { - break; - } - Tcl_DStringAppend(&buf, string, -1); - } - - result = Tcl_Eval(interp, Tcl_DStringValue(&buf)); - Tcl_DStringFree(&buf); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_VarEval -- - * - * Given a variable number of string arguments, concatenate them - * all together and execute the result as a Tcl command. - * - * Results: - * A standard Tcl return result. An error message or other - * result may be left in interp->result. - * - * Side effects: - * Depends on what was done by the command. - * - *---------------------------------------------------------------------- - */ - /* VARARGS2 */ /* ARGSUSED */ -int -Tcl_VarEval TCL_VARARGS_DEF(Tcl_Interp *,arg1) -{ - Tcl_Interp *interp; - va_list argList; - int result; - - interp = TCL_VARARGS_START(Tcl_Interp *,arg1,argList); - result = Tcl_VarEvalVA(interp, argList); - va_end(argList); - - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_GlobalEval -- - * - * Evaluate a command at global level in an interpreter. - * - * Results: - * A standard Tcl result is returned, and the interp's result is - * modified accordingly. - * - * Side effects: - * The command string is executed in interp, and the execution - * is carried out in the variable context of global level (no - * procedures active), just as if an "uplevel #0" command were - * being executed. - * - --------------------------------------------------------------------------- - */ - -int -Tcl_GlobalEval(interp, command) - Tcl_Interp *interp; /* Interpreter in which to evaluate command. */ - char *command; /* Command to evaluate. */ -{ - register Interp *iPtr = (Interp *) interp; - int result; - CallFrame *savedVarFramePtr; - - savedVarFramePtr = iPtr->varFramePtr; - iPtr->varFramePtr = NULL; - result = Tcl_Eval(interp, command); - iPtr->varFramePtr = savedVarFramePtr; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetRecursionLimit -- - * - * Set the maximum number of recursive calls that may be active - * for an interpreter at once. - * - * Results: - * The return value is the old limit on nesting for interp. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_SetRecursionLimit(interp, depth) - Tcl_Interp *interp; /* Interpreter whose nesting limit - * is to be set. */ - int depth; /* New value for maximimum depth. */ -{ - Interp *iPtr = (Interp *) interp; - int old; - - old = iPtr->maxNestingDepth; - if (depth > 0) { - iPtr->maxNestingDepth = depth; - } - return old; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AllowExceptions -- - * - * Sets a flag in an interpreter so that exceptions can occur - * in the next call to Tcl_Eval without them being turned into - * errors. - * - * Results: - * None. - * - * Side effects: - * The TCL_ALLOW_EXCEPTIONS flag gets set in the interpreter's - * evalFlags structure. See the reference documentation for - * more details. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AllowExceptions(interp) - Tcl_Interp *interp; /* Interpreter in which to set flag. */ -{ - Interp *iPtr = (Interp *) interp; - - iPtr->evalFlags |= TCL_ALLOW_EXCEPTIONS; -} - - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetVersion - * - * Get the Tcl major, minor, and patchlevel version numbers and - * the release type. A patch is a release type TCL_FINAL_RELEASE - * with a patchLevel > 0. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void Tcl_GetVersion(major, minor, patchLevel, type) - int *major; - int *minor; - int *patchLevel; - int *type; -{ - if (major != NULL) { - *major = TCL_MAJOR_VERSION; - } - if (minor != NULL) { - *minor = TCL_MINOR_VERSION; - } - if (patchLevel != NULL) { - *patchLevel = TCL_RELEASE_SERIAL; - } - if (type != NULL) { - *type = TCL_RELEASE_LEVEL; - } -} - diff --git a/generic/tclBinary.c b/generic/tclBinary.c deleted file mode 100644 index 5156465..0000000 --- a/generic/tclBinary.c +++ /dev/null @@ -1,1549 +0,0 @@ -/* - * tclBinary.c -- - * - * This file contains the implementation of the "binary" Tcl built-in - * command and the Tcl binary data object. - * - * 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. - * - * RCS: @(#) $Id: tclBinary.c,v 1.5 1999/04/16 00:46:42 stanton Exp $ - */ - -#include -#include "tclInt.h" -#include "tclPort.h" - -/* - * The following constants are used by GetFormatSpec to indicate various - * special conditions in the parsing of a format specifier. - */ - -#define BINARY_ALL -1 /* Use all elements in the argument. */ -#define BINARY_NOCOUNT -2 /* No count was specified in format. */ - -/* - * Prototypes for local procedures defined in this file: - */ - -static void DupByteArrayInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr, - Tcl_Obj *copyPtr)); -static int FormatNumber _ANSI_ARGS_((Tcl_Interp *interp, int type, - Tcl_Obj *src, unsigned char **cursorPtr)); -static void FreeByteArrayInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr)); -static int GetFormatSpec _ANSI_ARGS_((char **formatPtr, - char *cmdPtr, int *countPtr)); -static Tcl_Obj * ScanNumber _ANSI_ARGS_((unsigned char *buffer, int type)); -static int SetByteArrayFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static void UpdateStringOfByteArray _ANSI_ARGS_((Tcl_Obj *listPtr)); - - -/* - * The following object type represents an array of bytes. An array of - * bytes is not equivalent to an internationalized string. Conceptually, a - * string is an array of 16-bit quantities organized as a sequence of properly - * formed UTF-8 characters, while a ByteArray is an array of 8-bit quantities. - * Accessor functions are provided to convert a ByteArray to a String or a - * String to a ByteArray. Two or more consecutive bytes in an array of bytes - * may look like a single UTF-8 character if the array is casually treated as - * a string. But obtaining the String from a ByteArray is guaranteed to - * produced properly formed UTF-8 sequences so that there is a one-to-one - * map between bytes and characters. - * - * Converting a ByteArray to a String proceeds by casting each byte in the - * array to a 16-bit quantity, treating that number as a Unicode character, - * and storing the UTF-8 version of that Unicode character in the String. - * For ByteArrays consisting entirely of values 1..127, the corresponding - * String representation is the same as the ByteArray representation. - * - * Converting a String to a ByteArray proceeds by getting the Unicode - * representation of each character in the String, casting it to a - * byte by truncating the upper 8 bits, and then storing the byte in the - * ByteArray. Converting from ByteArray to String and back to ByteArray - * is not lossy, but converting an arbitrary String to a ByteArray may be. - */ - -Tcl_ObjType tclByteArrayType = { - "bytearray", - FreeByteArrayInternalRep, - DupByteArrayInternalRep, - UpdateStringOfByteArray, - SetByteArrayFromAny -}; - -/* - * The following structure is the internal rep for a ByteArray object. - * Keeps track of how much memory has been used and how much has been - * allocated for the byte array to enable growing and shrinking of the - * ByteArray object with fewer mallocs. - */ - -typedef struct ByteArray { - int used; /* The number of bytes used in the byte - * array. */ - int allocated; /* The amount of space actually allocated - * minus 1 byte. */ - unsigned char bytes[4]; /* The array of bytes. The actual size of - * this field depends on the 'allocated' field - * above. */ -} ByteArray; - -#define BYTEARRAY_SIZE(len) \ - ((unsigned) (sizeof(ByteArray) - 4 + (len))) -#define GET_BYTEARRAY(objPtr) \ - ((ByteArray *) (objPtr)->internalRep.otherValuePtr) -#define SET_BYTEARRAY(objPtr, baPtr) \ - (objPtr)->internalRep.otherValuePtr = (VOID *) (baPtr) - - -/* - *--------------------------------------------------------------------------- - * - * Tcl_NewByteArrayObj -- - * - * This procedure is creates a new ByteArray object and initializes - * it from the given array of bytes. - * - * Results: - * The newly create object is returned. This object will have no - * initial string representation. The returned object has a ref count - * of 0. - * - * Side effects: - * Memory allocated for new object and copy of byte array argument. - * - *--------------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG -#undef Tcl_NewByteArrayObj - - -Tcl_Obj * -Tcl_NewByteArrayObj(bytes, length) - unsigned char *bytes; /* The array of bytes used to initialize - * the new object. */ - int length; /* Length of the array of bytes, which must - * be >= 0. */ -{ - return Tcl_DbNewByteArrayObj(bytes, length, "unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewByteArrayObj(bytes, length) - unsigned char *bytes; /* The array of bytes used to initialize - * the new object. */ - int length; /* Length of the array of bytes, which must - * be >= 0. */ -{ - Tcl_Obj *objPtr; - - TclNewObj(objPtr); - Tcl_SetByteArrayObj(objPtr, bytes, length); - return objPtr; -} -#endif /* TCL_MEM_DEBUG */ - -/* - *--------------------------------------------------------------------------- - * - * Tcl_DbNewByteArrayObj -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. It is the same as the Tcl_NewByteArrayObj - * above except that it calls Tcl_DbCkalloc directly with the file name - * and line number from its caller. This simplifies debugging since then - * the checkmem command will report the correct file name and line number - * when reporting objects that haven't been freed. - * - * When TCL_MEM_DEBUG is not defined, this procedure just returns the - * result of calling Tcl_NewByteArrayObj. - * - * Results: - * The newly create object is returned. This object will have no - * initial string representation. The returned object has a ref count - * of 0. - * - * Side effects: - * Memory allocated for new object and copy of byte array argument. - * - *--------------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_DbNewByteArrayObj(bytes, length, file, line) - unsigned char *bytes; /* The array of bytes used to initialize - * the new object. */ - int length; /* Length of the array of bytes, which must - * be >= 0. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - Tcl_Obj *objPtr; - - TclDbNewObj(objPtr, file, line); - Tcl_SetByteArrayObj(objPtr, bytes, length); - return objPtr; -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_DbNewByteArrayObj(bytes, length, file, line) - unsigned char *bytes; /* The array of bytes used to initialize - * the new object. */ - int length; /* Length of the array of bytes, which must - * be >= 0. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - return Tcl_NewByteArrayObj(bytes, length); -} -#endif /* TCL_MEM_DEBUG */ - -/* - *--------------------------------------------------------------------------- - * - * Tcl_SetByteArrayObj -- - * - * Modify an object to be a ByteArray object and to have the specified - * array of bytes as its value. - * - * Results: - * None. - * - * Side effects: - * The object's old string rep and internal rep is freed. - * Memory allocated for copy of byte array argument. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetByteArrayObj(objPtr, bytes, length) - Tcl_Obj *objPtr; /* Object to initialize as a ByteArray. */ - unsigned char *bytes; /* The array of bytes to use as the new - * value. */ - int length; /* Length of the array of bytes, which must - * be >= 0. */ -{ - Tcl_ObjType *typePtr; - ByteArray *byteArrayPtr; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetByteArrayObj called with shared object"); - } - typePtr = objPtr->typePtr; - if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) { - (*typePtr->freeIntRepProc)(objPtr); - } - Tcl_InvalidateStringRep(objPtr); - - byteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length)); - byteArrayPtr->used = length; - byteArrayPtr->allocated = length; - memcpy((VOID *) byteArrayPtr->bytes, (VOID *) bytes, (size_t) length); - - objPtr->typePtr = &tclByteArrayType; - SET_BYTEARRAY(objPtr, byteArrayPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetByteArrayFromObj -- - * - * Attempt to get the array of bytes from the Tcl object. If the - * object is not already a ByteArray object, an attempt will be - * made to convert it to one. - * - * Results: - * Pointer to array of bytes representing the ByteArray object. - * - * Side effects: - * Frees old internal rep. Allocates memory for new internal rep. - * - *---------------------------------------------------------------------- - */ - -unsigned char * -Tcl_GetByteArrayFromObj(objPtr, lengthPtr) - Tcl_Obj *objPtr; /* The ByteArray object. */ - int *lengthPtr; /* If non-NULL, filled with length of the - * array of bytes in the ByteArray object. */ -{ - ByteArray *baPtr; - - SetByteArrayFromAny(NULL, objPtr); - baPtr = GET_BYTEARRAY(objPtr); - - if (lengthPtr != NULL) { - *lengthPtr = baPtr->used; - } - return (unsigned char *) baPtr->bytes; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetByteArrayLength -- - * - * This procedure changes the length of the byte array for this - * object. Once the caller has set the length of the array, it - * is acceptable to directly modify the bytes in the array up until - * Tcl_GetStringFromObj() has been called on this object. - * - * Results: - * The new byte array of the specified length. - * - * Side effects: - * Allocates enough memory for an array of bytes of the requested - * size. When growing the array, the old array is copied to the - * new array; new bytes are undefined. When shrinking, the - * old array is truncated to the specified length. - * - *--------------------------------------------------------------------------- - */ - -unsigned char * -Tcl_SetByteArrayLength(objPtr, length) - Tcl_Obj *objPtr; /* The ByteArray object. */ - int length; /* New length for internal byte array. */ -{ - ByteArray *byteArrayPtr, *newByteArrayPtr; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetObjLength called with shared object"); - } - if (objPtr->typePtr != &tclByteArrayType) { - SetByteArrayFromAny(NULL, objPtr); - } - - byteArrayPtr = GET_BYTEARRAY(objPtr); - if (length > byteArrayPtr->allocated) { - newByteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length)); - newByteArrayPtr->used = length; - newByteArrayPtr->allocated = length; - memcpy((VOID *) newByteArrayPtr->bytes, - (VOID *) byteArrayPtr->bytes, (size_t) byteArrayPtr->used); - ckfree((char *) byteArrayPtr); - byteArrayPtr = newByteArrayPtr; - SET_BYTEARRAY(objPtr, byteArrayPtr); - } - Tcl_InvalidateStringRep(objPtr); - byteArrayPtr->used = length; - return byteArrayPtr->bytes; -} - -/* - *--------------------------------------------------------------------------- - * - * SetByteArrayFromAny -- - * - * Generate the ByteArray internal rep from the string rep. - * - * Results: - * The return value is always TCL_OK. - * - * Side effects: - * A ByteArray object is stored as the internal rep of objPtr. - * - *--------------------------------------------------------------------------- - */ - -static int -SetByteArrayFromAny(interp, objPtr) - Tcl_Interp *interp; /* Not used. */ - Tcl_Obj *objPtr; /* The object to convert to type ByteArray. */ -{ - Tcl_ObjType *typePtr; - int length; - char *src, *srcEnd; - unsigned char *dst; - ByteArray *byteArrayPtr; - Tcl_UniChar ch; - - typePtr = objPtr->typePtr; - if (typePtr != &tclByteArrayType) { - src = Tcl_GetStringFromObj(objPtr, &length); - srcEnd = src + length; - - byteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length)); - for (dst = byteArrayPtr->bytes; src < srcEnd; ) { - src += Tcl_UtfToUniChar(src, &ch); - *dst++ = (unsigned char) ch; - } - - byteArrayPtr->used = dst - byteArrayPtr->bytes; - byteArrayPtr->allocated = length; - - if ((typePtr != NULL) && (typePtr->freeIntRepProc) != NULL) { - (*typePtr->freeIntRepProc)(objPtr); - } - objPtr->typePtr = &tclByteArrayType; - SET_BYTEARRAY(objPtr, byteArrayPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * FreeByteArrayInternalRep -- - * - * Deallocate the storage associated with a ByteArray data object's - * internal representation. - * - * Results: - * None. - * - * Side effects: - * Frees memory. - * - *---------------------------------------------------------------------- - */ - -static void -FreeByteArrayInternalRep(objPtr) - Tcl_Obj *objPtr; /* Object with internal rep to free. */ -{ - ckfree((char *) GET_BYTEARRAY(objPtr)); -} - -/* - *--------------------------------------------------------------------------- - * - * DupByteArrayInternalRep -- - * - * Initialize the internal representation of a ByteArray Tcl_Obj - * to a copy of the internal representation of an existing ByteArray - * object. - * - * Results: - * None. - * - * Side effects: - * Allocates memory. - * - *--------------------------------------------------------------------------- - */ - -static void -DupByteArrayInternalRep(srcPtr, copyPtr) - Tcl_Obj *srcPtr; /* Object with internal rep to copy. */ - Tcl_Obj *copyPtr; /* Object with internal rep to set. */ -{ - int length; - ByteArray *srcArrayPtr, *copyArrayPtr; - - srcArrayPtr = GET_BYTEARRAY(srcPtr); - length = srcArrayPtr->used; - - copyArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length)); - copyArrayPtr->used = length; - copyArrayPtr->allocated = length; - memcpy((VOID *) copyArrayPtr->bytes, (VOID *) srcArrayPtr->bytes, - (size_t) length); - SET_BYTEARRAY(copyPtr, copyArrayPtr); -} - -/* - *--------------------------------------------------------------------------- - * - * UpdateStringOfByteArray -- - * - * Update the string representation for a ByteArray data object. - * Note: This procedure does not invalidate 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 ByteArray-to-string conversion. - * - * The object becomes a string object -- the internal rep is - * discarded and the typePtr becomes NULL. - * - *--------------------------------------------------------------------------- - */ - -static void -UpdateStringOfByteArray(objPtr) - Tcl_Obj *objPtr; /* ByteArray object whose string rep to - * update. */ -{ - int i, length, size; - unsigned char *src; - char *dst; - ByteArray *byteArrayPtr; - - byteArrayPtr = GET_BYTEARRAY(objPtr); - src = byteArrayPtr->bytes; - length = byteArrayPtr->used; - - /* - * How much space will string rep need? - */ - - size = length; - for (i = 0; i < length; i++) { - if ((src[i] == 0) || (src[i] > 127)) { - size++; - } - } - - dst = (char *) ckalloc((unsigned) (size + 1)); - objPtr->bytes = dst; - objPtr->length = size; - - if (size == length) { - memcpy((VOID *) dst, (VOID *) src, (size_t) size); - dst[size] = '\0'; - } else { - for (i = 0; i < length; i++) { - dst += Tcl_UniCharToUtf(src[i], dst); - } - *dst = '\0'; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_BinaryObjCmd -- - * - * This procedure implements the "binary" Tcl command. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_BinaryObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int arg; /* Index of next argument to consume. */ - int value = 0; /* Current integer value to be packed. - * Initialized to avoid compiler warning. */ - char cmd; /* Current format character. */ - int count; /* Count associated with current format - * character. */ - char *format; /* Pointer to current position in format - * string. */ - Tcl_Obj *resultPtr; /* Object holding result buffer. */ - unsigned char *buffer; /* Start of result buffer. */ - unsigned char *cursor; /* Current position within result buffer. */ - unsigned char *maxPos; /* Greatest position within result buffer that - * cursor has visited.*/ - char *errorString, *errorValue, *str; - int offset, size, length, index; - static char *options[] = { - "format", "scan", NULL - }; - enum options { - BINARY_FORMAT, BINARY_SCAN - }; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - switch ((enum options) index) { - case BINARY_FORMAT: { - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "formatString ?arg arg ...?"); - return TCL_ERROR; - } - - /* - * To avoid copying the data, we format the string in two passes. - * The first pass computes the size of the output buffer. The - * second pass places the formatted data into the buffer. - */ - - format = Tcl_GetString(objv[2]); - arg = 3; - offset = 0; - length = 0; - while (*format != '\0') { - str = format; - if (!GetFormatSpec(&format, &cmd, &count)) { - break; - } - switch (cmd) { - case 'a': - case 'A': - case 'b': - case 'B': - case 'h': - case 'H': { - /* - * For string-type specifiers, the count corresponds - * to the number of bytes in a single argument. - */ - - if (arg >= objc) { - goto badIndex; - } - if (count == BINARY_ALL) { - Tcl_GetByteArrayFromObj(objv[arg], &count); - } else if (count == BINARY_NOCOUNT) { - count = 1; - } - arg++; - if (cmd == 'a' || cmd == 'A') { - offset += count; - } else if (cmd == 'b' || cmd == 'B') { - offset += (count + 7) / 8; - } else { - offset += (count + 1) / 2; - } - break; - } - case 'c': { - size = 1; - goto doNumbers; - } - case 's': - case 'S': { - size = 2; - goto doNumbers; - } - case 'i': - case 'I': { - size = 4; - goto doNumbers; - } - case 'f': { - size = sizeof(float); - goto doNumbers; - } - case 'd': { - size = sizeof(double); - - doNumbers: - if (arg >= objc) { - goto badIndex; - } - - /* - * For number-type specifiers, the count corresponds - * to the number of elements in the list stored in - * a single argument. If no count is specified, then - * the argument is taken as a single non-list value. - */ - - if (count == BINARY_NOCOUNT) { - arg++; - count = 1; - } else { - int listc; - Tcl_Obj **listv; - if (Tcl_ListObjGetElements(interp, objv[arg++], - &listc, &listv) != TCL_OK) { - return TCL_ERROR; - } - if (count == BINARY_ALL) { - count = listc; - } else if (count > listc) { - Tcl_AppendResult(interp, - "number of elements in list does not match count", - (char *) NULL); - return TCL_ERROR; - } - } - offset += count*size; - break; - } - case 'x': { - if (count == BINARY_ALL) { - Tcl_AppendResult(interp, - "cannot use \"*\" in format string with \"x\"", - (char *) NULL); - return TCL_ERROR; - } else if (count == BINARY_NOCOUNT) { - count = 1; - } - offset += count; - break; - } - case 'X': { - if (count == BINARY_NOCOUNT) { - count = 1; - } - if ((count > offset) || (count == BINARY_ALL)) { - count = offset; - } - if (offset > length) { - length = offset; - } - offset -= count; - break; - } - case '@': { - if (offset > length) { - length = offset; - } - if (count == BINARY_ALL) { - offset = length; - } else if (count == BINARY_NOCOUNT) { - goto badCount; - } else { - offset = count; - } - break; - } - default: { - errorString = str; - goto badfield; - } - } - } - if (offset > length) { - length = offset; - } - if (length == 0) { - return TCL_OK; - } - - /* - * Prepare the result object by preallocating the caclulated - * number of bytes and filling with nulls. - */ - - resultPtr = Tcl_GetObjResult(interp); - buffer = Tcl_SetByteArrayLength(resultPtr, length); - memset((VOID *) buffer, 0, (size_t) length); - - /* - * Pack the data into the result object. Note that we can skip - * the error checking during this pass, since we have already - * parsed the string once. - */ - - arg = 3; - format = Tcl_GetString(objv[2]); - cursor = buffer; - maxPos = cursor; - while (*format != 0) { - if (!GetFormatSpec(&format, &cmd, &count)) { - break; - } - if ((count == 0) && (cmd != '@')) { - arg++; - continue; - } - switch (cmd) { - case 'a': - case 'A': { - char pad = (char) (cmd == 'a' ? '\0' : ' '); - unsigned char *bytes; - - bytes = Tcl_GetByteArrayFromObj(objv[arg++], &length); - - if (count == BINARY_ALL) { - count = length; - } else if (count == BINARY_NOCOUNT) { - count = 1; - } - if (length >= count) { - memcpy((VOID *) cursor, (VOID *) bytes, - (size_t) count); - } else { - memcpy((VOID *) cursor, (VOID *) bytes, - (size_t) length); - memset((VOID *) (cursor + length), pad, - (size_t) (count - length)); - } - cursor += count; - break; - } - case 'b': - case 'B': { - unsigned char *last; - - str = Tcl_GetStringFromObj(objv[arg++], &length); - if (count == BINARY_ALL) { - count = length; - } else if (count == BINARY_NOCOUNT) { - count = 1; - } - last = cursor + ((count + 7) / 8); - if (count > length) { - count = length; - } - value = 0; - errorString = "binary"; - if (cmd == 'B') { - for (offset = 0; offset < count; offset++) { - value <<= 1; - if (str[offset] == '1') { - value |= 1; - } else if (str[offset] != '0') { - errorValue = str; - goto badValue; - } - if (((offset + 1) % 8) == 0) { - *cursor++ = (unsigned char) value; - value = 0; - } - } - } else { - for (offset = 0; offset < count; offset++) { - value >>= 1; - if (str[offset] == '1') { - value |= 128; - } else if (str[offset] != '0') { - errorValue = str; - goto badValue; - } - if (!((offset + 1) % 8)) { - *cursor++ = (unsigned char) value; - value = 0; - } - } - } - if ((offset % 8) != 0) { - if (cmd == 'B') { - value <<= 8 - (offset % 8); - } else { - value >>= 8 - (offset % 8); - } - *cursor++ = (unsigned char) value; - } - while (cursor < last) { - *cursor++ = '\0'; - } - break; - } - case 'h': - case 'H': { - unsigned char *last; - int c; - - str = Tcl_GetStringFromObj(objv[arg++], &length); - if (count == BINARY_ALL) { - count = length; - } else if (count == BINARY_NOCOUNT) { - count = 1; - } - last = cursor + ((count + 1) / 2); - if (count > length) { - count = length; - } - value = 0; - errorString = "hexadecimal"; - if (cmd == 'H') { - for (offset = 0; offset < count; offset++) { - value <<= 4; - if (!isxdigit(UCHAR(str[offset]))) { /* INTL: digit */ - errorValue = str; - goto badValue; - } - c = str[offset] - '0'; - if (c > 9) { - c += ('0' - 'A') + 10; - } - if (c > 16) { - c += ('A' - 'a'); - } - value |= (c & 0xf); - if (offset % 2) { - *cursor++ = (char) value; - value = 0; - } - } - } else { - for (offset = 0; offset < count; offset++) { - value >>= 4; - - if (!isxdigit(UCHAR(str[offset]))) { /* INTL: digit */ - errorValue = str; - goto badValue; - } - c = str[offset] - '0'; - if (c > 9) { - c += ('0' - 'A') + 10; - } - if (c > 16) { - c += ('A' - 'a'); - } - value |= ((c << 4) & 0xf0); - if (offset % 2) { - *cursor++ = (unsigned char)(value & 0xff); - value = 0; - } - } - } - if (offset % 2) { - if (cmd == 'H') { - value <<= 4; - } else { - value >>= 4; - } - *cursor++ = (unsigned char) value; - } - - while (cursor < last) { - *cursor++ = '\0'; - } - break; - } - case 'c': - case 's': - case 'S': - case 'i': - case 'I': - case 'd': - case 'f': { - int listc, i; - Tcl_Obj **listv; - - if (count == BINARY_NOCOUNT) { - /* - * Note that we are casting away the const-ness of - * objv, but this is safe since we aren't going to - * modify the array. - */ - - listv = (Tcl_Obj**)(objv + arg); - listc = 1; - count = 1; - } else { - Tcl_ListObjGetElements(interp, objv[arg], - &listc, &listv); - if (count == BINARY_ALL) { - count = listc; - } - } - arg++; - for (i = 0; i < count; i++) { - if (FormatNumber(interp, cmd, listv[i], &cursor) - != TCL_OK) { - return TCL_ERROR; - } - } - break; - } - case 'x': { - if (count == BINARY_NOCOUNT) { - count = 1; - } - memset(cursor, 0, (size_t) count); - cursor += count; - break; - } - case 'X': { - if (cursor > maxPos) { - maxPos = cursor; - } - if (count == BINARY_NOCOUNT) { - count = 1; - } - if ((count == BINARY_ALL) - || (count > (cursor - buffer))) { - cursor = buffer; - } else { - cursor -= count; - } - break; - } - case '@': { - if (cursor > maxPos) { - maxPos = cursor; - } - if (count == BINARY_ALL) { - cursor = maxPos; - } else { - cursor = buffer + count; - } - break; - } - } - } - break; - } - case BINARY_SCAN: { - int i; - Tcl_Obj *valuePtr, *elementPtr; - - if (objc < 4) { - Tcl_WrongNumArgs(interp, 2, objv, - "value formatString ?varName varName ...?"); - return TCL_ERROR; - } - buffer = Tcl_GetByteArrayFromObj(objv[2], &length); - format = Tcl_GetString(objv[3]); - cursor = buffer; - arg = 4; - offset = 0; - while (*format != '\0') { - str = format; - if (!GetFormatSpec(&format, &cmd, &count)) { - goto done; - } - switch (cmd) { - case 'a': - case 'A': { - unsigned char *src; - - if (arg >= objc) { - goto badIndex; - } - if (count == BINARY_ALL) { - count = length - offset; - } else { - if (count == BINARY_NOCOUNT) { - count = 1; - } - if (count > (length - offset)) { - goto done; - } - } - - src = buffer + offset; - size = count; - - /* - * Trim trailing nulls and spaces, if necessary. - */ - - if (cmd == 'A') { - while (size > 0) { - if (src[size-1] != '\0' && src[size-1] != ' ') { - break; - } - size--; - } - } - valuePtr = Tcl_NewByteArrayObj(src, size); - resultPtr = Tcl_ObjSetVar2(interp, objv[arg], - NULL, valuePtr, TCL_LEAVE_ERR_MSG); - arg++; - if (resultPtr == NULL) { - Tcl_DecrRefCount(valuePtr); /* unneeded */ - return TCL_ERROR; - } - offset += count; - break; - } - case 'b': - case 'B': { - unsigned char *src; - char *dest; - - if (arg >= objc) { - goto badIndex; - } - if (count == BINARY_ALL) { - count = (length - offset) * 8; - } else { - if (count == BINARY_NOCOUNT) { - count = 1; - } - if (count > (length - offset) * 8) { - goto done; - } - } - src = buffer + offset; - valuePtr = Tcl_NewObj(); - Tcl_SetObjLength(valuePtr, count); - dest = Tcl_GetString(valuePtr); - - if (cmd == 'b') { - for (i = 0; i < count; i++) { - if (i % 8) { - value >>= 1; - } else { - value = *src++; - } - *dest++ = (char) ((value & 1) ? '1' : '0'); - } - } else { - for (i = 0; i < count; i++) { - if (i % 8) { - value <<= 1; - } else { - value = *src++; - } - *dest++ = (char) ((value & 0x80) ? '1' : '0'); - } - } - - resultPtr = Tcl_ObjSetVar2(interp, objv[arg], - NULL, valuePtr, TCL_LEAVE_ERR_MSG); - arg++; - if (resultPtr == NULL) { - Tcl_DecrRefCount(valuePtr); /* unneeded */ - return TCL_ERROR; - } - offset += (count + 7 ) / 8; - break; - } - case 'h': - case 'H': { - char *dest; - unsigned char *src; - int i; - static char hexdigit[] = "0123456789abcdef"; - - if (arg >= objc) { - goto badIndex; - } - if (count == BINARY_ALL) { - count = (length - offset)*2; - } else { - if (count == BINARY_NOCOUNT) { - count = 1; - } - if (count > (length - offset)*2) { - goto done; - } - } - src = buffer + offset; - valuePtr = Tcl_NewObj(); - Tcl_SetObjLength(valuePtr, count); - dest = Tcl_GetString(valuePtr); - - if (cmd == 'h') { - for (i = 0; i < count; i++) { - if (i % 2) { - value >>= 4; - } else { - value = *src++; - } - *dest++ = hexdigit[value & 0xf]; - } - } else { - for (i = 0; i < count; i++) { - if (i % 2) { - value <<= 4; - } else { - value = *src++; - } - *dest++ = hexdigit[(value >> 4) & 0xf]; - } - } - - resultPtr = Tcl_ObjSetVar2(interp, objv[arg], - NULL, valuePtr, TCL_LEAVE_ERR_MSG); - arg++; - if (resultPtr == NULL) { - Tcl_DecrRefCount(valuePtr); /* unneeded */ - return TCL_ERROR; - } - offset += (count + 1) / 2; - break; - } - case 'c': { - size = 1; - goto scanNumber; - } - case 's': - case 'S': { - size = 2; - goto scanNumber; - } - case 'i': - case 'I': { - size = 4; - goto scanNumber; - } - case 'f': { - size = sizeof(float); - goto scanNumber; - } - case 'd': { - unsigned char *src; - - size = sizeof(double); - /* fall through */ - - scanNumber: - if (arg >= objc) { - goto badIndex; - } - if (count == BINARY_NOCOUNT) { - if ((length - offset) < size) { - goto done; - } - valuePtr = ScanNumber(buffer+offset, cmd); - offset += size; - } else { - if (count == BINARY_ALL) { - count = (length - offset) / size; - } - if ((length - offset) < (count * size)) { - goto done; - } - valuePtr = Tcl_NewObj(); - src = buffer+offset; - for (i = 0; i < count; i++) { - elementPtr = ScanNumber(src, cmd); - src += size; - Tcl_ListObjAppendElement(NULL, valuePtr, - elementPtr); - } - offset += count*size; - } - - resultPtr = Tcl_ObjSetVar2(interp, objv[arg], - NULL, valuePtr, TCL_LEAVE_ERR_MSG); - arg++; - if (resultPtr == NULL) { - Tcl_DecrRefCount(valuePtr); /* unneeded */ - return TCL_ERROR; - } - break; - } - case 'x': { - if (count == BINARY_NOCOUNT) { - count = 1; - } - if ((count == BINARY_ALL) - || (count > (length - offset))) { - offset = length; - } else { - offset += count; - } - break; - } - case 'X': { - if (count == BINARY_NOCOUNT) { - count = 1; - } - if ((count == BINARY_ALL) || (count > offset)) { - offset = 0; - } else { - offset -= count; - } - break; - } - case '@': { - if (count == BINARY_NOCOUNT) { - goto badCount; - } - if ((count == BINARY_ALL) || (count > length)) { - offset = length; - } else { - offset = count; - } - break; - } - default: { - errorString = str; - goto badfield; - } - } - } - - /* - * Set the result to the last position of the cursor. - */ - - done: - Tcl_ResetResult(interp); - Tcl_SetLongObj(Tcl_GetObjResult(interp), arg - 4); - break; - } - } - return TCL_OK; - - badValue: - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "expected ", errorString, - " string but got \"", errorValue, "\" instead", NULL); - return TCL_ERROR; - - badCount: - errorString = "missing count for \"@\" field specifier"; - goto error; - - badIndex: - errorString = "not enough arguments for all format specifiers"; - goto error; - - badfield: { - Tcl_UniChar ch; - char buf[TCL_UTF_MAX + 1]; - - Tcl_UtfToUniChar(errorString, &ch); - buf[Tcl_UniCharToUtf(ch, buf)] = '\0'; - Tcl_AppendResult(interp, "bad field specifier \"", buf, "\"", NULL); - return TCL_ERROR; - } - - error: - Tcl_AppendResult(interp, errorString, NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * GetFormatSpec -- - * - * This function parses the format strings used in the binary - * format and scan commands. - * - * Results: - * Moves the formatPtr to the start of the next command. Returns - * the current command character and count in cmdPtr and countPtr. - * The count is set to BINARY_ALL if the count character was '*' - * or BINARY_NOCOUNT if no count was specified. Returns 1 on - * success, or 0 if the string did not have a format specifier. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -GetFormatSpec(formatPtr, cmdPtr, countPtr) - char **formatPtr; /* Pointer to format string. */ - char *cmdPtr; /* Pointer to location of command char. */ - int *countPtr; /* Pointer to repeat count value. */ -{ - /* - * Skip any leading blanks. - */ - - while (**formatPtr == ' ') { - (*formatPtr)++; - } - - /* - * The string was empty, except for whitespace, so fail. - */ - - if (!(**formatPtr)) { - return 0; - } - - /* - * Extract the command character and any trailing digits or '*'. - */ - - *cmdPtr = **formatPtr; - (*formatPtr)++; - if (**formatPtr == '*') { - (*formatPtr)++; - (*countPtr) = BINARY_ALL; - } else if (isdigit(UCHAR(**formatPtr))) { /* INTL: digit */ - (*countPtr) = strtoul(*formatPtr, formatPtr, 10); - } else { - (*countPtr) = BINARY_NOCOUNT; - } - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * FormatNumber -- - * - * This routine is called by Tcl_BinaryObjCmd to format a number - * into a location pointed at by cursor. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Moves the cursor to the next location to be written into. - * - *---------------------------------------------------------------------- - */ - -static int -FormatNumber(interp, type, src, cursorPtr) - Tcl_Interp *interp; /* Current interpreter, used to report - * errors. */ - int type; /* Type of number to format. */ - Tcl_Obj *src; /* Number to format. */ - unsigned char **cursorPtr; /* Pointer to index into destination buffer. */ -{ - int value; - double dvalue; - - if ((type == 'd') || (type == 'f')) { - /* - * For floating point types, we need to copy the data using - * memcpy to avoid alignment issues. - */ - - if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) { - return TCL_ERROR; - } - if (type == 'd') { - memcpy((VOID *) *cursorPtr, (VOID *) &dvalue, sizeof(double)); - *cursorPtr += sizeof(double); - } else { - float fvalue; - - /* - * Because some compilers will generate floating point exceptions - * on an overflow cast (e.g. Borland), we restrict the values - * to the valid range for float. - */ - - if (fabs(dvalue) > (double)FLT_MAX) { - fvalue = (dvalue >= 0.0) ? FLT_MAX : -FLT_MAX; - } else { - fvalue = (float) dvalue; - } - memcpy((VOID *) *cursorPtr, (VOID *) &fvalue, sizeof(float)); - *cursorPtr += sizeof(float); - } - } else { - if (Tcl_GetIntFromObj(interp, src, &value) != TCL_OK) { - return TCL_ERROR; - } - if (type == 'c') { - *(*cursorPtr)++ = (unsigned char) value; - } else if (type == 's') { - *(*cursorPtr)++ = (unsigned char) value; - *(*cursorPtr)++ = (unsigned char) (value >> 8); - } else if (type == 'S') { - *(*cursorPtr)++ = (unsigned char) (value >> 8); - *(*cursorPtr)++ = (unsigned char) value; - } else if (type == 'i') { - *(*cursorPtr)++ = (unsigned char) value; - *(*cursorPtr)++ = (unsigned char) (value >> 8); - *(*cursorPtr)++ = (unsigned char) (value >> 16); - *(*cursorPtr)++ = (unsigned char) (value >> 24); - } else if (type == 'I') { - *(*cursorPtr)++ = (unsigned char) (value >> 24); - *(*cursorPtr)++ = (unsigned char) (value >> 16); - *(*cursorPtr)++ = (unsigned char) (value >> 8); - *(*cursorPtr)++ = (unsigned char) value; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ScanNumber -- - * - * This routine is called by Tcl_BinaryObjCmd to scan a number - * out of a buffer. - * - * Results: - * Returns a newly created object containing the scanned number. - * This object has a ref count of zero. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Tcl_Obj * -ScanNumber(buffer, type) - unsigned char *buffer; /* Buffer to scan number from. */ - int type; /* Format character from "binary scan" */ -{ - long value; - - /* - * We cannot rely on the compiler to properly sign extend integer values - * when we cast from smaller values to larger values because we don't know - * the exact size of the integer types. So, we have to handle sign - * extension explicitly by checking the high bit and padding with 1's as - * needed. - */ - - switch (type) { - case 'c': { - /* - * Characters need special handling. We want to produce a - * signed result, but on some platforms (such as AIX) chars - * are unsigned. To deal with this, check for a value that - * should be negative but isn't. - */ - - value = buffer[0]; - if (value & 0x80) { - value |= -0x100; - } - return Tcl_NewLongObj((long)value); - } - case 's': { - value = (long) (buffer[0] + (buffer[1] << 8)); - goto shortValue; - } - case 'S': { - value = (long) (buffer[1] + (buffer[0] << 8)); - shortValue: - if (value & 0x8000) { - value |= -0x10000; - } - return Tcl_NewLongObj(value); - } - case 'i': { - value = (long) (buffer[0] - + (buffer[1] << 8) - + (buffer[2] << 16) - + (buffer[3] << 24)); - goto intValue; - } - case 'I': { - value = (long) (buffer[3] - + (buffer[2] << 8) - + (buffer[1] << 16) - + (buffer[0] << 24)); - intValue: - /* - * Check to see if the value was sign extended properly on - * systems where an int is more than 32-bits. - */ - - if ((value & (((unsigned int)1)<<31)) && (value > 0)) { - value -= (((unsigned int)1)<<31); - value -= (((unsigned int)1)<<31); - } - return Tcl_NewLongObj(value); - } - case 'f': { - float fvalue; - memcpy((VOID *) &fvalue, (VOID *) buffer, sizeof(float)); - return Tcl_NewDoubleObj(fvalue); - } - case 'd': { - double dvalue; - memcpy((VOID *) &dvalue, (VOID *) buffer, sizeof(double)); - return Tcl_NewDoubleObj(dvalue); - } - } - return NULL; -} diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c deleted file mode 100644 index f19d597..0000000 --- a/generic/tclCkalloc.c +++ /dev/null @@ -1,974 +0,0 @@ -/* - * tclCkalloc.c -- - * - * Interface to malloc and free that provides support for debugging problems - * involving overwritten, double freeing memory and loss of memory. - * - * Copyright (c) 1991-1994 The Regents of the University of California. - * Copyright (c) 1994-1997 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. - * - * This code contributed by Karl Lehenbauer and Mark Diekhans - * - * RCS: @(#) $Id: tclCkalloc.c,v 1.4 1999/04/16 00:46:42 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -#define FALSE 0 -#define TRUE 1 - -#ifdef TCL_MEM_DEBUG - -/* - * One of the following structures is allocated each time the - * "memory tag" command is invoked, to hold the current tag. - */ - -typedef struct MemTag { - int refCount; /* Number of mem_headers referencing - * this tag. */ - char string[4]; /* Actual size of string will be as - * large as needed for actual tag. This - * must be the last field in the structure. */ -} MemTag; - -#define TAG_SIZE(bytesInString) ((unsigned) sizeof(MemTag) + bytesInString - 3) - -static MemTag *curTagPtr = NULL;/* Tag to use in all future mem_headers - * (set by "memory tag" command). */ - -/* - * One of the following structures is allocated just before each - * dynamically allocated chunk of memory, both to record information - * about the chunk and to help detect chunk under-runs. - */ - -#define LOW_GUARD_SIZE (8 + (32 - (sizeof(long) + sizeof(int)))%8) -struct mem_header { - struct mem_header *flink; - struct mem_header *blink; - MemTag *tagPtr; /* Tag from "memory tag" command; may be - * NULL. */ - char *file; - long length; - int line; - unsigned char low_guard[LOW_GUARD_SIZE]; - /* Aligns body on 8-byte boundary, plus - * provides at least 8 additional guard bytes - * to detect underruns. */ - char body[1]; /* First byte of client's space. Actual - * size of this field will be larger than - * one. */ -}; - -static struct mem_header *allocHead = NULL; /* List of allocated structures */ - -#define GUARD_VALUE 0141 - -/* - * The following macro determines the amount of guard space *above* each - * chunk of memory. - */ - -#define HIGH_GUARD_SIZE 8 - -/* - * The following macro computes the offset of the "body" field within - * mem_header. It is used to get back to the header pointer from the - * body pointer that's used by clients. - */ - -#define BODY_OFFSET \ - ((unsigned long) (&((struct mem_header *) 0)->body)) - -static int total_mallocs = 0; -static int total_frees = 0; -static int current_bytes_malloced = 0; -static int maximum_bytes_malloced = 0; -static int current_malloc_packets = 0; -static int maximum_malloc_packets = 0; -static int break_on_malloc = 0; -static int trace_on_at_malloc = 0; -static int alloc_tracing = FALSE; -static int init_malloced_bodies = TRUE; -#ifdef MEM_VALIDATE - static int validate_memory = TRUE; -#else - static int validate_memory = FALSE; -#endif - -/* - * The following variable indicates to TclFinalizeMemorySubsystem() - * that it should dump out the state of memory before exiting. If the - * value is non-NULL, it gives the name of the file in which to - * dump memory usage information. - */ - -char *tclMemDumpFileName = NULL; - -static char dumpFile[100]; /* Records where to dump memory allocation - * information. */ - -/* - * Mutex to serialize allocations. This is a low-level mutex that must - * be explicitly initialized. This is necessary because the self - * initializing mutexes use ckalloc... - */ -static TclpMutex ckallocMutex; -static int ckallocInit = 0; - -/* - * Prototypes for procedures defined in this file: - */ - -static int CheckmemCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char *argv[])); -static int MemoryCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -static void ValidateMemory _ANSI_ARGS_(( - struct mem_header *memHeaderP, char *file, - int line, int nukeGuards)); - -/* - *---------------------------------------------------------------------- - * - * TclInitDbCkalloc -- - * Initialize the locks used by the allocator. - * This is only appropriate to call in a single threaded environtment, - * such as during TclInitSubsystems. - * - *---------------------------------------------------------------------- - */ -void -TclInitDbCkalloc() -{ - if (!ckallocInit) { - ckallocInit = 1; - TclpMutexInit(&ckallocMutex); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclDumpMemoryInfo -- - * Display the global memory management statistics. - * - *---------------------------------------------------------------------- - */ -void -TclDumpMemoryInfo(outFile) - FILE *outFile; -{ - fprintf(outFile,"total mallocs %10d\n", - total_mallocs); - fprintf(outFile,"total frees %10d\n", - total_frees); - fprintf(outFile,"current packets allocated %10d\n", - current_malloc_packets); - fprintf(outFile,"current bytes allocated %10d\n", - current_bytes_malloced); - fprintf(outFile,"maximum packets allocated %10d\n", - maximum_malloc_packets); - fprintf(outFile,"maximum bytes allocated %10d\n", - maximum_bytes_malloced); -} - -/* - *---------------------------------------------------------------------- - * - * ValidateMemory -- - * Procedure to validate allocted memory guard zones. - * - *---------------------------------------------------------------------- - */ -static void -ValidateMemory(memHeaderP, file, line, nukeGuards) - struct mem_header *memHeaderP; - char *file; - int line; - int nukeGuards; -{ - unsigned char *hiPtr; - int idx; - int guard_failed = FALSE; - int byte; - - for (idx = 0; idx < LOW_GUARD_SIZE; idx++) { - byte = *(memHeaderP->low_guard + idx); - if (byte != GUARD_VALUE) { - guard_failed = TRUE; - fflush(stdout); - byte &= 0xff; - fprintf(stderr, "low guard byte %d is 0x%x \t%c\n", idx, byte, - (isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */ - } - } - if (guard_failed) { - TclDumpMemoryInfo (stderr); - fprintf(stderr, "low guard failed at %lx, %s %d\n", - (long unsigned int) memHeaderP->body, file, line); - fflush(stderr); /* In case name pointer is bad. */ - fprintf(stderr, "%ld bytes allocated at (%s %d)\n", memHeaderP->length, - memHeaderP->file, memHeaderP->line); - panic ("Memory validation failure"); - } - - hiPtr = (unsigned char *)memHeaderP->body + memHeaderP->length; - for (idx = 0; idx < HIGH_GUARD_SIZE; idx++) { - byte = *(hiPtr + idx); - if (byte != GUARD_VALUE) { - guard_failed = TRUE; - fflush (stdout); - byte &= 0xff; - fprintf(stderr, "hi guard byte %d is 0x%x \t%c\n", idx, byte, - (isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */ - } - } - - if (guard_failed) { - TclDumpMemoryInfo (stderr); - fprintf(stderr, "high guard failed at %lx, %s %d\n", - (long unsigned int) memHeaderP->body, file, line); - fflush(stderr); /* In case name pointer is bad. */ - fprintf(stderr, "%ld bytes allocated at (%s %d)\n", - memHeaderP->length, memHeaderP->file, - memHeaderP->line); - panic("Memory validation failure"); - } - - if (nukeGuards) { - memset ((char *) memHeaderP->low_guard, 0, LOW_GUARD_SIZE); - memset ((char *) hiPtr, 0, HIGH_GUARD_SIZE); - } - -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ValidateAllMemory -- - * Validates guard regions for all allocated memory. - * - *---------------------------------------------------------------------- - */ -void -Tcl_ValidateAllMemory (file, line) - char *file; - int line; -{ - struct mem_header *memScanP; - - if (!ckallocInit) { - ckallocInit = 1; - TclpMutexInit(&ckallocMutex); - } - TclpMutexLock(&ckallocMutex); - for (memScanP = allocHead; memScanP != NULL; memScanP = memScanP->flink) { - ValidateMemory(memScanP, file, line, FALSE); - } - TclpMutexUnlock(&ckallocMutex); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DumpActiveMemory -- - * Displays all allocated memory to stderr. - * - * Results: - * Return TCL_ERROR if an error accessing the file occures, `errno' - * will have the file error number left in it. - *---------------------------------------------------------------------- - */ -int -Tcl_DumpActiveMemory (fileName) - char *fileName; -{ - FILE *fileP; - struct mem_header *memScanP; - char *address; - - if (fileName == NULL) { - fileP = stdout; - } else { - fileP = fopen(fileName, "w"); - if (fileP == NULL) { - return TCL_ERROR; - } - } - - TclpMutexLock(&ckallocMutex); - for (memScanP = allocHead; memScanP != NULL; memScanP = memScanP->flink) { - address = &memScanP->body [0]; - fprintf(fileP, "%8lx - %8lx %7ld @ %s %d %s", - (long unsigned int) address, - (long unsigned int) address + memScanP->length - 1, - memScanP->length, memScanP->file, memScanP->line, - (memScanP->tagPtr == NULL) ? "" : memScanP->tagPtr->string); - (void) fputc('\n', fileP); - } - TclpMutexUnlock(&ckallocMutex); - - if (fileP != stderr) { - fclose (fileP); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbCkalloc - debugging ckalloc - * - * Allocate the requested amount of space plus some extra for - * guard bands at both ends of the request, plus a size, panicing - * if there isn't enough space, then write in the guard bands - * and return the address of the space in the middle that the - * user asked for. - * - * The second and third arguments are file and line, these contain - * the filename and line number corresponding to the caller. - * These are sent by the ckalloc macro; it uses the preprocessor - * autodefines __FILE__ and __LINE__. - * - *---------------------------------------------------------------------- - */ -char * -Tcl_DbCkalloc(size, file, line) - unsigned int size; - char *file; - int line; -{ - struct mem_header *result; - - if (validate_memory) - Tcl_ValidateAllMemory (file, line); - - result = (struct mem_header *) TclpAlloc((unsigned)size + - sizeof(struct mem_header) + HIGH_GUARD_SIZE); - if (result == NULL) { - fflush(stdout); - TclDumpMemoryInfo(stderr); - panic("unable to alloc %d bytes, %s line %d", size, file, - line); - } - - /* - * Fill in guard zones and size. Also initialize the contents of - * the block with bogus bytes to detect uses of initialized data. - * Link into allocated list. - */ - if (init_malloced_bodies) { - memset ((VOID *) result, GUARD_VALUE, - size + sizeof(struct mem_header) + HIGH_GUARD_SIZE); - } else { - memset ((char *) result->low_guard, GUARD_VALUE, LOW_GUARD_SIZE); - memset (result->body + size, GUARD_VALUE, HIGH_GUARD_SIZE); - } - if (!ckallocInit) { - ckallocInit = 1; - TclpMutexInit(&ckallocMutex); - } - TclpMutexLock(&ckallocMutex); - result->length = size; - result->tagPtr = curTagPtr; - if (curTagPtr != NULL) { - curTagPtr->refCount++; - } - result->file = file; - result->line = line; - result->flink = allocHead; - result->blink = NULL; - - if (allocHead != NULL) - allocHead->blink = result; - allocHead = result; - - total_mallocs++; - if (trace_on_at_malloc && (total_mallocs >= trace_on_at_malloc)) { - (void) fflush(stdout); - fprintf(stderr, "reached malloc trace enable point (%d)\n", - total_mallocs); - fflush(stderr); - alloc_tracing = TRUE; - trace_on_at_malloc = 0; - } - - if (alloc_tracing) - fprintf(stderr,"ckalloc %lx %d %s %d\n", - (long unsigned int) result->body, size, file, line); - - if (break_on_malloc && (total_mallocs >= break_on_malloc)) { - break_on_malloc = 0; - (void) fflush(stdout); - fprintf(stderr,"reached malloc break limit (%d)\n", - total_mallocs); - fprintf(stderr, "program will now enter C debugger\n"); - (void) fflush(stderr); - abort(); - } - - current_malloc_packets++; - if (current_malloc_packets > maximum_malloc_packets) - maximum_malloc_packets = current_malloc_packets; - current_bytes_malloced += size; - if (current_bytes_malloced > maximum_bytes_malloced) - maximum_bytes_malloced = current_bytes_malloced; - - TclpMutexUnlock(&ckallocMutex); - - return result->body; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbCkfree - debugging ckfree - * - * Verify that the low and high guards are intact, and if so - * then free the buffer else panic. - * - * The guards are erased after being checked to catch duplicate - * frees. - * - * The second and third arguments are file and line, these contain - * the filename and line number corresponding to the caller. - * These are sent by the ckfree macro; it uses the preprocessor - * autodefines __FILE__ and __LINE__. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_DbCkfree(ptr, file, line) - char * ptr; - char *file; - int line; -{ - /* - * The following cast is *very* tricky. Must convert the pointer - * to an integer before doing arithmetic on it, because otherwise - * the arithmetic will be done differently (and incorrectly) on - * word-addressed machines such as Crays (will subtract only bytes, - * even though BODY_OFFSET is in words on these machines). - */ - - struct mem_header *memp = (struct mem_header *) - (((unsigned long) ptr) - BODY_OFFSET); - - if (alloc_tracing) - fprintf(stderr, "ckfree %lx %ld %s %d\n", - (long unsigned int) memp->body, memp->length, file, line); - - if (validate_memory) - Tcl_ValidateAllMemory(file, line); - - TclpMutexLock(&ckallocMutex); - ValidateMemory(memp, file, line, TRUE); - if (init_malloced_bodies) { - memset((VOID *) ptr, GUARD_VALUE, (size_t) memp->length); - } - - total_frees++; - current_malloc_packets--; - current_bytes_malloced -= memp->length; - - if (memp->tagPtr != NULL) { - memp->tagPtr->refCount--; - if ((memp->tagPtr->refCount == 0) && (curTagPtr != memp->tagPtr)) { - TclpFree((char *) memp->tagPtr); - } - } - - /* - * Delink from allocated list - */ - if (memp->flink != NULL) - memp->flink->blink = memp->blink; - if (memp->blink != NULL) - memp->blink->flink = memp->flink; - if (allocHead == memp) - allocHead = memp->flink; - TclpFree((char *) memp); - TclpMutexUnlock(&ckallocMutex); - - return 0; -} - -/* - *-------------------------------------------------------------------- - * - * Tcl_DbCkrealloc - debugging ckrealloc - * - * Reallocate a chunk of memory by allocating a new one of the - * right size, copying the old data to the new location, and then - * freeing the old memory space, using all the memory checking - * features of this package. - * - *-------------------------------------------------------------------- - */ -char * -Tcl_DbCkrealloc(ptr, size, file, line) - char *ptr; - unsigned int size; - char *file; - int line; -{ - char *new; - unsigned int copySize; - - /* - * See comment from Tcl_DbCkfree before you change the following - * line. - */ - - struct mem_header *memp = (struct mem_header *) - (((unsigned long) ptr) - BODY_OFFSET); - - copySize = size; - if (copySize > (unsigned int) memp->length) { - copySize = memp->length; - } - new = Tcl_DbCkalloc(size, file, line); - memcpy((VOID *) new, (VOID *) ptr, (size_t) copySize); - Tcl_DbCkfree(ptr, file, line); - return(new); -} - - -/* - *---------------------------------------------------------------------- - * - * Tcl_Alloc, et al. -- - * - * These functions are defined in terms of the debugging versions - * when TCL_MEM_DEBUG is set. - * - * Results: - * Same as the debug versions. - * - * Side effects: - * Same as the debug versions. - * - *---------------------------------------------------------------------- - */ - -#undef Tcl_Alloc -#undef Tcl_Free -#undef Tcl_Realloc - -char * -Tcl_Alloc(size) - unsigned int size; -{ - return Tcl_DbCkalloc(size, "unknown", 0); -} - -void -Tcl_Free(ptr) - char *ptr; -{ - Tcl_DbCkfree(ptr, "unknown", 0); -} - -char * -Tcl_Realloc(ptr, size) - char *ptr; - unsigned int size; -{ - return Tcl_DbCkrealloc(ptr, size, "unknown", 0); -} - -/* - *---------------------------------------------------------------------- - * - * MemoryCmd -- - * Implements the TCL memory command: - * memory info - * memory display - * break_on_malloc count - * trace_on_at_malloc count - * trace on|off - * validate on|off - * - * Results: - * Standard TCL results. - * - *---------------------------------------------------------------------- - */ - /* ARGSUSED */ -static int -MemoryCmd (clientData, interp, argc, argv) - ClientData clientData; - Tcl_Interp *interp; - int argc; - char **argv; -{ - char *fileName; - Tcl_DString buffer; - int result; - - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option [args..]\"", (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[1],"active") == 0) { - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " active file\"", (char *) NULL); - return TCL_ERROR; - } - fileName = Tcl_TranslateFileName(interp, argv[2], &buffer); - if (fileName == NULL) { - return TCL_ERROR; - } - result = Tcl_DumpActiveMemory (fileName); - Tcl_DStringFree(&buffer); - if (result != TCL_OK) { - Tcl_AppendResult(interp, "error accessing ", argv[2], - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; - } - if (strcmp(argv[1],"break_on_malloc") == 0) { - if (argc != 3) { - goto argError; - } - if (Tcl_GetInt(interp, argv[2], &break_on_malloc) != TCL_OK) { - return TCL_ERROR; - } - return TCL_OK; - } - if (strcmp(argv[1],"info") == 0) { - char buffer[400]; - sprintf(buffer, "%-25s %10d\n%-25s %10d\n%-25s %10d\n%-25s %10d\n%-25s %10d\n%-25s %10d\n", - "total mallocs", total_mallocs, "total frees", total_frees, - "current packets allocated", current_malloc_packets, - "current bytes allocated", current_bytes_malloced, - "maximum packets allocated", maximum_malloc_packets, - "maximum bytes allocated", maximum_bytes_malloced); - Tcl_SetResult(interp, buffer, TCL_VOLATILE); - return TCL_OK; - } - if (strcmp(argv[1],"init") == 0) { - if (argc != 3) { - goto bad_suboption; - } - init_malloced_bodies = (strcmp(argv[2],"on") == 0); - return TCL_OK; - } - if (strcmp(argv[1],"tag") == 0) { - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " tag string\"", (char *) NULL); - return TCL_ERROR; - } - if ((curTagPtr != NULL) && (curTagPtr->refCount == 0)) { - TclpFree((char *) curTagPtr); - } - curTagPtr = (MemTag *) TclpAlloc(TAG_SIZE(strlen(argv[2]))); - curTagPtr->refCount = 0; - strcpy(curTagPtr->string, argv[2]); - return TCL_OK; - } - if (strcmp(argv[1],"trace") == 0) { - if (argc != 3) { - goto bad_suboption; - } - alloc_tracing = (strcmp(argv[2],"on") == 0); - return TCL_OK; - } - - if (strcmp(argv[1],"trace_on_at_malloc") == 0) { - if (argc != 3) { - goto argError; - } - if (Tcl_GetInt(interp, argv[2], &trace_on_at_malloc) != TCL_OK) { - return TCL_ERROR; - } - return TCL_OK; - } - if (strcmp(argv[1],"validate") == 0) { - if (argc != 3) { - goto bad_suboption; - } - validate_memory = (strcmp(argv[2],"on") == 0); - return TCL_OK; - } - - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": should be active, break_on_malloc, info, init, ", - "tag, trace, trace_on_at_malloc, or validate", (char *) NULL); - return TCL_ERROR; - -argError: - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ", argv[1], " count\"", (char *) NULL); - return TCL_ERROR; - -bad_suboption: - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ", argv[1], " on|off\"", (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * CheckmemCmd -- - * - * This is the command procedure for the "checkmem" command, which - * causes the application to exit after printing information about - * memory usage to the file passed to this command as its first - * argument. - * - * Results: - * Returns a standard Tcl completion code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -CheckmemCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Interpreter for evaluation. */ - int argc; /* Number of arguments. */ - char *argv[]; /* String values of arguments. */ -{ - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " fileName\"", (char *) NULL); - return TCL_ERROR; - } - tclMemDumpFileName = dumpFile; - strcpy(tclMemDumpFileName, argv[1]); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InitMemory -- - * Initialize the memory command. - * - *---------------------------------------------------------------------- - */ -void -Tcl_InitMemory(interp) - Tcl_Interp *interp; -{ - TclInitDbCkalloc(); - Tcl_CreateCommand (interp, "memory", MemoryCmd, (ClientData) NULL, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "checkmem", CheckmemCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); -} - - -#else /* TCL_MEM_DEBUG */ - -#undef Tcl_InitMemory -#undef Tcl_DumpActiveMemory -#undef Tcl_ValidateAllMemory - - -/* - *---------------------------------------------------------------------- - * - * Tcl_Alloc -- - * Interface to TclpAlloc when TCL_MEM_DEBUG is disabled. It does check - * that memory was actually allocated. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_Alloc (size) - unsigned int size; -{ - char *result; - - result = TclpAlloc(size); - if (result == NULL) - panic("unable to alloc %d bytes", size); - return result; -} - -char * -Tcl_DbCkalloc(size, file, line) - unsigned int size; - char *file; - int line; -{ - char *result; - - result = (char *) TclpAlloc(size); - - if (result == NULL) { - fflush(stdout); - panic("unable to alloc %d bytes, %s line %d", size, file, - line); - } - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * Tcl_Realloc -- - * Interface to TclpRealloc when TCL_MEM_DEBUG is disabled. It does - * check that memory was actually allocated. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_Realloc(ptr, size) - char *ptr; - unsigned int size; -{ - char *result; - - result = TclpRealloc(ptr, size); - if (result == NULL) - panic("unable to realloc %d bytes", size); - return result; -} - -char * -Tcl_DbCkrealloc(ptr, size, file, line) - char *ptr; - unsigned int size; - char *file; - int line; -{ - char *result; - - result = (char *) TclpRealloc(ptr, size); - - if (result == NULL) { - fflush(stdout); - panic("unable to realloc %d bytes, %s line %d", size, file, - line); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Free -- - * Interface to TclpFree when TCL_MEM_DEBUG is disabled. Done here - * rather in the macro to keep some modules from being compiled with - * TCL_MEM_DEBUG enabled and some with it disabled. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_Free (ptr) - char *ptr; -{ - TclpFree(ptr); -} - -int -Tcl_DbCkfree(ptr, file, line) - char * ptr; - char *file; - int line; -{ - TclpFree(ptr); - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InitMemory -- - * Dummy initialization for memory command, which is only available - * if TCL_MEM_DEBUG is on. - * - *---------------------------------------------------------------------- - */ - /* ARGSUSED */ -void -Tcl_InitMemory(interp) - Tcl_Interp *interp; -{ -} - -int -Tcl_DumpActiveMemory(fileName) - char *fileName; -{ - return TCL_OK; -} - -void -Tcl_ValidateAllMemory(file, line) - char *file; - int line; -{ -} - -void -TclDumpMemoryInfo(outFile) - FILE *outFile; -{ -} - -#endif /* TCL_MEM_DEBUG */ - -/* - *--------------------------------------------------------------------------- - * - * TclFinalizeMemorySubsystem -- - * - * This procedure is called to finalize all the structures that - * are used by the memory allocator on a per-process basis. - * - * Results: - * None. - * - * Side effects: - * This subsystem is self-initializing, since memory can be - * allocated before Tcl is formally initialized. After this call, - * this subsystem has been reset to its initial state and is - * usable again. - * - *--------------------------------------------------------------------------- - */ - -void -TclFinalizeMemorySubsystem() -{ -#ifdef TCL_MEM_DEBUG - TclpMutexLock(&ckallocMutex); - if (tclMemDumpFileName != NULL) { - Tcl_DumpActiveMemory(tclMemDumpFileName); - } - if (curTagPtr != NULL) { - TclpFree((char *) curTagPtr); - } - allocHead = NULL; - TclpMutexUnlock(&ckallocMutex); -#endif - -#if USE_TCLALLOC - TclFinalizeAllocSubsystem(); -#endif -} diff --git a/generic/tclClock.c b/generic/tclClock.c deleted file mode 100644 index 2015f53..0000000 --- a/generic/tclClock.c +++ /dev/null @@ -1,323 +0,0 @@ -/* - * tclClock.c -- - * - * Contains the time and date related commands. This code - * is derived from the time and date facilities of TclX, - * by Mark Diekhans and Karl Lehenbauer. - * - * Copyright 1991-1995 Karl Lehenbauer and Mark Diekhans. - * Copyright (c) 1995 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclClock.c,v 1.4 1999/04/16 00:46:43 stanton Exp $ - */ - -#include "tcl.h" -#include "tclInt.h" -#include "tclPort.h" - -/* - * The date parsing stuff uses lexx and has tons o statics. - */ - -TCL_DECLARE_MUTEX(clockMutex) - -/* - * Function prototypes for local procedures in this file: - */ - -static int FormatClock _ANSI_ARGS_((Tcl_Interp *interp, - unsigned long clockVal, int useGMT, - char *format)); - -/* - *------------------------------------------------------------------------- - * - * Tcl_ClockObjCmd -- - * - * This procedure is invoked to process the "clock" 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_ClockObjCmd (client, interp, objc, objv) - ClientData client; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument values. */ -{ - Tcl_Obj *resultPtr; - int index; - Tcl_Obj *CONST *objPtr; - int useGMT = 0; - char *format = "%a %b %d %X %Z %Y"; - int dummy; - unsigned long baseClock, clockVal; - long zone; - Tcl_Obj *baseObjPtr = NULL; - char *scanStr; - - static char *switches[] = - {"clicks", "format", "scan", "seconds", (char *) NULL}; - static char *formatSwitches[] = {"-format", "-gmt", (char *) NULL}; - static char *scanSwitches[] = {"-base", "-gmt", (char *) NULL}; - - resultPtr = Tcl_GetObjResult(interp); - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], switches, "option", 0, &index) - != TCL_OK) { - return TCL_ERROR; - } - switch (index) { - case 0: /* clicks */ - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - Tcl_SetLongObj(resultPtr, (long) TclpGetClicks()); - return TCL_OK; - case 1: /* format */ - if ((objc < 3) || (objc > 7)) { - wrongFmtArgs: - Tcl_WrongNumArgs(interp, 2, objv, - "clockval ?-format string? ?-gmt boolean?"); - return TCL_ERROR; - } - - if (Tcl_GetLongFromObj(interp, objv[2], (long*) &clockVal) - != TCL_OK) { - return TCL_ERROR; - } - - objPtr = objv+3; - objc -= 3; - while (objc > 1) { - if (Tcl_GetIndexFromObj(interp, objPtr[0], formatSwitches, - "switch", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - switch (index) { - case 0: /* -format */ - format = Tcl_GetStringFromObj(objPtr[1], &dummy); - break; - case 1: /* -gmt */ - if (Tcl_GetBooleanFromObj(interp, objPtr[1], - &useGMT) != TCL_OK) { - return TCL_ERROR; - } - break; - } - objPtr += 2; - objc -= 2; - } - if (objc != 0) { - goto wrongFmtArgs; - } - return FormatClock(interp, (unsigned long) clockVal, useGMT, - format); - case 2: /* scan */ - if ((objc < 3) || (objc > 7)) { - wrongScanArgs: - Tcl_WrongNumArgs(interp, 2, objv, - "dateString ?-base clockValue? ?-gmt boolean?"); - return TCL_ERROR; - } - - objPtr = objv+3; - objc -= 3; - while (objc > 1) { - if (Tcl_GetIndexFromObj(interp, objPtr[0], scanSwitches, - "switch", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - switch (index) { - case 0: /* -base */ - baseObjPtr = objPtr[1]; - break; - case 1: /* -gmt */ - if (Tcl_GetBooleanFromObj(interp, objPtr[1], - &useGMT) != TCL_OK) { - return TCL_ERROR; - } - break; - } - objPtr += 2; - objc -= 2; - } - if (objc != 0) { - goto wrongScanArgs; - } - - if (baseObjPtr != NULL) { - if (Tcl_GetLongFromObj(interp, baseObjPtr, - (long*) &baseClock) != TCL_OK) { - return TCL_ERROR; - } - } else { - baseClock = TclpGetSeconds(); - } - - if (useGMT) { - zone = -50000; /* Force GMT */ - } else { - zone = TclpGetTimeZone((unsigned long) baseClock); - } - - scanStr = Tcl_GetStringFromObj(objv[2], &dummy); - Tcl_MutexLock(&clockMutex); - if (TclGetDate(scanStr, (unsigned long) baseClock, zone, - (unsigned long *) &clockVal) < 0) { - Tcl_MutexUnlock(&clockMutex); - Tcl_AppendStringsToObj(resultPtr, - "unable to convert date-time string \"", - scanStr, "\"", (char *) NULL); - return TCL_ERROR; - } - Tcl_MutexUnlock(&clockMutex); - - Tcl_SetLongObj(resultPtr, (long) clockVal); - return TCL_OK; - case 3: /* seconds */ - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - Tcl_SetLongObj(resultPtr, (long) TclpGetSeconds()); - return TCL_OK; - default: - return TCL_ERROR; /* Should never be reached. */ - } -} - -/* - *----------------------------------------------------------------------------- - * - * FormatClock -- - * - * Formats a time value based on seconds into a human readable - * string. - * - * Results: - * Standard Tcl result. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static int -FormatClock(interp, clockVal, useGMT, format) - Tcl_Interp *interp; /* Current interpreter. */ - unsigned long clockVal; /* Time in seconds. */ - int useGMT; /* Boolean */ - char *format; /* Format string */ -{ - struct tm *timeDataPtr; - Tcl_DString buffer; - int bufSize; - char *p; - Tcl_Obj *resultPtr; - int result; -#ifndef HAVE_TM_ZONE - int savedTimeZone = 0; /* lint. */ - char *savedTZEnv = NULL; /* lint. */ -#endif - - resultPtr = Tcl_GetObjResult(interp); -#ifdef HAVE_TZSET - /* - * Some systems forgot to call tzset in localtime, make sure its done. - */ - static int calledTzset = 0; - - Tcl_MutexLock(&clockMutex); - if (!calledTzset) { - tzset(); - calledTzset = 1; - } - Tcl_MutexUnlock(&clockMutex); -#endif - -#ifndef HAVE_TM_ZONE - /* - * This is a kludge for systems not having the timezone string in - * struct tm. No matter what was specified, they use the local - * timezone string. - */ - - if (useGMT) { - char *varValue; - - varValue = Tcl_GetVar2(interp, "env", "TZ", TCL_GLOBAL_ONLY); - if (varValue != NULL) { - savedTZEnv = strcpy(ckalloc(strlen(varValue) + 1), varValue); - } else { - savedTZEnv = NULL; - } - Tcl_SetVar2(interp, "env", "TZ", "GMT", TCL_GLOBAL_ONLY); - savedTimeZone = timezone; - timezone = 0; - tzset(); - } -#endif - - timeDataPtr = TclpGetDate((TclpTime_t) &clockVal, useGMT); - - /* - * Make a guess at the upper limit on the substituted string size - * based on the number of percents in the string. - */ - - for (bufSize = 1, p = format; *p != '\0'; p++) { - if (*p == '%') { - bufSize += 40; - } else { - bufSize++; - } - } - Tcl_DStringInit(&buffer); - Tcl_DStringSetLength(&buffer, bufSize); - - Tcl_MutexLock(&clockMutex); - result = TclpStrftime(buffer.string, (unsigned int) bufSize, format, - timeDataPtr); - Tcl_MutexUnlock(&clockMutex); - -#ifndef HAVE_TM_ZONE - if (useGMT) { - if (savedTZEnv != NULL) { - Tcl_SetVar2(interp, "env", "TZ", savedTZEnv, TCL_GLOBAL_ONLY); - ckfree(savedTZEnv); - } else { - Tcl_UnsetVar2(interp, "env", "TZ", TCL_GLOBAL_ONLY); - } - timezone = savedTimeZone; - tzset(); - } -#endif - if ((result == 0) && (*format != '\0')) { - Tcl_AppendStringsToObj(resultPtr, "bad format string \"", format, - "\"", (char *) NULL); - return TCL_ERROR; - } - - Tcl_SetStringObj(resultPtr, buffer.string, -1); - Tcl_DStringFree(&buffer); - return TCL_OK; -} - diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c deleted file mode 100644 index 8aa6880..0000000 --- a/generic/tclCmdAH.c +++ /dev/null @@ -1,2305 +0,0 @@ -/* - * tclCmdAH.c -- - * - * This file contains the top-level command routines for most of - * the Tcl built-in commands whose names begin with the letters - * A to H. - * - * Copyright (c) 1987-1993 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. - * - * RCS: @(#) $Id: tclCmdAH.c,v 1.5 1999/04/16 00:46:43 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include - -typedef int (StatProc)_ANSI_ARGS_((CONST char *path, struct stat *buf)); - -/* - * Prototypes for local procedures defined in this file: - */ - -static int CheckAccess _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr, int mode)); -static int GetStatBuf _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr, StatProc *statProc, - struct stat *statPtr)); -static char * GetTypeFromMode _ANSI_ARGS_((int mode)); -static int SplitPath _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr, int *argcPtr, char ***argvPtr)); -static int StoreStatData _ANSI_ARGS_((Tcl_Interp *interp, - char *varName, struct stat *statPtr)); -static char ** StringifyObjects _ANSI_ARGS_((int objc, - Tcl_Obj *CONST objv[])); - -/* - *---------------------------------------------------------------------- - * - * Tcl_BreakObjCmd -- - * - * This procedure is invoked to process the "break" Tcl command. - * See the user documentation for details on what it does. - * - * With the bytecode compiler, this procedure is only called when - * a command name is computed at runtime, and is "break" or the name - * to which "break" was renamed: e.g., "set z break; $z" - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_BreakObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - if (objc != 1) { - Tcl_WrongNumArgs(interp, 1, objv, NULL); - return TCL_ERROR; - } - return TCL_BREAK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CaseObjCmd -- - * - * This procedure is invoked to process the "case" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_CaseObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register int i; - int body, result; - char *string, *arg; - int caseObjc; - Tcl_Obj *CONST *caseObjv; - Tcl_Obj *armPtr; - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 1, objv, - "string ?in? patList body ... ?default body?"); - return TCL_ERROR; - } - - string = Tcl_GetString(objv[1]); - body = -1; - - arg = Tcl_GetString(objv[2]); - if (strcmp(arg, "in") == 0) { - i = 3; - } else { - i = 2; - } - caseObjc = objc - i; - caseObjv = objv + i; - - /* - * If all of the pattern/command pairs are lumped into a single - * argument, split them out again. - */ - - if (caseObjc == 1) { - Tcl_Obj **newObjv; - - Tcl_ListObjGetElements(interp, caseObjv[0], &caseObjc, &newObjv); - caseObjv = newObjv; - } - - for (i = 0; i < caseObjc; i += 2) { - int patObjc, j; - char **patObjv; - char *pat; - unsigned char *p; - - if (i == (caseObjc - 1)) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "extra case pattern with no body", -1); - return TCL_ERROR; - } - - /* - * Check for special case of single pattern (no list) with - * no backslash sequences. - */ - - pat = Tcl_GetString(caseObjv[i]); - for (p = (unsigned char *) pat; *p != '\0'; p++) { - if (isspace(*p) || (*p == '\\')) { /* INTL: ISO space, UCHAR */ - break; - } - } - if (*p == '\0') { - if ((*pat == 'd') && (strcmp(pat, "default") == 0)) { - body = i + 1; - } - if (Tcl_StringMatch(string, pat)) { - body = i + 1; - goto match; - } - continue; - } - - - /* - * Break up pattern lists, then check each of the patterns - * in the list. - */ - - result = Tcl_SplitList(interp, pat, &patObjc, &patObjv); - if (result != TCL_OK) { - return result; - } - for (j = 0; j < patObjc; j++) { - if (Tcl_StringMatch(string, patObjv[j])) { - body = i + 1; - break; - } - } - ckfree((char *) patObjv); - if (j < patObjc) { - break; - } - } - - match: - if (body != -1) { - armPtr = caseObjv[body - 1]; - result = Tcl_EvalObjEx(interp, caseObjv[body], 0); - if (result == TCL_ERROR) { - char msg[100 + TCL_INTEGER_SPACE]; - - arg = Tcl_GetString(armPtr); - sprintf(msg, - "\n (\"%.50s\" arm line %d)", arg, - interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); - } - return result; - } - - /* - * Nothing matched: return nothing. - */ - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CatchObjCmd -- - * - * This object-based procedure is invoked to process the "catch" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_CatchObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Obj *varNamePtr = NULL; - int result; - - if ((objc != 2) && (objc != 3)) { - Tcl_WrongNumArgs(interp, 1, objv, "command ?varName?"); - return TCL_ERROR; - } - - /* - * Save a pointer to the variable name object, if any, in case the - * Tcl_EvalObj reallocates the bytecode interpreter's evaluation - * stack rendering objv invalid. - */ - - if (objc == 3) { - varNamePtr = objv[2]; - } - - result = Tcl_EvalObjEx(interp, objv[1], 0); - - if (objc == 3) { - if (Tcl_ObjSetVar2(interp, varNamePtr, NULL, - Tcl_GetObjResult(interp), 0) == NULL) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "couldn't save command result in variable", -1); - return TCL_ERROR; - } - } - - /* - * Set the interpreter's object result to an integer object holding the - * integer Tcl_EvalObj result. Note that we don't bother generating a - * string representation. We reset the interpreter's object result - * to an unshared empty object and then set it to be an integer object. - */ - - Tcl_ResetResult(interp); - Tcl_SetIntObj(Tcl_GetObjResult(interp), result); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CdObjCmd -- - * - * This procedure is invoked to process the "cd" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_CdObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *dirName; - Tcl_DString ds; - int result; - - if (objc > 2) { - Tcl_WrongNumArgs(interp, 1, objv, "?dirName?"); - return TCL_ERROR; - } - - if (objc == 2) { - dirName = Tcl_GetString(objv[1]); - } else { - dirName = "~"; - } - if (Tcl_TranslateFileName(interp, dirName, &ds) == NULL) { - return TCL_ERROR; - } - - result = Tcl_Chdir(Tcl_DStringValue(&ds)); - Tcl_DStringFree(&ds); - - if (result != 0) { - Tcl_AppendResult(interp, "couldn't change working directory to \"", - dirName, "\": ", Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ConcatObjCmd -- - * - * This object-based procedure is invoked to process the "concat" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ConcatObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - if (objc >= 2) { - Tcl_SetObjResult(interp, Tcl_ConcatObj(objc-1, objv+1)); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ContinueObjCmd - - * - * This procedure is invoked to process the "continue" Tcl command. - * See the user documentation for details on what it does. - * - * With the bytecode compiler, this procedure is only called when - * a command name is computed at runtime, and is "continue" or the name - * to which "continue" was renamed: e.g., "set z continue; $z" - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ContinueObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - if (objc != 1) { - Tcl_WrongNumArgs(interp, 1, objv, NULL); - return TCL_ERROR; - } - return TCL_CONTINUE; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EncodingObjCmd -- - * - * This command manipulates encodings. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_EncodingObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int index, length; - Tcl_Encoding encoding; - char *string; - Tcl_DString ds; - Tcl_Obj *resultPtr; - - static char *optionStrings[] = { - "convertfrom", "convertto", "names", "system", - NULL - }; - enum options { - ENC_CONVERTFROM, ENC_CONVERTTO, ENC_NAMES, ENC_SYSTEM - }; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); - return TCL_ERROR; - } - if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - switch ((enum options) index) { - case ENC_CONVERTTO: - case ENC_CONVERTFROM: { - char *name; - Tcl_Obj *data; - if (objc == 3) { - name = NULL; - data = objv[2]; - } else if (objc == 4) { - name = Tcl_GetString(objv[2]); - data = objv[3]; - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?encoding? data"); - return TCL_ERROR; - } - - encoding = Tcl_GetEncoding(interp, name); - if (!encoding) { - return TCL_ERROR; - } - - if ((enum options) index == ENC_CONVERTFROM) { - /* - * Treat the string as binary data. - */ - - string = (char *) Tcl_GetByteArrayFromObj(data, &length); - Tcl_ExternalToUtfDString(encoding, string, length, &ds); - - /* - * Note that we cannot use Tcl_DStringResult here because - * it will truncate the string at the first null byte. - */ - - Tcl_SetStringObj(Tcl_GetObjResult(interp), - Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); - Tcl_DStringFree(&ds); - } else { - /* - * Store the result as binary data. - */ - - string = Tcl_GetStringFromObj(data, &length); - Tcl_UtfToExternalDString(encoding, string, length, &ds); - resultPtr = Tcl_GetObjResult(interp); - Tcl_SetByteArrayObj(resultPtr, - (unsigned char *) Tcl_DStringValue(&ds), - Tcl_DStringLength(&ds)); - Tcl_DStringFree(&ds); - } - - Tcl_FreeEncoding(encoding); - break; - } - case ENC_NAMES: { - if (objc > 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - Tcl_GetEncodingNames(interp); - break; - } - case ENC_SYSTEM: { - if (objc > 3) { - Tcl_WrongNumArgs(interp, 2, objv, "?encoding?"); - return TCL_ERROR; - } - if (objc == 2) { - Tcl_SetResult(interp, Tcl_GetEncodingName(NULL), TCL_STATIC); - } else { - return Tcl_SetSystemEncoding(interp, - Tcl_GetStringFromObj(objv[2], NULL)); - } - break; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ErrorObjCmd -- - * - * This procedure is invoked to process the "error" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ErrorObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - char *info; - int infoLen; - - if ((objc < 2) || (objc > 4)) { - Tcl_WrongNumArgs(interp, 1, objv, "message ?errorInfo? ?errorCode?"); - return TCL_ERROR; - } - - if (objc >= 3) { /* process the optional info argument */ - info = Tcl_GetStringFromObj(objv[2], &infoLen); - if (*info != 0) { - Tcl_AddObjErrorInfo(interp, info, infoLen); - iPtr->flags |= ERR_ALREADY_LOGGED; - } - } - - if (objc == 4) { - Tcl_SetVar2Ex(interp, "errorCode", NULL, objv[3], TCL_GLOBAL_ONLY); - iPtr->flags |= ERROR_CODE_SET; - } - - Tcl_SetObjResult(interp, objv[1]); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EvalObjCmd -- - * - * This object-based procedure is invoked to process the "eval" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_EvalObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int result; - register Tcl_Obj *objPtr; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?"); - return TCL_ERROR; - } - - if (objc == 2) { - result = Tcl_EvalObjEx(interp, objv[1], 0); - } else { - /* - * More than one argument: concatenate them together with spaces - * between, then evaluate the result. - */ - - objPtr = Tcl_ConcatObj(objc-1, objv+1); - Tcl_IncrRefCount(objPtr); - result = Tcl_EvalObjEx(interp, objPtr, 0); - Tcl_DecrRefCount(objPtr); - } - if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"eval\" body line %d)", interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ExitObjCmd -- - * - * This procedure is invoked to process the "exit" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ExitObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int value; - - if ((objc != 1) && (objc != 2)) { - Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?"); - return TCL_ERROR; - } - - if (objc == 1) { - value = 0; - } else if (Tcl_GetIntFromObj(interp, objv[1], &value) != TCL_OK) { - return TCL_ERROR; - } - Tcl_Exit(value); - /*NOTREACHED*/ - return TCL_OK; /* Better not ever reach this! */ -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ExprObjCmd -- - * - * This object-based procedure is invoked to process the "expr" Tcl - * command. See the user documentation for details on what it does. - * - * With the bytecode compiler, this procedure is called in two - * circumstances: 1) to execute expr commands that are too complicated - * or too unsafe to try compiling directly into an inline sequence of - * instructions, and 2) to execute commands where the command name is - * computed at runtime and is "expr" or the name to which "expr" was - * renamed (e.g., "set z expr; $z 2+3") - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ExprObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Tcl_Obj *objPtr; - Tcl_Obj *resultPtr; - register char *bytes; - int length, i, result; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "arg ?arg ...?"); - return TCL_ERROR; - } - - if (objc == 2) { - result = Tcl_ExprObj(interp, objv[1], &resultPtr); - if (result == TCL_OK) { - Tcl_SetObjResult(interp, resultPtr); - Tcl_DecrRefCount(resultPtr); /* done with the result object */ - } - return result; - } - - /* - * Create a new object holding the concatenated argument strings. - */ - - bytes = Tcl_GetStringFromObj(objv[1], &length); - objPtr = Tcl_NewStringObj(bytes, length); - Tcl_IncrRefCount(objPtr); - for (i = 2; i < objc; i++) { - Tcl_AppendToObj(objPtr, " ", 1); - bytes = Tcl_GetStringFromObj(objv[i], &length); - Tcl_AppendToObj(objPtr, bytes, length); - } - - /* - * Evaluate the concatenated string object. - */ - - result = Tcl_ExprObj(interp, objPtr, &resultPtr); - if (result == TCL_OK) { - Tcl_SetObjResult(interp, resultPtr); - Tcl_DecrRefCount(resultPtr); /* done with the result object */ - } - - /* - * Free allocated resources. - */ - - Tcl_DecrRefCount(objPtr); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FileObjCmd -- - * - * This procedure is invoked to process the "file" Tcl command. - * See the user documentation for details on what it does. - * PLEASE NOTE THAT THIS FAILS WITH FILENAMES AND PATHS WITH - * EMBEDDED NULLS, WHICH COULD THEORETICALLY HAPPEN ON A MAC. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_FileObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Obj *resultPtr; - int index; - -/* - * This list of constants should match the fileOption string array below. - */ - - static char *fileOptions[] = { - "atime", "attributes", "copy", "delete", - "dirname", "executable", "exists", "extension", - "isdirectory", "isfile", "join", "lstat", - "mtime", "mkdir", "nativename", "owned", - "pathtype", "readable", "readlink", "rename", - "rootname", "size", "split", "stat", - "tail", "type", "volumes", "writable", - (char *) NULL - }; - enum options { - FILE_ATIME, FILE_ATTRIBUTES, FILE_COPY, FILE_DELETE, - FILE_DIRNAME, FILE_EXECUTABLE, FILE_EXISTS, FILE_EXTENSION, - FILE_ISDIRECTORY, FILE_ISFILE, FILE_JOIN, FILE_LSTAT, - FILE_MTIME, FILE_MKDIR, FILE_NATIVENAME, FILE_OWNED, - FILE_PATHTYPE, FILE_READABLE, FILE_READLINK, FILE_RENAME, - FILE_ROOTNAME, FILE_SIZE, FILE_SPLIT, FILE_STAT, - FILE_TAIL, FILE_TYPE, FILE_VOLUMES, FILE_WRITABLE - }; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); - return TCL_ERROR; - } - if (Tcl_GetIndexFromObj(interp, objv[1], fileOptions, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - resultPtr = Tcl_GetObjResult(interp); - switch ((enum options) index) { - case FILE_ATIME: { - struct stat buf; - - if (objc != 3) { - goto only3Args; - } - if (GetStatBuf(interp, objv[2], TclpStat, &buf) != TCL_OK) { - return TCL_ERROR; - } - Tcl_SetLongObj(resultPtr, (long) buf.st_atime); - return TCL_OK; - } - case FILE_ATTRIBUTES: { - return TclFileAttrsCmd(interp, objc, objv); - } - case FILE_COPY: { - int result; - char **argv; - - argv = StringifyObjects(objc, objv); - result = TclFileCopyCmd(interp, objc, argv); - ckfree((char *) argv); - return result; - } - case FILE_DELETE: { - int result; - char **argv; - - argv = StringifyObjects(objc, objv); - result = TclFileDeleteCmd(interp, objc, argv); - ckfree((char *) argv); - return result; - } - case FILE_DIRNAME: { - int argc; - char **argv; - - if (objc != 3) { - goto only3Args; - } - if (SplitPath(interp, objv[2], &argc, &argv) != TCL_OK) { - return TCL_ERROR; - } - - /* - * Return all but the last component. If there is only one - * component, return it if the path was non-relative, otherwise - * return the current directory. - */ - - if (argc > 1) { - Tcl_DString ds; - - Tcl_DStringInit(&ds); - Tcl_JoinPath(argc - 1, argv, &ds); - Tcl_SetStringObj(resultPtr, Tcl_DStringValue(&ds), - Tcl_DStringLength(&ds)); - Tcl_DStringFree(&ds); - } else if ((argc == 0) - || (Tcl_GetPathType(argv[0]) == TCL_PATH_RELATIVE)) { - Tcl_SetStringObj(resultPtr, - ((tclPlatform == TCL_PLATFORM_MAC) ? ":" : "."), 1); - } else { - Tcl_SetStringObj(resultPtr, argv[0], -1); - } - ckfree((char *) argv); - return TCL_OK; - } - case FILE_EXECUTABLE: { - if (objc != 3) { - goto only3Args; - } - return CheckAccess(interp, objv[2], X_OK); - } - case FILE_EXISTS: { - if (objc != 3) { - goto only3Args; - } - return CheckAccess(interp, objv[2], F_OK); - } - case FILE_EXTENSION: { - char *fileName, *extension; - if (objc != 3) { - goto only3Args; - } - fileName = Tcl_GetString(objv[2]); - extension = TclGetExtension(fileName); - if (extension != NULL) { - Tcl_SetStringObj(resultPtr, extension, -1); - } - return TCL_OK; - } - case FILE_ISDIRECTORY: { - int value; - struct stat buf; - - if (objc != 3) { - goto only3Args; - } - value = 0; - if (GetStatBuf(NULL, objv[2], TclpStat, &buf) == TCL_OK) { - value = S_ISDIR(buf.st_mode); - } - Tcl_SetBooleanObj(resultPtr, value); - return TCL_OK; - } - case FILE_ISFILE: { - int value; - struct stat buf; - - if (objc != 3) { - goto only3Args; - } - value = 0; - if (GetStatBuf(NULL, objv[2], TclpStat, &buf) == TCL_OK) { - value = S_ISREG(buf.st_mode); - } - Tcl_SetBooleanObj(resultPtr, value); - return TCL_OK; - } - case FILE_JOIN: { - char **argv; - Tcl_DString ds; - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "name ?name ...?"); - return TCL_ERROR; - } - argv = StringifyObjects(objc - 2, objv + 2); - Tcl_DStringInit(&ds); - Tcl_JoinPath(objc - 2, argv, &ds); - Tcl_SetStringObj(resultPtr, Tcl_DStringValue(&ds), - Tcl_DStringLength(&ds)); - Tcl_DStringFree(&ds); - ckfree((char *) argv); - return TCL_OK; - } - case FILE_LSTAT: { - char *varName; - struct stat buf; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "name varName"); - return TCL_ERROR; - } - if (GetStatBuf(interp, objv[2], TclpLstat, &buf) != TCL_OK) { - return TCL_ERROR; - } - varName = Tcl_GetString(objv[3]); - return StoreStatData(interp, varName, &buf); - } - case FILE_MTIME: { - struct stat buf; - - if (objc != 3) { - goto only3Args; - } - if (GetStatBuf(interp, objv[2], TclpStat, &buf) != TCL_OK) { - return TCL_ERROR; - } - Tcl_SetLongObj(resultPtr, (long) buf.st_mtime); - return TCL_OK; - } - case FILE_MKDIR: { - char **argv; - int result; - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "name ?name ...?"); - return TCL_ERROR; - } - argv = StringifyObjects(objc, objv); - result = TclFileMakeDirsCmd(interp, objc, argv); - ckfree((char *) argv); - return result; - } - case FILE_NATIVENAME: { - char *fileName; - Tcl_DString ds; - - if (objc != 3) { - goto only3Args; - } - fileName = Tcl_GetString(objv[2]); - fileName = Tcl_TranslateFileName(interp, fileName, &ds); - if (fileName == NULL) { - return TCL_ERROR; - } - Tcl_SetStringObj(resultPtr, fileName, Tcl_DStringLength(&ds)); - Tcl_DStringFree(&ds); - return TCL_OK; - } - case FILE_OWNED: { - int value; - struct stat buf; - - if (objc != 3) { - goto only3Args; - } - value = 0; - if (GetStatBuf(NULL, objv[2], TclpStat, &buf) == TCL_OK) { - /* - * For Windows and Macintosh, there are no user ids - * associated with a file, so we always return 1. - */ - -#if (defined(__WIN32__) || defined(MAC_TCL)) - value = 1; -#else - value = (geteuid() == buf.st_uid); -#endif - } - Tcl_SetBooleanObj(resultPtr, value); - return TCL_OK; - } - case FILE_PATHTYPE: { - char *fileName; - - if (objc != 3) { - goto only3Args; - } - fileName = Tcl_GetString(objv[2]); - switch (Tcl_GetPathType(fileName)) { - case TCL_PATH_ABSOLUTE: - Tcl_SetStringObj(resultPtr, "absolute", -1); - break; - case TCL_PATH_RELATIVE: - Tcl_SetStringObj(resultPtr, "relative", -1); - break; - case TCL_PATH_VOLUME_RELATIVE: - Tcl_SetStringObj(resultPtr, "volumerelative", -1); - break; - } - return TCL_OK; - } - case FILE_READABLE: { - if (objc != 3) { - goto only3Args; - } - return CheckAccess(interp, objv[2], R_OK); - } - case FILE_READLINK: { - char *fileName, *contents; - Tcl_DString name, link; - - if (objc != 3) { - goto only3Args; - } - - fileName = Tcl_GetString(objv[2]); - fileName = Tcl_TranslateFileName(interp, fileName, &name); - if (fileName == NULL) { - return TCL_ERROR; - } - - /* - * If S_IFLNK isn't defined it means that the machine doesn't - * support symbolic links, so the file can't possibly be a - * symbolic link. Generate an EINVAL error, which is what - * happens on machines that do support symbolic links when - * you invoke readlink on a file that isn't a symbolic link. - */ - -#ifndef S_IFLNK - contents = NULL; - errno = EINVAL; -#else - contents = TclpReadlink(fileName, &link); -#endif /* S_IFLNK */ - - Tcl_DStringFree(&name); - if (contents == NULL) { - Tcl_AppendResult(interp, "could not readlink \"", - Tcl_GetString(objv[2]), "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - Tcl_DStringResult(interp, &link); - return TCL_OK; - } - case FILE_RENAME: { - int result; - char **argv; - - argv = StringifyObjects(objc, objv); - result = TclFileRenameCmd(interp, objc, argv); - ckfree((char *) argv); - return result; - } - case FILE_ROOTNAME: { - int length; - char *fileName, *extension; - - if (objc != 3) { - goto only3Args; - } - fileName = Tcl_GetStringFromObj(objv[2], &length); - extension = TclGetExtension(fileName); - if (extension == NULL) { - Tcl_SetObjResult(interp, objv[2]); - } else { - Tcl_SetStringObj(resultPtr, fileName, - (int) (length - strlen(extension))); - } - return TCL_OK; - } - case FILE_SIZE: { - struct stat buf; - - if (objc != 3) { - goto only3Args; - } - if (GetStatBuf(interp, objv[2], TclpStat, &buf) != TCL_OK) { - return TCL_ERROR; - } - Tcl_SetLongObj(resultPtr, (long) buf.st_size); - return TCL_OK; - } - case FILE_SPLIT: { - int i, argc; - char **argv; - char *fileName; - Tcl_Obj *objPtr; - - if (objc != 3) { - goto only3Args; - } - fileName = Tcl_GetString(objv[2]); - Tcl_SplitPath(fileName, &argc, &argv); - for (i = 0; i < argc; i++) { - objPtr = Tcl_NewStringObj(argv[i], -1); - Tcl_ListObjAppendElement(NULL, resultPtr, objPtr); - } - ckfree((char *) argv); - return TCL_OK; - } - case FILE_STAT: { - char *varName; - struct stat buf; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 1, objv, "stat name varName"); - return TCL_ERROR; - } - if (GetStatBuf(interp, objv[2], TclpStat, &buf) != TCL_OK) { - return TCL_ERROR; - } - varName = Tcl_GetString(objv[3]); - return StoreStatData(interp, varName, &buf); - } - case FILE_TAIL: { - int argc; - char **argv; - - if (objc != 3) { - goto only3Args; - } - if (SplitPath(interp, objv[2], &argc, &argv) != TCL_OK) { - return TCL_ERROR; - } - - /* - * Return the last component, unless it is the only component, - * and it is the root of an absolute path. - */ - - if (argc > 0) { - if ((argc > 1) - || (Tcl_GetPathType(argv[0]) == TCL_PATH_RELATIVE)) { - Tcl_SetStringObj(resultPtr, argv[argc - 1], -1); - } - } - ckfree((char *) argv); - return TCL_OK; - } - case FILE_TYPE: { - struct stat buf; - - if (objc != 3) { - goto only3Args; - } - if (GetStatBuf(interp, objv[2], TclpLstat, &buf) != TCL_OK) { - return TCL_ERROR; - } - Tcl_SetStringObj(resultPtr, - GetTypeFromMode((unsigned short) buf.st_mode), -1); - return TCL_OK; - } - case FILE_VOLUMES: { - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - return TclpListVolumes(interp); - } - case FILE_WRITABLE: { - if (objc != 3) { - goto only3Args; - } - return CheckAccess(interp, objv[2], W_OK); - } - } - - only3Args: - Tcl_WrongNumArgs(interp, 2, objv, "name"); - return TCL_ERROR; -} - -/* - *--------------------------------------------------------------------------- - * - * SplitPath -- - * - * Utility procedure used by Tcl_FileObjCmd() to split a path. - * Differs from standard Tcl_SplitPath in its handling of home - * directories; Tcl_SplitPath preserves the "~" while this - * procedure computes the actual full path name. - * - * Results: - * The return value is TCL_OK if the path could be split, TCL_ERROR - * otherwise. If TCL_ERROR was returned, an error message is left - * in interp. If TCL_OK was returned, *argvPtr is set to a newly - * allocated array of strings that represent the individual - * directories in the specified path, and *argcPtr is filled with - * the length of that array. - * - * Side effects: - * Memory allocated. The caller must eventually free this memory - * by calling ckfree() on *argvPtr. - * - *--------------------------------------------------------------------------- - */ - -static int -SplitPath(interp, objPtr, argcPtr, argvPtr) - Tcl_Interp *interp; /* Interp for error return. May be NULL. */ - Tcl_Obj *objPtr; /* Path to be split. */ - int *argcPtr; /* Filled with length of following array. */ - char ***argvPtr; /* Filled with array of strings representing - * the elements of the specified path. */ -{ - char *fileName; - - fileName = Tcl_GetString(objPtr); - - /* - * If there is only one element, and it starts with a tilde, - * perform tilde substitution and resplit the path. - */ - - Tcl_SplitPath(fileName, argcPtr, argvPtr); - if ((*argcPtr == 1) && (fileName[0] == '~')) { - Tcl_DString ds; - - ckfree((char *) *argvPtr); - fileName = Tcl_TranslateFileName(interp, fileName, &ds); - if (fileName == NULL) { - return TCL_ERROR; - } - Tcl_SplitPath(fileName, argcPtr, argvPtr); - Tcl_DStringFree(&ds); - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * CheckAccess -- - * - * Utility procedure used by Tcl_FileObjCmd() to query file - * attributes available through the access() system call. - * - * Results: - * Always returns TCL_OK. Sets interp's result to boolean true or - * false depending on whether the file has the specified attribute. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static int -CheckAccess(interp, objPtr, mode) - Tcl_Interp *interp; /* Interp for status return. Must not be - * NULL. */ - Tcl_Obj *objPtr; /* Name of file to check. */ - int mode; /* Attribute to check; passed as argument to - * access(). */ -{ - int value; - char *fileName; - Tcl_DString ds; - - fileName = Tcl_GetString(objPtr); - fileName = Tcl_TranslateFileName(interp, fileName, &ds); - if (fileName == NULL) { - value = 0; - } else { - value = (TclAccess(fileName, mode) == 0); - Tcl_DStringFree(&ds); - } - Tcl_SetBooleanObj(Tcl_GetObjResult(interp), value); - - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * GetStatBuf -- - * - * Utility procedure used by Tcl_FileObjCmd() to query file - * attributes available through the stat() or lstat() system call. - * - * Results: - * The return value is TCL_OK if the specified file exists and can - * be stat'ed, TCL_ERROR otherwise. If TCL_ERROR is returned, an - * error message is left in interp's result. If TCL_OK is returned, - * *statPtr is filled with information about the specified file. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static int -GetStatBuf(interp, objPtr, statProc, statPtr) - Tcl_Interp *interp; /* Interp for error return. May be NULL. */ - Tcl_Obj *objPtr; /* Path name to examine. */ - StatProc *statProc; /* Either stat() or lstat() depending on - * desired behavior. */ - struct stat *statPtr; /* Filled with info about file obtained by - * calling (*statProc)(). */ -{ - char *fileName; - Tcl_DString ds; - int status; - - fileName = Tcl_GetString(objPtr); - fileName = Tcl_TranslateFileName(interp, fileName, &ds); - if (fileName == NULL) { - return TCL_ERROR; - } - - status = (*statProc)(Tcl_DStringValue(&ds), statPtr); - Tcl_DStringFree(&ds); - - if (status < 0) { - if (interp != NULL) { - Tcl_AppendResult(interp, "could not read \"", - Tcl_GetString(objPtr), "\": ", - Tcl_PosixError(interp), (char *) NULL); - } - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * StoreStatData -- - * - * This is a utility procedure that breaks out the fields of a - * "stat" structure and stores them in textual form into the - * elements of an associative array. - * - * Results: - * Returns a standard Tcl return value. If an error occurs then - * a message is left in interp's result. - * - * Side effects: - * Elements of the associative array given by "varName" are modified. - * - *---------------------------------------------------------------------- - */ - -static int -StoreStatData(interp, varName, statPtr) - Tcl_Interp *interp; /* Interpreter for error reports. */ - char *varName; /* Name of associative array variable - * in which to store stat results. */ - struct stat *statPtr; /* Pointer to buffer containing - * stat data to store in varName. */ -{ - char string[TCL_INTEGER_SPACE]; - - TclFormatInt(string, (long) statPtr->st_dev); - if (Tcl_SetVar2(interp, varName, "dev", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - TclFormatInt(string, (long) statPtr->st_ino); - if (Tcl_SetVar2(interp, varName, "ino", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - TclFormatInt(string, (unsigned short) statPtr->st_mode); - if (Tcl_SetVar2(interp, varName, "mode", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - TclFormatInt(string, (long) statPtr->st_nlink); - if (Tcl_SetVar2(interp, varName, "nlink", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - TclFormatInt(string, (long) statPtr->st_uid); - if (Tcl_SetVar2(interp, varName, "uid", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - TclFormatInt(string, (long) statPtr->st_gid); - if (Tcl_SetVar2(interp, varName, "gid", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - sprintf(string, "%lu", (unsigned long) statPtr->st_size); - if (Tcl_SetVar2(interp, varName, "size", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - TclFormatInt(string, (long) statPtr->st_atime); - if (Tcl_SetVar2(interp, varName, "atime", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - TclFormatInt(string, (long) statPtr->st_mtime); - if (Tcl_SetVar2(interp, varName, "mtime", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - TclFormatInt(string, (long) statPtr->st_ctime); - if (Tcl_SetVar2(interp, varName, "ctime", string, TCL_LEAVE_ERR_MSG) - == NULL) { - return TCL_ERROR; - } - if (Tcl_SetVar2(interp, varName, "type", - GetTypeFromMode((unsigned short) statPtr->st_mode), - TCL_LEAVE_ERR_MSG) == NULL) { - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * GetTypeFromMode -- - * - * Given a mode word, returns a string identifying the type of a - * file. - * - * Results: - * A static text string giving the file type from mode. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static char * -GetTypeFromMode(mode) - int mode; -{ - 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"; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FoObjCmd -- - * - * This procedure is invoked to process the "for" Tcl command. - * See the user documentation for details on what it does. - * - * With the bytecode compiler, this procedure is only called when - * a command name is computed at runtime, and is "for" or the name - * to which "for" was renamed: e.g., - * "set z for; $z {set i 0} {$i<100} {incr i} {puts $i}" - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ForObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int result, value; - - if (objc != 5) { - Tcl_WrongNumArgs(interp, 1, objv, "start test next command"); - return TCL_ERROR; - } - - result = Tcl_EvalObjEx(interp, objv[1], 0); - if (result != TCL_OK) { - if (result == TCL_ERROR) { - Tcl_AddErrorInfo(interp, "\n (\"for\" initial command)"); - } - return result; - } - while (1) { - result = Tcl_ExprBooleanObj(interp, objv[2], &value); - if (result != TCL_OK) { - return result; - } - if (!value) { - break; - } - result = Tcl_EvalObjEx(interp, objv[4], 0); - if ((result != TCL_OK) && (result != TCL_CONTINUE)) { - if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"for\" body line %d)",interp->errorLine); - Tcl_AddErrorInfo(interp, msg); - } - break; - } - result = Tcl_EvalObjEx(interp, objv[3], 0); - if (result == TCL_BREAK) { - break; - } else if (result != TCL_OK) { - if (result == TCL_ERROR) { - Tcl_AddErrorInfo(interp, "\n (\"for\" loop-end command)"); - } - return result; - } - } - if (result == TCL_BREAK) { - result = TCL_OK; - } - if (result == TCL_OK) { - Tcl_ResetResult(interp); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ForeachObjCmd -- - * - * This object-based procedure is invoked to process the "foreach" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ForeachObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int result = TCL_OK; - int i; /* i selects a value list */ - int j, maxj; /* Number of loop iterations */ - int v; /* v selects a loop variable */ - int numLists; /* Count of value lists */ - Tcl_Obj *bodyPtr; - - /* - * We copy the argument object pointers into a local array to avoid - * the problem that "objv" might become invalid. It is a pointer into - * the evaluation stack and that stack might be grown and reallocated - * if the loop body requires a large amount of stack space. - */ - -#define NUM_ARGS 9 - Tcl_Obj *(argObjStorage[NUM_ARGS]); - Tcl_Obj **argObjv = argObjStorage; - -#define STATIC_LIST_SIZE 4 - int indexArray[STATIC_LIST_SIZE]; /* Array of value list indices */ - int varcListArray[STATIC_LIST_SIZE]; /* # loop variables per list */ - Tcl_Obj **varvListArray[STATIC_LIST_SIZE]; /* Array of var name lists */ - int argcListArray[STATIC_LIST_SIZE]; /* Array of value list sizes */ - Tcl_Obj **argvListArray[STATIC_LIST_SIZE]; /* Array of value lists */ - - int *index = indexArray; - int *varcList = varcListArray; - Tcl_Obj ***varvList = varvListArray; - int *argcList = argcListArray; - Tcl_Obj ***argvList = argvListArray; - - if (objc < 4 || (objc%2 != 0)) { - Tcl_WrongNumArgs(interp, 1, objv, - "varList list ?varList list ...? command"); - return TCL_ERROR; - } - - /* - * Create the object argument array "argObjv". Make sure argObjv is - * large enough to hold the objc arguments. - */ - - if (objc > NUM_ARGS) { - argObjv = (Tcl_Obj **) ckalloc(objc * sizeof(Tcl_Obj *)); - } - for (i = 0; i < objc; i++) { - argObjv[i] = objv[i]; - } - - /* - * Manage numList parallel value lists. - * argvList[i] is a value list counted by argcList[i] - * varvList[i] is the list of variables associated with the value list - * varcList[i] is the number of variables associated with the value list - * index[i] is the current pointer into the value list argvList[i] - */ - - numLists = (objc-2)/2; - if (numLists > STATIC_LIST_SIZE) { - index = (int *) ckalloc(numLists * sizeof(int)); - varcList = (int *) ckalloc(numLists * sizeof(int)); - varvList = (Tcl_Obj ***) ckalloc(numLists * sizeof(Tcl_Obj **)); - argcList = (int *) ckalloc(numLists * sizeof(int)); - argvList = (Tcl_Obj ***) ckalloc(numLists * sizeof(Tcl_Obj **)); - } - for (i = 0; i < numLists; i++) { - index[i] = 0; - varcList[i] = 0; - varvList[i] = (Tcl_Obj **) NULL; - argcList[i] = 0; - argvList[i] = (Tcl_Obj **) NULL; - } - - /* - * Break up the value lists and variable lists into elements - */ - - maxj = 0; - for (i = 0; i < numLists; i++) { - result = Tcl_ListObjGetElements(interp, argObjv[1+i*2], - &varcList[i], &varvList[i]); - if (result != TCL_OK) { - goto done; - } - if (varcList[i] < 1) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "foreach varlist is empty", -1); - result = TCL_ERROR; - goto done; - } - - result = Tcl_ListObjGetElements(interp, argObjv[2+i*2], - &argcList[i], &argvList[i]); - if (result != TCL_OK) { - goto done; - } - - j = argcList[i] / varcList[i]; - if ((argcList[i] % varcList[i]) != 0) { - j++; - } - if (j > maxj) { - maxj = j; - } - } - - /* - * Iterate maxj times through the lists in parallel - * If some value lists run out of values, set loop vars to "" - */ - - bodyPtr = argObjv[objc-1]; - for (j = 0; j < maxj; j++) { - for (i = 0; i < numLists; i++) { - /* - * If a variable or value list object has been converted to - * another kind of Tcl object, convert it back to a list object - * and refetch the pointer to its element array. - */ - - if (argObjv[1+i*2]->typePtr != &tclListType) { - result = Tcl_ListObjGetElements(interp, argObjv[1+i*2], - &varcList[i], &varvList[i]); - if (result != TCL_OK) { - panic("Tcl_ForeachObjCmd: could not reconvert variable list %d to a list object\n", i); - } - } - if (argObjv[2+i*2]->typePtr != &tclListType) { - result = Tcl_ListObjGetElements(interp, argObjv[2+i*2], - &argcList[i], &argvList[i]); - if (result != TCL_OK) { - panic("Tcl_ForeachObjCmd: could not reconvert value list %d to a list object\n", i); - } - } - - for (v = 0; v < varcList[i]; v++) { - int k = index[i]++; - Tcl_Obj *valuePtr, *varValuePtr; - int isEmptyObj = 0; - - if (k < argcList[i]) { - valuePtr = argvList[i][k]; - } else { - valuePtr = Tcl_NewObj(); /* empty string */ - isEmptyObj = 1; - } - varValuePtr = Tcl_ObjSetVar2(interp, varvList[i][v], - NULL, valuePtr, 0); - if (varValuePtr == NULL) { - if (isEmptyObj) { - Tcl_DecrRefCount(valuePtr); - } - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "couldn't set loop variable: \"", - Tcl_GetString(varvList[i][v]), "\"", (char *) NULL); - result = TCL_ERROR; - goto done; - } - - } - } - - result = Tcl_EvalObjEx(interp, bodyPtr, 0); - if (result != TCL_OK) { - if (result == TCL_CONTINUE) { - result = TCL_OK; - } else if (result == TCL_BREAK) { - result = TCL_OK; - break; - } else if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"foreach\" body line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); - break; - } else { - break; - } - } - } - if (result == TCL_OK) { - Tcl_ResetResult(interp); - } - - done: - if (numLists > STATIC_LIST_SIZE) { - ckfree((char *) index); - ckfree((char *) varcList); - ckfree((char *) argcList); - ckfree((char *) varvList); - ckfree((char *) argvList); - } - if (argObjv != argObjStorage) { - ckfree((char *) argObjv); - } - return result; -#undef STATIC_LIST_SIZE -#undef NUM_ARGS -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FormatObjCmd -- - * - * This procedure is invoked to process the "format" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_FormatObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *format; /* Used to read characters from the format - * string. */ - int formatLen; /* The length of the format string */ - char *endPtr; /* Points to the last char in format array */ - char newFormat[40]; /* A new format specifier is generated here. */ - int width; /* Field width from field specifier, or 0 if - * no width given. */ - int precision; /* Field precision from field specifier, or 0 - * if no precision given. */ - int size; /* Number of bytes needed for result of - * conversion, based on type of conversion - * ("e", "s", etc.), width, and precision. */ - int intValue; /* Used to hold value to pass to sprintf, if - * it's a one-word integer or char value */ - char *ptrValue = NULL; /* Used to hold value to pass to sprintf, if - * it's a one-word value. */ - double doubleValue; /* Used to hold value to pass to sprintf if - * it's a double value. */ - int whichValue; /* Indicates which of intValue, ptrValue, - * or doubleValue has the value to pass to - * sprintf, according to the following - * definitions: */ -# define INT_VALUE 0 -# define CHAR_VALUE 1 -# define PTR_VALUE 2 -# define DOUBLE_VALUE 3 -# define STRING_VALUE 4 -# define MAX_FLOAT_SIZE 320 - - Tcl_Obj *resultPtr; /* Where result is stored finally. */ - char staticBuf[MAX_FLOAT_SIZE + 1]; - /* A static buffer to copy the format results - * into */ - char *dst = staticBuf; /* The buffer that sprintf writes into each - * time the format processes a specifier */ - int dstSize = MAX_FLOAT_SIZE; - /* The size of the dst buffer */ - int noPercent; /* Special case for speed: indicates there's - * no field specifier, just a string to copy.*/ - int objIndex; /* Index of argument to substitute next. */ - int gotXpg = 0; /* Non-zero means that an XPG3 %n$-style - * specifier has been seen. */ - int gotSequential = 0; /* Non-zero means that a regular sequential - * (non-XPG3) conversion specifier has been - * seen. */ - int useShort; /* Value to be printed is short (half word). */ - char *end; /* Used to locate end of numerical fields. */ - int stringLen = 0; /* Length of string in characters rather - * than bytes. Used for %s substitution. */ - int gotMinus; /* Non-zero indicates that a minus flag has - * been seen in the current field. */ - int gotPrecision; /* Non-zero indicates that a precision has - * been set for the current field. */ - - /* - * This procedure is a bit nasty. The goal is to use sprintf to - * do most of the dirty work. There are several problems: - * 1. this procedure can't trust its arguments. - * 2. we must be able to provide a large enough result area to hold - * whatever's generated. This is hard to estimate. - * 3. there's no way to move the arguments from objv to the call - * to sprintf in a reasonable way. This is particularly nasty - * because some of the arguments may be two-word values (doubles). - * So, what happens here is to scan the format string one % group - * at a time, making many individual calls to sprintf. - */ - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg arg ...?"); - return TCL_ERROR; - } - - format = (char *) Tcl_GetStringFromObj(objv[1], &formatLen); - endPtr = format + formatLen; - resultPtr = Tcl_NewObj(); - objIndex = 2; - - while (format < endPtr) { - register char *newPtr = newFormat; - - width = precision = noPercent = useShort = 0; - gotMinus = gotPrecision = 0; - whichValue = PTR_VALUE; - - /* - * Get rid of any characters before the next field specifier. - */ - if (*format != '%') { - ptrValue = format; - while ((*format != '%') && (format < endPtr)) { - format++; - } - size = format - ptrValue; - noPercent = 1; - goto doField; - } - - if (format[1] == '%') { - ptrValue = format; - size = 1; - noPercent = 1; - format += 2; - goto doField; - } - - /* - * Parse off a field specifier, compute how many characters - * will be needed to store the result, and substitute for - * "*" size specifiers. - */ - *newPtr = '%'; - newPtr++; - format++; - if (isdigit(UCHAR(*format))) { /* INTL: Tcl source. */ - int tmp; - - /* - * Check for an XPG3-style %n$ specification. Note: there - * must not be a mixture of XPG3 specs and non-XPG3 specs - * in the same format string. - */ - - tmp = strtoul(format, &end, 10); /* INTL: "C" locale. */ - if (*end != '$') { - goto notXpg; - } - format = end+1; - gotXpg = 1; - if (gotSequential) { - goto mixedXPG; - } - objIndex = tmp+1; - if ((objIndex < 2) || (objIndex >= objc)) { - goto badIndex; - } - goto xpgCheckDone; - } - - notXpg: - gotSequential = 1; - if (gotXpg) { - goto mixedXPG; - } - - xpgCheckDone: - while ((*format == '-') || (*format == '#') || (*format == '0') - || (*format == ' ') || (*format == '+')) { - if (*format == '-') { - gotMinus = 1; - } - *newPtr = *format; - newPtr++; - format++; - } - if (isdigit(UCHAR(*format))) { /* INTL: Tcl source. */ - width = strtoul(format, &end, 10); /* INTL: Tcl source. */ - format = end; - } else if (*format == '*') { - if (objIndex >= objc) { - goto badIndex; - } - if (Tcl_GetIntFromObj(interp, /* INTL: Tcl source. */ - objv[objIndex], &width) != TCL_OK) { - goto fmtError; - } - if (width < 0) { - width = -width; - *newPtr = '-'; - gotMinus = 1; - newPtr++; - } - objIndex++; - format++; - } - if (width > 100000) { - /* - * Don't allow arbitrarily large widths: could cause core - * dump when we try to allocate a zillion bytes of memory - * below. - */ - - width = 100000; - } else if (width < 0) { - width = 0; - } - if (width != 0) { - TclFormatInt(newPtr, width); /* INTL: printf format. */ - while (*newPtr != 0) { - newPtr++; - } - } - if (*format == '.') { - *newPtr = '.'; - newPtr++; - format++; - gotPrecision = 1; - } - if (isdigit(UCHAR(*format))) { /* INTL: Tcl source. */ - precision = strtoul(format, &end, 10); /* INTL: "C" locale. */ - format = end; - } else if (*format == '*') { - if (objIndex >= objc) { - goto badIndex; - } - if (Tcl_GetIntFromObj(interp, /* INTL: Tcl source. */ - objv[objIndex], &precision) != TCL_OK) { - goto fmtError; - } - objIndex++; - format++; - } - if (gotPrecision) { - TclFormatInt(newPtr, precision); /* INTL: printf format. */ - while (*newPtr != 0) { - newPtr++; - } - } - if (*format == 'l') { - format++; - } else if (*format == 'h') { - useShort = 1; - *newPtr = 'h'; - newPtr++; - format++; - } - *newPtr = *format; - newPtr++; - *newPtr = 0; - if (objIndex >= objc) { - goto badIndex; - } - switch (*format) { - case 'i': - newPtr[-1] = 'd'; - case 'd': - case 'o': - case 'u': - case 'x': - case 'X': - if (Tcl_GetIntFromObj(interp, /* INTL: Tcl source. */ - objv[objIndex], &intValue) != TCL_OK) { - goto fmtError; - } - whichValue = INT_VALUE; - size = 40 + precision; - break; - case 's': - /* - * Compute the length of the string in characters and add - * any additional space required by the field width. All of - * the extra characters will be spaces, so one byte per - * character is adequate. - */ - - whichValue = STRING_VALUE; - ptrValue = Tcl_GetStringFromObj(objv[objIndex], &size); - stringLen = Tcl_NumUtfChars(ptrValue, size); - if (gotPrecision && (precision < stringLen)) { - stringLen = precision; - } - size = Tcl_UtfAtIndex(ptrValue, stringLen) - ptrValue; - if (width > stringLen) { - size += (width - stringLen); - } - break; - case 'c': - if (Tcl_GetIntFromObj(interp, /* INTL: Tcl source. */ - objv[objIndex], &intValue) != TCL_OK) { - goto fmtError; - } - whichValue = CHAR_VALUE; - size = width + TCL_UTF_MAX; - break; - case 'e': - case 'E': - case 'f': - case 'g': - case 'G': - if (Tcl_GetDoubleFromObj(interp, /* INTL: Tcl source. */ - objv[objIndex], &doubleValue) != TCL_OK) { - goto fmtError; - } - whichValue = DOUBLE_VALUE; - size = MAX_FLOAT_SIZE; - if (precision > 10) { - size += precision; - } - break; - case 0: - Tcl_SetResult(interp, - "format string ended in middle of field specifier", - TCL_STATIC); - goto fmtError; - default: { - char buf[40]; - sprintf(buf, "bad field specifier \"%c\"", *format); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - goto fmtError; - } - } - objIndex++; - format++; - - /* - * Make sure that there's enough space to hold the formatted - * result, then format it. - */ - - doField: - if (width > size) { - size = width; - } - if (noPercent) { - Tcl_AppendToObj(resultPtr, ptrValue, size); - } else { - if (size > dstSize) { - if (dst != staticBuf) { - ckfree(dst); - } - dst = (char *) ckalloc((unsigned) (size + 1)); - dstSize = size; - } - switch (whichValue) { - case DOUBLE_VALUE: { - sprintf(dst, newFormat, doubleValue); /* INTL: user locale. */ - break; - } - case INT_VALUE: { - if (useShort) { - sprintf(dst, newFormat, (short) intValue); - } else { - sprintf(dst, newFormat, intValue); - } - break; - } - case CHAR_VALUE: { - char *ptr; - ptr = dst; - if (!gotMinus) { - for ( ; --width > 0; ptr++) { - *ptr = ' '; - } - } - ptr += Tcl_UniCharToUtf(intValue, ptr); - for ( ; --width > 0; ptr++) { - *ptr = ' '; - } - *ptr = '\0'; - break; - } - case STRING_VALUE: { - char *ptr; - int pad; - - ptr = dst; - if (width > stringLen) { - pad = width - stringLen; - } else { - pad = 0; - } - - if (!gotMinus) { - while (pad > 0) { - *ptr++ = ' '; - pad--; - } - } - - size = Tcl_UtfAtIndex(ptrValue, stringLen) - ptrValue; - if (size) { - memcpy(ptr, ptrValue, (size_t) size); - ptr += size; - } - while (pad > 0) { - *ptr++ = ' '; - pad--; - } - *ptr = '\0'; - break; - } - default: { - sprintf(dst, newFormat, ptrValue); - break; - } - } - Tcl_AppendToObj(resultPtr, dst, -1); - } - } - - Tcl_SetObjResult(interp, resultPtr); - if(dst != staticBuf) { - ckfree(dst); - } - return TCL_OK; - - mixedXPG: - Tcl_SetResult(interp, - "cannot mix \"%\" and \"%n$\" conversion specifiers", TCL_STATIC); - goto fmtError; - - badIndex: - if (gotXpg) { - Tcl_SetResult(interp, - "\"%n$\" argument index out of range", TCL_STATIC); - } else { - Tcl_SetResult(interp, - "not enough arguments for all format specifiers", TCL_STATIC); - } - - fmtError: - if(dst != staticBuf) { - ckfree(dst); - } - Tcl_DecrRefCount(resultPtr); - return TCL_ERROR; -} - -/* - *--------------------------------------------------------------------------- - * - * StringifyObjects -- - * - * Helper function to bridge the gap between an object-based procedure - * and an older string-based procedure. - * - * Given an array of objects, allocate an array that consists of the - * string representations of those objects. - * - * Results: - * The return value is a pointer to the newly allocated array of - * strings. Elements 0 to (objc-1) of the string array point to the - * string representation of the corresponding element in the source - * object array; element objc of the string array is NULL. - * - * Side effects: - * Memory allocated. The caller must eventually free this memory - * by calling ckfree() on the return value. - * - *--------------------------------------------------------------------------- - */ - -static char ** -StringifyObjects(objc, objv) - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int i; - char **argv; - - argv = (char **) ckalloc((objc + 1) * sizeof(char *)); - for (i = 0; i < objc; i++) { - argv[i] = Tcl_GetString(objv[i]); - } - argv[i] = NULL; - return argv; -} diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c deleted file mode 100644 index 6db0c53..0000000 --- a/generic/tclCmdIL.c +++ /dev/null @@ -1,2991 +0,0 @@ -/* - * tclCmdIL.c -- - * - * This file contains the top-level command routines for most of - * the Tcl built-in commands whose names begin with the letters - * I through L. It contains only commands in the generic core - * (i.e. those that don't depend much upon UNIX facilities). - * - * Copyright (c) 1987-1993 The Regents of the University of California. - * Copyright (c) 1993-1997 Lucent Technologies. - * Copyright (c) 1994-1997 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. - * - * RCS: @(#) $Id: tclCmdIL.c,v 1.12 1999/04/16 00:46:43 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclCompile.h" -#include "tclRegexp.h" - -/* - * During execution of the "lsort" command, structures of the following - * type are used to arrange the objects being sorted into a collection - * of linked lists. - */ - -typedef struct SortElement { - Tcl_Obj *objPtr; /* Object being sorted. */ - struct SortElement *nextPtr; /* Next element in the list, or - * NULL for end of list. */ -} SortElement; - -/* - * The "lsort" command needs to pass certain information down to the - * function that compares two list elements, and the comparison function - * needs to pass success or failure information back up to the top-level - * "lsort" command. The following structure is used to pass this - * information. - */ - -typedef struct SortInfo { - int isIncreasing; /* Nonzero means sort in increasing order. */ - int sortMode; /* The sort mode. One of SORTMODE_* - * values defined below */ - Tcl_Obj *compareCmdPtr; /* The Tcl comparison command when sortMode - * is SORTMODE_COMMAND. Pre-initialized to - * hold base of command.*/ - int index; /* If the -index option was specified, this - * holds the index of the list element - * to extract for comparison. If -index - * wasn't specified, this is -1. */ - Tcl_Interp *interp; /* The interpreter in which the sortis - * being done. */ - int resultCode; /* Completion code for the lsort command. - * If an error occurs during the sort this - * is changed from TCL_OK to TCL_ERROR. */ -} SortInfo; - -/* - * The "sortMode" field of the SortInfo structure can take on any of the - * following values. - */ - -#define SORTMODE_ASCII 0 -#define SORTMODE_INTEGER 1 -#define SORTMODE_REAL 2 -#define SORTMODE_COMMAND 3 -#define SORTMODE_DICTIONARY 4 - -/* - * Forward declarations for procedures defined in this file: - */ - -static void AppendLocals _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *listPtr, char *pattern, - int includeLinks)); -static int DictionaryCompare _ANSI_ARGS_((char *left, - char *right)); -static int InfoArgsCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoBodyCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoCmdCountCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoCommandsCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoCompleteCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoDefaultCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoExistsCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoGlobalsCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoHostnameCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoLevelCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoLibraryCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoLoadedCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoLocalsCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoNameOfExecutableCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoPatchLevelCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoProcsCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoScriptCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoSharedlibCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoTclVersionCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int InfoVarsCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static SortElement * MergeSort _ANSI_ARGS_((SortElement *headPt, - SortInfo *infoPtr)); -static SortElement * MergeLists _ANSI_ARGS_((SortElement *leftPtr, - SortElement *rightPtr, SortInfo *infoPtr)); -static int SortCompare _ANSI_ARGS_((Tcl_Obj *firstPtr, - Tcl_Obj *second, SortInfo *infoPtr)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_IfObjCmd -- - * - * This procedure is invoked to process the "if" Tcl command. - * See the user documentation for details on what it does. - * - * With the bytecode compiler, this procedure is only called when - * a command name is computed at runtime, and is "if" or the name - * to which "if" was renamed: e.g., "set z if; $z 1 {puts foo}" - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_IfObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int thenScriptIndex = 0; /* then script to be evaled after syntax check */ - int i, result, value; - char *clause; - i = 1; - while (1) { - /* - * At this point in the loop, objv and objc refer to an expression - * to test, either for the main expression or an expression - * following an "elseif". The arguments after the expression must - * be "then" (optional) and a script to execute if the expression is - * true. - */ - - if (i >= objc) { - clause = Tcl_GetString(objv[i-1]); - Tcl_AppendResult(interp, "wrong # args: no expression after \"", - clause, "\" argument", (char *) NULL); - return TCL_ERROR; - } - if (!thenScriptIndex) { - result = Tcl_ExprBooleanObj(interp, objv[i], &value); - if (result != TCL_OK) { - return result; - } - } - i++; - if (i >= objc) { - missingScript: - clause = Tcl_GetString(objv[i-1]); - Tcl_AppendResult(interp, "wrong # args: no script following \"", - clause, "\" argument", (char *) NULL); - return TCL_ERROR; - } - clause = Tcl_GetString(objv[i]); - if ((i < objc) && (strcmp(clause, "then") == 0)) { - i++; - } - if (i >= objc) { - goto missingScript; - } - if (value) { - thenScriptIndex = i; - value = 0; - } - - /* - * The expression evaluated to false. Skip the command, then - * see if there is an "else" or "elseif" clause. - */ - - i++; - if (i >= objc) { - if (thenScriptIndex) { - return Tcl_EvalObjEx(interp, objv[thenScriptIndex], 0); - } - return TCL_OK; - } - clause = Tcl_GetString(objv[i]); - if ((clause[0] == 'e') && (strcmp(clause, "elseif") == 0)) { - i++; - continue; - } - break; - } - - /* - * Couldn't find a "then" or "elseif" clause to execute. Check now - * for an "else" clause. We know that there's at least one more - * argument when we get here. - */ - - if (strcmp(clause, "else") == 0) { - i++; - if (i >= objc) { - Tcl_AppendResult(interp, - "wrong # args: no script following \"else\" argument", - (char *) NULL); - return TCL_ERROR; - } - } - if (i < objc - 1) { - Tcl_AppendResult(interp, - "wrong # args: extra words after \"else\" clause in \"if\" command", - (char *) NULL); - return TCL_ERROR; - } - if (thenScriptIndex) { - return Tcl_EvalObjEx(interp, objv[thenScriptIndex], 0); - } - return Tcl_EvalObjEx(interp, objv[i], 0); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_IncrObjCmd -- - * - * This procedure is invoked to process the "incr" Tcl command. - * See the user documentation for details on what it does. - * - * With the bytecode compiler, this procedure is only called when - * a command name is computed at runtime, and is "incr" or the name - * to which "incr" was renamed: e.g., "set z incr; $z i -1" - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_IncrObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - long incrAmount; - Tcl_Obj *newValuePtr; - - if ((objc != 2) && (objc != 3)) { - Tcl_WrongNumArgs(interp, 1, objv, "varName ?increment?"); - return TCL_ERROR; - } - - /* - * Calculate the amount to increment by. - */ - - if (objc == 2) { - incrAmount = 1; - } else { - if (Tcl_GetLongFromObj(interp, objv[2], &incrAmount) != TCL_OK) { - Tcl_AddErrorInfo(interp, "\n (reading increment)"); - return TCL_ERROR; - } - } - - /* - * Increment the variable's value. - */ - - newValuePtr = TclIncrVar2(interp, objv[1], (Tcl_Obj *) NULL, incrAmount, - TCL_LEAVE_ERR_MSG); - if (newValuePtr == NULL) { - return TCL_ERROR; - } - - /* - * Set the interpreter's object result to refer to the variable's new - * value object. - */ - - Tcl_SetObjResult(interp, newValuePtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InfoObjCmd -- - * - * This procedure is invoked to process the "info" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_InfoObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Arbitrary value passed to the command. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - static char *subCmds[] = { - "args", "body", "cmdcount", "commands", - "complete", "default", "exists", "globals", - "hostname", "level", "library", "loaded", - "locals", "nameofexecutable", "patchlevel", "procs", - "script", "sharedlibextension", "tclversion", "vars", - (char *) NULL}; - enum ISubCmdIdx { - IArgsIdx, IBodyIdx, ICmdCountIdx, ICommandsIdx, - ICompleteIdx, IDefaultIdx, IExistsIdx, IGlobalsIdx, - IHostnameIdx, ILevelIdx, ILibraryIdx, ILoadedIdx, - ILocalsIdx, INameOfExecutableIdx, IPatchLevelIdx, IProcsIdx, - IScriptIdx, ISharedLibExtensionIdx, ITclVersionIdx, IVarsIdx - }; - int index, result; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); - return TCL_ERROR; - } - - result = Tcl_GetIndexFromObj(interp, objv[1], subCmds, "option", 0, - (int *) &index); - if (result != TCL_OK) { - return result; - } - - switch (index) { - case IArgsIdx: - result = InfoArgsCmd(clientData, interp, objc, objv); - break; - case IBodyIdx: - result = InfoBodyCmd(clientData, interp, objc, objv); - break; - case ICmdCountIdx: - result = InfoCmdCountCmd(clientData, interp, objc, objv); - break; - case ICommandsIdx: - result = InfoCommandsCmd(clientData, interp, objc, objv); - break; - case ICompleteIdx: - result = InfoCompleteCmd(clientData, interp, objc, objv); - break; - case IDefaultIdx: - result = InfoDefaultCmd(clientData, interp, objc, objv); - break; - case IExistsIdx: - result = InfoExistsCmd(clientData, interp, objc, objv); - break; - case IGlobalsIdx: - result = InfoGlobalsCmd(clientData, interp, objc, objv); - break; - case IHostnameIdx: - result = InfoHostnameCmd(clientData, interp, objc, objv); - break; - case ILevelIdx: - result = InfoLevelCmd(clientData, interp, objc, objv); - break; - case ILibraryIdx: - result = InfoLibraryCmd(clientData, interp, objc, objv); - break; - case ILoadedIdx: - result = InfoLoadedCmd(clientData, interp, objc, objv); - break; - case ILocalsIdx: - result = InfoLocalsCmd(clientData, interp, objc, objv); - break; - case INameOfExecutableIdx: - result = InfoNameOfExecutableCmd(clientData, interp, objc, objv); - break; - case IPatchLevelIdx: - result = InfoPatchLevelCmd(clientData, interp, objc, objv); - break; - case IProcsIdx: - result = InfoProcsCmd(clientData, interp, objc, objv); - break; - case IScriptIdx: - result = InfoScriptCmd(clientData, interp, objc, objv); - break; - case ISharedLibExtensionIdx: - result = InfoSharedlibCmd(clientData, interp, objc, objv); - break; - case ITclVersionIdx: - result = InfoTclVersionCmd(clientData, interp, objc, objv); - break; - case IVarsIdx: - result = InfoVarsCmd(clientData, interp, objc, objv); - break; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * InfoArgsCmd -- - * - * Called to implement the "info args" command that returns the - * argument list for a procedure. Handles the following syntax: - * - * info args procName - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoArgsCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Interp *iPtr = (Interp *) interp; - char *name; - Proc *procPtr; - CompiledLocal *localPtr; - Tcl_Obj *listObjPtr; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "procname"); - return TCL_ERROR; - } - - name = Tcl_GetString(objv[2]); - procPtr = TclFindProc(iPtr, name); - if (procPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "\"", name, "\" isn't a procedure", (char *) NULL); - return TCL_ERROR; - } - - /* - * Build a return list containing the arguments. - */ - - listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - for (localPtr = procPtr->firstLocalPtr; localPtr != NULL; - localPtr = localPtr->nextPtr) { - if (TclIsVarArgument(localPtr)) { - Tcl_ListObjAppendElement(interp, listObjPtr, - Tcl_NewStringObj(localPtr->name, -1)); - } - } - Tcl_SetObjResult(interp, listObjPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoBodyCmd -- - * - * Called to implement the "info body" command that returns the body - * for a procedure. Handles the following syntax: - * - * info body procName - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoBodyCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Interp *iPtr = (Interp *) interp; - char *name; - Proc *procPtr; - Tcl_Obj *bodyPtr, *resultPtr; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "procname"); - return TCL_ERROR; - } - - name = Tcl_GetString(objv[2]); - procPtr = TclFindProc(iPtr, name); - if (procPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "\"", name, "\" isn't a procedure", (char *) NULL); - return TCL_ERROR; - } - - /* - * we need to check if the body from this procedure had been generated - * from a precompiled body. If that is the case, then the bodyPtr's - * string representation is bogus, since sources are not available. - * In order to make sure that later manipulations of the object do not - * invalidate the internal representation, we make a copy of the string - * representation and return that one, instead. - */ - - bodyPtr = procPtr->bodyPtr; - resultPtr = bodyPtr; - if (bodyPtr->typePtr == &tclByteCodeType) { - ByteCode *codePtr = (ByteCode *) bodyPtr->internalRep.otherValuePtr; - - if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) { - resultPtr = Tcl_NewStringObj(bodyPtr->bytes, bodyPtr->length); - } - } - - Tcl_SetObjResult(interp, resultPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoCmdCountCmd -- - * - * Called to implement the "info cmdcount" command that returns the - * number of commands that have been executed. Handles the following - * syntax: - * - * info cmdcount - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoCmdCountCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - - Tcl_SetIntObj(Tcl_GetObjResult(interp), iPtr->cmdCount); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoCommandsCmd -- - * - * Called to implement the "info commands" command that returns the - * list of commands in the interpreter that match an optional pattern. - * The pattern, if any, consists of an optional sequence of namespace - * names separated by "::" qualifiers, which is followed by a - * glob-style pattern that restricts which commands are returned. - * Handles the following syntax: - * - * info commands ?pattern? - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoCommandsCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *cmdName, *pattern, *simplePattern; - register Tcl_HashEntry *entryPtr; - Tcl_HashSearch search; - Namespace *nsPtr; - Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); - Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - Tcl_Obj *listPtr, *elemObjPtr; - int specificNsInPattern = 0; /* Init. to avoid compiler warning. */ - Tcl_Command cmd; - - /* - * Get the pattern and find the "effective namespace" in which to - * list commands. - */ - - if (objc == 2) { - simplePattern = NULL; - nsPtr = currNsPtr; - specificNsInPattern = 0; - } else if (objc == 3) { - /* - * From the pattern, get the effective namespace and the simple - * pattern (no namespace qualifiers or ::'s) at the end. If an - * error was found while parsing the pattern, return it. Otherwise, - * if the namespace wasn't found, just leave nsPtr NULL: we will - * return an empty list since no commands there can be found. - */ - - Namespace *dummy1NsPtr, *dummy2NsPtr; - - - pattern = Tcl_GetString(objv[2]); - TclGetNamespaceForQualName(interp, pattern, (Namespace *) NULL, - /*flags*/ 0, &nsPtr, &dummy1NsPtr, &dummy2NsPtr, &simplePattern); - - if (nsPtr != NULL) { /* we successfully found the pattern's ns */ - specificNsInPattern = (strcmp(simplePattern, pattern) != 0); - } - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?pattern?"); - return TCL_ERROR; - } - - /* - * Scan through the effective namespace's command table and create a - * list with all commands that match the pattern. If a specific - * namespace was requested in the pattern, qualify the command names - * with the namespace name. - */ - - listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - - if (nsPtr != NULL) { - entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search); - while (entryPtr != NULL) { - cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr); - if ((simplePattern == NULL) - || Tcl_StringMatch(cmdName, simplePattern)) { - if (specificNsInPattern) { - cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr); - elemObjPtr = Tcl_NewObj(); - Tcl_GetCommandFullName(interp, cmd, elemObjPtr); - } else { - elemObjPtr = Tcl_NewStringObj(cmdName, -1); - } - Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr); - } - entryPtr = Tcl_NextHashEntry(&search); - } - - /* - * If the effective namespace isn't the global :: namespace, and a - * specific namespace wasn't requested in the pattern, then add in - * all global :: commands that match the simple pattern. Of course, - * we add in only those commands that aren't hidden by a command in - * the effective namespace. - */ - - if ((nsPtr != globalNsPtr) && !specificNsInPattern) { - entryPtr = Tcl_FirstHashEntry(&globalNsPtr->cmdTable, &search); - while (entryPtr != NULL) { - cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr); - if ((simplePattern == NULL) - || Tcl_StringMatch(cmdName, simplePattern)) { - if (Tcl_FindHashEntry(&nsPtr->cmdTable, cmdName) == NULL) { - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(cmdName, -1)); - } - } - entryPtr = Tcl_NextHashEntry(&search); - } - } - } - - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoCompleteCmd -- - * - * Called to implement the "info complete" command that determines - * whether a string is a complete Tcl command. Handles the following - * syntax: - * - * info complete command - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoCompleteCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "command"); - return TCL_ERROR; - } - - if (TclObjCommandComplete(objv[2])) { - Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); - } else { - Tcl_SetIntObj(Tcl_GetObjResult(interp), 0); - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoDefaultCmd -- - * - * Called to implement the "info default" command that returns the - * default value for a procedure argument. Handles the following - * syntax: - * - * info default procName arg varName - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoDefaultCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - char *procName, *argName, *varName; - Proc *procPtr; - CompiledLocal *localPtr; - Tcl_Obj *valueObjPtr; - - if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "procname arg varname"); - return TCL_ERROR; - } - - procName = Tcl_GetString(objv[2]); - argName = Tcl_GetString(objv[3]); - - procPtr = TclFindProc(iPtr, procName); - if (procPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "\"", procName, "\" isn't a procedure", (char *) NULL); - return TCL_ERROR; - } - - for (localPtr = procPtr->firstLocalPtr; localPtr != NULL; - localPtr = localPtr->nextPtr) { - if (TclIsVarArgument(localPtr) - && (strcmp(argName, localPtr->name) == 0)) { - if (localPtr->defValuePtr != NULL) { - valueObjPtr = Tcl_ObjSetVar2(interp, objv[4], NULL, - localPtr->defValuePtr, 0); - if (valueObjPtr == NULL) { - defStoreError: - varName = Tcl_GetString(objv[4]); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "couldn't store default value in variable \"", - varName, "\"", (char *) NULL); - return TCL_ERROR; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); - } else { - Tcl_Obj *nullObjPtr = Tcl_NewObj(); - valueObjPtr = Tcl_ObjSetVar2(interp, objv[4], NULL, - nullObjPtr, 0); - if (valueObjPtr == NULL) { - Tcl_DecrRefCount(nullObjPtr); /* free unneeded obj */ - goto defStoreError; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), 0); - } - return TCL_OK; - } - } - - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "procedure \"", procName, "\" doesn't have an argument \"", - argName, "\"", (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * InfoExistsCmd -- - * - * Called to implement the "info exists" command that determines - * whether a variable exists. Handles the following syntax: - * - * info exists varName - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoExistsCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *varName; - Var *varPtr, *arrayPtr; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "varName"); - return TCL_ERROR; - } - - varName = Tcl_GetString(objv[2]); - varPtr = TclLookupVar(interp, varName, (char *) NULL, - 0, "access", - /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - if ((varPtr != NULL) && !TclIsVarUndefined(varPtr)) { - Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); - } else { - Tcl_SetIntObj(Tcl_GetObjResult(interp), 0); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoGlobalsCmd -- - * - * Called to implement the "info globals" command that returns the list - * of global variables matching an optional pattern. Handles the - * following syntax: - * - * info globals ?pattern? - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoGlobalsCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *varName, *pattern; - Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); - register Tcl_HashEntry *entryPtr; - Tcl_HashSearch search; - Var *varPtr; - Tcl_Obj *listPtr; - - if (objc == 2) { - pattern = NULL; - } else if (objc == 3) { - pattern = Tcl_GetString(objv[2]); - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?pattern?"); - return TCL_ERROR; - } - - /* - * Scan through the global :: namespace's variable table and create a - * list of all global variables that match the pattern. - */ - - listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - for (entryPtr = Tcl_FirstHashEntry(&globalNsPtr->varTable, &search); - entryPtr != NULL; - entryPtr = Tcl_NextHashEntry(&search)) { - varPtr = (Var *) Tcl_GetHashValue(entryPtr); - if (TclIsVarUndefined(varPtr)) { - continue; - } - varName = Tcl_GetHashKey(&globalNsPtr->varTable, entryPtr); - if ((pattern == NULL) || Tcl_StringMatch(varName, pattern)) { - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(varName, -1)); - } - } - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoHostnameCmd -- - * - * Called to implement the "info hostname" command that returns the - * host name. Handles the following syntax: - * - * info hostname - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoHostnameCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *name; - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - - name = Tcl_GetHostName(); - if (name) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), name, -1); - return TCL_OK; - } else { - Tcl_SetStringObj(Tcl_GetObjResult(interp), - "unable to determine name of host", -1); - return TCL_ERROR; - } -} - -/* - *---------------------------------------------------------------------- - * - * InfoLevelCmd -- - * - * Called to implement the "info level" command that returns - * information about the call stack. Handles the following syntax: - * - * info level ?number? - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoLevelCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - int level; - CallFrame *framePtr; - Tcl_Obj *listPtr; - - if (objc == 2) { /* just "info level" */ - if (iPtr->varFramePtr == NULL) { - Tcl_SetIntObj(Tcl_GetObjResult(interp), 0); - } else { - Tcl_SetIntObj(Tcl_GetObjResult(interp), iPtr->varFramePtr->level); - } - return TCL_OK; - } else if (objc == 3) { - if (Tcl_GetIntFromObj(interp, objv[2], &level) != TCL_OK) { - return TCL_ERROR; - } - if (level <= 0) { - if (iPtr->varFramePtr == NULL) { - levelError: - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad level \"", - Tcl_GetString(objv[2]), - "\"", (char *) NULL); - return TCL_ERROR; - } - level += iPtr->varFramePtr->level; - } - for (framePtr = iPtr->varFramePtr; framePtr != NULL; - framePtr = framePtr->callerVarPtr) { - if (framePtr->level == level) { - break; - } - } - if (framePtr == NULL) { - goto levelError; - } - - listPtr = Tcl_NewListObj(framePtr->objc, framePtr->objv); - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; - } - - Tcl_WrongNumArgs(interp, 2, objv, "?number?"); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * InfoLibraryCmd -- - * - * Called to implement the "info library" command that returns the - * library directory for the Tcl installation. Handles the following - * syntax: - * - * info library - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoLibraryCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *libDirName; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - - libDirName = Tcl_GetVar(interp, "tcl_library", TCL_GLOBAL_ONLY); - if (libDirName != NULL) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), libDirName, -1); - return TCL_OK; - } - Tcl_SetStringObj(Tcl_GetObjResult(interp), - "no library has been specified for Tcl", -1); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * InfoLoadedCmd -- - * - * Called to implement the "info loaded" command that returns the - * packages that have been loaded into an interpreter. Handles the - * following syntax: - * - * info loaded ?interp? - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoLoadedCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *interpName; - int result; - - if ((objc != 2) && (objc != 3)) { - Tcl_WrongNumArgs(interp, 2, objv, "?interp?"); - return TCL_ERROR; - } - - if (objc == 2) { /* get loaded pkgs in all interpreters */ - interpName = NULL; - } else { /* get pkgs just in specified interp */ - interpName = Tcl_GetString(objv[2]); - } - result = TclGetLoadedPackages(interp, interpName); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * InfoLocalsCmd -- - * - * Called to implement the "info locals" command to return a list of - * local variables that match an optional pattern. Handles the - * following syntax: - * - * info locals ?pattern? - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoLocalsCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - char *pattern; - Tcl_Obj *listPtr; - - if (objc == 2) { - pattern = NULL; - } else if (objc == 3) { - pattern = Tcl_GetString(objv[2]); - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?pattern?"); - return TCL_ERROR; - } - - if (iPtr->varFramePtr == NULL || !iPtr->varFramePtr->isProcCallFrame) { - return TCL_OK; - } - - /* - * Return a list containing names of first the compiled locals (i.e. the - * ones stored in the call frame), then the variables in the local hash - * table (if one exists). - */ - - listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - AppendLocals(interp, listPtr, pattern, 0); - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * AppendLocals -- - * - * Append the local variables for the current frame to the - * specified list object. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -AppendLocals(interp, listPtr, pattern, includeLinks) - Tcl_Interp *interp; /* Current interpreter. */ - Tcl_Obj *listPtr; /* List object to append names to. */ - char *pattern; /* Pattern to match against. */ - int includeLinks; /* 1 if upvars should be included, else 0. */ -{ - Interp *iPtr = (Interp *) interp; - CompiledLocal *localPtr; - Var *varPtr; - int i, localVarCt; - char *varName; - Tcl_HashTable *localVarTablePtr; - register Tcl_HashEntry *entryPtr; - Tcl_HashSearch search; - - localPtr = iPtr->varFramePtr->procPtr->firstLocalPtr; - localVarCt = iPtr->varFramePtr->numCompiledLocals; - varPtr = iPtr->varFramePtr->compiledLocals; - localVarTablePtr = iPtr->varFramePtr->varTablePtr; - - for (i = 0; i < localVarCt; i++) { - /* - * Skip nameless (temporary) variables and undefined variables - */ - - if (!TclIsVarTemporary(localPtr) && !TclIsVarUndefined(varPtr)) { - varName = varPtr->name; - if ((pattern == NULL) || Tcl_StringMatch(varName, pattern)) { - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(varName, -1)); - } - } - varPtr++; - localPtr = localPtr->nextPtr; - } - - if (localVarTablePtr != NULL) { - for (entryPtr = Tcl_FirstHashEntry(localVarTablePtr, &search); - entryPtr != NULL; - entryPtr = Tcl_NextHashEntry(&search)) { - varPtr = (Var *) Tcl_GetHashValue(entryPtr); - if (!TclIsVarUndefined(varPtr) - && (includeLinks || !TclIsVarLink(varPtr))) { - varName = Tcl_GetHashKey(localVarTablePtr, entryPtr); - if ((pattern == NULL) - || Tcl_StringMatch(varName, pattern)) { - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(varName, -1)); - } - } - } - } -} - -/* - *---------------------------------------------------------------------- - * - * InfoNameOfExecutableCmd -- - * - * Called to implement the "info nameofexecutable" command that returns - * the name of the binary file running this application. Handles the - * following syntax: - * - * info nameofexecutable - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoNameOfExecutableCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - CONST char *nameOfExecutable; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - - nameOfExecutable = Tcl_GetNameOfExecutable(); - - if (nameOfExecutable != NULL) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), (char *)nameOfExecutable, -1); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoPatchLevelCmd -- - * - * Called to implement the "info patchlevel" command that returns the - * default value for an argument to a procedure. Handles the following - * syntax: - * - * info patchlevel - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoPatchLevelCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *patchlevel; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - - patchlevel = Tcl_GetVar(interp, "tcl_patchLevel", - (TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); - if (patchlevel != NULL) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), patchlevel, -1); - return TCL_OK; - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * InfoProcsCmd -- - * - * Called to implement the "info procs" command that returns the - * procedures in the current namespace that match an optional pattern. - * Handles the following syntax: - * - * info procs ?pattern? - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoProcsCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *cmdName, *pattern; - Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - register Tcl_HashEntry *entryPtr; - Tcl_HashSearch search; - Command *cmdPtr, *realCmdPtr; - Tcl_Obj *listPtr; - - if (objc == 2) { - pattern = NULL; - } else if (objc == 3) { - pattern = Tcl_GetString(objv[2]); - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?pattern?"); - return TCL_ERROR; - } - - /* - * Scan through the current namespace's command table and return a list - * of all procs that match the pattern. - */ - - listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - for (entryPtr = Tcl_FirstHashEntry(&currNsPtr->cmdTable, &search); - entryPtr != NULL; - entryPtr = Tcl_NextHashEntry(&search)) { - cmdName = Tcl_GetHashKey(&currNsPtr->cmdTable, entryPtr); - cmdPtr = (Command *) Tcl_GetHashValue(entryPtr); - - /* - * If the command isn't itself a proc, it still might be an - * imported command that points to a "real" proc in a different - * namespace. - */ - - realCmdPtr = (Command *) TclGetOriginalCommand( - (Tcl_Command) cmdPtr); - if (TclIsProc(cmdPtr) - || ((realCmdPtr != NULL) && TclIsProc(realCmdPtr))) { - if ((pattern == NULL) || Tcl_StringMatch(cmdName, pattern)) { - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(cmdName, -1)); - } - } - } - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoScriptCmd -- - * - * Called to implement the "info script" command that returns the - * script file that is currently being evaluated. Handles the - * following syntax: - * - * info script - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoScriptCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - - if (iPtr->scriptFile != NULL) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), iPtr->scriptFile, -1); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoSharedlibCmd -- - * - * Called to implement the "info sharedlibextension" command that - * returns the file extension used for shared libraries. Handles the - * following syntax: - * - * info sharedlibextension - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoSharedlibCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - -#ifdef TCL_SHLIB_EXT - Tcl_SetStringObj(Tcl_GetObjResult(interp), TCL_SHLIB_EXT, -1); -#endif - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * InfoTclVersionCmd -- - * - * Called to implement the "info tclversion" command that returns the - * version number for this Tcl library. Handles the following syntax: - * - * info tclversion - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoTclVersionCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *version; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - - version = Tcl_GetVar(interp, "tcl_version", - (TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); - if (version != NULL) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), version, -1); - return TCL_OK; - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * InfoVarsCmd -- - * - * Called to implement the "info vars" command that returns the - * list of variables in the interpreter that match an optional pattern. - * The pattern, if any, consists of an optional sequence of namespace - * names separated by "::" qualifiers, which is followed by a - * glob-style pattern that restricts which variables are returned. - * Handles the following syntax: - * - * info vars ?pattern? - * - * Results: - * Returns TCL_OK is successful and TCL_ERROR is there is an error. - * - * Side effects: - * Returns a result in the interpreter's result object. If there is - * an error, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InfoVarsCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - char *varName, *pattern, *simplePattern; - register Tcl_HashEntry *entryPtr; - Tcl_HashSearch search; - Var *varPtr; - Namespace *nsPtr; - Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); - Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - Tcl_Obj *listPtr, *elemObjPtr; - int specificNsInPattern = 0; /* Init. to avoid compiler warning. */ - - /* - * Get the pattern and find the "effective namespace" in which to - * list variables. We only use this effective namespace if there's - * no active Tcl procedure frame. - */ - - if (objc == 2) { - simplePattern = NULL; - nsPtr = currNsPtr; - specificNsInPattern = 0; - } else if (objc == 3) { - /* - * From the pattern, get the effective namespace and the simple - * pattern (no namespace qualifiers or ::'s) at the end. If an - * error was found while parsing the pattern, return it. Otherwise, - * if the namespace wasn't found, just leave nsPtr NULL: we will - * return an empty list since no variables there can be found. - */ - - Namespace *dummy1NsPtr, *dummy2NsPtr; - - pattern = Tcl_GetString(objv[2]); - TclGetNamespaceForQualName(interp, pattern, (Namespace *) NULL, - /*flags*/ 0, &nsPtr, &dummy1NsPtr, &dummy2NsPtr, - &simplePattern); - - if (nsPtr != NULL) { /* we successfully found the pattern's ns */ - specificNsInPattern = (strcmp(simplePattern, pattern) != 0); - } - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?pattern?"); - return TCL_ERROR; - } - - /* - * If the namespace specified in the pattern wasn't found, just return. - */ - - if (nsPtr == NULL) { - return TCL_OK; - } - - listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - - if ((iPtr->varFramePtr == NULL) - || !iPtr->varFramePtr->isProcCallFrame - || specificNsInPattern) { - /* - * There is no frame pointer, the frame pointer was pushed only - * to activate a namespace, or we are in a procedure call frame - * but a specific namespace was specified. Create a list containing - * only the variables in the effective namespace's variable table. - */ - - entryPtr = Tcl_FirstHashEntry(&nsPtr->varTable, &search); - while (entryPtr != NULL) { - varPtr = (Var *) Tcl_GetHashValue(entryPtr); - if (!TclIsVarUndefined(varPtr) - || (varPtr->flags & VAR_NAMESPACE_VAR)) { - varName = Tcl_GetHashKey(&nsPtr->varTable, entryPtr); - if ((simplePattern == NULL) - || Tcl_StringMatch(varName, simplePattern)) { - if (specificNsInPattern) { - elemObjPtr = Tcl_NewObj(); - Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr, - elemObjPtr); - } else { - elemObjPtr = Tcl_NewStringObj(varName, -1); - } - Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr); - } - } - entryPtr = Tcl_NextHashEntry(&search); - } - - /* - * If the effective namespace isn't the global :: namespace, and a - * specific namespace wasn't requested in the pattern (i.e., the - * pattern only specifies variable names), then add in all global :: - * variables that match the simple pattern. Of course, add in only - * those variables that aren't hidden by a variable in the effective - * namespace. - */ - - if ((nsPtr != globalNsPtr) && !specificNsInPattern) { - entryPtr = Tcl_FirstHashEntry(&globalNsPtr->varTable, &search); - while (entryPtr != NULL) { - varPtr = (Var *) Tcl_GetHashValue(entryPtr); - if (!TclIsVarUndefined(varPtr) - || (varPtr->flags & VAR_NAMESPACE_VAR)) { - varName = Tcl_GetHashKey(&globalNsPtr->varTable, - entryPtr); - if ((simplePattern == NULL) - || Tcl_StringMatch(varName, simplePattern)) { - if (Tcl_FindHashEntry(&nsPtr->varTable, varName) == NULL) { - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(varName, -1)); - } - } - } - entryPtr = Tcl_NextHashEntry(&search); - } - } - } else { - AppendLocals(interp, listPtr, simplePattern, 1); - } - - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_JoinObjCmd -- - * - * This procedure is invoked to process the "join" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_JoinObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - char *joinString, *bytes; - int joinLength, listLen, length, i, result; - Tcl_Obj **elemPtrs; - Tcl_Obj *resObjPtr; - - if (objc == 2) { - joinString = " "; - joinLength = 1; - } else if (objc == 3) { - joinString = Tcl_GetStringFromObj(objv[2], &joinLength); - } else { - Tcl_WrongNumArgs(interp, 1, objv, "list ?joinString?"); - return TCL_ERROR; - } - - /* - * Make sure the list argument is a list object and get its length and - * a pointer to its array of element pointers. - */ - - result = Tcl_ListObjGetElements(interp, objv[1], &listLen, &elemPtrs); - if (result != TCL_OK) { - return result; - } - - /* - * Now concatenate strings to form the "joined" result. We append - * directly into the interpreter's result object. - */ - - resObjPtr = Tcl_GetObjResult(interp); - - for (i = 0; i < listLen; i++) { - bytes = Tcl_GetStringFromObj(elemPtrs[i], &length); - if (i > 0) { - Tcl_AppendToObj(resObjPtr, joinString, joinLength); - } - Tcl_AppendToObj(resObjPtr, bytes, length); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LindexObjCmd -- - * - * This object-based procedure is invoked to process the "lindex" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_LindexObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Obj *listPtr; - Tcl_Obj **elemPtrs; - int listLen, index, result; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "list index"); - return TCL_ERROR; - } - - /* - * Convert the first argument to a list if necessary. - */ - - listPtr = objv[1]; - result = Tcl_ListObjGetElements(interp, listPtr, &listLen, &elemPtrs); - if (result != TCL_OK) { - return result; - } - - /* - * Get the index from objv[2]. - */ - - result = TclGetIntForIndex(interp, objv[2], /*endValue*/ (listLen - 1), - &index); - if (result != TCL_OK) { - return result; - } - if ((index < 0) || (index >= listLen)) { - /* - * The index is out of range: the result is an empty string object. - */ - - return TCL_OK; - } - - /* - * Make sure listPtr still refers to a list object. It might have been - * converted to an int above if the argument objects were shared. - */ - - if (listPtr->typePtr != &tclListType) { - result = Tcl_ListObjGetElements(interp, listPtr, &listLen, - &elemPtrs); - if (result != TCL_OK) { - return result; - } - } - - /* - * Set the interpreter's object result to the index-th list element. - */ - - Tcl_SetObjResult(interp, elemPtrs[index]); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LinsertObjCmd -- - * - * This object-based procedure is invoked to process the "linsert" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A new Tcl list object formed by inserting zero or more elements - * into a list. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_LinsertObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - register int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Obj *listPtr, *resultPtr; - Tcl_ObjType *typePtr; - int index, isDuplicate, len, result; - - if (objc < 4) { - Tcl_WrongNumArgs(interp, 1, objv, "list index element ?element ...?"); - return TCL_ERROR; - } - - /* - * Get the index first since, if a conversion to int is needed, it - * will invalidate the list's internal representation. - */ - - result = TclGetIntForIndex(interp, objv[2], /*endValue*/ INT_MAX, - &index); - if (result != TCL_OK) { - return result; - } - - /* - * If the list object is unshared we can modify it directly. Otherwise - * we create a copy to modify: this is "copy on write". We create the - * duplicate directly in the interpreter's object result. - */ - - listPtr = objv[1]; - isDuplicate = 0; - if (Tcl_IsShared(listPtr)) { - /* - * The following code must reflect the logic in Tcl_DuplicateObj() - * except that it must duplicate the list object directly into the - * interpreter's result. - */ - - Tcl_ResetResult(interp); - resultPtr = Tcl_GetObjResult(interp); - typePtr = listPtr->typePtr; - if (listPtr->bytes == NULL) { - resultPtr->bytes = NULL; - } else if (listPtr->bytes != tclEmptyStringRep) { - len = listPtr->length; - TclInitStringRep(resultPtr, listPtr->bytes, len); - } - if (typePtr != NULL) { - if (typePtr->dupIntRepProc == NULL) { - resultPtr->internalRep = listPtr->internalRep; - resultPtr->typePtr = typePtr; - } else { - (*typePtr->dupIntRepProc)(listPtr, resultPtr); - } - } - listPtr = resultPtr; - isDuplicate = 1; - } - - if ((objc == 4) && (index == INT_MAX)) { - /* - * Special case: insert one element at the end of the list. - */ - - result = Tcl_ListObjAppendElement(interp, listPtr, objv[3]); - } else if (objc > 3) { - result = Tcl_ListObjReplace(interp, listPtr, index, 0, - (objc-3), &(objv[3])); - } - if (result != TCL_OK) { - return result; - } - - /* - * Set the interpreter's object result. - */ - - if (!isDuplicate) { - Tcl_SetObjResult(interp, listPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ListObjCmd -- - * - * This procedure is invoked to process the "list" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ListObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - register int objc; /* Number of arguments. */ - register Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - /* - * If there are no list elements, the result is an empty object. - * Otherwise modify the interpreter's result object to be a list object. - */ - - if (objc > 1) { - Tcl_SetListObj(Tcl_GetObjResult(interp), (objc-1), &(objv[1])); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LlengthObjCmd -- - * - * This object-based procedure is invoked to process the "llength" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_LlengthObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - register Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int listLen, result; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "list"); - return TCL_ERROR; - } - - result = Tcl_ListObjLength(interp, objv[1], &listLen); - if (result != TCL_OK) { - return result; - } - - /* - * Set the interpreter's object result to an integer object holding the - * length. - */ - - Tcl_SetIntObj(Tcl_GetObjResult(interp), listLen); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LrangeObjCmd -- - * - * This procedure is invoked to process the "lrange" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_LrangeObjCmd(notUsed, interp, objc, objv) - ClientData notUsed; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - register Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Obj *listPtr; - Tcl_Obj **elemPtrs; - int listLen, first, last, numElems, result; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 1, objv, "list first last"); - return TCL_ERROR; - } - - /* - * Make sure the list argument is a list object and get its length and - * a pointer to its array of element pointers. - */ - - listPtr = objv[1]; - result = Tcl_ListObjGetElements(interp, listPtr, &listLen, &elemPtrs); - if (result != TCL_OK) { - return result; - } - - /* - * Get the first and last indexes. - */ - - result = TclGetIntForIndex(interp, objv[2], /*endValue*/ (listLen - 1), - &first); - if (result != TCL_OK) { - return result; - } - if (first < 0) { - first = 0; - } - - result = TclGetIntForIndex(interp, objv[3], /*endValue*/ (listLen - 1), - &last); - if (result != TCL_OK) { - return result; - } - if (last >= listLen) { - last = (listLen - 1); - } - - if (first > last) { - return TCL_OK; /* the result is an empty object */ - } - - /* - * Make sure listPtr still refers to a list object. It might have been - * converted to an int above if the argument objects were shared. - */ - - if (listPtr->typePtr != &tclListType) { - result = Tcl_ListObjGetElements(interp, listPtr, &listLen, - &elemPtrs); - if (result != TCL_OK) { - return result; - } - } - - /* - * Extract a range of fields. We modify the interpreter's result object - * to be a list object containing the specified elements. - */ - - numElems = (last - first + 1); - Tcl_SetListObj(Tcl_GetObjResult(interp), numElems, &(elemPtrs[first])); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LreplaceObjCmd -- - * - * This object-based procedure is invoked to process the "lreplace" - * Tcl command. See the user documentation for details on what it does. - * - * Results: - * A new Tcl list object formed by replacing zero or more elements of - * a list. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_LreplaceObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Tcl_Obj *listPtr; - int createdNewObj, first, last, listLen, numToDelete; - int firstArgLen, result; - char *firstArg; - - if (objc < 4) { - Tcl_WrongNumArgs(interp, 1, objv, - "list first last ?element element ...?"); - return TCL_ERROR; - } - - /* - * If the list object is unshared we can modify it directly, otherwise - * we create a copy to modify: this is "copy on write". - */ - - listPtr = objv[1]; - createdNewObj = 0; - if (Tcl_IsShared(listPtr)) { - listPtr = Tcl_DuplicateObj(listPtr); - createdNewObj = 1; - } - result = Tcl_ListObjLength(interp, listPtr, &listLen); - if (result != TCL_OK) { - errorReturn: - if (createdNewObj) { - Tcl_DecrRefCount(listPtr); /* free unneeded obj */ - } - return result; - } - - /* - * Get the first and last indexes. - */ - - result = TclGetIntForIndex(interp, objv[2], /*endValue*/ (listLen - 1), - &first); - if (result != TCL_OK) { - goto errorReturn; - } - firstArg = Tcl_GetStringFromObj(objv[2], &firstArgLen); - - result = TclGetIntForIndex(interp, objv[3], /*endValue*/ (listLen - 1), - &last); - if (result != TCL_OK) { - goto errorReturn; - } - - if (first < 0) { - first = 0; - } - if ((first >= listLen) && (listLen > 0) - && (strncmp(firstArg, "end", (unsigned) firstArgLen) != 0)) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "list doesn't contain element ", - Tcl_GetString(objv[2]), (int *) NULL); - result = TCL_ERROR; - goto errorReturn; - } - if (last >= listLen) { - last = (listLen - 1); - } - if (first <= last) { - numToDelete = (last - first + 1); - } else { - numToDelete = 0; - } - - if (objc > 4) { - result = Tcl_ListObjReplace(interp, listPtr, first, numToDelete, - (objc-4), &(objv[4])); - } else { - result = Tcl_ListObjReplace(interp, listPtr, first, numToDelete, - 0, NULL); - } - if (result != TCL_OK) { - goto errorReturn; - } - - /* - * Set the interpreter's object result. - */ - - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LsearchObjCmd -- - * - * This procedure is invoked to process the "lsearch" 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_LsearchObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument values. */ -{ - char *bytes, *patternBytes; - int i, match, mode, index, result, listc, length, elemLen; - Tcl_Obj *patObj, **listv; - static char *options[] = { - "-exact", "-glob", "-regexp", NULL - }; - enum options { - LSEARCH_EXACT, LSEARCH_GLOB, LSEARCH_REGEXP - }; - - mode = LSEARCH_GLOB; - if (objc == 4) { - if (Tcl_GetIndexFromObj(interp, objv[1], options, "search mode", 0, - &mode) != TCL_OK) { - return TCL_ERROR; - } - } else if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "?mode? list pattern"); - return TCL_ERROR; - } - - /* - * Make sure the list argument is a list object and get its length and - * a pointer to its array of element pointers. - */ - - result = Tcl_ListObjGetElements(interp, objv[objc - 2], &listc, &listv); - if (result != TCL_OK) { - return result; - } - - patObj = objv[objc - 1]; - patternBytes = Tcl_GetStringFromObj(patObj, &length); - - index = -1; - for (i = 0; i < listc; i++) { - match = 0; - bytes = Tcl_GetStringFromObj(listv[i], &elemLen); - switch ((enum options) mode) { - case LSEARCH_EXACT: { - if (length == elemLen) { - match = (memcmp(bytes, patternBytes, - (size_t) length) == 0); - } - break; - } - case LSEARCH_GLOB: { - match = Tcl_StringMatch(bytes, patternBytes); - break; - } - case LSEARCH_REGEXP: { - match = TclRegExpMatchObj(interp, bytes, patObj); - if (match < 0) { - return TCL_ERROR; - } - break; - } - } - if (match != 0) { - index = i; - break; - } - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), index); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LsortObjCmd -- - * - * This procedure is invoked to process the "lsort" 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_LsortObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument values. */ -{ - int i, index; - Tcl_Obj *resultPtr; - int length; - Tcl_Obj *cmdPtr, **listObjPtrs; - SortElement *elementArray; - SortElement *elementPtr; - SortInfo sortInfo; /* Information about this sort that - * needs to be passed to the - * comparison function */ - static char *switches[] = - {"-ascii", "-command", "-decreasing", "-dictionary", - "-increasing", "-index", "-integer", "-real", (char *) NULL}; - - resultPtr = Tcl_GetObjResult(interp); - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "?options? list"); - return TCL_ERROR; - } - - /* - * Parse arguments to set up the mode for the sort. - */ - - sortInfo.isIncreasing = 1; - sortInfo.sortMode = SORTMODE_ASCII; - sortInfo.index = -1; - sortInfo.interp = interp; - sortInfo.resultCode = TCL_OK; - cmdPtr = NULL; - for (i = 1; i < objc-1; i++) { - if (Tcl_GetIndexFromObj(interp, objv[i], switches, "option", 0, &index) - != TCL_OK) { - return TCL_ERROR; - } - switch (index) { - case 0: /* -ascii */ - sortInfo.sortMode = SORTMODE_ASCII; - break; - case 1: /* -command */ - if (i == (objc-2)) { - Tcl_AppendToObj(resultPtr, - "\"-command\" option must be followed by comparison command", - -1); - return TCL_ERROR; - } - sortInfo.sortMode = SORTMODE_COMMAND; - cmdPtr = objv[i+1]; - i++; - break; - case 2: /* -decreasing */ - sortInfo.isIncreasing = 0; - break; - case 3: /* -dictionary */ - sortInfo.sortMode = SORTMODE_DICTIONARY; - break; - case 4: /* -increasing */ - sortInfo.isIncreasing = 1; - break; - case 5: /* -index */ - if (i == (objc-2)) { - Tcl_AppendToObj(resultPtr, - "\"-index\" option must be followed by list index", - -1); - return TCL_ERROR; - } - if (TclGetIntForIndex(interp, objv[i+1], -2, &sortInfo.index) - != TCL_OK) { - return TCL_ERROR; - } - cmdPtr = objv[i+1]; - i++; - break; - case 6: /* -integer */ - sortInfo.sortMode = SORTMODE_INTEGER; - break; - case 7: /* -real */ - sortInfo.sortMode = SORTMODE_REAL; - break; - } - } - if (sortInfo.sortMode == SORTMODE_COMMAND) { - /* - * The existing command is a list. We want to flatten it, append - * two dummy arguments on the end, and replace these arguments - * later. - */ - - Tcl_Obj *newCommandPtr = Tcl_DuplicateObj(cmdPtr); - - if (Tcl_ListObjAppendElement(interp, newCommandPtr, Tcl_NewObj()) - != TCL_OK) { - return TCL_ERROR; - } - Tcl_ListObjAppendElement(interp, newCommandPtr, Tcl_NewObj()); - sortInfo.compareCmdPtr = newCommandPtr; - Tcl_IncrRefCount(newCommandPtr); - } - - sortInfo.resultCode = Tcl_ListObjGetElements(interp, objv[objc-1], - &length, &listObjPtrs); - if (sortInfo.resultCode != TCL_OK) { - goto done; - } - if (length <= 0) { - return TCL_OK; - } - elementArray = (SortElement *) ckalloc(length * sizeof(SortElement)); - for (i=0; i < length; i++){ - elementArray[i].objPtr = listObjPtrs[i]; - elementArray[i].nextPtr = &elementArray[i+1]; - } - elementArray[length-1].nextPtr = NULL; - elementPtr = MergeSort(elementArray, &sortInfo); - if (sortInfo.resultCode == TCL_OK) { - /* - * Note: must clear the interpreter's result object: it could - * have been set by the -command script. - */ - - Tcl_ResetResult(interp); - resultPtr = Tcl_GetObjResult(interp); - for (; elementPtr != NULL; elementPtr = elementPtr->nextPtr){ - Tcl_ListObjAppendElement(interp, resultPtr, elementPtr->objPtr); - } - } - ckfree((char*) elementArray); - - done: - if (sortInfo.sortMode == SORTMODE_COMMAND) { - Tcl_DecrRefCount(sortInfo.compareCmdPtr); - sortInfo.compareCmdPtr = NULL; - } - return sortInfo.resultCode; -} - -/* - *---------------------------------------------------------------------- - * - * MergeSort - - * - * This procedure sorts a linked list of SortElement structures - * use the merge-sort algorithm. - * - * Results: - * A pointer to the head of the list after sorting is returned. - * - * Side effects: - * None, unless a user-defined comparison command does something - * weird. - * - *---------------------------------------------------------------------- - */ - -static SortElement * -MergeSort(headPtr, infoPtr) - SortElement *headPtr; /* First element on the list */ - SortInfo *infoPtr; /* Information needed by the - * comparison operator */ -{ - /* - * The subList array below holds pointers to temporary lists built - * during the merge sort. Element i of the array holds a list of - * length 2**i. - */ - -# define NUM_LISTS 30 - SortElement *subList[NUM_LISTS]; - SortElement *elementPtr; - int i; - - for(i = 0; i < NUM_LISTS; i++){ - subList[i] = NULL; - } - while (headPtr != NULL) { - elementPtr = headPtr; - headPtr = headPtr->nextPtr; - elementPtr->nextPtr = 0; - for (i = 0; (i < NUM_LISTS) && (subList[i] != NULL); i++){ - elementPtr = MergeLists(subList[i], elementPtr, infoPtr); - subList[i] = NULL; - } - if (i >= NUM_LISTS) { - i = NUM_LISTS-1; - } - subList[i] = elementPtr; - } - elementPtr = NULL; - for (i = 0; i < NUM_LISTS; i++){ - elementPtr = MergeLists(subList[i], elementPtr, infoPtr); - } - return elementPtr; -} - -/* - *---------------------------------------------------------------------- - * - * MergeLists - - * - * This procedure combines two sorted lists of SortElement structures - * into a single sorted list. - * - * Results: - * The unified list of SortElement structures. - * - * Side effects: - * None, unless a user-defined comparison command does something - * weird. - * - *---------------------------------------------------------------------- - */ - -static SortElement * -MergeLists(leftPtr, rightPtr, infoPtr) - SortElement *leftPtr; /* First list to be merged; may be - * NULL. */ - SortElement *rightPtr; /* Second list to be merged; may be - * NULL. */ - SortInfo *infoPtr; /* Information needed by the - * comparison operator. */ -{ - SortElement *headPtr; - SortElement *tailPtr; - - if (leftPtr == NULL) { - return rightPtr; - } - if (rightPtr == NULL) { - return leftPtr; - } - if (SortCompare(leftPtr->objPtr, rightPtr->objPtr, infoPtr) > 0) { - tailPtr = rightPtr; - rightPtr = rightPtr->nextPtr; - } else { - tailPtr = leftPtr; - leftPtr = leftPtr->nextPtr; - } - headPtr = tailPtr; - while ((leftPtr != NULL) && (rightPtr != NULL)) { - if (SortCompare(leftPtr->objPtr, rightPtr->objPtr, infoPtr) > 0) { - tailPtr->nextPtr = rightPtr; - tailPtr = rightPtr; - rightPtr = rightPtr->nextPtr; - } else { - tailPtr->nextPtr = leftPtr; - tailPtr = leftPtr; - leftPtr = leftPtr->nextPtr; - } - } - if (leftPtr != NULL) { - tailPtr->nextPtr = leftPtr; - } else { - tailPtr->nextPtr = rightPtr; - } - return headPtr; -} - -/* - *---------------------------------------------------------------------- - * - * SortCompare -- - * - * This procedure is invoked by MergeLists to determine the proper - * ordering between two elements. - * - * Results: - * A negative results means the the first element comes before the - * second, and a positive results means that the second element - * should come first. A result of zero means the two elements - * are equal and it doesn't matter which comes first. - * - * Side effects: - * None, unless a user-defined comparison command does something - * weird. - * - *---------------------------------------------------------------------- - */ - -static int -SortCompare(objPtr1, objPtr2, infoPtr) - Tcl_Obj *objPtr1, *objPtr2; /* Values to be compared. */ - SortInfo *infoPtr; /* Information passed from the - * top-level "lsort" command */ -{ - int order, listLen, index; - Tcl_Obj *objPtr; - char buffer[TCL_INTEGER_SPACE]; - - order = 0; - if (infoPtr->resultCode != TCL_OK) { - /* - * Once an error has occurred, skip any future comparisons - * so as to preserve the error message in sortInterp->result. - */ - - return order; - } - if (infoPtr->index != -1) { - /* - * The "-index" option was specified. Treat each object as a - * list, extract the requested element from each list, and - * compare the elements, not the lists. The special index "end" - * is signaled here with a large negative index. - */ - - if (Tcl_ListObjLength(infoPtr->interp, objPtr1, &listLen) != TCL_OK) { - infoPtr->resultCode = TCL_ERROR; - return order; - } - if (infoPtr->index < -1) { - index = listLen - 1; - } else { - index = infoPtr->index; - } - - if (Tcl_ListObjIndex(infoPtr->interp, objPtr1, index, &objPtr) - != TCL_OK) { - infoPtr->resultCode = TCL_ERROR; - return order; - } - if (objPtr == NULL) { - objPtr = objPtr1; - missingElement: - TclFormatInt(buffer, infoPtr->index); - Tcl_AppendStringsToObj(Tcl_GetObjResult(infoPtr->interp), - "element ", buffer, " missing from sublist \"", - Tcl_GetString(objPtr), "\"", (char *) NULL); - infoPtr->resultCode = TCL_ERROR; - return order; - } - objPtr1 = objPtr; - - if (Tcl_ListObjLength(infoPtr->interp, objPtr2, &listLen) != TCL_OK) { - infoPtr->resultCode = TCL_ERROR; - return order; - } - if (infoPtr->index < -1) { - index = listLen - 1; - } else { - index = infoPtr->index; - } - - if (Tcl_ListObjIndex(infoPtr->interp, objPtr2, index, &objPtr) - != TCL_OK) { - infoPtr->resultCode = TCL_ERROR; - return order; - } - if (objPtr == NULL) { - objPtr = objPtr2; - goto missingElement; - } - objPtr2 = objPtr; - } - if (infoPtr->sortMode == SORTMODE_ASCII) { - order = strcmp(Tcl_GetString(objPtr1), Tcl_GetString(objPtr2)); - } else if (infoPtr->sortMode == SORTMODE_DICTIONARY) { - order = DictionaryCompare( - Tcl_GetString(objPtr1), Tcl_GetString(objPtr2)); - } else if (infoPtr->sortMode == SORTMODE_INTEGER) { - int a, b; - - if ((Tcl_GetIntFromObj(infoPtr->interp, objPtr1, &a) != TCL_OK) - || (Tcl_GetIntFromObj(infoPtr->interp, objPtr2, &b) - != TCL_OK)) { - infoPtr->resultCode = TCL_ERROR; - return order; - } - if (a > b) { - order = 1; - } else if (b > a) { - order = -1; - } - } else if (infoPtr->sortMode == SORTMODE_REAL) { - double a, b; - - if ((Tcl_GetDoubleFromObj(infoPtr->interp, objPtr1, &a) != TCL_OK) - || (Tcl_GetDoubleFromObj(infoPtr->interp, objPtr2, &b) - != TCL_OK)) { - infoPtr->resultCode = TCL_ERROR; - return order; - } - if (a > b) { - order = 1; - } else if (b > a) { - order = -1; - } - } else { - Tcl_Obj **objv, *paramObjv[2]; - int objc; - - paramObjv[0] = objPtr1; - paramObjv[1] = objPtr2; - - /* - * We made space in the command list for the two things to - * compare. Replace them and evaluate the result. - */ - - Tcl_ListObjLength(infoPtr->interp, infoPtr->compareCmdPtr, &objc); - Tcl_ListObjReplace(infoPtr->interp, infoPtr->compareCmdPtr, objc - 2, - 2, 2, paramObjv); - Tcl_ListObjGetElements(infoPtr->interp, infoPtr->compareCmdPtr, - &objc, &objv); - - infoPtr->resultCode = Tcl_EvalObjv(infoPtr->interp, objc, objv, 0); - - if (infoPtr->resultCode != TCL_OK) { - Tcl_AddErrorInfo(infoPtr->interp, - "\n (-compare command)"); - return order; - } - - /* - * Parse the result of the command. - */ - - if (Tcl_GetIntFromObj(infoPtr->interp, - Tcl_GetObjResult(infoPtr->interp), &order) != TCL_OK) { - Tcl_ResetResult(infoPtr->interp); - Tcl_AppendToObj(Tcl_GetObjResult(infoPtr->interp), - "-compare command returned non-numeric result", -1); - infoPtr->resultCode = TCL_ERROR; - return order; - } - } - if (!infoPtr->isIncreasing) { - order = -order; - } - return order; -} - -/* - *---------------------------------------------------------------------- - * - * DictionaryCompare - * - * This function compares two strings as if they were being used in - * an index or card catalog. The case of alphabetic characters is - * ignored, except to break ties. Thus "B" comes before "b" but - * after "a". Also, integers embedded in the strings compare in - * numerical order. In other words, "x10y" comes after "x9y", not - * before it as it would when using strcmp(). - * - * Results: - * A negative result means that the first element comes before the - * second, and a positive result means that the second element - * should come first. A result of zero means the two elements - * are equal and it doesn't matter which comes first. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -DictionaryCompare(left, right) - char *left, *right; /* The strings to compare */ -{ - Tcl_UniChar uniLeft, uniRight; - int diff, zeros; - int secondaryDiff = 0; - - while (1) { - if (isdigit(UCHAR(*right)) /* INTL: digit */ - && isdigit(UCHAR(*left))) { /* INTL: digit */ - /* - * There are decimal numbers embedded in the two - * strings. Compare them as numbers, rather than - * strings. If one number has more leading zeros than - * the other, the number with more leading zeros sorts - * later, but only as a secondary choice. - */ - - zeros = 0; - while ((*right == '0') && (isdigit(UCHAR(right[1])))) { - right++; - zeros--; - } - while ((*left == '0') && (isdigit(UCHAR(left[1])))) { - left++; - zeros++; - } - if (secondaryDiff == 0) { - secondaryDiff = zeros; - } - - /* - * The code below compares the numbers in the two - * strings without ever converting them to integers. It - * does this by first comparing the lengths of the - * numbers and then comparing the digit values. - */ - - diff = 0; - while (1) { - if (diff == 0) { - diff = UCHAR(*left) - UCHAR(*right); - } - right++; - left++; - if (!isdigit(UCHAR(*right))) { /* INTL: digit */ - if (isdigit(UCHAR(*left))) { /* INTL: digit */ - return 1; - } else { - /* - * The two numbers have the same length. See - * if their values are different. - */ - - if (diff != 0) { - return diff; - } - break; - } - } else if (!isdigit(UCHAR(*left))) { /* INTL: digit */ - return -1; - } - } - continue; - } - - /* - * Convert character to Unicode for comparison purposes. If either - * string is at the terminating null, do a byte-wise comparison and - * bail out immediately. - */ - - if ((*left != '\0') && (*right != '\0')) { - left += Tcl_UtfToUniChar(left, &uniLeft); - right += Tcl_UtfToUniChar(right, &uniRight); - } else { - diff = UCHAR(*left) - UCHAR(*right); - break; - } - - diff = uniLeft - uniRight; - if (diff) { - if (Tcl_UniCharIsUpper(uniLeft) && - Tcl_UniCharIsLower(uniRight)) { - diff = Tcl_UniCharToLower(uniLeft) - uniRight; - if (diff) { - return diff; - } else if (secondaryDiff == 0) { - secondaryDiff = -1; - } - } else if (Tcl_UniCharIsUpper(uniRight) - && Tcl_UniCharIsLower(uniLeft)) { - diff = uniLeft - Tcl_UniCharToLower(uniRight); - if (diff) { - return diff; - } else if (secondaryDiff == 0) { - secondaryDiff = 1; - } - } else { - return diff; - } - } - } - if (diff == 0) { - diff = secondaryDiff; - } - return diff; -} diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c deleted file mode 100644 index 38a3f8d..0000000 --- a/generic/tclCmdMZ.c +++ /dev/null @@ -1,1935 +0,0 @@ -/* - * tclCmdMZ.c -- - * - * This file contains the top-level command routines for most of - * the Tcl built-in commands whose names begin with the letters - * M to Z. It contains only commands in the generic core (i.e. - * those that don't depend much upon UNIX facilities). - * - * Copyright (c) 1987-1993 The Regents of the University of California. - * Copyright (c) 1994-1997 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. - * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.3 1999/04/16 00:46:43 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclCompile.h" -#include "tclRegexp.h" - -/* - * Flag values used by Tcl_ScanObjCmd. - */ - -#define SCAN_NOSKIP 0x1 /* Don't skip blanks. */ -#define SCAN_SUPPRESS 0x2 /* Suppress assignment. */ -#define SCAN_UNSIGNED 0x4 /* Read an unsigned value. */ -#define SCAN_WIDTH 0x8 /* A width value was supplied. */ - -#define SCAN_SIGNOK 0x10 /* A +/- character is allowed. */ -#define SCAN_NODIGITS 0x20 /* No digits have been scanned. */ -#define SCAN_NOZERO 0x40 /* No zero digits have been scanned. */ -#define SCAN_XOK 0x80 /* An 'x' is allowed. */ -#define SCAN_PTOK 0x100 /* Decimal point is allowed. */ -#define SCAN_EXPOK 0x200 /* An exponent is allowed. */ - -/* - * Structure used to hold information about variable traces: - */ - -typedef struct { - int flags; /* Operations for which Tcl command is - * to be invoked. */ - char *errMsg; /* Error message returned from Tcl command, - * or NULL. Malloc'ed. */ - size_t length; /* Number of non-NULL chars. in command. */ - char command[4]; /* Space for Tcl command to invoke. Actual - * size will be as large as necessary to - * hold command. This field must be the - * last in the structure, so that it can - * be larger than 4 bytes. */ -} TraceVarInfo; - -/* - * Forward declarations for procedures defined in this file: - */ - -static char * TraceVarProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, - int flags)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_PwdObjCmd -- - * - * This procedure is invoked to process the "pwd" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_PwdObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_DString ds; - - if (objc != 1) { - Tcl_WrongNumArgs(interp, 1, objv, NULL); - return TCL_ERROR; - } - - if (Tcl_GetCwd(interp, &ds) == NULL) { - return TCL_ERROR; - } - Tcl_DStringResult(interp, &ds); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RegexpObjCmd -- - * - * This procedure is invoked to process the "regexp" Tcl command. - * See the user documentation for details on what it does. The - * REGEXP_TEST stuff is to minimize code differences between this - * and the "testregexp" command. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_RegexpObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int i, result, indices, stringLength, wLen, match, about; - int cflags, eflags; - Tcl_RegExp regExpr; - char *string; - Tcl_DString stringBuffer, valueBuffer; - Tcl_UniChar *wStart; - static char *options[] = { - "-indices", "-nocase", "-about", "-expanded", - "-line", "-linestop", "-lineanchor", - "--", (char *) NULL - }; - enum options { - REGEXP_INDICES, REGEXP_NOCASE, REGEXP_ABOUT, REGEXP_EXPANDED, - REGEXP_LINE, REGEXP_LINESTOP, REGEXP_LINEANCHOR, - REGEXP_LAST - }; - - indices = 0; - about = 0; - cflags = REG_ADVANCED; - eflags = 0; - - for (i = 1; i < objc; i++) { - char *name; - int index; - - name = Tcl_GetString(objv[i]); - if (name[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[i], options, "switch", TCL_EXACT, - &index) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum options) index) { - case REGEXP_INDICES: { - indices = 1; - break; - } - case REGEXP_NOCASE: { - cflags |= REG_ICASE; - break; - } - case REGEXP_ABOUT: { - about = 1; - break; - } - case REGEXP_EXPANDED: { - cflags |= REG_EXPANDED; - break; - } - case REGEXP_LINE: { - cflags |= REG_NEWLINE; - break; - } - case REGEXP_LINESTOP: { - cflags |= REG_NLSTOP; - break; - } - case REGEXP_LINEANCHOR: { - cflags |= REG_NLANCH; - break; - } - case REGEXP_LAST: { - i++; - goto endOfForLoop; - } - } - } - - endOfForLoop: - if (objc - i < 2 - about) { - Tcl_WrongNumArgs(interp, 1, objv, - "?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?"); - return TCL_ERROR; - } - objc -= i; - objv += i; - - regExpr = Tcl_GetRegExpFromObj(interp, objv[0], cflags); - if (regExpr == NULL) { - return TCL_ERROR; - } - - if (about) { - if (TclRegAbout(interp, regExpr) < 0) { - return TCL_ERROR; - } - return TCL_OK; - } - - result = TCL_OK; - string = Tcl_GetStringFromObj(objv[1], &stringLength); - - Tcl_DStringInit(&valueBuffer); - - Tcl_DStringInit(&stringBuffer); - wStart = Tcl_UtfToUniCharDString(string, stringLength, &stringBuffer); - wLen = Tcl_DStringLength(&stringBuffer) / sizeof(Tcl_UniChar); - - match = TclRegExpExecUniChar(interp, regExpr, wStart, wLen, objc-2, eflags); - if (match < 0) { - result = TCL_ERROR; - goto done; - } - if (match == 0) { - /* - * Set the interpreter's object result to an integer object w/ value 0. - */ - - Tcl_SetIntObj(Tcl_GetObjResult(interp), 0); - goto done; - } - - /* - * If additional variable names have been specified, return - * index information in those variables. - */ - - objc -= 2; - objv += 2; - - for (i = 0; i < objc; i++) { - char *varName, *value; - int start, end; - - varName = Tcl_GetString(objv[i]); - - TclRegExpRangeUniChar(regExpr, i, &start, &end); - if (start < 0) { - if (indices) { - value = Tcl_SetVar(interp, varName, "-1 -1", 0); - } else { - value = Tcl_SetVar(interp, varName, "", 0); - } - } else { - if (indices) { - char info[TCL_INTEGER_SPACE * 2]; - - sprintf(info, "%d %d", start, end - 1); - value = Tcl_SetVar(interp, varName, info, 0); - } else { - value = Tcl_UniCharToUtfDString(wStart + start, end - start, - &valueBuffer); - value = Tcl_SetVar(interp, varName, value, 0); - Tcl_DStringSetLength(&valueBuffer, 0); - } - } - if (value == NULL) { - Tcl_AppendResult(interp, "couldn't set variable \"", - varName, "\"", (char *) NULL); - result = TCL_ERROR; - goto done; - } - } - - /* - * Set the interpreter's object result to an integer object w/ value 1. - */ - - Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); - - done: - Tcl_DStringFree(&stringBuffer); - Tcl_DStringFree(&valueBuffer); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RegsubObjCmd -- - * - * This procedure is invoked to process the "regsub" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_RegsubObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int i, result, flags, all, stringLength, numMatches; - Tcl_RegExp regExpr; - Tcl_DString resultBuffer, stringBuffer; - CONST Tcl_UniChar *w, *wStart, *wEnd; - char *string, *subspec, *varname; - static char *options[] = { - "-all", "-nocase", "--", NULL - }; - enum options { - REGSUB_ALL, REGSUB_NOCASE, REGSUB_LAST - }; - - flags = 0; - all = 0; - - for (i = 1; i < objc; i++) { - char *name; - int index; - - name = Tcl_GetString(objv[i]); - if (name[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[i], options, "switch", TCL_EXACT, - &index) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum options) index) { - case REGSUB_ALL: { - all = 1; - break; - } - case REGSUB_NOCASE: { - flags |= REG_ICASE; - break; - } - case REGSUB_LAST: { - i++; - goto endOfForLoop; - } - } - } - endOfForLoop: - if (objc - i != 4) { - Tcl_WrongNumArgs(interp, 1, objv, - "?switches? exp string subSpec varName"); - return TCL_ERROR; - } - - objv += i; - regExpr = Tcl_GetRegExpFromObj(interp, objv[0], flags | REG_ADVANCED); - if (regExpr == NULL) { - return TCL_ERROR; - } - - result = TCL_OK; - string = Tcl_GetStringFromObj(objv[1], &stringLength); - subspec = Tcl_GetString(objv[2]); - varname = Tcl_GetString(objv[3]); - - Tcl_DStringInit(&resultBuffer); - - /* - * The following loop is to handle multiple matches within the - * same source string; each iteration handles one match and its - * corresponding substitution. If "-all" hasn't been specified - * then the loop body only gets executed once. - */ - - Tcl_DStringInit(&stringBuffer); - wStart = Tcl_UtfToUniCharDString(string, stringLength, &stringBuffer); - wEnd = wStart + Tcl_DStringLength(&stringBuffer) / sizeof(Tcl_UniChar); - - numMatches = 0; - for (w = wStart; w < wEnd; ) { - int start, end, subStart, subEnd, match; - char *src, *firstChar; - char c; - - /* - * The flags argument is set if string is part of a larger string, - * so that "^" won't match. - */ - - match = TclRegExpExecUniChar(interp, regExpr, w, wEnd - w, 10, - ((w > wStart) ? REG_NOTBOL : 0)); - if (match < 0) { - result = TCL_ERROR; - goto done; - } - if (match == 0) { - break; - } - numMatches++; - - /* - * Copy the portion of the source string before the match to the - * result variable. - */ - - TclRegExpRangeUniChar(regExpr, 0, &start, &end); - Tcl_UniCharToUtfDString(w, start, &resultBuffer); - - /* - * Append the subSpec argument to the variable, making appropriate - * substitutions. This code is a bit hairy because of the backslash - * conventions and because the code saves up ranges of characters in - * subSpec to reduce the number of calls to Tcl_SetVar. - */ - - src = subspec; - firstChar = subspec; - for (c = *src; c != '\0'; src++, c = *src) { - int index; - - if (c == '&') { - index = 0; - } else if (c == '\\') { - c = src[1]; - if ((c >= '0') && (c <= '9')) { - index = c - '0'; - } else if ((c == '\\') || (c == '&')) { - Tcl_DStringAppend(&resultBuffer, firstChar, - src - firstChar); - Tcl_DStringAppend(&resultBuffer, &c, 1); - firstChar = src + 2; - src++; - continue; - } else { - continue; - } - } else { - continue; - } - if (firstChar != src) { - Tcl_DStringAppend(&resultBuffer, firstChar, src - firstChar); - } - TclRegExpRangeUniChar(regExpr, index, &subStart, &subEnd); - if ((subStart >= 0) && (subEnd >= 0)) { - Tcl_UniCharToUtfDString(w + subStart, subEnd - subStart, - &resultBuffer); - } - if (*src == '\\') { - src++; - } - firstChar = src + 1; - } - if (firstChar != src) { - Tcl_DStringAppend(&resultBuffer, firstChar, src - firstChar); - } - if (end == 0) { - /* - * Always consume at least one character of the input string - * in order to prevent infinite loops. - */ - - Tcl_UniCharToUtfDString(w, 1, &resultBuffer); - w++; - } - w += end; - if (!all) { - break; - } - } - - /* - * Copy the portion of the source string after the last match to the - * result variable. - */ - - if ((w < wEnd) || (numMatches == 0)) { - Tcl_UniCharToUtfDString(w, wEnd - w, &resultBuffer); - } - if (Tcl_SetVar(interp, varname, Tcl_DStringValue(&resultBuffer), - 0) == NULL) { - Tcl_AppendResult(interp, "couldn't set variable \"", varname, "\"", - (char *) NULL); - result = TCL_ERROR; - } else { - /* - * Set the interpreter's object result to an integer object holding the - * number of matches. - */ - - Tcl_SetIntObj(Tcl_GetObjResult(interp), numMatches); - } - - done: - Tcl_DStringFree(&stringBuffer); - Tcl_DStringFree(&resultBuffer); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RenameObjCmd -- - * - * This procedure is invoked to process the "rename" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_RenameObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Arbitrary value passed to the command. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *oldName, *newName; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "oldName newName"); - return TCL_ERROR; - } - - oldName = Tcl_GetString(objv[1]); - newName = Tcl_GetString(objv[2]); - return TclRenameCommand(interp, oldName, newName); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ReturnObjCmd -- - * - * This object-based procedure is invoked to process the "return" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ReturnObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - int optionLen, argLen, code, result; - - if (iPtr->errorInfo != NULL) { - ckfree(iPtr->errorInfo); - iPtr->errorInfo = NULL; - } - if (iPtr->errorCode != NULL) { - ckfree(iPtr->errorCode); - iPtr->errorCode = NULL; - } - code = TCL_OK; - - for (objv++, objc--; objc > 1; objv += 2, objc -= 2) { - char *option = Tcl_GetStringFromObj(objv[0], &optionLen); - char *arg = Tcl_GetStringFromObj(objv[1], &argLen); - - if (strcmp(option, "-code") == 0) { - register int c = arg[0]; - if ((c == 'o') && (strcmp(arg, "ok") == 0)) { - code = TCL_OK; - } else if ((c == 'e') && (strcmp(arg, "error") == 0)) { - code = TCL_ERROR; - } else if ((c == 'r') && (strcmp(arg, "return") == 0)) { - code = TCL_RETURN; - } else if ((c == 'b') && (strcmp(arg, "break") == 0)) { - code = TCL_BREAK; - } else if ((c == 'c') && (strcmp(arg, "continue") == 0)) { - code = TCL_CONTINUE; - } else { - result = Tcl_GetIntFromObj((Tcl_Interp *) NULL, objv[1], - &code); - if (result != TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad completion code \"", - Tcl_GetString(objv[1]), - "\": must be ok, error, return, break, ", - "continue, or an integer", (char *) NULL); - return result; - } - } - } else if (strcmp(option, "-errorinfo") == 0) { - iPtr->errorInfo = - (char *) ckalloc((unsigned) (strlen(arg) + 1)); - strcpy(iPtr->errorInfo, arg); - } else if (strcmp(option, "-errorcode") == 0) { - iPtr->errorCode = - (char *) ckalloc((unsigned) (strlen(arg) + 1)); - strcpy(iPtr->errorCode, arg); - } else { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad option \"", option, - "\": must be -code, -errorcode, or -errorinfo", - (char *) NULL); - return TCL_ERROR; - } - } - - if (objc == 1) { - /* - * Set the interpreter's object result. An inline version of - * Tcl_SetObjResult. - */ - - Tcl_SetObjResult(interp, objv[0]); - } - iPtr->returnCode = code; - return TCL_RETURN; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SourceObjCmd -- - * - * This procedure is invoked to process the "source" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_SourceObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *bytes; - int result; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "fileName"); - return TCL_ERROR; - } - - bytes = Tcl_GetString(objv[1]); - result = Tcl_EvalFile(interp, bytes); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SplitObjCmd -- - * - * This procedure is invoked to process the "split" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_SplitObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_UniChar ch; - int len; - char *splitChars, *string, *end; - int splitCharLen, stringLen; - Tcl_Obj *listPtr, *objPtr; - - if (objc == 2) { - splitChars = " \n\t\r"; - splitCharLen = 4; - } else if (objc == 3) { - splitChars = Tcl_GetStringFromObj(objv[2], &splitCharLen); - } else { - Tcl_WrongNumArgs(interp, 1, objv, "string ?splitChars?"); - return TCL_ERROR; - } - - string = Tcl_GetStringFromObj(objv[1], &stringLen); - end = string + stringLen; - listPtr = Tcl_GetObjResult(interp); - - if (stringLen == 0) { - /* - * Do nothing. - */ - } else if (splitCharLen == 0) { - /* - * Handle the special case of splitting on every character. - */ - - for ( ; string < end; string += len) { - len = Tcl_UtfToUniChar(string, &ch); - objPtr = Tcl_NewStringObj(string, len); - Tcl_ListObjAppendElement(NULL, listPtr, objPtr); - } - } else { - char *element, *p, *splitEnd; - int splitLen; - Tcl_UniChar splitChar; - - /* - * Normal case: split on any of a given set of characters. - * Discard instances of the split characters. - */ - - splitEnd = splitChars + splitCharLen; - - for (element = string; string < end; string += len) { - len = Tcl_UtfToUniChar(string, &ch); - for (p = splitChars; p < splitEnd; p += splitLen) { - splitLen = Tcl_UtfToUniChar(p, &splitChar); - if (ch == splitChar) { - objPtr = Tcl_NewStringObj(element, string - element); - Tcl_ListObjAppendElement(NULL, listPtr, objPtr); - element = string + len; - break; - } - } - } - objPtr = Tcl_NewStringObj(element, string - element); - Tcl_ListObjAppendElement(NULL, listPtr, objPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_StringObjCmd -- - * - * This procedure is invoked to process the "string" Tcl command. - * See the user documentation for details on what it does. Note - * that this command only functions correctly on properly formed - * Tcl UTF strings. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_StringObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int index, left, right; - Tcl_Obj *resultPtr; - char *string1, *string2; - int length1, length2; - static char *options[] = { - "compare", "first", "index", "last", - "length", "match", "range", "tolower", - "toupper", "totitle", "trim", "trimleft", - "trimright", "wordend", "wordstart", (char *) NULL - }; - enum options { - STR_COMPARE, STR_FIRST, STR_INDEX, STR_LAST, - STR_LENGTH, STR_MATCH, STR_RANGE, STR_TOLOWER, - STR_TOUPPER, STR_TOTITLE, STR_TRIM, STR_TRIMLEFT, - STR_TRIMRIGHT, STR_WORDEND, STR_WORDSTART - }; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - resultPtr = Tcl_GetObjResult(interp); - switch ((enum options) index) { - case STR_COMPARE: { - int match, length; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "string1 string2"); - return TCL_ERROR; - } - - string1 = Tcl_GetStringFromObj(objv[2], &length1); - string2 = Tcl_GetStringFromObj(objv[3], &length2); - - length = (length1 < length2) ? length1 : length2; - match = memcmp(string1, string2, (unsigned) length); - if (match == 0) { - match = length1 - length2; - } - Tcl_SetIntObj(resultPtr, (match > 0) ? 1 : (match < 0) ? -1 : 0); - break; - } - case STR_FIRST: { - register char *p, *end; - int match; - - if (objc != 4) { - badFirstLastArgs: - Tcl_WrongNumArgs(interp, 2, objv, "string1 string2"); - return TCL_ERROR; - } - - /* - * This algorithm fails on improperly formed UTF strings. - */ - - match = -1; - string1 = Tcl_GetStringFromObj(objv[2], &length1); - string2 = Tcl_GetStringFromObj(objv[3], &length2); - if (length1 > 0) { - end = string2 + length2 - length1 + 1; - for (p = string2; p < end; p++) { - /* - * Scan forward to find the first character. - */ - - p = memchr(p, *string1, (unsigned) (end - p)); - if (p == NULL) { - break; - } - if (memcmp(string1, p, (unsigned) length1) == 0) { - match = p - string2; - break; - } - } - } - - /* - * Compute the character index of the matching string by counting - * the number of characters before the match. - */ - - if (match != -1) { - match = Tcl_NumUtfChars(string2, match); - } - Tcl_SetIntObj(resultPtr, match); - break; - } - case STR_INDEX: { - int index; - Tcl_UniChar ch; - char buf[TCL_UTF_MAX]; - char *start, *end; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "string charIndex"); - return TCL_ERROR; - } - - if (Tcl_GetIntFromObj(interp, objv[3], &index) != TCL_OK) { - return TCL_ERROR; - } - if (index >= 0) { - start = Tcl_GetStringFromObj(objv[2], &length1); - end = start + length1; - for ( ; start < end; index--) { - start += Tcl_UtfToUniChar(start, &ch); - if (index == 0) { - Tcl_SetStringObj(resultPtr, buf, - Tcl_UniCharToUtf(ch, buf)); - break; - } - } - } - break; - } - case STR_LAST: { - register char *p; - int match; - - if (objc != 4) { - goto badFirstLastArgs; - } - - /* - * This algorithm fails on improperly formed UTF strings. - */ - - match = -1; - string1 = Tcl_GetStringFromObj(objv[2], &length1); - string2 = Tcl_GetStringFromObj(objv[3], &length2); - if (length1 > 0) { - for (p = string2 + length2 - length1; p >= string2; p--) { - /* - * Scan backwards to find the first character. - */ - - while ((p != string2) && (*p != *string1)) { - p--; - } - if (memcmp(string1, p, (unsigned) length1) == 0) { - match = p - string2; - break; - } - } - } - - /* - * Compute the character index of the matching string by counting - * the number of characters before the match. - */ - - if (match != -1) { - match = Tcl_NumUtfChars(string2, match); - } - Tcl_SetIntObj(resultPtr, match); - break; - } - case STR_LENGTH: { - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "string"); - return TCL_ERROR; - } - - string1 = Tcl_GetStringFromObj(objv[2], &length1); - Tcl_SetIntObj(resultPtr, Tcl_NumUtfChars(string1, length1)); - break; - } - case STR_MATCH: { - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "pattern string"); - return TCL_ERROR; - } - - string1 = Tcl_GetStringFromObj(objv[2], &length1); - string2 = Tcl_GetStringFromObj(objv[3], &length2); - Tcl_SetBooleanObj(resultPtr, Tcl_StringMatch(string2, string1)); - break; - } - case STR_RANGE: { - int first, last; - - if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "string first last"); - return TCL_ERROR; - } - - string1 = Tcl_GetStringFromObj(objv[2], &length1); - length1 = Tcl_NumUtfChars(string1, length1); - if (TclGetIntForIndex(interp, objv[3], length1 - 1, - &first) != TCL_OK) { - return TCL_ERROR; - } - if (TclGetIntForIndex(interp, objv[4], length1 - 1, - &last) != TCL_OK) { - return TCL_ERROR; - } - if (first < 0) { - first = 0; - } - if (last >= length1 - 1) { - last = length1 - 1; - } - if (last >= first) { - char *start, *end; - - start = Tcl_UtfAtIndex(string1, first); - end = Tcl_UtfAtIndex(start, last - first + 1); - Tcl_SetStringObj(resultPtr, start, end - start); - } - break; - } - case STR_TOLOWER: - case STR_TOUPPER: - case STR_TOTITLE: - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "string"); - return TCL_ERROR; - } - - string1 = Tcl_GetStringFromObj(objv[2], &length1); - - /* - * Since the result object is not a shared object, it is - * safe to copy the string into the result and do the - * conversion in place. The conversion may change the length - * of the string, so reset the length after conversion. - */ - - Tcl_SetStringObj(resultPtr, string1, length1); - if ((enum options) index == STR_TOLOWER) { - length1 = Tcl_UtfToLower(Tcl_GetStringFromObj(resultPtr, NULL)); - } else if ((enum options) index == STR_TOUPPER) { - length1 = Tcl_UtfToUpper(Tcl_GetStringFromObj(resultPtr, NULL)); - } else { - length1 = Tcl_UtfToTitle(Tcl_GetStringFromObj(resultPtr, NULL)); - } - Tcl_SetObjLength(resultPtr, length1); - break; - - case STR_TRIM: { - Tcl_UniChar ch, trim; - register char *p, *end; - char *check, *checkEnd; - int offset; - - left = 1; - right = 1; - - dotrim: - if (objc == 4) { - string2 = Tcl_GetStringFromObj(objv[3], &length2); - } else if (objc == 3) { - string2 = " \t\n\r"; - length2 = strlen(string2); - } else { - Tcl_WrongNumArgs(interp, 2, objv, "string ?chars?"); - return TCL_ERROR; - } - string1 = Tcl_GetStringFromObj(objv[2], &length1); - checkEnd = string2 + length2; - - if (left) { - end = string1 + length1; - /* - * The outer loop iterates over the string. The inner - * loop iterates over the trim characters. The loops - * terminate as soon as a non-trim character is discovered - * and string1 is left pointing at the first non-trim - * character. - */ - - for (p = string1; p < end; p += offset) { - offset = Tcl_UtfToUniChar(p, &ch); - - for (check = string2; ; ) { - if (check >= checkEnd) { - p = end; - break; - } - check += Tcl_UtfToUniChar(check, &trim); - if (ch == trim) { - length1 -= offset; - string1 += offset; - break; - } - } - } - } - if (right) { - end = string1; - - /* - * The outer loop iterates over the string. The inner - * loop iterates over the trim characters. The loops - * terminate as soon as a non-trim character is discovered - * and length1 marks the last non-trim character. - */ - - for (p = string1 + length1; p > end; ) { - p = Tcl_UtfPrev(p, string1); - offset = Tcl_UtfToUniChar(p, &ch); - for (check = string2; ; ) { - if (check >= checkEnd) { - p = end; - break; - } - check += Tcl_UtfToUniChar(check, &trim); - if (ch == trim) { - length1 -= offset; - break; - } - } - } - } - Tcl_SetStringObj(resultPtr, string1, length1); - break; - } - case STR_TRIMLEFT: { - left = 1; - right = 0; - goto dotrim; - } - case STR_TRIMRIGHT: { - left = 0; - right = 1; - goto dotrim; - } - case STR_WORDEND: { - int cur; - Tcl_UniChar ch; - char *p, *end; - int numChars; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "string index"); - return TCL_ERROR; - } - - string1 = Tcl_GetStringFromObj(objv[2], &length1); - if (Tcl_GetIntFromObj(interp, objv[3], &index) != TCL_OK) { - return TCL_ERROR; - } - if (index < 0) { - index = 0; - } - numChars = Tcl_NumUtfChars(string1, length1); - if (index < numChars) { - p = Tcl_UtfAtIndex(string1, index); - end = string1+length1; - for (cur = index; p < end; cur++) { - p += Tcl_UtfToUniChar(p, &ch); - if (!Tcl_UniCharIsWordChar(ch)) { - break; - } - } - if (cur == index) { - cur++; - } - } else { - cur = numChars; - } - Tcl_SetIntObj(resultPtr, cur); - break; - } - case STR_WORDSTART: { - int cur; - Tcl_UniChar ch; - char *p; - int numChars; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "string index"); - return TCL_ERROR; - } - - string1 = Tcl_GetStringFromObj(objv[2], &length1); - if (Tcl_GetIntFromObj(interp, objv[3], &index) != TCL_OK) { - return TCL_ERROR; - } - numChars = Tcl_NumUtfChars(string1, length1); - if (index >= numChars) { - index = numChars - 1; - } - cur = 0; - if (index > 0) { - p = Tcl_UtfAtIndex(string1, index); - for (cur = index; cur >= 0; cur--) { - Tcl_UtfToUniChar(p, &ch); - if (!Tcl_UniCharIsWordChar(ch)) { - break; - } - p = Tcl_UtfPrev(p, string1); - } - if (cur != index) { - cur += 1; - } - } - Tcl_SetIntObj(resultPtr, cur); - break; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SubstObjCmd -- - * - * This procedure is invoked to process the "subst" Tcl command. - * See the user documentation for details on what it does. This - * command is an almost direct copy of an implementation by - * Andrew Payne. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_SubstObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - static char *substOptions[] = { - "-nobackslashes", "-nocommands", "-novariables", (char *) NULL - }; - enum substOptions { - SUBST_NOBACKSLASHES, SUBST_NOCOMMANDS, SUBST_NOVARS - }; - Interp *iPtr = (Interp *) interp; - Tcl_DString result; - char *p, *old, *value; - int optionIndex, code, count, doVars, doCmds, doBackslashes, i; - - /* - * Parse command-line options. - */ - - doVars = doCmds = doBackslashes = 1; - for (i = 1; i < (objc-1); i++) { - p = Tcl_GetString(objv[i]); - if (*p != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[i], substOptions, - "switch", 0, &optionIndex) != TCL_OK) { - - return TCL_ERROR; - } - switch (optionIndex) { - case SUBST_NOBACKSLASHES: { - doBackslashes = 0; - break; - } - case SUBST_NOCOMMANDS: { - doCmds = 0; - break; - } - case SUBST_NOVARS: { - doVars = 0; - break; - } - default: { - panic("Tcl_SubstObjCmd: bad option index to SubstOptions"); - } - } - } - if (i != (objc-1)) { - Tcl_WrongNumArgs(interp, 1, objv, - "?-nobackslashes? ?-nocommands? ?-novariables? string"); - return TCL_ERROR; - } - - /* - * Scan through the string one character at a time, performing - * command, variable, and backslash substitutions. - */ - - Tcl_DStringInit(&result); - old = p = Tcl_GetString(objv[i]); - while (*p != 0) { - switch (*p) { - case '\\': - if (doBackslashes) { - char buf[TCL_UTF_MAX]; - - if (p != old) { - Tcl_DStringAppend(&result, old, p-old); - } - Tcl_DStringAppend(&result, buf, - Tcl_UtfBackslash(p, &count, buf)); - p += count; - old = p; - } else { - p++; - } - break; - - case '$': - if (doVars) { - if (p != old) { - Tcl_DStringAppend(&result, old, p-old); - } - value = Tcl_ParseVar(interp, p, &p); - if (value == NULL) { - Tcl_DStringFree(&result); - return TCL_ERROR; - } - Tcl_DStringAppend(&result, value, -1); - old = p; - } else { - p++; - } - break; - - case '[': - if (doCmds) { - if (p != old) { - Tcl_DStringAppend(&result, old, p-old); - } - iPtr->evalFlags = TCL_BRACKET_TERM; - code = Tcl_Eval(interp, p+1); - if (code == TCL_ERROR) { - Tcl_DStringFree(&result); - return code; - } - old = p = (p+1 + iPtr->termOffset+1); - Tcl_DStringAppend(&result, iPtr->result, -1); - Tcl_ResetResult(interp); - } else { - p++; - } - break; - - default: - p++; - break; - } - } - if (p != old) { - Tcl_DStringAppend(&result, old, p-old); - } - Tcl_DStringResult(interp, &result); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SwitchObjCmd -- - * - * This object-based procedure is invoked to process the "switch" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_SwitchObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int i, j, index, mode, matched, result; - char *string, *pattern; - static char *options[] = { - "-exact", "-glob", "-regexp", "--", - NULL - }; - enum options { - OPT_EXACT, OPT_GLOB, OPT_REGEXP, OPT_LAST - }; - - mode = OPT_EXACT; - for (i = 1; i < objc; i++) { - string = Tcl_GetString(objv[i]); - if (string[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - if (index == OPT_LAST) { - i++; - break; - } - mode = index; - } - - if (objc - i < 2) { - Tcl_WrongNumArgs(interp, 1, objv, - "?switches? string pattern body ... ?default body?"); - return TCL_ERROR; - } - - string = Tcl_GetString(objv[i]); - objc -= i + 1; - objv += i + 1; - - /* - * If all of the pattern/command pairs are lumped into a single - * argument, split them out again. - */ - - if (objc == 1) { - Tcl_Obj **listv; - - if (Tcl_ListObjGetElements(interp, objv[0], &objc, &listv) != TCL_OK) { - return TCL_ERROR; - } - objv = listv; - } - - for (i = 0; i < objc; i += 2) { - if (i == objc - 1) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "extra switch pattern with no body", -1); - return TCL_ERROR; - } - - /* - * See if the pattern matches the string. - */ - - pattern = Tcl_GetString(objv[i]); - matched = 0; - if ((i == objc - 2) - && (*pattern == 'd') - && (strcmp(pattern, "default") == 0)) { - matched = 1; - } else { - switch (mode) { - case OPT_EXACT: - matched = (strcmp(string, pattern) == 0); - break; - case OPT_GLOB: - matched = Tcl_StringMatch(string, pattern); - break; - case OPT_REGEXP: - matched = TclRegExpMatchObj(interp, string, objv[i]); - if (matched < 0) { - return TCL_ERROR; - } - break; - } - } - if (matched == 0) { - continue; - } - - /* - * We've got a match. Find a body to execute, skipping bodies - * that are "-". - */ - - for (j = i + 1; ; j += 2) { - if (j >= objc) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "no body specified for pattern \"", pattern, - "\"", (char *) NULL); - return TCL_ERROR; - } - if (strcmp(Tcl_GetString(objv[j]), "-") != 0) { - break; - } - } - result = Tcl_EvalObjEx(interp, objv[j], 0); - if (result == TCL_ERROR) { - char msg[100 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"%.50s\" arm line %d)", pattern, - interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); - } - return result; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_TimeObjCmd -- - * - * This object-based procedure is invoked to process the "time" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_TimeObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Tcl_Obj *objPtr; - register int i, result; - int count; - double totalMicroSec; - Tcl_Time start, stop; - char buf[100]; - - if (objc == 2) { - count = 1; - } else if (objc == 3) { - result = Tcl_GetIntFromObj(interp, objv[2], &count); - if (result != TCL_OK) { - return result; - } - } else { - Tcl_WrongNumArgs(interp, 1, objv, "command ?count?"); - return TCL_ERROR; - } - - objPtr = objv[1]; - i = count; - TclpGetTime(&start); - while (i-- > 0) { - result = Tcl_EvalObjEx(interp, objPtr, 0); - if (result != TCL_OK) { - return result; - } - } - TclpGetTime(&stop); - - totalMicroSec = - (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - sprintf(buf, "%.0f microseconds per iteration", - ((count <= 0) ? 0 : totalMicroSec/count)); - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), buf, -1); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_TraceObjCmd -- - * - * This procedure is invoked to process the "trace" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_TraceObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int optionIndex, commandLength; - char *name, *rwuOps, *command, *p; - size_t length; - static char *traceOptions[] = { - "variable", "vdelete", "vinfo", (char *) NULL - }; - enum traceOptions { - TRACE_VARIABLE, TRACE_VDELETE, TRACE_VINFO - }; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option [arg arg ...]"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], traceOptions, - "option", 0, &optionIndex) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum traceOptions) optionIndex) { - case TRACE_VARIABLE: { - int flags; - TraceVarInfo *tvarPtr; - if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "name ops command"); - return TCL_ERROR; - } - - flags = 0; - rwuOps = Tcl_GetString(objv[3]); - for (p = rwuOps; *p != 0; p++) { - if (*p == 'r') { - flags |= TCL_TRACE_READS; - } else if (*p == 'w') { - flags |= TCL_TRACE_WRITES; - } else if (*p == 'u') { - flags |= TCL_TRACE_UNSETS; - } else { - goto badOps; - } - } - if (flags == 0) { - goto badOps; - } - - command = Tcl_GetStringFromObj(objv[4], &commandLength); - length = (size_t) commandLength; - tvarPtr = (TraceVarInfo *) ckalloc((unsigned) - (sizeof(TraceVarInfo) - sizeof(tvarPtr->command) - + length + 1)); - tvarPtr->flags = flags; - tvarPtr->errMsg = NULL; - tvarPtr->length = length; - flags |= TCL_TRACE_UNSETS; - strcpy(tvarPtr->command, command); - name = Tcl_GetString(objv[2]); - if (Tcl_TraceVar(interp, name, flags, TraceVarProc, - (ClientData) tvarPtr) != TCL_OK) { - ckfree((char *) tvarPtr); - return TCL_ERROR; - } - break; - } - case TRACE_VDELETE: { - int flags; - TraceVarInfo *tvarPtr; - ClientData clientData; - - if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "name ops command"); - return TCL_ERROR; - } - - flags = 0; - rwuOps = Tcl_GetString(objv[3]); - for (p = rwuOps; *p != 0; p++) { - if (*p == 'r') { - flags |= TCL_TRACE_READS; - } else if (*p == 'w') { - flags |= TCL_TRACE_WRITES; - } else if (*p == 'u') { - flags |= TCL_TRACE_UNSETS; - } else { - goto badOps; - } - } - if (flags == 0) { - goto badOps; - } - - /* - * Search through all of our traces on this variable to - * see if there's one with the given command. If so, then - * delete the first one that matches. - */ - - command = Tcl_GetStringFromObj(objv[4], &commandLength); - length = (size_t) commandLength; - clientData = 0; - name = Tcl_GetString(objv[2]); - while ((clientData = Tcl_VarTraceInfo(interp, name, 0, - TraceVarProc, clientData)) != 0) { - tvarPtr = (TraceVarInfo *) clientData; - if ((tvarPtr->length == length) && (tvarPtr->flags == flags) - && (strncmp(command, tvarPtr->command, - (size_t) length) == 0)) { - Tcl_UntraceVar(interp, name, flags | TCL_TRACE_UNSETS, - TraceVarProc, clientData); - if (tvarPtr->errMsg != NULL) { - ckfree(tvarPtr->errMsg); - } - ckfree((char *) tvarPtr); - break; - } - } - break; - } - case TRACE_VINFO: { - ClientData clientData; - char ops[4]; - Tcl_Obj *resultListPtr, *pairObjPtr, *elemObjPtr; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "name"); - return TCL_ERROR; - } - resultListPtr = Tcl_GetObjResult(interp); - clientData = 0; - name = Tcl_GetString(objv[2]); - while ((clientData = Tcl_VarTraceInfo(interp, name, 0, - TraceVarProc, clientData)) != 0) { - - TraceVarInfo *tvarPtr = (TraceVarInfo *) clientData; - - pairObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - p = ops; - if (tvarPtr->flags & TCL_TRACE_READS) { - *p = 'r'; - p++; - } - if (tvarPtr->flags & TCL_TRACE_WRITES) { - *p = 'w'; - p++; - } - if (tvarPtr->flags & TCL_TRACE_UNSETS) { - *p = 'u'; - p++; - } - *p = '\0'; - - /* - * Build a pair (2-item list) with the ops string as - * the first obj element and the tvarPtr->command string - * as the second obj element. Append the pair (as an - * element) to the end of the result object list. - */ - - elemObjPtr = Tcl_NewStringObj(ops, -1); - Tcl_ListObjAppendElement(NULL, pairObjPtr, elemObjPtr); - elemObjPtr = Tcl_NewStringObj(tvarPtr->command, -1); - Tcl_ListObjAppendElement(NULL, pairObjPtr, elemObjPtr); - Tcl_ListObjAppendElement(interp, resultListPtr, pairObjPtr); - } - Tcl_SetObjResult(interp, resultListPtr); - break; - } - default: { - panic("Tcl_TraceObjCmd: bad option index to TraceOptions"); - } - } - return TCL_OK; - - badOps: - Tcl_AppendResult(interp, "bad operations \"", rwuOps, - "\": should be one or more of rwu", (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * TraceVarProc -- - * - * This procedure is called to handle variable accesses that have - * been traced using the "trace" command. - * - * Results: - * Normally returns NULL. If the trace command returns an error, - * then this procedure returns an error string. - * - * Side effects: - * Depends on the command associated with the trace. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static char * -TraceVarProc(clientData, interp, name1, name2, flags) - ClientData clientData; /* Information about the variable trace. */ - Tcl_Interp *interp; /* Interpreter containing variable. */ - char *name1; /* Name of variable or array. */ - char *name2; /* Name of element within array; NULL means - * scalar variable is being referenced. */ - int flags; /* OR-ed bits giving operation and other - * information. */ -{ - Tcl_SavedResult state; - TraceVarInfo *tvarPtr = (TraceVarInfo *) clientData; - char *result; - int code; - Tcl_DString cmd; - - result = NULL; - if (tvarPtr->errMsg != NULL) { - ckfree(tvarPtr->errMsg); - tvarPtr->errMsg = NULL; - } - if ((tvarPtr->flags & flags) && !(flags & TCL_INTERP_DESTROYED)) { - - /* - * Generate a command to execute by appending list elements - * for the two variable names and the operation. The five - * extra characters are for three space, the opcode character, - * and the terminating null. - */ - - if (name2 == NULL) { - name2 = ""; - } - Tcl_DStringInit(&cmd); - Tcl_DStringAppend(&cmd, tvarPtr->command, (int) tvarPtr->length); - Tcl_DStringAppendElement(&cmd, name1); - Tcl_DStringAppendElement(&cmd, name2); - if (flags & TCL_TRACE_READS) { - Tcl_DStringAppend(&cmd, " r", 2); - } else if (flags & TCL_TRACE_WRITES) { - Tcl_DStringAppend(&cmd, " w", 2); - } else if (flags & TCL_TRACE_UNSETS) { - Tcl_DStringAppend(&cmd, " u", 2); - } - - /* - * Execute the command. Save the interp's result used for - * the command. We discard any object result the command returns. - */ - - Tcl_SaveResult(interp, &state); - - code = Tcl_Eval(interp, Tcl_DStringValue(&cmd)); - if (code != TCL_OK) { /* copy error msg to result */ - char *string; - int length; - - string = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length); - tvarPtr->errMsg = (char *) ckalloc((unsigned) (length + 1)); - memcpy(tvarPtr->errMsg, string, (size_t) (length + 1)); - result = tvarPtr->errMsg; - } - - Tcl_RestoreResult(interp, &state); - - Tcl_DStringFree(&cmd); - } - if (flags & TCL_TRACE_DESTROYED) { - result = NULL; - if (tvarPtr->errMsg != NULL) { - ckfree(tvarPtr->errMsg); - } - ckfree((char *) tvarPtr); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_WhileObjCmd -- - * - * This procedure is invoked to process the "while" Tcl command. - * See the user documentation for details on what it does. - * - * With the bytecode compiler, this procedure is only called when - * a command name is computed at runtime, and is "while" or the name - * to which "while" was renamed: e.g., "set z while; $z {$i<100} {}" - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_WhileObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int result, value; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "test command"); - return TCL_ERROR; - } - - while (1) { - result = Tcl_ExprBooleanObj(interp, objv[1], &value); - if (result != TCL_OK) { - return result; - } - if (!value) { - break; - } - result = Tcl_EvalObjEx(interp, objv[2], 0); - if ((result != TCL_OK) && (result != TCL_CONTINUE)) { - if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"while\" body line %d)", - interp->errorLine); - Tcl_AddErrorInfo(interp, msg); - } - break; - } - } - if (result == TCL_BREAK) { - result = TCL_OK; - } - if (result == TCL_OK) { - Tcl_ResetResult(interp); - } - return result; -} - diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c deleted file mode 100644 index 09c3dd0..0000000 --- a/generic/tclCompCmds.c +++ /dev/null @@ -1,1980 +0,0 @@ -/* - * tclCompCmds.c -- - * - * This file contains compilation procedures that compile various - * Tcl commands into a sequence of instructions ("bytecodes"). - * - * Copyright (c) 1997-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. - * - * RCS: @(#) $Id: tclCompCmds.c,v 1.2 1999/04/16 00:46:43 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclCompile.h" - -/* - * Prototypes for procedures defined later in this file: - */ - -static ClientData DupForeachInfo _ANSI_ARGS_((ClientData clientData)); -static void FreeForeachInfo _ANSI_ARGS_(( - ClientData clientData)); - -/* - * The structures below define the AuxData types defined in this file. - */ - -AuxDataType tclForeachInfoType = { - "ForeachInfo", /* name */ - DupForeachInfo, /* dupProc */ - FreeForeachInfo /* freeProc */ -}; - -/* - *---------------------------------------------------------------------- - * - * TclCompileBreakCmd -- - * - * Procedure called to compile the "break" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK unless - * there was an error during compilation. If an error occurs then - * the interpreter's result contains a standard error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the command. - * - * Side effects: - * Instructions are added to envPtr to execute the "break" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileBreakCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - if (parsePtr->numWords != 1) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"break\"", -1); - envPtr->maxStackDepth = 0; - return TCL_ERROR; - } - - /* - * Emit a break instruction. - */ - - TclEmitOpcode(INST_BREAK, envPtr); - envPtr->maxStackDepth = 0; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileCatchCmd -- - * - * Procedure called to compile the "catch" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK if - * compilation was successful. If an error occurs then the - * interpreter's result contains a standard error message and TCL_ERROR - * is returned. If the command is too complex for TclCompileCatchCmd, - * TCL_OUT_LINE_COMPILE is returned indicating that the catch command - * should be compiled "out of line" by emitting code to invoke its - * command procedure at runtime. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the command. - * - * Side effects: - * Instructions are added to envPtr to execute the "catch" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileCatchCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - JumpFixup jumpFixup; - Tcl_Token *cmdTokenPtr, *nameTokenPtr; - char *name; - int localIndex, nameChars, range, maxDepth, startOffset, jumpDist; - int code; - char buffer[32 + TCL_INTEGER_SPACE]; - - envPtr->maxStackDepth = 0; - if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"catch command ?varName?\"", -1); - return TCL_ERROR; - } - - /* - * If a variable was specified and the catch command is at global level - * (not in a procedure), don't compile it inline: the payoff is - * too small. - */ - - if ((parsePtr->numWords == 3) && (envPtr->procPtr == NULL)) { - return TCL_OUT_LINE_COMPILE; - } - - /* - * Make sure the variable name, if any, has no substitutions and just - * refers to a local scaler. - */ - - localIndex = -1; - cmdTokenPtr = parsePtr->tokenPtr - + (parsePtr->tokenPtr->numComponents + 1); - if (parsePtr->numWords == 3) { - nameTokenPtr = cmdTokenPtr + (cmdTokenPtr->numComponents + 1); - if (nameTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { - name = nameTokenPtr[1].start; - nameChars = nameTokenPtr[1].size; - if (!TclIsLocalScalar(name, nameChars)) { - return TCL_OUT_LINE_COMPILE; - } - localIndex = TclFindCompiledLocal(nameTokenPtr[1].start, - nameTokenPtr[1].size, /*create*/ 1, - /*flags*/ VAR_SCALAR, envPtr->procPtr); - } else { - return TCL_OUT_LINE_COMPILE; - } - } - - /* - * We will compile the catch command. Emit a beginCatch instruction at - * the start of the catch body: the subcommand it controls. - */ - - maxDepth = 0; - - envPtr->exceptDepth++; - envPtr->maxExceptDepth = - TclMax(envPtr->exceptDepth, envPtr->maxExceptDepth); - range = TclCreateExceptRange(CATCH_EXCEPTION_RANGE, envPtr); - TclEmitInstInt4(INST_BEGIN_CATCH4, range, envPtr); - - startOffset = (envPtr->codeNext - envPtr->codeStart); - envPtr->exceptArrayPtr[range].codeOffset = startOffset; - code = TclCompileCmdWord(interp, cmdTokenPtr+1, - cmdTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - sprintf(buffer, "\n (\"catch\" body line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, buffer, -1); - } - goto done; - } - maxDepth = envPtr->maxStackDepth; - envPtr->exceptArrayPtr[range].numCodeBytes = - (envPtr->codeNext - envPtr->codeStart) - startOffset; - - /* - * The "no errors" epilogue code: store the body's result into the - * variable (if any), push "0" (TCL_OK) as the catch's "no error" - * result, and jump around the "error case" code. - */ - - if (localIndex != -1) { - if (localIndex <= 255) { - TclEmitInstInt1(INST_STORE_SCALAR1, localIndex, envPtr); - } else { - TclEmitInstInt4(INST_STORE_SCALAR4, localIndex, envPtr); - } - } - TclEmitOpcode(INST_POP, envPtr); - TclEmitPush(TclRegisterLiteral(envPtr, "0", 1, /*onHeap*/ 0), - envPtr); - if (maxDepth == 0) { - maxDepth = 1; - } - TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &jumpFixup); - - /* - * The "error case" code: store the body's result into the variable (if - * any), then push the error result code. The initial PC offset here is - * the catch's error target. - */ - - envPtr->exceptArrayPtr[range].catchOffset = - (envPtr->codeNext - envPtr->codeStart); - if (localIndex != -1) { - TclEmitOpcode(INST_PUSH_RESULT, envPtr); - if (localIndex <= 255) { - TclEmitInstInt1(INST_STORE_SCALAR1, localIndex, envPtr); - } else { - TclEmitInstInt4(INST_STORE_SCALAR4, localIndex, envPtr); - } - TclEmitOpcode(INST_POP, envPtr); - } - TclEmitOpcode(INST_PUSH_RETURN_CODE, envPtr); - - /* - * Update the target of the jump after the "no errors" code, then emit - * an endCatch instruction at the end of the catch command. - */ - - jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpFixup.codeOffset; - if (TclFixupForwardJump(envPtr, &jumpFixup, jumpDist, 127)) { - panic("TclCompileCatchCmd: bad jump distance %d\n", jumpDist); - } - TclEmitOpcode(INST_END_CATCH, envPtr); - - done: - envPtr->exceptDepth--; - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileContinueCmd -- - * - * Procedure called to compile the "continue" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK unless - * there was an error while parsing string. If an error occurs then - * the interpreter's result contains a standard error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the command. - * - * Side effects: - * Instructions are added to envPtr to execute the "continue" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileContinueCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - /* - * There should be no argument after the "continue". - */ - - if (parsePtr->numWords != 1) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"continue\"", -1); - envPtr->maxStackDepth = 0; - return TCL_ERROR; - } - - /* - * Emit a continue instruction. - */ - - TclEmitOpcode(INST_CONTINUE, envPtr); - envPtr->maxStackDepth = 0; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileExprCmd -- - * - * Procedure called to compile the "expr" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK - * unless there was an error while parsing string. If an error occurs - * then the interpreter's result contains a standard error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the "expr" command. - * - * Side effects: - * Instructions are added to envPtr to execute the "expr" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileExprCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - Tcl_Token *firstWordPtr; - - envPtr->maxStackDepth = 0; - if (parsePtr->numWords == 1) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"expr arg ?arg ...?\"", -1); - return TCL_ERROR; - } - - firstWordPtr = parsePtr->tokenPtr - + (parsePtr->tokenPtr->numComponents + 1); - return TclCompileExprWords(interp, firstWordPtr, (parsePtr->numWords-1), - envPtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileForCmd -- - * - * Procedure called to compile the "for" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK unless - * there was an error while parsing string. If an error occurs then - * the interpreter's result contains a standard error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the command. - * - * Side effects: - * Instructions are added to envPtr to execute the "for" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileForCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - Tcl_Token *startTokenPtr, *testTokenPtr, *nextTokenPtr, *bodyTokenPtr; - JumpFixup jumpFalseFixup; - int maxDepth, jumpBackDist, jumpBackOffset, testCodeOffset, jumpDist; - int bodyRange, nextRange, code; - unsigned char *jumpPc; - char buffer[32 + TCL_INTEGER_SPACE]; - - envPtr->maxStackDepth = 0; - if (parsePtr->numWords != 5) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"for start test next command\"", -1); - return TCL_ERROR; - } - - /* - * If the test expression requires substitutions, don't compile the for - * command inline. E.g., the expression might cause the loop to never - * execute or execute forever, as in "for {} "$x > 5" {incr x} {}". - */ - - startTokenPtr = parsePtr->tokenPtr - + (parsePtr->tokenPtr->numComponents + 1); - testTokenPtr = startTokenPtr + (startTokenPtr->numComponents + 1); - if (testTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { - return TCL_OUT_LINE_COMPILE; - } - - /* - * Create ExceptionRange records for the body and the "next" command. - * The "next" command's ExceptionRange supports break but not continue - * (and has a -1 continueOffset). - */ - - envPtr->exceptDepth++; - envPtr->maxExceptDepth = - TclMax(envPtr->exceptDepth, envPtr->maxExceptDepth); - bodyRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr); - nextRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr); - - /* - * Inline compile the initial command. - */ - - maxDepth = 0; - code = TclCompileCmdWord(interp, startTokenPtr+1, - startTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - Tcl_AddObjErrorInfo(interp, - "\n (\"for\" initial command)", -1); - } - goto done; - } - maxDepth = envPtr->maxStackDepth; - TclEmitOpcode(INST_POP, envPtr); - - /* - * Compile the test then emit the conditional jump that exits the for. - */ - - testCodeOffset = (envPtr->codeNext - envPtr->codeStart); - code = TclCompileExprWords(interp, testTokenPtr, 1, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - Tcl_AddObjErrorInfo(interp, - "\n (\"for\" test expression)", -1); - } - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpFalseFixup); - - /* - * Compile the loop body. - */ - - nextTokenPtr = testTokenPtr + (testTokenPtr->numComponents + 1); - bodyTokenPtr = nextTokenPtr + (nextTokenPtr->numComponents + 1); - envPtr->exceptArrayPtr[bodyRange].codeOffset = - (envPtr->codeNext - envPtr->codeStart); - code = TclCompileCmdWord(interp, bodyTokenPtr+1, - bodyTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - sprintf(buffer, "\n (\"for\" body line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, buffer, -1); - } - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - envPtr->exceptArrayPtr[bodyRange].numCodeBytes = - (envPtr->codeNext - envPtr->codeStart) - - envPtr->exceptArrayPtr[bodyRange].codeOffset; - TclEmitOpcode(INST_POP, envPtr); - - /* - * Compile the "next" subcommand. - */ - - envPtr->exceptArrayPtr[bodyRange].continueOffset = - (envPtr->codeNext - envPtr->codeStart); - envPtr->exceptArrayPtr[nextRange].codeOffset = - (envPtr->codeNext - envPtr->codeStart); - code = TclCompileCmdWord(interp, nextTokenPtr+1, - nextTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - Tcl_AddObjErrorInfo(interp, - "\n (\"for\" loop-end command)", -1); - } - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - envPtr->exceptArrayPtr[nextRange].numCodeBytes = - (envPtr->codeNext - envPtr->codeStart) - - envPtr->exceptArrayPtr[nextRange].codeOffset; - TclEmitOpcode(INST_POP, envPtr); - - /* - * Jump back to the test at the top of the loop. Generate a 4 byte jump - * if the distance to the test is > 120 bytes. This is conservative and - * ensures that we won't have to replace this jump if we later need to - * replace the ifFalse jump with a 4 byte jump. - */ - - jumpBackOffset = (envPtr->codeNext - envPtr->codeStart); - jumpBackDist = (jumpBackOffset - testCodeOffset); - if (jumpBackDist > 120) { - TclEmitInstInt4(INST_JUMP4, -jumpBackDist, envPtr); - } else { - TclEmitInstInt1(INST_JUMP1, -jumpBackDist, envPtr); - } - - /* - * Fix the target of the jumpFalse after the test. - */ - - jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpFalseFixup.codeOffset; - if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) { - /* - * Update the loop body and "next" command ExceptionRanges since - * they moved down. - */ - - envPtr->exceptArrayPtr[bodyRange].codeOffset += 3; - envPtr->exceptArrayPtr[bodyRange].continueOffset += 3; - envPtr->exceptArrayPtr[nextRange].codeOffset += 3; - - /* - * Update the jump back to the test at the top of the loop since it - * also moved down 3 bytes. - */ - - jumpBackOffset += 3; - jumpPc = (envPtr->codeStart + jumpBackOffset); - jumpBackDist += 3; - if (jumpBackDist > 120) { - TclUpdateInstInt4AtPc(INST_JUMP4, -jumpBackDist, jumpPc); - } else { - TclUpdateInstInt1AtPc(INST_JUMP1, -jumpBackDist, jumpPc); - } - } - - /* - * Set the loop's break target. - */ - - envPtr->exceptArrayPtr[bodyRange].breakOffset = - envPtr->exceptArrayPtr[nextRange].breakOffset = - (envPtr->codeNext - envPtr->codeStart); - - /* - * The for command's result is an empty string. - */ - - TclEmitPush(TclRegisterLiteral(envPtr, "", 0, /*onHeap*/ 0), envPtr); - if (maxDepth == 0) { - maxDepth = 1; - } - code = TCL_OK; - - done: - envPtr->maxStackDepth = maxDepth; - envPtr->exceptDepth--; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileForeachCmd -- - * - * Procedure called to compile the "foreach" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK if - * compilation was successful. If an error occurs then the - * interpreter's result contains a standard error message and TCL_ERROR - * is returned. If the command is too complex for TclCompileForeachCmd, - * TCL_OUT_LINE_COMPILE is returned indicating that the foreach command - * should be compiled "out of line" by emitting code to invoke its - * command procedure at runtime. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the "while" command. - * - * Side effects: - * Instructions are added to envPtr to execute the "foreach" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileForeachCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - Proc *procPtr = envPtr->procPtr; - ForeachInfo *infoPtr; /* Points to the structure describing this - * foreach command. Stored in a AuxData - * record in the ByteCode. */ - int firstValueTemp; /* Index of the first temp var in the frame - * used to point to a value list. */ - int loopCtTemp; /* Index of temp var holding the loop's - * iteration count. */ - Tcl_Token *tokenPtr, *bodyTokenPtr; - char *varList; - unsigned char *jumpPc; - JumpFixup jumpFalseFixup; - int jumpDist, jumpBackDist, jumpBackOffset, maxDepth, infoIndex, range; - int numWords, numLists, numVars, loopIndex, tempVar, i, j, code; - char savedChar; - char buffer[32 + TCL_INTEGER_SPACE]; - - /* - * We parse the variable list argument words and create two arrays: - * varcList[i] is number of variables in i-th var list - * varvList[i] points to array of var names in i-th var list - */ - -#define STATIC_VAR_LIST_SIZE 5 - int varcListStaticSpace[STATIC_VAR_LIST_SIZE]; - char **varvListStaticSpace[STATIC_VAR_LIST_SIZE]; - int *varcList = varcListStaticSpace; - char ***varvList = varvListStaticSpace; - - /* - * If the foreach command isn't in a procedure, don't compile it inline: - * the payoff is too small. - */ - - envPtr->maxStackDepth = 0; - if (procPtr == NULL) { - return TCL_OUT_LINE_COMPILE; - } - - maxDepth = 0; - - numWords = parsePtr->numWords; - if ((numWords < 4) || (numWords%2 != 0)) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"foreach varList list ?varList list ...? command\"", -1); - return TCL_ERROR; - } - - /* - * Allocate storage for the varcList and varvList arrays if necessary. - */ - - numLists = (numWords - 2)/2; - if (numLists > STATIC_VAR_LIST_SIZE) { - varcList = (int *) ckalloc(numLists * sizeof(int)); - varvList = (char ***) ckalloc(numLists * sizeof(char **)); - } - for (loopIndex = 0; loopIndex < numLists; loopIndex++) { - varcList[loopIndex] = 0; - varvList[loopIndex] = (char **) NULL; - } - - /* - * Set the exception stack depth. - */ - - envPtr->exceptDepth++; - envPtr->maxExceptDepth = - TclMax(envPtr->exceptDepth, envPtr->maxExceptDepth); - - /* - * Break up each var list and set the varcList and varvList arrays. - * Don't compile the foreach inline if any var name needs substitutions - * or isn't a scalar, or if any var list needs substitutions. - */ - - loopIndex = 0; - for (i = 0, tokenPtr = parsePtr->tokenPtr; - i < numWords-1; - i++, tokenPtr += (tokenPtr->numComponents + 1)) { - if (i%2 == 1) { - if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { - code = TCL_OUT_LINE_COMPILE; - goto done; - } - varList = tokenPtr[1].start; - savedChar = varList[tokenPtr[1].size]; - - /* - * Note there is a danger that modifying the string could have - * undesirable side effects. In this case, Tcl_SplitList does - * not have any dependencies on shared strings so we should be - * safe. - */ - - varList[tokenPtr[1].size] = '\0'; - code = Tcl_SplitList(interp, varList, - &varcList[loopIndex], &varvList[loopIndex]); - varList[tokenPtr[1].size] = savedChar; - if (code != TCL_OK) { - goto done; - } - - numVars = varcList[loopIndex]; - for (j = 0; j < numVars; j++) { - char *varName = varvList[loopIndex][j]; - if (!TclIsLocalScalar(varName, (int) strlen(varName))) { - code = TCL_OUT_LINE_COMPILE; - goto done; - } - } - loopIndex++; - } - } - - /* - * We will compile the foreach command. - * Reserve (numLists + 1) temporary variables: - * - numLists temps to hold each value list - * - 1 temp for the loop counter (index of next element in each list) - * At this time we don't try to reuse temporaries; if there are two - * nonoverlapping foreach loops, they don't share any temps. - */ - - firstValueTemp = -1; - for (loopIndex = 0; loopIndex < numLists; loopIndex++) { - tempVar = TclFindCompiledLocal(NULL, /*nameChars*/ 0, - /*create*/ 1, /*flags*/ VAR_SCALAR, procPtr); - if (loopIndex == 0) { - firstValueTemp = tempVar; - } - } - loopCtTemp = TclFindCompiledLocal(NULL, /*nameChars*/ 0, - /*create*/ 1, /*flags*/ VAR_SCALAR, procPtr); - - /* - * Create and initialize the ForeachInfo and ForeachVarList data - * structures describing this command. Then create a AuxData record - * pointing to the ForeachInfo structure. - */ - - infoPtr = (ForeachInfo *) ckalloc((unsigned) - (sizeof(ForeachInfo) + (numLists * sizeof(ForeachVarList *)))); - infoPtr->numLists = numLists; - infoPtr->firstValueTemp = firstValueTemp; - infoPtr->loopCtTemp = loopCtTemp; - for (loopIndex = 0; loopIndex < numLists; loopIndex++) { - ForeachVarList *varListPtr; - numVars = varcList[loopIndex]; - varListPtr = (ForeachVarList *) ckalloc((unsigned) - sizeof(ForeachVarList) + (numVars * sizeof(int))); - varListPtr->numVars = numVars; - for (j = 0; j < numVars; j++) { - char *varName = varvList[loopIndex][j]; - int nameChars = strlen(varName); - varListPtr->varIndexes[j] = TclFindCompiledLocal(varName, - nameChars, /*create*/ 1, /*flags*/ VAR_SCALAR, procPtr); - } - infoPtr->varLists[loopIndex] = varListPtr; - } - infoIndex = TclCreateAuxData((ClientData) infoPtr, &tclForeachInfoType, envPtr); - - /* - * Evaluate then store each value list in the associated temporary. - */ - - range = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr); - - loopIndex = 0; - for (i = 0, tokenPtr = parsePtr->tokenPtr; - i < numWords-1; - i++, tokenPtr += (tokenPtr->numComponents + 1)) { - if ((i%2 == 0) && (i > 0)) { - code = TclCompileTokens(interp, tokenPtr+1, - tokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - - tempVar = (firstValueTemp + loopIndex); - if (tempVar <= 255) { - TclEmitInstInt1(INST_STORE_SCALAR1, tempVar, envPtr); - } else { - TclEmitInstInt4(INST_STORE_SCALAR4, tempVar, envPtr); - } - TclEmitOpcode(INST_POP, envPtr); - loopIndex++; - } - } - bodyTokenPtr = tokenPtr; - - /* - * Initialize the temporary var that holds the count of loop iterations. - */ - - TclEmitInstInt4(INST_FOREACH_START4, infoIndex, envPtr); - - /* - * Top of loop code: assign each loop variable and check whether - * to terminate the loop. - */ - - envPtr->exceptArrayPtr[range].continueOffset = - (envPtr->codeNext - envPtr->codeStart); - TclEmitInstInt4(INST_FOREACH_STEP4, infoIndex, envPtr); - TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpFalseFixup); - - /* - * Inline compile the loop body. - */ - - envPtr->exceptArrayPtr[range].codeOffset = - (envPtr->codeNext - envPtr->codeStart); - code = TclCompileCmdWord(interp, bodyTokenPtr+1, - bodyTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - sprintf(buffer, "\n (\"foreach\" body line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, buffer, -1); - } - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - envPtr->exceptArrayPtr[range].numCodeBytes = - (envPtr->codeNext - envPtr->codeStart) - - envPtr->exceptArrayPtr[range].codeOffset; - TclEmitOpcode(INST_POP, envPtr); - - /* - * Jump back to the test at the top of the loop. Generate a 4 byte jump - * if the distance to the test is > 120 bytes. This is conservative and - * ensures that we won't have to replace this jump if we later need to - * replace the ifFalse jump with a 4 byte jump. - */ - - jumpBackOffset = (envPtr->codeNext - envPtr->codeStart); - jumpBackDist = - (jumpBackOffset - envPtr->exceptArrayPtr[range].continueOffset); - if (jumpBackDist > 120) { - TclEmitInstInt4(INST_JUMP4, -jumpBackDist, envPtr); - } else { - TclEmitInstInt1(INST_JUMP1, -jumpBackDist, envPtr); - } - - /* - * Fix the target of the jump after the foreach_step test. - */ - - jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpFalseFixup.codeOffset; - if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) { - /* - * Update the loop body's starting PC offset since it moved down. - */ - - envPtr->exceptArrayPtr[range].codeOffset += 3; - - /* - * Update the jump back to the test at the top of the loop since it - * also moved down 3 bytes. - */ - - jumpBackOffset += 3; - jumpPc = (envPtr->codeStart + jumpBackOffset); - jumpBackDist += 3; - if (jumpBackDist > 120) { - TclUpdateInstInt4AtPc(INST_JUMP4, -jumpBackDist, jumpPc); - } else { - TclUpdateInstInt1AtPc(INST_JUMP1, -jumpBackDist, jumpPc); - } - } - - /* - * Set the loop's break target. - */ - - envPtr->exceptArrayPtr[range].breakOffset = - (envPtr->codeNext - envPtr->codeStart); - - /* - * The foreach command's result is an empty string. - */ - - TclEmitPush(TclRegisterLiteral(envPtr, "", 0, /*onHeap*/ 0), envPtr); - if (maxDepth == 0) { - maxDepth = 1; - } - - done: - for (loopIndex = 0; loopIndex < numLists; loopIndex++) { - if (varvList[loopIndex] != (char **) NULL) { - ckfree((char *) varvList[loopIndex]); - } - } - if (varcList != varcListStaticSpace) { - ckfree((char *) varcList); - ckfree((char *) varvList); - } - envPtr->maxStackDepth = maxDepth; - envPtr->exceptDepth--; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * DupForeachInfo -- - * - * This procedure duplicates a ForeachInfo structure created as - * auxiliary data during the compilation of a foreach command. - * - * Results: - * A pointer to a newly allocated copy of the existing ForeachInfo - * structure is returned. - * - * Side effects: - * Storage for the copied ForeachInfo record is allocated. If the - * original ForeachInfo structure pointed to any ForeachVarList - * records, these structures are also copied and pointers to them - * are stored in the new ForeachInfo record. - * - *---------------------------------------------------------------------- - */ - -static ClientData -DupForeachInfo(clientData) - ClientData clientData; /* The foreach command's compilation - * auxiliary data to duplicate. */ -{ - register ForeachInfo *srcPtr = (ForeachInfo *) clientData; - ForeachInfo *dupPtr; - register ForeachVarList *srcListPtr, *dupListPtr; - int numLists = srcPtr->numLists; - int numVars, i, j; - - dupPtr = (ForeachInfo *) ckalloc((unsigned) - (sizeof(ForeachInfo) + (numLists * sizeof(ForeachVarList *)))); - dupPtr->numLists = numLists; - dupPtr->firstValueTemp = srcPtr->firstValueTemp; - dupPtr->loopCtTemp = srcPtr->loopCtTemp; - - for (i = 0; i < numLists; i++) { - srcListPtr = srcPtr->varLists[i]; - numVars = srcListPtr->numVars; - dupListPtr = (ForeachVarList *) ckalloc((unsigned) - sizeof(ForeachVarList) + numVars*sizeof(int)); - dupListPtr->numVars = numVars; - for (j = 0; j < numVars; j++) { - dupListPtr->varIndexes[j] = srcListPtr->varIndexes[j]; - } - dupPtr->varLists[i] = dupListPtr; - } - return (ClientData) dupPtr; -} - -/* - *---------------------------------------------------------------------- - * - * FreeForeachInfo -- - * - * Procedure to free a ForeachInfo structure created as auxiliary data - * during the compilation of a foreach command. - * - * Results: - * None. - * - * Side effects: - * Storage for the ForeachInfo structure pointed to by the ClientData - * argument is freed as is any ForeachVarList record pointed to by the - * ForeachInfo structure. - * - *---------------------------------------------------------------------- - */ - -static void -FreeForeachInfo(clientData) - ClientData clientData; /* The foreach command's compilation - * auxiliary data to free. */ -{ - register ForeachInfo *infoPtr = (ForeachInfo *) clientData; - register ForeachVarList *listPtr; - int numLists = infoPtr->numLists; - register int i; - - for (i = 0; i < numLists; i++) { - listPtr = infoPtr->varLists[i]; - ckfree((char *) listPtr); - } - ckfree((char *) infoPtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileIfCmd -- - * - * Procedure called to compile the "if" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK if - * compilation was successful. If an error occurs then the - * interpreter's result contains a standard error message and TCL_ERROR - * is returned. If the command is too complex for TclCompileIfCmd, - * TCL_OUT_LINE_COMPILE is returned indicating that the if command - * should be compiled "out of line" by emitting code to invoke its - * command procedure at runtime. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the command. - * - * Side effects: - * Instructions are added to envPtr to execute the "if" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileIfCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - JumpFixupArray jumpFalseFixupArray; - /* Used to fix the ifFalse jump after each - * test when its target PC is determined. */ - JumpFixupArray jumpEndFixupArray; - /* Used to fix the jump after each "then" - * body to the end of the "if" when that PC - * is determined. */ - Tcl_Token *tokenPtr, *testTokenPtr; - int jumpDist, jumpFalseDist, jumpIndex; - int numWords, wordIdx, numBytes, maxDepth, j, code; - char *word; - char buffer[100]; - - TclInitJumpFixupArray(&jumpFalseFixupArray); - TclInitJumpFixupArray(&jumpEndFixupArray); - maxDepth = 0; - code = TCL_OK; - - /* - * Each iteration of this loop compiles one "if expr ?then? body" - * or "elseif expr ?then? body" clause. - */ - - tokenPtr = parsePtr->tokenPtr; - wordIdx = 0; - numWords = parsePtr->numWords; - while (wordIdx < numWords) { - /* - * Stop looping if the token isn't "if" or "elseif". - */ - - if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { - break; - } - word = tokenPtr[1].start; - numBytes = tokenPtr[1].size; - if ((tokenPtr == parsePtr->tokenPtr) - || ((numBytes == 6) && (strncmp(word, "elseif", 6) == 0))) { - tokenPtr += (tokenPtr->numComponents + 1); - wordIdx++; - } else { - break; - } - if (wordIdx >= numWords) { - sprintf(buffer, - "wrong # args: no expression after \"%.30s\" argument", - word); - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), buffer, -1); - code = TCL_ERROR; - goto done; - } - - /* - * Compile the test expression then emit the conditional jump - * around the "then" part. If the expression word isn't simple, - * we back off and compile the if command out-of-line. - */ - - testTokenPtr = tokenPtr; - code = TclCompileExprWords(interp, testTokenPtr, 1, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - Tcl_AddObjErrorInfo(interp, - "\n (\"if\" test expression)", -1); - } - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - if (jumpFalseFixupArray.next >= jumpFalseFixupArray.end) { - TclExpandJumpFixupArray(&jumpFalseFixupArray); - } - jumpIndex = jumpFalseFixupArray.next; - jumpFalseFixupArray.next++; - TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, - &(jumpFalseFixupArray.fixup[jumpIndex])); - - /* - * Skip over the optional "then" before the then clause. - */ - - tokenPtr = testTokenPtr + (testTokenPtr->numComponents + 1); - wordIdx++; - if (wordIdx >= numWords) { - sprintf(buffer, "wrong # args: no script following \"%.20s\" argument", testTokenPtr->start); - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), buffer, -1); - code = TCL_ERROR; - goto done; - } - if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { - word = tokenPtr[1].start; - numBytes = tokenPtr[1].size; - if ((numBytes == 4) && (strncmp(word, "then", 4) == 0)) { - tokenPtr += (tokenPtr->numComponents + 1); - wordIdx++; - if (wordIdx >= numWords) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: no script following \"then\" argument", -1); - code = TCL_ERROR; - goto done; - } - } - } - - /* - * Compile the "then" command body. - */ - - code = TclCompileCmdWord(interp, tokenPtr+1, - tokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - sprintf(buffer, "\n (\"if\" then script line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, buffer, -1); - } - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - - /* - * Jump to the end of the "if" command. Both jumpFalseFixupArray and - * jumpEndFixupArray are indexed by "jumpIndex". - */ - - if (jumpEndFixupArray.next >= jumpEndFixupArray.end) { - TclExpandJumpFixupArray(&jumpEndFixupArray); - } - jumpEndFixupArray.next++; - TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, - &(jumpEndFixupArray.fixup[jumpIndex])); - - /* - * Fix the target of the jumpFalse after the test. Generate a 4 byte - * jump if the distance is > 120 bytes. This is conservative, and - * ensures that we won't have to replace this jump if we later also - * need to replace the proceeding jump to the end of the "if" with a - * 4 byte jump. - */ - - jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpFalseFixupArray.fixup[jumpIndex].codeOffset; - if (TclFixupForwardJump(envPtr, - &(jumpFalseFixupArray.fixup[jumpIndex]), jumpDist, 120)) { - /* - * Adjust the code offset for the proceeding jump to the end - * of the "if" command. - */ - - jumpEndFixupArray.fixup[jumpIndex].codeOffset += 3; - } - - tokenPtr += (tokenPtr->numComponents + 1); - wordIdx++; - } - - /* - * Check for the optional else clause. - */ - - if ((wordIdx < numWords) - && (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD)) { - /* - * There is an else clause. Skip over the optional "else" word. - */ - - word = tokenPtr[1].start; - numBytes = tokenPtr[1].size; - if ((numBytes == 4) && (strncmp(word, "else", 4) == 0)) { - tokenPtr += (tokenPtr->numComponents + 1); - wordIdx++; - if (wordIdx >= numWords) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: no script following \"else\" argument", -1); - code = TCL_ERROR; - goto done; - } - } - - /* - * Compile the else command body. - */ - - code = TclCompileCmdWord(interp, tokenPtr+1, - tokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - sprintf(buffer, "\n (\"if\" else script line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, buffer, -1); - } - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - - /* - * Make sure there are no words after the else clause. - */ - - wordIdx++; - if (wordIdx < numWords) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: extra words after \"else\" clause in \"if\" command", -1); - code = TCL_ERROR; - goto done; - } - } else { - /* - * No else clause: the "if" command's result is an empty string. - */ - - TclEmitPush(TclRegisterLiteral(envPtr, "", 0,/*onHeap*/ 0), envPtr); - maxDepth = TclMax(1, maxDepth); - } - - /* - * Fix the unconditional jumps to the end of the "if" command. - */ - - for (j = jumpEndFixupArray.next; j > 0; j--) { - jumpIndex = (j - 1); /* i.e. process the closest jump first */ - jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpEndFixupArray.fixup[jumpIndex].codeOffset; - if (TclFixupForwardJump(envPtr, - &(jumpEndFixupArray.fixup[jumpIndex]), jumpDist, 127)) { - /* - * Adjust the immediately preceeding "ifFalse" jump. We moved - * it's target (just after this jump) down three bytes. - */ - - unsigned char *ifFalsePc = envPtr->codeStart - + jumpFalseFixupArray.fixup[jumpIndex].codeOffset; - unsigned char opCode = *ifFalsePc; - if (opCode == INST_JUMP_FALSE1) { - jumpFalseDist = TclGetInt1AtPtr(ifFalsePc + 1); - jumpFalseDist += 3; - TclStoreInt1AtPtr(jumpFalseDist, (ifFalsePc + 1)); - } else if (opCode == INST_JUMP_FALSE4) { - jumpFalseDist = TclGetInt4AtPtr(ifFalsePc + 1); - jumpFalseDist += 3; - TclStoreInt4AtPtr(jumpFalseDist, (ifFalsePc + 1)); - } else { - panic("TclCompileIfCmd: unexpected opcode updating ifFalse jump"); - } - } - } - - /* - * Free the jumpFixupArray array if malloc'ed storage was used. - */ - - done: - TclFreeJumpFixupArray(&jumpFalseFixupArray); - TclFreeJumpFixupArray(&jumpEndFixupArray); - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileIncrCmd -- - * - * Procedure called to compile the "incr" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK if - * compilation was successful. If an error occurs then the - * interpreter's result contains a standard error message and TCL_ERROR - * is returned. If the command is too complex for TclCompileIncrCmd, - * TCL_OUT_LINE_COMPILE is returned indicating that the incr command - * should be compiled "out of line" by emitting code to invoke its - * command procedure at runtime. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the "incr" command. - * - * Side effects: - * Instructions are added to envPtr to execute the "incr" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileIncrCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - Tcl_Token *varTokenPtr, *incrTokenPtr; - Tcl_Parse elemParse; - int gotElemParse = 0; - char *name, *elName, *p; - int nameChars, elNameChars, haveImmValue, immValue, localIndex, i, code; - int maxDepth = 0; - char buffer[160]; - - envPtr->maxStackDepth = 0; - if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"incr varName ?increment?\"", -1); - return TCL_ERROR; - } - - name = NULL; - elName = NULL; - elNameChars = 0; - localIndex = -1; - code = TCL_OK; - - varTokenPtr = parsePtr->tokenPtr - + (parsePtr->tokenPtr->numComponents + 1); - if (varTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { - /* - * A simple variable name. Divide it up into "name" and "elName" - * strings. If it is not a local variable, look it up at runtime. - */ - - name = varTokenPtr[1].start; - nameChars = varTokenPtr[1].size; - for (i = 0, p = name; i < nameChars; i++, p++) { - if (*p == '(') { - char *openParen = p; - p = (name + nameChars-1); - if (*p == ')') { /* last char is ')' => array reference */ - nameChars = (openParen - name); - elName = openParen+1; - elNameChars = (p - elName); - } - break; - } - } - if (envPtr->procPtr != NULL) { - localIndex = TclFindCompiledLocal(name, nameChars, - /*create*/ 0, /*flags*/ 0, envPtr->procPtr); - if (localIndex > 255) { /* we'll push the name */ - localIndex = -1; - } - } - if (localIndex < 0) { - TclEmitPush(TclRegisterLiteral(envPtr, name, nameChars, - /*onHeap*/ 0), envPtr); - maxDepth = 1; - } - - /* - * Compile the element script, if any. - */ - - if (elName != NULL) { - /* - * Temporarily replace the '(' and ')' by '"'s. - */ - - *(elName-1) = '"'; - *(elName+elNameChars) = '"'; - code = Tcl_ParseCommand(interp, elName-1, elNameChars+2, - /*nested*/ 0, &elemParse); - *(elName-1) = '('; - *(elName+elNameChars) = ')'; - gotElemParse = 1; - if ((code != TCL_OK) || (elemParse.numWords > 1)) { - sprintf(buffer, "\n (parsing index for array \"%.*s\")", - TclMin(nameChars, 100), name); - Tcl_AddObjErrorInfo(interp, buffer, -1); - code = TCL_ERROR; - goto done; - } else if (elemParse.numWords == 1) { - code = TclCompileTokens(interp, elemParse.tokenPtr+1, - elemParse.tokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth += envPtr->maxStackDepth; - } else { - TclEmitPush(TclRegisterLiteral(envPtr, "", 0, - /*alreadyAlloced*/ 0), envPtr); - maxDepth += 1; - } - } - } else { - /* - * Not a simple variable name. Look it up at runtime. - */ - - code = TclCompileTokens(interp, varTokenPtr+1, - varTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - } - - /* - * If an increment is given, push it, but see first if it's a small - * integer. - */ - - haveImmValue = 0; - immValue = 0; - if (parsePtr->numWords == 3) { - incrTokenPtr = varTokenPtr + (varTokenPtr->numComponents + 1); - if (incrTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { - char *word = incrTokenPtr[1].start; - int numBytes = incrTokenPtr[1].size; - char savedChar = word[numBytes]; - long n; - - /* - * Note there is a danger that modifying the string could have - * undesirable side effects. In this case, TclLooksLikeInt and - * TclGetLong do not have any dependencies on shared strings so we - * should be safe. - */ - - word[numBytes] = '\0'; - if (TclLooksLikeInt(word, numBytes) - && (TclGetLong((Tcl_Interp *) NULL, word, &n) == TCL_OK)) { - if ((-127 <= n) && (n <= 127)) { - haveImmValue = 1; - immValue = n; - } - } - word[numBytes] = savedChar; - if (!haveImmValue) { - TclEmitPush(TclRegisterLiteral(envPtr, word, numBytes, - /*onHeap*/ 0), envPtr); - maxDepth += 1; - } - } else { - code = TclCompileTokens(interp, incrTokenPtr+1, - incrTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - Tcl_AddObjErrorInfo(interp, - "\n (increment expression)", -1); - } - goto done; - } - maxDepth += envPtr->maxStackDepth; - } - } else { /* no incr amount given so use 1 */ - haveImmValue = 1; - immValue = 1; - } - - /* - * Emit the instruction to increment the variable. - */ - - if (name != NULL) { - if (elName == NULL) { - if (localIndex >= 0) { - if (haveImmValue) { - TclEmitInstInt1(INST_INCR_SCALAR1_IMM, localIndex, - envPtr); - TclEmitInt1(immValue, envPtr); - } else { - TclEmitInstInt1(INST_INCR_SCALAR1, localIndex, envPtr); - } - } else { - if (haveImmValue) { - TclEmitInstInt1(INST_INCR_SCALAR_STK_IMM, immValue, - envPtr); - } else { - TclEmitOpcode(INST_INCR_SCALAR_STK, envPtr); - } - } - } else { - if (localIndex >= 0) { - if (haveImmValue) { - TclEmitInstInt1(INST_INCR_ARRAY1_IMM, localIndex, - envPtr); - TclEmitInt1(immValue, envPtr); - } else { - TclEmitInstInt1(INST_INCR_ARRAY1, localIndex, envPtr); - } - } else { - if (haveImmValue) { - TclEmitInstInt1(INST_INCR_ARRAY_STK_IMM, immValue, - envPtr); - } else { - TclEmitOpcode(INST_INCR_ARRAY_STK, envPtr); - } - } - } - } else { /* non-simple variable name */ - if (haveImmValue) { - TclEmitInstInt1(INST_INCR_STK_IMM, immValue, envPtr); - } else { - TclEmitOpcode(INST_INCR_STK, envPtr); - } - } - - done: - if (gotElemParse) { - Tcl_FreeParse(&elemParse); - } - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileSetCmd -- - * - * Procedure called to compile the "set" command. - * - * Results: - * The return value is a standard Tcl result, which is normally TCL_OK - * unless there was an error while parsing string. If an error occurs - * then the interpreter's result contains a standard error message. If - * complation fails because the set command requires a second level of - * substitutions, TCL_OUT_LINE_COMPILE is returned indicating that the - * set command should be compiled "out of line" by emitting code to - * invoke its command procedure (Tcl_SetCmd) at runtime. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the incr command. - * - * Side effects: - * Instructions are added to envPtr to execute the "set" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileSetCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - Tcl_Token *varTokenPtr, *valueTokenPtr; - Tcl_Parse elemParse; - int gotElemParse = 0; - register char *p; - char *name, *elName; - int nameChars, elNameChars; - register int i; - int isAssignment, simpleVarName, localIndex, numWords; - int maxDepth = 0; - int code = TCL_OK; - - envPtr->maxStackDepth = 0; - numWords = parsePtr->numWords; - if ((numWords != 2) && (numWords != 3)) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"set varName ?newValue?\"", -1); - return TCL_ERROR; - } - isAssignment = (numWords == 3); - - /* - * Decide if we can use a frame slot for the var/array name or if we - * need to emit code to compute and push the name at runtime. We use a - * frame slot (entry in the array of local vars) if we are compiling a - * procedure body and if the name is simple text that does not include - * namespace qualifiers. - */ - - simpleVarName = 0; - name = elName = NULL; - nameChars = elNameChars = 0; - localIndex = -1; - - varTokenPtr = parsePtr->tokenPtr - + (parsePtr->tokenPtr->numComponents + 1); - if (varTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { - simpleVarName = 1; - name = varTokenPtr[1].start; - nameChars = varTokenPtr[1].size; - /* last char is ')' => potential array reference */ - if ( *(name + nameChars - 1) == ')') { - for (i = 0, p = name; i < nameChars; i++, p++) { - if (*p == '(') { - elName = p + 1; - elNameChars = nameChars - i - 2; - nameChars = i ; - break; - } - } - } - - /* - * If elName contains any double quotes ("), we can't inline - * compile the element script using the replace '()' by '"' - * technique below. - */ - - for (i = 0, p = elName; i < elNameChars; i++, p++) { - if (*p == '"') { - simpleVarName = 0; - break; - } - } - } else if ((varTokenPtr->numComponents == 4) - && (varTokenPtr[1].type == TCL_TOKEN_TEXT) - && (varTokenPtr[1].start[varTokenPtr[1].size-1] == '(') - && (varTokenPtr[4].type == TCL_TOKEN_TEXT) - && (varTokenPtr[4].size == 1) - && (varTokenPtr[4].start[0] == ')')) { - simpleVarName = 1; - name = varTokenPtr[1].start; - nameChars = varTokenPtr[1].size - 1; - elName = varTokenPtr[2].start; - elNameChars = varTokenPtr[2].size; - } - - if (simpleVarName) { - /* - * See whether name has any namespace separators (::'s). - */ - - int hasNsQualifiers = 0; - for (i = 0, p = name; i < nameChars; i++, p++) { - if ((*p == ':') && ((i+1) < nameChars) && (*(p+1) == ':')) { - hasNsQualifiers = 1; - break; - } - } - - /* - * Look up the var name's index in the array of local vars in the - * proc frame. If retrieving the var's value and it doesn't already - * exist, push its name and look it up at runtime. - */ - - if ((envPtr->procPtr != NULL) && !hasNsQualifiers) { - localIndex = TclFindCompiledLocal(name, nameChars, - /*create*/ isAssignment, - /*flags*/ ((elName==NULL)? VAR_SCALAR : VAR_ARRAY), - envPtr->procPtr); - } - if (localIndex >= 0) { - maxDepth = 0; - } else { - TclEmitPush(TclRegisterLiteral(envPtr, name, nameChars, - /*onHeap*/ 0), envPtr); - maxDepth = 1; - } - - /* - * Compile the element script, if any. - */ - - if (elName != NULL) { - /* - * Temporarily replace the '(' and ')' by '"'s. - */ - - *(elName-1) = '"'; - *(elName+elNameChars) = '"'; - code = Tcl_ParseCommand(interp, elName-1, elNameChars+2, - /*nested*/ 0, &elemParse); - *(elName-1) = '('; - *(elName+elNameChars) = ')'; - gotElemParse = 1; - if ((code != TCL_OK) || (elemParse.numWords > 1)) { - char buffer[160]; - sprintf(buffer, "\n (parsing index for array \"%.*s\")", - TclMin(nameChars, 100), name); - Tcl_AddObjErrorInfo(interp, buffer, -1); - code = TCL_ERROR; - goto done; - } else if (elemParse.numWords == 1) { - code = TclCompileTokens(interp, elemParse.tokenPtr+1, - elemParse.tokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth += envPtr->maxStackDepth; - } else { - TclEmitPush(TclRegisterLiteral(envPtr, "", 0, - /*alreadyAlloced*/ 0), envPtr); - maxDepth += 1; - } - } - } else { - /* - * The var name isn't simple: compile and push it. - */ - - code = TclCompileTokens(interp, varTokenPtr+1, - varTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth += envPtr->maxStackDepth; - } - - /* - * If we are doing an assignment, push the new value. - */ - - if (isAssignment) { - valueTokenPtr = varTokenPtr + (varTokenPtr->numComponents + 1); - if (valueTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { - TclEmitPush(TclRegisterLiteral(envPtr, valueTokenPtr[1].start, - valueTokenPtr[1].size, /*onHeap*/ 0), envPtr); - maxDepth += 1; - } else { - code = TclCompileTokens(interp, valueTokenPtr+1, - valueTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth += envPtr->maxStackDepth; - } - } - - /* - * Emit instructions to set/get the variable. - */ - - if (simpleVarName) { - if (elName == NULL) { - if (localIndex >= 0) { - if (localIndex <= 255) { - TclEmitInstInt1((isAssignment? - INST_STORE_SCALAR1 : INST_LOAD_SCALAR1), - localIndex, envPtr); - } else { - TclEmitInstInt4((isAssignment? - INST_STORE_SCALAR4 : INST_LOAD_SCALAR4), - localIndex, envPtr); - } - } else { - TclEmitOpcode((isAssignment? - INST_STORE_SCALAR_STK : INST_LOAD_SCALAR_STK), - envPtr); - } - } else { - if (localIndex >= 0) { - if (localIndex <= 255) { - TclEmitInstInt1((isAssignment? - INST_STORE_ARRAY1 : INST_LOAD_ARRAY1), - localIndex, envPtr); - } else { - TclEmitInstInt4((isAssignment? - INST_STORE_ARRAY4 : INST_LOAD_ARRAY4), - localIndex, envPtr); - } - } else { - TclEmitOpcode((isAssignment? - INST_STORE_ARRAY_STK : INST_LOAD_ARRAY_STK), - envPtr); - } - } - } else { - TclEmitOpcode((isAssignment? INST_STORE_STK : INST_LOAD_STK), - envPtr); - } - - done: - if (gotElemParse) { - Tcl_FreeParse(&elemParse); - } - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileWhileCmd -- - * - * Procedure called to compile the "while" command. - * - * Results: - * The return value is a standard Tcl result, which is TCL_OK if - * compilation was successful. If an error occurs then the - * interpreter's result contains a standard error message and TCL_ERROR - * is returned. If compilation failed because the command is too - * complex for TclCompileWhileCmd, TCL_OUT_LINE_COMPILE is returned - * indicating that the while command should be compiled "out of line" - * by emitting code to invoke its command procedure at runtime. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the "while" command. - * - * Side effects: - * Instructions are added to envPtr to execute the "while" command - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileWhileCmd(interp, parsePtr, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Points to a parse structure for the - * command created by Tcl_ParseCommand. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - Tcl_Token *testTokenPtr, *bodyTokenPtr; - JumpFixup jumpFalseFixup; - unsigned char *jumpPc; - int testCodeOffset, jumpDist, jumpBackDist, jumpBackOffset; - int range, maxDepth, code; - char buffer[32 + TCL_INTEGER_SPACE]; - - envPtr->maxStackDepth = 0; - maxDepth = 0; - if (parsePtr->numWords != 3) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be \"while test command\"", -1); - return TCL_ERROR; - } - - /* - * If the test expression requires substitutions, don't compile the - * while command inline. E.g., the expression might cause the loop to - * never execute or execute forever, as in "while "$x < 5" {}". - */ - - testTokenPtr = parsePtr->tokenPtr - + (parsePtr->tokenPtr->numComponents + 1); - if (testTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { - return TCL_OUT_LINE_COMPILE; - } - - /* - * Create a ExceptionRange record for the loop body. This is used to - * implement break and continue. - */ - - envPtr->exceptDepth++; - envPtr->maxExceptDepth = - TclMax(envPtr->exceptDepth, envPtr->maxExceptDepth); - range = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr); - envPtr->exceptArrayPtr[range].continueOffset = - (envPtr->codeNext - envPtr->codeStart); - - /* - * Compile the test expression then emit the conditional jump that - * terminates the while. We already know it's a simple word. - */ - - testCodeOffset = (envPtr->codeNext - envPtr->codeStart); - envPtr->exceptArrayPtr[range].continueOffset = testCodeOffset; - code = TclCompileExprWords(interp, testTokenPtr, 1, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - Tcl_AddObjErrorInfo(interp, - "\n (\"while\" test expression)", -1); - } - goto error; - } - maxDepth = envPtr->maxStackDepth; - TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpFalseFixup); - - /* - * Compile the loop body. - */ - - bodyTokenPtr = testTokenPtr + (testTokenPtr->numComponents + 1); - envPtr->exceptArrayPtr[range].codeOffset = - (envPtr->codeNext - envPtr->codeStart); - code = TclCompileCmdWord(interp, bodyTokenPtr+1, - bodyTokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - sprintf(buffer, "\n (\"while\" body line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, buffer, -1); - } - goto error; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - envPtr->exceptArrayPtr[range].numCodeBytes = - (envPtr->codeNext - envPtr->codeStart) - - envPtr->exceptArrayPtr[range].codeOffset; - TclEmitOpcode(INST_POP, envPtr); - - /* - * Jump back to the test at the top of the loop. Generate a 4 byte jump - * if the distance to the test is > 120 bytes. This is conservative and - * ensures that we won't have to replace this jump if we later need to - * replace the ifFalse jump with a 4 byte jump. - */ - - jumpBackOffset = (envPtr->codeNext - envPtr->codeStart); - jumpBackDist = (jumpBackOffset - testCodeOffset); - if (jumpBackDist > 120) { - TclEmitInstInt4(INST_JUMP4, -jumpBackDist, envPtr); - } else { - TclEmitInstInt1(INST_JUMP1, -jumpBackDist, envPtr); - } - - /* - * Fix the target of the jumpFalse after the test. - */ - - jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpFalseFixup.codeOffset; - if (TclFixupForwardJump(envPtr, &jumpFalseFixup, jumpDist, 127)) { - /* - * Update the loop body's starting PC offset since it moved down. - */ - - envPtr->exceptArrayPtr[range].codeOffset += 3; - - /* - * Update the jump back to the test at the top of the loop since it - * also moved down 3 bytes. - */ - - jumpBackOffset += 3; - jumpPc = (envPtr->codeStart + jumpBackOffset); - jumpBackDist += 3; - if (jumpBackDist > 120) { - TclUpdateInstInt4AtPc(INST_JUMP4, -jumpBackDist, jumpPc); - } else { - TclUpdateInstInt1AtPc(INST_JUMP1, -jumpBackDist, jumpPc); - } - } - - /* - * Set the loop's break target. - */ - - envPtr->exceptArrayPtr[range].breakOffset = - (envPtr->codeNext - envPtr->codeStart); - - /* - * The while command's result is an empty string. - */ - - TclEmitPush(TclRegisterLiteral(envPtr, "", 0, /*onHeap*/ 0), envPtr); - if (maxDepth == 0) { - maxDepth = 1; - } - envPtr->maxStackDepth = maxDepth; - envPtr->exceptDepth--; - return TCL_OK; - - error: - envPtr->maxStackDepth = maxDepth; - envPtr->exceptDepth--; - return code; -} - - - diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c deleted file mode 100644 index 42342b1..0000000 --- a/generic/tclCompExpr.c +++ /dev/null @@ -1,1048 +0,0 @@ -/* - * tclCompExpr.c -- - * - * This file contains the code to compile Tcl expressions. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclCompExpr.c,v 1.3 1999/04/16 00:46:44 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclCompile.h" - -/* - * The stuff below is a bit of a hack so that this file can be used in - * environments that include no UNIX, i.e. no errno: just arrange to use - * the errno from tclExecute.c here. - */ - -#ifndef TCL_GENERIC_ONLY -#include "tclPort.h" -#else -#define NO_ERRNO_H -#endif - -#ifdef NO_ERRNO_H -extern int errno; /* Use errno from tclExecute.c. */ -#define ERANGE 34 -#endif - -/* - * Boolean variable that controls whether expression compilation tracing - * is enabled. - */ - -#ifdef TCL_COMPILE_DEBUG -static int traceExprComp = 0; -#endif /* TCL_COMPILE_DEBUG */ - -/* - * The ExprInfo structure describes the state of compiling an expression. - * A pointer to an ExprInfo record is passed among the routines in - * this module. - */ - -typedef struct ExprInfo { - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Parse *parsePtr; /* Structure filled with information about - * the parsed expression. */ - char *expr; /* The expression that was originally passed - * to TclCompileExpr. */ - char *lastChar; /* Points just after last byte of expr. */ - int hasOperators; /* Set 1 if the expr has operators; 0 if - * expr is only a primary. If 1 after - * compiling an expr, a tryCvtToNumeric - * instruction is emitted to convert the - * primary to a number if possible. */ - int exprIsJustVarRef; /* Set 1 if the expr consists of just a - * variable reference as in the expression - * of "if $b then...". Otherwise 0. If 1 the - * expr is compiled out-of-line in order to - * implement expr's 2 level substitution - * semantics properly. */ - int exprIsComparison; /* Set 1 if the top-level operator in the - * expr is a comparison. Otherwise 0. If 1, - * because the operands might be strings, - * the expr is compiled out-of-line in order - * to implement expr's 2 level substitution - * semantics properly. */ -} ExprInfo; - -/* - * Definitions of numeric codes representing each expression operator. - * The order of these must match the entries in the operatorTable below. - * Also the codes for the relational operators (OP_LESS, OP_GREATER, - * OP_LE, OP_GE, OP_EQ, and OP_NE) must be consecutive and in that order. - * Note that OP_PLUS and OP_MINUS represent both unary and binary operators. - */ - -#define OP_MULT 0 -#define OP_DIVIDE 1 -#define OP_MOD 2 -#define OP_PLUS 3 -#define OP_MINUS 4 -#define OP_LSHIFT 5 -#define OP_RSHIFT 6 -#define OP_LESS 7 -#define OP_GREATER 8 -#define OP_LE 9 -#define OP_GE 10 -#define OP_EQ 11 -#define OP_NEQ 12 -#define OP_BITAND 13 -#define OP_BITXOR 14 -#define OP_BITOR 15 -#define OP_LAND 16 -#define OP_LOR 17 -#define OP_QUESTY 18 -#define OP_LNOT 19 -#define OP_BITNOT 20 - -/* - * Table describing the expression operators. Entries in this table must - * correspond to the definitions of numeric codes for operators just above. - */ - -static int opTableInitialized = 0; /* 0 means not yet initialized. */ - -TCL_DECLARE_MUTEX(opMutex) - -typedef struct OperatorDesc { - char *name; /* Name of the operator. */ - int numOperands; /* Number of operands. 0 if the operator - * requires special handling. */ - int instruction; /* Instruction opcode for the operator. - * Ignored if numOperands is 0. */ -} OperatorDesc; - -OperatorDesc operatorTable[] = { - {"*", 2, INST_MULT}, - {"/", 2, INST_DIV}, - {"%", 2, INST_MOD}, - {"+", 0}, - {"-", 0}, - {"<<", 2, INST_LSHIFT}, - {">>", 2, INST_RSHIFT}, - {"<", 2, INST_LT}, - {">", 2, INST_GT}, - {"<=", 2, INST_LE}, - {">=", 2, INST_GE}, - {"==", 2, INST_EQ}, - {"!=", 2, INST_NEQ}, - {"&", 2, INST_BITAND}, - {"^", 2, INST_BITXOR}, - {"|", 2, INST_BITOR}, - {"&&", 0}, - {"||", 0}, - {"?", 0}, - {"!", 1, INST_LNOT}, - {"~", 1, INST_BITNOT}, - {NULL} -}; - -/* - * Hashtable used to map the names of expression operators to the index - * of their OperatorDesc description. - */ - -static Tcl_HashTable opHashTable; - -/* - * Declarations for local procedures to this file: - */ - -static int CompileCondExpr _ANSI_ARGS_(( - Tcl_Token *exprTokenPtr, ExprInfo *infoPtr, - CompileEnv *envPtr, Tcl_Token **endPtrPtr)); -static int CompileLandOrLorExpr _ANSI_ARGS_(( - Tcl_Token *exprTokenPtr, int opIndex, - ExprInfo *infoPtr, CompileEnv *envPtr, - Tcl_Token **endPtrPtr)); -static int CompileMathFuncCall _ANSI_ARGS_(( - Tcl_Token *exprTokenPtr, char *funcName, - ExprInfo *infoPtr, CompileEnv *envPtr, - Tcl_Token **endPtrPtr)); -static int CompileSubExpr _ANSI_ARGS_(( - Tcl_Token *exprTokenPtr, ExprInfo *infoPtr, - CompileEnv *envPtr)); -static void LogSyntaxError _ANSI_ARGS_((ExprInfo *infoPtr)); - -/* - * Macro used to debug the execution of the expression compiler. - */ - -#ifdef TCL_COMPILE_DEBUG -#define TRACE(exprBytes, exprLength, tokenBytes, tokenLength) \ - if (traceExprComp) { \ - fprintf(stderr, "CompileSubExpr: \"%.*s\", token \"%.*s\"\n", \ - (exprLength), (exprBytes), (tokenLength), (tokenBytes)); \ - } -#else -#define TRACE(exprBytes, exprLength, tokenBytes, tokenLength) -#endif /* TCL_COMPILE_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * TclCompileExpr -- - * - * This procedure compiles a string containing a Tcl expression into - * Tcl bytecodes. This procedure is the top-level interface to the - * the expression compilation module, and is used by such public - * procedures as Tcl_ExprString, Tcl_ExprStringObj, Tcl_ExprLong, - * Tcl_ExprDouble, Tcl_ExprBoolean, and Tcl_ExprBooleanObj. - * - * Results: - * The return value is TCL_OK on a successful compilation and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the expression. - * - * envPtr->exprIsJustVarRef is set 1 if the expression consisted of - * a single variable reference as in the expression of "if $b then...". - * Otherwise it is set 0. This is used to implement Tcl's two level - * expression substitution semantics properly. - * - * envPtr->exprIsComparison is set 1 if the top-level operator in the - * expr is a comparison. Otherwise it is set 0. If 1, because the - * operands might be strings, the expr is compiled out-of-line in order - * to implement expr's 2 level substitution semantics properly. - * - * Side effects: - * Adds instructions to envPtr to evaluate the expression at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileExpr(interp, script, numBytes, envPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - char *script; /* The source script to compile. */ - int numBytes; /* Number of bytes in script. If < 0, the - * string consists of all bytes up to the - * first null character. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - ExprInfo info; - Tcl_Parse parse; - Tcl_HashEntry *hPtr; - int maxDepth, new, i, code; - - /* - * If this is the first time we've been called, initialize the table - * of expression operators. - */ - - if (numBytes < 0) { - numBytes = (script? strlen(script) : 0); - } - if (!opTableInitialized) { - Tcl_MutexLock(&opMutex); - if (!opTableInitialized) { - Tcl_InitHashTable(&opHashTable, TCL_STRING_KEYS); - for (i = 0; operatorTable[i].name != NULL; i++) { - hPtr = Tcl_CreateHashEntry(&opHashTable, - operatorTable[i].name, &new); - if (new) { - Tcl_SetHashValue(hPtr, (ClientData) i); - } - } - opTableInitialized = 1; - } - Tcl_MutexUnlock(&opMutex); - } - - /* - * Initialize the structure containing information abvout this - * expression compilation. - */ - - info.interp = interp; - info.parsePtr = &parse; - info.expr = script; - info.lastChar = (script + numBytes); - info.hasOperators = 0; - info.exprIsJustVarRef = 1; /* will be set 0 if anything else is seen */ - info.exprIsComparison = 0; - - /* - * Parse the expression then compile it. - */ - - maxDepth = 0; - code = Tcl_ParseExpr(interp, script, numBytes, &parse); - if (code != TCL_OK) { - goto done; - } - - code = CompileSubExpr(parse.tokenPtr, &info, envPtr); - if (code != TCL_OK) { - Tcl_FreeParse(&parse); - goto done; - } - maxDepth = envPtr->maxStackDepth; - - if (!info.hasOperators) { - /* - * Attempt to convert the primary's object to an int or double. - * This is done in order to support Tcl's policy of interpreting - * operands if at all possible as first integers, else - * floating-point numbers. - */ - - TclEmitOpcode(INST_TRY_CVT_TO_NUMERIC, envPtr); - } - Tcl_FreeParse(&parse); - - done: - envPtr->maxStackDepth = maxDepth; - envPtr->exprIsJustVarRef = info.exprIsJustVarRef; - envPtr->exprIsComparison = info.exprIsComparison; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeCompilation -- - * - * Clean up the compilation environment so it can later be - * properly reinitialized. This procedure is called by - * TclFinalizeCompExecEnv() in tclObj.c, which in turn is called - * by Tcl_Finalize(). - * - * Results: - * None. - * - * Side effects: - * Cleans up the compilation environment. At the moment, just the - * table of expression operators is freed. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeCompilation() -{ - Tcl_MutexLock(&opMutex); - if (opTableInitialized) { - Tcl_DeleteHashTable(&opHashTable); - opTableInitialized = 0; - } - Tcl_MutexUnlock(&opMutex); -} - -/* - *---------------------------------------------------------------------- - * - * CompileSubExpr -- - * - * Given a pointer to a TCL_TOKEN_SUB_EXPR token describing a - * subexpression, this procedure emits instructions to evaluate the - * subexpression at runtime. - * - * Results: - * The return value is TCL_OK on a successful compilation and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the subexpression. - * - * envPtr->exprIsJustVarRef is set 1 if the subexpression consisted of - * a single variable reference as in the expression of "if $b then...". - * Otherwise it is set 0. This is used to implement Tcl's two level - * expression substitution semantics properly. - * - * envPtr->exprIsComparison is set 1 if the top-level operator in the - * subexpression is a comparison. Otherwise it is set 0. If 1, because - * the operands might be strings, the expr is compiled out-of-line in - * order to implement expr's 2 level substitution semantics properly. - * - * Side effects: - * Adds instructions to envPtr to evaluate the subexpression. - * - *---------------------------------------------------------------------- - */ - -static int -CompileSubExpr(exprTokenPtr, infoPtr, envPtr) - Tcl_Token *exprTokenPtr; /* Points to TCL_TOKEN_SUB_EXPR token - * to compile. */ - ExprInfo *infoPtr; /* Describes the compilation state for the - * expression being compiled. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - Tcl_Interp *interp = infoPtr->interp; - Tcl_Token *tokenPtr, *endPtr, *afterSubexprPtr; - OperatorDesc *opDescPtr; - Tcl_HashEntry *hPtr; - char *operator; - char savedChar; - int maxDepth, objIndex, opIndex, length, code; - char buffer[TCL_UTF_MAX]; - - if (exprTokenPtr->type != TCL_TOKEN_SUB_EXPR) { - panic("CompileSubExpr: token type %d not TCL_TOKEN_SUB_EXPR\n", - exprTokenPtr->type); - } - maxDepth = 0; - code = TCL_OK; - - /* - * Switch on the type of the first token after the subexpression token. - * After processing it, advance tokenPtr to point just after the - * subexpression's last token. - */ - - tokenPtr = exprTokenPtr+1; - TRACE(exprTokenPtr->start, exprTokenPtr->size, - tokenPtr->start, tokenPtr->size); - switch (tokenPtr->type) { - case TCL_TOKEN_WORD: - code = TclCompileTokens(interp, tokenPtr+1, - tokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr += (tokenPtr->numComponents + 1); - infoPtr->exprIsJustVarRef = 0; - break; - - case TCL_TOKEN_TEXT: - if (tokenPtr->size > 0) { - objIndex = TclRegisterLiteral(envPtr, tokenPtr->start, - tokenPtr->size, /*onHeap*/ 0); - } else { - objIndex = TclRegisterLiteral(envPtr, "", 0, /*onHeap*/ 0); - } - TclEmitPush(objIndex, envPtr); - maxDepth = 1; - tokenPtr += 1; - infoPtr->exprIsJustVarRef = 0; - break; - - case TCL_TOKEN_BS: - length = Tcl_UtfBackslash(tokenPtr->start, (int *) NULL, - buffer); - if (length > 0) { - objIndex = TclRegisterLiteral(envPtr, buffer, length, - /*onHeap*/ 0); - } else { - objIndex = TclRegisterLiteral(envPtr, "", 0, /*onHeap*/ 0); - } - TclEmitPush(objIndex, envPtr); - maxDepth = 1; - tokenPtr += 1; - infoPtr->exprIsJustVarRef = 0; - break; - - case TCL_TOKEN_COMMAND: - code = TclCompileScript(interp, tokenPtr->start+1, - tokenPtr->size-2, /*nested*/ 1, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr += 1; - infoPtr->exprIsJustVarRef = 0; - break; - - case TCL_TOKEN_VARIABLE: - code = TclCompileTokens(interp, tokenPtr, 1, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr += (tokenPtr->numComponents + 1); - break; - - case TCL_TOKEN_SUB_EXPR: - infoPtr->exprIsComparison = 0; - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr += (tokenPtr->numComponents + 1); - break; - - case TCL_TOKEN_OPERATOR: - /* - * Look up the operator. Temporarily overwrite the character - * just after the end of the operator with a 0 byte. If the - * operator isn't found, treat it as a math function. - */ - - /* - * TODO: Note that the string is modified in place. This is unsafe - * and will break if any of the routines called while the string is - * modified have side effects that depend on the original string - * being unmodified (e.g. adding an entry to the literal table). - */ - - operator = tokenPtr->start; - savedChar = operator[tokenPtr->size]; - operator[tokenPtr->size] = 0; - hPtr = Tcl_FindHashEntry(&opHashTable, operator); - if (hPtr == NULL) { - code = CompileMathFuncCall(exprTokenPtr, operator, infoPtr, - envPtr, &endPtr); - operator[tokenPtr->size] = (char) savedChar; - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr = endPtr; - infoPtr->exprIsJustVarRef = 0; - infoPtr->exprIsComparison = 0; - break; - } - operator[tokenPtr->size] = (char) savedChar; - opIndex = (int) Tcl_GetHashValue(hPtr); - opDescPtr = &(operatorTable[opIndex]); - - /* - * If the operator is "normal", compile it using information - * from the operator table. - */ - - if (opDescPtr->numOperands > 0) { - tokenPtr++; - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr += (tokenPtr->numComponents + 1); - - if (opDescPtr->numOperands == 2) { - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = TclMax((envPtr->maxStackDepth + 1), - maxDepth); - tokenPtr += (tokenPtr->numComponents + 1); - } - TclEmitOpcode(opDescPtr->instruction, envPtr); - infoPtr->hasOperators = 1; - infoPtr->exprIsJustVarRef = 0; - infoPtr->exprIsComparison = - ((opIndex >= OP_LESS) && (opIndex <= OP_NEQ)); - break; - } - - /* - * The operator requires special treatment, and is either - * "+" or "-", or one of "&&", "||" or "?". - */ - - switch (opIndex) { - case OP_PLUS: - case OP_MINUS: - tokenPtr++; - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr += (tokenPtr->numComponents + 1); - - /* - * Check whether the "+" or "-" is unary. - */ - - afterSubexprPtr = exprTokenPtr - + exprTokenPtr->numComponents+1; - if (tokenPtr == afterSubexprPtr) { - TclEmitOpcode(((opIndex==OP_PLUS)? - INST_UPLUS : INST_UMINUS), - envPtr); - break; - } - - /* - * The "+" or "-" is binary. - */ - - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = TclMax((envPtr->maxStackDepth + 1), - maxDepth); - tokenPtr += (tokenPtr->numComponents + 1); - TclEmitOpcode(((opIndex==OP_PLUS)? INST_ADD : INST_SUB), - envPtr); - break; - - case OP_LAND: - case OP_LOR: - code = CompileLandOrLorExpr(exprTokenPtr, opIndex, - infoPtr, envPtr, &endPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr = endPtr; - break; - - case OP_QUESTY: - code = CompileCondExpr(exprTokenPtr, infoPtr, - envPtr, &endPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr = endPtr; - break; - - default: - panic("CompileSubExpr: unexpected operator %d requiring special treatment\n", - opIndex); - } /* end switch on operator requiring special treatment */ - infoPtr->hasOperators = 1; - infoPtr->exprIsJustVarRef = 0; - infoPtr->exprIsComparison = 0; - break; - - default: - panic("CompileSubExpr: unexpected token type %d\n", - tokenPtr->type); - } - - /* - * Verify that the subexpression token had the required number of - * subtokens: that we've advanced tokenPtr just beyond the - * subexpression's last token. For example, a "*" subexpression must - * contain the tokens for exactly two operands. - */ - - if (tokenPtr != (exprTokenPtr + exprTokenPtr->numComponents+1)) { - LogSyntaxError(infoPtr); - code = TCL_ERROR; - } - - done: - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * CompileLandOrLorExpr -- - * - * This procedure compiles a Tcl logical and ("&&") or logical or - * ("||") subexpression. - * - * Results: - * The return value is TCL_OK on a successful compilation and TCL_ERROR - * on failure. If TCL_OK is returned, a pointer to the token just after - * the last one in the subexpression is stored at the address in - * endPtrPtr. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the expression. - * - * Side effects: - * Adds instructions to envPtr to evaluate the expression at runtime. - * - *---------------------------------------------------------------------- - */ - -static int -CompileLandOrLorExpr(exprTokenPtr, opIndex, infoPtr, envPtr, endPtrPtr) - Tcl_Token *exprTokenPtr; /* Points to TCL_TOKEN_SUB_EXPR token - * containing the "&&" or "||" operator. */ - int opIndex; /* A code describing the expression - * operator: either OP_LAND or OP_LOR. */ - ExprInfo *infoPtr; /* Describes the compilation state for the - * expression being compiled. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ - Tcl_Token **endPtrPtr; /* If successful, a pointer to the token - * just after the last token in the - * subexpression is stored here. */ -{ - JumpFixup shortCircuitFixup; /* Used to fix up the short circuit jump - * after the first subexpression. */ - JumpFixup lhsTrueFixup, lhsEndFixup; - /* Used to fix up jumps used to convert the - * first operand to 0 or 1. */ - Tcl_Token *tokenPtr; - int dist, maxDepth, code; - - /* - * Emit code for the first operand. - */ - - maxDepth = 0; - tokenPtr = exprTokenPtr+2; - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr += (tokenPtr->numComponents + 1); - - /* - * Convert the first operand to the result that Tcl requires: - * "0" or "1". Eventually we'll use a new instruction for this. - */ - - TclEmitForwardJump(envPtr, TCL_TRUE_JUMP, &lhsTrueFixup); - TclEmitPush(TclRegisterLiteral(envPtr, "0", 1, /*onHeap*/ 0), envPtr); - TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &lhsEndFixup); - dist = (envPtr->codeNext - envPtr->codeStart) - lhsTrueFixup.codeOffset; - if (TclFixupForwardJump(envPtr, &lhsTrueFixup, dist, 127)) { - badDist: - panic("CompileLandOrLorExpr: bad jump distance %d\n", dist); - } - TclEmitPush(TclRegisterLiteral(envPtr, "1", 1, /*onHeap*/ 0), envPtr); - dist = (envPtr->codeNext - envPtr->codeStart) - lhsEndFixup.codeOffset; - if (TclFixupForwardJump(envPtr, &lhsEndFixup, dist, 127)) { - goto badDist; - } - - /* - * Emit the "short circuit" jump around the rest of the expression. - * Duplicate the "0" or "1" on top of the stack first to keep the - * jump from consuming it. - */ - - TclEmitOpcode(INST_DUP, envPtr); - TclEmitForwardJump(envPtr, - ((opIndex==OP_LAND)? TCL_FALSE_JUMP : TCL_TRUE_JUMP), - &shortCircuitFixup); - - /* - * Emit code for the second operand. - */ - - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = TclMax((envPtr->maxStackDepth + 1), maxDepth); - tokenPtr += (tokenPtr->numComponents + 1); - - /* - * Emit a "logical and" or "logical or" instruction. This does not try - * to "short- circuit" the evaluation of both operands, but instead - * ensures that we either have a "1" or a "0" result. - */ - - TclEmitOpcode(((opIndex==OP_LAND)? INST_LAND : INST_LOR), envPtr); - - /* - * Now that we know the target of the forward jump, update it with the - * correct distance. - */ - - dist = (envPtr->codeNext - envPtr->codeStart) - - shortCircuitFixup.codeOffset; - TclFixupForwardJump(envPtr, &shortCircuitFixup, dist, 127); - *endPtrPtr = tokenPtr; - - done: - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * CompileCondExpr -- - * - * This procedure compiles a Tcl conditional expression: - * condExpr ::= lorExpr ['?' condExpr ':' condExpr] - * - * Results: - * The return value is TCL_OK on a successful compilation and TCL_ERROR - * on failure. If TCL_OK is returned, a pointer to the token just after - * the last one in the subexpression is stored at the address in - * endPtrPtr. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the expression. - * - * Side effects: - * Adds instructions to envPtr to evaluate the expression at runtime. - * - *---------------------------------------------------------------------- - */ - -static int -CompileCondExpr(exprTokenPtr, infoPtr, envPtr, endPtrPtr) - Tcl_Token *exprTokenPtr; /* Points to TCL_TOKEN_SUB_EXPR token - * containing the "?" operator. */ - ExprInfo *infoPtr; /* Describes the compilation state for the - * expression being compiled. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ - Tcl_Token **endPtrPtr; /* If successful, a pointer to the token - * just after the last token in the - * subexpression is stored here. */ -{ - JumpFixup jumpAroundThenFixup, jumpAroundElseFixup; - /* Used to update or replace one-byte jumps - * around the then and else expressions when - * their target PCs are determined. */ - Tcl_Token *tokenPtr; - int elseCodeOffset, dist, maxDepth, code; - - /* - * Emit code for the test. - */ - - maxDepth = 0; - tokenPtr = exprTokenPtr+2; - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = envPtr->maxStackDepth; - tokenPtr += (tokenPtr->numComponents + 1); - - /* - * Emit the jump to the "else" expression if the test was false. - */ - - TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpAroundThenFixup); - - /* - * Compile the "then" expression. Note that if a subexpression is only - * a primary, we need to try to convert it to numeric. We do this to - * support Tcl's policy of interpreting operands if at all possible as - * first integers, else floating-point numbers. - */ - - infoPtr->hasOperators = 0; - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - tokenPtr += (tokenPtr->numComponents + 1); - if (!infoPtr->hasOperators) { - TclEmitOpcode(INST_TRY_CVT_TO_NUMERIC, envPtr); - } - - /* - * Emit an unconditional jump around the "else" condExpr. - */ - - TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, - &jumpAroundElseFixup); - - /* - * Compile the "else" expression. - */ - - elseCodeOffset = (envPtr->codeNext - envPtr->codeStart); - infoPtr->hasOperators = 0; - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - tokenPtr += (tokenPtr->numComponents + 1); - if (!infoPtr->hasOperators) { - TclEmitOpcode(INST_TRY_CVT_TO_NUMERIC, envPtr); - } - - /* - * Fix up the second jump around the "else" expression. - */ - - dist = (envPtr->codeNext - envPtr->codeStart) - - jumpAroundElseFixup.codeOffset; - if (TclFixupForwardJump(envPtr, &jumpAroundElseFixup, dist, 127)) { - /* - * Update the else expression's starting code offset since it - * moved down 3 bytes too. - */ - - elseCodeOffset += 3; - } - - /* - * Fix up the first jump to the "else" expression if the test was false. - */ - - dist = (elseCodeOffset - jumpAroundThenFixup.codeOffset); - TclFixupForwardJump(envPtr, &jumpAroundThenFixup, dist, 127); - *endPtrPtr = tokenPtr; - - done: - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * CompileMathFuncCall -- - * - * This procedure compiles a call on a math function in an expression: - * mathFuncCall ::= funcName '(' [condExpr {',' condExpr}] ')' - * - * Results: - * The return value is TCL_OK on a successful compilation and TCL_ERROR - * on failure. If TCL_OK is returned, a pointer to the token just after - * the last one in the subexpression is stored at the address in - * endPtrPtr. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the function. - * - * Side effects: - * Adds instructions to envPtr to evaluate the math function at - * runtime. - * - *---------------------------------------------------------------------- - */ - -static int -CompileMathFuncCall(exprTokenPtr, funcName, infoPtr, envPtr, endPtrPtr) - Tcl_Token *exprTokenPtr; /* Points to TCL_TOKEN_SUB_EXPR token - * containing the math function call. */ - char *funcName; /* Name of the math function. */ - ExprInfo *infoPtr; /* Describes the compilation state for the - * expression being compiled. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ - Tcl_Token **endPtrPtr; /* If successful, a pointer to the token - * just after the last token in the - * subexpression is stored here. */ -{ - Tcl_Interp *interp = infoPtr->interp; - Interp *iPtr = (Interp *) interp; - MathFunc *mathFuncPtr; - Tcl_HashEntry *hPtr; - Tcl_Token *tokenPtr, *afterSubexprPtr; - int maxDepth, code, i; - - /* - * Look up the MathFunc record for the function. - */ - - code = TCL_OK; - maxDepth = 0; - hPtr = Tcl_FindHashEntry(&iPtr->mathFuncTable, funcName); - if (hPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown math function \"", funcName, "\"", (char *) NULL); - code = TCL_ERROR; - goto done; - } - mathFuncPtr = (MathFunc *) Tcl_GetHashValue(hPtr); - - /* - * If not a builtin function, push an object with the function's name. - */ - - if (mathFuncPtr->builtinFuncIndex < 0) { - TclEmitPush(TclRegisterLiteral(envPtr, funcName, -1, /*onHeap*/ 0), - envPtr); - maxDepth = 1; - } - - /* - * Compile any arguments for the function. - */ - - tokenPtr = exprTokenPtr+2; - afterSubexprPtr = exprTokenPtr + (exprTokenPtr->numComponents + 1); - if (mathFuncPtr->numArgs > 0) { - for (i = 0; i < mathFuncPtr->numArgs; i++) { - if (tokenPtr == afterSubexprPtr) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "too few arguments for math function", -1); - code = TCL_ERROR; - goto done; - } - infoPtr->exprIsComparison = 0; - code = CompileSubExpr(tokenPtr, infoPtr, envPtr); - if (code != TCL_OK) { - goto done; - } - tokenPtr += (tokenPtr->numComponents + 1); - maxDepth++; - } - if (tokenPtr != afterSubexprPtr) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "too many arguments for math function", -1); - code = TCL_ERROR; - goto done; - } - } else if (tokenPtr != afterSubexprPtr) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "too many arguments for math function", -1); - code = TCL_ERROR; - goto done; - } - - /* - * Compile the call on the math function. Note that the "objc" argument - * count for non-builtin functions is incremented by 1 to include the - * function name itself. - */ - - if (mathFuncPtr->builtinFuncIndex >= 0) { /* a builtin function */ - TclEmitInstInt1(INST_CALL_BUILTIN_FUNC1, - mathFuncPtr->builtinFuncIndex, envPtr); - } else { - TclEmitInstInt1(INST_CALL_FUNC1, (mathFuncPtr->numArgs+1), envPtr); - } - *endPtrPtr = afterSubexprPtr; - - done: - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * LogSyntaxError -- - * - * This procedure is invoked after an error occurs when compiling an - * expression. It sets the interpreter result to an error message - * describing the error. - * - * Results: - * None. - * - * Side effects: - * Sets the interpreter result to an error message describing the - * expression that was being compiled when the error occurred. - * - *---------------------------------------------------------------------- - */ - -static void -LogSyntaxError(infoPtr) - ExprInfo *infoPtr; /* Describes the compilation state for the - * expression being compiled. */ -{ - int numBytes = (infoPtr->lastChar - infoPtr->expr); - char buffer[100]; - - sprintf(buffer, "syntax error in expression \"%.*s\"", - ((numBytes > 60)? 60 : numBytes), infoPtr->expr); - Tcl_AppendStringsToObj(Tcl_GetObjResult(infoPtr->interp), - buffer, (char *) NULL); -} diff --git a/generic/tclCompile.c b/generic/tclCompile.c deleted file mode 100644 index 12b6cd4..0000000 --- a/generic/tclCompile.c +++ /dev/null @@ -1,3452 +0,0 @@ -/* - * tclCompile.c -- - * - * This file contains procedures that compile Tcl commands or parts - * of commands (like quoted strings or nested sub-commands) into a - * sequence of instructions ("bytecodes"). - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclCompile.c,v 1.14 1999/04/16 00:46:44 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclCompile.h" - -/* - * Table of all AuxData types. - */ - -static Tcl_HashTable auxDataTypeTable; -static int auxDataTypeTableInitialized; /* 0 means not yet initialized. */ - -TCL_DECLARE_MUTEX(tableMutex) - -/* - * Variable that controls whether compilation tracing is enabled and, if so, - * what level of tracing is desired: - * 0: no compilation tracing - * 1: summarize compilation of top level cmds and proc bodies - * 2: display all instructions of each ByteCode compiled - * This variable is linked to the Tcl variable "tcl_traceCompile". - */ - -int tclTraceCompile = 0; -static int traceInitialized = 0; - -/* - * A table describing the Tcl bytecode instructions. Entries in this table - * must correspond to the instruction opcode definitions in tclCompile.h. - * The names "op1" and "op4" refer to an instruction's one or four byte - * first operand. Similarly, "stktop" and "stknext" refer to the topmost - * and next to topmost stack elements. - * - * Note that the load, store, and incr instructions do not distinguish local - * from global variables; the bytecode interpreter at runtime uses the - * existence of a procedure call frame to distinguish these. - */ - -InstructionDesc instructionTable[] = { - /* Name Bytes #Opnds Operand types Stack top, next */ - {"done", 1, 0, {OPERAND_NONE}}, - /* Finish ByteCode execution and return stktop (top stack item) */ - {"push1", 2, 1, {OPERAND_UINT1}}, - /* Push object at ByteCode objArray[op1] */ - {"push4", 5, 1, {OPERAND_UINT4}}, - /* Push object at ByteCode objArray[op4] */ - {"pop", 1, 0, {OPERAND_NONE}}, - /* Pop the topmost stack object */ - {"dup", 1, 0, {OPERAND_NONE}}, - /* Duplicate the topmost stack object and push the result */ - {"concat1", 2, 1, {OPERAND_UINT1}}, - /* Concatenate the top op1 items and push result */ - {"invokeStk1", 2, 1, {OPERAND_UINT1}}, - /* Invoke command named objv[0]; = */ - {"invokeStk4", 5, 1, {OPERAND_UINT4}}, - /* Invoke command named objv[0]; = */ - {"evalStk", 1, 0, {OPERAND_NONE}}, - /* Evaluate command in stktop using Tcl_EvalObj. */ - {"exprStk", 1, 0, {OPERAND_NONE}}, - /* Execute expression in stktop using Tcl_ExprStringObj. */ - - {"loadScalar1", 2, 1, {OPERAND_UINT1}}, - /* Load scalar variable at index op1 <= 255 in call frame */ - {"loadScalar4", 5, 1, {OPERAND_UINT4}}, - /* Load scalar variable at index op1 >= 256 in call frame */ - {"loadScalarStk", 1, 0, {OPERAND_NONE}}, - /* Load scalar variable; scalar's name is stktop */ - {"loadArray1", 2, 1, {OPERAND_UINT1}}, - /* Load array element; array at slot op1<=255, element is stktop */ - {"loadArray4", 5, 1, {OPERAND_UINT4}}, - /* Load array element; array at slot op1 > 255, element is stktop */ - {"loadArrayStk", 1, 0, {OPERAND_NONE}}, - /* Load array element; element is stktop, array name is stknext */ - {"loadStk", 1, 0, {OPERAND_NONE}}, - /* Load general variable; unparsed variable name is stktop */ - {"storeScalar1", 2, 1, {OPERAND_UINT1}}, - /* Store scalar variable at op1<=255 in frame; value is stktop */ - {"storeScalar4", 5, 1, {OPERAND_UINT4}}, - /* Store scalar variable at op1 > 255 in frame; value is stktop */ - {"storeScalarStk", 1, 0, {OPERAND_NONE}}, - /* Store scalar; value is stktop, scalar name is stknext */ - {"storeArray1", 2, 1, {OPERAND_UINT1}}, - /* Store array element; array at op1<=255, value is top then elem */ - {"storeArray4", 5, 1, {OPERAND_UINT4}}, - /* Store array element; array at op1>=256, value is top then elem */ - {"storeArrayStk", 1, 0, {OPERAND_NONE}}, - /* Store array element; value is stktop, then elem, array names */ - {"storeStk", 1, 0, {OPERAND_NONE}}, - /* Store general variable; value is stktop, then unparsed name */ - - {"incrScalar1", 2, 1, {OPERAND_UINT1}}, - /* Incr scalar at index op1<=255 in frame; incr amount is stktop */ - {"incrScalarStk", 1, 0, {OPERAND_NONE}}, - /* Incr scalar; incr amount is stktop, scalar's name is stknext */ - {"incrArray1", 2, 1, {OPERAND_UINT1}}, - /* Incr array elem; arr at slot op1<=255, amount is top then elem */ - {"incrArrayStk", 1, 0, {OPERAND_NONE}}, - /* Incr array element; amount is top then elem then array names */ - {"incrStk", 1, 0, {OPERAND_NONE}}, - /* Incr general variable; amount is stktop then unparsed var name */ - {"incrScalar1Imm", 3, 2, {OPERAND_UINT1, OPERAND_INT1}}, - /* Incr scalar at slot op1 <= 255; amount is 2nd operand byte */ - {"incrScalarStkImm", 2, 1, {OPERAND_INT1}}, - /* Incr scalar; scalar name is stktop; incr amount is op1 */ - {"incrArray1Imm", 3, 2, {OPERAND_UINT1, OPERAND_INT1}}, - /* Incr array elem; array at slot op1 <= 255, elem is stktop, - * amount is 2nd operand byte */ - {"incrArrayStkImm", 2, 1, {OPERAND_INT1}}, - /* Incr array element; elem is top then array name, amount is op1 */ - {"incrStkImm", 2, 1, {OPERAND_INT1}}, - /* Incr general variable; unparsed name is top, amount is op1 */ - - {"jump1", 2, 1, {OPERAND_INT1}}, - /* Jump relative to (pc + op1) */ - {"jump4", 5, 1, {OPERAND_INT4}}, - /* Jump relative to (pc + op4) */ - {"jumpTrue1", 2, 1, {OPERAND_INT1}}, - /* Jump relative to (pc + op1) if stktop expr object is true */ - {"jumpTrue4", 5, 1, {OPERAND_INT4}}, - /* Jump relative to (pc + op4) if stktop expr object is true */ - {"jumpFalse1", 2, 1, {OPERAND_INT1}}, - /* Jump relative to (pc + op1) if stktop expr object is false */ - {"jumpFalse4", 5, 1, {OPERAND_INT4}}, - /* Jump relative to (pc + op4) if stktop expr object is false */ - - {"lor", 1, 0, {OPERAND_NONE}}, - /* Logical or: push (stknext || stktop) */ - {"land", 1, 0, {OPERAND_NONE}}, - /* Logical and: push (stknext && stktop) */ - {"bitor", 1, 0, {OPERAND_NONE}}, - /* Bitwise or: push (stknext | stktop) */ - {"bitxor", 1, 0, {OPERAND_NONE}}, - /* Bitwise xor push (stknext ^ stktop) */ - {"bitand", 1, 0, {OPERAND_NONE}}, - /* Bitwise and: push (stknext & stktop) */ - {"eq", 1, 0, {OPERAND_NONE}}, - /* Equal: push (stknext == stktop) */ - {"neq", 1, 0, {OPERAND_NONE}}, - /* Not equal: push (stknext != stktop) */ - {"lt", 1, 0, {OPERAND_NONE}}, - /* Less: push (stknext < stktop) */ - {"gt", 1, 0, {OPERAND_NONE}}, - /* Greater: push (stknext || stktop) */ - {"le", 1, 0, {OPERAND_NONE}}, - /* Logical or: push (stknext || stktop) */ - {"ge", 1, 0, {OPERAND_NONE}}, - /* Logical or: push (stknext || stktop) */ - {"lshift", 1, 0, {OPERAND_NONE}}, - /* Left shift: push (stknext << stktop) */ - {"rshift", 1, 0, {OPERAND_NONE}}, - /* Right shift: push (stknext >> stktop) */ - {"add", 1, 0, {OPERAND_NONE}}, - /* Add: push (stknext + stktop) */ - {"sub", 1, 0, {OPERAND_NONE}}, - /* Sub: push (stkext - stktop) */ - {"mult", 1, 0, {OPERAND_NONE}}, - /* Multiply: push (stknext * stktop) */ - {"div", 1, 0, {OPERAND_NONE}}, - /* Divide: push (stknext / stktop) */ - {"mod", 1, 0, {OPERAND_NONE}}, - /* Mod: push (stknext % stktop) */ - {"uplus", 1, 0, {OPERAND_NONE}}, - /* Unary plus: push +stktop */ - {"uminus", 1, 0, {OPERAND_NONE}}, - /* Unary minus: push -stktop */ - {"bitnot", 1, 0, {OPERAND_NONE}}, - /* Bitwise not: push ~stktop */ - {"not", 1, 0, {OPERAND_NONE}}, - /* Logical not: push !stktop */ - {"callBuiltinFunc1", 2, 1, {OPERAND_UINT1}}, - /* Call builtin math function with index op1; any args are on stk */ - {"callFunc1", 2, 1, {OPERAND_UINT1}}, - /* Call non-builtin func objv[0]; = */ - {"tryCvtToNumeric", 1, 0, {OPERAND_NONE}}, - /* Try converting stktop to first int then double if possible. */ - - {"break", 1, 0, {OPERAND_NONE}}, - /* Abort closest enclosing loop; if none, return TCL_BREAK code. */ - {"continue", 1, 0, {OPERAND_NONE}}, - /* Skip to next iteration of closest enclosing loop; if none, - * return TCL_CONTINUE code. */ - - {"foreach_start4", 5, 1, {OPERAND_UINT4}}, - /* Initialize execution of a foreach loop. Operand is aux data index - * of the ForeachInfo structure for the foreach command. */ - {"foreach_step4", 5, 1, {OPERAND_UINT4}}, - /* "Step" or begin next iteration of foreach loop. Push 0 if to - * terminate loop, else push 1. */ - - {"beginCatch4", 5, 1, {OPERAND_UINT4}}, - /* Record start of catch with the operand's exception index. - * Push the current stack depth onto a special catch stack. */ - {"endCatch", 1, 0, {OPERAND_NONE}}, - /* End of last catch. Pop the bytecode interpreter's catch stack. */ - {"pushResult", 1, 0, {OPERAND_NONE}}, - /* Push the interpreter's object result onto the stack. */ - {"pushReturnCode", 1, 0, {OPERAND_NONE}}, - /* Push interpreter's return code (e.g. TCL_OK or TCL_ERROR) as - * a new object onto the stack. */ - {0} -}; - -/* - * Prototypes for procedures defined later in this file: - */ - -static void DupByteCodeInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr, - Tcl_Obj *copyPtr)); -static unsigned char * EncodeCmdLocMap _ANSI_ARGS_(( - CompileEnv *envPtr, ByteCode *codePtr, - unsigned char *startPtr)); -static void EnterCmdExtentData _ANSI_ARGS_(( - CompileEnv *envPtr, int cmdNumber, - int numSrcBytes, int numCodeBytes)); -static void EnterCmdStartData _ANSI_ARGS_(( - CompileEnv *envPtr, int cmdNumber, - int srcOffset, int codeOffset)); -static void FreeByteCodeInternalRep _ANSI_ARGS_(( - Tcl_Obj *objPtr)); -static int GetCmdLocEncodingSize _ANSI_ARGS_(( - CompileEnv *envPtr)); -static void LogCompilationInfo _ANSI_ARGS_((Tcl_Interp *interp, - char *script, char *command, int length)); -#ifdef TCL_COMPILE_STATS -static void RecordByteCodeStats _ANSI_ARGS_(( - ByteCode *codePtr)); -#endif /* TCL_COMPILE_STATS */ -static int SetByteCodeFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); - -/* - * The structure below defines the bytecode Tcl object type by - * means of procedures that can be invoked by generic object code. - */ - -Tcl_ObjType tclByteCodeType = { - "bytecode", /* name */ - FreeByteCodeInternalRep, /* freeIntRepProc */ - DupByteCodeInternalRep, /* dupIntRepProc */ - (Tcl_UpdateStringProc *) NULL, /* updateStringProc */ - SetByteCodeFromAny /* setFromAnyProc */ -}; - -/* - *----------------------------------------------------------------------- - * - * SetByteCodeFromAny -- - * - * Part of the bytecode Tcl object type implementation. Attempts to - * generate an byte code internal form for the Tcl object "objPtr" by - * compiling its string representation. - * - * Results: - * The return value is a standard Tcl object result. If an error occurs - * during compilation, an error message is left in the interpreter's - * result unless "interp" is NULL. - * - * Side effects: - * Frees the old internal representation. If no error occurs, then the - * compiled code is stored as "objPtr"s bytecode representation. - * Also, if debugging, initializes the "tcl_traceCompile" Tcl variable - * used to trace compilations. - * - *---------------------------------------------------------------------- - */ - -static int -SetByteCodeFromAny(interp, objPtr) - Tcl_Interp *interp; /* The interpreter for which the code is - * being compiled. Must not be NULL. */ - Tcl_Obj *objPtr; /* The object to make a ByteCode object. */ -{ - Interp *iPtr = (Interp *) interp; - CompileEnv compEnv; /* Compilation environment structure - * allocated in frame. */ - LiteralTable *localTablePtr = &(compEnv.localLitTable); - register AuxData *auxDataPtr; - LiteralEntry *entryPtr; - register int i; - int length, nested, result; - char *string; - - if (!traceInitialized) { - if (Tcl_LinkVar(interp, "tcl_traceCompile", - (char *) &tclTraceCompile, TCL_LINK_INT) != TCL_OK) { - panic("SetByteCodeFromAny: unable to create link for tcl_traceCompile variable"); - } - traceInitialized = 1; - } - - if (iPtr->evalFlags & TCL_BRACKET_TERM) { - nested = 1; - } else { - nested = 0; - } - string = Tcl_GetStringFromObj(objPtr, &length); - TclInitCompileEnv(interp, &compEnv, string, length); - result = TclCompileScript(interp, string, length, nested, &compEnv); - if (result != TCL_OK) { - /* - * Compilation errors. - */ - - entryPtr = compEnv.literalArrayPtr; - for (i = 0; i < compEnv.literalArrayNext; i++) { - TclReleaseLiteral(interp, entryPtr->objPtr); - entryPtr++; - } -#ifdef TCL_COMPILE_DEBUG - TclVerifyGlobalLiteralTable(iPtr); -#endif /*TCL_COMPILE_DEBUG*/ - - auxDataPtr = compEnv.auxDataArrayPtr; - for (i = 0; i < compEnv.auxDataArrayNext; i++) { - if (auxDataPtr->type->freeProc != NULL) { - auxDataPtr->type->freeProc(auxDataPtr->clientData); - } - auxDataPtr++; - } - goto done; - } - - /* - * Successful compilation. Add a "done" instruction at the end. - */ - - compEnv.numSrcBytes = iPtr->termOffset; - TclEmitOpcode(INST_DONE, &compEnv); - - /* - * Change the object into a ByteCode object. Ownership of the literal - * objects and aux data items is given to the ByteCode object. - */ - -#ifdef TCL_COMPILE_DEBUG - TclVerifyLocalLiteralTable(&compEnv); -#endif /*TCL_COMPILE_DEBUG*/ - TclInitByteCodeObj(objPtr, &compEnv); -#ifdef TCL_COMPILE_DEBUG - if (tclTraceCompile == 2) { - TclPrintByteCodeObj(interp, objPtr); - } -#endif /* TCL_COMPILE_DEBUG */ - - /* - * Free storage allocated during compilation. - */ - - done: - if (localTablePtr->buckets != localTablePtr->staticBuckets) { - ckfree((char *) localTablePtr->buckets); - } - TclFreeCompileEnv(&compEnv); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * DupByteCodeInternalRep -- - * - * Part of the bytecode Tcl object type implementation. However, it - * does not copy the internal representation of a bytecode Tcl_Obj, but - * instead leaves the new object untyped (with a NULL type pointer). - * Code will be compiled for the new object only if necessary. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -DupByteCodeInternalRep(srcPtr, copyPtr) - Tcl_Obj *srcPtr; /* Object with internal rep to copy. */ - Tcl_Obj *copyPtr; /* Object with internal rep to set. */ -{ - return; -} - -/* - *---------------------------------------------------------------------- - * - * FreeByteCodeInternalRep -- - * - * Part of the bytecode Tcl object type implementation. Frees the - * storage associated with a bytecode object's internal representation - * unless its code is actively being executed. - * - * Results: - * None. - * - * Side effects: - * The bytecode object's internal rep is marked invalid and its - * code gets freed unless the code is actively being executed. - * In that case the cleanup is delayed until the last execution - * of the code completes. - * - *---------------------------------------------------------------------- - */ - -static void -FreeByteCodeInternalRep(objPtr) - register Tcl_Obj *objPtr; /* Object whose internal rep to free. */ -{ - register ByteCode *codePtr = - (ByteCode *) objPtr->internalRep.otherValuePtr; - - codePtr->refCount--; - if (codePtr->refCount <= 0) { - TclCleanupByteCode(codePtr); - } - objPtr->typePtr = NULL; - objPtr->internalRep.otherValuePtr = NULL; -} - -/* - *---------------------------------------------------------------------- - * - * TclCleanupByteCode -- - * - * This procedure does all the real work of freeing up a bytecode - * object's ByteCode structure. It's called only when the structure's - * reference count becomes zero. - * - * Results: - * None. - * - * Side effects: - * Frees objPtr's bytecode internal representation and sets its type - * and objPtr->internalRep.otherValuePtr NULL. Also releases its - * literals and frees its auxiliary data items. - * - *---------------------------------------------------------------------- - */ - -void -TclCleanupByteCode(codePtr) - register ByteCode *codePtr; /* Points to the ByteCode to free. */ -{ - Tcl_Interp *interp = (Tcl_Interp *) *codePtr->interpHandle; - int numLitObjects = codePtr->numLitObjects; - int numAuxDataItems = codePtr->numAuxDataItems; - register Tcl_Obj **objArrayPtr; - register AuxData *auxDataPtr; - int i; -#ifdef TCL_COMPILE_STATS - - if (interp != NULL) { - ByteCodeStats *statsPtr; - Tcl_Time destroyTime; - int lifetimeSec, lifetimeMicroSec, log2; - - statsPtr = &((Interp *) interp)->stats; - - statsPtr->numByteCodesFreed++; - statsPtr->currentSrcBytes -= (double) codePtr->numSrcBytes; - statsPtr->currentByteCodeBytes -= (double) codePtr->structureSize; - - statsPtr->currentInstBytes -= (double) codePtr->numCodeBytes; - statsPtr->currentLitBytes -= - (double) (codePtr->numLitObjects * sizeof(Tcl_Obj *)); - statsPtr->currentExceptBytes -= - (double) (codePtr->numExceptRanges * sizeof(ExceptionRange)); - statsPtr->currentAuxBytes -= - (double) (codePtr->numAuxDataItems * sizeof(AuxData)); - statsPtr->currentCmdMapBytes -= (double) codePtr->numCmdLocBytes; - - TclpGetTime(&destroyTime); - lifetimeSec = destroyTime.sec - codePtr->createTime.sec; - if (lifetimeSec > 2000) { /* avoid overflow */ - lifetimeSec = 2000; - } - lifetimeMicroSec = - 1000000*lifetimeSec + (destroyTime.usec - codePtr->createTime.usec); - - log2 = TclLog2(lifetimeMicroSec); - if (log2 > 31) { - log2 = 31; - } - statsPtr->lifetimeCount[log2]++; - } -#endif /* TCL_COMPILE_STATS */ - - /* - * A single heap object holds the ByteCode structure and its code, - * object, command location, and auxiliary data arrays. This means we - * only need to 1) decrement the ref counts of the LiteralEntry's in - * its literal array, 2) call the free procs for the auxiliary data - * items, and 3) free the ByteCode structure's heap object. - */ - - if (interp != NULL) { - /* - * If the interp has already been freed, then Tcl will have already - * forcefully released all the literals used by ByteCodes compiled - * with respect to that interp. - */ - - objArrayPtr = codePtr->objArrayPtr; - for (i = 0; i < numLitObjects; i++) { - /* - * TclReleaseLiteral sets a ByteCode's object array entry NULL to - * indicate that it has already freed the literal. - */ - - if (*objArrayPtr != NULL) { - TclReleaseLiteral(interp, *objArrayPtr); - } - objArrayPtr++; - } - } - - auxDataPtr = codePtr->auxDataArrayPtr; - for (i = 0; i < numAuxDataItems; i++) { - if (auxDataPtr->type->freeProc != NULL) { - (*auxDataPtr->type->freeProc)(auxDataPtr->clientData); - } - auxDataPtr++; - } - - TclHandleRelease(codePtr->interpHandle); - ckfree((char *) codePtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclInitCompileEnv -- - * - * Initializes a CompileEnv compilation environment structure for the - * compilation of a string in an interpreter. - * - * Results: - * None. - * - * Side effects: - * The CompileEnv structure is initialized. - * - *---------------------------------------------------------------------- - */ - -void -TclInitCompileEnv(interp, envPtr, string, numBytes) - Tcl_Interp *interp; /* The interpreter for which a CompileEnv - * structure is initialized. */ - register CompileEnv *envPtr; /* Points to the CompileEnv structure to - * initialize. */ - char *string; /* The source string to be compiled. */ - int numBytes; /* Number of bytes in source string. */ -{ - Interp *iPtr = (Interp *) interp; - - envPtr->iPtr = iPtr; - envPtr->source = string; - envPtr->numSrcBytes = numBytes; - envPtr->procPtr = iPtr->compiledProcPtr; - envPtr->numCommands = 0; - envPtr->exceptDepth = 0; - envPtr->maxExceptDepth = 0; - envPtr->maxStackDepth = 0; - TclInitLiteralTable(&(envPtr->localLitTable)); - envPtr->exprIsJustVarRef = 0; - envPtr->exprIsComparison = 0; - - envPtr->codeStart = envPtr->staticCodeSpace; - envPtr->codeNext = envPtr->codeStart; - envPtr->codeEnd = (envPtr->codeStart + COMPILEENV_INIT_CODE_BYTES); - envPtr->mallocedCodeArray = 0; - - envPtr->literalArrayPtr = envPtr->staticLiteralSpace; - envPtr->literalArrayNext = 0; - envPtr->literalArrayEnd = COMPILEENV_INIT_NUM_OBJECTS; - envPtr->mallocedLiteralArray = 0; - - envPtr->exceptArrayPtr = envPtr->staticExceptArraySpace; - envPtr->exceptArrayNext = 0; - envPtr->exceptArrayEnd = COMPILEENV_INIT_EXCEPT_RANGES; - envPtr->mallocedExceptArray = 0; - - envPtr->cmdMapPtr = envPtr->staticCmdMapSpace; - envPtr->cmdMapEnd = COMPILEENV_INIT_CMD_MAP_SIZE; - envPtr->mallocedCmdMap = 0; - - envPtr->auxDataArrayPtr = envPtr->staticAuxDataArraySpace; - envPtr->auxDataArrayNext = 0; - envPtr->auxDataArrayEnd = COMPILEENV_INIT_AUX_DATA_SIZE; - envPtr->mallocedAuxDataArray = 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclFreeCompileEnv -- - * - * Free the storage allocated in a CompileEnv compilation environment - * structure. - * - * Results: - * None. - * - * Side effects: - * Allocated storage in the CompileEnv structure is freed. Note that - * its local literal table is not deleted and its literal objects are - * not released. In addition, storage referenced by its auxiliary data - * items is not freed. This is done so that, when compilation is - * successful, "ownership" of these objects and aux data items is - * handed over to the corresponding ByteCode structure. - * - *---------------------------------------------------------------------- - */ - -void -TclFreeCompileEnv(envPtr) - register CompileEnv *envPtr; /* Points to the CompileEnv structure. */ -{ - if (envPtr->mallocedCodeArray) { - ckfree((char *) envPtr->codeStart); - } - if (envPtr->mallocedLiteralArray) { - ckfree((char *) envPtr->literalArrayPtr); - } - if (envPtr->mallocedExceptArray) { - ckfree((char *) envPtr->exceptArrayPtr); - } - if (envPtr->mallocedCmdMap) { - ckfree((char *) envPtr->cmdMapPtr); - } - if (envPtr->mallocedAuxDataArray) { - ckfree((char *) envPtr->auxDataArrayPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileScript -- - * - * Compile a Tcl script in a string. - * - * Results: - * The return value is TCL_OK on a successful compilation and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * interp->termOffset is set to the offset of the character in the - * script just after the last one successfully processed; this will be - * the offset of the ']' if (flags & TCL_BRACKET_TERM). - * envPtr->maxStackDepth is set to the maximum number of stack elements - * needed to execute the script's commands. - * - * Side effects: - * Adds instructions to envPtr to evaluate the script at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileScript(interp, script, numBytes, nested, envPtr) - Tcl_Interp *interp; /* Used for error and status reporting. */ - char *script; /* The source script to compile. */ - int numBytes; /* Number of bytes in script. If < 0, the - * script consists of all bytes up to the - * first null character. */ - int nested; /* Non-zero means this is a nested command: - * close bracket ']' should be considered a - * command terminator. If zero, close - * bracket has no special meaning. */ - CompileEnv *envPtr; /* Holds resulting instructions. */ -{ - Interp *iPtr = (Interp *) interp; - Tcl_Parse parse; - int maxDepth = 0; /* Maximum number of stack elements needed - * to execute all cmds. */ - int lastTopLevelCmdIndex = -1; - /* Index of most recent toplevel command in - * the command location table. Initialized - * to avoid compiler warning. */ - int startCodeOffset = -1; /* Offset of first byte of current command's - * code. Init. to avoid compiler warning. */ - unsigned char *entryCodeNext = envPtr->codeNext; - char *p, *next; - Namespace *cmdNsPtr; - Command *cmdPtr; - Tcl_Token *tokenPtr; - int bytesLeft, isFirstCmd, gotParse, wordIdx, currCmdIndex; - int commandLength, objIndex, code; - char prev; - Tcl_DString ds; - - Tcl_DStringInit(&ds); - - if (numBytes < 0) { - numBytes = strlen(script); - } - Tcl_ResetResult(interp); - isFirstCmd = 1; - - /* - * Each iteration through the following loop compiles the next - * command from the script. - */ - - p = script; - bytesLeft = numBytes; - gotParse = 0; - while (bytesLeft > 0) { - if (Tcl_ParseCommand(interp, p, bytesLeft, nested, &parse) != TCL_OK) { - code = TCL_ERROR; - goto error; - } - gotParse = 1; - if (parse.numWords > 0) { - /* - * If not the first command, pop the previous command's result - * and, if we're compiling a top level command, update the last - * command's code size to account for the pop instruction. - */ - - if (!isFirstCmd) { - TclEmitOpcode(INST_POP, envPtr); - if (!nested) { - envPtr->cmdMapPtr[lastTopLevelCmdIndex].numCodeBytes = - (envPtr->codeNext - envPtr->codeStart) - - startCodeOffset; - } - } - - /* - * Determine the actual length of the command. - */ - - commandLength = parse.commandSize; - prev = '\0'; - if (commandLength > 0) { - prev = parse.commandStart[commandLength-1]; - } - if (((parse.commandStart+commandLength) != (script+numBytes)) - || ((prev=='\n') || (nested && (prev==']')))) { - /* - * The command didn't end at the end of the script (i.e. it - * ended at a terminator character such as ";". Reduce the - * length by one so that the trace message doesn't include - * the terminator character. - */ - - commandLength -= 1; - } - - /* - * If tracing, print a line for each top level command compiled. - */ - - if ((tclTraceCompile >= 1) - && !nested && (envPtr->procPtr == NULL)) { - fprintf(stdout, " Compiling: "); - TclPrintSource(stdout, parse.commandStart, - TclMin(commandLength, 55)); - fprintf(stdout, "\n"); - } - - /* - * Each iteration of the following loop compiles one word - * from the command. - */ - - envPtr->numCommands++; - currCmdIndex = (envPtr->numCommands - 1); - if (!nested) { - lastTopLevelCmdIndex = currCmdIndex; - } - startCodeOffset = (envPtr->codeNext - envPtr->codeStart); - EnterCmdStartData(envPtr, currCmdIndex, - (parse.commandStart - envPtr->source), startCodeOffset); - - for (wordIdx = 0, tokenPtr = parse.tokenPtr; - wordIdx < parse.numWords; - wordIdx++, tokenPtr += (tokenPtr->numComponents + 1)) { - if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { - /* - * If this is the first word and the command has a - * compile procedure, let it compile the command. - */ - - if (wordIdx == 0) { - if (envPtr->procPtr != NULL) { - cmdNsPtr = envPtr->procPtr->cmdPtr->nsPtr; - } else { - cmdNsPtr = NULL; /* use current NS */ - } - - /* - * We copy the string before trying to find the command - * by name. We used to modify the string in place, but - * this is not safe because the name resolution - * handlers could have side effects that rely on the - * unmodified string. - */ - - Tcl_DStringSetLength(&ds, 0); - Tcl_DStringAppend(&ds, tokenPtr[1].start, - tokenPtr[1].size); - - cmdPtr = (Command *) Tcl_FindCommand(interp, - Tcl_DStringValue(&ds), - (Tcl_Namespace *) cmdNsPtr, /*flags*/ 0); - - if ((cmdPtr != NULL) - && (cmdPtr->compileProc != NULL) - && !(iPtr->flags & DONT_COMPILE_CMDS_INLINE)) { - code = (*(cmdPtr->compileProc))(interp, &parse, - envPtr); - if (code == TCL_OK) { - maxDepth = TclMax(envPtr->maxStackDepth, - maxDepth); - goto finishCommand; - } else if (code == TCL_OUT_LINE_COMPILE) { - /* do nothing */ - } else { /* an error */ - goto error; - } - } - - /* - * No compile procedure so push the word. If the - * command was found, push a CmdName object to - * reduce runtime lookups. - */ - - objIndex = TclRegisterLiteral(envPtr, - tokenPtr[1].start, tokenPtr[1].size, - /*onHeap*/ 0); - if (cmdPtr != NULL) { - TclSetCmdNameObj(interp, - envPtr->literalArrayPtr[objIndex].objPtr, - cmdPtr); - } - } else { - objIndex = TclRegisterLiteral(envPtr, - tokenPtr[1].start, tokenPtr[1].size, - /*onHeap*/ 0); - } - TclEmitPush(objIndex, envPtr); - maxDepth = TclMax((wordIdx + 1), maxDepth); - } else { - /* - * The word is not a simple string of characters. - */ - - code = TclCompileTokens(interp, tokenPtr+1, - tokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - goto error; - } - maxDepth = TclMax((wordIdx + envPtr->maxStackDepth), - maxDepth); - } - } - - /* - * Emit an invoke instruction for the command. We skip this - * if a compile procedure was found for the command. - */ - - if (wordIdx > 0) { - if (wordIdx <= 255) { - TclEmitInstInt1(INST_INVOKE_STK1, wordIdx, envPtr); - } else { - TclEmitInstInt4(INST_INVOKE_STK4, wordIdx, envPtr); - } - } - - /* - * Update the compilation environment structure and record the - * offsets of the source and code for the command. - */ - - finishCommand: - EnterCmdExtentData(envPtr, currCmdIndex, commandLength, - (envPtr->codeNext-envPtr->codeStart) - startCodeOffset); - isFirstCmd = 0; - } /* end if parse.numWords > 0 */ - - /* - * Advance to the next command in the script. - */ - - next = parse.commandStart + parse.commandSize; - bytesLeft -= (next - p); - p = next; - Tcl_FreeParse(&parse); - gotParse = 0; - if (nested && (p[-1] == ']')) { - /* - * We get here in the special case where TCL_BRACKET_TERM was - * set in the interpreter and we reached a close bracket in the - * script. Stop compilation. - */ - - break; - } - } - - /* - * If the source script yielded no instructions (e.g., if it was empty), - * push an empty string as the command's result. - */ - - if (envPtr->codeNext == entryCodeNext) { - TclEmitPush(TclRegisterLiteral(envPtr, "", 0, /*alreadyAlloced*/ 0), - envPtr); - maxDepth = 1; - } - - if ((nested != 0) && (p > script) && (p[-1] == ']')) { - iPtr->termOffset = (p - 1) - script; - } else { - iPtr->termOffset = (p - script); - } - envPtr->maxStackDepth = maxDepth; - Tcl_DStringFree(&ds); - return TCL_OK; - - error: - /* - * Generate various pieces of error information, such as the line - * number where the error occurred and information to add to the - * errorInfo variable. Then free resources that had been allocated - * to the command. - */ - - commandLength = parse.commandSize; - prev = '\0'; - if (commandLength > 0) { - prev = parse.commandStart[commandLength-1]; - } - if (((parse.commandStart+commandLength) != (script+numBytes)) - || ((prev == '\n') || (nested && (prev == ']')))) { - /* - * The command where the error occurred didn't end at the end - * of the script (i.e. it ended at a terminator character such - * as ";". Reduce the length by one so that the error message - * doesn't include the terminator character. - */ - - commandLength -= 1; - } - LogCompilationInfo(interp, script, parse.commandStart, commandLength); - if (gotParse) { - Tcl_FreeParse(&parse); - } - iPtr->termOffset = (p - script); - envPtr->maxStackDepth = maxDepth; - Tcl_DStringFree(&ds); - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileTokens -- - * - * Given an array of tokens parsed from a Tcl command (e.g., the tokens - * that make up a word) this procedure emits instructions to evaluate - * the tokens and concatenate their values to form a single result - * value on the interpreter's runtime evaluation stack. - * - * Results: - * The return value is a standard Tcl result. If an error occurs, an - * error message is left in the interpreter's result. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to evaluate the tokens. - * - * Side effects: - * Instructions are added to envPtr to push and evaluate the tokens - * at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileTokens(interp, tokenPtr, count, envPtr) - Tcl_Interp *interp; /* Used for error and status reporting. */ - Tcl_Token *tokenPtr; /* Pointer to first in an array of tokens - * to compile. */ - int count; /* Number of tokens to consider at tokenPtr. - * Must be at least 1. */ - CompileEnv *envPtr; /* Holds the resulting instructions. */ -{ - Tcl_DString textBuffer; /* Holds concatenated chars from adjacent - * TCL_TOKEN_TEXT, TCL_TOKEN_BS tokens. */ - char buffer[TCL_UTF_MAX]; - char *name, *p; - int numObjsToConcat, nameBytes, hasNsQualifiers, localVar; - int length, maxDepth, depthForVar, i, code; - unsigned char *entryCodeNext = envPtr->codeNext; - - Tcl_DStringInit(&textBuffer); - maxDepth = 0; - numObjsToConcat = 0; - for ( ; count > 0; count--, tokenPtr++) { - switch (tokenPtr->type) { - case TCL_TOKEN_TEXT: - Tcl_DStringAppend(&textBuffer, tokenPtr->start, - tokenPtr->size); - break; - - case TCL_TOKEN_BS: - length = Tcl_UtfBackslash(tokenPtr->start, (int *) NULL, - buffer); - Tcl_DStringAppend(&textBuffer, buffer, length); - break; - - case TCL_TOKEN_COMMAND: - /* - * Push any accumulated chars appearing before the command. - */ - - if (Tcl_DStringLength(&textBuffer) > 0) { - int literal; - - literal = TclRegisterLiteral(envPtr, - Tcl_DStringValue(&textBuffer), - Tcl_DStringLength(&textBuffer), /*onHeap*/ 0); - TclEmitPush(literal, envPtr); - numObjsToConcat++; - maxDepth = TclMax(numObjsToConcat, maxDepth); - Tcl_DStringFree(&textBuffer); - } - - code = TclCompileScript(interp, tokenPtr->start+1, - tokenPtr->size-2, /*nested*/ 1, envPtr); - if (code != TCL_OK) { - goto error; - } - maxDepth = TclMax((numObjsToConcat + envPtr->maxStackDepth), - maxDepth); - numObjsToConcat++; - break; - - case TCL_TOKEN_VARIABLE: - /* - * Push any accumulated chars appearing before the $. - */ - - if (Tcl_DStringLength(&textBuffer) > 0) { - int literal; - - literal = TclRegisterLiteral(envPtr, - Tcl_DStringValue(&textBuffer), - Tcl_DStringLength(&textBuffer), /*onHeap*/ 0); - TclEmitPush(literal, envPtr); - numObjsToConcat++; - maxDepth = TclMax(numObjsToConcat, maxDepth); - Tcl_DStringFree(&textBuffer); - } - - /* - * Check if the name contains any namespace qualifiers. - */ - - name = tokenPtr[1].start; - nameBytes = tokenPtr[1].size; - hasNsQualifiers = 0; - for (i = 0, p = name; i < nameBytes; i++, p++) { - if ((*p == ':') && (i < (nameBytes-1)) - && (*(p+1) == ':')) { - hasNsQualifiers = 1; - break; - } - } - - /* - * Either push the variable's name, or find its index in - * the array of local variables in a procedure frame. - */ - - depthForVar = 0; - if ((envPtr->procPtr == NULL) || hasNsQualifiers) { - localVar = -1; - TclEmitPush(TclRegisterLiteral(envPtr, name, nameBytes, - /*onHeap*/ 0), envPtr); - depthForVar = 1; - } else { - localVar = TclFindCompiledLocal(name, nameBytes, - /*create*/ 0, /*flags*/ 0, envPtr->procPtr); - if (localVar < 0) { - TclEmitPush(TclRegisterLiteral(envPtr, name, - nameBytes, /*onHeap*/ 0), envPtr); - depthForVar = 1; - } - } - - /* - * Emit instructions to load the variable. - */ - - if (tokenPtr->numComponents == 1) { - if (localVar < 0) { - TclEmitOpcode(INST_LOAD_SCALAR_STK, envPtr); - } else if (localVar <= 255) { - TclEmitInstInt1(INST_LOAD_SCALAR1, localVar, - envPtr); - } else { - TclEmitInstInt4(INST_LOAD_SCALAR4, localVar, - envPtr); - } - } else { - code = TclCompileTokens(interp, tokenPtr+2, - tokenPtr->numComponents-1, envPtr); - if (code != TCL_OK) { - sprintf(buffer, - "\n (parsing index for array \"%.*s\")", - ((nameBytes > 100)? 100 : nameBytes), name); - Tcl_AddObjErrorInfo(interp, buffer, -1); - goto error; - } - depthForVar += envPtr->maxStackDepth; - if (localVar < 0) { - TclEmitOpcode(INST_LOAD_ARRAY_STK, envPtr); - } else if (localVar <= 255) { - TclEmitInstInt1(INST_LOAD_ARRAY1, localVar, - envPtr); - } else { - TclEmitInstInt4(INST_LOAD_ARRAY4, localVar, - envPtr); - } - } - maxDepth = TclMax(numObjsToConcat + depthForVar, maxDepth); - numObjsToConcat++; - count -= tokenPtr->numComponents; - tokenPtr += tokenPtr->numComponents; - break; - - default: - panic("Unexpected token type in TclCompileTokens"); - } - } - - /* - * Push any accumulated characters appearing at the end. - */ - - if (Tcl_DStringLength(&textBuffer) > 0) { - int literal; - - literal = TclRegisterLiteral(envPtr, Tcl_DStringValue(&textBuffer), - Tcl_DStringLength(&textBuffer), /*onHeap*/ 0); - TclEmitPush(literal, envPtr); - numObjsToConcat++; - maxDepth = TclMax(numObjsToConcat, maxDepth); - } - - /* - * If necessary, concatenate the parts of the word. - */ - - while (numObjsToConcat > 255) { - TclEmitInstInt1(INST_CONCAT1, 255, envPtr); - numObjsToConcat -= 254; /* concat pushes 1 obj, the result */ - } - if (numObjsToConcat > 1) { - TclEmitInstInt1(INST_CONCAT1, numObjsToConcat, envPtr); - } - - /* - * If the tokens yielded no instructions, push an empty string. - */ - - if (envPtr->codeNext == entryCodeNext) { - TclEmitPush(TclRegisterLiteral(envPtr, "", 0, /*alreadyAlloced*/ 0), - envPtr); - maxDepth = 1; - } - Tcl_DStringFree(&textBuffer); - envPtr->maxStackDepth = maxDepth; - return TCL_OK; - - error: - Tcl_DStringFree(&textBuffer); - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileCmdWord -- - * - * Given an array of parse tokens for a word containing one or more Tcl - * commands, emit inline instructions to execute them. This procedure - * differs from TclCompileTokens in that a simple word such as a loop - * body enclosed in braces is not just pushed as a string, but is - * itself parsed into tokens and compiled. - * - * Results: - * The return value is a standard Tcl result. If an error occurs, an - * error message is left in the interpreter's result. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the tokens. - * - * Side effects: - * Instructions are added to envPtr to execute the tokens at runtime. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileCmdWord(interp, tokenPtr, count, envPtr) - Tcl_Interp *interp; /* Used for error and status reporting. */ - Tcl_Token *tokenPtr; /* Pointer to first in an array of tokens - * for a command word to compile inline. */ - int count; /* Number of tokens to consider at tokenPtr. - * Must be at least 1. */ - CompileEnv *envPtr; /* Holds the resulting instructions. */ -{ - int code; - - /* - * Handle the common case: if there is a single text token, compile it - * into an inline sequence of instructions. - */ - - envPtr->maxStackDepth = 0; - if ((count == 1) && (tokenPtr->type == TCL_TOKEN_TEXT)) { - code = TclCompileScript(interp, tokenPtr->start, tokenPtr->size, - /*nested*/ 0, envPtr); - return code; - } - - /* - * Multiple tokens or the single token involves substitutions. Emit - * instructions to invoke the eval command procedure at runtime on the - * result of evaluating the tokens. - */ - - code = TclCompileTokens(interp, tokenPtr, count, envPtr); - if (code != TCL_OK) { - return code; - } - TclEmitOpcode(INST_EVAL_STK, envPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclCompileExprWords -- - * - * Given an array of parse tokens representing one or more words that - * contain a Tcl expression, emit inline instructions to execute the - * expression. This procedure differs from TclCompileExpr in that it - * supports Tcl's two-level substitution semantics for expressions that - * appear as command words. - * - * Results: - * The return value is a standard Tcl result. If an error occurs, an - * error message is left in the interpreter's result. - * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the expression. - * - * Side effects: - * Instructions are added to envPtr to execute the expression. - * - *---------------------------------------------------------------------- - */ - -int -TclCompileExprWords(interp, tokenPtr, numWords, envPtr) - Tcl_Interp *interp; /* Used for error and status reporting. */ - Tcl_Token *tokenPtr; /* Points to first in an array of word - * tokens tokens for the expression to - * compile inline. */ - int numWords; /* Number of word tokens starting at - * tokenPtr. Must be at least 1. Each word - * token contains one or more subtokens. */ - CompileEnv *envPtr; /* Holds the resulting instructions. */ -{ - Tcl_Token *wordPtr, *partPtr; - JumpFixup jumpFixup; - int maxDepth, doExprInline, range, numBytes, i, j, code; - char *script; - char saveChar; - int saveExprIsJustVarRef = envPtr->exprIsJustVarRef; - int saveExprIsComparison = envPtr->exprIsComparison; - - envPtr->maxStackDepth = 0; - maxDepth = 0; - range = -1; - code = TCL_OK; - - /* - * If the expression is a single word that doesn't require - * substitutions, just compile it's string into inline instructions. - */ - - if ((numWords == 1) && (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD)) { - /* - * Temporarily overwrite the character just after the end of the - * string with a 0 byte. - */ - - script = tokenPtr[1].start; - numBytes = tokenPtr[1].size; - saveChar = script[numBytes]; - script[numBytes] = 0; - code = TclCompileExpr(interp, script, numBytes, envPtr); - script[numBytes] = saveChar; - return code; - } - - /* - * Multiple words or the single word requires substitutions. We may - * need to call expr's command proc at runtime. This often recompiles - * the expression each time and is slow. However, there are some - * circumstances where we can still compile inline code "optimistically" - * and check for type errors during execution that signal when double - * substitutions must be done. - */ - - doExprInline = 1; - wordPtr = tokenPtr; - for (i = 0; ((i < numWords) && doExprInline); i++) { - if (wordPtr->type == TCL_TOKEN_WORD) { - for (j = 0, partPtr = wordPtr+1; j < wordPtr->numComponents; - j++, partPtr++) { - if ((partPtr->type == TCL_TOKEN_BS) - || (partPtr->type == TCL_TOKEN_COMMAND)) { - doExprInline = 0; - break; - } - } - } - wordPtr += (wordPtr->numComponents + 1); - } - - /* - * If only variable substitutions appear (no backslash or command - * substitutions), inline compile the expr inside a "catch" so that if - * there is any error, we call expr's command proc at runtime. - */ - - if (doExprInline) { - Tcl_DString exprBuffer; - int startCodeOffset = (envPtr->codeNext - envPtr->codeStart); - int startExceptNext = envPtr->exceptArrayNext; - - envPtr->exceptDepth++; - envPtr->maxExceptDepth = - TclMax(envPtr->exceptDepth, envPtr->maxExceptDepth); - range = TclCreateExceptRange(CATCH_EXCEPTION_RANGE, envPtr); - TclEmitInstInt4(INST_BEGIN_CATCH4, range, envPtr); - - Tcl_DStringInit(&exprBuffer); - wordPtr = tokenPtr; - for (i = 0; i < numWords; i++) { - if (i > 0) { - Tcl_DStringAppend(&exprBuffer, " ", 1); - } - for (j = 0, partPtr = wordPtr+1; j < wordPtr->numComponents; - j++, partPtr++) { - switch (partPtr->type) { - case TCL_TOKEN_TEXT: - Tcl_DStringAppend(&exprBuffer, partPtr->start, - partPtr->size); - break; - - case TCL_TOKEN_VARIABLE: - Tcl_DStringAppend(&exprBuffer, partPtr->start, - partPtr->size); - j += partPtr->numComponents; - partPtr += partPtr->numComponents; - break; - - default: - panic("unexpected token type in TclCompileExprWords"); - } - } - wordPtr += (wordPtr->numComponents + 1); - } - envPtr->exceptArrayPtr[range].codeOffset = - (envPtr->codeNext - envPtr->codeStart); - code = TclCompileExpr(interp, Tcl_DStringValue(&exprBuffer), - Tcl_DStringLength(&exprBuffer), envPtr); - envPtr->exceptArrayPtr[range].numCodeBytes = - (envPtr->codeNext - envPtr->codeStart) - - envPtr->exceptArrayPtr[range].codeOffset; - maxDepth = envPtr->maxStackDepth; - Tcl_DStringFree(&exprBuffer); - - if ((code != TCL_OK) || (envPtr->exprIsJustVarRef) - || (envPtr->exprIsComparison)) { - /* - * Delete the inline code and call the expr command proc at - * runtime. There was a compilation error or the inline code - * might not have the right 2 level substitution semantics: - * e.g., if the expr consisted of a single variable ref or the - * top-level operator is a comparison (which might operate on - * strings). The code might appear to execute successfully but - * produce the wrong result. We depend on execution failing if a - * second level of substitutions is required. - */ - - envPtr->codeNext = (envPtr->codeStart + startCodeOffset); - envPtr->exceptArrayNext = startExceptNext; - doExprInline = 0; - } else { - TclEmitOpcode(INST_END_CATCH, envPtr); /* for ok case */ - TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &jumpFixup); - envPtr->exceptArrayPtr[range].catchOffset = - (envPtr->codeNext - envPtr->codeStart); - TclEmitOpcode(INST_END_CATCH, envPtr); /* for error case */ - } - } - - /* - * Emit code to call the expr command proc at runtime. Concatenate the - * (already substituted once) expr tokens with a space between each. - */ - - wordPtr = tokenPtr; - for (i = 0; i < numWords; i++) { - code = TclCompileTokens(interp, wordPtr+1, wordPtr->numComponents, - envPtr); - if (code != TCL_OK) { - break; - } - if (i < (numWords - 1)) { - TclEmitPush(TclRegisterLiteral(envPtr, " ", 1, /*onHeap*/ 0), - envPtr); - maxDepth = TclMax((envPtr->maxStackDepth + 1), maxDepth); - } else { - maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - } - wordPtr += (wordPtr->numComponents + 1); - } - if (code == TCL_OK) { - int concatItems = 2*numWords - 1; - while (concatItems > 255) { - TclEmitInstInt1(INST_CONCAT1, 255, envPtr); - concatItems -= 254; - } - if (concatItems > 1) { - TclEmitInstInt1(INST_CONCAT1, concatItems, envPtr); - } - TclEmitOpcode(INST_EXPR_STK, envPtr); - } - - /* - * If generating inline code, update the target of the jump at the end. - */ - - if (doExprInline) { - int jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpFixup.codeOffset; - if (TclFixupForwardJump(envPtr, &jumpFixup, jumpDist, 127)) { - /* - * Update the inline expression code's catch ExceptionRange - * target since it, being after the jump, also moved down. - */ - - envPtr->exceptArrayPtr[range].catchOffset += 3; - } - envPtr->exceptDepth--; - } - - envPtr->exprIsJustVarRef = saveExprIsJustVarRef; - envPtr->exprIsComparison = saveExprIsComparison; - envPtr->maxStackDepth = maxDepth; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclInitByteCodeObj -- - * - * Create a ByteCode structure and initialize it from a CompileEnv - * compilation environment structure. The ByteCode structure is - * smaller and contains just that information needed to execute - * the bytecode instructions resulting from compiling a Tcl script. - * The resulting structure is placed in the specified object. - * - * Results: - * A newly constructed ByteCode object is stored in the internal - * representation of the objPtr. - * - * Side effects: - * A single heap object is allocated to hold the new ByteCode structure - * and its code, object, command location, and aux data arrays. Note - * that "ownership" (i.e., the pointers to) the Tcl objects and aux - * data items will be handed over to the new ByteCode structure from - * the CompileEnv structure. - * - *---------------------------------------------------------------------- - */ - -void -TclInitByteCodeObj(objPtr, envPtr) - Tcl_Obj *objPtr; /* Points object that should be - * initialized, and whose string rep - * contains the source code. */ - register CompileEnv *envPtr; /* Points to the CompileEnv structure from - * which to create a ByteCode structure. */ -{ - register ByteCode *codePtr; - size_t codeBytes, objArrayBytes, exceptArrayBytes, cmdLocBytes; - size_t auxDataArrayBytes, structureSize; - register unsigned char *p; - unsigned char *nextPtr; - int numLitObjects = envPtr->literalArrayNext; - Namespace *namespacePtr; - int i; - Interp *iPtr; - - iPtr = envPtr->iPtr; - - codeBytes = (envPtr->codeNext - envPtr->codeStart); - objArrayBytes = (envPtr->literalArrayNext * sizeof(Tcl_Obj *)); - exceptArrayBytes = (envPtr->exceptArrayNext * sizeof(ExceptionRange)); - auxDataArrayBytes = (envPtr->auxDataArrayNext * sizeof(AuxData)); - cmdLocBytes = GetCmdLocEncodingSize(envPtr); - - /* - * Compute the total number of bytes needed for this bytecode. - */ - - structureSize = sizeof(ByteCode); - structureSize += TCL_ALIGN(codeBytes); /* align object array */ - structureSize += TCL_ALIGN(objArrayBytes); /* align exc range arr */ - structureSize += TCL_ALIGN(exceptArrayBytes); /* align AuxData array */ - structureSize += auxDataArrayBytes; - structureSize += cmdLocBytes; - - if (envPtr->iPtr->varFramePtr != NULL) { - namespacePtr = envPtr->iPtr->varFramePtr->nsPtr; - } else { - namespacePtr = envPtr->iPtr->globalNsPtr; - } - - p = (unsigned char *) ckalloc((size_t) structureSize); - codePtr = (ByteCode *) p; - codePtr->interpHandle = TclHandlePreserve(iPtr->handle); - codePtr->compileEpoch = iPtr->compileEpoch; - codePtr->nsPtr = namespacePtr; - codePtr->nsEpoch = namespacePtr->resolverEpoch; - codePtr->refCount = 1; - codePtr->flags = 0; - codePtr->source = envPtr->source; - codePtr->procPtr = envPtr->procPtr; - - codePtr->numCommands = envPtr->numCommands; - codePtr->numSrcBytes = envPtr->numSrcBytes; - codePtr->numCodeBytes = codeBytes; - codePtr->numLitObjects = numLitObjects; - codePtr->numExceptRanges = envPtr->exceptArrayNext; - codePtr->numAuxDataItems = envPtr->auxDataArrayNext; - codePtr->numCmdLocBytes = cmdLocBytes; - codePtr->maxExceptDepth = envPtr->maxExceptDepth; - codePtr->maxStackDepth = envPtr->maxStackDepth; - - p += sizeof(ByteCode); - codePtr->codeStart = p; - memcpy((VOID *) p, (VOID *) envPtr->codeStart, (size_t) codeBytes); - - p += TCL_ALIGN(codeBytes); /* align object array */ - codePtr->objArrayPtr = (Tcl_Obj **) p; - for (i = 0; i < numLitObjects; i++) { - codePtr->objArrayPtr[i] = envPtr->literalArrayPtr[i].objPtr; - } - - p += TCL_ALIGN(objArrayBytes); /* align exception range array */ - if (exceptArrayBytes > 0) { - codePtr->exceptArrayPtr = (ExceptionRange *) p; - memcpy((VOID *) p, (VOID *) envPtr->exceptArrayPtr, - (size_t) exceptArrayBytes); - } else { - codePtr->exceptArrayPtr = NULL; - } - - p += TCL_ALIGN(exceptArrayBytes); /* align AuxData array */ - if (auxDataArrayBytes > 0) { - codePtr->auxDataArrayPtr = (AuxData *) p; - memcpy((VOID *) p, (VOID *) envPtr->auxDataArrayPtr, - (size_t) auxDataArrayBytes); - } else { - codePtr->auxDataArrayPtr = NULL; - } - - p += auxDataArrayBytes; - nextPtr = EncodeCmdLocMap(envPtr, codePtr, (unsigned char *) p); -#ifdef TCL_COMPILE_DEBUG - if (((size_t)(nextPtr - p)) != cmdLocBytes) { - panic("TclInitByteCodeObj: encoded cmd location bytes %d != expected size %d\n", (nextPtr - p), cmdLocBytes); - } -#endif - - /* - * Record various compilation-related statistics about the new ByteCode - * structure. Don't include overhead for statistics-related fields. - */ - -#ifdef TCL_COMPILE_STATS - codePtr->structureSize = structureSize - - (sizeof(size_t) + sizeof(Tcl_Time)); - TclpGetTime(&(codePtr->createTime)); - - RecordByteCodeStats(codePtr); -#endif /* TCL_COMPILE_STATS */ - - /* - * Free the old internal rep then convert the object to a - * bytecode object by making its internal rep point to the just - * compiled ByteCode. - */ - - if ((objPtr->typePtr != NULL) && - (objPtr->typePtr->freeIntRepProc != NULL)) { - (*objPtr->typePtr->freeIntRepProc)(objPtr); - } - objPtr->internalRep.otherValuePtr = (VOID *) codePtr; - objPtr->typePtr = &tclByteCodeType; -} - -/* - *---------------------------------------------------------------------- - * - * LogCompilationInfo -- - * - * This procedure is invoked after an error occurs during compilation. - * It adds information to the "errorInfo" variable to describe the - * command that was being compiled when the error occurred. - * - * Results: - * None. - * - * Side effects: - * Information about the command is added to errorInfo and the - * line number stored internally in the interpreter is set. If this - * is the first call to this procedure or Tcl_AddObjErrorInfo since - * an error occurred, then old information in errorInfo is - * deleted. - * - *---------------------------------------------------------------------- - */ - -static void -LogCompilationInfo(interp, script, command, length) - Tcl_Interp *interp; /* Interpreter in which to log the - * information. */ - char *script; /* First character in script containing - * command (must be <= command). */ - char *command; /* First character in command that - * generated the error. */ - int length; /* Number of bytes in command (-1 means - * use all bytes up to first null byte). */ -{ - char buffer[200]; - register char *p; - char *ellipsis = ""; - Interp *iPtr = (Interp *) interp; - - if (iPtr->flags & ERR_ALREADY_LOGGED) { - /* - * Someone else has already logged error information for this - * command; we shouldn't add anything more. - */ - - return; - } - - /* - * Compute the line number where the error occurred. - */ - - iPtr->errorLine = 1; - for (p = script; p != command; p++) { - if (*p == '\n') { - iPtr->errorLine++; - } - } - - /* - * Create an error message to add to errorInfo, including up to a - * maximum number of characters of the command. - */ - - if (length < 0) { - length = strlen(command); - } - if (length > 150) { - length = 150; - ellipsis = "..."; - } - sprintf(buffer, "\n while compiling\n\"%.*s%s\"", - length, command, ellipsis); - Tcl_AddObjErrorInfo(interp, buffer, -1); -} - -/* - *---------------------------------------------------------------------- - * - * TclFindCompiledLocal -- - * - * This procedure is called at compile time to look up and optionally - * allocate an entry ("slot") for a variable in a procedure's array of - * local variables. If the variable's name is NULL, a new temporary - * variable is always created. (Such temporary variables can only be - * referenced using their slot index.) - * - * Results: - * If create is 0 and the name is non-NULL, then if the variable is - * found, the index of its entry in the procedure's array of local - * variables is returned; otherwise -1 is returned. If name is NULL, - * the index of a new temporary variable is returned. Finally, if - * create is 1 and name is non-NULL, the index of a new entry is - * returned. - * - * Side effects: - * Creates and registers a new local variable if create is 1 and - * the variable is unknown, or if the name is NULL. - * - *---------------------------------------------------------------------- - */ - -int -TclFindCompiledLocal(name, nameBytes, create, flags, procPtr) - register char *name; /* Points to first character of the name of - * a scalar or array variable. If NULL, a - * temporary var should be created. */ - int nameBytes; /* Number of bytes in the name. */ - int create; /* If 1, allocate a local frame entry for - * the variable if it is new. */ - int flags; /* Flag bits for the compiled local if - * created. Only VAR_SCALAR, VAR_ARRAY, and - * VAR_LINK make sense. */ - register Proc *procPtr; /* Points to structure describing procedure - * containing the variable reference. */ -{ - register CompiledLocal *localPtr; - int localVar = -1; - register int i; - - /* - * If not creating a temporary, does a local variable of the specified - * name already exist? - */ - - if (name != NULL) { - int localCt = procPtr->numCompiledLocals; - localPtr = procPtr->firstLocalPtr; - for (i = 0; i < localCt; i++) { - if (!TclIsVarTemporary(localPtr)) { - char *localName = localPtr->name; - if ((name[0] == localName[0]) - && (nameBytes == localPtr->nameLength) - && (strncmp(name, localName, (unsigned) nameBytes) == 0)) { - return i; - } - } - localPtr = localPtr->nextPtr; - } - } - - /* - * Create a new variable if appropriate. - */ - - if (create || (name == NULL)) { - localVar = procPtr->numCompiledLocals; - localPtr = (CompiledLocal *) ckalloc((unsigned) - (sizeof(CompiledLocal) - sizeof(localPtr->name) - + nameBytes+1)); - if (procPtr->firstLocalPtr == NULL) { - procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr; - } else { - procPtr->lastLocalPtr->nextPtr = localPtr; - procPtr->lastLocalPtr = localPtr; - } - localPtr->nextPtr = NULL; - localPtr->nameLength = nameBytes; - localPtr->frameIndex = localVar; - localPtr->flags = flags; - if (name == NULL) { - localPtr->flags |= VAR_TEMPORARY; - } - localPtr->defValuePtr = NULL; - localPtr->resolveInfo = NULL; - - if (name != NULL) { - memcpy((VOID *) localPtr->name, (VOID *) name, - (size_t) nameBytes); - } - localPtr->name[nameBytes] = '\0'; - procPtr->numCompiledLocals++; - } - return localVar; -} - -/* - *---------------------------------------------------------------------- - * - * TclInitCompiledLocals -- - * - * This routine is invoked in order to initialize the compiled - * locals table for a new call frame. - * - * Results: - * None. - * - * Side effects: - * May invoke various name resolvers in order to determine which - * variables are being referenced at runtime. - * - *---------------------------------------------------------------------- - */ - -void -TclInitCompiledLocals(interp, framePtr, nsPtr) - Tcl_Interp *interp; /* Current interpreter. */ - CallFrame *framePtr; /* Call frame to initialize. */ - Namespace *nsPtr; /* Pointer to current namespace. */ -{ - register CompiledLocal *localPtr; - Interp *iPtr = (Interp*) interp; - Tcl_ResolvedVarInfo *vinfo, *resVarInfo; - Var *varPtr = framePtr->compiledLocals; - Var *resolvedVarPtr; - ResolverScheme *resPtr; - int result; - - /* - * Initialize the array of local variables stored in the call frame. - * Some variables may have special resolution rules. In that case, - * we call their "resolver" procs to get our hands on the variable, - * and we make the compiled local a link to the real variable. - */ - - for (localPtr = framePtr->procPtr->firstLocalPtr; - localPtr != NULL; - localPtr = localPtr->nextPtr) { - - /* - * Check to see if this local is affected by namespace or - * interp resolvers. The resolver to use is cached for the - * next invocation of the procedure. - */ - - if (!(localPtr->flags & (VAR_ARGUMENT|VAR_TEMPORARY|VAR_RESOLVED)) - && (nsPtr->compiledVarResProc || iPtr->resolverPtr)) { - resPtr = iPtr->resolverPtr; - - if (nsPtr->compiledVarResProc) { - result = (*nsPtr->compiledVarResProc)(nsPtr->interp, - localPtr->name, localPtr->nameLength, - (Tcl_Namespace *) nsPtr, &vinfo); - } else { - result = TCL_CONTINUE; - } - - while ((result == TCL_CONTINUE) && resPtr) { - if (resPtr->compiledVarResProc) { - result = (*resPtr->compiledVarResProc)(nsPtr->interp, - localPtr->name, localPtr->nameLength, - (Tcl_Namespace *) nsPtr, &vinfo); - } - resPtr = resPtr->nextPtr; - } - if (result == TCL_OK) { - localPtr->resolveInfo = vinfo; - localPtr->flags |= VAR_RESOLVED; - } - } - - /* - * Now invoke the resolvers to determine the exact variables that - * should be used. - */ - - resVarInfo = localPtr->resolveInfo; - resolvedVarPtr = NULL; - - if (resVarInfo && resVarInfo->fetchProc) { - resolvedVarPtr = (Var*) (*resVarInfo->fetchProc)(interp, - resVarInfo); - } - - if (resolvedVarPtr) { - varPtr->name = localPtr->name; /* will be just '\0' if temp var */ - varPtr->nsPtr = NULL; - varPtr->hPtr = NULL; - varPtr->refCount = 0; - varPtr->tracePtr = NULL; - varPtr->searchPtr = NULL; - varPtr->flags = 0; - TclSetVarLink(varPtr); - varPtr->value.linkPtr = resolvedVarPtr; - resolvedVarPtr->refCount++; - } else { - varPtr->value.objPtr = NULL; - varPtr->name = localPtr->name; /* will be just '\0' if temp var */ - varPtr->nsPtr = NULL; - varPtr->hPtr = NULL; - varPtr->refCount = 0; - varPtr->tracePtr = NULL; - varPtr->searchPtr = NULL; - varPtr->flags = (localPtr->flags | VAR_UNDEFINED); - } - varPtr++; - } -} - -/* - *---------------------------------------------------------------------- - * - * TclExpandCodeArray -- - * - * Procedure that uses malloc to allocate more storage for a - * CompileEnv's code array. - * - * Results: - * None. - * - * Side effects: - * The byte code array in *envPtr is reallocated to a new array of - * double the size, and if envPtr->mallocedCodeArray is non-zero the - * old array is freed. Byte codes are copied from the old array to the - * new one. - * - *---------------------------------------------------------------------- - */ - -void -TclExpandCodeArray(envPtr) - CompileEnv *envPtr; /* Points to the CompileEnv whose code array - * must be enlarged. */ -{ - /* - * envPtr->codeNext is equal to envPtr->codeEnd. The currently defined - * code bytes are stored between envPtr->codeStart and - * (envPtr->codeNext - 1) [inclusive]. - */ - - size_t currBytes = (envPtr->codeNext - envPtr->codeStart); - size_t newBytes = 2*(envPtr->codeEnd - envPtr->codeStart); - unsigned char *newPtr = (unsigned char *) ckalloc((unsigned) newBytes); - - /* - * Copy from old code array to new, free old code array if needed, and - * mark new code array as malloced. - */ - - memcpy((VOID *) newPtr, (VOID *) envPtr->codeStart, currBytes); - if (envPtr->mallocedCodeArray) { - ckfree((char *) envPtr->codeStart); - } - envPtr->codeStart = newPtr; - envPtr->codeNext = (newPtr + currBytes); - envPtr->codeEnd = (newPtr + newBytes); - envPtr->mallocedCodeArray = 1; -} - -/* - *---------------------------------------------------------------------- - * - * EnterCmdStartData -- - * - * Registers the starting source and bytecode location of a - * command. This information is used at runtime to map between - * instruction pc and source locations. - * - * Results: - * None. - * - * Side effects: - * Inserts source and code location information into the compilation - * environment envPtr for the command at index cmdIndex. The - * compilation environment's CmdLocation array is grown if necessary. - * - *---------------------------------------------------------------------- - */ - -static void -EnterCmdStartData(envPtr, cmdIndex, srcOffset, codeOffset) - CompileEnv *envPtr; /* Points to the compilation environment - * structure in which to enter command - * location information. */ - int cmdIndex; /* Index of the command whose start data - * is being set. */ - int srcOffset; /* Offset of first char of the command. */ - int codeOffset; /* Offset of first byte of command code. */ -{ - CmdLocation *cmdLocPtr; - - if ((cmdIndex < 0) || (cmdIndex >= envPtr->numCommands)) { - panic("EnterCmdStartData: bad command index %d\n", cmdIndex); - } - - if (cmdIndex >= envPtr->cmdMapEnd) { - /* - * Expand the command location array by allocating more storage from - * the heap. The currently allocated CmdLocation entries are stored - * from cmdMapPtr[0] up to cmdMapPtr[envPtr->cmdMapEnd] (inclusive). - */ - - size_t currElems = envPtr->cmdMapEnd; - size_t newElems = 2*currElems; - size_t currBytes = currElems * sizeof(CmdLocation); - size_t newBytes = newElems * sizeof(CmdLocation); - CmdLocation *newPtr = (CmdLocation *) ckalloc((unsigned) newBytes); - - /* - * Copy from old command location array to new, free old command - * location array if needed, and mark new array as malloced. - */ - - memcpy((VOID *) newPtr, (VOID *) envPtr->cmdMapPtr, currBytes); - if (envPtr->mallocedCmdMap) { - ckfree((char *) envPtr->cmdMapPtr); - } - envPtr->cmdMapPtr = (CmdLocation *) newPtr; - envPtr->cmdMapEnd = newElems; - envPtr->mallocedCmdMap = 1; - } - - if (cmdIndex > 0) { - if (codeOffset < envPtr->cmdMapPtr[cmdIndex-1].codeOffset) { - panic("EnterCmdStartData: cmd map not sorted by code offset"); - } - } - - cmdLocPtr = &(envPtr->cmdMapPtr[cmdIndex]); - cmdLocPtr->codeOffset = codeOffset; - cmdLocPtr->srcOffset = srcOffset; - cmdLocPtr->numSrcBytes = -1; - cmdLocPtr->numCodeBytes = -1; -} - -/* - *---------------------------------------------------------------------- - * - * EnterCmdExtentData -- - * - * Registers the source and bytecode length for a command. This - * information is used at runtime to map between instruction pc and - * source locations. - * - * Results: - * None. - * - * Side effects: - * Inserts source and code length information into the compilation - * environment envPtr for the command at index cmdIndex. Starting - * source and bytecode information for the command must already - * have been registered. - * - *---------------------------------------------------------------------- - */ - -static void -EnterCmdExtentData(envPtr, cmdIndex, numSrcBytes, numCodeBytes) - CompileEnv *envPtr; /* Points to the compilation environment - * structure in which to enter command - * location information. */ - int cmdIndex; /* Index of the command whose source and - * code length data is being set. */ - int numSrcBytes; /* Number of command source chars. */ - int numCodeBytes; /* Offset of last byte of command code. */ -{ - CmdLocation *cmdLocPtr; - - if ((cmdIndex < 0) || (cmdIndex >= envPtr->numCommands)) { - panic("EnterCmdExtentData: bad command index %d\n", cmdIndex); - } - - if (cmdIndex > envPtr->cmdMapEnd) { - panic("EnterCmdExtentData: missing start data for command %d\n", - cmdIndex); - } - - cmdLocPtr = &(envPtr->cmdMapPtr[cmdIndex]); - cmdLocPtr->numSrcBytes = numSrcBytes; - cmdLocPtr->numCodeBytes = numCodeBytes; -} - -/* - *---------------------------------------------------------------------- - * - * TclCreateExceptRange -- - * - * Procedure that allocates and initializes a new ExceptionRange - * structure of the specified kind in a CompileEnv. - * - * Results: - * Returns the index for the newly created ExceptionRange. - * - * Side effects: - * If there is not enough room in the CompileEnv's ExceptionRange - * array, the array in expanded: a new array of double the size is - * allocated, if envPtr->mallocedExceptArray is non-zero the old - * array is freed, and ExceptionRange entries are copied from the old - * array to the new one. - * - *---------------------------------------------------------------------- - */ - -int -TclCreateExceptRange(type, envPtr) - ExceptionRangeType type; /* The kind of ExceptionRange desired. */ - register CompileEnv *envPtr;/* Points to CompileEnv for which to - * create a new ExceptionRange structure. */ -{ - register ExceptionRange *rangePtr; - int index = envPtr->exceptArrayNext; - - if (index >= envPtr->exceptArrayEnd) { - /* - * Expand the ExceptionRange array. The currently allocated entries - * are stored between elements 0 and (envPtr->exceptArrayNext - 1) - * [inclusive]. - */ - - size_t currBytes = - envPtr->exceptArrayNext * sizeof(ExceptionRange); - int newElems = 2*envPtr->exceptArrayEnd; - size_t newBytes = newElems * sizeof(ExceptionRange); - ExceptionRange *newPtr = (ExceptionRange *) - ckalloc((unsigned) newBytes); - - /* - * Copy from old ExceptionRange array to new, free old - * ExceptionRange array if needed, and mark the new ExceptionRange - * array as malloced. - */ - - memcpy((VOID *) newPtr, (VOID *) envPtr->exceptArrayPtr, - currBytes); - if (envPtr->mallocedExceptArray) { - ckfree((char *) envPtr->exceptArrayPtr); - } - envPtr->exceptArrayPtr = (ExceptionRange *) newPtr; - envPtr->exceptArrayEnd = newElems; - envPtr->mallocedExceptArray = 1; - } - envPtr->exceptArrayNext++; - - rangePtr = &(envPtr->exceptArrayPtr[index]); - rangePtr->type = type; - rangePtr->nestingLevel = envPtr->exceptDepth; - rangePtr->codeOffset = -1; - rangePtr->numCodeBytes = -1; - rangePtr->breakOffset = -1; - rangePtr->continueOffset = -1; - rangePtr->catchOffset = -1; - return index; -} - -/* - *---------------------------------------------------------------------- - * - * TclCreateAuxData -- - * - * Procedure that allocates and initializes a new AuxData structure in - * a CompileEnv's array of compilation auxiliary data records. These - * AuxData records hold information created during compilation by - * CompileProcs and used by instructions during execution. - * - * Results: - * Returns the index for the newly created AuxData structure. - * - * Side effects: - * If there is not enough room in the CompileEnv's AuxData array, - * the AuxData array in expanded: a new array of double the size - * is allocated, if envPtr->mallocedAuxDataArray is non-zero - * the old array is freed, and AuxData entries are copied from - * the old array to the new one. - * - *---------------------------------------------------------------------- - */ - -int -TclCreateAuxData(clientData, typePtr, envPtr) - ClientData clientData; /* The compilation auxiliary data to store - * in the new aux data record. */ - AuxDataType *typePtr; /* Pointer to the type to attach to this AuxData */ - register CompileEnv *envPtr;/* Points to the CompileEnv for which a new - * aux data structure is to be allocated. */ -{ - int index; /* Index for the new AuxData structure. */ - register AuxData *auxDataPtr; - /* Points to the new AuxData structure */ - - index = envPtr->auxDataArrayNext; - if (index >= envPtr->auxDataArrayEnd) { - /* - * Expand the AuxData array. The currently allocated entries are - * stored between elements 0 and (envPtr->auxDataArrayNext - 1) - * [inclusive]. - */ - - size_t currBytes = envPtr->auxDataArrayNext * sizeof(AuxData); - int newElems = 2*envPtr->auxDataArrayEnd; - size_t newBytes = newElems * sizeof(AuxData); - AuxData *newPtr = (AuxData *) ckalloc((unsigned) newBytes); - - /* - * Copy from old AuxData array to new, free old AuxData array if - * needed, and mark the new AuxData array as malloced. - */ - - memcpy((VOID *) newPtr, (VOID *) envPtr->auxDataArrayPtr, - currBytes); - if (envPtr->mallocedAuxDataArray) { - ckfree((char *) envPtr->auxDataArrayPtr); - } - envPtr->auxDataArrayPtr = newPtr; - envPtr->auxDataArrayEnd = newElems; - envPtr->mallocedAuxDataArray = 1; - } - envPtr->auxDataArrayNext++; - - auxDataPtr = &(envPtr->auxDataArrayPtr[index]); - auxDataPtr->clientData = clientData; - auxDataPtr->type = typePtr; - return index; -} - -/* - *---------------------------------------------------------------------- - * - * TclInitJumpFixupArray -- - * - * Initializes a JumpFixupArray structure to hold some number of - * jump fixup entries. - * - * Results: - * None. - * - * Side effects: - * The JumpFixupArray structure is initialized. - * - *---------------------------------------------------------------------- - */ - -void -TclInitJumpFixupArray(fixupArrayPtr) - register JumpFixupArray *fixupArrayPtr; - /* Points to the JumpFixupArray structure - * to initialize. */ -{ - fixupArrayPtr->fixup = fixupArrayPtr->staticFixupSpace; - fixupArrayPtr->next = 0; - fixupArrayPtr->end = (JUMPFIXUP_INIT_ENTRIES - 1); - fixupArrayPtr->mallocedArray = 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclExpandJumpFixupArray -- - * - * Procedure that uses malloc to allocate more storage for a - * jump fixup array. - * - * Results: - * None. - * - * Side effects: - * The jump fixup array in *fixupArrayPtr is reallocated to a new array - * of double the size, and if fixupArrayPtr->mallocedArray is non-zero - * the old array is freed. Jump fixup structures are copied from the - * old array to the new one. - * - *---------------------------------------------------------------------- - */ - -void -TclExpandJumpFixupArray(fixupArrayPtr) - register JumpFixupArray *fixupArrayPtr; - /* Points to the JumpFixupArray structure - * to enlarge. */ -{ - /* - * The currently allocated jump fixup entries are stored from fixup[0] - * up to fixup[fixupArrayPtr->fixupNext] (*not* inclusive). We assume - * fixupArrayPtr->fixupNext is equal to fixupArrayPtr->fixupEnd. - */ - - size_t currBytes = fixupArrayPtr->next * sizeof(JumpFixup); - int newElems = 2*(fixupArrayPtr->end + 1); - size_t newBytes = newElems * sizeof(JumpFixup); - JumpFixup *newPtr = (JumpFixup *) ckalloc((unsigned) newBytes); - - /* - * Copy from the old array to new, free the old array if needed, - * and mark the new array as malloced. - */ - - memcpy((VOID *) newPtr, (VOID *) fixupArrayPtr->fixup, currBytes); - if (fixupArrayPtr->mallocedArray) { - ckfree((char *) fixupArrayPtr->fixup); - } - fixupArrayPtr->fixup = (JumpFixup *) newPtr; - fixupArrayPtr->end = newElems; - fixupArrayPtr->mallocedArray = 1; -} - -/* - *---------------------------------------------------------------------- - * - * TclFreeJumpFixupArray -- - * - * Free any storage allocated in a jump fixup array structure. - * - * Results: - * None. - * - * Side effects: - * Allocated storage in the JumpFixupArray structure is freed. - * - *---------------------------------------------------------------------- - */ - -void -TclFreeJumpFixupArray(fixupArrayPtr) - register JumpFixupArray *fixupArrayPtr; - /* Points to the JumpFixupArray structure - * to free. */ -{ - if (fixupArrayPtr->mallocedArray) { - ckfree((char *) fixupArrayPtr->fixup); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclEmitForwardJump -- - * - * Procedure to emit a two-byte forward jump of kind "jumpType". Since - * the jump may later have to be grown to five bytes if the jump target - * is more than, say, 127 bytes away, this procedure also initializes a - * JumpFixup record with information about the jump. - * - * Results: - * None. - * - * Side effects: - * The JumpFixup record pointed to by "jumpFixupPtr" is initialized - * with information needed later if the jump is to be grown. Also, - * a two byte jump of the designated type is emitted at the current - * point in the bytecode stream. - * - *---------------------------------------------------------------------- - */ - -void -TclEmitForwardJump(envPtr, jumpType, jumpFixupPtr) - CompileEnv *envPtr; /* Points to the CompileEnv structure that - * holds the resulting instruction. */ - TclJumpType jumpType; /* Indicates the kind of jump: if true or - * false or unconditional. */ - JumpFixup *jumpFixupPtr; /* Points to the JumpFixup structure to - * initialize with information about this - * forward jump. */ -{ - /* - * Initialize the JumpFixup structure: - * - codeOffset is offset of first byte of jump below - * - cmdIndex is index of the command after the current one - * - exceptIndex is the index of the first ExceptionRange after - * the current one. - */ - - jumpFixupPtr->jumpType = jumpType; - jumpFixupPtr->codeOffset = (envPtr->codeNext - envPtr->codeStart); - jumpFixupPtr->cmdIndex = envPtr->numCommands; - jumpFixupPtr->exceptIndex = envPtr->exceptArrayNext; - - switch (jumpType) { - case TCL_UNCONDITIONAL_JUMP: - TclEmitInstInt1(INST_JUMP1, 0, envPtr); - break; - case TCL_TRUE_JUMP: - TclEmitInstInt1(INST_JUMP_TRUE1, 0, envPtr); - break; - default: - TclEmitInstInt1(INST_JUMP_FALSE1, 0, envPtr); - break; - } -} - -/* - *---------------------------------------------------------------------- - * - * TclFixupForwardJump -- - * - * Procedure that updates a previously-emitted forward jump to jump - * a specified number of bytes, "jumpDist". If necessary, the jump is - * grown from two to five bytes; this is done if the jump distance is - * greater than "distThreshold" (normally 127 bytes). The jump is - * described by a JumpFixup record previously initialized by - * TclEmitForwardJump. - * - * Results: - * 1 if the jump was grown and subsequent instructions had to be moved; - * otherwise 0. This result is returned to allow callers to update - * any additional code offsets they may hold. - * - * Side effects: - * The jump may be grown and subsequent instructions moved. If this - * happens, the code offsets for any commands and any ExceptionRange - * records between the jump and the current code address will be - * updated to reflect the moved code. Also, the bytecode instruction - * array in the CompileEnv structure may be grown and reallocated. - * - *---------------------------------------------------------------------- - */ - -int -TclFixupForwardJump(envPtr, jumpFixupPtr, jumpDist, distThreshold) - CompileEnv *envPtr; /* Points to the CompileEnv structure that - * holds the resulting instruction. */ - JumpFixup *jumpFixupPtr; /* Points to the JumpFixup structure that - * describes the forward jump. */ - int jumpDist; /* Jump distance to set in jump - * instruction. */ - int distThreshold; /* Maximum distance before the two byte - * jump is grown to five bytes. */ -{ - unsigned char *jumpPc, *p; - int firstCmd, lastCmd, firstRange, lastRange, k; - unsigned int numBytes; - - if (jumpDist <= distThreshold) { - jumpPc = (envPtr->codeStart + jumpFixupPtr->codeOffset); - switch (jumpFixupPtr->jumpType) { - case TCL_UNCONDITIONAL_JUMP: - TclUpdateInstInt1AtPc(INST_JUMP1, jumpDist, jumpPc); - break; - case TCL_TRUE_JUMP: - TclUpdateInstInt1AtPc(INST_JUMP_TRUE1, jumpDist, jumpPc); - break; - default: - TclUpdateInstInt1AtPc(INST_JUMP_FALSE1, jumpDist, jumpPc); - break; - } - return 0; - } - - /* - * We must grow the jump then move subsequent instructions down. - * Note that if we expand the space for generated instructions, - * code addresses might change; be careful about updating any of - * these addresses held in variables. - */ - - if ((envPtr->codeNext + 3) > envPtr->codeEnd) { - TclExpandCodeArray(envPtr); - } - jumpPc = (envPtr->codeStart + jumpFixupPtr->codeOffset); - for (numBytes = envPtr->codeNext-jumpPc-2, p = jumpPc+2+numBytes-1; - numBytes > 0; numBytes--, p--) { - p[3] = p[0]; - } - envPtr->codeNext += 3; - jumpDist += 3; - switch (jumpFixupPtr->jumpType) { - case TCL_UNCONDITIONAL_JUMP: - TclUpdateInstInt4AtPc(INST_JUMP4, jumpDist, jumpPc); - break; - case TCL_TRUE_JUMP: - TclUpdateInstInt4AtPc(INST_JUMP_TRUE4, jumpDist, jumpPc); - break; - default: - TclUpdateInstInt4AtPc(INST_JUMP_FALSE4, jumpDist, jumpPc); - break; - } - - /* - * Adjust the code offsets for any commands and any ExceptionRange - * records between the jump and the current code address. - */ - - firstCmd = jumpFixupPtr->cmdIndex; - lastCmd = (envPtr->numCommands - 1); - if (firstCmd < lastCmd) { - for (k = firstCmd; k <= lastCmd; k++) { - (envPtr->cmdMapPtr[k]).codeOffset += 3; - } - } - - firstRange = jumpFixupPtr->exceptIndex; - lastRange = (envPtr->exceptArrayNext - 1); - for (k = firstRange; k <= lastRange; k++) { - ExceptionRange *rangePtr = &(envPtr->exceptArrayPtr[k]); - rangePtr->codeOffset += 3; - - switch (rangePtr->type) { - case LOOP_EXCEPTION_RANGE: - rangePtr->breakOffset += 3; - if (rangePtr->continueOffset != -1) { - rangePtr->continueOffset += 3; - } - break; - case CATCH_EXCEPTION_RANGE: - rangePtr->catchOffset += 3; - break; - default: - panic("TclFixupForwardJump: bad ExceptionRange type %d\n", - rangePtr->type); - } - } - return 1; /* the jump was grown */ -} - -/* - *---------------------------------------------------------------------- - * - * TclGetInstructionTable -- - * - * Returns a pointer to the table describing Tcl bytecode instructions. - * This procedure is defined so that clients can access the pointer from - * outside the TCL DLLs. - * - * Results: - * Returns a pointer to the global instruction table, same as the - * expression (&instructionTable[0]). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -InstructionDesc * -TclGetInstructionTable() -{ - return &instructionTable[0]; -} - -/* - *-------------------------------------------------------------- - * - * TclRegisterAuxDataType -- - * - * This procedure is called to register a new AuxData type - * in the table of all AuxData types supported by Tcl. - * - * Results: - * None. - * - * Side effects: - * The type is registered in the AuxData type table. If there was already - * a type with the same name as in typePtr, it is replaced with the - * new type. - * - *-------------------------------------------------------------- - */ - -void -TclRegisterAuxDataType(typePtr) - AuxDataType *typePtr; /* Information about object type; - * storage must be statically - * allocated (must live forever). */ -{ - register Tcl_HashEntry *hPtr; - int new; - - Tcl_MutexLock(&tableMutex); - if (!auxDataTypeTableInitialized) { - TclInitAuxDataTypeTable(); - } - - /* - * If there's already a type with the given name, remove it. - */ - - hPtr = Tcl_FindHashEntry(&auxDataTypeTable, typePtr->name); - if (hPtr != (Tcl_HashEntry *) NULL) { - Tcl_DeleteHashEntry(hPtr); - } - - /* - * Now insert the new object type. - */ - - hPtr = Tcl_CreateHashEntry(&auxDataTypeTable, typePtr->name, &new); - if (new) { - Tcl_SetHashValue(hPtr, typePtr); - } - Tcl_MutexUnlock(&tableMutex); -} - -/* - *---------------------------------------------------------------------- - * - * TclGetAuxDataType -- - * - * This procedure looks up an Auxdata type by name. - * - * Results: - * If an AuxData type with name matching "typeName" is found, a pointer - * to its AuxDataType structure is returned; otherwise, NULL is returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -AuxDataType * -TclGetAuxDataType(typeName) - char *typeName; /* Name of AuxData type to look up. */ -{ - register Tcl_HashEntry *hPtr; - AuxDataType *typePtr = NULL; - - Tcl_MutexLock(&tableMutex); - if (!auxDataTypeTableInitialized) { - TclInitAuxDataTypeTable(); - } - - hPtr = Tcl_FindHashEntry(&auxDataTypeTable, typeName); - if (hPtr != (Tcl_HashEntry *) NULL) { - typePtr = (AuxDataType *) Tcl_GetHashValue(hPtr); - } - Tcl_MutexUnlock(&tableMutex); - - return typePtr; -} - -/* - *-------------------------------------------------------------- - * - * TclInitAuxDataTypeTable -- - * - * This procedure is invoked to perform once-only initialization of - * the AuxData type table. It also registers the AuxData types defined in - * this file. - * - * Results: - * None. - * - * Side effects: - * Initializes the table of defined AuxData types "auxDataTypeTable" with - * builtin AuxData types defined in this file. - * - *-------------------------------------------------------------- - */ - -void -TclInitAuxDataTypeTable() -{ - /* - * The table mutex must already be held before this routine is invoked. - */ - - auxDataTypeTableInitialized = 1; - Tcl_InitHashTable(&auxDataTypeTable, TCL_STRING_KEYS); - - /* - * There is only one AuxData type at this time, so register it here. - */ - - TclRegisterAuxDataType(&tclForeachInfoType); -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeAuxDataTypeTable -- - * - * This procedure is called by Tcl_Finalize after all exit handlers - * have been run to free up storage associated with the table of AuxData - * types. This procedure is called by TclFinalizeExecution() which - * is called by Tcl_Finalize(). - * - * Results: - * None. - * - * Side effects: - * Deletes all entries in the hash table of AuxData types. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeAuxDataTypeTable() -{ - Tcl_MutexLock(&tableMutex); - if (auxDataTypeTableInitialized) { - Tcl_DeleteHashTable(&auxDataTypeTable); - auxDataTypeTableInitialized = 0; - } - Tcl_MutexUnlock(&tableMutex); -} - -/* - *---------------------------------------------------------------------- - * - * GetCmdLocEncodingSize -- - * - * Computes the total number of bytes needed to encode the command - * location information for some compiled code. - * - * Results: - * The byte count needed to encode the compiled location information. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -GetCmdLocEncodingSize(envPtr) - CompileEnv *envPtr; /* Points to compilation environment - * structure containing the CmdLocation - * structure to encode. */ -{ - register CmdLocation *mapPtr = envPtr->cmdMapPtr; - int numCmds = envPtr->numCommands; - int codeDelta, codeLen, srcDelta, srcLen; - int codeDeltaNext, codeLengthNext, srcDeltaNext, srcLengthNext; - /* The offsets in their respective byte - * sequences where the next encoded offset - * or length should go. */ - int prevCodeOffset, prevSrcOffset, i; - - codeDeltaNext = codeLengthNext = srcDeltaNext = srcLengthNext = 0; - prevCodeOffset = prevSrcOffset = 0; - for (i = 0; i < numCmds; i++) { - codeDelta = (mapPtr[i].codeOffset - prevCodeOffset); - if (codeDelta < 0) { - panic("GetCmdLocEncodingSize: bad code offset"); - } else if (codeDelta <= 127) { - codeDeltaNext++; - } else { - codeDeltaNext += 5; /* 1 byte for 0xFF, 4 for positive delta */ - } - prevCodeOffset = mapPtr[i].codeOffset; - - codeLen = mapPtr[i].numCodeBytes; - if (codeLen < 0) { - panic("GetCmdLocEncodingSize: bad code length"); - } else if (codeLen <= 127) { - codeLengthNext++; - } else { - codeLengthNext += 5; /* 1 byte for 0xFF, 4 for length */ - } - - srcDelta = (mapPtr[i].srcOffset - prevSrcOffset); - if ((-127 <= srcDelta) && (srcDelta <= 127)) { - srcDeltaNext++; - } else { - srcDeltaNext += 5; /* 1 byte for 0xFF, 4 for delta */ - } - prevSrcOffset = mapPtr[i].srcOffset; - - srcLen = mapPtr[i].numSrcBytes; - if (srcLen < 0) { - panic("GetCmdLocEncodingSize: bad source length"); - } else if (srcLen <= 127) { - srcLengthNext++; - } else { - srcLengthNext += 5; /* 1 byte for 0xFF, 4 for length */ - } - } - - return (codeDeltaNext + codeLengthNext + srcDeltaNext + srcLengthNext); -} - -/* - *---------------------------------------------------------------------- - * - * EncodeCmdLocMap -- - * - * Encode the command location information for some compiled code into - * a ByteCode structure. The encoded command location map is stored as - * three adjacent byte sequences. - * - * Results: - * Pointer to the first byte after the encoded command location - * information. - * - * Side effects: - * The encoded information is stored into the block of memory headed - * by codePtr. Also records pointers to the start of the four byte - * sequences in fields in codePtr's ByteCode header structure. - * - *---------------------------------------------------------------------- - */ - -static unsigned char * -EncodeCmdLocMap(envPtr, codePtr, startPtr) - CompileEnv *envPtr; /* Points to compilation environment - * structure containing the CmdLocation - * structure to encode. */ - ByteCode *codePtr; /* ByteCode in which to encode envPtr's - * command location information. */ - unsigned char *startPtr; /* Points to the first byte in codePtr's - * memory block where the location - * information is to be stored. */ -{ - register CmdLocation *mapPtr = envPtr->cmdMapPtr; - int numCmds = envPtr->numCommands; - register unsigned char *p = startPtr; - int codeDelta, codeLen, srcDelta, srcLen, prevOffset; - register int i; - - /* - * Encode the code offset for each command as a sequence of deltas. - */ - - codePtr->codeDeltaStart = p; - prevOffset = 0; - for (i = 0; i < numCmds; i++) { - codeDelta = (mapPtr[i].codeOffset - prevOffset); - if (codeDelta < 0) { - panic("EncodeCmdLocMap: bad code offset"); - } else if (codeDelta <= 127) { - TclStoreInt1AtPtr(codeDelta, p); - p++; - } else { - TclStoreInt1AtPtr(0xFF, p); - p++; - TclStoreInt4AtPtr(codeDelta, p); - p += 4; - } - prevOffset = mapPtr[i].codeOffset; - } - - /* - * Encode the code length for each command. - */ - - codePtr->codeLengthStart = p; - for (i = 0; i < numCmds; i++) { - codeLen = mapPtr[i].numCodeBytes; - if (codeLen < 0) { - panic("EncodeCmdLocMap: bad code length"); - } else if (codeLen <= 127) { - TclStoreInt1AtPtr(codeLen, p); - p++; - } else { - TclStoreInt1AtPtr(0xFF, p); - p++; - TclStoreInt4AtPtr(codeLen, p); - p += 4; - } - } - - /* - * Encode the source offset for each command as a sequence of deltas. - */ - - codePtr->srcDeltaStart = p; - prevOffset = 0; - for (i = 0; i < numCmds; i++) { - srcDelta = (mapPtr[i].srcOffset - prevOffset); - if ((-127 <= srcDelta) && (srcDelta <= 127)) { - TclStoreInt1AtPtr(srcDelta, p); - p++; - } else { - TclStoreInt1AtPtr(0xFF, p); - p++; - TclStoreInt4AtPtr(srcDelta, p); - p += 4; - } - prevOffset = mapPtr[i].srcOffset; - } - - /* - * Encode the source length for each command. - */ - - codePtr->srcLengthStart = p; - for (i = 0; i < numCmds; i++) { - srcLen = mapPtr[i].numSrcBytes; - if (srcLen < 0) { - panic("EncodeCmdLocMap: bad source length"); - } else if (srcLen <= 127) { - TclStoreInt1AtPtr(srcLen, p); - p++; - } else { - TclStoreInt1AtPtr(0xFF, p); - p++; - TclStoreInt4AtPtr(srcLen, p); - p += 4; - } - } - - return p; -} - -#ifdef TCL_COMPILE_DEBUG -/* - *---------------------------------------------------------------------- - * - * TclPrintByteCodeObj -- - * - * This procedure prints ("disassembles") the instructions of a - * bytecode object to stdout. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -TclPrintByteCodeObj(interp, objPtr) - Tcl_Interp *interp; /* Used only for Tcl_GetStringFromObj. */ - Tcl_Obj *objPtr; /* The bytecode object to disassemble. */ -{ - ByteCode* codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; - unsigned char *codeStart, *codeLimit, *pc; - unsigned char *codeDeltaNext, *codeLengthNext; - unsigned char *srcDeltaNext, *srcLengthNext; - int codeOffset, codeLen, srcOffset, srcLen, numCmds, delta, i; - Interp *iPtr = (Interp *) *codePtr->interpHandle; - - if (codePtr->refCount <= 0) { - return; /* already freed */ - } - - codeStart = codePtr->codeStart; - codeLimit = (codeStart + codePtr->numCodeBytes); - numCmds = codePtr->numCommands; - - /* - * Print header lines describing the ByteCode. - */ - - fprintf(stdout, "\nByteCode 0x%x, refCt %u, epoch %u, interp 0x%x (epoch %u)\n", - (unsigned int) codePtr, codePtr->refCount, - codePtr->compileEpoch, (unsigned int) iPtr, - iPtr->compileEpoch); - fprintf(stdout, " Source "); - TclPrintSource(stdout, codePtr->source, - TclMin(codePtr->numSrcBytes, 55)); - fprintf(stdout, "\n Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", - numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes, - codePtr->numLitObjects, codePtr->numAuxDataItems, - codePtr->maxStackDepth, -#ifdef TCL_COMPILE_STATS - (codePtr->numSrcBytes? - ((float)codePtr->structureSize)/((float)codePtr->numSrcBytes) : 0.0)); -#else - 0.0); -#endif -#ifdef TCL_COMPILE_STATS - fprintf(stdout, - " Code %d = header %d+inst %d+litObj %d+exc %d+aux %d+cmdMap %d\n", - codePtr->structureSize, - (sizeof(ByteCode) - (sizeof(size_t) + sizeof(Tcl_Time))), - codePtr->numCodeBytes, - (codePtr->numLitObjects * sizeof(Tcl_Obj *)), - (codePtr->numExceptRanges * sizeof(ExceptionRange)), - (codePtr->numAuxDataItems * sizeof(AuxData)), - codePtr->numCmdLocBytes); -#endif /* TCL_COMPILE_STATS */ - - /* - * If the ByteCode is the compiled body of a Tcl procedure, print - * information about that procedure. Note that we don't know the - * procedure's name since ByteCode's can be shared among procedures. - */ - - if (codePtr->procPtr != NULL) { - Proc *procPtr = codePtr->procPtr; - int numCompiledLocals = procPtr->numCompiledLocals; - fprintf(stdout, - " Proc 0x%x, refCt %d, args %d, compiled locals %d\n", - (unsigned int) procPtr, procPtr->refCount, procPtr->numArgs, - numCompiledLocals); - if (numCompiledLocals > 0) { - CompiledLocal *localPtr = procPtr->firstLocalPtr; - for (i = 0; i < numCompiledLocals; i++) { - fprintf(stdout, " slot %d%s%s%s%s%s%s", i, - ((localPtr->flags & VAR_SCALAR)? ", scalar" : ""), - ((localPtr->flags & VAR_ARRAY)? ", array" : ""), - ((localPtr->flags & VAR_LINK)? ", link" : ""), - ((localPtr->flags & VAR_ARGUMENT)? ", arg" : ""), - ((localPtr->flags & VAR_TEMPORARY)? ", temp" : ""), - ((localPtr->flags & VAR_RESOLVED)? ", resolved" : "")); - if (TclIsVarTemporary(localPtr)) { - fprintf(stdout, "\n"); - } else { - fprintf(stdout, ", \"%s\"\n", localPtr->name); - } - localPtr = localPtr->nextPtr; - } - } - } - - /* - * Print the ExceptionRange array. - */ - - if (codePtr->numExceptRanges > 0) { - fprintf(stdout, " Exception ranges %d, depth %d:\n", - codePtr->numExceptRanges, codePtr->maxExceptDepth); - for (i = 0; i < codePtr->numExceptRanges; i++) { - ExceptionRange *rangePtr = &(codePtr->exceptArrayPtr[i]); - fprintf(stdout, " %d: level %d, %s, pc %d-%d, ", - i, rangePtr->nestingLevel, - ((rangePtr->type == LOOP_EXCEPTION_RANGE) - ? "loop" : "catch"), - rangePtr->codeOffset, - (rangePtr->codeOffset + rangePtr->numCodeBytes - 1)); - switch (rangePtr->type) { - case LOOP_EXCEPTION_RANGE: - fprintf(stdout, "continue %d, break %d\n", - rangePtr->continueOffset, rangePtr->breakOffset); - break; - case CATCH_EXCEPTION_RANGE: - fprintf(stdout, "catch %d\n", rangePtr->catchOffset); - break; - default: - panic("TclPrintByteCodeObj: bad ExceptionRange type %d\n", - rangePtr->type); - } - } - } - - /* - * If there were no commands (e.g., an expression or an empty string - * was compiled), just print all instructions and return. - */ - - if (numCmds == 0) { - pc = codeStart; - while (pc < codeLimit) { - fprintf(stdout, " "); - pc += TclPrintInstruction(codePtr, pc); - } - return; - } - - /* - * Print table showing the code offset, source offset, and source - * length for each command. These are encoded as a sequence of bytes. - */ - - fprintf(stdout, " Commands %d:", numCmds); - codeDeltaNext = codePtr->codeDeltaStart; - codeLengthNext = codePtr->codeLengthStart; - srcDeltaNext = codePtr->srcDeltaStart; - srcLengthNext = codePtr->srcLengthStart; - codeOffset = srcOffset = 0; - for (i = 0; i < numCmds; i++) { - if ((unsigned int) (*codeDeltaNext) == (unsigned int) 0xFF) { - codeDeltaNext++; - delta = TclGetInt4AtPtr(codeDeltaNext); - codeDeltaNext += 4; - } else { - delta = TclGetInt1AtPtr(codeDeltaNext); - codeDeltaNext++; - } - codeOffset += delta; - - if ((unsigned int) (*codeLengthNext) == (unsigned int) 0xFF) { - codeLengthNext++; - codeLen = TclGetInt4AtPtr(codeLengthNext); - codeLengthNext += 4; - } else { - codeLen = TclGetInt1AtPtr(codeLengthNext); - codeLengthNext++; - } - - if ((unsigned int) (*srcDeltaNext) == (unsigned int) 0xFF) { - srcDeltaNext++; - delta = TclGetInt4AtPtr(srcDeltaNext); - srcDeltaNext += 4; - } else { - delta = TclGetInt1AtPtr(srcDeltaNext); - srcDeltaNext++; - } - srcOffset += delta; - - if ((unsigned int) (*srcLengthNext) == (unsigned int) 0xFF) { - srcLengthNext++; - srcLen = TclGetInt4AtPtr(srcLengthNext); - srcLengthNext += 4; - } else { - srcLen = TclGetInt1AtPtr(srcLengthNext); - srcLengthNext++; - } - - fprintf(stdout, "%s%4d: pc %d-%d, src %d-%d", - ((i % 2)? " " : "\n "), - (i+1), codeOffset, (codeOffset + codeLen - 1), - srcOffset, (srcOffset + srcLen - 1)); - } - if (numCmds > 0) { - fprintf(stdout, "\n"); - } - - /* - * Print each instruction. If the instruction corresponds to the start - * of a command, print the command's source. Note that we don't need - * the code length here. - */ - - codeDeltaNext = codePtr->codeDeltaStart; - srcDeltaNext = codePtr->srcDeltaStart; - srcLengthNext = codePtr->srcLengthStart; - codeOffset = srcOffset = 0; - pc = codeStart; - for (i = 0; i < numCmds; i++) { - if ((unsigned int) (*codeDeltaNext) == (unsigned int) 0xFF) { - codeDeltaNext++; - delta = TclGetInt4AtPtr(codeDeltaNext); - codeDeltaNext += 4; - } else { - delta = TclGetInt1AtPtr(codeDeltaNext); - codeDeltaNext++; - } - codeOffset += delta; - - if ((unsigned int) (*srcDeltaNext) == (unsigned int) 0xFF) { - srcDeltaNext++; - delta = TclGetInt4AtPtr(srcDeltaNext); - srcDeltaNext += 4; - } else { - delta = TclGetInt1AtPtr(srcDeltaNext); - srcDeltaNext++; - } - srcOffset += delta; - - if ((unsigned int) (*srcLengthNext) == (unsigned int) 0xFF) { - srcLengthNext++; - srcLen = TclGetInt4AtPtr(srcLengthNext); - srcLengthNext += 4; - } else { - srcLen = TclGetInt1AtPtr(srcLengthNext); - srcLengthNext++; - } - - /* - * Print instructions before command i. - */ - - while ((pc-codeStart) < codeOffset) { - fprintf(stdout, " "); - pc += TclPrintInstruction(codePtr, pc); - } - - fprintf(stdout, " Command %d: ", (i+1)); - TclPrintSource(stdout, (codePtr->source + srcOffset), - TclMin(srcLen, 55)); - fprintf(stdout, "\n"); - } - if (pc < codeLimit) { - /* - * Print instructions after the last command. - */ - - while (pc < codeLimit) { - fprintf(stdout, " "); - pc += TclPrintInstruction(codePtr, pc); - } - } -} -#endif /* TCL_COMPILE_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * TclPrintInstruction -- - * - * This procedure prints ("disassembles") one instruction from a - * bytecode object to stdout. - * - * Results: - * Returns the length in bytes of the current instruiction. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclPrintInstruction(codePtr, pc) - ByteCode* codePtr; /* Bytecode containing the instruction. */ - unsigned char *pc; /* Points to first byte of instruction. */ -{ - Proc *procPtr = codePtr->procPtr; - unsigned char opCode = *pc; - register InstructionDesc *instDesc = &instructionTable[opCode]; - unsigned char *codeStart = codePtr->codeStart; - unsigned int pcOffset = (pc - codeStart); - int opnd, i, j; - - fprintf(stdout, "(%u) %s ", pcOffset, instDesc->name); - for (i = 0; i < instDesc->numOperands; i++) { - switch (instDesc->opTypes[i]) { - case OPERAND_INT1: - opnd = TclGetInt1AtPtr(pc+1+i); - if ((i == 0) && ((opCode == INST_JUMP1) - || (opCode == INST_JUMP_TRUE1) - || (opCode == INST_JUMP_FALSE1))) { - fprintf(stdout, "%d # pc %u", opnd, (pcOffset + opnd)); - } else { - fprintf(stdout, "%d", opnd); - } - break; - case OPERAND_INT4: - opnd = TclGetInt4AtPtr(pc+1+i); - if ((i == 0) && ((opCode == INST_JUMP4) - || (opCode == INST_JUMP_TRUE4) - || (opCode == INST_JUMP_FALSE4))) { - fprintf(stdout, "%d # pc %u", opnd, (pcOffset + opnd)); - } else { - fprintf(stdout, "%d", opnd); - } - break; - case OPERAND_UINT1: - opnd = TclGetUInt1AtPtr(pc+1+i); - if ((i == 0) && (opCode == INST_PUSH1)) { - fprintf(stdout, "%u # ", (unsigned int) opnd); - TclPrintObject(stdout, codePtr->objArrayPtr[opnd], 40); - } else if ((i == 0) && ((opCode == INST_LOAD_SCALAR1) - || (opCode == INST_LOAD_ARRAY1) - || (opCode == INST_STORE_SCALAR1) - || (opCode == INST_STORE_ARRAY1))) { - int localCt = procPtr->numCompiledLocals; - CompiledLocal *localPtr = procPtr->firstLocalPtr; - if (opnd >= localCt) { - panic("TclPrintInstruction: bad local var index %u (%u locals)\n", - (unsigned int) opnd, localCt); - return instDesc->numBytes; - } - for (j = 0; j < opnd; j++) { - localPtr = localPtr->nextPtr; - } - if (TclIsVarTemporary(localPtr)) { - fprintf(stdout, "%u # temp var %u", - (unsigned int) opnd, (unsigned int) opnd); - } else { - fprintf(stdout, "%u # var ", (unsigned int) opnd); - TclPrintSource(stdout, localPtr->name, 40); - } - } else { - fprintf(stdout, "%u ", (unsigned int) opnd); - } - break; - case OPERAND_UINT4: - opnd = TclGetUInt4AtPtr(pc+1+i); - if (opCode == INST_PUSH4) { - fprintf(stdout, "%u # ", opnd); - TclPrintObject(stdout, codePtr->objArrayPtr[opnd], 40); - } else if ((i == 0) && ((opCode == INST_LOAD_SCALAR4) - || (opCode == INST_LOAD_ARRAY4) - || (opCode == INST_STORE_SCALAR4) - || (opCode == INST_STORE_ARRAY4))) { - int localCt = procPtr->numCompiledLocals; - CompiledLocal *localPtr = procPtr->firstLocalPtr; - if (opnd >= localCt) { - panic("TclPrintInstruction: bad local var index %u (%u locals)\n", - (unsigned int) opnd, localCt); - return instDesc->numBytes; - } - for (j = 0; j < opnd; j++) { - localPtr = localPtr->nextPtr; - } - if (TclIsVarTemporary(localPtr)) { - fprintf(stdout, "%u # temp var %u", - (unsigned int) opnd, (unsigned int) opnd); - } else { - fprintf(stdout, "%u # var ", (unsigned int) opnd); - TclPrintSource(stdout, localPtr->name, 40); - } - } else { - fprintf(stdout, "%u ", (unsigned int) opnd); - } - break; - case OPERAND_NONE: - default: - break; - } - } - fprintf(stdout, "\n"); - return instDesc->numBytes; -} - -/* - *---------------------------------------------------------------------- - * - * TclPrintObject -- - * - * This procedure prints up to a specified number of characters from - * the argument Tcl object's string representation to a specified file. - * - * Results: - * None. - * - * Side effects: - * Outputs characters to the specified file. - * - *---------------------------------------------------------------------- - */ - -void -TclPrintObject(outFile, objPtr, maxChars) - FILE *outFile; /* The file to print the source to. */ - Tcl_Obj *objPtr; /* Points to the Tcl object whose string - * representation should be printed. */ - int maxChars; /* Maximum number of chars to print. */ -{ - char *bytes; - int length; - - bytes = Tcl_GetStringFromObj(objPtr, &length); - TclPrintSource(outFile, bytes, TclMin(length, maxChars)); -} - -/* - *---------------------------------------------------------------------- - * - * TclPrintSource -- - * - * This procedure prints up to a specified number of characters from - * the argument string to a specified file. It tries to produce legible - * output by adding backslashes as necessary. - * - * Results: - * None. - * - * Side effects: - * Outputs characters to the specified file. - * - *---------------------------------------------------------------------- - */ - -void -TclPrintSource(outFile, string, maxChars) - FILE *outFile; /* The file to print the source to. */ - char *string; /* The string to print. */ - int maxChars; /* Maximum number of chars to print. */ -{ - register char *p; - register int i = 0; - - if (string == NULL) { - fprintf(outFile, "\"\""); - return; - } - - fprintf(outFile, "\""); - p = string; - for (; (*p != '\0') && (i < maxChars); p++, i++) { - switch (*p) { - case '"': - fprintf(outFile, "\\\""); - continue; - case '\f': - fprintf(outFile, "\\f"); - continue; - case '\n': - fprintf(outFile, "\\n"); - continue; - case '\r': - fprintf(outFile, "\\r"); - continue; - case '\t': - fprintf(outFile, "\\t"); - continue; - case '\v': - fprintf(outFile, "\\v"); - continue; - default: - fprintf(outFile, "%c", *p); - continue; - } - } - fprintf(outFile, "\""); -} - -#ifdef TCL_COMPILE_STATS -/* - *---------------------------------------------------------------------- - * - * RecordByteCodeStats -- - * - * Accumulates various compilation-related statistics for each newly - * compiled ByteCode. Called by the TclInitByteCodeObj when Tcl is - * compiled with the -DTCL_COMPILE_STATS flag - * - * Results: - * None. - * - * Side effects: - * Accumulates aggregate code-related statistics in the interpreter's - * ByteCodeStats structure. Records statistics specific to a ByteCode - * in its ByteCode structure. - * - *---------------------------------------------------------------------- - */ - -void -RecordByteCodeStats(codePtr) - ByteCode *codePtr; /* Points to ByteCode structure with info - * to add to accumulated statistics. */ -{ - Interp *iPtr = (Interp *) *codePtr->interpHandle; - register ByteCodeStats *statsPtr = &(iPtr->stats); - - statsPtr->numCompilations++; - statsPtr->totalSrcBytes += (double) codePtr->numSrcBytes; - statsPtr->totalByteCodeBytes += (double) codePtr->structureSize; - statsPtr->currentSrcBytes += (double) codePtr->numSrcBytes; - statsPtr->currentByteCodeBytes += (double) codePtr->structureSize; - - statsPtr->srcCount[TclLog2(codePtr->numSrcBytes)]++; - statsPtr->byteCodeCount[TclLog2(codePtr->structureSize)]++; - - statsPtr->currentInstBytes += (double) codePtr->numCodeBytes; - statsPtr->currentLitBytes += - (double) (codePtr->numLitObjects * sizeof(Tcl_Obj *)); - statsPtr->currentExceptBytes += - (double) (codePtr->numExceptRanges * sizeof(ExceptionRange)); - statsPtr->currentAuxBytes += - (double) (codePtr->numAuxDataItems * sizeof(AuxData)); - statsPtr->currentCmdMapBytes += (double) codePtr->numCmdLocBytes; -} -#endif /* TCL_COMPILE_STATS */ diff --git a/generic/tclCompile.h b/generic/tclCompile.h deleted file mode 100644 index 4a718fd..0000000 --- a/generic/tclCompile.h +++ /dev/null @@ -1,981 +0,0 @@ -/* - * tclCompile.h -- - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclCompile.h,v 1.10 1999/04/16 00:46:45 stanton Exp $ - */ - -#ifndef _TCLCOMPILATION -#define _TCLCOMPILATION 1 - -#ifndef _TCLINT -#include "tclInt.h" -#endif /* _TCLINT */ - -#ifdef BUILD_tcl -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT -#endif - -/* - *------------------------------------------------------------------------ - * Variables related to compilation. These are used in tclCompile.c, - * tclExecute.c, tclBasic.c, and their clients. - *------------------------------------------------------------------------ - */ - -/* - * Variable that denotes the command name Tcl object type. Objects of this - * type cache the Command pointer that results from looking up command names - * in the command hashtable. - */ - -extern Tcl_ObjType tclCmdNameType; - -/* - * Variable that controls whether compilation tracing is enabled and, if so, - * what level of tracing is desired: - * 0: no compilation tracing - * 1: summarize compilation of top level cmds and proc bodies - * 2: display all instructions of each ByteCode compiled - * This variable is linked to the Tcl variable "tcl_traceCompile". - */ - -extern int tclTraceCompile; - -/* - * Variable that controls whether execution tracing is enabled and, if so, - * what level of tracing is desired: - * 0: no execution tracing - * 1: trace invocations of Tcl procs only - * 2: trace invocations of all (not compiled away) commands - * 3: display each instruction executed - * This variable is linked to the Tcl variable "tcl_traceExec". - */ - -extern int tclTraceExec; - -/* - *------------------------------------------------------------------------ - * Data structures related to compilation. - *------------------------------------------------------------------------ - */ - -/* - * The structure used to implement Tcl "exceptions" (exceptional returns): - * for example, those generated in loops by the break and continue commands, - * and those generated by scripts and caught by the catch command. This - * ExceptionRange structure describes a range of code (e.g., a loop body), - * the kind of exceptions (e.g., a break or continue) that might occur, and - * the PC offsets to jump to if a matching exception does occur. Exception - * ranges can nest so this structure includes a nesting level that is used - * at runtime to find the closest exception range surrounding a PC. For - * example, when a break command is executed, the ExceptionRange structure - * for the most deeply nested loop, if any, is found and used. These - * structures are also generated for the "next" subcommands of for loops - * since a break there terminates the for command. This means a for command - * actually generates two LoopInfo structures. - */ - -typedef enum { - LOOP_EXCEPTION_RANGE, /* Exception's range is part of a loop. - * Break and continue "exceptions" cause - * jumps to appropriate PC offsets. */ - CATCH_EXCEPTION_RANGE /* Exception's range is controlled by a - * catch command. Errors in the range cause - * a jump to a catch PC offset. */ -} ExceptionRangeType; - -typedef struct ExceptionRange { - ExceptionRangeType type; /* The kind of ExceptionRange. */ - int nestingLevel; /* Static depth of the exception range. - * Used to find the most deeply-nested - * range surrounding a PC at runtime. */ - int codeOffset; /* Offset of the first instruction byte of - * the code range. */ - int numCodeBytes; /* Number of bytes in the code range. */ - int breakOffset; /* If LOOP_EXCEPTION_RANGE, the target PC - * offset for a break command in the range. */ - int continueOffset; /* If LOOP_EXCEPTION_RANGE and not -1, the - * target PC offset for a continue command in - * the code range. Otherwise, ignore this range - * when processing a continue command. */ - int catchOffset; /* If a CATCH_EXCEPTION_RANGE, the target PC - * offset for any "exception" in range. */ -} ExceptionRange; - -/* - * Structure used to map between instruction pc and source locations. It - * defines for each compiled Tcl command its code's starting offset and - * its source's starting offset and length. Note that the code offset - * increases monotonically: that is, the table is sorted in code offset - * order. The source offset is not monotonic. - */ - -typedef struct CmdLocation { - int codeOffset; /* Offset of first byte of command code. */ - int numCodeBytes; /* Number of bytes for command's code. */ - int srcOffset; /* Offset of first char of the command. */ - int numSrcBytes; /* Number of command source chars. */ -} CmdLocation; - -/* - * CompileProcs need the ability to record information during compilation - * that can be used by bytecode instructions during execution. The AuxData - * structure provides this "auxiliary data" mechanism. An arbitrary number - * of these structures can be stored in the ByteCode record (during - * compilation they are stored in a CompileEnv structure). Each AuxData - * record holds one word of client-specified data (often a pointer) and is - * given an index that instructions can later use to look up the structure - * and its data. - * - * The following definitions declare the types of procedures that are called - * to duplicate or free this auxiliary data when the containing ByteCode - * objects are duplicated and freed. Pointers to these procedures are kept - * in the AuxData structure. - */ - -typedef ClientData (AuxDataDupProc) _ANSI_ARGS_((ClientData clientData)); -typedef void (AuxDataFreeProc) _ANSI_ARGS_((ClientData clientData)); - -/* - * We define a separate AuxDataType struct to hold type-related information - * for the AuxData structure. This separation makes it possible for clients - * outside of the TCL core to manipulate (in a limited fashion!) AuxData; - * for example, it makes it possible to pickle and unpickle AuxData structs. - */ - -typedef struct AuxDataType { - char *name; /* the name of the type. Types can be - * registered and found by name */ - AuxDataDupProc *dupProc; /* Callback procedure to invoke when the - * aux data is duplicated (e.g., when the - * ByteCode structure containing the aux - * data is duplicated). NULL means just - * copy the source clientData bits; no - * proc need be called. */ - AuxDataFreeProc *freeProc; /* Callback procedure to invoke when the - * aux data is freed. NULL means no - * proc need be called. */ -} AuxDataType; - -/* - * The definition of the AuxData structure that holds information created - * during compilation by CompileProcs and used by instructions during - * execution. - */ - -typedef struct AuxData { - AuxDataType *type; /* pointer to the AuxData type associated with - * this ClientData. */ - ClientData clientData; /* The compilation data itself. */ -} AuxData; - -/* - * Structure defining the compilation environment. After compilation, fields - * describing bytecode instructions are copied out into the more compact - * ByteCode structure defined below. - */ - -#define COMPILEENV_INIT_CODE_BYTES 250 -#define COMPILEENV_INIT_NUM_OBJECTS 60 -#define COMPILEENV_INIT_EXCEPT_RANGES 5 -#define COMPILEENV_INIT_CMD_MAP_SIZE 40 -#define COMPILEENV_INIT_AUX_DATA_SIZE 5 - -typedef struct CompileEnv { - Interp *iPtr; /* Interpreter containing the code being - * compiled. Commands and their compile - * procs are specific to an interpreter so - * the code emitted will depend on the - * interpreter. */ - char *source; /* The source string being compiled by - * SetByteCodeFromAny. This pointer is not - * owned by the CompileEnv and must not be - * freed or changed by it. */ - int numSrcBytes; /* Number of bytes in source. */ - Proc *procPtr; /* If a procedure is being compiled, a - * pointer to its Proc structure; otherwise - * NULL. Used to compile local variables. - * Set from information provided by - * ObjInterpProc in tclProc.c. */ - int numCommands; /* Number of commands compiled. */ - int exceptDepth; /* Current exception range nesting level; - * -1 if not in any range currently. */ - int maxExceptDepth; /* Max nesting level of exception ranges; - * -1 if no ranges have been compiled. */ - int maxStackDepth; /* Maximum number of stack elements needed - * to execute the code. Set by compilation - * procedures before returning. */ - LiteralTable localLitTable; /* Contains LiteralEntry's describing - * all Tcl objects referenced by this - * compiled code. Indexed by the string - * representations of the literals. Used to - * avoid creating duplicate objects. */ - int exprIsJustVarRef; /* Set 1 if the expression last compiled by - * TclCompileExpr consisted of just a - * variable reference as in the expression - * of "if $b then...". Otherwise 0. Used - * to implement expr's 2 level substitution - * semantics properly. */ - int exprIsComparison; /* Set 1 if the top-level operator in the - * expression last compiled is a comparison. - * Otherwise 0. If 1, since the operands - * might be strings, the expr is compiled - * out-of-line to implement expr's 2 level - * substitution semantics properly. */ - unsigned char *codeStart; /* Points to the first byte of the code. */ - unsigned char *codeNext; /* Points to next code array byte to use. */ - unsigned char *codeEnd; /* Points just after the last allocated - * code array byte. */ - int mallocedCodeArray; /* Set 1 if code array was expanded - * and codeStart points into the heap.*/ - LiteralEntry *literalArrayPtr; - /* Points to start of LiteralEntry array. */ - int literalArrayNext; /* Index of next free object array entry. */ - int literalArrayEnd; /* Index just after last obj array entry. */ - int mallocedLiteralArray; /* 1 if object array was expanded and - * objArray points into the heap, else 0. */ - ExceptionRange *exceptArrayPtr; - /* Points to start of the ExceptionRange - * array. */ - int exceptArrayNext; /* Next free ExceptionRange array index. - * exceptArrayNext is the number of ranges - * and (exceptArrayNext-1) is the index of - * the current range's array entry. */ - int exceptArrayEnd; /* Index after the last ExceptionRange - * array entry. */ - int mallocedExceptArray; /* 1 if ExceptionRange array was expanded - * and exceptArrayPtr points in heap, - * else 0. */ - CmdLocation *cmdMapPtr; /* Points to start of CmdLocation array. - * numCommands is the index of the next - * entry to use; (numCommands-1) is the - * entry index for the last command. */ - int cmdMapEnd; /* Index after last CmdLocation entry. */ - int mallocedCmdMap; /* 1 if command map array was expanded and - * cmdMapPtr points in the heap, else 0. */ - AuxData *auxDataArrayPtr; /* Points to auxiliary data array start. */ - int auxDataArrayNext; /* Next free compile aux data array index. - * auxDataArrayNext is the number of aux - * data items and (auxDataArrayNext-1) is - * index of current aux data array entry. */ - int auxDataArrayEnd; /* Index after last aux data array entry. */ - int mallocedAuxDataArray; /* 1 if aux data array was expanded and - * auxDataArrayPtr points in heap else 0. */ - unsigned char staticCodeSpace[COMPILEENV_INIT_CODE_BYTES]; - /* Initial storage for code. */ - LiteralEntry staticLiteralSpace[COMPILEENV_INIT_NUM_OBJECTS]; - /* Initial storage of LiteralEntry array. */ - ExceptionRange staticExceptArraySpace[COMPILEENV_INIT_EXCEPT_RANGES]; - /* Initial ExceptionRange array storage. */ - CmdLocation staticCmdMapSpace[COMPILEENV_INIT_CMD_MAP_SIZE]; - /* Initial storage for cmd location map. */ - AuxData staticAuxDataArraySpace[COMPILEENV_INIT_AUX_DATA_SIZE]; - /* Initial storage for aux data array. */ -} CompileEnv; - -/* - * The structure defining the bytecode instructions resulting from compiling - * a Tcl script. Note that this structure is variable length: a single heap - * object is allocated to hold the ByteCode structure immediately followed - * by the code bytes, the literal object array, the ExceptionRange array, - * the CmdLocation map, and the compilation AuxData array. - */ - -/* - * A PRECOMPILED bytecode struct is one that was generated from a compiled - * image rather than implicitly compiled from source - */ -#define TCL_BYTECODE_PRECOMPILED 0x0001 - -typedef struct ByteCode { - TclHandle interpHandle; /* Handle for interpreter containing the - * compiled code. Commands and their compile - * procs are specific to an interpreter so the - * code emitted will depend on the - * interpreter. */ - int compileEpoch; /* Value of iPtr->compileEpoch when this - * ByteCode was compiled. Used to invalidate - * code when, e.g., commands with compile - * procs are redefined. */ - Namespace *nsPtr; /* Namespace context in which this code - * was compiled. If the code is executed - * if a different namespace, it must be - * recompiled. */ - int nsEpoch; /* Value of nsPtr->resolverEpoch when this - * ByteCode was compiled. Used to invalidate - * code when new namespace resolution rules - * are put into effect. */ - int refCount; /* Reference count: set 1 when created - * plus 1 for each execution of the code - * currently active. This structure can be - * freed when refCount becomes zero. */ - unsigned int flags; /* flags describing state for the codebyte. - * this variable holds ORed values from the - * TCL_BYTECODE_ masks defined above */ - char *source; /* The source string from which this - * ByteCode was compiled. Note that this - * pointer is not owned by the ByteCode and - * must not be freed or modified by it. */ - Proc *procPtr; /* If the ByteCode was compiled from a - * procedure body, this is a pointer to its - * Proc structure; otherwise NULL. This - * pointer is also not owned by the ByteCode - * and must not be freed by it. */ - size_t structureSize; /* Number of bytes in the ByteCode structure - * itself. Does not include heap space for - * literal Tcl objects or storage referenced - * by AuxData entries. */ - int numCommands; /* Number of commands compiled. */ - int numSrcBytes; /* Number of source bytes compiled. */ - int numCodeBytes; /* Number of code bytes. */ - int numLitObjects; /* Number of objects in literal array. */ - int numExceptRanges; /* Number of ExceptionRange array elems. */ - int numAuxDataItems; /* Number of AuxData items. */ - int numCmdLocBytes; /* Number of bytes needed for encoded - * command location information. */ - int maxExceptDepth; /* Maximum nesting level of ExceptionRanges; - * -1 if no ranges were compiled. */ - int maxStackDepth; /* Maximum number of stack elements needed - * to execute the code. */ - unsigned char *codeStart; /* Points to the first byte of the code. - * This is just after the final ByteCode - * member cmdMapPtr. */ - Tcl_Obj **objArrayPtr; /* Points to the start of the literal - * object array. This is just after the - * last code byte. */ - ExceptionRange *exceptArrayPtr; - /* Points to the start of the ExceptionRange - * array. This is just after the last - * object in the object array. */ - AuxData *auxDataArrayPtr; /* Points to the start of the auxiliary data - * array. This is just after the last entry - * in the ExceptionRange array. */ - unsigned char *codeDeltaStart; - /* Points to the first of a sequence of - * bytes that encode the change in the - * starting offset of each command's code. - * If -127<=delta<=127, it is encoded as 1 - * byte, otherwise 0xFF (128) appears and - * the delta is encoded by the next 4 bytes. - * Code deltas are always positive. This - * sequence is just after the last entry in - * the AuxData array. */ - unsigned char *codeLengthStart; - /* Points to the first of a sequence of - * bytes that encode the length of each - * command's code. The encoding is the same - * as for code deltas. Code lengths are - * always positive. This sequence is just - * after the last entry in the code delta - * sequence. */ - unsigned char *srcDeltaStart; - /* Points to the first of a sequence of - * bytes that encode the change in the - * starting offset of each command's source. - * The encoding is the same as for code - * deltas. Source deltas can be negative. - * This sequence is just after the last byte - * in the code length sequence. */ - unsigned char *srcLengthStart; - /* Points to the first of a sequence of - * bytes that encode the length of each - * command's source. The encoding is the - * same as for code deltas. Source lengths - * are always positive. This sequence is - * just after the last byte in the source - * delta sequence. */ -#ifdef TCL_COMPILE_STATS - Tcl_Time createTime; /* Absolute time when the ByteCode was - * created. */ -#endif /* TCL_COMPILE_STATS */ -} ByteCode; - -/* - * Opcodes for the Tcl bytecode instructions. These must correspond to the - * entries in the table of instruction descriptions, instructionTable, in - * tclCompile.c. Also, the order and number of the expression opcodes - * (e.g., INST_LOR) must match the entries in the array operatorStrings in - * tclExecute.c. - */ - -/* Opcodes 0 to 9 */ -#define INST_DONE 0 -#define INST_PUSH1 1 -#define INST_PUSH4 2 -#define INST_POP 3 -#define INST_DUP 4 -#define INST_CONCAT1 5 -#define INST_INVOKE_STK1 6 -#define INST_INVOKE_STK4 7 -#define INST_EVAL_STK 8 -#define INST_EXPR_STK 9 - -/* Opcodes 10 to 23 */ -#define INST_LOAD_SCALAR1 10 -#define INST_LOAD_SCALAR4 11 -#define INST_LOAD_SCALAR_STK 12 -#define INST_LOAD_ARRAY1 13 -#define INST_LOAD_ARRAY4 14 -#define INST_LOAD_ARRAY_STK 15 -#define INST_LOAD_STK 16 -#define INST_STORE_SCALAR1 17 -#define INST_STORE_SCALAR4 18 -#define INST_STORE_SCALAR_STK 19 -#define INST_STORE_ARRAY1 20 -#define INST_STORE_ARRAY4 21 -#define INST_STORE_ARRAY_STK 22 -#define INST_STORE_STK 23 - -/* Opcodes 24 to 33 */ -#define INST_INCR_SCALAR1 24 -#define INST_INCR_SCALAR_STK 25 -#define INST_INCR_ARRAY1 26 -#define INST_INCR_ARRAY_STK 27 -#define INST_INCR_STK 28 -#define INST_INCR_SCALAR1_IMM 29 -#define INST_INCR_SCALAR_STK_IMM 30 -#define INST_INCR_ARRAY1_IMM 31 -#define INST_INCR_ARRAY_STK_IMM 32 -#define INST_INCR_STK_IMM 33 - -/* Opcodes 34 to 39 */ -#define INST_JUMP1 34 -#define INST_JUMP4 35 -#define INST_JUMP_TRUE1 36 -#define INST_JUMP_TRUE4 37 -#define INST_JUMP_FALSE1 38 -#define INST_JUMP_FALSE4 39 - -/* Opcodes 40 to 64 */ -#define INST_LOR 40 -#define INST_LAND 41 -#define INST_BITOR 42 -#define INST_BITXOR 43 -#define INST_BITAND 44 -#define INST_EQ 45 -#define INST_NEQ 46 -#define INST_LT 47 -#define INST_GT 48 -#define INST_LE 49 -#define INST_GE 50 -#define INST_LSHIFT 51 -#define INST_RSHIFT 52 -#define INST_ADD 53 -#define INST_SUB 54 -#define INST_MULT 55 -#define INST_DIV 56 -#define INST_MOD 57 -#define INST_UPLUS 58 -#define INST_UMINUS 59 -#define INST_BITNOT 60 -#define INST_LNOT 61 -#define INST_CALL_BUILTIN_FUNC1 62 -#define INST_CALL_FUNC1 63 -#define INST_TRY_CVT_TO_NUMERIC 64 - -/* Opcodes 65 to 66 */ -#define INST_BREAK 65 -#define INST_CONTINUE 66 - -/* Opcodes 67 to 68 */ -#define INST_FOREACH_START4 67 -#define INST_FOREACH_STEP4 68 - -/* Opcodes 69 to 72 */ -#define INST_BEGIN_CATCH4 69 -#define INST_END_CATCH 70 -#define INST_PUSH_RESULT 71 -#define INST_PUSH_RETURN_CODE 72 - -/* The last opcode */ -#define LAST_INST_OPCODE 72 - -/* - * Table describing the Tcl bytecode instructions: their name (for - * displaying code), total number of code bytes required (including - * operand bytes), and a description of the type of each operand. - * These operand types include signed and unsigned integers of length - * one and four bytes. The unsigned integers are used for indexes or - * for, e.g., the count of objects to push in a "push" instruction. - */ - -#define MAX_INSTRUCTION_OPERANDS 2 - -typedef enum InstOperandType { - OPERAND_NONE, - OPERAND_INT1, /* One byte signed integer. */ - OPERAND_INT4, /* Four byte signed integer. */ - OPERAND_UINT1, /* One byte unsigned integer. */ - OPERAND_UINT4 /* Four byte unsigned integer. */ -} InstOperandType; - -typedef struct InstructionDesc { - char *name; /* Name of instruction. */ - int numBytes; /* Total number of bytes for instruction. */ - int numOperands; /* Number of operands. */ - InstOperandType opTypes[MAX_INSTRUCTION_OPERANDS]; - /* The type of each operand. */ -} InstructionDesc; - -extern InstructionDesc instructionTable[]; - -/* - * Definitions of the values of the INST_CALL_BUILTIN_FUNC instruction's - * operand byte. Each value denotes a builtin Tcl math function. These - * values must correspond to the entries in the builtinFuncTable array - * below and to the values stored in the tclInt.h MathFunc structure's - * builtinFuncIndex field. - */ - -#define BUILTIN_FUNC_ACOS 0 -#define BUILTIN_FUNC_ASIN 1 -#define BUILTIN_FUNC_ATAN 2 -#define BUILTIN_FUNC_ATAN2 3 -#define BUILTIN_FUNC_CEIL 4 -#define BUILTIN_FUNC_COS 5 -#define BUILTIN_FUNC_COSH 6 -#define BUILTIN_FUNC_EXP 7 -#define BUILTIN_FUNC_FLOOR 8 -#define BUILTIN_FUNC_FMOD 9 -#define BUILTIN_FUNC_HYPOT 10 -#define BUILTIN_FUNC_LOG 11 -#define BUILTIN_FUNC_LOG10 12 -#define BUILTIN_FUNC_POW 13 -#define BUILTIN_FUNC_SIN 14 -#define BUILTIN_FUNC_SINH 15 -#define BUILTIN_FUNC_SQRT 16 -#define BUILTIN_FUNC_TAN 17 -#define BUILTIN_FUNC_TANH 18 -#define BUILTIN_FUNC_ABS 19 -#define BUILTIN_FUNC_DOUBLE 20 -#define BUILTIN_FUNC_INT 21 -#define BUILTIN_FUNC_RAND 22 -#define BUILTIN_FUNC_ROUND 23 -#define BUILTIN_FUNC_SRAND 24 - -#define LAST_BUILTIN_FUNC 24 - -/* - * Table describing the built-in math functions. Entries in this table are - * indexed by the values of the INST_CALL_BUILTIN_FUNC instruction's - * operand byte. - */ - -typedef int (CallBuiltinFuncProc) _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); - -typedef struct { - char *name; /* Name of function. */ - int numArgs; /* Number of arguments for function. */ - Tcl_ValueType argTypes[MAX_MATH_ARGS]; - /* Acceptable types for each argument. */ - CallBuiltinFuncProc *proc; /* Procedure implementing this function. */ - ClientData clientData; /* Additional argument to pass to the - * function when invoking it. */ -} BuiltinFunc; - -extern BuiltinFunc builtinFuncTable[]; - -/* - * Compilation of some Tcl constructs such as if commands and the logical or - * (||) and logical and (&&) operators in expressions requires the - * generation of forward jumps. Since the PC target of these jumps isn't - * known when the jumps are emitted, we record the offset of each jump in an - * array of JumpFixup structures. There is one array for each sequence of - * jumps to one target PC. When we learn the target PC, we update the jumps - * with the correct distance. Also, if the distance is too great (> 127 - * bytes), we replace the single-byte jump with a four byte jump - * instruction, move the instructions after the jump down, and update the - * code offsets for any commands between the jump and the target. - */ - -typedef enum { - TCL_UNCONDITIONAL_JUMP, - TCL_TRUE_JUMP, - TCL_FALSE_JUMP -} TclJumpType; - -typedef struct JumpFixup { - TclJumpType jumpType; /* Indicates the kind of jump. */ - int codeOffset; /* Offset of the first byte of the one-byte - * forward jump's code. */ - int cmdIndex; /* Index of the first command after the one - * for which the jump was emitted. Used to - * update the code offsets for subsequent - * commands if the two-byte jump at jumpPc - * must be replaced with a five-byte one. */ - int exceptIndex; /* Index of the first range entry in the - * ExceptionRange array after the current - * one. This field is used to adjust the - * code offsets in subsequent ExceptionRange - * records when a jump is grown from 2 bytes - * to 5 bytes. */ -} JumpFixup; - -#define JUMPFIXUP_INIT_ENTRIES 10 - -typedef struct JumpFixupArray { - JumpFixup *fixup; /* Points to start of jump fixup array. */ - int next; /* Index of next free array entry. */ - int end; /* Index of last usable entry in array. */ - int mallocedArray; /* 1 if array was expanded and fixups points - * into the heap, else 0. */ - JumpFixup staticFixupSpace[JUMPFIXUP_INIT_ENTRIES]; - /* Initial storage for jump fixup array. */ -} JumpFixupArray; - -/* - * The structure describing one variable list of a foreach command. Note - * that only foreach commands inside procedure bodies are compiled inline so - * a ForeachVarList structure always describes local variables. Furthermore, - * only scalar variables are supported for inline-compiled foreach loops. - */ - -typedef struct ForeachVarList { - int numVars; /* The number of variables in the list. */ - int varIndexes[1]; /* An array of the indexes ("slot numbers") - * for each variable in the procedure's - * array of local variables. Only scalar - * variables are supported. The actual - * size of this field will be large enough - * to numVars indexes. THIS MUST BE THE - * LAST FIELD IN THE STRUCTURE! */ -} ForeachVarList; - -/* - * Structure used to hold information about a foreach command that is needed - * during program execution. These structures are stored in CompileEnv and - * ByteCode structures as auxiliary data. - */ - -typedef struct ForeachInfo { - int numLists; /* The number of both the variable and value - * lists of the foreach command. */ - int firstValueTemp; /* Index of the first temp var in a proc - * frame used to point to a value list. */ - int loopCtTemp; /* Index of temp var in a proc frame - * holding the loop's iteration count. Used - * to determine next value list element to - * assign each loop var. */ - ForeachVarList *varLists[1];/* An array of pointers to ForeachVarList - * structures describing each var list. The - * actual size of this field will be large - * enough to numVars indexes. THIS MUST BE - * THE LAST FIELD IN THE STRUCTURE! */ -} ForeachInfo; - -extern AuxDataType tclForeachInfoType; - -/* - * Structure containing a cached pointer to a command that is the result - * of resolving the command's name in some namespace. It is the internal - * representation for a cmdName object. It contains the pointer along - * with some information that is used to check the pointer's validity. - */ - -typedef struct ResolvedCmdName { - Command *cmdPtr; /* A cached Command pointer. */ - Namespace *refNsPtr; /* Points to the namespace containing the - * reference (not the namespace that - * contains the referenced command). */ - long refNsId; /* refNsPtr's unique namespace id. Used to - * verify that refNsPtr is still valid - * (e.g., it's possible that the cmd's - * containing namespace was deleted and a - * new one created at the same address). */ - int refNsCmdEpoch; /* Value of the referencing namespace's - * cmdRefEpoch when the pointer was cached. - * Before using the cached pointer, we check - * if the namespace's epoch was incremented; - * if so, this cached pointer is invalid. */ - int cmdEpoch; /* Value of the command's cmdEpoch when this - * pointer was cached. Before using the - * cached pointer, we check if the cmd's - * epoch was incremented; if so, the cmd was - * renamed, deleted, hidden, or exposed, and - * so the pointer is invalid. */ - int refCount; /* Reference count: 1 for each cmdName - * object that has a pointer to this - * ResolvedCmdName structure as its internal - * rep. This structure can be freed when - * refCount becomes zero. */ -} ResolvedCmdName; - -/* - *---------------------------------------------------------------- - * Procedures shared among Tcl bytecode compilation and execution - * modules but not used outside: - *---------------------------------------------------------------- - */ - -EXTERN void TclCleanupByteCode _ANSI_ARGS_((ByteCode *codePtr)); -EXTERN int TclCompileCmdWord _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Token *tokenPtr, int count, - CompileEnv *envPtr)); -EXTERN int TclCompileExpr _ANSI_ARGS_((Tcl_Interp *interp, - char *script, int numBytes, - CompileEnv *envPtr)); -EXTERN int TclCompileExprWords _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Token *tokenPtr, int numWords, - CompileEnv *envPtr)); -EXTERN int TclCompileScript _ANSI_ARGS_((Tcl_Interp *interp, - char *script, int numBytes, int nested, - CompileEnv *envPtr)); -EXTERN int TclCompileTokens _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Token *tokenPtr, int count, - CompileEnv *envPtr)); -EXTERN int TclCreateAuxData _ANSI_ARGS_((ClientData clientData, - AuxDataType *typePtr, CompileEnv *envPtr)); -EXTERN int TclCreateExceptRange _ANSI_ARGS_(( - ExceptionRangeType type, CompileEnv *envPtr)); -EXTERN ExecEnv * TclCreateExecEnv _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN void TclDeleteExecEnv _ANSI_ARGS_((ExecEnv *eePtr)); -EXTERN void TclDeleteLiteralTable _ANSI_ARGS_(( - Tcl_Interp *interp, LiteralTable *tablePtr)); -EXTERN void TclEmitForwardJump _ANSI_ARGS_((CompileEnv *envPtr, - TclJumpType jumpType, JumpFixup *jumpFixupPtr)); -EXTERN AuxDataType *TclGetAuxDataType _ANSI_ARGS_((char *typeName)); -EXTERN ExceptionRange * TclGetExceptionRangeForPc _ANSI_ARGS_(( - unsigned char *pc, int catchOnly, - ByteCode* codePtr)); -EXTERN InstructionDesc * TclGetInstructionTable _ANSI_ARGS_(()); -EXTERN int TclExecuteByteCode _ANSI_ARGS_((Tcl_Interp *interp, - ByteCode *codePtr)); -EXTERN void TclExpandCodeArray _ANSI_ARGS_(( - CompileEnv *envPtr)); -EXTERN void TclExpandJumpFixupArray _ANSI_ARGS_(( - JumpFixupArray *fixupArrayPtr)); -EXTERN void TclFinalizeAuxDataTypeTable _ANSI_ARGS_((void)); -EXTERN int TclFindCompiledLocal _ANSI_ARGS_((char *name, - int nameChars, int create, int flags, - Proc *procPtr)); -EXTERN LiteralEntry * TclLookupLiteralEntry _ANSI_ARGS_(( - Tcl_Interp *interp, Tcl_Obj *objPtr)); -EXTERN int TclFixupForwardJump _ANSI_ARGS_(( - CompileEnv *envPtr, JumpFixup *jumpFixupPtr, - int jumpDist, int distThreshold)); -EXTERN void TclFreeCompileEnv _ANSI_ARGS_((CompileEnv *envPtr)); -EXTERN void TclFreeJumpFixupArray _ANSI_ARGS_(( - JumpFixupArray *fixupArrayPtr)); -EXTERN void TclInitAuxDataTypeTable _ANSI_ARGS_((void)); -EXTERN void TclInitByteCodeObj _ANSI_ARGS_((Tcl_Obj *objPtr, - CompileEnv *envPtr)); -EXTERN void TclInitCompilation _ANSI_ARGS_((void)); -EXTERN void TclInitCompileEnv _ANSI_ARGS_((Tcl_Interp *interp, - CompileEnv *envPtr, char *string, - int numBytes)); -EXTERN void TclInitJumpFixupArray _ANSI_ARGS_(( - JumpFixupArray *fixupArrayPtr)); -EXTERN void TclInitLiteralTable _ANSI_ARGS_(( - LiteralTable *tablePtr)); -#ifdef TCL_COMPILE_STATS -EXTERN char * TclLiteralStats _ANSI_ARGS_(( - LiteralTable *tablePtr)); -EXTERN int TclLog2 _ANSI_ARGS_((int value)); -#endif -#ifdef TCL_COMPILE_DEBUG -EXTERN void TclPrintByteCodeObj _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -#endif -EXTERN int TclPrintInstruction _ANSI_ARGS_((ByteCode* codePtr, - unsigned char *pc)); -EXTERN void TclPrintObject _ANSI_ARGS_((FILE *outFile, - Tcl_Obj *objPtr, int maxChars)); -EXTERN void TclPrintSource _ANSI_ARGS_((FILE *outFile, - char *string, int maxChars)); -EXTERN void TclRegisterAuxDataType _ANSI_ARGS_((AuxDataType *typePtr)); -EXTERN int TclRegisterLiteral _ANSI_ARGS_((CompileEnv *envPtr, - char *bytes, int length, int onHeap)); -EXTERN void TclReleaseLiteral _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -EXTERN void TclSetCmdNameObj _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr, Command *cmdPtr)); -#ifdef TCL_COMPILE_DEBUG -EXTERN void TclVerifyGlobalLiteralTable _ANSI_ARGS_(( - Interp *iPtr)); -EXTERN void TclVerifyLocalLiteralTable _ANSI_ARGS_(( - CompileEnv *envPtr)); -#endif - -/* - *---------------------------------------------------------------- - * Macros used by Tcl bytecode compilation and execution modules - * inside the Tcl core but not used outside. - *---------------------------------------------------------------- - */ - -/* - * Macro to emit an opcode byte into a CompileEnv's code array. - * The ANSI C "prototype" for this macro is: - * - * EXTERN void TclEmitOpcode _ANSI_ARGS_((unsigned char op, - * CompileEnv *envPtr)); - */ - -#define TclEmitOpcode(op, envPtr) \ - if ((envPtr)->codeNext == (envPtr)->codeEnd) \ - TclExpandCodeArray(envPtr); \ - *(envPtr)->codeNext++ = (unsigned char) (op) - -/* - * Macro to emit an integer operand. - * The ANSI C "prototype" for this macro is: - * - * EXTERN void TclEmitInt1 _ANSI_ARGS_((int i, CompileEnv *envPtr)); - */ - -#define TclEmitInt1(i, envPtr) \ - if ((envPtr)->codeNext == (envPtr)->codeEnd) \ - TclExpandCodeArray(envPtr); \ - *(envPtr)->codeNext++ = (unsigned char) ((unsigned int) (i)) - -/* - * Macros to emit an instruction with signed or unsigned integer operands. - * Four byte integers are stored in "big-endian" order with the high order - * byte stored at the lowest address. - * The ANSI C "prototypes" for these macros are: - * - * EXTERN void TclEmitInstInt1 _ANSI_ARGS_((unsigned char op, int i, - * CompileEnv *envPtr)); - * EXTERN void TclEmitInstInt4 _ANSI_ARGS_((unsigned char op, int i, - * CompileEnv *envPtr)); - */ - -#define TclEmitInstInt1(op, i, envPtr) \ - if (((envPtr)->codeNext + 2) > (envPtr)->codeEnd) { \ - TclExpandCodeArray(envPtr); \ - } \ - *(envPtr)->codeNext++ = (unsigned char) (op); \ - *(envPtr)->codeNext++ = (unsigned char) ((unsigned int) (i)) - -#define TclEmitInstInt4(op, i, envPtr) \ - if (((envPtr)->codeNext + 5) > (envPtr)->codeEnd) { \ - TclExpandCodeArray(envPtr); \ - } \ - *(envPtr)->codeNext++ = (unsigned char) (op); \ - *(envPtr)->codeNext++ = \ - (unsigned char) ((unsigned int) (i) >> 24); \ - *(envPtr)->codeNext++ = \ - (unsigned char) ((unsigned int) (i) >> 16); \ - *(envPtr)->codeNext++ = \ - (unsigned char) ((unsigned int) (i) >> 8); \ - *(envPtr)->codeNext++ = \ - (unsigned char) ((unsigned int) (i) ) - -/* - * Macro to push a Tcl object onto the Tcl evaluation stack. It emits the - * object's one or four byte array index into the CompileEnv's code - * array. These support, respectively, a maximum of 256 (2**8) and 2**32 - * objects in a CompileEnv. The ANSI C "prototype" for this macro is: - * - * EXTERN void TclEmitPush _ANSI_ARGS_((int objIndex, CompileEnv *envPtr)); - */ - -#define TclEmitPush(objIndex, envPtr) \ - if ((objIndex) <= 255) { \ - TclEmitInstInt1(INST_PUSH1, (objIndex), (envPtr)); \ - } else { \ - TclEmitInstInt4(INST_PUSH4, (objIndex), (envPtr)); \ - } - -/* - * Macros to update a (signed or unsigned) integer starting at a pointer. - * The two variants depend on the number of bytes. The ANSI C "prototypes" - * for these macros are: - * - * EXTERN void TclStoreInt1AtPtr _ANSI_ARGS_((int i, unsigned char *p)); - * EXTERN void TclStoreInt4AtPtr _ANSI_ARGS_((int i, unsigned char *p)); - */ - -#define TclStoreInt1AtPtr(i, p) \ - *(p) = (unsigned char) ((unsigned int) (i)) - -#define TclStoreInt4AtPtr(i, p) \ - *(p) = (unsigned char) ((unsigned int) (i) >> 24); \ - *(p+1) = (unsigned char) ((unsigned int) (i) >> 16); \ - *(p+2) = (unsigned char) ((unsigned int) (i) >> 8); \ - *(p+3) = (unsigned char) ((unsigned int) (i) ) - -/* - * Macros to update instructions at a particular pc with a new op code - * and a (signed or unsigned) int operand. The ANSI C "prototypes" for - * these macros are: - * - * EXTERN void TclUpdateInstInt1AtPc _ANSI_ARGS_((unsigned char op, int i, - * unsigned char *pc)); - * EXTERN void TclUpdateInstInt4AtPc _ANSI_ARGS_((unsigned char op, int i, - * unsigned char *pc)); - */ - -#define TclUpdateInstInt1AtPc(op, i, pc) \ - *(pc) = (unsigned char) (op); \ - TclStoreInt1AtPtr((i), ((pc)+1)) - -#define TclUpdateInstInt4AtPc(op, i, pc) \ - *(pc) = (unsigned char) (op); \ - TclStoreInt4AtPtr((i), ((pc)+1)) - -/* - * Macros to get a signed integer (GET_INT{1,2}) or an unsigned int - * (GET_UINT{1,2}) from a pointer. There are two variants for each - * return type that depend on the number of bytes fetched. - * The ANSI C "prototypes" for these macros are: - * - * EXTERN int TclGetInt1AtPtr _ANSI_ARGS_((unsigned char *p)); - * EXTERN int TclGetInt4AtPtr _ANSI_ARGS_((unsigned char *p)); - * EXTERN unsigned int TclGetUInt1AtPtr _ANSI_ARGS_((unsigned char *p)); - * EXTERN unsigned int TclGetUInt4AtPtr _ANSI_ARGS_((unsigned char *p)); - */ - -/* - * The TclGetInt1AtPtr macro is tricky because we want to do sign - * extension on the 1-byte value. Unfortunately the "char" type isn't - * signed on all platforms so sign-extension doesn't always happen - * automatically. Sometimes we can explicitly declare the pointer to be - * signed, but other times we have to explicitly sign-extend the value - * in software. - */ - -#ifndef __CHAR_UNSIGNED__ -# define TclGetInt1AtPtr(p) ((int) *((char *) p)) -#else -# ifdef HAVE_SIGNED_CHAR -# define TclGetInt1AtPtr(p) ((int) *((signed char *) p)) -# else -# define TclGetInt1AtPtr(p) (((int) *((char *) p)) \ - | ((*(p) & 0200) ? (-256) : 0)) -# endif -#endif - -#define TclGetInt4AtPtr(p) (((int) TclGetInt1AtPtr(p) << 24) | \ - (*((p)+1) << 16) | \ - (*((p)+2) << 8) | \ - (*((p)+3))) - -#define TclGetUInt1AtPtr(p) ((unsigned int) *(p)) -#define TclGetUInt4AtPtr(p) ((unsigned int) (*(p) << 24) | \ - (*((p)+1) << 16) | \ - (*((p)+2) << 8) | \ - (*((p)+3))) - -/* - * Macros used to compute the minimum and maximum of two integers. - * The ANSI C "prototypes" for these macros are: - * - * EXTERN int TclMin _ANSI_ARGS_((int i, int j)); - * EXTERN int TclMax _ANSI_ARGS_((int i, int j)); - */ - -#define TclMin(i, j) ((((int) i) < ((int) j))? (i) : (j)) -#define TclMax(i, j) ((((int) i) > ((int) j))? (i) : (j)) - -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLIMPORT - -#endif /* _TCLCOMPILATION */ diff --git a/generic/tclDate.c b/generic/tclDate.c deleted file mode 100644 index cdbcfe8..0000000 --- a/generic/tclDate.c +++ /dev/null @@ -1,1638 +0,0 @@ -/* - * tclDate.c -- - * - * This file is generated from a yacc grammar defined in - * the file tclGetDate.y. It should not be edited directly. - * - * Copyright (c) 1992-1995 Karl Lehenbauer and Mark Diekhans. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclDate.c,v 1.4 1999/04/16 00:46:45 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -#ifdef MAC_TCL -# define EPOCH 1904 -# define START_OF_TIME 1904 -# define END_OF_TIME 2039 -#else -# define EPOCH 1970 -# define START_OF_TIME 1902 -# define END_OF_TIME 2037 -#endif - -/* - * The offset of tm_year of struct tm returned by localtime, gmtime, etc. - * I don't know how universal this is; K&R II, the NetBSD manpages, and - * ../compat/strftime.c all agree that tm_year is the year-1900. However, - * some systems may have a different value. This #define should be the - * same as in ../compat/strftime.c. - */ -#define TM_YEAR_BASE 1900 - -#define HOUR(x) ((int) (60 * x)) -#define SECSPERDAY (24L * 60L * 60L) - - -/* - * An entry in the lexical lookup table. - */ -typedef struct _TABLE { - char *name; - int type; - time_t value; -} TABLE; - - -/* - * Daylight-savings mode: on, off, or not yet known. - */ -typedef enum _DSTMODE { - DSTon, DSToff, DSTmaybe -} DSTMODE; - -/* - * Meridian: am, pm, or 24-hour style. - */ -typedef enum _MERIDIAN { - MERam, MERpm, MER24 -} MERIDIAN; - - -/* - * Global variables. We could get rid of most of these by using a good - * union as the yacc stack. (This routine was originally written before - * yacc had the %union construct.) Maybe someday; right now we only use - * the %union very rarely. - */ -static char *TclDateInput; -static DSTMODE TclDateDSTmode; -static time_t TclDateDayOrdinal; -static time_t TclDateDayNumber; -static int TclDateHaveDate; -static int TclDateHaveDay; -static int TclDateHaveRel; -static int TclDateHaveTime; -static int TclDateHaveZone; -static time_t TclDateTimezone; -static time_t TclDateDay; -static time_t TclDateHour; -static time_t TclDateMinutes; -static time_t TclDateMonth; -static time_t TclDateSeconds; -static time_t TclDateYear; -static MERIDIAN TclDateMeridian; -static time_t TclDateRelMonth; -static time_t TclDateRelSeconds; - - -/* - * Prototypes of internal functions. - */ -static void TclDateerror _ANSI_ARGS_((char *s)); -static time_t ToSeconds _ANSI_ARGS_((time_t Hours, time_t Minutes, - time_t Seconds, MERIDIAN Meridian)); -static int Convert _ANSI_ARGS_((time_t Month, time_t Day, time_t Year, - time_t Hours, time_t Minutes, time_t Seconds, - MERIDIAN Meridia, DSTMODE DSTmode, time_t *TimePtr)); -static time_t DSTcorrect _ANSI_ARGS_((time_t Start, time_t Future)); -static time_t RelativeDate _ANSI_ARGS_((time_t Start, time_t DayOrdinal, - time_t DayNumber)); -static int RelativeMonth _ANSI_ARGS_((time_t Start, time_t RelMonth, - time_t *TimePtr)); -static int LookupWord _ANSI_ARGS_((char *buff)); -static int TclDatelex _ANSI_ARGS_((void)); - -int -TclDateparse _ANSI_ARGS_((void)); -typedef union -#ifdef __cplusplus - YYSTYPE -#endif - { - time_t Number; - enum _MERIDIAN Meridian; -} YYSTYPE; -# define tAGO 257 -# define tDAY 258 -# define tDAYZONE 259 -# define tID 260 -# define tMERIDIAN 261 -# define tMINUTE_UNIT 262 -# define tMONTH 263 -# define tMONTH_UNIT 264 -# define tSEC_UNIT 265 -# define tSNUMBER 266 -# define tUNUMBER 267 -# define tZONE 268 -# define tEPOCH 269 -# define tDST 270 - - - -#ifdef __cplusplus - -#ifndef TclDateerror - void TclDateerror(const char *); -#endif - -#ifndef TclDatelex -#ifdef __EXTERN_C__ - extern "C" { int TclDatelex(void); } -#else - int TclDatelex(void); -#endif -#endif - int TclDateparse(void); - -#endif -#define TclDateclearin TclDatechar = -1 -#define TclDateerrok TclDateerrflag = 0 -extern int TclDatechar; -extern int TclDateerrflag; -YYSTYPE TclDatelval; -YYSTYPE TclDateval; -typedef int TclDatetabelem; -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 150 -#endif -#if YYMAXDEPTH > 0 -int TclDate_TclDates[YYMAXDEPTH], *TclDates = TclDate_TclDates; -YYSTYPE TclDate_TclDatev[YYMAXDEPTH], *TclDatev = TclDate_TclDatev; -#else /* user does initial allocation */ -int *TclDates; -YYSTYPE *TclDatev; -#endif -static int TclDatemaxdepth = YYMAXDEPTH; -# define YYERRCODE 256 - - -/* - * Month and day table. - */ -static TABLE MonthDayTable[] = { - { "january", tMONTH, 1 }, - { "february", tMONTH, 2 }, - { "march", tMONTH, 3 }, - { "april", tMONTH, 4 }, - { "may", tMONTH, 5 }, - { "june", tMONTH, 6 }, - { "july", tMONTH, 7 }, - { "august", tMONTH, 8 }, - { "september", tMONTH, 9 }, - { "sept", tMONTH, 9 }, - { "october", tMONTH, 10 }, - { "november", tMONTH, 11 }, - { "december", tMONTH, 12 }, - { "sunday", tDAY, 0 }, - { "monday", tDAY, 1 }, - { "tuesday", tDAY, 2 }, - { "tues", tDAY, 2 }, - { "wednesday", tDAY, 3 }, - { "wednes", tDAY, 3 }, - { "thursday", tDAY, 4 }, - { "thur", tDAY, 4 }, - { "thurs", tDAY, 4 }, - { "friday", tDAY, 5 }, - { "saturday", tDAY, 6 }, - { NULL } -}; - -/* - * Time units table. - */ -static TABLE UnitsTable[] = { - { "year", tMONTH_UNIT, 12 }, - { "month", tMONTH_UNIT, 1 }, - { "fortnight", tMINUTE_UNIT, 14 * 24 * 60 }, - { "week", tMINUTE_UNIT, 7 * 24 * 60 }, - { "day", tMINUTE_UNIT, 1 * 24 * 60 }, - { "hour", tMINUTE_UNIT, 60 }, - { "minute", tMINUTE_UNIT, 1 }, - { "min", tMINUTE_UNIT, 1 }, - { "second", tSEC_UNIT, 1 }, - { "sec", tSEC_UNIT, 1 }, - { NULL } -}; - -/* - * Assorted relative-time words. - */ -static TABLE OtherTable[] = { - { "tomorrow", tMINUTE_UNIT, 1 * 24 * 60 }, - { "yesterday", tMINUTE_UNIT, -1 * 24 * 60 }, - { "today", tMINUTE_UNIT, 0 }, - { "now", tMINUTE_UNIT, 0 }, - { "last", tUNUMBER, -1 }, - { "this", tMINUTE_UNIT, 0 }, - { "next", tUNUMBER, 2 }, -#if 0 - { "first", tUNUMBER, 1 }, -/* { "second", tUNUMBER, 2 }, */ - { "third", tUNUMBER, 3 }, - { "fourth", tUNUMBER, 4 }, - { "fifth", tUNUMBER, 5 }, - { "sixth", tUNUMBER, 6 }, - { "seventh", tUNUMBER, 7 }, - { "eighth", tUNUMBER, 8 }, - { "ninth", tUNUMBER, 9 }, - { "tenth", tUNUMBER, 10 }, - { "eleventh", tUNUMBER, 11 }, - { "twelfth", tUNUMBER, 12 }, -#endif - { "ago", tAGO, 1 }, - { "epoch", tEPOCH, 0 }, - { NULL } -}; - -/* - * The timezone table. (Note: This table was modified to not use any floating - * point constants to work around an SGI compiler bug). - */ -static TABLE TimezoneTable[] = { - { "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */ - { "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */ - { "utc", tZONE, HOUR( 0) }, - { "wet", tZONE, HOUR( 0) } , /* Western European */ - { "bst", tDAYZONE, HOUR( 0) }, /* British Summer */ - { "wat", tZONE, HOUR( 1) }, /* West Africa */ - { "at", tZONE, HOUR( 2) }, /* Azores */ -#if 0 - /* For completeness. BST is also British Summer, and GST is - * also Guam Standard. */ - { "bst", tZONE, HOUR( 3) }, /* Brazil Standard */ - { "gst", tZONE, HOUR( 3) }, /* Greenland Standard */ -#endif - { "nft", tZONE, HOUR( 7/2) }, /* Newfoundland */ - { "nst", tZONE, HOUR( 7/2) }, /* Newfoundland Standard */ - { "ndt", tDAYZONE, HOUR( 7/2) }, /* Newfoundland Daylight */ - { "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */ - { "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */ - { "est", tZONE, HOUR( 5) }, /* Eastern Standard */ - { "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */ - { "cst", tZONE, HOUR( 6) }, /* Central Standard */ - { "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */ - { "mst", tZONE, HOUR( 7) }, /* Mountain Standard */ - { "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */ - { "pst", tZONE, HOUR( 8) }, /* Pacific Standard */ - { "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */ - { "yst", tZONE, HOUR( 9) }, /* Yukon Standard */ - { "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */ - { "hst", tZONE, HOUR(10) }, /* Hawaii Standard */ - { "hdt", tDAYZONE, HOUR(10) }, /* Hawaii Daylight */ - { "cat", tZONE, HOUR(10) }, /* Central Alaska */ - { "ahst", tZONE, HOUR(10) }, /* Alaska-Hawaii Standard */ - { "nt", tZONE, HOUR(11) }, /* Nome */ - { "idlw", tZONE, HOUR(12) }, /* International Date Line West */ - { "cet", tZONE, -HOUR( 1) }, /* Central European */ - { "met", tZONE, -HOUR( 1) }, /* Middle European */ - { "mewt", tZONE, -HOUR( 1) }, /* Middle European Winter */ - { "mest", tDAYZONE, -HOUR( 1) }, /* Middle European Summer */ - { "swt", tZONE, -HOUR( 1) }, /* Swedish Winter */ - { "sst", tDAYZONE, -HOUR( 1) }, /* Swedish Summer */ - { "fwt", tZONE, -HOUR( 1) }, /* French Winter */ - { "fst", tDAYZONE, -HOUR( 1) }, /* French Summer */ - { "eet", tZONE, -HOUR( 2) }, /* Eastern Europe, USSR Zone 1 */ - { "bt", tZONE, -HOUR( 3) }, /* Baghdad, USSR Zone 2 */ - { "it", tZONE, -HOUR( 7/2) }, /* Iran */ - { "zp4", tZONE, -HOUR( 4) }, /* USSR Zone 3 */ - { "zp5", tZONE, -HOUR( 5) }, /* USSR Zone 4 */ - { "ist", tZONE, -HOUR(11/2) }, /* Indian Standard */ - { "zp6", tZONE, -HOUR( 6) }, /* USSR Zone 5 */ -#if 0 - /* For completeness. NST is also Newfoundland Stanard, nad SST is - * also Swedish Summer. */ - { "nst", tZONE, -HOUR(13/2) }, /* North Sumatra */ - { "sst", tZONE, -HOUR( 7) }, /* South Sumatra, USSR Zone 6 */ -#endif /* 0 */ - { "wast", tZONE, -HOUR( 7) }, /* West Australian Standard */ - { "wadt", tDAYZONE, -HOUR( 7) }, /* West Australian Daylight */ - { "jt", tZONE, -HOUR(15/2) }, /* Java (3pm in Cronusland!) */ - { "cct", tZONE, -HOUR( 8) }, /* China Coast, USSR Zone 7 */ - { "jst", tZONE, -HOUR( 9) }, /* Japan Standard, USSR Zone 8 */ - { "cast", tZONE, -HOUR(19/2) }, /* Central Australian Standard */ - { "cadt", tDAYZONE, -HOUR(19/2) }, /* Central Australian Daylight */ - { "east", tZONE, -HOUR(10) }, /* Eastern Australian Standard */ - { "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylight */ - { "gst", tZONE, -HOUR(10) }, /* Guam Standard, USSR Zone 9 */ - { "nzt", tZONE, -HOUR(12) }, /* New Zealand */ - { "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */ - { "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */ - { "idle", tZONE, -HOUR(12) }, /* International Date Line East */ - /* ADDED BY Marco Nijdam */ - { "dst", tDST, HOUR( 0) }, /* DST on (hour is ignored) */ - /* End ADDED */ - { NULL } -}; - -/* - * Military timezone table. - */ -static TABLE MilitaryTable[] = { - { "a", tZONE, HOUR( 1) }, - { "b", tZONE, HOUR( 2) }, - { "c", tZONE, HOUR( 3) }, - { "d", tZONE, HOUR( 4) }, - { "e", tZONE, HOUR( 5) }, - { "f", tZONE, HOUR( 6) }, - { "g", tZONE, HOUR( 7) }, - { "h", tZONE, HOUR( 8) }, - { "i", tZONE, HOUR( 9) }, - { "k", tZONE, HOUR( 10) }, - { "l", tZONE, HOUR( 11) }, - { "m", tZONE, HOUR( 12) }, - { "n", tZONE, HOUR(- 1) }, - { "o", tZONE, HOUR(- 2) }, - { "p", tZONE, HOUR(- 3) }, - { "q", tZONE, HOUR(- 4) }, - { "r", tZONE, HOUR(- 5) }, - { "s", tZONE, HOUR(- 6) }, - { "t", tZONE, HOUR(- 7) }, - { "u", tZONE, HOUR(- 8) }, - { "v", tZONE, HOUR(- 9) }, - { "w", tZONE, HOUR(-10) }, - { "x", tZONE, HOUR(-11) }, - { "y", tZONE, HOUR(-12) }, - { "z", tZONE, HOUR( 0) }, - { NULL } -}; - - -/* - * Dump error messages in the bit bucket. - */ -static void -TclDateerror(s) - char *s; -{ -} - - -static time_t -ToSeconds(Hours, Minutes, Seconds, Meridian) - time_t Hours; - time_t Minutes; - time_t Seconds; - MERIDIAN Meridian; -{ - if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59) - return -1; - switch (Meridian) { - case MER24: - if (Hours < 0 || Hours > 23) - return -1; - return (Hours * 60L + Minutes) * 60L + Seconds; - case MERam: - if (Hours < 1 || Hours > 12) - return -1; - return ((Hours % 12) * 60L + Minutes) * 60L + Seconds; - case MERpm: - if (Hours < 1 || Hours > 12) - return -1; - return (((Hours % 12) + 12) * 60L + Minutes) * 60L + Seconds; - } - return -1; /* Should never be reached */ -} - - -static int -Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode, TimePtr) - time_t Month; - time_t Day; - time_t Year; - time_t Hours; - time_t Minutes; - time_t Seconds; - MERIDIAN Meridian; - DSTMODE DSTmode; - time_t *TimePtr; -{ - static int DaysInMonth[12] = { - 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 - }; - time_t tod; - time_t Julian; - int i; - - DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) - ? 29 : 28; - if (Month < 1 || Month > 12 - || Year < START_OF_TIME || Year > END_OF_TIME - || Day < 1 || Day > DaysInMonth[(int)--Month]) - return -1; - - for (Julian = Day - 1, i = 0; i < Month; i++) - Julian += DaysInMonth[i]; - if (Year >= EPOCH) { - for (i = EPOCH; i < Year; i++) - Julian += 365 + (i % 4 == 0); - } else { - for (i = Year; i < EPOCH; i++) - Julian -= 365 + (i % 4 == 0); - } - Julian *= SECSPERDAY; - Julian += TclDateTimezone * 60L; - if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0) - return -1; - Julian += tod; - if (DSTmode == DSTon - || (DSTmode == DSTmaybe && TclpGetDate((TclpTime_t)&Julian, 0)->tm_isdst)) - Julian -= 60 * 60; - *TimePtr = Julian; - return 0; -} - - -static time_t -DSTcorrect(Start, Future) - time_t Start; - time_t Future; -{ - time_t StartDay; - time_t FutureDay; - - StartDay = (TclpGetDate((TclpTime_t)&Start, 0)->tm_hour + 1) % 24; - FutureDay = (TclpGetDate((TclpTime_t)&Future, 0)->tm_hour + 1) % 24; - return (Future - Start) + (StartDay - FutureDay) * 60L * 60L; -} - - -static time_t -RelativeDate(Start, DayOrdinal, DayNumber) - time_t Start; - time_t DayOrdinal; - time_t DayNumber; -{ - struct tm *tm; - time_t now; - - now = Start; - tm = TclpGetDate((TclpTime_t)&now, 0); - now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7); - now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1); - return DSTcorrect(Start, now); -} - - -static int -RelativeMonth(Start, RelMonth, TimePtr) - time_t Start; - time_t RelMonth; - time_t *TimePtr; -{ - struct tm *tm; - time_t Month; - time_t Year; - time_t Julian; - int result; - - if (RelMonth == 0) { - *TimePtr = 0; - return 0; - } - tm = TclpGetDate((TclpTime_t)&Start, 0); - Month = 12 * (tm->tm_year + TM_YEAR_BASE) + tm->tm_mon + RelMonth; - Year = Month / 12; - Month = Month % 12 + 1; - result = Convert(Month, (time_t) tm->tm_mday, Year, - (time_t) tm->tm_hour, (time_t) tm->tm_min, (time_t) tm->tm_sec, - MER24, DSTmaybe, &Julian); - /* - * The following iteration takes into account the case were we jump - * into a "short month". Far example, "one month from Jan 31" will - * fail because there is no Feb 31. The code below will reduce the - * day and try converting the date until we succed or the date equals - * 28 (which always works unless the date is bad in another way). - */ - - while ((result != 0) && (tm->tm_mday > 28)) { - tm->tm_mday--; - result = Convert(Month, (time_t) tm->tm_mday, Year, - (time_t) tm->tm_hour, (time_t) tm->tm_min, (time_t) tm->tm_sec, - MER24, DSTmaybe, &Julian); - } - if (result != 0) { - return -1; - } - *TimePtr = DSTcorrect(Start, Julian); - return 0; -} - - -static int -LookupWord(buff) - char *buff; -{ - register char *p; - register char *q; - register TABLE *tp; - int i; - int abbrev; - - /* - * Make it lowercase. - */ - - Tcl_UtfToLower(buff); - - if (strcmp(buff, "am") == 0 || strcmp(buff, "a.m.") == 0) { - TclDatelval.Meridian = MERam; - return tMERIDIAN; - } - if (strcmp(buff, "pm") == 0 || strcmp(buff, "p.m.") == 0) { - TclDatelval.Meridian = MERpm; - return tMERIDIAN; - } - - /* - * See if we have an abbreviation for a month. - */ - if (strlen(buff) == 3) { - abbrev = 1; - } else if (strlen(buff) == 4 && buff[3] == '.') { - abbrev = 1; - buff[3] = '\0'; - } else { - abbrev = 0; - } - - for (tp = MonthDayTable; tp->name; tp++) { - if (abbrev) { - if (strncmp(buff, tp->name, 3) == 0) { - TclDatelval.Number = tp->value; - return tp->type; - } - } else if (strcmp(buff, tp->name) == 0) { - TclDatelval.Number = tp->value; - return tp->type; - } - } - - for (tp = TimezoneTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - TclDatelval.Number = tp->value; - return tp->type; - } - } - - for (tp = UnitsTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - TclDatelval.Number = tp->value; - return tp->type; - } - } - - /* - * Strip off any plural and try the units table again. - */ - i = strlen(buff) - 1; - if (buff[i] == 's') { - buff[i] = '\0'; - for (tp = UnitsTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - TclDatelval.Number = tp->value; - return tp->type; - } - } - } - - for (tp = OtherTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - TclDatelval.Number = tp->value; - return tp->type; - } - } - - /* - * Military timezones. - */ - if (buff[1] == '\0' && !(*buff & 0x80) - && isalpha(UCHAR(*buff))) { /* INTL: ISO only */ - for (tp = MilitaryTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - TclDatelval.Number = tp->value; - return tp->type; - } - } - } - - /* - * Drop out any periods and try the timezone table again. - */ - for (i = 0, p = q = buff; *q; q++) - if (*q != '.') { - *p++ = *q; - } else { - i++; - } - *p = '\0'; - if (i) { - for (tp = TimezoneTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - TclDatelval.Number = tp->value; - return tp->type; - } - } - } - - return tID; -} - - -static int -TclDatelex() -{ - register char c; - register char *p; - char buff[20]; - int Count; - int sign; - - for ( ; ; ) { - while (isspace((unsigned char) (*TclDateInput))) { - TclDateInput++; - } - - if (isdigit(c = *TclDateInput) || c == '-' || c == '+') { /* INTL: digit */ - if (c == '-' || c == '+') { - sign = c == '-' ? -1 : 1; - if (!isdigit(*++TclDateInput)) { /* INTL: digit */ - /* - * skip the '-' sign - */ - continue; - } - } else { - sign = 0; - } - for (TclDatelval.Number = 0; - isdigit(c = *TclDateInput++); ) { /* INTL: digit */ - TclDatelval.Number = 10 * TclDatelval.Number + c - '0'; - } - TclDateInput--; - if (sign < 0) { - TclDatelval.Number = -TclDatelval.Number; - } - return sign ? tSNUMBER : tUNUMBER; - } - if (!(c & 0x80) && isalpha(UCHAR(c))) { /* INTL: ISO only. */ - for (p = buff; isalpha(c = *TclDateInput++) /* INTL: ISO only. */ - || c == '.'; ) { - if (p < &buff[sizeof buff - 1]) { - *p++ = c; - } - } - *p = '\0'; - TclDateInput--; - return LookupWord(buff); - } - if (c != '(') { - return *TclDateInput++; - } - Count = 0; - do { - c = *TclDateInput++; - if (c == '\0') { - return c; - } else if (c == '(') { - Count++; - } else if (c == ')') { - Count--; - } - } while (Count > 0); - } -} - -/* - * Specify zone is of -50000 to force GMT. (This allows BST to work). - */ - -int -TclGetDate(p, now, zone, timePtr) - char *p; - unsigned long now; - long zone; - unsigned long *timePtr; -{ - struct tm *tm; - time_t Start; - time_t Time; - time_t tod; - int thisyear; - - TclDateInput = p; - tm = TclpGetDate((TclpTime_t) &now, 0); - thisyear = tm->tm_year + TM_YEAR_BASE; - TclDateYear = thisyear; - TclDateMonth = tm->tm_mon + 1; - TclDateDay = tm->tm_mday; - TclDateTimezone = zone; - if (zone == -50000) { - TclDateDSTmode = DSToff; /* assume GMT */ - TclDateTimezone = 0; - } else { - TclDateDSTmode = DSTmaybe; - } - TclDateHour = 0; - TclDateMinutes = 0; - TclDateSeconds = 0; - TclDateMeridian = MER24; - TclDateRelSeconds = 0; - TclDateRelMonth = 0; - TclDateHaveDate = 0; - TclDateHaveDay = 0; - TclDateHaveRel = 0; - TclDateHaveTime = 0; - TclDateHaveZone = 0; - - if (TclDateparse() || TclDateHaveTime > 1 || TclDateHaveZone > 1 || TclDateHaveDate > 1 || - TclDateHaveDay > 1) { - return -1; - } - - if (TclDateHaveDate || TclDateHaveTime || TclDateHaveDay) { - if (TclDateYear < 0) { - TclDateYear = -TclDateYear; - } - /* - * The following line handles years that are specified using - * only two digits. The line of code below implements a policy - * defined by the X/Open workgroup on the millinium rollover. - * Note: some of those dates may not actually be valid on some - * platforms. The POSIX standard startes that the dates 70-99 - * shall refer to 1970-1999 and 00-38 shall refer to 2000-2038. - * This later definition should work on all platforms. - */ - - if (TclDateYear < 100) { - if (TclDateYear >= 69) { - TclDateYear += 1900; - } else { - TclDateYear += 2000; - } - } - if (Convert(TclDateMonth, TclDateDay, TclDateYear, TclDateHour, TclDateMinutes, TclDateSeconds, - TclDateMeridian, TclDateDSTmode, &Start) < 0) { - return -1; - } - } else { - Start = now; - if (!TclDateHaveRel) { - Start -= ((tm->tm_hour * 60L) + tm->tm_min * 60L) + tm->tm_sec; - } - } - - Start += TclDateRelSeconds; - if (RelativeMonth(Start, TclDateRelMonth, &Time) < 0) { - return -1; - } - Start += Time; - - if (TclDateHaveDay && !TclDateHaveDate) { - tod = RelativeDate(Start, TclDateDayOrdinal, TclDateDayNumber); - Start += tod; - } - - *timePtr = Start; - return 0; -} -TclDatetabelem TclDateexca[] ={ --1, 1, - 0, -1, - -2, 0, - }; -# define YYNPROD 41 -# define YYLAST 227 -TclDatetabelem TclDateact[]={ - - 14, 11, 23, 28, 17, 12, 19, 18, 16, 9, - 10, 13, 42, 21, 46, 45, 44, 48, 41, 37, - 36, 35, 32, 29, 34, 33, 31, 43, 39, 38, - 30, 15, 8, 7, 6, 5, 4, 3, 2, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 22, 0, 0, 20, 25, 24, 27, - 26, 42, 0, 0, 0, 0, 40 }; -TclDatetabelem TclDatepact[]={ - --10000000, -258,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000, -45, - -267,-10000000, -244,-10000000, -14, -231, -240,-10000000,-10000000,-10000000, --10000000, -246,-10000000, -247, -248,-10000000,-10000000,-10000000,-10000000, -15, --10000000,-10000000,-10000000,-10000000,-10000000, -40, -20,-10000000, -251,-10000000, --10000000, -252,-10000000, -253,-10000000, -249,-10000000,-10000000,-10000000 }; -TclDatetabelem TclDatepgo[]={ - - 0, 28, 39, 38, 37, 36, 35, 34, 33, 32, - 31 }; -TclDatetabelem TclDater1[]={ - - 0, 2, 2, 3, 3, 3, 3, 3, 3, 4, - 4, 4, 4, 4, 5, 5, 5, 7, 7, 7, - 6, 6, 6, 6, 6, 6, 6, 8, 8, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 9, 1, - 1 }; -TclDatetabelem TclDater2[]={ - - 0, 0, 4, 3, 3, 3, 3, 3, 2, 5, - 9, 9, 13, 13, 5, 3, 3, 3, 5, 5, - 7, 11, 5, 9, 5, 3, 7, 5, 2, 5, - 5, 3, 5, 5, 3, 5, 5, 3, 3, 1, - 3 }; -TclDatetabelem TclDatechk[]={ - --10000000, -2, -3, -4, -5, -6, -7, -8, -9, 267, - 268, 259, 263, 269, 258, -10, 266, 262, 265, 264, - 261, 58, 258, 47, 263, 262, 265, 264, 270, 267, - 44, 257, 262, 265, 264, 267, 267, 267, 44, -1, - 266, 58, 261, 47, 267, 267, 267, -1, 266 }; -TclDatetabelem TclDatedef[]={ - - 1, -2, 2, 3, 4, 5, 6, 7, 8, 38, - 15, 16, 0, 25, 17, 28, 0, 31, 34, 37, - 9, 0, 19, 0, 24, 29, 33, 36, 14, 22, - 18, 27, 30, 32, 35, 39, 20, 26, 0, 10, - 11, 0, 40, 0, 23, 39, 21, 12, 13 }; -typedef struct -#ifdef __cplusplus - TclDatetoktype -#endif -{ char *t_name; int t_val; } TclDatetoktype; -#ifndef YYDEBUG -# define YYDEBUG 0 /* don't allow debugging */ -#endif - -#if YYDEBUG - -TclDatetoktype TclDatetoks[] = -{ - "tAGO", 257, - "tDAY", 258, - "tDAYZONE", 259, - "tID", 260, - "tMERIDIAN", 261, - "tMINUTE_UNIT", 262, - "tMONTH", 263, - "tMONTH_UNIT", 264, - "tSEC_UNIT", 265, - "tSNUMBER", 266, - "tUNUMBER", 267, - "tZONE", 268, - "tEPOCH", 269, - "tDST", 270, - "-unknown-", -1 /* ends search */ -}; - -char * TclDatereds[] = -{ - "-no such reduction-", - "spec : /* empty */", - "spec : spec item", - "item : time", - "item : zone", - "item : date", - "item : day", - "item : rel", - "item : number", - "time : tUNUMBER tMERIDIAN", - "time : tUNUMBER ':' tUNUMBER o_merid", - "time : tUNUMBER ':' tUNUMBER tSNUMBER", - "time : tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid", - "time : tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER", - "zone : tZONE tDST", - "zone : tZONE", - "zone : tDAYZONE", - "day : tDAY", - "day : tDAY ','", - "day : tUNUMBER tDAY", - "date : tUNUMBER '/' tUNUMBER", - "date : tUNUMBER '/' tUNUMBER '/' tUNUMBER", - "date : tMONTH tUNUMBER", - "date : tMONTH tUNUMBER ',' tUNUMBER", - "date : tUNUMBER tMONTH", - "date : tEPOCH", - "date : tUNUMBER tMONTH tUNUMBER", - "rel : relunit tAGO", - "rel : relunit", - "relunit : tUNUMBER tMINUTE_UNIT", - "relunit : tSNUMBER tMINUTE_UNIT", - "relunit : tMINUTE_UNIT", - "relunit : tSNUMBER tSEC_UNIT", - "relunit : tUNUMBER tSEC_UNIT", - "relunit : tSEC_UNIT", - "relunit : tSNUMBER tMONTH_UNIT", - "relunit : tUNUMBER tMONTH_UNIT", - "relunit : tMONTH_UNIT", - "number : tUNUMBER", - "o_merid : /* empty */", - "o_merid : tMERIDIAN", -}; -#endif /* YYDEBUG */ -/* - * Copyright (c) 1993 by Sun Microsystems, Inc. - */ - - -/* -** Skeleton parser driver for yacc output -*/ - -/* -** yacc user known macros and defines -*/ -#define YYERROR goto TclDateerrlab -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYBACKUP( newtoken, newvalue )\ -{\ - if ( TclDatechar >= 0 || ( TclDater2[ TclDatetmp ] >> 1 ) != 1 )\ - {\ - TclDateerror( "syntax error - cannot backup" );\ - goto TclDateerrlab;\ - }\ - TclDatechar = newtoken;\ - TclDatestate = *TclDateps;\ - TclDatelval = newvalue;\ - goto TclDatenewstate;\ -} -#define YYRECOVERING() (!!TclDateerrflag) -#define YYNEW(type) malloc(sizeof(type) * TclDatenewmax) -#define YYCOPY(to, from, type) \ - (type *) memcpy(to, (char *) from, TclDatenewmax * sizeof(type)) -#define YYENLARGE( from, type) \ - (type *) realloc((char *) from, TclDatenewmax * sizeof(type)) -#ifndef YYDEBUG -# define YYDEBUG 1 /* make debugging available */ -#endif - -/* -** user known globals -*/ -int TclDatedebug; /* set to 1 to get debugging */ - -/* -** driver internal defines -*/ -#define YYFLAG (-10000000) - -/* -** global variables used by the parser -*/ -YYSTYPE *TclDatepv; /* top of value stack */ -int *TclDateps; /* top of state stack */ - -int TclDatestate; /* current state */ -int TclDatetmp; /* extra var (lasts between blocks) */ - -int TclDatenerrs; /* number of errors */ -int TclDateerrflag; /* error recovery flag */ -int TclDatechar; /* current input token number */ - - - -#ifdef YYNMBCHARS -#define YYLEX() TclDatecvtok(TclDatelex()) -/* -** TclDatecvtok - return a token if i is a wchar_t value that exceeds 255. -** If i<255, i itself is the token. If i>255 but the neither -** of the 30th or 31st bit is on, i is already a token. -*/ -#if defined(__STDC__) || defined(__cplusplus) -int TclDatecvtok(int i) -#else -int TclDatecvtok(i) int i; -#endif -{ - int first = 0; - int last = YYNMBCHARS - 1; - int mid; - wchar_t j; - - if(i&0x60000000){/*Must convert to a token. */ - if( TclDatembchars[last].character < i ){ - return i;/*Giving up*/ - } - while ((last>=first)&&(first>=0)) {/*Binary search loop*/ - mid = (first+last)/2; - j = TclDatembchars[mid].character; - if( j==i ){/*Found*/ - return TclDatembchars[mid].tvalue; - }else if( j= 0; - TclDate_i++ ) - { - if ( TclDatetoks[TclDate_i].t_val == TclDatechar ) - break; - } - printf( "%s\n", TclDatetoks[TclDate_i].t_name ); - } - } -#endif /* YYDEBUG */ - if ( ++TclDate_ps >= &TclDates[ TclDatemaxdepth ] ) /* room on stack? */ - { - /* - ** reallocate and recover. Note that pointers - ** have to be reset, or bad things will happen - */ - int TclDateps_index = (TclDate_ps - TclDates); - int TclDatepv_index = (TclDate_pv - TclDatev); - int TclDatepvt_index = (TclDatepvt - TclDatev); - int TclDatenewmax; -#ifdef YYEXPAND - TclDatenewmax = YYEXPAND(TclDatemaxdepth); -#else - TclDatenewmax = 2 * TclDatemaxdepth; /* double table size */ - if (TclDatemaxdepth == YYMAXDEPTH) /* first time growth */ - { - char *newTclDates = (char *)YYNEW(int); - char *newTclDatev = (char *)YYNEW(YYSTYPE); - if (newTclDates != 0 && newTclDatev != 0) - { - TclDates = YYCOPY(newTclDates, TclDates, int); - TclDatev = YYCOPY(newTclDatev, TclDatev, YYSTYPE); - } - else - TclDatenewmax = 0; /* failed */ - } - else /* not first time */ - { - TclDates = YYENLARGE(TclDates, int); - TclDatev = YYENLARGE(TclDatev, YYSTYPE); - if (TclDates == 0 || TclDatev == 0) - TclDatenewmax = 0; /* failed */ - } -#endif - if (TclDatenewmax <= TclDatemaxdepth) /* tables not expanded */ - { - TclDateerror( "yacc stack overflow" ); - YYABORT; - } - TclDatemaxdepth = TclDatenewmax; - - TclDate_ps = TclDates + TclDateps_index; - TclDate_pv = TclDatev + TclDatepv_index; - TclDatepvt = TclDatev + TclDatepvt_index; - } - *TclDate_ps = TclDate_state; - *++TclDate_pv = TclDateval; - - /* - ** we have a new state - find out what to do - */ - TclDate_newstate: - if ( ( TclDate_n = TclDatepact[ TclDate_state ] ) <= YYFLAG ) - goto TclDatedefault; /* simple state */ -#if YYDEBUG - /* - ** if debugging, need to mark whether new token grabbed - */ - TclDatetmp = TclDatechar < 0; -#endif - if ( ( TclDatechar < 0 ) && ( ( TclDatechar = YYLEX() ) < 0 ) ) - TclDatechar = 0; /* reached EOF */ -#if YYDEBUG - if ( TclDatedebug && TclDatetmp ) - { - register int TclDate_i; - - printf( "Received token " ); - if ( TclDatechar == 0 ) - printf( "end-of-file\n" ); - else if ( TclDatechar < 0 ) - printf( "-none-\n" ); - else - { - for ( TclDate_i = 0; TclDatetoks[TclDate_i].t_val >= 0; - TclDate_i++ ) - { - if ( TclDatetoks[TclDate_i].t_val == TclDatechar ) - break; - } - printf( "%s\n", TclDatetoks[TclDate_i].t_name ); - } - } -#endif /* YYDEBUG */ - if ( ( ( TclDate_n += TclDatechar ) < 0 ) || ( TclDate_n >= YYLAST ) ) - goto TclDatedefault; - if ( TclDatechk[ TclDate_n = TclDateact[ TclDate_n ] ] == TclDatechar ) /*valid shift*/ - { - TclDatechar = -1; - TclDateval = TclDatelval; - TclDate_state = TclDate_n; - if ( TclDateerrflag > 0 ) - TclDateerrflag--; - goto TclDate_stack; - } - - TclDatedefault: - if ( ( TclDate_n = TclDatedef[ TclDate_state ] ) == -2 ) - { -#if YYDEBUG - TclDatetmp = TclDatechar < 0; -#endif - if ( ( TclDatechar < 0 ) && ( ( TclDatechar = YYLEX() ) < 0 ) ) - TclDatechar = 0; /* reached EOF */ -#if YYDEBUG - if ( TclDatedebug && TclDatetmp ) - { - register int TclDate_i; - - printf( "Received token " ); - if ( TclDatechar == 0 ) - printf( "end-of-file\n" ); - else if ( TclDatechar < 0 ) - printf( "-none-\n" ); - else - { - for ( TclDate_i = 0; - TclDatetoks[TclDate_i].t_val >= 0; - TclDate_i++ ) - { - if ( TclDatetoks[TclDate_i].t_val - == TclDatechar ) - { - break; - } - } - printf( "%s\n", TclDatetoks[TclDate_i].t_name ); - } - } -#endif /* YYDEBUG */ - /* - ** look through exception table - */ - { - register int *TclDatexi = TclDateexca; - - while ( ( *TclDatexi != -1 ) || - ( TclDatexi[1] != TclDate_state ) ) - { - TclDatexi += 2; - } - while ( ( *(TclDatexi += 2) >= 0 ) && - ( *TclDatexi != TclDatechar ) ) - ; - if ( ( TclDate_n = TclDatexi[1] ) < 0 ) - YYACCEPT; - } - } - - /* - ** check for syntax error - */ - if ( TclDate_n == 0 ) /* have an error */ - { - /* no worry about speed here! */ - switch ( TclDateerrflag ) - { - case 0: /* new error */ - TclDateerror( "syntax error" ); - goto skip_init; - /* - ** get globals into registers. - ** we have a user generated syntax type error - */ - TclDate_pv = TclDatepv; - TclDate_ps = TclDateps; - TclDate_state = TclDatestate; - skip_init: - TclDatenerrs++; - /* FALLTHRU */ - case 1: - case 2: /* incompletely recovered error */ - /* try again... */ - TclDateerrflag = 3; - /* - ** find state where "error" is a legal - ** shift action - */ - while ( TclDate_ps >= TclDates ) - { - TclDate_n = TclDatepact[ *TclDate_ps ] + YYERRCODE; - if ( TclDate_n >= 0 && TclDate_n < YYLAST && - TclDatechk[TclDateact[TclDate_n]] == YYERRCODE) { - /* - ** simulate shift of "error" - */ - TclDate_state = TclDateact[ TclDate_n ]; - goto TclDate_stack; - } - /* - ** current state has no shift on - ** "error", pop stack - */ -#if YYDEBUG -# define _POP_ "Error recovery pops state %d, uncovers state %d\n" - if ( TclDatedebug ) - printf( _POP_, *TclDate_ps, - TclDate_ps[-1] ); -# undef _POP_ -#endif - TclDate_ps--; - TclDate_pv--; - } - /* - ** there is no state on stack with "error" as - ** a valid shift. give up. - */ - YYABORT; - case 3: /* no shift yet; eat a token */ -#if YYDEBUG - /* - ** if debugging, look up token in list of - ** pairs. 0 and negative shouldn't occur, - ** but since timing doesn't matter when - ** debugging, it doesn't hurt to leave the - ** tests here. - */ - if ( TclDatedebug ) - { - register int TclDate_i; - - printf( "Error recovery discards " ); - if ( TclDatechar == 0 ) - printf( "token end-of-file\n" ); - else if ( TclDatechar < 0 ) - printf( "token -none-\n" ); - else - { - for ( TclDate_i = 0; - TclDatetoks[TclDate_i].t_val >= 0; - TclDate_i++ ) - { - if ( TclDatetoks[TclDate_i].t_val - == TclDatechar ) - { - break; - } - } - printf( "token %s\n", - TclDatetoks[TclDate_i].t_name ); - } - } -#endif /* YYDEBUG */ - if ( TclDatechar == 0 ) /* reached EOF. quit */ - YYABORT; - TclDatechar = -1; - goto TclDate_newstate; - } - }/* end if ( TclDate_n == 0 ) */ - /* - ** reduction by production TclDate_n - ** put stack tops, etc. so things right after switch - */ -#if YYDEBUG - /* - ** if debugging, print the string that is the user's - ** specification of the reduction which is just about - ** to be done. - */ - if ( TclDatedebug ) - printf( "Reduce by (%d) \"%s\"\n", - TclDate_n, TclDatereds[ TclDate_n ] ); -#endif - TclDatetmp = TclDate_n; /* value to switch over */ - TclDatepvt = TclDate_pv; /* $vars top of value stack */ - /* - ** Look in goto table for next state - ** Sorry about using TclDate_state here as temporary - ** register variable, but why not, if it works... - ** If TclDater2[ TclDate_n ] doesn't have the low order bit - ** set, then there is no action to be done for - ** this reduction. So, no saving & unsaving of - ** registers done. The only difference between the - ** code just after the if and the body of the if is - ** the goto TclDate_stack in the body. This way the test - ** can be made before the choice of what to do is needed. - */ - { - /* length of production doubled with extra bit */ - register int TclDate_len = TclDater2[ TclDate_n ]; - - if ( !( TclDate_len & 01 ) ) - { - TclDate_len >>= 1; - TclDateval = ( TclDate_pv -= TclDate_len )[1]; /* $$ = $1 */ - TclDate_state = TclDatepgo[ TclDate_n = TclDater1[ TclDate_n ] ] + - *( TclDate_ps -= TclDate_len ) + 1; - if ( TclDate_state >= YYLAST || - TclDatechk[ TclDate_state = - TclDateact[ TclDate_state ] ] != -TclDate_n ) - { - TclDate_state = TclDateact[ TclDatepgo[ TclDate_n ] ]; - } - goto TclDate_stack; - } - TclDate_len >>= 1; - TclDateval = ( TclDate_pv -= TclDate_len )[1]; /* $$ = $1 */ - TclDate_state = TclDatepgo[ TclDate_n = TclDater1[ TclDate_n ] ] + - *( TclDate_ps -= TclDate_len ) + 1; - if ( TclDate_state >= YYLAST || - TclDatechk[ TclDate_state = TclDateact[ TclDate_state ] ] != -TclDate_n ) - { - TclDate_state = TclDateact[ TclDatepgo[ TclDate_n ] ]; - } - } - /* save until reenter driver code */ - TclDatestate = TclDate_state; - TclDateps = TclDate_ps; - TclDatepv = TclDate_pv; - } - /* - ** code supplied by user is placed in this switch - */ - switch( TclDatetmp ) - { - -case 3:{ - TclDateHaveTime++; - } break; -case 4:{ - TclDateHaveZone++; - } break; -case 5:{ - TclDateHaveDate++; - } break; -case 6:{ - TclDateHaveDay++; - } break; -case 7:{ - TclDateHaveRel++; - } break; -case 9:{ - TclDateHour = TclDatepvt[-1].Number; - TclDateMinutes = 0; - TclDateSeconds = 0; - TclDateMeridian = TclDatepvt[-0].Meridian; - } break; -case 10:{ - TclDateHour = TclDatepvt[-3].Number; - TclDateMinutes = TclDatepvt[-1].Number; - TclDateSeconds = 0; - TclDateMeridian = TclDatepvt[-0].Meridian; - } break; -case 11:{ - TclDateHour = TclDatepvt[-3].Number; - TclDateMinutes = TclDatepvt[-1].Number; - TclDateMeridian = MER24; - TclDateDSTmode = DSToff; - TclDateTimezone = - (TclDatepvt[-0].Number % 100 + (TclDatepvt[-0].Number / 100) * 60); - } break; -case 12:{ - TclDateHour = TclDatepvt[-5].Number; - TclDateMinutes = TclDatepvt[-3].Number; - TclDateSeconds = TclDatepvt[-1].Number; - TclDateMeridian = TclDatepvt[-0].Meridian; - } break; -case 13:{ - TclDateHour = TclDatepvt[-5].Number; - TclDateMinutes = TclDatepvt[-3].Number; - TclDateSeconds = TclDatepvt[-1].Number; - TclDateMeridian = MER24; - TclDateDSTmode = DSToff; - TclDateTimezone = - (TclDatepvt[-0].Number % 100 + (TclDatepvt[-0].Number / 100) * 60); - } break; -case 14:{ - TclDateTimezone = TclDatepvt[-1].Number; - TclDateDSTmode = DSTon; - } break; -case 15:{ - TclDateTimezone = TclDatepvt[-0].Number; - TclDateDSTmode = DSToff; - } break; -case 16:{ - TclDateTimezone = TclDatepvt[-0].Number; - TclDateDSTmode = DSTon; - } break; -case 17:{ - TclDateDayOrdinal = 1; - TclDateDayNumber = TclDatepvt[-0].Number; - } break; -case 18:{ - TclDateDayOrdinal = 1; - TclDateDayNumber = TclDatepvt[-1].Number; - } break; -case 19:{ - TclDateDayOrdinal = TclDatepvt[-1].Number; - TclDateDayNumber = TclDatepvt[-0].Number; - } break; -case 20:{ - TclDateMonth = TclDatepvt[-2].Number; - TclDateDay = TclDatepvt[-0].Number; - } break; -case 21:{ - TclDateMonth = TclDatepvt[-4].Number; - TclDateDay = TclDatepvt[-2].Number; - TclDateYear = TclDatepvt[-0].Number; - } break; -case 22:{ - TclDateMonth = TclDatepvt[-1].Number; - TclDateDay = TclDatepvt[-0].Number; - } break; -case 23:{ - TclDateMonth = TclDatepvt[-3].Number; - TclDateDay = TclDatepvt[-2].Number; - TclDateYear = TclDatepvt[-0].Number; - } break; -case 24:{ - TclDateMonth = TclDatepvt[-0].Number; - TclDateDay = TclDatepvt[-1].Number; - } break; -case 25:{ - TclDateMonth = 1; - TclDateDay = 1; - TclDateYear = EPOCH; - } break; -case 26:{ - TclDateMonth = TclDatepvt[-1].Number; - TclDateDay = TclDatepvt[-2].Number; - TclDateYear = TclDatepvt[-0].Number; - } break; -case 27:{ - TclDateRelSeconds = -TclDateRelSeconds; - TclDateRelMonth = -TclDateRelMonth; - } break; -case 29:{ - TclDateRelSeconds += TclDatepvt[-1].Number * TclDatepvt[-0].Number * 60L; - } break; -case 30:{ - TclDateRelSeconds += TclDatepvt[-1].Number * TclDatepvt[-0].Number * 60L; - } break; -case 31:{ - TclDateRelSeconds += TclDatepvt[-0].Number * 60L; - } break; -case 32:{ - TclDateRelSeconds += TclDatepvt[-1].Number; - } break; -case 33:{ - TclDateRelSeconds += TclDatepvt[-1].Number; - } break; -case 34:{ - TclDateRelSeconds++; - } break; -case 35:{ - TclDateRelMonth += TclDatepvt[-1].Number * TclDatepvt[-0].Number; - } break; -case 36:{ - TclDateRelMonth += TclDatepvt[-1].Number * TclDatepvt[-0].Number; - } break; -case 37:{ - TclDateRelMonth += TclDatepvt[-0].Number; - } break; -case 38:{ - if (TclDateHaveTime && TclDateHaveDate && !TclDateHaveRel) { - TclDateYear = TclDatepvt[-0].Number; - } else { - TclDateHaveTime++; - if (TclDatepvt[-0].Number < 100) { - TclDateHour = 0; - TclDateMinutes = TclDatepvt[-0].Number; - } else { - TclDateHour = TclDatepvt[-0].Number / 100; - TclDateMinutes = TclDatepvt[-0].Number % 100; - } - TclDateSeconds = 0; - TclDateMeridian = MER24; - } - } break; -case 39:{ - TclDateval.Meridian = MER24; - } break; -case 40:{ - TclDateval.Meridian = TclDatepvt[-0].Meridian; - } break; - } - goto TclDatestack; /* reset registers in driver code */ -} - diff --git a/generic/tclDecls.h b/generic/tclDecls.h deleted file mode 100644 index f07ff56..0000000 --- a/generic/tclDecls.h +++ /dev/null @@ -1,2995 +0,0 @@ -/* - * tclDecls.h -- - * - * Declarations of functions in the platform independent public Tcl API. - * - * 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. - * - * RCS: @(#) $Id: tclDecls.h,v 1.7 1999/04/16 00:46:45 stanton Exp $ - */ - -#ifndef _TCLDECLS -#define _TCLDECLS - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tcl.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported function declarations: - */ - -/* 0 */ -EXTERN int Tcl_PkgProvideEx _ANSI_ARGS_((Tcl_Interp * interp, - char * name, char * version, - ClientData clientData)); -/* 1 */ -EXTERN char * Tcl_PkgRequireEx _ANSI_ARGS_((Tcl_Interp * interp, - char * name, char * version, int exact, - ClientData * clientDataPtr)); -/* 2 */ -EXTERN void Tcl_Panic _ANSI_ARGS_(TCL_VARARGS(char *,format)); -/* 3 */ -EXTERN char * Tcl_Alloc _ANSI_ARGS_((unsigned int size)); -/* 4 */ -EXTERN void Tcl_Free _ANSI_ARGS_((char * ptr)); -/* 5 */ -EXTERN char * Tcl_Realloc _ANSI_ARGS_((char * ptr, - unsigned int size)); -/* 6 */ -EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size, - char * file, int line)); -/* 7 */ -EXTERN int Tcl_DbCkfree _ANSI_ARGS_((char * ptr, char * file, - int line)); -/* 8 */ -EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char * ptr, - unsigned int size, char * file, int line)); -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* 9 */ -EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_((int fd, int mask, - Tcl_FileProc * proc, ClientData clientData)); -#endif /* UNIX */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* 10 */ -EXTERN void Tcl_DeleteFileHandler _ANSI_ARGS_((int fd)); -#endif /* UNIX */ -/* 11 */ -EXTERN void Tcl_SetTimer _ANSI_ARGS_((Tcl_Time * timePtr)); -/* 12 */ -EXTERN void Tcl_Sleep _ANSI_ARGS_((int ms)); -/* 13 */ -EXTERN int Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time * timePtr)); -/* 14 */ -EXTERN int Tcl_AppendAllObjTypes _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr)); -/* 15 */ -EXTERN void Tcl_AppendStringsToObj _ANSI_ARGS_(TCL_VARARGS(Tcl_Obj *,objPtr)); -/* 16 */ -EXTERN void Tcl_AppendToObj _ANSI_ARGS_((Tcl_Obj * objPtr, - char * bytes, int length)); -/* 17 */ -EXTERN Tcl_Obj * Tcl_ConcatObj _ANSI_ARGS_((int objc, - Tcl_Obj *CONST objv[])); -/* 18 */ -EXTERN int Tcl_ConvertToType _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, Tcl_ObjType * typePtr)); -/* 19 */ -EXTERN void Tcl_DbDecrRefCount _ANSI_ARGS_((Tcl_Obj * objPtr, - char * file, int line)); -/* 20 */ -EXTERN void Tcl_DbIncrRefCount _ANSI_ARGS_((Tcl_Obj * objPtr, - char * file, int line)); -/* 21 */ -EXTERN int Tcl_DbIsShared _ANSI_ARGS_((Tcl_Obj * objPtr, - char * file, int line)); -/* 22 */ -EXTERN Tcl_Obj * Tcl_DbNewBooleanObj _ANSI_ARGS_((int boolValue, - char * file, int line)); -/* 23 */ -EXTERN Tcl_Obj * Tcl_DbNewByteArrayObj _ANSI_ARGS_(( - unsigned char * bytes, int length, - char * file, int line)); -/* 24 */ -EXTERN Tcl_Obj * Tcl_DbNewDoubleObj _ANSI_ARGS_((double doubleValue, - char * file, int line)); -/* 25 */ -EXTERN Tcl_Obj * Tcl_DbNewListObj _ANSI_ARGS_((int objc, - Tcl_Obj *CONST objv[], char * file, int line)); -/* 26 */ -EXTERN Tcl_Obj * Tcl_DbNewLongObj _ANSI_ARGS_((long longValue, - char * file, int line)); -/* 27 */ -EXTERN Tcl_Obj * Tcl_DbNewObj _ANSI_ARGS_((char * file, int line)); -/* 28 */ -EXTERN Tcl_Obj * Tcl_DbNewStringObj _ANSI_ARGS_((CONST char * bytes, - int length, char * file, int line)); -/* 29 */ -EXTERN Tcl_Obj * Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj * objPtr)); -/* 30 */ -EXTERN void TclFreeObj _ANSI_ARGS_((Tcl_Obj * objPtr)); -/* 31 */ -EXTERN int Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp * interp, - char * str, int * boolPtr)); -/* 32 */ -EXTERN int Tcl_GetBooleanFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - int * boolPtr)); -/* 33 */ -EXTERN unsigned char * Tcl_GetByteArrayFromObj _ANSI_ARGS_(( - Tcl_Obj * objPtr, int * lengthPtr)); -/* 34 */ -EXTERN int Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp * interp, - char * str, double * doublePtr)); -/* 35 */ -EXTERN int Tcl_GetDoubleFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - double * doublePtr)); -/* 36 */ -EXTERN int Tcl_GetIndexFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, char ** tablePtr, - char * msg, int flags, int * indexPtr)); -/* 37 */ -EXTERN int Tcl_GetInt _ANSI_ARGS_((Tcl_Interp * interp, - char * str, int * intPtr)); -/* 38 */ -EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int * intPtr)); -/* 39 */ -EXTERN int Tcl_GetLongFromObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, long * longPtr)); -/* 40 */ -EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((char * typeName)); -/* 41 */ -EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj * objPtr, - int * lengthPtr)); -/* 42 */ -EXTERN void Tcl_InvalidateStringRep _ANSI_ARGS_(( - Tcl_Obj * objPtr)); -/* 43 */ -EXTERN int Tcl_ListObjAppendList _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * listPtr, - Tcl_Obj * elemListPtr)); -/* 44 */ -EXTERN int Tcl_ListObjAppendElement _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * listPtr, - Tcl_Obj * objPtr)); -/* 45 */ -EXTERN int Tcl_ListObjGetElements _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * listPtr, - int * objcPtr, Tcl_Obj *** objvPtr)); -/* 46 */ -EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * listPtr, int index, - Tcl_Obj ** objPtrPtr)); -/* 47 */ -EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * listPtr, int * intPtr)); -/* 48 */ -EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * listPtr, int first, int count, - int objc, Tcl_Obj *CONST objv[])); -/* 49 */ -EXTERN Tcl_Obj * Tcl_NewBooleanObj _ANSI_ARGS_((int boolValue)); -/* 50 */ -EXTERN Tcl_Obj * Tcl_NewByteArrayObj _ANSI_ARGS_(( - unsigned char * bytes, int length)); -/* 51 */ -EXTERN Tcl_Obj * Tcl_NewDoubleObj _ANSI_ARGS_((double doubleValue)); -/* 52 */ -EXTERN Tcl_Obj * Tcl_NewIntObj _ANSI_ARGS_((int intValue)); -/* 53 */ -EXTERN Tcl_Obj * Tcl_NewListObj _ANSI_ARGS_((int objc, - Tcl_Obj *CONST objv[])); -/* 54 */ -EXTERN Tcl_Obj * Tcl_NewLongObj _ANSI_ARGS_((long longValue)); -/* 55 */ -EXTERN Tcl_Obj * Tcl_NewObj _ANSI_ARGS_((void)); -/* 56 */ -EXTERN Tcl_Obj * Tcl_NewStringObj _ANSI_ARGS_((CONST char * bytes, - int length)); -/* 57 */ -EXTERN void Tcl_SetBooleanObj _ANSI_ARGS_((Tcl_Obj * objPtr, - int boolValue)); -/* 58 */ -EXTERN unsigned char * Tcl_SetByteArrayLength _ANSI_ARGS_((Tcl_Obj * objPtr, - int length)); -/* 59 */ -EXTERN void Tcl_SetByteArrayObj _ANSI_ARGS_((Tcl_Obj * objPtr, - unsigned char * bytes, int length)); -/* 60 */ -EXTERN void Tcl_SetDoubleObj _ANSI_ARGS_((Tcl_Obj * objPtr, - double doubleValue)); -/* 61 */ -EXTERN void Tcl_SetIntObj _ANSI_ARGS_((Tcl_Obj * objPtr, - int intValue)); -/* 62 */ -EXTERN void Tcl_SetListObj _ANSI_ARGS_((Tcl_Obj * objPtr, - int objc, Tcl_Obj *CONST objv[])); -/* 63 */ -EXTERN void Tcl_SetLongObj _ANSI_ARGS_((Tcl_Obj * objPtr, - long longValue)); -/* 64 */ -EXTERN void Tcl_SetObjLength _ANSI_ARGS_((Tcl_Obj * objPtr, - int length)); -/* 65 */ -EXTERN void Tcl_SetStringObj _ANSI_ARGS_((Tcl_Obj * objPtr, - char * bytes, int length)); -/* 66 */ -EXTERN void Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * message)); -/* 67 */ -EXTERN void Tcl_AddObjErrorInfo _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * message, int length)); -/* 68 */ -EXTERN void Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp * interp)); -/* 69 */ -EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * string)); -/* 70 */ -EXTERN void Tcl_AppendResult _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); -/* 71 */ -EXTERN Tcl_AsyncHandler Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc * proc, - ClientData clientData)); -/* 72 */ -EXTERN void Tcl_AsyncDelete _ANSI_ARGS_((Tcl_AsyncHandler async)); -/* 73 */ -EXTERN int Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp * interp, - int code)); -/* 74 */ -EXTERN void Tcl_AsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async)); -/* 75 */ -EXTERN int Tcl_AsyncReady _ANSI_ARGS_((void)); -/* 76 */ -EXTERN void Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp * interp)); -/* 77 */ -EXTERN char Tcl_Backslash _ANSI_ARGS_((CONST char * src, - int * readPtr)); -/* 78 */ -EXTERN int Tcl_BadChannelOption _ANSI_ARGS_(( - Tcl_Interp * interp, char * optionName, - char * optionList)); -/* 79 */ -EXTERN void Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_InterpDeleteProc * proc, - ClientData clientData)); -/* 80 */ -EXTERN void Tcl_CancelIdleCall _ANSI_ARGS_(( - Tcl_IdleProc * idleProc, - ClientData clientData)); -/* 81 */ -EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Channel chan)); -/* 82 */ -EXTERN int Tcl_CommandComplete _ANSI_ARGS_((char * cmd)); -/* 83 */ -EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, char ** argv)); -/* 84 */ -EXTERN int Tcl_ConvertElement _ANSI_ARGS_((CONST char * src, - char * dst, int flags)); -/* 85 */ -EXTERN int Tcl_ConvertCountedElement _ANSI_ARGS_(( - CONST char * src, int length, char * dst, - int flags)); -/* 86 */ -EXTERN int Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp * slave, - char * slaveCmd, Tcl_Interp * target, - char * targetCmd, int argc, char ** argv)); -/* 87 */ -EXTERN int Tcl_CreateAliasObj _ANSI_ARGS_((Tcl_Interp * slave, - char * slaveCmd, Tcl_Interp * target, - char * targetCmd, int objc, - Tcl_Obj *CONST objv[])); -/* 88 */ -EXTERN Tcl_Channel Tcl_CreateChannel _ANSI_ARGS_(( - Tcl_ChannelType * typePtr, char * chanName, - ClientData instanceData, int mask)); -/* 89 */ -EXTERN void Tcl_CreateChannelHandler _ANSI_ARGS_(( - Tcl_Channel chan, int mask, - Tcl_ChannelProc * proc, - ClientData clientData)); -/* 90 */ -EXTERN void Tcl_CreateCloseHandler _ANSI_ARGS_((Tcl_Channel chan, - Tcl_CloseProc * proc, ClientData clientData)); -/* 91 */ -EXTERN Tcl_Command Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp * interp, - char * cmdName, Tcl_CmdProc * proc, - ClientData clientData, - Tcl_CmdDeleteProc * deleteProc)); -/* 92 */ -EXTERN void Tcl_CreateEventSource _ANSI_ARGS_(( - Tcl_EventSetupProc * setupProc, - Tcl_EventCheckProc * checkProc, - ClientData clientData)); -/* 93 */ -EXTERN void Tcl_CreateExitHandler _ANSI_ARGS_(( - Tcl_ExitProc * proc, ClientData clientData)); -/* 94 */ -EXTERN Tcl_Interp * Tcl_CreateInterp _ANSI_ARGS_((void)); -/* 95 */ -EXTERN void Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp * interp, - char * name, int numArgs, - Tcl_ValueType * argTypes, - Tcl_MathProc * proc, ClientData clientData)); -/* 96 */ -EXTERN Tcl_Command Tcl_CreateObjCommand _ANSI_ARGS_(( - Tcl_Interp * interp, char * cmdName, - Tcl_ObjCmdProc * proc, ClientData clientData, - Tcl_CmdDeleteProc * deleteProc)); -/* 97 */ -EXTERN Tcl_Interp * Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp * interp, - char * slaveName, int isSafe)); -/* 98 */ -EXTERN Tcl_TimerToken Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds, - Tcl_TimerProc * proc, ClientData clientData)); -/* 99 */ -EXTERN Tcl_Trace Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp * interp, - int level, Tcl_CmdTraceProc * proc, - ClientData clientData)); -/* 100 */ -EXTERN void Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp * interp, - char * name)); -/* 101 */ -EXTERN void Tcl_DeleteChannelHandler _ANSI_ARGS_(( - Tcl_Channel chan, Tcl_ChannelProc * proc, - ClientData clientData)); -/* 102 */ -EXTERN void Tcl_DeleteCloseHandler _ANSI_ARGS_((Tcl_Channel chan, - Tcl_CloseProc * proc, ClientData clientData)); -/* 103 */ -EXTERN int Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp * interp, - char * cmdName)); -/* 104 */ -EXTERN int Tcl_DeleteCommandFromToken _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Command command)); -/* 105 */ -EXTERN void Tcl_DeleteEvents _ANSI_ARGS_(( - Tcl_EventDeleteProc * proc, - ClientData clientData)); -/* 106 */ -EXTERN void Tcl_DeleteEventSource _ANSI_ARGS_(( - Tcl_EventSetupProc * setupProc, - Tcl_EventCheckProc * checkProc, - ClientData clientData)); -/* 107 */ -EXTERN void Tcl_DeleteExitHandler _ANSI_ARGS_(( - Tcl_ExitProc * proc, ClientData clientData)); -/* 108 */ -EXTERN void Tcl_DeleteHashEntry _ANSI_ARGS_(( - Tcl_HashEntry * entryPtr)); -/* 109 */ -EXTERN void Tcl_DeleteHashTable _ANSI_ARGS_(( - Tcl_HashTable * tablePtr)); -/* 110 */ -EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp * interp)); -/* 111 */ -EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, - Tcl_Pid * pidPtr)); -/* 112 */ -EXTERN void Tcl_DeleteTimerHandler _ANSI_ARGS_(( - Tcl_TimerToken token)); -/* 113 */ -EXTERN void Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Trace trace)); -/* 114 */ -EXTERN void Tcl_DontCallWhenDeleted _ANSI_ARGS_(( - Tcl_Interp * interp, - Tcl_InterpDeleteProc * proc, - ClientData clientData)); -/* 115 */ -EXTERN int Tcl_DoOneEvent _ANSI_ARGS_((int flags)); -/* 116 */ -EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc * proc, - ClientData clientData)); -/* 117 */ -EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString * dsPtr, - CONST char * str, int length)); -/* 118 */ -EXTERN char * Tcl_DStringAppendElement _ANSI_ARGS_(( - Tcl_DString * dsPtr, CONST char * string)); -/* 119 */ -EXTERN void Tcl_DStringEndSublist _ANSI_ARGS_(( - Tcl_DString * dsPtr)); -/* 120 */ -EXTERN void Tcl_DStringFree _ANSI_ARGS_((Tcl_DString * dsPtr)); -/* 121 */ -EXTERN void Tcl_DStringGetResult _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_DString * dsPtr)); -/* 122 */ -EXTERN void Tcl_DStringInit _ANSI_ARGS_((Tcl_DString * dsPtr)); -/* 123 */ -EXTERN void Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_DString * dsPtr)); -/* 124 */ -EXTERN void Tcl_DStringSetLength _ANSI_ARGS_(( - Tcl_DString * dsPtr, int length)); -/* 125 */ -EXTERN void Tcl_DStringStartSublist _ANSI_ARGS_(( - Tcl_DString * dsPtr)); -/* 126 */ -EXTERN int Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan)); -/* 127 */ -EXTERN char * Tcl_ErrnoId _ANSI_ARGS_((void)); -/* 128 */ -EXTERN char * Tcl_ErrnoMsg _ANSI_ARGS_((int err)); -/* 129 */ -EXTERN int Tcl_Eval _ANSI_ARGS_((Tcl_Interp * interp, - char * string)); -/* 130 */ -EXTERN int Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp * interp, - char * fileName)); -/* 131 */ -EXTERN int Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr)); -/* 132 */ -EXTERN void Tcl_EventuallyFree _ANSI_ARGS_(( - ClientData clientData, - Tcl_FreeProc * freeProc)); -/* 133 */ -EXTERN void Tcl_Exit _ANSI_ARGS_((int status)); -/* 134 */ -EXTERN int Tcl_ExposeCommand _ANSI_ARGS_((Tcl_Interp * interp, - char * hiddenCmdToken, char * cmdName)); -/* 135 */ -EXTERN int Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp * interp, - char * str, int * ptr)); -/* 136 */ -EXTERN int Tcl_ExprBooleanObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int * ptr)); -/* 137 */ -EXTERN int Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp * interp, - char * str, double * ptr)); -/* 138 */ -EXTERN int Tcl_ExprDoubleObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, double * ptr)); -/* 139 */ -EXTERN int Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp * interp, - char * str, long * ptr)); -/* 140 */ -EXTERN int Tcl_ExprLongObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, long * ptr)); -/* 141 */ -EXTERN int Tcl_ExprObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, Tcl_Obj ** resultPtrPtr)); -/* 142 */ -EXTERN int Tcl_ExprString _ANSI_ARGS_((Tcl_Interp * interp, - char * string)); -/* 143 */ -EXTERN void Tcl_Finalize _ANSI_ARGS_((void)); -/* 144 */ -EXTERN void Tcl_FindExecutable _ANSI_ARGS_((CONST char * argv0)); -/* 145 */ -EXTERN Tcl_HashEntry * Tcl_FirstHashEntry _ANSI_ARGS_(( - Tcl_HashTable * tablePtr, - Tcl_HashSearch * searchPtr)); -/* 146 */ -EXTERN int Tcl_Flush _ANSI_ARGS_((Tcl_Channel chan)); -/* 147 */ -EXTERN void Tcl_FreeResult _ANSI_ARGS_((Tcl_Interp * interp)); -/* 148 */ -EXTERN int Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp * interp, - char * slaveCmd, - Tcl_Interp ** targetInterpPtr, - char ** targetCmdPtr, int * argcPtr, - char *** argvPtr)); -/* 149 */ -EXTERN int Tcl_GetAliasObj _ANSI_ARGS_((Tcl_Interp * interp, - char * slaveCmd, - Tcl_Interp ** targetInterpPtr, - char ** targetCmdPtr, int * objcPtr, - Tcl_Obj *** objv)); -/* 150 */ -EXTERN ClientData Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp * interp, - char * name, Tcl_InterpDeleteProc ** procPtr)); -/* 151 */ -EXTERN Tcl_Channel Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp * interp, - char * chanName, int * modePtr)); -/* 152 */ -EXTERN int Tcl_GetChannelBufferSize _ANSI_ARGS_(( - Tcl_Channel chan)); -/* 153 */ -EXTERN int Tcl_GetChannelHandle _ANSI_ARGS_((Tcl_Channel chan, - int direction, ClientData * handlePtr)); -/* 154 */ -EXTERN ClientData Tcl_GetChannelInstanceData _ANSI_ARGS_(( - Tcl_Channel chan)); -/* 155 */ -EXTERN int Tcl_GetChannelMode _ANSI_ARGS_((Tcl_Channel chan)); -/* 156 */ -EXTERN char * Tcl_GetChannelName _ANSI_ARGS_((Tcl_Channel chan)); -/* 157 */ -EXTERN int Tcl_GetChannelOption _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Channel chan, - char * optionName, Tcl_DString * dsPtr)); -/* 158 */ -EXTERN Tcl_ChannelType * Tcl_GetChannelType _ANSI_ARGS_((Tcl_Channel chan)); -/* 159 */ -EXTERN int Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp * interp, - char * cmdName, Tcl_CmdInfo * infoPtr)); -/* 160 */ -EXTERN char * Tcl_GetCommandName _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Command command)); -/* 161 */ -EXTERN int Tcl_GetErrno _ANSI_ARGS_((void)); -/* 162 */ -EXTERN char * Tcl_GetHostName _ANSI_ARGS_((void)); -/* 163 */ -EXTERN int Tcl_GetInterpPath _ANSI_ARGS_(( - Tcl_Interp * askInterp, - Tcl_Interp * slaveInterp)); -/* 164 */ -EXTERN Tcl_Interp * Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp * interp)); -/* 165 */ -EXTERN CONST char * Tcl_GetNameOfExecutable _ANSI_ARGS_((void)); -/* 166 */ -EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp * interp)); -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* 167 */ -EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp * interp, - char * str, int write, int checkUsage, - ClientData * filePtr)); -#endif /* UNIX */ -/* 168 */ -EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((char * path)); -/* 169 */ -EXTERN int Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan, - Tcl_DString * dsPtr)); -/* 170 */ -EXTERN int Tcl_GetsObj _ANSI_ARGS_((Tcl_Channel chan, - Tcl_Obj * objPtr)); -/* 171 */ -EXTERN int Tcl_GetServiceMode _ANSI_ARGS_((void)); -/* 172 */ -EXTERN Tcl_Interp * Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp * interp, - char * slaveName)); -/* 173 */ -EXTERN Tcl_Channel Tcl_GetStdChannel _ANSI_ARGS_((int type)); -/* 174 */ -EXTERN char * Tcl_GetStringResult _ANSI_ARGS_((Tcl_Interp * interp)); -/* 175 */ -EXTERN char * Tcl_GetVar _ANSI_ARGS_((Tcl_Interp * interp, - char * varName, int flags)); -/* 176 */ -EXTERN char * Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags)); -/* 177 */ -EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp * interp, - char * command)); -/* 178 */ -EXTERN int Tcl_GlobalEvalObj _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr)); -/* 179 */ -EXTERN int Tcl_HideCommand _ANSI_ARGS_((Tcl_Interp * interp, - char * cmdName, char * hiddenCmdToken)); -/* 180 */ -EXTERN int Tcl_Init _ANSI_ARGS_((Tcl_Interp * interp)); -/* 181 */ -EXTERN void Tcl_InitHashTable _ANSI_ARGS_(( - Tcl_HashTable * tablePtr, int keyType)); -/* 182 */ -EXTERN int Tcl_InputBlocked _ANSI_ARGS_((Tcl_Channel chan)); -/* 183 */ -EXTERN int Tcl_InputBuffered _ANSI_ARGS_((Tcl_Channel chan)); -/* 184 */ -EXTERN int Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp * interp)); -/* 185 */ -EXTERN int Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp * interp)); -/* 186 */ -EXTERN char * Tcl_JoinPath _ANSI_ARGS_((int argc, char ** argv, - Tcl_DString * resultPtr)); -/* 187 */ -EXTERN int Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp * interp, - char * varName, char * addr, int type)); -/* Slot 188 is reserved */ -/* 189 */ -EXTERN Tcl_Channel Tcl_MakeFileChannel _ANSI_ARGS_((ClientData handle, - int mode)); -/* 190 */ -EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp * interp)); -/* 191 */ -EXTERN Tcl_Channel Tcl_MakeTcpClientChannel _ANSI_ARGS_(( - ClientData tcpSocket)); -/* 192 */ -EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, char ** argv)); -/* 193 */ -EXTERN Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_(( - Tcl_HashSearch * searchPtr)); -/* 194 */ -EXTERN void Tcl_NotifyChannel _ANSI_ARGS_((Tcl_Channel channel, - int mask)); -/* 195 */ -EXTERN Tcl_Obj * Tcl_ObjGetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, - int flags)); -/* 196 */ -EXTERN Tcl_Obj * Tcl_ObjSetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, - Tcl_Obj * newValuePtr, int flags)); -/* 197 */ -EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_(( - Tcl_Interp * interp, int argc, char ** argv, - int flags)); -/* 198 */ -EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp * interp, - char * fileName, char * modeString, - int permissions)); -/* 199 */ -EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp * interp, - int port, char * address, char * myaddr, - int myport, int async)); -/* 200 */ -EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp * interp, - int port, char * host, - Tcl_TcpAcceptProc * acceptProc, - ClientData callbackData)); -/* 201 */ -EXTERN void Tcl_Preserve _ANSI_ARGS_((ClientData data)); -/* 202 */ -EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp * interp, - double value, char * dst)); -/* 203 */ -EXTERN int Tcl_PutEnv _ANSI_ARGS_((CONST char * string)); -/* 204 */ -EXTERN char * Tcl_PosixError _ANSI_ARGS_((Tcl_Interp * interp)); -/* 205 */ -EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event * evPtr, - Tcl_QueuePosition position)); -/* 206 */ -EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan, - char * bufPtr, int toRead)); -/* 207 */ -EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void)); -/* 208 */ -EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp * interp, - char * cmd, int flags)); -/* 209 */ -EXTERN int Tcl_RecordAndEvalObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * cmdPtr, - int flags)); -/* 210 */ -EXTERN void Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Channel chan)); -/* 211 */ -EXTERN void Tcl_RegisterObjType _ANSI_ARGS_(( - Tcl_ObjType * typePtr)); -/* 212 */ -EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp * interp, - char * string)); -/* 213 */ -EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_RegExp regexp, CONST char * str, - CONST char * start)); -/* 214 */ -EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp * interp, - char * str, char * pattern)); -/* 215 */ -EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp, - int index, char ** startPtr, char ** endPtr)); -/* 216 */ -EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData)); -/* 217 */ -EXTERN void Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp * interp)); -/* 218 */ -EXTERN int Tcl_ScanElement _ANSI_ARGS_((CONST char * str, - int * flagPtr)); -/* 219 */ -EXTERN int Tcl_ScanCountedElement _ANSI_ARGS_((CONST char * str, - int length, int * flagPtr)); -/* 220 */ -EXTERN int Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan, int offset, - int mode)); -/* 221 */ -EXTERN int Tcl_ServiceAll _ANSI_ARGS_((void)); -/* 222 */ -EXTERN int Tcl_ServiceEvent _ANSI_ARGS_((int flags)); -/* 223 */ -EXTERN void Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp * interp, - char * name, Tcl_InterpDeleteProc * proc, - ClientData clientData)); -/* 224 */ -EXTERN void Tcl_SetChannelBufferSize _ANSI_ARGS_(( - Tcl_Channel chan, int sz)); -/* 225 */ -EXTERN int Tcl_SetChannelOption _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Channel chan, - char * optionName, char * newValue)); -/* 226 */ -EXTERN int Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp * interp, - char * cmdName, Tcl_CmdInfo * infoPtr)); -/* 227 */ -EXTERN void Tcl_SetErrno _ANSI_ARGS_((int err)); -/* 228 */ -EXTERN void Tcl_SetErrorCode _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); -/* 229 */ -EXTERN void Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time * timePtr)); -/* 230 */ -EXTERN void Tcl_SetPanicProc _ANSI_ARGS_(( - Tcl_PanicProc * panicProc)); -/* 231 */ -EXTERN int Tcl_SetRecursionLimit _ANSI_ARGS_(( - Tcl_Interp * interp, int depth)); -/* 232 */ -EXTERN void Tcl_SetResult _ANSI_ARGS_((Tcl_Interp * interp, - char * str, Tcl_FreeProc * freeProc)); -/* 233 */ -EXTERN int Tcl_SetServiceMode _ANSI_ARGS_((int mode)); -/* 234 */ -EXTERN void Tcl_SetObjErrorCode _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * errorObjPtr)); -/* 235 */ -EXTERN void Tcl_SetObjResult _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * resultObjPtr)); -/* 236 */ -EXTERN void Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel, - int type)); -/* 237 */ -EXTERN char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp * interp, - char * varName, char * newValue, int flags)); -/* 238 */ -EXTERN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, char * newValue, - int flags)); -/* 239 */ -EXTERN char * Tcl_SignalId _ANSI_ARGS_((int sig)); -/* 240 */ -EXTERN char * Tcl_SignalMsg _ANSI_ARGS_((int sig)); -/* 241 */ -EXTERN void Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp * interp)); -/* 242 */ -EXTERN int Tcl_SplitList _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * listStr, int * argcPtr, - char *** argvPtr)); -/* 243 */ -EXTERN void Tcl_SplitPath _ANSI_ARGS_((CONST char * path, - int * argcPtr, char *** argvPtr)); -/* 244 */ -EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp * interp, - char * pkgName, - Tcl_PackageInitProc * initProc, - Tcl_PackageInitProc * safeInitProc)); -/* 245 */ -EXTERN int Tcl_StringMatch _ANSI_ARGS_((CONST char * str, - CONST char * pattern)); -/* 246 */ -EXTERN int Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan)); -/* 247 */ -EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp * interp, - char * varName, int flags, - Tcl_VarTraceProc * proc, - ClientData clientData)); -/* 248 */ -EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags, - Tcl_VarTraceProc * proc, - ClientData clientData)); -/* 249 */ -EXTERN char * Tcl_TranslateFileName _ANSI_ARGS_(( - Tcl_Interp * interp, char * name, - Tcl_DString * bufferPtr)); -/* 250 */ -EXTERN int Tcl_Ungets _ANSI_ARGS_((Tcl_Channel chan, char * str, - int len, int atHead)); -/* 251 */ -EXTERN void Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp * interp, - char * varName)); -/* 252 */ -EXTERN int Tcl_UnregisterChannel _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Channel chan)); -/* 253 */ -EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp * interp, - char * varName, int flags)); -/* 254 */ -EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags)); -/* 255 */ -EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp * interp, - char * varName, int flags, - Tcl_VarTraceProc * proc, - ClientData clientData)); -/* 256 */ -EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags, - Tcl_VarTraceProc * proc, - ClientData clientData)); -/* 257 */ -EXTERN void Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp * interp, - char * varName)); -/* 258 */ -EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp * interp, - char * frameName, char * varName, - char * localName, int flags)); -/* 259 */ -EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp * interp, - char * frameName, char * part1, char * part2, - char * localName, int flags)); -/* 260 */ -EXTERN int Tcl_VarEval _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); -/* 261 */ -EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp * interp, - char * varName, int flags, - Tcl_VarTraceProc * procPtr, - ClientData prevClientData)); -/* 262 */ -EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags, - Tcl_VarTraceProc * procPtr, - ClientData prevClientData)); -/* 263 */ -EXTERN int Tcl_Write _ANSI_ARGS_((Tcl_Channel chan, char * s, - int slen)); -/* 264 */ -EXTERN void Tcl_WrongNumArgs _ANSI_ARGS_((Tcl_Interp * interp, - int objc, Tcl_Obj *CONST objv[], - char * message)); -/* 265 */ -EXTERN int Tcl_DumpActiveMemory _ANSI_ARGS_((char * fileName)); -/* 266 */ -EXTERN void Tcl_ValidateAllMemory _ANSI_ARGS_((char * file, - int line)); -/* 267 */ -EXTERN void Tcl_AppendResultVA _ANSI_ARGS_((Tcl_Interp * interp, - va_list argList)); -/* 268 */ -EXTERN void Tcl_AppendStringsToObjVA _ANSI_ARGS_(( - Tcl_Obj * objPtr, va_list argList)); -/* 269 */ -EXTERN char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable * tablePtr)); -/* 270 */ -EXTERN char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp * interp, - char * str, char ** termPtr)); -/* 271 */ -EXTERN char * Tcl_PkgPresent _ANSI_ARGS_((Tcl_Interp * interp, - char * name, char * version, int exact)); -/* 272 */ -EXTERN char * Tcl_PkgPresentEx _ANSI_ARGS_((Tcl_Interp * interp, - char * name, char * version, int exact, - ClientData * clientDataPtr)); -/* 273 */ -EXTERN int Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp * interp, - char * name, char * version)); -/* 274 */ -EXTERN char * Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp * interp, - char * name, char * version, int exact)); -/* 275 */ -EXTERN void Tcl_SetErrorCodeVA _ANSI_ARGS_((Tcl_Interp * interp, - va_list argList)); -/* 276 */ -EXTERN int Tcl_VarEvalVA _ANSI_ARGS_((Tcl_Interp * interp, - va_list argList)); -/* 277 */ -EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int * statPtr, - int options)); -/* 278 */ -EXTERN void Tcl_PanicVA _ANSI_ARGS_((char * format, - va_list argList)); -/* 279 */ -EXTERN void Tcl_GetVersion _ANSI_ARGS_((int * major, int * minor, - int * patchLevel, int * type)); -/* 280 */ -EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp * interp)); -/* Slot 281 is reserved */ -/* Slot 282 is reserved */ -/* Slot 283 is reserved */ -/* Slot 284 is reserved */ -/* Slot 285 is reserved */ -/* 286 */ -EXTERN void Tcl_AppendObjToObj _ANSI_ARGS_((Tcl_Obj * objPtr, - Tcl_Obj * appendObjPtr)); -/* 287 */ -EXTERN Tcl_Encoding Tcl_CreateEncoding _ANSI_ARGS_(( - Tcl_EncodingType * typePtr)); -/* 288 */ -EXTERN void Tcl_CreateThreadExitHandler _ANSI_ARGS_(( - Tcl_ExitProc * proc, ClientData clientData)); -/* 289 */ -EXTERN void Tcl_DeleteThreadExitHandler _ANSI_ARGS_(( - Tcl_ExitProc * proc, ClientData clientData)); -/* 290 */ -EXTERN void Tcl_DiscardResult _ANSI_ARGS_(( - Tcl_SavedResult * statePtr)); -/* 291 */ -EXTERN int Tcl_EvalEx _ANSI_ARGS_((Tcl_Interp * interp, - char * script, int numBytes, int flags)); -/* 292 */ -EXTERN int Tcl_EvalObjv _ANSI_ARGS_((Tcl_Interp * interp, - int objc, Tcl_Obj *CONST objv[], int flags)); -/* 293 */ -EXTERN int Tcl_EvalObjEx _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int flags)); -/* 294 */ -EXTERN void Tcl_ExitThread _ANSI_ARGS_((int status)); -/* 295 */ -EXTERN int Tcl_ExternalToUtf _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Encoding encoding, CONST char * src, - int srcLen, int flags, - Tcl_EncodingState * statePtr, char * dst, - int dstLen, int * srcReadPtr, - int * dstWrotePtr, int * dstCharsPtr)); -/* 296 */ -EXTERN char * Tcl_ExternalToUtfDString _ANSI_ARGS_(( - Tcl_Encoding encoding, CONST char * src, - int srcLen, Tcl_DString * dsPtr)); -/* 297 */ -EXTERN void Tcl_FinalizeThread _ANSI_ARGS_((void)); -/* 298 */ -EXTERN void Tcl_FinalizeNotifier _ANSI_ARGS_(( - ClientData clientData)); -/* 299 */ -EXTERN void Tcl_FreeEncoding _ANSI_ARGS_((Tcl_Encoding encoding)); -/* 300 */ -EXTERN Tcl_ThreadId Tcl_GetCurrentThread _ANSI_ARGS_((void)); -/* 301 */ -EXTERN Tcl_Encoding Tcl_GetEncoding _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * name)); -/* 302 */ -EXTERN char * Tcl_GetEncodingName _ANSI_ARGS_(( - Tcl_Encoding encoding)); -/* 303 */ -EXTERN void Tcl_GetEncodingNames _ANSI_ARGS_(( - Tcl_Interp * interp)); -/* 304 */ -EXTERN int Tcl_GetIndexFromObjStruct _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - char ** tablePtr, int offset, char * msg, - int flags, int * indexPtr)); -/* 305 */ -EXTERN VOID * Tcl_GetThreadData _ANSI_ARGS_(( - Tcl_ThreadDataKey * keyPtr, int size)); -/* 306 */ -EXTERN Tcl_Obj * Tcl_GetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags)); -/* 307 */ -EXTERN ClientData Tcl_InitNotifier _ANSI_ARGS_((void)); -/* 308 */ -EXTERN void Tcl_MutexLock _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); -/* 309 */ -EXTERN void Tcl_MutexUnlock _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); -/* 310 */ -EXTERN void Tcl_ConditionNotify _ANSI_ARGS_(( - Tcl_Condition * condPtr)); -/* 311 */ -EXTERN void Tcl_ConditionWait _ANSI_ARGS_(( - Tcl_Condition * condPtr, - Tcl_Mutex * mutexPtr, Tcl_Time * timePtr)); -/* 312 */ -EXTERN int Tcl_NumUtfChars _ANSI_ARGS_((CONST char * src, - int len)); -/* 313 */ -EXTERN int Tcl_ReadChars _ANSI_ARGS_((Tcl_Channel channel, - Tcl_Obj * objPtr, int charsToRead, - int appendFlag)); -/* 314 */ -EXTERN void Tcl_RestoreResult _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_SavedResult * statePtr)); -/* 315 */ -EXTERN void Tcl_SaveResult _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_SavedResult * statePtr)); -/* 316 */ -EXTERN int Tcl_SetSystemEncoding _ANSI_ARGS_(( - Tcl_Interp * interp, CONST char * name)); -/* 317 */ -EXTERN Tcl_Obj * Tcl_SetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, - Tcl_Obj * newValuePtr, int flags)); -/* 318 */ -EXTERN void Tcl_ThreadAlert _ANSI_ARGS_((Tcl_ThreadId threadId)); -/* 319 */ -EXTERN void Tcl_ThreadQueueEvent _ANSI_ARGS_(( - Tcl_ThreadId threadId, Tcl_Event* evPtr, - Tcl_QueuePosition position)); -/* 320 */ -EXTERN Tcl_UniChar Tcl_UniCharAtIndex _ANSI_ARGS_((CONST char * src, - int index)); -/* 321 */ -EXTERN Tcl_UniChar Tcl_UniCharToLower _ANSI_ARGS_((int ch)); -/* 322 */ -EXTERN Tcl_UniChar Tcl_UniCharToTitle _ANSI_ARGS_((int ch)); -/* 323 */ -EXTERN Tcl_UniChar Tcl_UniCharToUpper _ANSI_ARGS_((int ch)); -/* 324 */ -EXTERN int Tcl_UniCharToUtf _ANSI_ARGS_((int ch, char * buf)); -/* 325 */ -EXTERN char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char * src, - int index)); -/* 326 */ -EXTERN int Tcl_UtfCharComplete _ANSI_ARGS_((CONST char * src, - int len)); -/* 327 */ -EXTERN int Tcl_UtfBackslash _ANSI_ARGS_((CONST char * src, - int * readPtr, char * dst)); -/* 328 */ -EXTERN char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char * src, - int ch)); -/* 329 */ -EXTERN char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char * src, - int ch)); -/* 330 */ -EXTERN char * Tcl_UtfNext _ANSI_ARGS_((CONST char * src)); -/* 331 */ -EXTERN char * Tcl_UtfPrev _ANSI_ARGS_((CONST char * src, - CONST char * start)); -/* 332 */ -EXTERN int Tcl_UtfToExternal _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Encoding encoding, CONST char * src, - int srcLen, int flags, - Tcl_EncodingState * statePtr, char * dst, - int dstLen, int * srcReadPtr, - int * dstWrotePtr, int * dstCharsPtr)); -/* 333 */ -EXTERN char * Tcl_UtfToExternalDString _ANSI_ARGS_(( - Tcl_Encoding encoding, CONST char * src, - int srcLen, Tcl_DString * dsPtr)); -/* 334 */ -EXTERN int Tcl_UtfToLower _ANSI_ARGS_((char * src)); -/* 335 */ -EXTERN int Tcl_UtfToTitle _ANSI_ARGS_((char * src)); -/* 336 */ -EXTERN int Tcl_UtfToUniChar _ANSI_ARGS_((CONST char * src, - Tcl_UniChar * chPtr)); -/* 337 */ -EXTERN int Tcl_UtfToUpper _ANSI_ARGS_((char * src)); -/* 338 */ -EXTERN int Tcl_WriteChars _ANSI_ARGS_((Tcl_Channel chan, - CONST char * src, int srcLen)); -/* 339 */ -EXTERN int Tcl_WriteObj _ANSI_ARGS_((Tcl_Channel chan, - Tcl_Obj * objPtr)); -/* 340 */ -EXTERN char * Tcl_GetString _ANSI_ARGS_((Tcl_Obj * objPtr)); -/* 341 */ -EXTERN char * Tcl_GetDefaultEncodingDir _ANSI_ARGS_((void)); -/* 342 */ -EXTERN void Tcl_SetDefaultEncodingDir _ANSI_ARGS_((char * path)); -/* 343 */ -EXTERN void Tcl_AlertNotifier _ANSI_ARGS_((ClientData clientData)); -/* 344 */ -EXTERN void Tcl_ServiceModeHook _ANSI_ARGS_((int mode)); -/* 345 */ -EXTERN int Tcl_UniCharIsAlnum _ANSI_ARGS_((int ch)); -/* 346 */ -EXTERN int Tcl_UniCharIsAlpha _ANSI_ARGS_((int ch)); -/* 347 */ -EXTERN int Tcl_UniCharIsDigit _ANSI_ARGS_((int ch)); -/* 348 */ -EXTERN int Tcl_UniCharIsLower _ANSI_ARGS_((int ch)); -/* 349 */ -EXTERN int Tcl_UniCharIsSpace _ANSI_ARGS_((int ch)); -/* 350 */ -EXTERN int Tcl_UniCharIsUpper _ANSI_ARGS_((int ch)); -/* 351 */ -EXTERN int Tcl_UniCharIsWordChar _ANSI_ARGS_((int ch)); -/* 352 */ -EXTERN int Tcl_UniCharLen _ANSI_ARGS_((Tcl_UniChar * str)); -/* 353 */ -EXTERN int Tcl_UniCharNcmp _ANSI_ARGS_((const Tcl_UniChar * cs, - const Tcl_UniChar * ct, size_t n)); -/* 354 */ -EXTERN char * Tcl_UniCharToUtfDString _ANSI_ARGS_(( - CONST Tcl_UniChar * string, int numChars, - Tcl_DString * dsPtr)); -/* 355 */ -EXTERN Tcl_UniChar * Tcl_UtfToUniCharDString _ANSI_ARGS_(( - CONST char * string, int length, - Tcl_DString * dsPtr)); -/* 356 */ -EXTERN Tcl_RegExp Tcl_GetRegExpFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * patObj, - int flags)); -/* 357 */ -EXTERN Tcl_Obj * Tcl_EvalTokens _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Token * tokenPtr, int count)); -/* 358 */ -EXTERN void Tcl_FreeParse _ANSI_ARGS_((Tcl_Parse * parsePtr)); -/* 359 */ -EXTERN void Tcl_LogCommandInfo _ANSI_ARGS_((Tcl_Interp * interp, - char * script, char * command, int length)); -/* 360 */ -EXTERN int Tcl_ParseBraces _ANSI_ARGS_((Tcl_Interp * interp, - char * string, int numBytes, - Tcl_Parse * parsePtr, int append, - char ** termPtr)); -/* 361 */ -EXTERN int Tcl_ParseCommand _ANSI_ARGS_((Tcl_Interp * interp, - char * string, int numBytes, int nested, - Tcl_Parse * parsePtr)); -/* 362 */ -EXTERN int Tcl_ParseExpr _ANSI_ARGS_((Tcl_Interp * interp, - char * string, int numBytes, - Tcl_Parse * parsePtr)); -/* 363 */ -EXTERN int Tcl_ParseQuotedString _ANSI_ARGS_(( - Tcl_Interp * interp, char * string, - int numBytes, Tcl_Parse * parsePtr, - int append, char ** termPtr)); -/* 364 */ -EXTERN int Tcl_ParseVarName _ANSI_ARGS_((Tcl_Interp * interp, - char * string, int numBytes, - Tcl_Parse * parsePtr, int append)); -/* 365 */ -EXTERN char * Tcl_GetCwd _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_DString * cwdPtr)); -/* 366 */ -EXTERN int Tcl_Chdir _ANSI_ARGS_((CONST char * dirName)); - -typedef struct TclStubHooks { - struct TclPlatStubs *tclPlatStubs; - struct TclIntStubs *tclIntStubs; - struct TclIntPlatStubs *tclIntPlatStubs; -} TclStubHooks; - -typedef struct TclStubs { - int magic; - struct TclStubHooks *hooks; - - int (*tcl_PkgProvideEx) _ANSI_ARGS_((Tcl_Interp * interp, char * name, char * version, ClientData clientData)); /* 0 */ - char * (*tcl_PkgRequireEx) _ANSI_ARGS_((Tcl_Interp * interp, char * name, char * version, int exact, ClientData * clientDataPtr)); /* 1 */ - void (*tcl_Panic) _ANSI_ARGS_(TCL_VARARGS(char *,format)); /* 2 */ - char * (*tcl_Alloc) _ANSI_ARGS_((unsigned int size)); /* 3 */ - void (*tcl_Free) _ANSI_ARGS_((char * ptr)); /* 4 */ - char * (*tcl_Realloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 5 */ - char * (*tcl_DbCkalloc) _ANSI_ARGS_((unsigned int size, char * file, int line)); /* 6 */ - int (*tcl_DbCkfree) _ANSI_ARGS_((char * ptr, char * file, int line)); /* 7 */ - char * (*tcl_DbCkrealloc) _ANSI_ARGS_((char * ptr, unsigned int size, char * file, int line)); /* 8 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - void (*tcl_CreateFileHandler) _ANSI_ARGS_((int fd, int mask, Tcl_FileProc * proc, ClientData clientData)); /* 9 */ -#endif /* UNIX */ -#ifdef __WIN32__ - void *reserved9; -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved9; -#endif /* MAC_TCL */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - void (*tcl_DeleteFileHandler) _ANSI_ARGS_((int fd)); /* 10 */ -#endif /* UNIX */ -#ifdef __WIN32__ - void *reserved10; -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved10; -#endif /* MAC_TCL */ - void (*tcl_SetTimer) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 11 */ - void (*tcl_Sleep) _ANSI_ARGS_((int ms)); /* 12 */ - int (*tcl_WaitForEvent) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 13 */ - int (*tcl_AppendAllObjTypes) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 14 */ - void (*tcl_AppendStringsToObj) _ANSI_ARGS_(TCL_VARARGS(Tcl_Obj *,objPtr)); /* 15 */ - void (*tcl_AppendToObj) _ANSI_ARGS_((Tcl_Obj * objPtr, char * bytes, int length)); /* 16 */ - Tcl_Obj * (*tcl_ConcatObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 17 */ - int (*tcl_ConvertToType) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tcl_ObjType * typePtr)); /* 18 */ - void (*tcl_DbDecrRefCount) _ANSI_ARGS_((Tcl_Obj * objPtr, char * file, int line)); /* 19 */ - void (*tcl_DbIncrRefCount) _ANSI_ARGS_((Tcl_Obj * objPtr, char * file, int line)); /* 20 */ - int (*tcl_DbIsShared) _ANSI_ARGS_((Tcl_Obj * objPtr, char * file, int line)); /* 21 */ - Tcl_Obj * (*tcl_DbNewBooleanObj) _ANSI_ARGS_((int boolValue, char * file, int line)); /* 22 */ - Tcl_Obj * (*tcl_DbNewByteArrayObj) _ANSI_ARGS_((unsigned char * bytes, int length, char * file, int line)); /* 23 */ - Tcl_Obj * (*tcl_DbNewDoubleObj) _ANSI_ARGS_((double doubleValue, char * file, int line)); /* 24 */ - Tcl_Obj * (*tcl_DbNewListObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[], char * file, int line)); /* 25 */ - Tcl_Obj * (*tcl_DbNewLongObj) _ANSI_ARGS_((long longValue, char * file, int line)); /* 26 */ - Tcl_Obj * (*tcl_DbNewObj) _ANSI_ARGS_((char * file, int line)); /* 27 */ - Tcl_Obj * (*tcl_DbNewStringObj) _ANSI_ARGS_((CONST char * bytes, int length, char * file, int line)); /* 28 */ - Tcl_Obj * (*tcl_DuplicateObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 29 */ - void (*tclFreeObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 30 */ - int (*tcl_GetBoolean) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * boolPtr)); /* 31 */ - int (*tcl_GetBooleanFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * boolPtr)); /* 32 */ - unsigned char * (*tcl_GetByteArrayFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 33 */ - int (*tcl_GetDouble) _ANSI_ARGS_((Tcl_Interp * interp, char * str, double * doublePtr)); /* 34 */ - int (*tcl_GetDoubleFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, double * doublePtr)); /* 35 */ - int (*tcl_GetIndexFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, char ** tablePtr, char * msg, int flags, int * indexPtr)); /* 36 */ - int (*tcl_GetInt) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * intPtr)); /* 37 */ - int (*tcl_GetIntFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * intPtr)); /* 38 */ - int (*tcl_GetLongFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, long * longPtr)); /* 39 */ - Tcl_ObjType * (*tcl_GetObjType) _ANSI_ARGS_((char * typeName)); /* 40 */ - char * (*tcl_GetStringFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 41 */ - void (*tcl_InvalidateStringRep) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 42 */ - int (*tcl_ListObjAppendList) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, Tcl_Obj * elemListPtr)); /* 43 */ - int (*tcl_ListObjAppendElement) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, Tcl_Obj * objPtr)); /* 44 */ - int (*tcl_ListObjGetElements) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int * objcPtr, Tcl_Obj *** objvPtr)); /* 45 */ - int (*tcl_ListObjIndex) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int index, Tcl_Obj ** objPtrPtr)); /* 46 */ - int (*tcl_ListObjLength) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int * intPtr)); /* 47 */ - int (*tcl_ListObjReplace) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int first, int count, int objc, Tcl_Obj *CONST objv[])); /* 48 */ - Tcl_Obj * (*tcl_NewBooleanObj) _ANSI_ARGS_((int boolValue)); /* 49 */ - Tcl_Obj * (*tcl_NewByteArrayObj) _ANSI_ARGS_((unsigned char * bytes, int length)); /* 50 */ - Tcl_Obj * (*tcl_NewDoubleObj) _ANSI_ARGS_((double doubleValue)); /* 51 */ - Tcl_Obj * (*tcl_NewIntObj) _ANSI_ARGS_((int intValue)); /* 52 */ - Tcl_Obj * (*tcl_NewListObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 53 */ - Tcl_Obj * (*tcl_NewLongObj) _ANSI_ARGS_((long longValue)); /* 54 */ - Tcl_Obj * (*tcl_NewObj) _ANSI_ARGS_((void)); /* 55 */ - Tcl_Obj * (*tcl_NewStringObj) _ANSI_ARGS_((CONST char * bytes, int length)); /* 56 */ - void (*tcl_SetBooleanObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int boolValue)); /* 57 */ - unsigned char * (*tcl_SetByteArrayLength) _ANSI_ARGS_((Tcl_Obj * objPtr, int length)); /* 58 */ - void (*tcl_SetByteArrayObj) _ANSI_ARGS_((Tcl_Obj * objPtr, unsigned char * bytes, int length)); /* 59 */ - void (*tcl_SetDoubleObj) _ANSI_ARGS_((Tcl_Obj * objPtr, double doubleValue)); /* 60 */ - void (*tcl_SetIntObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int intValue)); /* 61 */ - void (*tcl_SetListObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int objc, Tcl_Obj *CONST objv[])); /* 62 */ - void (*tcl_SetLongObj) _ANSI_ARGS_((Tcl_Obj * objPtr, long longValue)); /* 63 */ - void (*tcl_SetObjLength) _ANSI_ARGS_((Tcl_Obj * objPtr, int length)); /* 64 */ - void (*tcl_SetStringObj) _ANSI_ARGS_((Tcl_Obj * objPtr, char * bytes, int length)); /* 65 */ - void (*tcl_AddErrorInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * message)); /* 66 */ - void (*tcl_AddObjErrorInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * message, int length)); /* 67 */ - void (*tcl_AllowExceptions) _ANSI_ARGS_((Tcl_Interp * interp)); /* 68 */ - void (*tcl_AppendElement) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string)); /* 69 */ - void (*tcl_AppendResult) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 70 */ - Tcl_AsyncHandler (*tcl_AsyncCreate) _ANSI_ARGS_((Tcl_AsyncProc * proc, ClientData clientData)); /* 71 */ - void (*tcl_AsyncDelete) _ANSI_ARGS_((Tcl_AsyncHandler async)); /* 72 */ - int (*tcl_AsyncInvoke) _ANSI_ARGS_((Tcl_Interp * interp, int code)); /* 73 */ - void (*tcl_AsyncMark) _ANSI_ARGS_((Tcl_AsyncHandler async)); /* 74 */ - int (*tcl_AsyncReady) _ANSI_ARGS_((void)); /* 75 */ - void (*tcl_BackgroundError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 76 */ - char (*tcl_Backslash) _ANSI_ARGS_((CONST char * src, int * readPtr)); /* 77 */ - int (*tcl_BadChannelOption) _ANSI_ARGS_((Tcl_Interp * interp, char * optionName, char * optionList)); /* 78 */ - void (*tcl_CallWhenDeleted) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_InterpDeleteProc * proc, ClientData clientData)); /* 79 */ - void (*tcl_CancelIdleCall) _ANSI_ARGS_((Tcl_IdleProc * idleProc, ClientData clientData)); /* 80 */ - int (*tcl_Close) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 81 */ - int (*tcl_CommandComplete) _ANSI_ARGS_((char * cmd)); /* 82 */ - char * (*tcl_Concat) _ANSI_ARGS_((int argc, char ** argv)); /* 83 */ - int (*tcl_ConvertElement) _ANSI_ARGS_((CONST char * src, char * dst, int flags)); /* 84 */ - int (*tcl_ConvertCountedElement) _ANSI_ARGS_((CONST char * src, int length, char * dst, int flags)); /* 85 */ - int (*tcl_CreateAlias) _ANSI_ARGS_((Tcl_Interp * slave, char * slaveCmd, Tcl_Interp * target, char * targetCmd, int argc, char ** argv)); /* 86 */ - int (*tcl_CreateAliasObj) _ANSI_ARGS_((Tcl_Interp * slave, char * slaveCmd, Tcl_Interp * target, char * targetCmd, int objc, Tcl_Obj *CONST objv[])); /* 87 */ - Tcl_Channel (*tcl_CreateChannel) _ANSI_ARGS_((Tcl_ChannelType * typePtr, char * chanName, ClientData instanceData, int mask)); /* 88 */ - void (*tcl_CreateChannelHandler) _ANSI_ARGS_((Tcl_Channel chan, int mask, Tcl_ChannelProc * proc, ClientData clientData)); /* 89 */ - void (*tcl_CreateCloseHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_CloseProc * proc, ClientData clientData)); /* 90 */ - Tcl_Command (*tcl_CreateCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * cmdName, Tcl_CmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 91 */ - void (*tcl_CreateEventSource) _ANSI_ARGS_((Tcl_EventSetupProc * setupProc, Tcl_EventCheckProc * checkProc, ClientData clientData)); /* 92 */ - void (*tcl_CreateExitHandler) _ANSI_ARGS_((Tcl_ExitProc * proc, ClientData clientData)); /* 93 */ - Tcl_Interp * (*tcl_CreateInterp) _ANSI_ARGS_((void)); /* 94 */ - void (*tcl_CreateMathFunc) _ANSI_ARGS_((Tcl_Interp * interp, char * name, int numArgs, Tcl_ValueType * argTypes, Tcl_MathProc * proc, ClientData clientData)); /* 95 */ - Tcl_Command (*tcl_CreateObjCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * cmdName, Tcl_ObjCmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 96 */ - Tcl_Interp * (*tcl_CreateSlave) _ANSI_ARGS_((Tcl_Interp * interp, char * slaveName, int isSafe)); /* 97 */ - Tcl_TimerToken (*tcl_CreateTimerHandler) _ANSI_ARGS_((int milliseconds, Tcl_TimerProc * proc, ClientData clientData)); /* 98 */ - Tcl_Trace (*tcl_CreateTrace) _ANSI_ARGS_((Tcl_Interp * interp, int level, Tcl_CmdTraceProc * proc, ClientData clientData)); /* 99 */ - void (*tcl_DeleteAssocData) _ANSI_ARGS_((Tcl_Interp * interp, char * name)); /* 100 */ - void (*tcl_DeleteChannelHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_ChannelProc * proc, ClientData clientData)); /* 101 */ - void (*tcl_DeleteCloseHandler) _ANSI_ARGS_((Tcl_Channel chan, Tcl_CloseProc * proc, ClientData clientData)); /* 102 */ - int (*tcl_DeleteCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * cmdName)); /* 103 */ - int (*tcl_DeleteCommandFromToken) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Command command)); /* 104 */ - void (*tcl_DeleteEvents) _ANSI_ARGS_((Tcl_EventDeleteProc * proc, ClientData clientData)); /* 105 */ - void (*tcl_DeleteEventSource) _ANSI_ARGS_((Tcl_EventSetupProc * setupProc, Tcl_EventCheckProc * checkProc, ClientData clientData)); /* 106 */ - void (*tcl_DeleteExitHandler) _ANSI_ARGS_((Tcl_ExitProc * proc, ClientData clientData)); /* 107 */ - void (*tcl_DeleteHashEntry) _ANSI_ARGS_((Tcl_HashEntry * entryPtr)); /* 108 */ - void (*tcl_DeleteHashTable) _ANSI_ARGS_((Tcl_HashTable * tablePtr)); /* 109 */ - void (*tcl_DeleteInterp) _ANSI_ARGS_((Tcl_Interp * interp)); /* 110 */ - void (*tcl_DetachPids) _ANSI_ARGS_((int numPids, Tcl_Pid * pidPtr)); /* 111 */ - void (*tcl_DeleteTimerHandler) _ANSI_ARGS_((Tcl_TimerToken token)); /* 112 */ - void (*tcl_DeleteTrace) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Trace trace)); /* 113 */ - void (*tcl_DontCallWhenDeleted) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_InterpDeleteProc * proc, ClientData clientData)); /* 114 */ - int (*tcl_DoOneEvent) _ANSI_ARGS_((int flags)); /* 115 */ - void (*tcl_DoWhenIdle) _ANSI_ARGS_((Tcl_IdleProc * proc, ClientData clientData)); /* 116 */ - char * (*tcl_DStringAppend) _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * str, int length)); /* 117 */ - char * (*tcl_DStringAppendElement) _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * string)); /* 118 */ - void (*tcl_DStringEndSublist) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 119 */ - void (*tcl_DStringFree) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 120 */ - void (*tcl_DStringGetResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * dsPtr)); /* 121 */ - void (*tcl_DStringInit) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 122 */ - void (*tcl_DStringResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * dsPtr)); /* 123 */ - void (*tcl_DStringSetLength) _ANSI_ARGS_((Tcl_DString * dsPtr, int length)); /* 124 */ - void (*tcl_DStringStartSublist) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 125 */ - int (*tcl_Eof) _ANSI_ARGS_((Tcl_Channel chan)); /* 126 */ - char * (*tcl_ErrnoId) _ANSI_ARGS_((void)); /* 127 */ - char * (*tcl_ErrnoMsg) _ANSI_ARGS_((int err)); /* 128 */ - int (*tcl_Eval) _ANSI_ARGS_((Tcl_Interp * interp, char * string)); /* 129 */ - int (*tcl_EvalFile) _ANSI_ARGS_((Tcl_Interp * interp, char * fileName)); /* 130 */ - int (*tcl_EvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 131 */ - void (*tcl_EventuallyFree) _ANSI_ARGS_((ClientData clientData, Tcl_FreeProc * freeProc)); /* 132 */ - void (*tcl_Exit) _ANSI_ARGS_((int status)); /* 133 */ - int (*tcl_ExposeCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * hiddenCmdToken, char * cmdName)); /* 134 */ - int (*tcl_ExprBoolean) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * ptr)); /* 135 */ - int (*tcl_ExprBooleanObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * ptr)); /* 136 */ - int (*tcl_ExprDouble) _ANSI_ARGS_((Tcl_Interp * interp, char * str, double * ptr)); /* 137 */ - int (*tcl_ExprDoubleObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, double * ptr)); /* 138 */ - int (*tcl_ExprLong) _ANSI_ARGS_((Tcl_Interp * interp, char * str, long * ptr)); /* 139 */ - int (*tcl_ExprLongObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, long * ptr)); /* 140 */ - int (*tcl_ExprObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tcl_Obj ** resultPtrPtr)); /* 141 */ - int (*tcl_ExprString) _ANSI_ARGS_((Tcl_Interp * interp, char * string)); /* 142 */ - void (*tcl_Finalize) _ANSI_ARGS_((void)); /* 143 */ - void (*tcl_FindExecutable) _ANSI_ARGS_((CONST char * argv0)); /* 144 */ - Tcl_HashEntry * (*tcl_FirstHashEntry) _ANSI_ARGS_((Tcl_HashTable * tablePtr, Tcl_HashSearch * searchPtr)); /* 145 */ - int (*tcl_Flush) _ANSI_ARGS_((Tcl_Channel chan)); /* 146 */ - void (*tcl_FreeResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 147 */ - int (*tcl_GetAlias) _ANSI_ARGS_((Tcl_Interp * interp, char * slaveCmd, Tcl_Interp ** targetInterpPtr, char ** targetCmdPtr, int * argcPtr, char *** argvPtr)); /* 148 */ - int (*tcl_GetAliasObj) _ANSI_ARGS_((Tcl_Interp * interp, char * slaveCmd, Tcl_Interp ** targetInterpPtr, char ** targetCmdPtr, int * objcPtr, Tcl_Obj *** objv)); /* 149 */ - ClientData (*tcl_GetAssocData) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_InterpDeleteProc ** procPtr)); /* 150 */ - Tcl_Channel (*tcl_GetChannel) _ANSI_ARGS_((Tcl_Interp * interp, char * chanName, int * modePtr)); /* 151 */ - int (*tcl_GetChannelBufferSize) _ANSI_ARGS_((Tcl_Channel chan)); /* 152 */ - int (*tcl_GetChannelHandle) _ANSI_ARGS_((Tcl_Channel chan, int direction, ClientData * handlePtr)); /* 153 */ - ClientData (*tcl_GetChannelInstanceData) _ANSI_ARGS_((Tcl_Channel chan)); /* 154 */ - int (*tcl_GetChannelMode) _ANSI_ARGS_((Tcl_Channel chan)); /* 155 */ - char * (*tcl_GetChannelName) _ANSI_ARGS_((Tcl_Channel chan)); /* 156 */ - int (*tcl_GetChannelOption) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan, char * optionName, Tcl_DString * dsPtr)); /* 157 */ - Tcl_ChannelType * (*tcl_GetChannelType) _ANSI_ARGS_((Tcl_Channel chan)); /* 158 */ - int (*tcl_GetCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * cmdName, Tcl_CmdInfo * infoPtr)); /* 159 */ - char * (*tcl_GetCommandName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Command command)); /* 160 */ - int (*tcl_GetErrno) _ANSI_ARGS_((void)); /* 161 */ - char * (*tcl_GetHostName) _ANSI_ARGS_((void)); /* 162 */ - int (*tcl_GetInterpPath) _ANSI_ARGS_((Tcl_Interp * askInterp, Tcl_Interp * slaveInterp)); /* 163 */ - Tcl_Interp * (*tcl_GetMaster) _ANSI_ARGS_((Tcl_Interp * interp)); /* 164 */ - CONST char * (*tcl_GetNameOfExecutable) _ANSI_ARGS_((void)); /* 165 */ - Tcl_Obj * (*tcl_GetObjResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 166 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - int (*tcl_GetOpenFile) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int write, int checkUsage, ClientData * filePtr)); /* 167 */ -#endif /* UNIX */ -#ifdef __WIN32__ - void *reserved167; -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void *reserved167; -#endif /* MAC_TCL */ - Tcl_PathType (*tcl_GetPathType) _ANSI_ARGS_((char * path)); /* 168 */ - int (*tcl_Gets) _ANSI_ARGS_((Tcl_Channel chan, Tcl_DString * dsPtr)); /* 169 */ - int (*tcl_GetsObj) _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj * objPtr)); /* 170 */ - int (*tcl_GetServiceMode) _ANSI_ARGS_((void)); /* 171 */ - Tcl_Interp * (*tcl_GetSlave) _ANSI_ARGS_((Tcl_Interp * interp, char * slaveName)); /* 172 */ - Tcl_Channel (*tcl_GetStdChannel) _ANSI_ARGS_((int type)); /* 173 */ - char * (*tcl_GetStringResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 174 */ - char * (*tcl_GetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 175 */ - char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 176 */ - int (*tcl_GlobalEval) _ANSI_ARGS_((Tcl_Interp * interp, char * command)); /* 177 */ - int (*tcl_GlobalEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 178 */ - int (*tcl_HideCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * cmdName, char * hiddenCmdToken)); /* 179 */ - int (*tcl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 180 */ - void (*tcl_InitHashTable) _ANSI_ARGS_((Tcl_HashTable * tablePtr, int keyType)); /* 181 */ - int (*tcl_InputBlocked) _ANSI_ARGS_((Tcl_Channel chan)); /* 182 */ - int (*tcl_InputBuffered) _ANSI_ARGS_((Tcl_Channel chan)); /* 183 */ - int (*tcl_InterpDeleted) _ANSI_ARGS_((Tcl_Interp * interp)); /* 184 */ - int (*tcl_IsSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 185 */ - char * (*tcl_JoinPath) _ANSI_ARGS_((int argc, char ** argv, Tcl_DString * resultPtr)); /* 186 */ - int (*tcl_LinkVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, char * addr, int type)); /* 187 */ - void *reserved188; - Tcl_Channel (*tcl_MakeFileChannel) _ANSI_ARGS_((ClientData handle, int mode)); /* 189 */ - int (*tcl_MakeSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 190 */ - Tcl_Channel (*tcl_MakeTcpClientChannel) _ANSI_ARGS_((ClientData tcpSocket)); /* 191 */ - char * (*tcl_Merge) _ANSI_ARGS_((int argc, char ** argv)); /* 192 */ - Tcl_HashEntry * (*tcl_NextHashEntry) _ANSI_ARGS_((Tcl_HashSearch * searchPtr)); /* 193 */ - void (*tcl_NotifyChannel) _ANSI_ARGS_((Tcl_Channel channel, int mask)); /* 194 */ - Tcl_Obj * (*tcl_ObjGetVar2) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, int flags)); /* 195 */ - Tcl_Obj * (*tcl_ObjSetVar2) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, Tcl_Obj * newValuePtr, int flags)); /* 196 */ - Tcl_Channel (*tcl_OpenCommandChannel) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv, int flags)); /* 197 */ - Tcl_Channel (*tcl_OpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, char * fileName, char * modeString, int permissions)); /* 198 */ - Tcl_Channel (*tcl_OpenTcpClient) _ANSI_ARGS_((Tcl_Interp * interp, int port, char * address, char * myaddr, int myport, int async)); /* 199 */ - Tcl_Channel (*tcl_OpenTcpServer) _ANSI_ARGS_((Tcl_Interp * interp, int port, char * host, Tcl_TcpAcceptProc * acceptProc, ClientData callbackData)); /* 200 */ - void (*tcl_Preserve) _ANSI_ARGS_((ClientData data)); /* 201 */ - void (*tcl_PrintDouble) _ANSI_ARGS_((Tcl_Interp * interp, double value, char * dst)); /* 202 */ - int (*tcl_PutEnv) _ANSI_ARGS_((CONST char * string)); /* 203 */ - char * (*tcl_PosixError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 204 */ - void (*tcl_QueueEvent) _ANSI_ARGS_((Tcl_Event * evPtr, Tcl_QueuePosition position)); /* 205 */ - int (*tcl_Read) _ANSI_ARGS_((Tcl_Channel chan, char * bufPtr, int toRead)); /* 206 */ - void (*tcl_ReapDetachedProcs) _ANSI_ARGS_((void)); /* 207 */ - int (*tcl_RecordAndEval) _ANSI_ARGS_((Tcl_Interp * interp, char * cmd, int flags)); /* 208 */ - int (*tcl_RecordAndEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * cmdPtr, int flags)); /* 209 */ - void (*tcl_RegisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 210 */ - void (*tcl_RegisterObjType) _ANSI_ARGS_((Tcl_ObjType * typePtr)); /* 211 */ - Tcl_RegExp (*tcl_RegExpCompile) _ANSI_ARGS_((Tcl_Interp * interp, char * string)); /* 212 */ - int (*tcl_RegExpExec) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_RegExp regexp, CONST char * str, CONST char * start)); /* 213 */ - int (*tcl_RegExpMatch) _ANSI_ARGS_((Tcl_Interp * interp, char * str, char * pattern)); /* 214 */ - void (*tcl_RegExpRange) _ANSI_ARGS_((Tcl_RegExp regexp, int index, char ** startPtr, char ** endPtr)); /* 215 */ - void (*tcl_Release) _ANSI_ARGS_((ClientData clientData)); /* 216 */ - void (*tcl_ResetResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 217 */ - int (*tcl_ScanElement) _ANSI_ARGS_((CONST char * str, int * flagPtr)); /* 218 */ - int (*tcl_ScanCountedElement) _ANSI_ARGS_((CONST char * str, int length, int * flagPtr)); /* 219 */ - int (*tcl_Seek) _ANSI_ARGS_((Tcl_Channel chan, int offset, int mode)); /* 220 */ - int (*tcl_ServiceAll) _ANSI_ARGS_((void)); /* 221 */ - int (*tcl_ServiceEvent) _ANSI_ARGS_((int flags)); /* 222 */ - void (*tcl_SetAssocData) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_InterpDeleteProc * proc, ClientData clientData)); /* 223 */ - void (*tcl_SetChannelBufferSize) _ANSI_ARGS_((Tcl_Channel chan, int sz)); /* 224 */ - int (*tcl_SetChannelOption) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan, char * optionName, char * newValue)); /* 225 */ - int (*tcl_SetCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * cmdName, Tcl_CmdInfo * infoPtr)); /* 226 */ - void (*tcl_SetErrno) _ANSI_ARGS_((int err)); /* 227 */ - void (*tcl_SetErrorCode) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 228 */ - void (*tcl_SetMaxBlockTime) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 229 */ - void (*tcl_SetPanicProc) _ANSI_ARGS_((Tcl_PanicProc * panicProc)); /* 230 */ - int (*tcl_SetRecursionLimit) _ANSI_ARGS_((Tcl_Interp * interp, int depth)); /* 231 */ - void (*tcl_SetResult) _ANSI_ARGS_((Tcl_Interp * interp, char * str, Tcl_FreeProc * freeProc)); /* 232 */ - int (*tcl_SetServiceMode) _ANSI_ARGS_((int mode)); /* 233 */ - void (*tcl_SetObjErrorCode) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * errorObjPtr)); /* 234 */ - void (*tcl_SetObjResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * resultObjPtr)); /* 235 */ - void (*tcl_SetStdChannel) _ANSI_ARGS_((Tcl_Channel channel, int type)); /* 236 */ - char * (*tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, char * newValue, int flags)); /* 237 */ - char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, char * newValue, int flags)); /* 238 */ - char * (*tcl_SignalId) _ANSI_ARGS_((int sig)); /* 239 */ - char * (*tcl_SignalMsg) _ANSI_ARGS_((int sig)); /* 240 */ - void (*tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp * interp)); /* 241 */ - int (*tcl_SplitList) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * listStr, int * argcPtr, char *** argvPtr)); /* 242 */ - void (*tcl_SplitPath) _ANSI_ARGS_((CONST char * path, int * argcPtr, char *** argvPtr)); /* 243 */ - void (*tcl_StaticPackage) _ANSI_ARGS_((Tcl_Interp * interp, char * pkgName, Tcl_PackageInitProc * initProc, Tcl_PackageInitProc * safeInitProc)); /* 244 */ - int (*tcl_StringMatch) _ANSI_ARGS_((CONST char * str, CONST char * pattern)); /* 245 */ - int (*tcl_Tell) _ANSI_ARGS_((Tcl_Channel chan)); /* 246 */ - int (*tcl_TraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 247 */ - int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */ - char * (*tcl_TranslateFileName) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_DString * bufferPtr)); /* 249 */ - int (*tcl_Ungets) _ANSI_ARGS_((Tcl_Channel chan, char * str, int len, int atHead)); /* 250 */ - void (*tcl_UnlinkVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 251 */ - int (*tcl_UnregisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 252 */ - int (*tcl_UnsetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 253 */ - int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 254 */ - void (*tcl_UntraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 255 */ - void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 256 */ - void (*tcl_UpdateLinkedVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 257 */ - int (*tcl_UpVar) _ANSI_ARGS_((Tcl_Interp * interp, char * frameName, char * varName, char * localName, int flags)); /* 258 */ - int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * frameName, char * part1, char * part2, char * localName, int flags)); /* 259 */ - int (*tcl_VarEval) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 260 */ - ClientData (*tcl_VarTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 261 */ - ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */ - int (*tcl_Write) _ANSI_ARGS_((Tcl_Channel chan, char * s, int slen)); /* 263 */ - void (*tcl_WrongNumArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], char * message)); /* 264 */ - int (*tcl_DumpActiveMemory) _ANSI_ARGS_((char * fileName)); /* 265 */ - void (*tcl_ValidateAllMemory) _ANSI_ARGS_((char * file, int line)); /* 266 */ - void (*tcl_AppendResultVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 267 */ - void (*tcl_AppendStringsToObjVA) _ANSI_ARGS_((Tcl_Obj * objPtr, va_list argList)); /* 268 */ - char * (*tcl_HashStats) _ANSI_ARGS_((Tcl_HashTable * tablePtr)); /* 269 */ - char * (*tcl_ParseVar) _ANSI_ARGS_((Tcl_Interp * interp, char * str, char ** termPtr)); /* 270 */ - char * (*tcl_PkgPresent) _ANSI_ARGS_((Tcl_Interp * interp, char * name, char * version, int exact)); /* 271 */ - char * (*tcl_PkgPresentEx) _ANSI_ARGS_((Tcl_Interp * interp, char * name, char * version, int exact, ClientData * clientDataPtr)); /* 272 */ - int (*tcl_PkgProvide) _ANSI_ARGS_((Tcl_Interp * interp, char * name, char * version)); /* 273 */ - char * (*tcl_PkgRequire) _ANSI_ARGS_((Tcl_Interp * interp, char * name, char * version, int exact)); /* 274 */ - void (*tcl_SetErrorCodeVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 275 */ - int (*tcl_VarEvalVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 276 */ - Tcl_Pid (*tcl_WaitPid) _ANSI_ARGS_((Tcl_Pid pid, int * statPtr, int options)); /* 277 */ - void (*tcl_PanicVA) _ANSI_ARGS_((char * format, va_list argList)); /* 278 */ - void (*tcl_GetVersion) _ANSI_ARGS_((int * major, int * minor, int * patchLevel, int * type)); /* 279 */ - void (*tcl_InitMemory) _ANSI_ARGS_((Tcl_Interp * interp)); /* 280 */ - void *reserved281; - void *reserved282; - void *reserved283; - void *reserved284; - void *reserved285; - void (*tcl_AppendObjToObj) _ANSI_ARGS_((Tcl_Obj * objPtr, Tcl_Obj * appendObjPtr)); /* 286 */ - Tcl_Encoding (*tcl_CreateEncoding) _ANSI_ARGS_((Tcl_EncodingType * typePtr)); /* 287 */ - void (*tcl_CreateThreadExitHandler) _ANSI_ARGS_((Tcl_ExitProc * proc, ClientData clientData)); /* 288 */ - void (*tcl_DeleteThreadExitHandler) _ANSI_ARGS_((Tcl_ExitProc * proc, ClientData clientData)); /* 289 */ - void (*tcl_DiscardResult) _ANSI_ARGS_((Tcl_SavedResult * statePtr)); /* 290 */ - int (*tcl_EvalEx) _ANSI_ARGS_((Tcl_Interp * interp, char * script, int numBytes, int flags)); /* 291 */ - int (*tcl_EvalObjv) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], int flags)); /* 292 */ - int (*tcl_EvalObjEx) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int flags)); /* 293 */ - void (*tcl_ExitThread) _ANSI_ARGS_((int status)); /* 294 */ - int (*tcl_ExternalToUtf) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Encoding encoding, CONST char * src, int srcLen, int flags, Tcl_EncodingState * statePtr, char * dst, int dstLen, int * srcReadPtr, int * dstWrotePtr, int * dstCharsPtr)); /* 295 */ - char * (*tcl_ExternalToUtfDString) _ANSI_ARGS_((Tcl_Encoding encoding, CONST char * src, int srcLen, Tcl_DString * dsPtr)); /* 296 */ - void (*tcl_FinalizeThread) _ANSI_ARGS_((void)); /* 297 */ - void (*tcl_FinalizeNotifier) _ANSI_ARGS_((ClientData clientData)); /* 298 */ - void (*tcl_FreeEncoding) _ANSI_ARGS_((Tcl_Encoding encoding)); /* 299 */ - Tcl_ThreadId (*tcl_GetCurrentThread) _ANSI_ARGS_((void)); /* 300 */ - Tcl_Encoding (*tcl_GetEncoding) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 301 */ - char * (*tcl_GetEncodingName) _ANSI_ARGS_((Tcl_Encoding encoding)); /* 302 */ - void (*tcl_GetEncodingNames) _ANSI_ARGS_((Tcl_Interp * interp)); /* 303 */ - int (*tcl_GetIndexFromObjStruct) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, char ** tablePtr, int offset, char * msg, int flags, int * indexPtr)); /* 304 */ - VOID * (*tcl_GetThreadData) _ANSI_ARGS_((Tcl_ThreadDataKey * keyPtr, int size)); /* 305 */ - Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags)); /* 306 */ - ClientData (*tcl_InitNotifier) _ANSI_ARGS_((void)); /* 307 */ - void (*tcl_MutexLock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 308 */ - void (*tcl_MutexUnlock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 309 */ - void (*tcl_ConditionNotify) _ANSI_ARGS_((Tcl_Condition * condPtr)); /* 310 */ - void (*tcl_ConditionWait) _ANSI_ARGS_((Tcl_Condition * condPtr, Tcl_Mutex * mutexPtr, Tcl_Time * timePtr)); /* 311 */ - int (*tcl_NumUtfChars) _ANSI_ARGS_((CONST char * src, int len)); /* 312 */ - int (*tcl_ReadChars) _ANSI_ARGS_((Tcl_Channel channel, Tcl_Obj * objPtr, int charsToRead, int appendFlag)); /* 313 */ - void (*tcl_RestoreResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 314 */ - void (*tcl_SaveResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 315 */ - int (*tcl_SetSystemEncoding) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 316 */ - Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, Tcl_Obj * newValuePtr, int flags)); /* 317 */ - void (*tcl_ThreadAlert) _ANSI_ARGS_((Tcl_ThreadId threadId)); /* 318 */ - void (*tcl_ThreadQueueEvent) _ANSI_ARGS_((Tcl_ThreadId threadId, Tcl_Event* evPtr, Tcl_QueuePosition position)); /* 319 */ - Tcl_UniChar (*tcl_UniCharAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 320 */ - Tcl_UniChar (*tcl_UniCharToLower) _ANSI_ARGS_((int ch)); /* 321 */ - Tcl_UniChar (*tcl_UniCharToTitle) _ANSI_ARGS_((int ch)); /* 322 */ - Tcl_UniChar (*tcl_UniCharToUpper) _ANSI_ARGS_((int ch)); /* 323 */ - int (*tcl_UniCharToUtf) _ANSI_ARGS_((int ch, char * buf)); /* 324 */ - char * (*tcl_UtfAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 325 */ - int (*tcl_UtfCharComplete) _ANSI_ARGS_((CONST char * src, int len)); /* 326 */ - int (*tcl_UtfBackslash) _ANSI_ARGS_((CONST char * src, int * readPtr, char * dst)); /* 327 */ - char * (*tcl_UtfFindFirst) _ANSI_ARGS_((CONST char * src, int ch)); /* 328 */ - char * (*tcl_UtfFindLast) _ANSI_ARGS_((CONST char * src, int ch)); /* 329 */ - char * (*tcl_UtfNext) _ANSI_ARGS_((CONST char * src)); /* 330 */ - char * (*tcl_UtfPrev) _ANSI_ARGS_((CONST char * src, CONST char * start)); /* 331 */ - int (*tcl_UtfToExternal) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Encoding encoding, CONST char * src, int srcLen, int flags, Tcl_EncodingState * statePtr, char * dst, int dstLen, int * srcReadPtr, int * dstWrotePtr, int * dstCharsPtr)); /* 332 */ - char * (*tcl_UtfToExternalDString) _ANSI_ARGS_((Tcl_Encoding encoding, CONST char * src, int srcLen, Tcl_DString * dsPtr)); /* 333 */ - int (*tcl_UtfToLower) _ANSI_ARGS_((char * src)); /* 334 */ - int (*tcl_UtfToTitle) _ANSI_ARGS_((char * src)); /* 335 */ - int (*tcl_UtfToUniChar) _ANSI_ARGS_((CONST char * src, Tcl_UniChar * chPtr)); /* 336 */ - int (*tcl_UtfToUpper) _ANSI_ARGS_((char * src)); /* 337 */ - int (*tcl_WriteChars) _ANSI_ARGS_((Tcl_Channel chan, CONST char * src, int srcLen)); /* 338 */ - int (*tcl_WriteObj) _ANSI_ARGS_((Tcl_Channel chan, Tcl_Obj * objPtr)); /* 339 */ - char * (*tcl_GetString) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 340 */ - char * (*tcl_GetDefaultEncodingDir) _ANSI_ARGS_((void)); /* 341 */ - void (*tcl_SetDefaultEncodingDir) _ANSI_ARGS_((char * path)); /* 342 */ - void (*tcl_AlertNotifier) _ANSI_ARGS_((ClientData clientData)); /* 343 */ - void (*tcl_ServiceModeHook) _ANSI_ARGS_((int mode)); /* 344 */ - int (*tcl_UniCharIsAlnum) _ANSI_ARGS_((int ch)); /* 345 */ - int (*tcl_UniCharIsAlpha) _ANSI_ARGS_((int ch)); /* 346 */ - int (*tcl_UniCharIsDigit) _ANSI_ARGS_((int ch)); /* 347 */ - int (*tcl_UniCharIsLower) _ANSI_ARGS_((int ch)); /* 348 */ - int (*tcl_UniCharIsSpace) _ANSI_ARGS_((int ch)); /* 349 */ - int (*tcl_UniCharIsUpper) _ANSI_ARGS_((int ch)); /* 350 */ - int (*tcl_UniCharIsWordChar) _ANSI_ARGS_((int ch)); /* 351 */ - int (*tcl_UniCharLen) _ANSI_ARGS_((Tcl_UniChar * str)); /* 352 */ - int (*tcl_UniCharNcmp) _ANSI_ARGS_((const Tcl_UniChar * cs, const Tcl_UniChar * ct, size_t n)); /* 353 */ - char * (*tcl_UniCharToUtfDString) _ANSI_ARGS_((CONST Tcl_UniChar * string, int numChars, Tcl_DString * dsPtr)); /* 354 */ - Tcl_UniChar * (*tcl_UtfToUniCharDString) _ANSI_ARGS_((CONST char * string, int length, Tcl_DString * dsPtr)); /* 355 */ - Tcl_RegExp (*tcl_GetRegExpFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * patObj, int flags)); /* 356 */ - Tcl_Obj * (*tcl_EvalTokens) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 357 */ - void (*tcl_FreeParse) _ANSI_ARGS_((Tcl_Parse * parsePtr)); /* 358 */ - void (*tcl_LogCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * script, char * command, int length)); /* 359 */ - int (*tcl_ParseBraces) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, Tcl_Parse * parsePtr, int append, char ** termPtr)); /* 360 */ - int (*tcl_ParseCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, int nested, Tcl_Parse * parsePtr)); /* 361 */ - int (*tcl_ParseExpr) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, Tcl_Parse * parsePtr)); /* 362 */ - int (*tcl_ParseQuotedString) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, Tcl_Parse * parsePtr, int append, char ** termPtr)); /* 363 */ - int (*tcl_ParseVarName) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int numBytes, Tcl_Parse * parsePtr, int append)); /* 364 */ - char * (*tcl_GetCwd) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * cwdPtr)); /* 365 */ - int (*tcl_Chdir) _ANSI_ARGS_((CONST char * dirName)); /* 366 */ -} TclStubs; - -extern TclStubs *tclStubsPtr; - -#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) - -/* - * Inline function declarations: - */ - -#ifndef Tcl_PkgProvideEx -#define Tcl_PkgProvideEx \ - (tclStubsPtr->tcl_PkgProvideEx) /* 0 */ -#endif -#ifndef Tcl_PkgRequireEx -#define Tcl_PkgRequireEx \ - (tclStubsPtr->tcl_PkgRequireEx) /* 1 */ -#endif -#ifndef Tcl_Panic -#define Tcl_Panic \ - (tclStubsPtr->tcl_Panic) /* 2 */ -#endif -#ifndef Tcl_Alloc -#define Tcl_Alloc \ - (tclStubsPtr->tcl_Alloc) /* 3 */ -#endif -#ifndef Tcl_Free -#define Tcl_Free \ - (tclStubsPtr->tcl_Free) /* 4 */ -#endif -#ifndef Tcl_Realloc -#define Tcl_Realloc \ - (tclStubsPtr->tcl_Realloc) /* 5 */ -#endif -#ifndef Tcl_DbCkalloc -#define Tcl_DbCkalloc \ - (tclStubsPtr->tcl_DbCkalloc) /* 6 */ -#endif -#ifndef Tcl_DbCkfree -#define Tcl_DbCkfree \ - (tclStubsPtr->tcl_DbCkfree) /* 7 */ -#endif -#ifndef Tcl_DbCkrealloc -#define Tcl_DbCkrealloc \ - (tclStubsPtr->tcl_DbCkrealloc) /* 8 */ -#endif -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef Tcl_CreateFileHandler -#define Tcl_CreateFileHandler \ - (tclStubsPtr->tcl_CreateFileHandler) /* 9 */ -#endif -#endif /* UNIX */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef Tcl_DeleteFileHandler -#define Tcl_DeleteFileHandler \ - (tclStubsPtr->tcl_DeleteFileHandler) /* 10 */ -#endif -#endif /* UNIX */ -#ifndef Tcl_SetTimer -#define Tcl_SetTimer \ - (tclStubsPtr->tcl_SetTimer) /* 11 */ -#endif -#ifndef Tcl_Sleep -#define Tcl_Sleep \ - (tclStubsPtr->tcl_Sleep) /* 12 */ -#endif -#ifndef Tcl_WaitForEvent -#define Tcl_WaitForEvent \ - (tclStubsPtr->tcl_WaitForEvent) /* 13 */ -#endif -#ifndef Tcl_AppendAllObjTypes -#define Tcl_AppendAllObjTypes \ - (tclStubsPtr->tcl_AppendAllObjTypes) /* 14 */ -#endif -#ifndef Tcl_AppendStringsToObj -#define Tcl_AppendStringsToObj \ - (tclStubsPtr->tcl_AppendStringsToObj) /* 15 */ -#endif -#ifndef Tcl_AppendToObj -#define Tcl_AppendToObj \ - (tclStubsPtr->tcl_AppendToObj) /* 16 */ -#endif -#ifndef Tcl_ConcatObj -#define Tcl_ConcatObj \ - (tclStubsPtr->tcl_ConcatObj) /* 17 */ -#endif -#ifndef Tcl_ConvertToType -#define Tcl_ConvertToType \ - (tclStubsPtr->tcl_ConvertToType) /* 18 */ -#endif -#ifndef Tcl_DbDecrRefCount -#define Tcl_DbDecrRefCount \ - (tclStubsPtr->tcl_DbDecrRefCount) /* 19 */ -#endif -#ifndef Tcl_DbIncrRefCount -#define Tcl_DbIncrRefCount \ - (tclStubsPtr->tcl_DbIncrRefCount) /* 20 */ -#endif -#ifndef Tcl_DbIsShared -#define Tcl_DbIsShared \ - (tclStubsPtr->tcl_DbIsShared) /* 21 */ -#endif -#ifndef Tcl_DbNewBooleanObj -#define Tcl_DbNewBooleanObj \ - (tclStubsPtr->tcl_DbNewBooleanObj) /* 22 */ -#endif -#ifndef Tcl_DbNewByteArrayObj -#define Tcl_DbNewByteArrayObj \ - (tclStubsPtr->tcl_DbNewByteArrayObj) /* 23 */ -#endif -#ifndef Tcl_DbNewDoubleObj -#define Tcl_DbNewDoubleObj \ - (tclStubsPtr->tcl_DbNewDoubleObj) /* 24 */ -#endif -#ifndef Tcl_DbNewListObj -#define Tcl_DbNewListObj \ - (tclStubsPtr->tcl_DbNewListObj) /* 25 */ -#endif -#ifndef Tcl_DbNewLongObj -#define Tcl_DbNewLongObj \ - (tclStubsPtr->tcl_DbNewLongObj) /* 26 */ -#endif -#ifndef Tcl_DbNewObj -#define Tcl_DbNewObj \ - (tclStubsPtr->tcl_DbNewObj) /* 27 */ -#endif -#ifndef Tcl_DbNewStringObj -#define Tcl_DbNewStringObj \ - (tclStubsPtr->tcl_DbNewStringObj) /* 28 */ -#endif -#ifndef Tcl_DuplicateObj -#define Tcl_DuplicateObj \ - (tclStubsPtr->tcl_DuplicateObj) /* 29 */ -#endif -#ifndef TclFreeObj -#define TclFreeObj \ - (tclStubsPtr->tclFreeObj) /* 30 */ -#endif -#ifndef Tcl_GetBoolean -#define Tcl_GetBoolean \ - (tclStubsPtr->tcl_GetBoolean) /* 31 */ -#endif -#ifndef Tcl_GetBooleanFromObj -#define Tcl_GetBooleanFromObj \ - (tclStubsPtr->tcl_GetBooleanFromObj) /* 32 */ -#endif -#ifndef Tcl_GetByteArrayFromObj -#define Tcl_GetByteArrayFromObj \ - (tclStubsPtr->tcl_GetByteArrayFromObj) /* 33 */ -#endif -#ifndef Tcl_GetDouble -#define Tcl_GetDouble \ - (tclStubsPtr->tcl_GetDouble) /* 34 */ -#endif -#ifndef Tcl_GetDoubleFromObj -#define Tcl_GetDoubleFromObj \ - (tclStubsPtr->tcl_GetDoubleFromObj) /* 35 */ -#endif -#ifndef Tcl_GetIndexFromObj -#define Tcl_GetIndexFromObj \ - (tclStubsPtr->tcl_GetIndexFromObj) /* 36 */ -#endif -#ifndef Tcl_GetInt -#define Tcl_GetInt \ - (tclStubsPtr->tcl_GetInt) /* 37 */ -#endif -#ifndef Tcl_GetIntFromObj -#define Tcl_GetIntFromObj \ - (tclStubsPtr->tcl_GetIntFromObj) /* 38 */ -#endif -#ifndef Tcl_GetLongFromObj -#define Tcl_GetLongFromObj \ - (tclStubsPtr->tcl_GetLongFromObj) /* 39 */ -#endif -#ifndef Tcl_GetObjType -#define Tcl_GetObjType \ - (tclStubsPtr->tcl_GetObjType) /* 40 */ -#endif -#ifndef Tcl_GetStringFromObj -#define Tcl_GetStringFromObj \ - (tclStubsPtr->tcl_GetStringFromObj) /* 41 */ -#endif -#ifndef Tcl_InvalidateStringRep -#define Tcl_InvalidateStringRep \ - (tclStubsPtr->tcl_InvalidateStringRep) /* 42 */ -#endif -#ifndef Tcl_ListObjAppendList -#define Tcl_ListObjAppendList \ - (tclStubsPtr->tcl_ListObjAppendList) /* 43 */ -#endif -#ifndef Tcl_ListObjAppendElement -#define Tcl_ListObjAppendElement \ - (tclStubsPtr->tcl_ListObjAppendElement) /* 44 */ -#endif -#ifndef Tcl_ListObjGetElements -#define Tcl_ListObjGetElements \ - (tclStubsPtr->tcl_ListObjGetElements) /* 45 */ -#endif -#ifndef Tcl_ListObjIndex -#define Tcl_ListObjIndex \ - (tclStubsPtr->tcl_ListObjIndex) /* 46 */ -#endif -#ifndef Tcl_ListObjLength -#define Tcl_ListObjLength \ - (tclStubsPtr->tcl_ListObjLength) /* 47 */ -#endif -#ifndef Tcl_ListObjReplace -#define Tcl_ListObjReplace \ - (tclStubsPtr->tcl_ListObjReplace) /* 48 */ -#endif -#ifndef Tcl_NewBooleanObj -#define Tcl_NewBooleanObj \ - (tclStubsPtr->tcl_NewBooleanObj) /* 49 */ -#endif -#ifndef Tcl_NewByteArrayObj -#define Tcl_NewByteArrayObj \ - (tclStubsPtr->tcl_NewByteArrayObj) /* 50 */ -#endif -#ifndef Tcl_NewDoubleObj -#define Tcl_NewDoubleObj \ - (tclStubsPtr->tcl_NewDoubleObj) /* 51 */ -#endif -#ifndef Tcl_NewIntObj -#define Tcl_NewIntObj \ - (tclStubsPtr->tcl_NewIntObj) /* 52 */ -#endif -#ifndef Tcl_NewListObj -#define Tcl_NewListObj \ - (tclStubsPtr->tcl_NewListObj) /* 53 */ -#endif -#ifndef Tcl_NewLongObj -#define Tcl_NewLongObj \ - (tclStubsPtr->tcl_NewLongObj) /* 54 */ -#endif -#ifndef Tcl_NewObj -#define Tcl_NewObj \ - (tclStubsPtr->tcl_NewObj) /* 55 */ -#endif -#ifndef Tcl_NewStringObj -#define Tcl_NewStringObj \ - (tclStubsPtr->tcl_NewStringObj) /* 56 */ -#endif -#ifndef Tcl_SetBooleanObj -#define Tcl_SetBooleanObj \ - (tclStubsPtr->tcl_SetBooleanObj) /* 57 */ -#endif -#ifndef Tcl_SetByteArrayLength -#define Tcl_SetByteArrayLength \ - (tclStubsPtr->tcl_SetByteArrayLength) /* 58 */ -#endif -#ifndef Tcl_SetByteArrayObj -#define Tcl_SetByteArrayObj \ - (tclStubsPtr->tcl_SetByteArrayObj) /* 59 */ -#endif -#ifndef Tcl_SetDoubleObj -#define Tcl_SetDoubleObj \ - (tclStubsPtr->tcl_SetDoubleObj) /* 60 */ -#endif -#ifndef Tcl_SetIntObj -#define Tcl_SetIntObj \ - (tclStubsPtr->tcl_SetIntObj) /* 61 */ -#endif -#ifndef Tcl_SetListObj -#define Tcl_SetListObj \ - (tclStubsPtr->tcl_SetListObj) /* 62 */ -#endif -#ifndef Tcl_SetLongObj -#define Tcl_SetLongObj \ - (tclStubsPtr->tcl_SetLongObj) /* 63 */ -#endif -#ifndef Tcl_SetObjLength -#define Tcl_SetObjLength \ - (tclStubsPtr->tcl_SetObjLength) /* 64 */ -#endif -#ifndef Tcl_SetStringObj -#define Tcl_SetStringObj \ - (tclStubsPtr->tcl_SetStringObj) /* 65 */ -#endif -#ifndef Tcl_AddErrorInfo -#define Tcl_AddErrorInfo \ - (tclStubsPtr->tcl_AddErrorInfo) /* 66 */ -#endif -#ifndef Tcl_AddObjErrorInfo -#define Tcl_AddObjErrorInfo \ - (tclStubsPtr->tcl_AddObjErrorInfo) /* 67 */ -#endif -#ifndef Tcl_AllowExceptions -#define Tcl_AllowExceptions \ - (tclStubsPtr->tcl_AllowExceptions) /* 68 */ -#endif -#ifndef Tcl_AppendElement -#define Tcl_AppendElement \ - (tclStubsPtr->tcl_AppendElement) /* 69 */ -#endif -#ifndef Tcl_AppendResult -#define Tcl_AppendResult \ - (tclStubsPtr->tcl_AppendResult) /* 70 */ -#endif -#ifndef Tcl_AsyncCreate -#define Tcl_AsyncCreate \ - (tclStubsPtr->tcl_AsyncCreate) /* 71 */ -#endif -#ifndef Tcl_AsyncDelete -#define Tcl_AsyncDelete \ - (tclStubsPtr->tcl_AsyncDelete) /* 72 */ -#endif -#ifndef Tcl_AsyncInvoke -#define Tcl_AsyncInvoke \ - (tclStubsPtr->tcl_AsyncInvoke) /* 73 */ -#endif -#ifndef Tcl_AsyncMark -#define Tcl_AsyncMark \ - (tclStubsPtr->tcl_AsyncMark) /* 74 */ -#endif -#ifndef Tcl_AsyncReady -#define Tcl_AsyncReady \ - (tclStubsPtr->tcl_AsyncReady) /* 75 */ -#endif -#ifndef Tcl_BackgroundError -#define Tcl_BackgroundError \ - (tclStubsPtr->tcl_BackgroundError) /* 76 */ -#endif -#ifndef Tcl_Backslash -#define Tcl_Backslash \ - (tclStubsPtr->tcl_Backslash) /* 77 */ -#endif -#ifndef Tcl_BadChannelOption -#define Tcl_BadChannelOption \ - (tclStubsPtr->tcl_BadChannelOption) /* 78 */ -#endif -#ifndef Tcl_CallWhenDeleted -#define Tcl_CallWhenDeleted \ - (tclStubsPtr->tcl_CallWhenDeleted) /* 79 */ -#endif -#ifndef Tcl_CancelIdleCall -#define Tcl_CancelIdleCall \ - (tclStubsPtr->tcl_CancelIdleCall) /* 80 */ -#endif -#ifndef Tcl_Close -#define Tcl_Close \ - (tclStubsPtr->tcl_Close) /* 81 */ -#endif -#ifndef Tcl_CommandComplete -#define Tcl_CommandComplete \ - (tclStubsPtr->tcl_CommandComplete) /* 82 */ -#endif -#ifndef Tcl_Concat -#define Tcl_Concat \ - (tclStubsPtr->tcl_Concat) /* 83 */ -#endif -#ifndef Tcl_ConvertElement -#define Tcl_ConvertElement \ - (tclStubsPtr->tcl_ConvertElement) /* 84 */ -#endif -#ifndef Tcl_ConvertCountedElement -#define Tcl_ConvertCountedElement \ - (tclStubsPtr->tcl_ConvertCountedElement) /* 85 */ -#endif -#ifndef Tcl_CreateAlias -#define Tcl_CreateAlias \ - (tclStubsPtr->tcl_CreateAlias) /* 86 */ -#endif -#ifndef Tcl_CreateAliasObj -#define Tcl_CreateAliasObj \ - (tclStubsPtr->tcl_CreateAliasObj) /* 87 */ -#endif -#ifndef Tcl_CreateChannel -#define Tcl_CreateChannel \ - (tclStubsPtr->tcl_CreateChannel) /* 88 */ -#endif -#ifndef Tcl_CreateChannelHandler -#define Tcl_CreateChannelHandler \ - (tclStubsPtr->tcl_CreateChannelHandler) /* 89 */ -#endif -#ifndef Tcl_CreateCloseHandler -#define Tcl_CreateCloseHandler \ - (tclStubsPtr->tcl_CreateCloseHandler) /* 90 */ -#endif -#ifndef Tcl_CreateCommand -#define Tcl_CreateCommand \ - (tclStubsPtr->tcl_CreateCommand) /* 91 */ -#endif -#ifndef Tcl_CreateEventSource -#define Tcl_CreateEventSource \ - (tclStubsPtr->tcl_CreateEventSource) /* 92 */ -#endif -#ifndef Tcl_CreateExitHandler -#define Tcl_CreateExitHandler \ - (tclStubsPtr->tcl_CreateExitHandler) /* 93 */ -#endif -#ifndef Tcl_CreateInterp -#define Tcl_CreateInterp \ - (tclStubsPtr->tcl_CreateInterp) /* 94 */ -#endif -#ifndef Tcl_CreateMathFunc -#define Tcl_CreateMathFunc \ - (tclStubsPtr->tcl_CreateMathFunc) /* 95 */ -#endif -#ifndef Tcl_CreateObjCommand -#define Tcl_CreateObjCommand \ - (tclStubsPtr->tcl_CreateObjCommand) /* 96 */ -#endif -#ifndef Tcl_CreateSlave -#define Tcl_CreateSlave \ - (tclStubsPtr->tcl_CreateSlave) /* 97 */ -#endif -#ifndef Tcl_CreateTimerHandler -#define Tcl_CreateTimerHandler \ - (tclStubsPtr->tcl_CreateTimerHandler) /* 98 */ -#endif -#ifndef Tcl_CreateTrace -#define Tcl_CreateTrace \ - (tclStubsPtr->tcl_CreateTrace) /* 99 */ -#endif -#ifndef Tcl_DeleteAssocData -#define Tcl_DeleteAssocData \ - (tclStubsPtr->tcl_DeleteAssocData) /* 100 */ -#endif -#ifndef Tcl_DeleteChannelHandler -#define Tcl_DeleteChannelHandler \ - (tclStubsPtr->tcl_DeleteChannelHandler) /* 101 */ -#endif -#ifndef Tcl_DeleteCloseHandler -#define Tcl_DeleteCloseHandler \ - (tclStubsPtr->tcl_DeleteCloseHandler) /* 102 */ -#endif -#ifndef Tcl_DeleteCommand -#define Tcl_DeleteCommand \ - (tclStubsPtr->tcl_DeleteCommand) /* 103 */ -#endif -#ifndef Tcl_DeleteCommandFromToken -#define Tcl_DeleteCommandFromToken \ - (tclStubsPtr->tcl_DeleteCommandFromToken) /* 104 */ -#endif -#ifndef Tcl_DeleteEvents -#define Tcl_DeleteEvents \ - (tclStubsPtr->tcl_DeleteEvents) /* 105 */ -#endif -#ifndef Tcl_DeleteEventSource -#define Tcl_DeleteEventSource \ - (tclStubsPtr->tcl_DeleteEventSource) /* 106 */ -#endif -#ifndef Tcl_DeleteExitHandler -#define Tcl_DeleteExitHandler \ - (tclStubsPtr->tcl_DeleteExitHandler) /* 107 */ -#endif -#ifndef Tcl_DeleteHashEntry -#define Tcl_DeleteHashEntry \ - (tclStubsPtr->tcl_DeleteHashEntry) /* 108 */ -#endif -#ifndef Tcl_DeleteHashTable -#define Tcl_DeleteHashTable \ - (tclStubsPtr->tcl_DeleteHashTable) /* 109 */ -#endif -#ifndef Tcl_DeleteInterp -#define Tcl_DeleteInterp \ - (tclStubsPtr->tcl_DeleteInterp) /* 110 */ -#endif -#ifndef Tcl_DetachPids -#define Tcl_DetachPids \ - (tclStubsPtr->tcl_DetachPids) /* 111 */ -#endif -#ifndef Tcl_DeleteTimerHandler -#define Tcl_DeleteTimerHandler \ - (tclStubsPtr->tcl_DeleteTimerHandler) /* 112 */ -#endif -#ifndef Tcl_DeleteTrace -#define Tcl_DeleteTrace \ - (tclStubsPtr->tcl_DeleteTrace) /* 113 */ -#endif -#ifndef Tcl_DontCallWhenDeleted -#define Tcl_DontCallWhenDeleted \ - (tclStubsPtr->tcl_DontCallWhenDeleted) /* 114 */ -#endif -#ifndef Tcl_DoOneEvent -#define Tcl_DoOneEvent \ - (tclStubsPtr->tcl_DoOneEvent) /* 115 */ -#endif -#ifndef Tcl_DoWhenIdle -#define Tcl_DoWhenIdle \ - (tclStubsPtr->tcl_DoWhenIdle) /* 116 */ -#endif -#ifndef Tcl_DStringAppend -#define Tcl_DStringAppend \ - (tclStubsPtr->tcl_DStringAppend) /* 117 */ -#endif -#ifndef Tcl_DStringAppendElement -#define Tcl_DStringAppendElement \ - (tclStubsPtr->tcl_DStringAppendElement) /* 118 */ -#endif -#ifndef Tcl_DStringEndSublist -#define Tcl_DStringEndSublist \ - (tclStubsPtr->tcl_DStringEndSublist) /* 119 */ -#endif -#ifndef Tcl_DStringFree -#define Tcl_DStringFree \ - (tclStubsPtr->tcl_DStringFree) /* 120 */ -#endif -#ifndef Tcl_DStringGetResult -#define Tcl_DStringGetResult \ - (tclStubsPtr->tcl_DStringGetResult) /* 121 */ -#endif -#ifndef Tcl_DStringInit -#define Tcl_DStringInit \ - (tclStubsPtr->tcl_DStringInit) /* 122 */ -#endif -#ifndef Tcl_DStringResult -#define Tcl_DStringResult \ - (tclStubsPtr->tcl_DStringResult) /* 123 */ -#endif -#ifndef Tcl_DStringSetLength -#define Tcl_DStringSetLength \ - (tclStubsPtr->tcl_DStringSetLength) /* 124 */ -#endif -#ifndef Tcl_DStringStartSublist -#define Tcl_DStringStartSublist \ - (tclStubsPtr->tcl_DStringStartSublist) /* 125 */ -#endif -#ifndef Tcl_Eof -#define Tcl_Eof \ - (tclStubsPtr->tcl_Eof) /* 126 */ -#endif -#ifndef Tcl_ErrnoId -#define Tcl_ErrnoId \ - (tclStubsPtr->tcl_ErrnoId) /* 127 */ -#endif -#ifndef Tcl_ErrnoMsg -#define Tcl_ErrnoMsg \ - (tclStubsPtr->tcl_ErrnoMsg) /* 128 */ -#endif -#ifndef Tcl_Eval -#define Tcl_Eval \ - (tclStubsPtr->tcl_Eval) /* 129 */ -#endif -#ifndef Tcl_EvalFile -#define Tcl_EvalFile \ - (tclStubsPtr->tcl_EvalFile) /* 130 */ -#endif -#ifndef Tcl_EvalObj -#define Tcl_EvalObj \ - (tclStubsPtr->tcl_EvalObj) /* 131 */ -#endif -#ifndef Tcl_EventuallyFree -#define Tcl_EventuallyFree \ - (tclStubsPtr->tcl_EventuallyFree) /* 132 */ -#endif -#ifndef Tcl_Exit -#define Tcl_Exit \ - (tclStubsPtr->tcl_Exit) /* 133 */ -#endif -#ifndef Tcl_ExposeCommand -#define Tcl_ExposeCommand \ - (tclStubsPtr->tcl_ExposeCommand) /* 134 */ -#endif -#ifndef Tcl_ExprBoolean -#define Tcl_ExprBoolean \ - (tclStubsPtr->tcl_ExprBoolean) /* 135 */ -#endif -#ifndef Tcl_ExprBooleanObj -#define Tcl_ExprBooleanObj \ - (tclStubsPtr->tcl_ExprBooleanObj) /* 136 */ -#endif -#ifndef Tcl_ExprDouble -#define Tcl_ExprDouble \ - (tclStubsPtr->tcl_ExprDouble) /* 137 */ -#endif -#ifndef Tcl_ExprDoubleObj -#define Tcl_ExprDoubleObj \ - (tclStubsPtr->tcl_ExprDoubleObj) /* 138 */ -#endif -#ifndef Tcl_ExprLong -#define Tcl_ExprLong \ - (tclStubsPtr->tcl_ExprLong) /* 139 */ -#endif -#ifndef Tcl_ExprLongObj -#define Tcl_ExprLongObj \ - (tclStubsPtr->tcl_ExprLongObj) /* 140 */ -#endif -#ifndef Tcl_ExprObj -#define Tcl_ExprObj \ - (tclStubsPtr->tcl_ExprObj) /* 141 */ -#endif -#ifndef Tcl_ExprString -#define Tcl_ExprString \ - (tclStubsPtr->tcl_ExprString) /* 142 */ -#endif -#ifndef Tcl_Finalize -#define Tcl_Finalize \ - (tclStubsPtr->tcl_Finalize) /* 143 */ -#endif -#ifndef Tcl_FindExecutable -#define Tcl_FindExecutable \ - (tclStubsPtr->tcl_FindExecutable) /* 144 */ -#endif -#ifndef Tcl_FirstHashEntry -#define Tcl_FirstHashEntry \ - (tclStubsPtr->tcl_FirstHashEntry) /* 145 */ -#endif -#ifndef Tcl_Flush -#define Tcl_Flush \ - (tclStubsPtr->tcl_Flush) /* 146 */ -#endif -#ifndef Tcl_FreeResult -#define Tcl_FreeResult \ - (tclStubsPtr->tcl_FreeResult) /* 147 */ -#endif -#ifndef Tcl_GetAlias -#define Tcl_GetAlias \ - (tclStubsPtr->tcl_GetAlias) /* 148 */ -#endif -#ifndef Tcl_GetAliasObj -#define Tcl_GetAliasObj \ - (tclStubsPtr->tcl_GetAliasObj) /* 149 */ -#endif -#ifndef Tcl_GetAssocData -#define Tcl_GetAssocData \ - (tclStubsPtr->tcl_GetAssocData) /* 150 */ -#endif -#ifndef Tcl_GetChannel -#define Tcl_GetChannel \ - (tclStubsPtr->tcl_GetChannel) /* 151 */ -#endif -#ifndef Tcl_GetChannelBufferSize -#define Tcl_GetChannelBufferSize \ - (tclStubsPtr->tcl_GetChannelBufferSize) /* 152 */ -#endif -#ifndef Tcl_GetChannelHandle -#define Tcl_GetChannelHandle \ - (tclStubsPtr->tcl_GetChannelHandle) /* 153 */ -#endif -#ifndef Tcl_GetChannelInstanceData -#define Tcl_GetChannelInstanceData \ - (tclStubsPtr->tcl_GetChannelInstanceData) /* 154 */ -#endif -#ifndef Tcl_GetChannelMode -#define Tcl_GetChannelMode \ - (tclStubsPtr->tcl_GetChannelMode) /* 155 */ -#endif -#ifndef Tcl_GetChannelName -#define Tcl_GetChannelName \ - (tclStubsPtr->tcl_GetChannelName) /* 156 */ -#endif -#ifndef Tcl_GetChannelOption -#define Tcl_GetChannelOption \ - (tclStubsPtr->tcl_GetChannelOption) /* 157 */ -#endif -#ifndef Tcl_GetChannelType -#define Tcl_GetChannelType \ - (tclStubsPtr->tcl_GetChannelType) /* 158 */ -#endif -#ifndef Tcl_GetCommandInfo -#define Tcl_GetCommandInfo \ - (tclStubsPtr->tcl_GetCommandInfo) /* 159 */ -#endif -#ifndef Tcl_GetCommandName -#define Tcl_GetCommandName \ - (tclStubsPtr->tcl_GetCommandName) /* 160 */ -#endif -#ifndef Tcl_GetErrno -#define Tcl_GetErrno \ - (tclStubsPtr->tcl_GetErrno) /* 161 */ -#endif -#ifndef Tcl_GetHostName -#define Tcl_GetHostName \ - (tclStubsPtr->tcl_GetHostName) /* 162 */ -#endif -#ifndef Tcl_GetInterpPath -#define Tcl_GetInterpPath \ - (tclStubsPtr->tcl_GetInterpPath) /* 163 */ -#endif -#ifndef Tcl_GetMaster -#define Tcl_GetMaster \ - (tclStubsPtr->tcl_GetMaster) /* 164 */ -#endif -#ifndef Tcl_GetNameOfExecutable -#define Tcl_GetNameOfExecutable \ - (tclStubsPtr->tcl_GetNameOfExecutable) /* 165 */ -#endif -#ifndef Tcl_GetObjResult -#define Tcl_GetObjResult \ - (tclStubsPtr->tcl_GetObjResult) /* 166 */ -#endif -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef Tcl_GetOpenFile -#define Tcl_GetOpenFile \ - (tclStubsPtr->tcl_GetOpenFile) /* 167 */ -#endif -#endif /* UNIX */ -#ifndef Tcl_GetPathType -#define Tcl_GetPathType \ - (tclStubsPtr->tcl_GetPathType) /* 168 */ -#endif -#ifndef Tcl_Gets -#define Tcl_Gets \ - (tclStubsPtr->tcl_Gets) /* 169 */ -#endif -#ifndef Tcl_GetsObj -#define Tcl_GetsObj \ - (tclStubsPtr->tcl_GetsObj) /* 170 */ -#endif -#ifndef Tcl_GetServiceMode -#define Tcl_GetServiceMode \ - (tclStubsPtr->tcl_GetServiceMode) /* 171 */ -#endif -#ifndef Tcl_GetSlave -#define Tcl_GetSlave \ - (tclStubsPtr->tcl_GetSlave) /* 172 */ -#endif -#ifndef Tcl_GetStdChannel -#define Tcl_GetStdChannel \ - (tclStubsPtr->tcl_GetStdChannel) /* 173 */ -#endif -#ifndef Tcl_GetStringResult -#define Tcl_GetStringResult \ - (tclStubsPtr->tcl_GetStringResult) /* 174 */ -#endif -#ifndef Tcl_GetVar -#define Tcl_GetVar \ - (tclStubsPtr->tcl_GetVar) /* 175 */ -#endif -#ifndef Tcl_GetVar2 -#define Tcl_GetVar2 \ - (tclStubsPtr->tcl_GetVar2) /* 176 */ -#endif -#ifndef Tcl_GlobalEval -#define Tcl_GlobalEval \ - (tclStubsPtr->tcl_GlobalEval) /* 177 */ -#endif -#ifndef Tcl_GlobalEvalObj -#define Tcl_GlobalEvalObj \ - (tclStubsPtr->tcl_GlobalEvalObj) /* 178 */ -#endif -#ifndef Tcl_HideCommand -#define Tcl_HideCommand \ - (tclStubsPtr->tcl_HideCommand) /* 179 */ -#endif -#ifndef Tcl_Init -#define Tcl_Init \ - (tclStubsPtr->tcl_Init) /* 180 */ -#endif -#ifndef Tcl_InitHashTable -#define Tcl_InitHashTable \ - (tclStubsPtr->tcl_InitHashTable) /* 181 */ -#endif -#ifndef Tcl_InputBlocked -#define Tcl_InputBlocked \ - (tclStubsPtr->tcl_InputBlocked) /* 182 */ -#endif -#ifndef Tcl_InputBuffered -#define Tcl_InputBuffered \ - (tclStubsPtr->tcl_InputBuffered) /* 183 */ -#endif -#ifndef Tcl_InterpDeleted -#define Tcl_InterpDeleted \ - (tclStubsPtr->tcl_InterpDeleted) /* 184 */ -#endif -#ifndef Tcl_IsSafe -#define Tcl_IsSafe \ - (tclStubsPtr->tcl_IsSafe) /* 185 */ -#endif -#ifndef Tcl_JoinPath -#define Tcl_JoinPath \ - (tclStubsPtr->tcl_JoinPath) /* 186 */ -#endif -#ifndef Tcl_LinkVar -#define Tcl_LinkVar \ - (tclStubsPtr->tcl_LinkVar) /* 187 */ -#endif -/* Slot 188 is reserved */ -#ifndef Tcl_MakeFileChannel -#define Tcl_MakeFileChannel \ - (tclStubsPtr->tcl_MakeFileChannel) /* 189 */ -#endif -#ifndef Tcl_MakeSafe -#define Tcl_MakeSafe \ - (tclStubsPtr->tcl_MakeSafe) /* 190 */ -#endif -#ifndef Tcl_MakeTcpClientChannel -#define Tcl_MakeTcpClientChannel \ - (tclStubsPtr->tcl_MakeTcpClientChannel) /* 191 */ -#endif -#ifndef Tcl_Merge -#define Tcl_Merge \ - (tclStubsPtr->tcl_Merge) /* 192 */ -#endif -#ifndef Tcl_NextHashEntry -#define Tcl_NextHashEntry \ - (tclStubsPtr->tcl_NextHashEntry) /* 193 */ -#endif -#ifndef Tcl_NotifyChannel -#define Tcl_NotifyChannel \ - (tclStubsPtr->tcl_NotifyChannel) /* 194 */ -#endif -#ifndef Tcl_ObjGetVar2 -#define Tcl_ObjGetVar2 \ - (tclStubsPtr->tcl_ObjGetVar2) /* 195 */ -#endif -#ifndef Tcl_ObjSetVar2 -#define Tcl_ObjSetVar2 \ - (tclStubsPtr->tcl_ObjSetVar2) /* 196 */ -#endif -#ifndef Tcl_OpenCommandChannel -#define Tcl_OpenCommandChannel \ - (tclStubsPtr->tcl_OpenCommandChannel) /* 197 */ -#endif -#ifndef Tcl_OpenFileChannel -#define Tcl_OpenFileChannel \ - (tclStubsPtr->tcl_OpenFileChannel) /* 198 */ -#endif -#ifndef Tcl_OpenTcpClient -#define Tcl_OpenTcpClient \ - (tclStubsPtr->tcl_OpenTcpClient) /* 199 */ -#endif -#ifndef Tcl_OpenTcpServer -#define Tcl_OpenTcpServer \ - (tclStubsPtr->tcl_OpenTcpServer) /* 200 */ -#endif -#ifndef Tcl_Preserve -#define Tcl_Preserve \ - (tclStubsPtr->tcl_Preserve) /* 201 */ -#endif -#ifndef Tcl_PrintDouble -#define Tcl_PrintDouble \ - (tclStubsPtr->tcl_PrintDouble) /* 202 */ -#endif -#ifndef Tcl_PutEnv -#define Tcl_PutEnv \ - (tclStubsPtr->tcl_PutEnv) /* 203 */ -#endif -#ifndef Tcl_PosixError -#define Tcl_PosixError \ - (tclStubsPtr->tcl_PosixError) /* 204 */ -#endif -#ifndef Tcl_QueueEvent -#define Tcl_QueueEvent \ - (tclStubsPtr->tcl_QueueEvent) /* 205 */ -#endif -#ifndef Tcl_Read -#define Tcl_Read \ - (tclStubsPtr->tcl_Read) /* 206 */ -#endif -#ifndef Tcl_ReapDetachedProcs -#define Tcl_ReapDetachedProcs \ - (tclStubsPtr->tcl_ReapDetachedProcs) /* 207 */ -#endif -#ifndef Tcl_RecordAndEval -#define Tcl_RecordAndEval \ - (tclStubsPtr->tcl_RecordAndEval) /* 208 */ -#endif -#ifndef Tcl_RecordAndEvalObj -#define Tcl_RecordAndEvalObj \ - (tclStubsPtr->tcl_RecordAndEvalObj) /* 209 */ -#endif -#ifndef Tcl_RegisterChannel -#define Tcl_RegisterChannel \ - (tclStubsPtr->tcl_RegisterChannel) /* 210 */ -#endif -#ifndef Tcl_RegisterObjType -#define Tcl_RegisterObjType \ - (tclStubsPtr->tcl_RegisterObjType) /* 211 */ -#endif -#ifndef Tcl_RegExpCompile -#define Tcl_RegExpCompile \ - (tclStubsPtr->tcl_RegExpCompile) /* 212 */ -#endif -#ifndef Tcl_RegExpExec -#define Tcl_RegExpExec \ - (tclStubsPtr->tcl_RegExpExec) /* 213 */ -#endif -#ifndef Tcl_RegExpMatch -#define Tcl_RegExpMatch \ - (tclStubsPtr->tcl_RegExpMatch) /* 214 */ -#endif -#ifndef Tcl_RegExpRange -#define Tcl_RegExpRange \ - (tclStubsPtr->tcl_RegExpRange) /* 215 */ -#endif -#ifndef Tcl_Release -#define Tcl_Release \ - (tclStubsPtr->tcl_Release) /* 216 */ -#endif -#ifndef Tcl_ResetResult -#define Tcl_ResetResult \ - (tclStubsPtr->tcl_ResetResult) /* 217 */ -#endif -#ifndef Tcl_ScanElement -#define Tcl_ScanElement \ - (tclStubsPtr->tcl_ScanElement) /* 218 */ -#endif -#ifndef Tcl_ScanCountedElement -#define Tcl_ScanCountedElement \ - (tclStubsPtr->tcl_ScanCountedElement) /* 219 */ -#endif -#ifndef Tcl_Seek -#define Tcl_Seek \ - (tclStubsPtr->tcl_Seek) /* 220 */ -#endif -#ifndef Tcl_ServiceAll -#define Tcl_ServiceAll \ - (tclStubsPtr->tcl_ServiceAll) /* 221 */ -#endif -#ifndef Tcl_ServiceEvent -#define Tcl_ServiceEvent \ - (tclStubsPtr->tcl_ServiceEvent) /* 222 */ -#endif -#ifndef Tcl_SetAssocData -#define Tcl_SetAssocData \ - (tclStubsPtr->tcl_SetAssocData) /* 223 */ -#endif -#ifndef Tcl_SetChannelBufferSize -#define Tcl_SetChannelBufferSize \ - (tclStubsPtr->tcl_SetChannelBufferSize) /* 224 */ -#endif -#ifndef Tcl_SetChannelOption -#define Tcl_SetChannelOption \ - (tclStubsPtr->tcl_SetChannelOption) /* 225 */ -#endif -#ifndef Tcl_SetCommandInfo -#define Tcl_SetCommandInfo \ - (tclStubsPtr->tcl_SetCommandInfo) /* 226 */ -#endif -#ifndef Tcl_SetErrno -#define Tcl_SetErrno \ - (tclStubsPtr->tcl_SetErrno) /* 227 */ -#endif -#ifndef Tcl_SetErrorCode -#define Tcl_SetErrorCode \ - (tclStubsPtr->tcl_SetErrorCode) /* 228 */ -#endif -#ifndef Tcl_SetMaxBlockTime -#define Tcl_SetMaxBlockTime \ - (tclStubsPtr->tcl_SetMaxBlockTime) /* 229 */ -#endif -#ifndef Tcl_SetPanicProc -#define Tcl_SetPanicProc \ - (tclStubsPtr->tcl_SetPanicProc) /* 230 */ -#endif -#ifndef Tcl_SetRecursionLimit -#define Tcl_SetRecursionLimit \ - (tclStubsPtr->tcl_SetRecursionLimit) /* 231 */ -#endif -#ifndef Tcl_SetResult -#define Tcl_SetResult \ - (tclStubsPtr->tcl_SetResult) /* 232 */ -#endif -#ifndef Tcl_SetServiceMode -#define Tcl_SetServiceMode \ - (tclStubsPtr->tcl_SetServiceMode) /* 233 */ -#endif -#ifndef Tcl_SetObjErrorCode -#define Tcl_SetObjErrorCode \ - (tclStubsPtr->tcl_SetObjErrorCode) /* 234 */ -#endif -#ifndef Tcl_SetObjResult -#define Tcl_SetObjResult \ - (tclStubsPtr->tcl_SetObjResult) /* 235 */ -#endif -#ifndef Tcl_SetStdChannel -#define Tcl_SetStdChannel \ - (tclStubsPtr->tcl_SetStdChannel) /* 236 */ -#endif -#ifndef Tcl_SetVar -#define Tcl_SetVar \ - (tclStubsPtr->tcl_SetVar) /* 237 */ -#endif -#ifndef Tcl_SetVar2 -#define Tcl_SetVar2 \ - (tclStubsPtr->tcl_SetVar2) /* 238 */ -#endif -#ifndef Tcl_SignalId -#define Tcl_SignalId \ - (tclStubsPtr->tcl_SignalId) /* 239 */ -#endif -#ifndef Tcl_SignalMsg -#define Tcl_SignalMsg \ - (tclStubsPtr->tcl_SignalMsg) /* 240 */ -#endif -#ifndef Tcl_SourceRCFile -#define Tcl_SourceRCFile \ - (tclStubsPtr->tcl_SourceRCFile) /* 241 */ -#endif -#ifndef Tcl_SplitList -#define Tcl_SplitList \ - (tclStubsPtr->tcl_SplitList) /* 242 */ -#endif -#ifndef Tcl_SplitPath -#define Tcl_SplitPath \ - (tclStubsPtr->tcl_SplitPath) /* 243 */ -#endif -#ifndef Tcl_StaticPackage -#define Tcl_StaticPackage \ - (tclStubsPtr->tcl_StaticPackage) /* 244 */ -#endif -#ifndef Tcl_StringMatch -#define Tcl_StringMatch \ - (tclStubsPtr->tcl_StringMatch) /* 245 */ -#endif -#ifndef Tcl_Tell -#define Tcl_Tell \ - (tclStubsPtr->tcl_Tell) /* 246 */ -#endif -#ifndef Tcl_TraceVar -#define Tcl_TraceVar \ - (tclStubsPtr->tcl_TraceVar) /* 247 */ -#endif -#ifndef Tcl_TraceVar2 -#define Tcl_TraceVar2 \ - (tclStubsPtr->tcl_TraceVar2) /* 248 */ -#endif -#ifndef Tcl_TranslateFileName -#define Tcl_TranslateFileName \ - (tclStubsPtr->tcl_TranslateFileName) /* 249 */ -#endif -#ifndef Tcl_Ungets -#define Tcl_Ungets \ - (tclStubsPtr->tcl_Ungets) /* 250 */ -#endif -#ifndef Tcl_UnlinkVar -#define Tcl_UnlinkVar \ - (tclStubsPtr->tcl_UnlinkVar) /* 251 */ -#endif -#ifndef Tcl_UnregisterChannel -#define Tcl_UnregisterChannel \ - (tclStubsPtr->tcl_UnregisterChannel) /* 252 */ -#endif -#ifndef Tcl_UnsetVar -#define Tcl_UnsetVar \ - (tclStubsPtr->tcl_UnsetVar) /* 253 */ -#endif -#ifndef Tcl_UnsetVar2 -#define Tcl_UnsetVar2 \ - (tclStubsPtr->tcl_UnsetVar2) /* 254 */ -#endif -#ifndef Tcl_UntraceVar -#define Tcl_UntraceVar \ - (tclStubsPtr->tcl_UntraceVar) /* 255 */ -#endif -#ifndef Tcl_UntraceVar2 -#define Tcl_UntraceVar2 \ - (tclStubsPtr->tcl_UntraceVar2) /* 256 */ -#endif -#ifndef Tcl_UpdateLinkedVar -#define Tcl_UpdateLinkedVar \ - (tclStubsPtr->tcl_UpdateLinkedVar) /* 257 */ -#endif -#ifndef Tcl_UpVar -#define Tcl_UpVar \ - (tclStubsPtr->tcl_UpVar) /* 258 */ -#endif -#ifndef Tcl_UpVar2 -#define Tcl_UpVar2 \ - (tclStubsPtr->tcl_UpVar2) /* 259 */ -#endif -#ifndef Tcl_VarEval -#define Tcl_VarEval \ - (tclStubsPtr->tcl_VarEval) /* 260 */ -#endif -#ifndef Tcl_VarTraceInfo -#define Tcl_VarTraceInfo \ - (tclStubsPtr->tcl_VarTraceInfo) /* 261 */ -#endif -#ifndef Tcl_VarTraceInfo2 -#define Tcl_VarTraceInfo2 \ - (tclStubsPtr->tcl_VarTraceInfo2) /* 262 */ -#endif -#ifndef Tcl_Write -#define Tcl_Write \ - (tclStubsPtr->tcl_Write) /* 263 */ -#endif -#ifndef Tcl_WrongNumArgs -#define Tcl_WrongNumArgs \ - (tclStubsPtr->tcl_WrongNumArgs) /* 264 */ -#endif -#ifndef Tcl_DumpActiveMemory -#define Tcl_DumpActiveMemory \ - (tclStubsPtr->tcl_DumpActiveMemory) /* 265 */ -#endif -#ifndef Tcl_ValidateAllMemory -#define Tcl_ValidateAllMemory \ - (tclStubsPtr->tcl_ValidateAllMemory) /* 266 */ -#endif -#ifndef Tcl_AppendResultVA -#define Tcl_AppendResultVA \ - (tclStubsPtr->tcl_AppendResultVA) /* 267 */ -#endif -#ifndef Tcl_AppendStringsToObjVA -#define Tcl_AppendStringsToObjVA \ - (tclStubsPtr->tcl_AppendStringsToObjVA) /* 268 */ -#endif -#ifndef Tcl_HashStats -#define Tcl_HashStats \ - (tclStubsPtr->tcl_HashStats) /* 269 */ -#endif -#ifndef Tcl_ParseVar -#define Tcl_ParseVar \ - (tclStubsPtr->tcl_ParseVar) /* 270 */ -#endif -#ifndef Tcl_PkgPresent -#define Tcl_PkgPresent \ - (tclStubsPtr->tcl_PkgPresent) /* 271 */ -#endif -#ifndef Tcl_PkgPresentEx -#define Tcl_PkgPresentEx \ - (tclStubsPtr->tcl_PkgPresentEx) /* 272 */ -#endif -#ifndef Tcl_PkgProvide -#define Tcl_PkgProvide \ - (tclStubsPtr->tcl_PkgProvide) /* 273 */ -#endif -#ifndef Tcl_PkgRequire -#define Tcl_PkgRequire \ - (tclStubsPtr->tcl_PkgRequire) /* 274 */ -#endif -#ifndef Tcl_SetErrorCodeVA -#define Tcl_SetErrorCodeVA \ - (tclStubsPtr->tcl_SetErrorCodeVA) /* 275 */ -#endif -#ifndef Tcl_VarEvalVA -#define Tcl_VarEvalVA \ - (tclStubsPtr->tcl_VarEvalVA) /* 276 */ -#endif -#ifndef Tcl_WaitPid -#define Tcl_WaitPid \ - (tclStubsPtr->tcl_WaitPid) /* 277 */ -#endif -#ifndef Tcl_PanicVA -#define Tcl_PanicVA \ - (tclStubsPtr->tcl_PanicVA) /* 278 */ -#endif -#ifndef Tcl_GetVersion -#define Tcl_GetVersion \ - (tclStubsPtr->tcl_GetVersion) /* 279 */ -#endif -#ifndef Tcl_InitMemory -#define Tcl_InitMemory \ - (tclStubsPtr->tcl_InitMemory) /* 280 */ -#endif -/* Slot 281 is reserved */ -/* Slot 282 is reserved */ -/* Slot 283 is reserved */ -/* Slot 284 is reserved */ -/* Slot 285 is reserved */ -#ifndef Tcl_AppendObjToObj -#define Tcl_AppendObjToObj \ - (tclStubsPtr->tcl_AppendObjToObj) /* 286 */ -#endif -#ifndef Tcl_CreateEncoding -#define Tcl_CreateEncoding \ - (tclStubsPtr->tcl_CreateEncoding) /* 287 */ -#endif -#ifndef Tcl_CreateThreadExitHandler -#define Tcl_CreateThreadExitHandler \ - (tclStubsPtr->tcl_CreateThreadExitHandler) /* 288 */ -#endif -#ifndef Tcl_DeleteThreadExitHandler -#define Tcl_DeleteThreadExitHandler \ - (tclStubsPtr->tcl_DeleteThreadExitHandler) /* 289 */ -#endif -#ifndef Tcl_DiscardResult -#define Tcl_DiscardResult \ - (tclStubsPtr->tcl_DiscardResult) /* 290 */ -#endif -#ifndef Tcl_EvalEx -#define Tcl_EvalEx \ - (tclStubsPtr->tcl_EvalEx) /* 291 */ -#endif -#ifndef Tcl_EvalObjv -#define Tcl_EvalObjv \ - (tclStubsPtr->tcl_EvalObjv) /* 292 */ -#endif -#ifndef Tcl_EvalObjEx -#define Tcl_EvalObjEx \ - (tclStubsPtr->tcl_EvalObjEx) /* 293 */ -#endif -#ifndef Tcl_ExitThread -#define Tcl_ExitThread \ - (tclStubsPtr->tcl_ExitThread) /* 294 */ -#endif -#ifndef Tcl_ExternalToUtf -#define Tcl_ExternalToUtf \ - (tclStubsPtr->tcl_ExternalToUtf) /* 295 */ -#endif -#ifndef Tcl_ExternalToUtfDString -#define Tcl_ExternalToUtfDString \ - (tclStubsPtr->tcl_ExternalToUtfDString) /* 296 */ -#endif -#ifndef Tcl_FinalizeThread -#define Tcl_FinalizeThread \ - (tclStubsPtr->tcl_FinalizeThread) /* 297 */ -#endif -#ifndef Tcl_FinalizeNotifier -#define Tcl_FinalizeNotifier \ - (tclStubsPtr->tcl_FinalizeNotifier) /* 298 */ -#endif -#ifndef Tcl_FreeEncoding -#define Tcl_FreeEncoding \ - (tclStubsPtr->tcl_FreeEncoding) /* 299 */ -#endif -#ifndef Tcl_GetCurrentThread -#define Tcl_GetCurrentThread \ - (tclStubsPtr->tcl_GetCurrentThread) /* 300 */ -#endif -#ifndef Tcl_GetEncoding -#define Tcl_GetEncoding \ - (tclStubsPtr->tcl_GetEncoding) /* 301 */ -#endif -#ifndef Tcl_GetEncodingName -#define Tcl_GetEncodingName \ - (tclStubsPtr->tcl_GetEncodingName) /* 302 */ -#endif -#ifndef Tcl_GetEncodingNames -#define Tcl_GetEncodingNames \ - (tclStubsPtr->tcl_GetEncodingNames) /* 303 */ -#endif -#ifndef Tcl_GetIndexFromObjStruct -#define Tcl_GetIndexFromObjStruct \ - (tclStubsPtr->tcl_GetIndexFromObjStruct) /* 304 */ -#endif -#ifndef Tcl_GetThreadData -#define Tcl_GetThreadData \ - (tclStubsPtr->tcl_GetThreadData) /* 305 */ -#endif -#ifndef Tcl_GetVar2Ex -#define Tcl_GetVar2Ex \ - (tclStubsPtr->tcl_GetVar2Ex) /* 306 */ -#endif -#ifndef Tcl_InitNotifier -#define Tcl_InitNotifier \ - (tclStubsPtr->tcl_InitNotifier) /* 307 */ -#endif -#ifndef Tcl_MutexLock -#define Tcl_MutexLock \ - (tclStubsPtr->tcl_MutexLock) /* 308 */ -#endif -#ifndef Tcl_MutexUnlock -#define Tcl_MutexUnlock \ - (tclStubsPtr->tcl_MutexUnlock) /* 309 */ -#endif -#ifndef Tcl_ConditionNotify -#define Tcl_ConditionNotify \ - (tclStubsPtr->tcl_ConditionNotify) /* 310 */ -#endif -#ifndef Tcl_ConditionWait -#define Tcl_ConditionWait \ - (tclStubsPtr->tcl_ConditionWait) /* 311 */ -#endif -#ifndef Tcl_NumUtfChars -#define Tcl_NumUtfChars \ - (tclStubsPtr->tcl_NumUtfChars) /* 312 */ -#endif -#ifndef Tcl_ReadChars -#define Tcl_ReadChars \ - (tclStubsPtr->tcl_ReadChars) /* 313 */ -#endif -#ifndef Tcl_RestoreResult -#define Tcl_RestoreResult \ - (tclStubsPtr->tcl_RestoreResult) /* 314 */ -#endif -#ifndef Tcl_SaveResult -#define Tcl_SaveResult \ - (tclStubsPtr->tcl_SaveResult) /* 315 */ -#endif -#ifndef Tcl_SetSystemEncoding -#define Tcl_SetSystemEncoding \ - (tclStubsPtr->tcl_SetSystemEncoding) /* 316 */ -#endif -#ifndef Tcl_SetVar2Ex -#define Tcl_SetVar2Ex \ - (tclStubsPtr->tcl_SetVar2Ex) /* 317 */ -#endif -#ifndef Tcl_ThreadAlert -#define Tcl_ThreadAlert \ - (tclStubsPtr->tcl_ThreadAlert) /* 318 */ -#endif -#ifndef Tcl_ThreadQueueEvent -#define Tcl_ThreadQueueEvent \ - (tclStubsPtr->tcl_ThreadQueueEvent) /* 319 */ -#endif -#ifndef Tcl_UniCharAtIndex -#define Tcl_UniCharAtIndex \ - (tclStubsPtr->tcl_UniCharAtIndex) /* 320 */ -#endif -#ifndef Tcl_UniCharToLower -#define Tcl_UniCharToLower \ - (tclStubsPtr->tcl_UniCharToLower) /* 321 */ -#endif -#ifndef Tcl_UniCharToTitle -#define Tcl_UniCharToTitle \ - (tclStubsPtr->tcl_UniCharToTitle) /* 322 */ -#endif -#ifndef Tcl_UniCharToUpper -#define Tcl_UniCharToUpper \ - (tclStubsPtr->tcl_UniCharToUpper) /* 323 */ -#endif -#ifndef Tcl_UniCharToUtf -#define Tcl_UniCharToUtf \ - (tclStubsPtr->tcl_UniCharToUtf) /* 324 */ -#endif -#ifndef Tcl_UtfAtIndex -#define Tcl_UtfAtIndex \ - (tclStubsPtr->tcl_UtfAtIndex) /* 325 */ -#endif -#ifndef Tcl_UtfCharComplete -#define Tcl_UtfCharComplete \ - (tclStubsPtr->tcl_UtfCharComplete) /* 326 */ -#endif -#ifndef Tcl_UtfBackslash -#define Tcl_UtfBackslash \ - (tclStubsPtr->tcl_UtfBackslash) /* 327 */ -#endif -#ifndef Tcl_UtfFindFirst -#define Tcl_UtfFindFirst \ - (tclStubsPtr->tcl_UtfFindFirst) /* 328 */ -#endif -#ifndef Tcl_UtfFindLast -#define Tcl_UtfFindLast \ - (tclStubsPtr->tcl_UtfFindLast) /* 329 */ -#endif -#ifndef Tcl_UtfNext -#define Tcl_UtfNext \ - (tclStubsPtr->tcl_UtfNext) /* 330 */ -#endif -#ifndef Tcl_UtfPrev -#define Tcl_UtfPrev \ - (tclStubsPtr->tcl_UtfPrev) /* 331 */ -#endif -#ifndef Tcl_UtfToExternal -#define Tcl_UtfToExternal \ - (tclStubsPtr->tcl_UtfToExternal) /* 332 */ -#endif -#ifndef Tcl_UtfToExternalDString -#define Tcl_UtfToExternalDString \ - (tclStubsPtr->tcl_UtfToExternalDString) /* 333 */ -#endif -#ifndef Tcl_UtfToLower -#define Tcl_UtfToLower \ - (tclStubsPtr->tcl_UtfToLower) /* 334 */ -#endif -#ifndef Tcl_UtfToTitle -#define Tcl_UtfToTitle \ - (tclStubsPtr->tcl_UtfToTitle) /* 335 */ -#endif -#ifndef Tcl_UtfToUniChar -#define Tcl_UtfToUniChar \ - (tclStubsPtr->tcl_UtfToUniChar) /* 336 */ -#endif -#ifndef Tcl_UtfToUpper -#define Tcl_UtfToUpper \ - (tclStubsPtr->tcl_UtfToUpper) /* 337 */ -#endif -#ifndef Tcl_WriteChars -#define Tcl_WriteChars \ - (tclStubsPtr->tcl_WriteChars) /* 338 */ -#endif -#ifndef Tcl_WriteObj -#define Tcl_WriteObj \ - (tclStubsPtr->tcl_WriteObj) /* 339 */ -#endif -#ifndef Tcl_GetString -#define Tcl_GetString \ - (tclStubsPtr->tcl_GetString) /* 340 */ -#endif -#ifndef Tcl_GetDefaultEncodingDir -#define Tcl_GetDefaultEncodingDir \ - (tclStubsPtr->tcl_GetDefaultEncodingDir) /* 341 */ -#endif -#ifndef Tcl_SetDefaultEncodingDir -#define Tcl_SetDefaultEncodingDir \ - (tclStubsPtr->tcl_SetDefaultEncodingDir) /* 342 */ -#endif -#ifndef Tcl_AlertNotifier -#define Tcl_AlertNotifier \ - (tclStubsPtr->tcl_AlertNotifier) /* 343 */ -#endif -#ifndef Tcl_ServiceModeHook -#define Tcl_ServiceModeHook \ - (tclStubsPtr->tcl_ServiceModeHook) /* 344 */ -#endif -#ifndef Tcl_UniCharIsAlnum -#define Tcl_UniCharIsAlnum \ - (tclStubsPtr->tcl_UniCharIsAlnum) /* 345 */ -#endif -#ifndef Tcl_UniCharIsAlpha -#define Tcl_UniCharIsAlpha \ - (tclStubsPtr->tcl_UniCharIsAlpha) /* 346 */ -#endif -#ifndef Tcl_UniCharIsDigit -#define Tcl_UniCharIsDigit \ - (tclStubsPtr->tcl_UniCharIsDigit) /* 347 */ -#endif -#ifndef Tcl_UniCharIsLower -#define Tcl_UniCharIsLower \ - (tclStubsPtr->tcl_UniCharIsLower) /* 348 */ -#endif -#ifndef Tcl_UniCharIsSpace -#define Tcl_UniCharIsSpace \ - (tclStubsPtr->tcl_UniCharIsSpace) /* 349 */ -#endif -#ifndef Tcl_UniCharIsUpper -#define Tcl_UniCharIsUpper \ - (tclStubsPtr->tcl_UniCharIsUpper) /* 350 */ -#endif -#ifndef Tcl_UniCharIsWordChar -#define Tcl_UniCharIsWordChar \ - (tclStubsPtr->tcl_UniCharIsWordChar) /* 351 */ -#endif -#ifndef Tcl_UniCharLen -#define Tcl_UniCharLen \ - (tclStubsPtr->tcl_UniCharLen) /* 352 */ -#endif -#ifndef Tcl_UniCharNcmp -#define Tcl_UniCharNcmp \ - (tclStubsPtr->tcl_UniCharNcmp) /* 353 */ -#endif -#ifndef Tcl_UniCharToUtfDString -#define Tcl_UniCharToUtfDString \ - (tclStubsPtr->tcl_UniCharToUtfDString) /* 354 */ -#endif -#ifndef Tcl_UtfToUniCharDString -#define Tcl_UtfToUniCharDString \ - (tclStubsPtr->tcl_UtfToUniCharDString) /* 355 */ -#endif -#ifndef Tcl_GetRegExpFromObj -#define Tcl_GetRegExpFromObj \ - (tclStubsPtr->tcl_GetRegExpFromObj) /* 356 */ -#endif -#ifndef Tcl_EvalTokens -#define Tcl_EvalTokens \ - (tclStubsPtr->tcl_EvalTokens) /* 357 */ -#endif -#ifndef Tcl_FreeParse -#define Tcl_FreeParse \ - (tclStubsPtr->tcl_FreeParse) /* 358 */ -#endif -#ifndef Tcl_LogCommandInfo -#define Tcl_LogCommandInfo \ - (tclStubsPtr->tcl_LogCommandInfo) /* 359 */ -#endif -#ifndef Tcl_ParseBraces -#define Tcl_ParseBraces \ - (tclStubsPtr->tcl_ParseBraces) /* 360 */ -#endif -#ifndef Tcl_ParseCommand -#define Tcl_ParseCommand \ - (tclStubsPtr->tcl_ParseCommand) /* 361 */ -#endif -#ifndef Tcl_ParseExpr -#define Tcl_ParseExpr \ - (tclStubsPtr->tcl_ParseExpr) /* 362 */ -#endif -#ifndef Tcl_ParseQuotedString -#define Tcl_ParseQuotedString \ - (tclStubsPtr->tcl_ParseQuotedString) /* 363 */ -#endif -#ifndef Tcl_ParseVarName -#define Tcl_ParseVarName \ - (tclStubsPtr->tcl_ParseVarName) /* 364 */ -#endif -#ifndef Tcl_GetCwd -#define Tcl_GetCwd \ - (tclStubsPtr->tcl_GetCwd) /* 365 */ -#endif -#ifndef Tcl_Chdir -#define Tcl_Chdir \ - (tclStubsPtr->tcl_Chdir) /* 366 */ -#endif - -#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#endif /* _TCLDECLS */ - diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c deleted file mode 100644 index 40ded74..0000000 --- a/generic/tclEncoding.c +++ /dev/null @@ -1,2685 +0,0 @@ -/* - * tclEncoding.c -- - * - * Contains the implementation of the encoding conversion package. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclEncoding.c,v 1.2 1999/04/16 00:46:45 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -typedef size_t (LengthProc)_ANSI_ARGS_((CONST char *src)); - -/* - * The following data structure represents an encoding, which describes how - * to convert between various character sets and UTF-8. - */ - -typedef struct Encoding { - char *name; /* Name of encoding. Malloced because (1) - * hash table entry that owns this encoding - * may be freed prior to this encoding being - * freed, (2) string passed in the - * Tcl_EncodingType structure may not be - * persistent. */ - Tcl_EncodingConvertProc *toUtfProc; - /* Procedure to convert from external - * encoding into UTF-8. */ - Tcl_EncodingConvertProc *fromUtfProc; - /* Procedure to convert from UTF-8 into - * external encoding. */ - Tcl_EncodingFreeProc *freeProc; - /* If non-NULL, procedure to call when this - * encoding is deleted. */ - int nullSize; /* Number of 0x00 bytes that signify - * end-of-string in this encoding. This - * number is used to determine the source - * string length when the srcLen argument is - * negative. This number can be 1 or 2. */ - ClientData clientData; /* Arbitrary value associated with encoding - * type. Passed to conversion procedures. */ - LengthProc *lengthProc; /* Function to compute length of - * null-terminated strings in this encoding. - * If nullSize is 1, this is strlen; if - * nullSize is 2, this is a function that - * returns the number of bytes in a 0x0000 - * terminated string. */ - int refCount; /* Number of uses of this structure. */ - Tcl_HashEntry *hPtr; /* Hash table entry that owns this encoding. */ -} Encoding; - -/* - * The following structure is the clientData for a dynamically-loaded, - * table-driven encoding created by LoadTableEncoding(). It maps between - * Unicode and a single-byte, double-byte, or multibyte (1 or 2 bytes only) - * encoding. - */ - -typedef struct TableEncodingData { - int fallback; /* Character (in this encoding) to - * substitute when this encoding cannot - * represent a UTF-8 character. */ - char prefixBytes[256]; /* If a byte in the input stream is a lead - * byte for a 2-byte sequence, the - * corresponding entry in this array is 1, - * otherwise it is 0. */ - unsigned short **toUnicode; /* Two dimensional sparse matrix to map - * characters from the encoding to Unicode. - * Each element of the toUnicode array points - * to an array of 256 shorts. If there is no - * corresponding character in Unicode, the - * value in the matrix is 0x0000. malloc'd. */ - unsigned short **fromUnicode; - /* Two dimensional sparse matrix to map - * characters from Unicode to the encoding. - * Each element of the fromUnicode array - * points to an array of 256 shorts. If there - * is no corresponding character the encoding, - * the value in the matrix is 0x0000. - * malloc'd. */ -} TableEncodingData; - -/* - * The following structures is the clientData for a dynamically-loaded, - * escape-driven encoding that is itself comprised of other simpler - * encodings. An example is "iso-2022-jp", which uses escape sequences to - * switch between ascii, jis0208, jis0212, gb2312, and ksc5601. Note that - * "escape-driven" does not necessarily mean that the ESCAPE character is - * the character used for switching character sets. - */ - -typedef struct EscapeSubTable { - unsigned int sequenceLen; /* Length of following string. */ - char sequence[16]; /* Escape code that marks this encoding. */ - char name[32]; /* Name for encoding. */ - Encoding *encodingPtr; /* Encoding loaded using above name, or NULL - * if this sub-encoding has not been needed - * yet. */ -} EscapeSubTable; - -typedef struct EscapeEncodingData { - int fallback; /* Character (in this encoding) to - * substitute when this encoding cannot - * represent a UTF-8 character. */ - unsigned int initLen; /* Length of following string. */ - char init[16]; /* String to emit or expect before first char - * in conversion. */ - unsigned int finalLen; /* Length of following string. */ - char final[16]; /* String to emit or expect after last char - * in conversion. */ - char prefixBytes[256]; /* If a byte in the input stream is the - * first character of one of the escape - * sequences in the following array, the - * corresponding entry in this array is 1, - * otherwise it is 0. */ - int numSubTables; /* Length of following array. */ - EscapeSubTable subTables[1];/* Information about each EscapeSubTable - * used by this encoding type. The actual - * size will be as large as necessary to - * hold all EscapeSubTables. */ -} EscapeEncodingData; - -/* - * Constants used when loading an encoding file to identify the type of the - * file. - */ - -#define ENCODING_SINGLEBYTE 0 -#define ENCODING_DOUBLEBYTE 1 -#define ENCODING_MULTIBYTE 2 -#define ENCODING_ESCAPE 3 - -/* - * Initialize the default encoding directory. If this variable contains - * a non NULL value, it will be the first path used to locate the - * system encoding files. - */ - -char *tclDefaultEncodingDir = NULL; - -/* - * Hash table that keeps track of all loaded Encodings. Keys are - * the string names that represent the encoding, values are (Encoding *). - */ - -static Tcl_HashTable encodingTable; -TCL_DECLARE_MUTEX(encodingMutex) - -/* - * The following are used to hold the default and current system encodings. - * If NULL is passed to one of the conversion routines, the current setting - * of the system encoding will be used to perform the conversion. - */ - -static Tcl_Encoding defaultEncoding; -static Tcl_Encoding systemEncoding; - -/* - * The following variable is used in the sparse matrix code for a - * TableEncoding to represent a page in the table that has no entries. - */ - -static unsigned short emptyPage[256]; - -/* - * Procedures used only in this module. - */ - -static int BinaryProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static void EscapeFreeProc _ANSI_ARGS_((ClientData clientData)); -static int EscapeFromUtfProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static int EscapeToUtfProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static void FreeEncoding _ANSI_ARGS_((Tcl_Encoding encoding)); -static Encoding * GetTableEncoding _ANSI_ARGS_(( - EscapeEncodingData *dataPtr, int state)); -static Tcl_Encoding LoadEncodingFile _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *name)); -static Tcl_Encoding LoadTableEncoding _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *name, int type, Tcl_Channel chan)); -static Tcl_Encoding LoadEscapeEncoding _ANSI_ARGS_((CONST char *name, - Tcl_Channel chan)); -static Tcl_Channel OpenEncodingFile _ANSI_ARGS_((CONST char *dir, - CONST char *name)); -static void TableFreeProc _ANSI_ARGS_((ClientData clientData)); -static int TableFromUtfProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static int TableToUtfProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static size_t unilen _ANSI_ARGS_((CONST char *src)); -static int UnicodeToUtfProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static int UtfToUnicodeProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static int UtfToUtfProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, int dstLen, - int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); - - -/* - *--------------------------------------------------------------------------- - * - * TclInitEncodingSubsystem -- - * - * Initialize all resources used by this subsystem on a per-process - * basis. - * - * Results: - * None. - * - * Side effects: - * Depends on the memory, object, and IO subsystems. - * - *--------------------------------------------------------------------------- - */ - -void -TclInitEncodingSubsystem() -{ - Tcl_EncodingType type; - - Tcl_MutexLock(&encodingMutex); - Tcl_InitHashTable(&encodingTable, TCL_STRING_KEYS); - Tcl_MutexUnlock(&encodingMutex); - - /* - * Create a few initial encodings. Note that the UTF-8 to UTF-8 - * translation is not a no-op, because it will turn a stream of - * improperly formed UTF-8 into a properly formed stream. - */ - - type.encodingName = "identity"; - type.toUtfProc = BinaryProc; - type.fromUtfProc = BinaryProc; - type.freeProc = NULL; - type.nullSize = 1; - type.clientData = NULL; - - defaultEncoding = Tcl_CreateEncoding(&type); - systemEncoding = Tcl_GetEncoding(NULL, type.encodingName); - - type.encodingName = "utf-8"; - type.toUtfProc = UtfToUtfProc; - type.fromUtfProc = UtfToUtfProc; - type.freeProc = NULL; - type.nullSize = 1; - type.clientData = NULL; - Tcl_CreateEncoding(&type); - - type.encodingName = "unicode"; - type.toUtfProc = UnicodeToUtfProc; - type.fromUtfProc = UtfToUnicodeProc; - type.freeProc = NULL; - type.nullSize = 2; - type.clientData = NULL; - Tcl_CreateEncoding(&type); -} - - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeEncodingSubsystem -- - * - * Release the state associated with the encoding subsystem. - * - * Results: - * None. - * - * Side effects: - * Frees all of the encodings. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeEncodingSubsystem() -{ - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - Encoding *encodingPtr; - - Tcl_MutexLock(&encodingMutex); - hPtr = Tcl_FirstHashEntry(&encodingTable, &search); - while (hPtr != NULL) { - encodingPtr = (Encoding *) Tcl_GetHashValue(hPtr); - if (encodingPtr->freeProc != NULL) { - (*encodingPtr->freeProc)(encodingPtr->clientData); - } - ckfree((char *) encodingPtr->name); - ckfree((char *) encodingPtr); - hPtr = Tcl_NextHashEntry(&search); - } - Tcl_DeleteHashTable(&encodingTable); - Tcl_MutexUnlock(&encodingMutex); -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_GetDefaultEncodingDir -- - * - * - * Results: - * - * Side effects: - * - *------------------------------------------------------------------------- - */ - -char * -Tcl_GetDefaultEncodingDir() -{ - return tclDefaultEncodingDir; -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_SetDefaultEncodingDir -- - * - * - * Results: - * - * Side effects: - * - *------------------------------------------------------------------------- - */ - -void -Tcl_SetDefaultEncodingDir(path) - char *path; -{ - tclDefaultEncodingDir = (char *)ckalloc((unsigned) strlen(path) + 1); - strcpy(tclDefaultEncodingDir, path); -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_GetEncoding -- - * - * Given the name of a encoding, find the corresponding Tcl_Encoding - * token. If the encoding did not already exist, Tcl attempts to - * dynamically load an encoding by that name. - * - * Results: - * Returns a token that represents the encoding. If the name didn't - * refer to any known or loadable encoding, NULL is returned. If - * NULL was returned, an error message is left in interp's result - * object, unless interp was NULL. - * - * Side effects: - * The new encoding type is entered into a table visible to all - * interpreters, keyed off the encoding's name. For each call to - * this procedure, there should eventually be a call to - * Tcl_FreeEncoding, so that the database can be cleaned up when - * encodings aren't needed anymore. - * - *------------------------------------------------------------------------- - */ - -Tcl_Encoding -Tcl_GetEncoding(interp, name) - Tcl_Interp *interp; /* Interp for error reporting, if not NULL. */ - CONST char *name; /* The name of the desired encoding. */ -{ - Tcl_HashEntry *hPtr; - Encoding *encodingPtr; - - Tcl_MutexLock(&encodingMutex); - if (name == NULL) { - encodingPtr = (Encoding *) systemEncoding; - encodingPtr->refCount++; - Tcl_MutexUnlock(&encodingMutex); - return systemEncoding; - } - - hPtr = Tcl_FindHashEntry(&encodingTable, name); - if (hPtr != NULL) { - encodingPtr = (Encoding *) Tcl_GetHashValue(hPtr); - encodingPtr->refCount++; - Tcl_MutexUnlock(&encodingMutex); - return (Tcl_Encoding) encodingPtr; - } - Tcl_MutexUnlock(&encodingMutex); - return LoadEncodingFile(interp, name); -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_FreeEncoding -- - * - * This procedure is called to release an encoding allocated by - * Tcl_CreateEncoding() or Tcl_GetEncoding(). - * - * Results: - * None. - * - * Side effects: - * The reference count associated with the encoding is decremented - * and the encoding may be deleted if nothing is using it anymore. - * - *--------------------------------------------------------------------------- - */ - -void -Tcl_FreeEncoding(encoding) - Tcl_Encoding encoding; -{ - Tcl_MutexLock(&encodingMutex); - FreeEncoding(encoding); - Tcl_MutexUnlock(&encodingMutex); -} - -/* - *---------------------------------------------------------------------- - * - * FreeEncoding -- - * - * This procedure is called to release an encoding by procedures - * that already have the encodingMutex. - * - * Results: - * None. - * - * Side effects: - * The reference count associated with the encoding is decremented - * and the encoding may be deleted if nothing is using it anymore. - * - *---------------------------------------------------------------------- - */ - -static void -FreeEncoding(encoding) - Tcl_Encoding encoding; -{ - Encoding *encodingPtr; - - encodingPtr = (Encoding *) encoding; - if (encodingPtr == NULL) { - return; - } - encodingPtr->refCount--; - if (encodingPtr->refCount == 0) { - if (encodingPtr->freeProc != NULL) { - (*encodingPtr->freeProc)(encodingPtr->clientData); - } - if (encodingPtr->hPtr != NULL) { - Tcl_DeleteHashEntry(encodingPtr->hPtr); - } - ckfree((char *) encodingPtr->name); - ckfree((char *) encodingPtr); - } -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_GetEncodingName -- - * - * Given an encoding, return the name that was used to constuct - * the encoding. - * - * Results: - * The name of the encoding. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -char * -Tcl_GetEncodingName(encoding) - Tcl_Encoding encoding; /* The encoding whose name to fetch. */ -{ - Encoding *encodingPtr; - - if (encoding == NULL) { - encoding = systemEncoding; - } - encodingPtr = (Encoding *) encoding; - return encodingPtr->name; -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_GetEncodingNames -- - * - * Get the list of all known encodings, including the ones stored - * as files on disk in the encoding path. - * - * Results: - * Modifies interp's result object to hold a list of all the available - * encodings. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -void -Tcl_GetEncodingNames(interp) - Tcl_Interp *interp; /* Interp to hold result. */ -{ - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - Tcl_Obj *pathPtr, *resultPtr; - int dummy; - - Tcl_HashTable table; - - Tcl_MutexLock(&encodingMutex); - Tcl_InitHashTable(&table, TCL_STRING_KEYS); - hPtr = Tcl_FirstHashEntry(&encodingTable, &search); - while (hPtr != NULL) { - Encoding *encodingPtr; - - encodingPtr = (Encoding *) Tcl_GetHashValue(hPtr); - Tcl_CreateHashEntry(&table, encodingPtr->name, &dummy); - hPtr = Tcl_NextHashEntry(&search); - } - Tcl_MutexUnlock(&encodingMutex); - - pathPtr = TclGetLibraryPath(); - if (pathPtr != NULL) { - int i, objc; - Tcl_Obj **objv; - Tcl_DString pwdString; - char globArgString[10]; - - objc = 0; - Tcl_ListObjGetElements(NULL, pathPtr, &objc, &objv); - - Tcl_GetCwd(interp, &pwdString); - - for (i = 0; i < objc; i++) { - char *string; - int j, objc2, length; - Tcl_Obj **objv2; - - string = Tcl_GetStringFromObj(objv[i], NULL); - Tcl_ResetResult(interp); - - /* - * TclGlob() changes the contents of globArgString, which causes - * a segfault if we pass in a pointer to non-writeable memory. - * TclGlob() puts its results directly into interp. - */ - - strcpy(globArgString, "*.enc"); - if ((Tcl_Chdir(string) == 0) - && (Tcl_Chdir("encoding") == 0) - && (TclGlob(interp, globArgString, 0) == TCL_OK)) { - objc2 = 0; - - Tcl_ListObjGetElements(NULL, Tcl_GetObjResult(interp), &objc2, - &objv2); - - for (j = 0; j < objc2; j++) { - string = Tcl_GetStringFromObj(objv2[j], &length); - length -= 4; - if (length > 0) { - string[length] = '\0'; - Tcl_CreateHashEntry(&table, string, &dummy); - string[length] = '.'; - } - } - } - Tcl_Chdir(Tcl_DStringValue(&pwdString)); - } - Tcl_DStringFree(&pwdString); - } - - /* - * Clear any values placed in the result by globbing. - */ - - Tcl_ResetResult(interp); - resultPtr = Tcl_GetObjResult(interp); - - hPtr = Tcl_FirstHashEntry(&table, &search); - while (hPtr != NULL) { - Tcl_Obj *strPtr; - - strPtr = Tcl_NewStringObj(Tcl_GetHashKey(&table, hPtr), -1); - Tcl_ListObjAppendElement(NULL, resultPtr, strPtr); - hPtr = Tcl_NextHashEntry(&search); - } - Tcl_DeleteHashTable(&table); -} - -/* - *------------------------------------------------------------------------ - * - * Tcl_SetSystemEncoding -- - * - * Sets the default encoding that should be used whenever the user - * passes a NULL value in to one of the conversion routines. - * If the supplied name is NULL, the system encoding is reset to the - * default system encoding. - * - * Results: - * The return value is TCL_OK if the system encoding was successfully - * set to the encoding specified by name, TCL_ERROR otherwise. If - * TCL_ERROR is returned, an error message is left in interp's result - * object, unless interp was NULL. - * - * Side effects: - * The reference count of the new system encoding is incremented. - * The reference count of the old system encoding is decremented and - * it may be freed. - * - *------------------------------------------------------------------------ - */ - -int -Tcl_SetSystemEncoding(interp, name) - Tcl_Interp *interp; /* Interp for error reporting, if not NULL. */ - CONST char *name; /* The name of the desired encoding, or NULL - * to reset to default encoding. */ -{ - Tcl_Encoding encoding; - Encoding *encodingPtr; - - if (name == NULL) { - Tcl_MutexLock(&encodingMutex); - encoding = defaultEncoding; - encodingPtr = (Encoding *) encoding; - encodingPtr->refCount++; - Tcl_MutexUnlock(&encodingMutex); - } else { - encoding = Tcl_GetEncoding(interp, name); - if (encoding == NULL) { - return TCL_ERROR; - } - } - - Tcl_MutexLock(&encodingMutex); - FreeEncoding(systemEncoding); - systemEncoding = encoding; - Tcl_MutexUnlock(&encodingMutex); - - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_CreateEncoding -- - * - * This procedure is called to define a new encoding and the procedures - * that are used to convert between the specified encoding and Unicode. - * - * Results: - * Returns a token that represents the encoding. If an encoding with - * the same name already existed, the old encoding token remains - * valid and continues to behave as it used to, and will eventually - * be garbage collected when the last reference to it goes away. Any - * subsequent calls to Tcl_GetEncoding with the specified name will - * retrieve the most recent encoding token. - * - * Side effects: - * The new encoding type is entered into a table visible to all - * interpreters, keyed off the encoding's name. For each call to - * this procedure, there should eventually be a call to - * Tcl_FreeEncoding, so that the database can be cleaned up when - * encodings aren't needed anymore. - * - *--------------------------------------------------------------------------- - */ - -Tcl_Encoding -Tcl_CreateEncoding(typePtr) - Tcl_EncodingType *typePtr; /* The encoding type. */ -{ - Tcl_HashEntry *hPtr; - int new; - Encoding *encodingPtr; - char *name; - - Tcl_MutexLock(&encodingMutex); - hPtr = Tcl_CreateHashEntry(&encodingTable, typePtr->encodingName, &new); - if (new == 0) { - /* - * Remove old encoding from hash table, but don't delete it until - * last reference goes away. - */ - - encodingPtr = (Encoding *) Tcl_GetHashValue(hPtr); - encodingPtr->hPtr = NULL; - } - - name = ckalloc((unsigned) strlen(typePtr->encodingName) + 1); - - encodingPtr = (Encoding *) ckalloc(sizeof(Encoding)); - encodingPtr->name = strcpy(name, typePtr->encodingName); - encodingPtr->toUtfProc = typePtr->toUtfProc; - encodingPtr->fromUtfProc = typePtr->fromUtfProc; - encodingPtr->freeProc = typePtr->freeProc; - encodingPtr->nullSize = typePtr->nullSize; - encodingPtr->clientData = typePtr->clientData; - if (typePtr->nullSize == 1) { - encodingPtr->lengthProc = strlen; - } else { - encodingPtr->lengthProc = unilen; - } - encodingPtr->refCount = 1; - encodingPtr->hPtr = hPtr; - Tcl_SetHashValue(hPtr, encodingPtr); - - Tcl_MutexUnlock(&encodingMutex); - - return (Tcl_Encoding) encodingPtr; -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_ExternalToUtfDString -- - * - * Convert a source buffer from the specified encoding into UTF-8. - * If any of the bytes in the source buffer are invalid or cannot - * be represented in the target encoding, a default fallback - * character will be substituted. - * - * Results: - * The converted bytes are stored in the DString, which is then NULL - * terminated. The return value is a pointer to the value stored - * in the DString. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -char * -Tcl_ExternalToUtfDString(encoding, src, srcLen, dstPtr) - Tcl_Encoding encoding; /* The encoding for the source string, or - * NULL for the default system encoding. */ - CONST char *src; /* Source string in specified encoding. */ - int srcLen; /* Source string length in bytes, or < 0 for - * encoding-specific string length. */ - Tcl_DString *dstPtr; /* Uninitialized or free DString in which - * the converted string is stored. */ -{ - char *dst; - Tcl_EncodingState state; - Encoding *encodingPtr; - int flags, dstLen, result, soFar, srcRead, dstWrote, dstChars; - - Tcl_DStringInit(dstPtr); - dst = Tcl_DStringValue(dstPtr); - dstLen = dstPtr->spaceAvl - 1; - - if (encoding == NULL) { - encoding = systemEncoding; - } - encodingPtr = (Encoding *) encoding; - - if (src == NULL) { - srcLen = 0; - } else if (srcLen < 0) { - srcLen = (*encodingPtr->lengthProc)(src); - } - flags = TCL_ENCODING_START | TCL_ENCODING_END; - while (1) { - result = (*encodingPtr->toUtfProc)(encodingPtr->clientData, src, - srcLen, flags, &state, dst, dstLen, &srcRead, &dstWrote, - &dstChars); - soFar = dst + dstWrote - Tcl_DStringValue(dstPtr); - if (result != TCL_CONVERT_NOSPACE) { - Tcl_DStringSetLength(dstPtr, soFar); - return Tcl_DStringValue(dstPtr); - } - flags &= ~TCL_ENCODING_START; - src += srcRead; - srcLen -= srcRead; - if (Tcl_DStringLength(dstPtr) == 0) { - Tcl_DStringSetLength(dstPtr, dstLen); - } - Tcl_DStringSetLength(dstPtr, 2 * Tcl_DStringLength(dstPtr) + 1); - dst = Tcl_DStringValue(dstPtr) + soFar; - dstLen = Tcl_DStringLength(dstPtr) - soFar - 1; - } -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_ExternalToUtf -- - * - * Convert a source buffer from the specified encoding into UTF-8, - * - * Results: - * The return value is one of TCL_OK, TCL_CONVERT_MULTIBYTE, - * TCL_CONVERT_SYNTAX, TCL_CONVERT_UNKNOWN, or TCL_CONVERT_NOSPACE, - * as documented in tcl.h. - * - * Side effects: - * The converted bytes are stored in the output buffer. - * - *------------------------------------------------------------------------- - */ - -int -Tcl_ExternalToUtf(interp, encoding, src, srcLen, flags, statePtr, dst, - dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr) - Tcl_Interp *interp; /* Interp for error return, if not NULL. */ - Tcl_Encoding encoding; /* The encoding for the source string, or - * NULL for the default system encoding. */ - CONST char *src; /* Source string in specified encoding. */ - int srcLen; /* Source string length in bytes, or < 0 for - * encoding-specific string length. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - Encoding *encodingPtr; - int result, srcRead, dstWrote, dstChars; - Tcl_EncodingState state; - - if (encoding == NULL) { - encoding = systemEncoding; - } - encodingPtr = (Encoding *) encoding; - - if (src == NULL) { - srcLen = 0; - } else if (srcLen < 0) { - srcLen = (*encodingPtr->lengthProc)(src); - } - if (statePtr == NULL) { - flags |= TCL_ENCODING_START | TCL_ENCODING_END; - statePtr = &state; - } - if (srcReadPtr == NULL) { - srcReadPtr = &srcRead; - } - if (dstWrotePtr == NULL) { - dstWrotePtr = &dstWrote; - } - if (dstCharsPtr == NULL) { - dstCharsPtr = &dstChars; - } - - /* - * If there are any null characters in the middle of the buffer, they will - * converted to the UTF-8 null character (\xC080). To get the actual - * \0 at the end of the destination buffer, we need to append it manually. - */ - - dstLen--; - result = (*encodingPtr->toUtfProc)(encodingPtr->clientData, src, srcLen, - flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, - dstCharsPtr); - dst[*dstWrotePtr] = '\0'; - return result; -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_UtfToExternalDString -- - * - * Convert a source buffer from UTF-8 into the specified encoding. - * If any of the bytes in the source buffer are invalid or cannot - * be represented in the target encoding, a default fallback - * character will be substituted. - * - * Results: - * The converted bytes are stored in the DString, which is then - * NULL terminated in an encoding-specific manner. The return value - * is a pointer to the value stored in the DString. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -char * -Tcl_UtfToExternalDString(encoding, src, srcLen, dstPtr) - Tcl_Encoding encoding; /* The encoding for the converted string, - * or NULL for the default system encoding. */ - CONST char *src; /* Source string in UTF-8. */ - int srcLen; /* Source string length in bytes, or < 0 for - * strlen(). */ - Tcl_DString *dstPtr; /* Uninitialized or free DString in which - * the converted string is stored. */ -{ - char *dst; - Tcl_EncodingState state; - Encoding *encodingPtr; - int flags, dstLen, result, soFar, srcRead, dstWrote, dstChars; - - Tcl_DStringInit(dstPtr); - dst = Tcl_DStringValue(dstPtr); - dstLen = dstPtr->spaceAvl - 1; - - if (encoding == NULL) { - encoding = systemEncoding; - } - encodingPtr = (Encoding *) encoding; - - if (src == NULL) { - srcLen = 0; - } else if (srcLen < 0) { - srcLen = strlen(src); - } - flags = TCL_ENCODING_START | TCL_ENCODING_END; - while (1) { - result = (*encodingPtr->fromUtfProc)(encodingPtr->clientData, src, - srcLen, flags, &state, dst, dstLen, &srcRead, &dstWrote, - &dstChars); - soFar = dst + dstWrote - Tcl_DStringValue(dstPtr); - if (result != TCL_CONVERT_NOSPACE) { - if (encodingPtr->nullSize == 2) { - Tcl_DStringSetLength(dstPtr, soFar + 1); - } - Tcl_DStringSetLength(dstPtr, soFar); - return Tcl_DStringValue(dstPtr); - } - flags &= ~TCL_ENCODING_START; - src += srcRead; - srcLen -= srcRead; - if (Tcl_DStringLength(dstPtr) == 0) { - Tcl_DStringSetLength(dstPtr, dstLen); - } - Tcl_DStringSetLength(dstPtr, 2 * Tcl_DStringLength(dstPtr) + 1); - dst = Tcl_DStringValue(dstPtr) + soFar; - dstLen = Tcl_DStringLength(dstPtr) - soFar - 1; - } -} - -/* - *------------------------------------------------------------------------- - * - * Tcl_UtfToExternal -- - * - * Convert a buffer from UTF-8 into the specified encoding. - * - * Results: - * The return value is one of TCL_OK, TCL_CONVERT_MULTIBYTE, - * TCL_CONVERT_SYNTAX, TCL_CONVERT_UNKNOWN, or TCL_CONVERT_NOSPACE, - * as documented in tcl.h. - * - * Side effects: - * The converted bytes are stored in the output buffer. - * - *------------------------------------------------------------------------- - */ - -int -Tcl_UtfToExternal(interp, encoding, src, srcLen, flags, statePtr, dst, - dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr) - Tcl_Interp *interp; /* Interp for error return, if not NULL. */ - Tcl_Encoding encoding; /* The encoding for the converted string, - * or NULL for the default system encoding. */ - CONST char *src; /* Source string in UTF-8. */ - int srcLen; /* Source string length in bytes, or < 0 for - * strlen(). */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - Encoding *encodingPtr; - int result, srcRead, dstWrote, dstChars; - Tcl_EncodingState state; - - if (encoding == NULL) { - encoding = systemEncoding; - } - encodingPtr = (Encoding *) encoding; - - if (src == NULL) { - srcLen = 0; - } else if (srcLen < 0) { - srcLen = strlen(src); - } - if (statePtr == NULL) { - flags |= TCL_ENCODING_START | TCL_ENCODING_END; - statePtr = &state; - } - if (srcReadPtr == NULL) { - srcReadPtr = &srcRead; - } - if (dstWrotePtr == NULL) { - dstWrotePtr = &dstWrote; - } - if (dstCharsPtr == NULL) { - dstCharsPtr = &dstChars; - } - - dstLen -= encodingPtr->nullSize; - result = (*encodingPtr->fromUtfProc)(encodingPtr->clientData, src, srcLen, - flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, - dstCharsPtr); - if (encodingPtr->nullSize == 2) { - dst[*dstWrotePtr + 1] = '\0'; - } - dst[*dstWrotePtr] = '\0'; - - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_FindExecutable -- - * - * This procedure computes the absolute path name of the current - * application, given its argv[0] value. - * - * Results: - * None. - * - * Side effects: - * The variable tclExecutableName gets filled in with the file - * name for the application, if we figured it out. If we couldn't - * figure it out, tclExecutableName is set to NULL. - * - *--------------------------------------------------------------------------- - */ - -void -Tcl_FindExecutable(argv0) - CONST char *argv0; /* The value of the application's argv[0] - * (native). */ -{ - CONST char *name; - Tcl_DString buffer, nameString; - - TclInitSubsystems(argv0); - - if (argv0 == NULL) { - goto done; - } - if (tclExecutableName != NULL) { - ckfree(tclExecutableName); - tclExecutableName = NULL; - } - if ((name = TclpFindExecutable(argv0)) == NULL) { - goto done; - } - - /* - * The value returned from TclpNameOfExecutable is a UTF string that - * is possibly dirty depending on when it was initialized. To assure - * that the UTF string is a properly encoded native string for this - * system, convert the UTF string to the default native encoding - * before the default encoding is initialized. Then, convert it back - * to UTF after the system encoding is loaded. - */ - - Tcl_UtfToExternalDString(NULL, name, -1, &buffer); - TclFindEncodings(argv0); - - /* - * Now it is OK to convert the native string back to UTF and set - * the value of the tclExecutableName. - */ - - Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&buffer), -1, &nameString); - tclExecutableName = (char *) - ckalloc((unsigned) (Tcl_DStringLength(&nameString) + 1)); - strcpy(tclExecutableName, Tcl_DStringValue(&nameString)); - - Tcl_DStringFree(&buffer); - Tcl_DStringFree(&nameString); - return; - - done: - TclFindEncodings(argv0); -} - -/* - *--------------------------------------------------------------------------- - * - * LoadEncodingFile -- - * - * Read a file that describes an encoding and create a new Encoding - * from the data. - * - * Results: - * The return value is the newly loaded Encoding, or NULL if - * the file didn't exist of was in the incorrect format. If NULL was - * returned, an error message is left in interp's result object, - * unless interp was NULL. - * - * Side effects: - * File read from disk. - * - *--------------------------------------------------------------------------- - */ - -static Tcl_Encoding -LoadEncodingFile(interp, name) - Tcl_Interp *interp; /* Interp for error reporting, if not NULL. */ - CONST char *name; /* The name of the encoding file on disk - * and also the name for new encoding. */ -{ - int objc, i, ch; - Tcl_Obj **objv; - Tcl_Obj *pathPtr; - Tcl_Channel chan; - Tcl_Encoding encoding; - - pathPtr = TclGetLibraryPath(); - if (pathPtr == NULL) { - goto unknown; - } - objc = 0; - Tcl_ListObjGetElements(NULL, pathPtr, &objc, &objv); - - chan = NULL; - for (i = 0; i < objc; i++) { - chan = OpenEncodingFile(Tcl_GetString(objv[i]), name); - if (chan != NULL) { - break; - } - } - - if (chan == NULL) { - goto unknown; - } - - Tcl_SetChannelOption(NULL, chan, "-encoding", "utf-8"); - - while (1) { - Tcl_DString ds; - - Tcl_DStringInit(&ds); - Tcl_Gets(chan, &ds); - ch = Tcl_DStringValue(&ds)[0]; - Tcl_DStringFree(&ds); - if (ch != '#') { - break; - } - } - - encoding = NULL; - switch (ch) { - case 'S': { - encoding = LoadTableEncoding(interp, name, ENCODING_SINGLEBYTE, - chan); - break; - } - case 'D': { - encoding = LoadTableEncoding(interp, name, ENCODING_DOUBLEBYTE, - chan); - break; - } - case 'M': { - encoding = LoadTableEncoding(interp, name, ENCODING_MULTIBYTE, - chan); - break; - } - case 'E': { - encoding = LoadEscapeEncoding(name, chan); - break; - } - } - if ((encoding == NULL) && (interp != NULL)) { - Tcl_AppendResult(interp, "invalid encoding file \"", name, "\"", NULL); - } - Tcl_Close(NULL, chan); - return encoding; - - unknown: - if (interp != NULL) { - Tcl_AppendResult(interp, "unknown encoding \"", name, "\"", NULL); - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * OpenEncodingFile -- - * - * Look for the file encoding/.enc in the specified - * directory. - * - * Results: - * Returns an open file channel if the file exists. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Tcl_Channel -OpenEncodingFile(dir, name) - CONST char *dir; - CONST char *name; - -{ - char *argv[3]; - Tcl_DString pathString; - char *path; - Tcl_Channel chan; - - argv[0] = (char *) dir; - argv[1] = "encoding"; - argv[2] = (char *) name; - - Tcl_DStringInit(&pathString); - Tcl_JoinPath(3, argv, &pathString); - path = Tcl_DStringAppend(&pathString, ".enc", -1); - chan = Tcl_OpenFileChannel(NULL, path, "r", 0); - Tcl_DStringFree(&pathString); - - return chan; -} - -/* - *------------------------------------------------------------------------- - * - * LoadTableEncoding -- - * - * Helper function for LoadEncodingTable(). Loads a table to that - * converts between Unicode and some other encoding and creates an - * encoding (using a TableEncoding structure) from that information. - * - * File contains binary data, but begins with a marker to indicate - * byte-ordering, so that same binary file can be read on either - * endian platforms. - * - * Results: - * The return value is the new encoding, or NULL if the encoding - * could not be created (because the file contained invalid data). - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static Tcl_Encoding -LoadTableEncoding(interp, name, type, chan) - Tcl_Interp *interp; /* Interp for temporary obj while reading. */ - CONST char *name; /* Name for new encoding. */ - int type; /* Type of encoding (ENCODING_?????). */ - Tcl_Channel chan; /* File containing new encoding. */ -{ - Tcl_DString lineString; - Tcl_Obj *objPtr; - char *line; - int i, hi, lo, numPages, symbol, fallback; - unsigned char used[256]; - unsigned int size; - TableEncodingData *dataPtr; - unsigned short *pageMemPtr; - Tcl_EncodingType encType; - char *hex; - static char staticHex[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, - 10, 11, 12, 13, 14, 15 - }; - - hex = staticHex - '0'; - - Tcl_DStringInit(&lineString); - Tcl_Gets(chan, &lineString); - line = Tcl_DStringValue(&lineString); - - fallback = (int) strtol(line, &line, 16); - symbol = (int) strtol(line, &line, 10); - numPages = (int) strtol(line, &line, 10); - Tcl_DStringFree(&lineString); - - if (numPages < 0) { - numPages = 0; - } else if (numPages > 256) { - numPages = 256; - } - - memset(used, 0, sizeof(used)); - -#undef PAGESIZE -#define PAGESIZE (256 * sizeof(unsigned short)) - - dataPtr = (TableEncodingData *) ckalloc(sizeof(TableEncodingData)); - memset(dataPtr, 0, sizeof(TableEncodingData)); - - dataPtr->fallback = fallback; - - /* - * Read the table that maps characters to Unicode. Performs a single - * malloc to get the memory for the array and all the pages needed by - * the array. - */ - - size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE; - dataPtr->toUnicode = (unsigned short **) ckalloc(size); - memset(dataPtr->toUnicode, 0, size); - pageMemPtr = (unsigned short *) (dataPtr->toUnicode + 256); - - if (interp == NULL) { - objPtr = Tcl_NewObj(); - } else { - objPtr = Tcl_GetObjResult(interp); - } - for (i = 0; i < numPages; i++) { - int ch; - char *p; - - Tcl_ReadChars(chan, objPtr, 3 + 16 * (16 * 4 + 1), 0); - p = Tcl_GetString(objPtr); - hi = (hex[(int)p[0]] << 4) + hex[(int)p[1]]; - dataPtr->toUnicode[hi] = pageMemPtr; - p += 2; - for (lo = 0; lo < 256; lo++) { - if ((lo & 0x0f) == 0) { - p++; - } - ch = (hex[(int)p[0]] << 12) + (hex[(int)p[1]] << 8) - + (hex[(int)p[2]] << 4) + hex[(int)p[3]]; - if (ch != 0) { - used[ch >> 8] = 1; - } - *pageMemPtr = (unsigned short) ch; - pageMemPtr++; - p += 4; - } - } - if (interp == NULL) { - Tcl_DecrRefCount(objPtr); - } else { - Tcl_ResetResult(interp); - } - - if (type == ENCODING_DOUBLEBYTE) { - memset(dataPtr->prefixBytes, 1, sizeof(dataPtr->prefixBytes)); - } else { - for (hi = 1; hi < 256; hi++) { - if (dataPtr->toUnicode[hi] != NULL) { - dataPtr->prefixBytes[hi] = 1; - } - } - } - - /* - * Invert toUnicode array to produce the fromUnicode array. Performs a - * single malloc to get the memory for the array and all the pages - * needed by the array. While reading in the toUnicode array, we - * remembered what pages that would be needed for the fromUnicode array. - */ - - if (symbol) { - used[0] = 1; - } - numPages = 0; - for (hi = 0; hi < 256; hi++) { - if (used[hi]) { - numPages++; - } - } - size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE; - dataPtr->fromUnicode = (unsigned short **) ckalloc(size); - memset(dataPtr->fromUnicode, 0, size); - pageMemPtr = (unsigned short *) (dataPtr->fromUnicode + 256); - - for (hi = 0; hi < 256; hi++) { - if (dataPtr->toUnicode[hi] == NULL) { - dataPtr->toUnicode[hi] = emptyPage; - } else { - for (lo = 0; lo < 256; lo++) { - int ch; - - ch = dataPtr->toUnicode[hi][lo]; - if (ch != 0) { - unsigned short *page; - - page = dataPtr->fromUnicode[ch >> 8]; - if (page == NULL) { - page = pageMemPtr; - pageMemPtr += 256; - dataPtr->fromUnicode[ch >> 8] = page; - } - page[ch & 0xff] = (unsigned short) ((hi << 8) + lo); - } - } - } - } - if (type == ENCODING_MULTIBYTE) { - /* - * If multibyte encodings don't have a backslash character, define - * one. Otherwise, on Windows, native file names won't work because - * the backslash in the file name will map to the unknown character - * (question mark) when converting from UTF-8 to external encoding. - */ - - if (dataPtr->fromUnicode[0] != NULL) { - if (dataPtr->fromUnicode[0]['\\'] == '\0') { - dataPtr->fromUnicode[0]['\\'] = '\\'; - } - } - } - if (symbol) { - unsigned short *page; - - /* - * Make a special symbol encoding that not only maps the symbol - * characters from their Unicode code points down into page 0, but - * also ensure that the characters on page 0 map to themselves. - * This is so that a symbol font can be used to display a simple - * string like "abcd" and have alpha, beta, chi, delta show up, - * rather than have "unknown" chars show up because strictly - * speaking the symbol font doesn't have glyphs for those low ascii - * chars. - */ - - page = dataPtr->fromUnicode[0]; - if (page == NULL) { - page = pageMemPtr; - dataPtr->fromUnicode[0] = page; - } - for (lo = 0; lo < 256; lo++) { - if (dataPtr->toUnicode[0][lo] != 0) { - page[lo] = (unsigned short) lo; - } - } - } - for (hi = 0; hi < 256; hi++) { - if (dataPtr->fromUnicode[hi] == NULL) { - dataPtr->fromUnicode[hi] = emptyPage; - } - } - encType.encodingName = name; - encType.toUtfProc = TableToUtfProc; - encType.fromUtfProc = TableFromUtfProc; - encType.freeProc = TableFreeProc; - encType.nullSize = (type == ENCODING_DOUBLEBYTE) ? 2 : 1; - encType.clientData = (ClientData) dataPtr; - return Tcl_CreateEncoding(&encType); - -} - -/* - *------------------------------------------------------------------------- - * - * LoadEscapeEncoding -- - * - * Helper function for LoadEncodingTable(). Loads a state machine - * that converts between Unicode and some other encoding. - * - * File contains text data that describes the escape sequences that - * are used to choose an encoding and the associated names for the - * sub-encodings. - * - * Results: - * The return value is the new encoding, or NULL if the encoding - * could not be created (because the file contained invalid data). - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static Tcl_Encoding -LoadEscapeEncoding(name, chan) - CONST char *name; /* Name for new encoding. */ - Tcl_Channel chan; /* File containing new encoding. */ -{ - int i; - unsigned int size; - Tcl_DString escapeData; - char init[16], final[16]; - EscapeEncodingData *dataPtr; - Tcl_EncodingType type; - - init[0] = '\0'; - final[0] = '\0'; - Tcl_DStringInit(&escapeData); - - while (1) { - int argc; - char **argv; - char *line; - Tcl_DString lineString; - - Tcl_DStringInit(&lineString); - if (Tcl_Gets(chan, &lineString) < 0) { - break; - } - line = Tcl_DStringValue(&lineString); - if (Tcl_SplitList(NULL, line, &argc, &argv) != TCL_OK) { - continue; - } - if (argc >= 2) { - if (strcmp(argv[0], "name") == 0) { - ; - } else if (strcmp(argv[0], "init") == 0) { - strncpy(init, argv[1], sizeof(init)); - init[sizeof(init) - 1] = '\0'; - } else if (strcmp(argv[0], "final") == 0) { - strncpy(final, argv[1], sizeof(final)); - final[sizeof(final) - 1] = '\0'; - } else { - EscapeSubTable est; - - strncpy(est.sequence, argv[1], sizeof(est.sequence)); - est.sequence[sizeof(est.sequence) - 1] = '\0'; - est.sequenceLen = strlen(est.sequence); - - strncpy(est.name, argv[0], sizeof(est.name)); - est.name[sizeof(est.name) - 1] = '\0'; - - est.encodingPtr = NULL; - Tcl_DStringAppend(&escapeData, (char *) &est, sizeof(est)); - } - } - ckfree((char *) argv); - Tcl_DStringFree(&lineString); - } - - size = sizeof(EscapeEncodingData) - - sizeof(EscapeSubTable) + Tcl_DStringLength(&escapeData); - dataPtr = (EscapeEncodingData *) ckalloc(size); - dataPtr->initLen = strlen(init); - strcpy(dataPtr->init, init); - dataPtr->finalLen = strlen(final); - strcpy(dataPtr->final, final); - dataPtr->numSubTables = Tcl_DStringLength(&escapeData) / sizeof(EscapeSubTable); - memcpy((VOID *) dataPtr->subTables, (VOID *) Tcl_DStringValue(&escapeData), - (size_t) Tcl_DStringLength(&escapeData)); - Tcl_DStringFree(&escapeData); - - memset(dataPtr->prefixBytes, 0, sizeof(dataPtr->prefixBytes)); - for (i = 0; i < dataPtr->numSubTables; i++) { - dataPtr->prefixBytes[UCHAR(dataPtr->subTables[i].sequence[0])] = 1; - } - if (dataPtr->init[0] != '\0') { - dataPtr->prefixBytes[UCHAR(dataPtr->init[0])] = 1; - } - if (dataPtr->final[0] != '\0') { - dataPtr->prefixBytes[UCHAR(dataPtr->final[0])] = 1; - } - - type.encodingName = name; - type.toUtfProc = EscapeToUtfProc; - type.fromUtfProc = EscapeFromUtfProc; - type.freeProc = EscapeFreeProc; - type.nullSize = 1; - type.clientData = (ClientData) dataPtr; - - return Tcl_CreateEncoding(&type); -} - -/* - *------------------------------------------------------------------------- - * - * BinaryProc -- - * - * The default conversion when no other conversion is specified. - * No translation is done; source bytes are copied directly to - * destination bytes. - * - * Results: - * Returns TCL_OK if conversion was successful. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static int -BinaryProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* Not used. */ - CONST char *src; /* Source string (unknown encoding). */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - int result; - - result = TCL_OK; - dstLen -= TCL_UTF_MAX - 1; - if (dstLen < 0) { - dstLen = 0; - } - if (srcLen > dstLen) { - srcLen = dstLen; - result = TCL_CONVERT_NOSPACE; - } - - *srcReadPtr = srcLen; - *dstWrotePtr = srcLen; - *dstCharsPtr = srcLen; - for ( ; --srcLen >= 0; ) { - *dst++ = *src++; - } - return result; -} - -/* - *------------------------------------------------------------------------- - * - * UtfToUtfProc -- - * - * Convert from UTF-8 to UTF-8. Note that the UTF-8 to UTF-8 - * translation is not a no-op, because it will turn a stream of - * improperly formed UTF-8 into a properly formed stream. - * - * Results: - * Returns TCL_OK if conversion was successful. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static int -UtfToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* Not used. */ - CONST char *src; /* Source string in UTF-8. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - CONST char *srcStart, *srcEnd, *srcClose; - char *dstStart, *dstEnd; - int result, numChars; - Tcl_UniChar ch; - - result = TCL_OK; - - srcStart = src; - srcEnd = src + srcLen; - srcClose = srcEnd; - if ((flags & TCL_ENCODING_END) == 0) { - srcClose -= TCL_UTF_MAX; - } - - dstStart = dst; - dstEnd = dst + dstLen - TCL_UTF_MAX; - - for (numChars = 0; src < srcEnd; numChars++) { - if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) { - /* - * If there is more string to follow, this will ensure that the - * last UTF-8 character in the source buffer hasn't been cut off. - */ - - result = TCL_CONVERT_MULTIBYTE; - break; - } - if (dst > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - src += Tcl_UtfToUniChar(src, &ch); - dst += Tcl_UniCharToUtf(ch, dst); - } - - *srcReadPtr = src - srcStart; - *dstWrotePtr = dst - dstStart; - *dstCharsPtr = numChars; - return result; -} - -/* - *------------------------------------------------------------------------- - * - * UnicodeToUtfProc -- - * - * Convert from Unicode to UTF-8. - * - * Results: - * Returns TCL_OK if conversion was successful. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static int -UnicodeToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* Not used. */ - CONST char *src; /* Source string in Unicode. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - CONST Tcl_UniChar *wSrc, *wSrcStart, *wSrcEnd; - char *dstEnd, *dstStart; - int result, numChars; - - result = TCL_OK; - if ((srcLen % sizeof(Tcl_UniChar)) != 0) { - result = TCL_CONVERT_MULTIBYTE; - srcLen /= sizeof(Tcl_UniChar); - srcLen *= sizeof(Tcl_UniChar); - } - - wSrc = (Tcl_UniChar *) src; - - wSrcStart = (Tcl_UniChar *) src; - wSrcEnd = (Tcl_UniChar *) (src + srcLen); - - dstStart = dst; - dstEnd = dst + dstLen - TCL_UTF_MAX; - - for (numChars = 0; wSrc < wSrcEnd; numChars++) { - if (dst > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - dst += Tcl_UniCharToUtf(*wSrc, dst); - wSrc++; - } - - *srcReadPtr = (char *) wSrc - (char *) wSrcStart; - *dstWrotePtr = dst - dstStart; - *dstCharsPtr = numChars; - return result; -} - -/* - *------------------------------------------------------------------------- - * - * UtfToUnicodeProc -- - * - * Convert from UTF-8 to Unicode. - * - * Results: - * Returns TCL_OK if conversion was successful. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static int -UtfToUnicodeProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* TableEncodingData that specifies encoding. */ - CONST char *src; /* Source string in UTF-8. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - CONST char *srcStart, *srcEnd, *srcClose; - Tcl_UniChar *wDst, *wDstStart, *wDstEnd; - int result, numChars; - - srcStart = src; - srcEnd = src + srcLen; - srcClose = srcEnd; - if ((flags & TCL_ENCODING_END) == 0) { - srcClose -= TCL_UTF_MAX; - } - - wDst = (Tcl_UniChar *) dst; - wDstStart = (Tcl_UniChar *) dst; - wDstEnd = (Tcl_UniChar *) (dst + dstLen - sizeof(Tcl_UniChar)); - - result = TCL_OK; - for (numChars = 0; src < srcEnd; numChars++) { - if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) { - /* - * If there is more string to follow, this will ensure that the - * last UTF-8 character in the source buffer hasn't been cut off. - */ - - result = TCL_CONVERT_MULTIBYTE; - break; - } - if (wDst > wDstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - src += Tcl_UtfToUniChar(src, wDst); - wDst++; - } - *srcReadPtr = src - srcStart; - *dstWrotePtr = (char *) wDst - (char *) wDstStart; - *dstCharsPtr = numChars; - return result; -} - -/* - *------------------------------------------------------------------------- - * - * TableToUtfProc -- - * - * Convert from the encoding specified by the TableEncodingData into - * UTF-8. - * - * Results: - * Returns TCL_OK if conversion was successful. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static int -TableToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* TableEncodingData that specifies - * encoding. */ - CONST char *src; /* Source string in specified encoding. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - CONST char *srcStart, *srcEnd; - char *dstEnd, *dstStart, *prefixBytes; - int result, byte, numChars; - Tcl_UniChar ch; - unsigned short **toUnicode; - unsigned short *pageZero; - TableEncodingData *dataPtr; - - srcStart = src; - srcEnd = src + srcLen; - - dstStart = dst; - dstEnd = dst + dstLen - TCL_UTF_MAX; - - dataPtr = (TableEncodingData *) clientData; - toUnicode = dataPtr->toUnicode; - prefixBytes = dataPtr->prefixBytes; - pageZero = toUnicode[0]; - - result = TCL_OK; - for (numChars = 0; src < srcEnd; numChars++) { - if (dst > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - byte = *((unsigned char *) src); - if (prefixBytes[byte]) { - src++; - if (src >= srcEnd) { - src--; - result = TCL_CONVERT_MULTIBYTE; - break; - } - ch = toUnicode[byte][*((unsigned char *) src)]; - } else { - ch = pageZero[byte]; - } - if ((ch == 0) && (byte != 0)) { - if (flags & TCL_ENCODING_STOPONERROR) { - result = TCL_CONVERT_SYNTAX; - break; - } - if (prefixBytes[byte]) { - src--; - } - ch = (Tcl_UniChar) byte; - } - dst += Tcl_UniCharToUtf(ch, dst); - src++; - } - *srcReadPtr = src - srcStart; - *dstWrotePtr = dst - dstStart; - *dstCharsPtr = numChars; - return result; -} - -/* - *------------------------------------------------------------------------- - * - * TableFromUtfProc -- - * - * Convert from UTF-8 into the encoding specified by the - * TableEncodingData. - * - * Results: - * Returns TCL_OK if conversion was successful. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static int -TableFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* TableEncodingData that specifies - * encoding. */ - CONST char *src; /* Source string in UTF-8. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - CONST char *srcStart, *srcEnd, *srcClose; - char *dstStart, *dstEnd, *prefixBytes; - Tcl_UniChar ch; - int result, len, word, numChars; - TableEncodingData *dataPtr; - unsigned short **fromUnicode; - - result = TCL_OK; - - dataPtr = (TableEncodingData *) clientData; - prefixBytes = dataPtr->prefixBytes; - fromUnicode = dataPtr->fromUnicode; - - srcStart = src; - srcEnd = src + srcLen; - srcClose = srcEnd; - if ((flags & TCL_ENCODING_END) == 0) { - srcClose -= TCL_UTF_MAX; - } - - dstStart = dst; - dstEnd = dst + dstLen - 1; - - for (numChars = 0; src < srcEnd; numChars++) { - if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) { - /* - * If there is more string to follow, this will ensure that the - * last UTF-8 character in the source buffer hasn't been cut off. - */ - - result = TCL_CONVERT_MULTIBYTE; - break; - } - len = Tcl_UtfToUniChar(src, &ch); - word = fromUnicode[(ch >> 8)][ch & 0xff]; - if ((word == 0) && (ch != 0)) { - if (flags & TCL_ENCODING_STOPONERROR) { - result = TCL_CONVERT_UNKNOWN; - break; - } - word = dataPtr->fallback; - } - if (prefixBytes[(word >> 8)] != 0) { - if (dst + 1 > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - dst[0] = (char) (word >> 8); - dst[1] = (char) word; - dst += 2; - } else { - if (dst > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - dst[0] = (char) word; - dst++; - } - src += len; - } - *srcReadPtr = src - srcStart; - *dstWrotePtr = dst - dstStart; - *dstCharsPtr = numChars; - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * TableFreeProc -- - * - * This procedure is invoked when an encoding is deleted. It deletes - * the memory used by the TableEncodingData. - * - * Results: - * None. - * - * Side effects: - * Memory freed. - * - *--------------------------------------------------------------------------- - */ - -static void -TableFreeProc(clientData) - ClientData clientData; /* TableEncodingData that specifies - * encoding. */ -{ - TableEncodingData *dataPtr; - - dataPtr = (TableEncodingData *) clientData; - ckfree((char *) dataPtr->toUnicode); - ckfree((char *) dataPtr->fromUnicode); - ckfree((char *) dataPtr); -} - -/* - *------------------------------------------------------------------------- - * - * EscapeToUtfProc -- - * - * Convert from the encoding specified by the EscapeEncodingData into - * UTF-8. - * - * Results: - * Returns TCL_OK if conversion was successful. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static int -EscapeToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* EscapeEncodingData that specifies - * encoding. */ - CONST char *src; /* Source string in specified encoding. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - EscapeEncodingData *dataPtr; - char *prefixBytes, *tablePrefixBytes; - unsigned short **tableToUnicode; - Encoding *encodingPtr; - int state, result, numChars; - CONST char *srcStart, *srcEnd; - char *dstStart, *dstEnd; - - result = TCL_OK; - - tablePrefixBytes = NULL; /* lint. */ - tableToUnicode = NULL; /* lint. */ - - dataPtr = (EscapeEncodingData *) clientData; - prefixBytes = dataPtr->prefixBytes; - encodingPtr = NULL; - - srcStart = src; - srcEnd = src + srcLen; - - dstStart = dst; - dstEnd = dst + dstLen - TCL_UTF_MAX; - - state = (int) *statePtr; - if (flags & TCL_ENCODING_START) { - state = 0; - } - - for (numChars = 0; src < srcEnd; ) { - int byte, hi, lo, ch; - - if (dst > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - byte = *((unsigned char *) src); - if (prefixBytes[byte]) { - unsigned int left, len, longest; - int checked, i; - EscapeSubTable *subTablePtr; - - /* - * Saw the beginning of an escape sequence. - */ - - left = srcEnd - src; - len = dataPtr->initLen; - longest = len; - checked = 0; - if (len <= left) { - checked++; - if ((len > 0) && - (memcmp(src, dataPtr->init, len) == 0)) { - /* - * If we see initialization string, skip it, even if we're - * not at the beginning of the buffer. - */ - - src += len; - continue; - } - } - len = dataPtr->finalLen; - if (len > longest) { - longest = len; - } - if (len <= left) { - checked++; - if ((len > 0) && - (memcmp(src, dataPtr->final, len) == 0)) { - /* - * If we see finalization string, skip it, even if we're - * not at the end of the buffer. - */ - - src += len; - continue; - } - } - subTablePtr = dataPtr->subTables; - for (i = 0; i < dataPtr->numSubTables; i++) { - len = subTablePtr->sequenceLen; - if (len > longest) { - longest = len; - } - if (len <= left) { - checked++; - if ((len > 0) && - (memcmp(src, subTablePtr->sequence, len) == 0)) { - state = i; - encodingPtr = NULL; - subTablePtr = NULL; - src += len; - break; - } - } - subTablePtr++; - } - if (subTablePtr == NULL) { - /* - * A match was found, the escape sequence was consumed, and - * the state was updated. - */ - - continue; - } - - /* - * We have a split-up or unrecognized escape sequence. If we - * checked all the sequences, then it's a syntax error, - * otherwise we need more bytes to determine a match. - */ - - if ((checked == dataPtr->numSubTables + 2) - || (flags & TCL_ENCODING_END)) { - if ((flags & TCL_ENCODING_STOPONERROR) == 0) { - /* - * Skip the unknown escape sequence. - */ - - src += longest; - continue; - } - result = TCL_CONVERT_SYNTAX; - } else { - result = TCL_CONVERT_MULTIBYTE; - } - break; - } - - if (encodingPtr == NULL) { - TableEncodingData *tableDataPtr; - - encodingPtr = GetTableEncoding(dataPtr, state); - tableDataPtr = (TableEncodingData *) encodingPtr->clientData; - tablePrefixBytes = tableDataPtr->prefixBytes; - tableToUnicode = tableDataPtr->toUnicode; - } - if (tablePrefixBytes[byte]) { - src++; - if (src >= srcEnd) { - src--; - result = TCL_CONVERT_MULTIBYTE; - break; - } - hi = byte; - lo = *((unsigned char *) src); - } else { - hi = 0; - lo = byte; - } - ch = tableToUnicode[hi][lo]; - dst += Tcl_UniCharToUtf(ch, dst); - src++; - numChars++; - } - - *statePtr = (Tcl_EncodingState) state; - *srcReadPtr = src - srcStart; - *dstWrotePtr = dst - dstStart; - *dstCharsPtr = numChars; - return result; -} - -/* - *------------------------------------------------------------------------- - * - * EscapeFromUtfProc -- - * - * Convert from UTF-8 into the encoding specified by the - * EscapeEncodingData. - * - * Results: - * Returns TCL_OK if conversion was successful. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -static int -EscapeFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* EscapeEncodingData that specifies - * encoding. */ - CONST char *src; /* Source string in UTF-8. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Place for conversion routine to store - * state information used during a piecewise - * conversion. Contents of statePtr are - * initialized and/or reset by conversion - * routine under control of flags argument. */ - char *dst; /* Output buffer in which converted string - * is stored. */ - int dstLen; /* The maximum length of output buffer in - * bytes. */ - int *srcReadPtr; /* Filled with the number of bytes from the - * source string that were converted. This - * may be less than the original source length - * if there was a problem converting some - * source characters. */ - int *dstWrotePtr; /* Filled with the number of bytes that were - * stored in the output buffer as a result of - * the conversion. */ - int *dstCharsPtr; /* Filled with the number of characters that - * correspond to the bytes stored in the - * output buffer. */ -{ - EscapeEncodingData *dataPtr; - Encoding *encodingPtr; - CONST char *srcStart, *srcEnd, *srcClose; - char *dstStart, *dstEnd; - int state, result, numChars; - TableEncodingData *tableDataPtr; - char *tablePrefixBytes; - unsigned short **tableFromUnicode; - - result = TCL_OK; - - dataPtr = (EscapeEncodingData *) clientData; - - srcStart = src; - srcEnd = src + srcLen; - srcClose = srcEnd; - if ((flags & TCL_ENCODING_END) == 0) { - srcClose -= TCL_UTF_MAX; - } - - dstStart = dst; - dstEnd = dst + dstLen - 1; - - if (flags & TCL_ENCODING_START) { - unsigned int len; - - state = 0; - len = dataPtr->subTables[0].sequenceLen; - if (dst + dataPtr->initLen + len > dstEnd) { - *srcReadPtr = 0; - *dstWrotePtr = 0; - return TCL_CONVERT_NOSPACE; - } - memcpy((VOID *) dst, (VOID *) dataPtr->init, - (size_t) dataPtr->initLen); - dst += dataPtr->initLen; - memcpy((VOID *) dst, (VOID *) dataPtr->subTables[0].sequence, - (size_t) len); - dst += len; - } else { - state = (int) *statePtr; - } - - encodingPtr = GetTableEncoding(dataPtr, state); - tableDataPtr = (TableEncodingData *) encodingPtr->clientData; - tablePrefixBytes = tableDataPtr->prefixBytes; - tableFromUnicode = tableDataPtr->fromUnicode; - - for (numChars = 0; src < srcEnd; numChars++) { - unsigned int len; - int word; - Tcl_UniChar ch; - - if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) { - /* - * If there is more string to follow, this will ensure that the - * last UTF-8 character in the source buffer hasn't been cut off. - */ - - result = TCL_CONVERT_MULTIBYTE; - break; - } - len = Tcl_UtfToUniChar(src, &ch); - word = tableFromUnicode[(ch >> 8)][ch & 0xff]; - - if ((word == 0) && (ch != 0)) { - int oldState; - EscapeSubTable *subTablePtr; - - oldState = state; - for (state = 0; state < dataPtr->numSubTables; state++) { - encodingPtr = GetTableEncoding(dataPtr, state); - tableDataPtr = (TableEncodingData *) encodingPtr->clientData; - word = tableDataPtr->fromUnicode[(ch >> 8)][ch & 0xff]; - if (word != 0) { - break; - } - } - - if (word == 0) { - state = oldState; - if (flags & TCL_ENCODING_STOPONERROR) { - result = TCL_CONVERT_UNKNOWN; - break; - } - encodingPtr = GetTableEncoding(dataPtr, state); - tableDataPtr = (TableEncodingData *) encodingPtr->clientData; - word = tableDataPtr->fallback; - } - - tablePrefixBytes = tableDataPtr->prefixBytes; - tableFromUnicode = tableDataPtr->fromUnicode; - - subTablePtr = &dataPtr->subTables[state]; - if (dst + subTablePtr->sequenceLen > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - memcpy((VOID *) dst, (VOID *) subTablePtr->sequence, - (size_t) subTablePtr->sequenceLen); - dst += subTablePtr->sequenceLen; - } - - if (tablePrefixBytes[(word >> 8)] != 0) { - if (dst + 1 > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - dst[0] = (char) (word >> 8); - dst[1] = (char) word; - dst += 2; - } else { - if (dst > dstEnd) { - result = TCL_CONVERT_NOSPACE; - break; - } - dst[0] = (char) word; - dst++; - } - src += len; - } - - if ((result == TCL_OK) && (flags & TCL_ENCODING_END)) { - if (dst + dataPtr->finalLen > dstEnd) { - result = TCL_CONVERT_NOSPACE; - } else { - memcpy((VOID *) dst, (VOID *) dataPtr->final, - (size_t) dataPtr->finalLen); - dst += dataPtr->finalLen; - } - } - - *statePtr = (Tcl_EncodingState) state; - *srcReadPtr = src - srcStart; - *dstWrotePtr = dst - dstStart; - *dstCharsPtr = numChars; - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * EscapeFreeProc -- - * - * This procedure is invoked when an EscapeEncodingData encoding is - * deleted. It deletes the memory used by the encoding. - * - * Results: - * None. - * - * Side effects: - * Memory freed. - * - *--------------------------------------------------------------------------- - */ - -static void -EscapeFreeProc(clientData) - ClientData clientData; /* EscapeEncodingData that specifies encoding. */ -{ - EscapeEncodingData *dataPtr; - EscapeSubTable *subTablePtr; - int i; - - dataPtr = (EscapeEncodingData *) clientData; - if (dataPtr == NULL) { - return; - } - subTablePtr = dataPtr->subTables; - for (i = 0; i < dataPtr->numSubTables; i++) { - FreeEncoding((Tcl_Encoding) subTablePtr->encodingPtr); - subTablePtr++; - } - ckfree((char *) dataPtr); -} - -/* - *--------------------------------------------------------------------------- - * - * GetTableEncoding -- - * - * Helper function for the EscapeEncodingData conversions. Gets the - * encoding (of type TextEncodingData) that represents the specified - * state. - * - * Results: - * The return value is the encoding. - * - * Side effects: - * If the encoding that represents the specified state has not - * already been used by this EscapeEncoding, it will be loaded - * and cached in the dataPtr. - * - *--------------------------------------------------------------------------- - */ - -static Encoding * -GetTableEncoding(dataPtr, state) - EscapeEncodingData *dataPtr;/* Contains names of encodings. */ - int state; /* Index in dataPtr of desired Encoding. */ -{ - EscapeSubTable *subTablePtr; - Encoding *encodingPtr; - - subTablePtr = &dataPtr->subTables[state]; - encodingPtr = subTablePtr->encodingPtr; - if (encodingPtr == NULL) { - encodingPtr = (Encoding *) Tcl_GetEncoding(NULL, subTablePtr->name); - if ((encodingPtr == NULL) - || (encodingPtr->toUtfProc != TableToUtfProc)) { - panic("EscapeToUtfProc: invalid sub table"); - } - subTablePtr->encodingPtr = encodingPtr; - } - return encodingPtr; -} - -/* - *--------------------------------------------------------------------------- - * - * unilen -- - * - * A helper function for the Tcl_ExternalToUtf functions. This - * function is similar to strlen for double-byte characters: it - * returns the number of bytes in a 0x0000 terminated string. - * - * Results: - * As above. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static size_t -unilen(src) - CONST char *src; -{ - unsigned short *p; - - p = (unsigned short *) src; - while (*p != 0x0000) { - p++; - } - return (char *) p - src; -} - - diff --git a/generic/tclEnv.c b/generic/tclEnv.c deleted file mode 100644 index 4e5854e..0000000 --- a/generic/tclEnv.c +++ /dev/null @@ -1,669 +0,0 @@ -/* - * tclEnv.c -- - * - * Tcl support for environment variables, including a setenv - * procedure. This file contains the generic portion of the - * environment module. It is primarily responsible for keeping - * the "env" arrays in sync with the system environment variables. - * - * Copyright (c) 1991-1994 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclEnv.c,v 1.4 1999/04/16 00:46:46 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -TCL_DECLARE_MUTEX(envMutex) /* To serialize access to environ */ - -static int cacheSize = 0; /* Number of env strings in environCache. */ -static char **environCache = NULL; - /* Array containing all of the environment - * strings that Tcl has allocated. */ - -#ifndef USE_PUTENV -static int environSize = 0; /* Non-zero means that the environ array was - * malloced and has this many total entries - * allocated to it (not all may be in use at - * once). Zero means that the environment - * array is in its original static state. */ -#endif - -/* - * Declarations for local procedures defined in this file: - */ - -static char * EnvTraceProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, - int flags)); -static void ReplaceString _ANSI_ARGS_((CONST char *oldStr, - char *newStr)); -void TclSetEnv _ANSI_ARGS_((CONST char *name, - CONST char *value)); -void TclUnsetEnv _ANSI_ARGS_((CONST char *name)); - - -/* - *---------------------------------------------------------------------- - * - * TclSetupEnv -- - * - * This procedure is invoked for an interpreter to make environment - * variables accessible from that interpreter via the "env" - * associative array. - * - * Results: - * None. - * - * Side effects: - * The interpreter is added to a list of interpreters managed - * by us, so that its view of envariables can be kept consistent - * with the view in other interpreters. If this is the first - * call to TclSetupEnv, then additional initialization happens, - * such as copying the environment to dynamically-allocated space - * for ease of management. - * - *---------------------------------------------------------------------- - */ - -void -TclSetupEnv(interp) - Tcl_Interp *interp; /* Interpreter whose "env" array is to be - * managed. */ -{ - Tcl_DString envString; - char *p1, *p2; - int i; - - /* - * Synchronize the values in the environ array with the contents - * of the Tcl "env" variable. To do this: - * 1) Remove the trace that fires when the "env" var is unset. - * 2) Unset the "env" variable. - * 3) If there are no environ variables, create an empty "env" - * array. Otherwise populate the array with current values. - * 4) Add a trace that synchronizes the "env" array. - */ - - Tcl_UntraceVar2(interp, "env", (char *) NULL, - TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS | - TCL_TRACE_READS | TCL_TRACE_ARRAY, EnvTraceProc, - (ClientData) NULL); - - Tcl_UnsetVar2(interp, "env", (char *) NULL, TCL_GLOBAL_ONLY); - - if (environ[0] == NULL) { - Tcl_Obj *varNamePtr; - - varNamePtr = Tcl_NewStringObj("env", -1); - Tcl_IncrRefCount(varNamePtr); - TclArraySet(interp, varNamePtr, NULL); - Tcl_DecrRefCount(varNamePtr); - } else { - Tcl_MutexLock(&envMutex); - for (i = 0; environ[i] != NULL; i++) { - p1 = Tcl_ExternalToUtfDString(NULL, environ[i], -1, &envString); - p2 = strchr(p1, '='); - if (p2 == NULL) { - /* - * This condition seem to happen occasionally under some - * versions of Solaris; ignore the entry. - */ - - continue; - } - p2++; - p2[-1] = '\0'; - Tcl_SetVar2(interp, "env", p1, p2, TCL_GLOBAL_ONLY); - Tcl_DStringFree(&envString); - } - Tcl_MutexUnlock(&envMutex); - } - - Tcl_TraceVar2(interp, "env", (char *) NULL, - TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS | - TCL_TRACE_READS | TCL_TRACE_ARRAY, EnvTraceProc, - (ClientData) NULL); -} - -/* - *---------------------------------------------------------------------- - * - * TclSetEnv -- - * - * Set an environment variable, replacing an existing value - * or creating a new variable if there doesn't exist a variable - * by the given name. This procedure is intended to be a - * stand-in for the UNIX "setenv" procedure so that applications - * using that procedure will interface properly to Tcl. To make - * it a stand-in, the Makefile must define "TclSetEnv" to "setenv". - * - * Results: - * None. - * - * Side effects: - * The environ array gets updated. - * - *---------------------------------------------------------------------- - */ - -void -TclSetEnv(name, value) - CONST char *name; /* Name of variable whose value is to be - * set (UTF-8). */ - CONST char *value; /* New value for variable (UTF-8). */ -{ - Tcl_DString envString; - int index, length, nameLength; - char *p, *p2, *oldValue; - - /* - * Figure out where the entry is going to go. If the name doesn't - * already exist, enlarge the array if necessary to make room. If the - * name exists, free its old entry. - */ - - Tcl_MutexLock(&envMutex); - index = TclpFindVariable(name, &length); - - if (index == -1) { -#ifndef USE_PUTENV - if ((length + 2) > environSize) { - char **newEnviron; - - newEnviron = (char **) ckalloc((unsigned) - ((length + 5) * sizeof(char *))); - memcpy((VOID *) newEnviron, (VOID *) environ, - length*sizeof(char *)); - if (environSize != 0) { - ckfree((char *) environ); - } - environ = newEnviron; - environSize = length + 5; - } - index = length; - environ[index + 1] = NULL; -#endif - oldValue = NULL; - nameLength = strlen(name); - } else { - char *env; - - /* - * Compare the new value to the existing value. If they're - * the same then quit immediately (e.g. don't rewrite the - * value or propagate it to other interpreters). Otherwise, - * when there are N interpreters there will be N! propagations - * of the same value among the interpreters. - */ - - env = Tcl_ExternalToUtfDString(NULL, environ[index], -1, &envString); - if (strcmp(value, (env + length + 1)) == 0) { - Tcl_DStringFree(&envString); - Tcl_MutexUnlock(&envMutex); - return; - } - Tcl_DStringFree(&envString); - - oldValue = environ[index]; - nameLength = length; - } - - - /* - * Create a new entry. Build a complete UTF string that contains - * a "name=value" pattern. Then convert the string to the native - * encoding, and set the environ array value. - */ - - p = (char *) ckalloc((unsigned) (nameLength + strlen(value) + 2)); - strcpy(p, name); - p[nameLength] = '='; - strcpy(p+nameLength+1, value); - p2 = Tcl_UtfToExternalDString(NULL, p, -1, &envString); - ckfree(p); - - -#ifdef USE_PUTENV - /* - * Update the system environment. - */ - - putenv(p2); - index = TclpFindVariable(name, &length); -#else - /* - * Copy the native string to heap memory. - */ - - p = (char *) ckalloc((unsigned) (strlen(p2) + 1)); - strcpy(p, p2); - environ[index] = p; -#endif - - /* - * Watch out for versions of putenv that copy the string (e.g. VC++). - * In this case we need to free the string immediately. Otherwise - * update the string in the cache. - */ - - if (environ[index] != p) { - Tcl_DStringFree(&envString); - } else { - ReplaceString(oldValue, p); - } - - Tcl_MutexUnlock(&envMutex); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PutEnv -- - * - * Set an environment variable. Similar to setenv except that - * the information is passed in a single string of the form - * NAME=value, rather than as separate name strings. This procedure - * is intended to be a stand-in for the UNIX "putenv" procedure - * so that applications using that procedure will interface - * properly to Tcl. To make it a stand-in, the Makefile will - * define "Tcl_PutEnv" to "putenv". - * - * Results: - * None. - * - * Side effects: - * The environ array gets updated, as do all of the interpreters - * that we manage. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_PutEnv(string) - CONST char *string; /* Info about environment variable in the - * form NAME=value. (native) */ -{ - Tcl_DString nameString; - int nameLength; - char *name, *value; - - if (string == NULL) { - return 0; - } - - /* - * First convert the native string to UTF. Then separate the - * string into name and value parts, and call TclSetEnv to do - * all of the real work. - */ - - name = Tcl_ExternalToUtfDString(NULL, string, -1, &nameString); - value = strchr(name, '='); - if (value == NULL) { - return 0; - } - nameLength = value - name; - if (nameLength == 0) { - return 0; - } - - value[0] = '\0'; - TclSetEnv(name, value+1); - Tcl_DStringFree(&nameString); - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclUnsetEnv -- - * - * Remove an environment variable, updating the "env" arrays - * in all interpreters managed by us. This function is intended - * to replace the UNIX "unsetenv" function (but to do this the - * Makefile must be modified to redefine "TclUnsetEnv" to - * "unsetenv". - * - * Results: - * None. - * - * Side effects: - * Interpreters are updated, as is environ. - * - *---------------------------------------------------------------------- - */ - -void -TclUnsetEnv(name) - CONST char *name; /* Name of variable to remove (UTF-8). */ -{ - char *oldValue; - int length, index; -#ifdef USE_PUTENV - Tcl_DString envString; - char *string; -#else - char **envPtr; -#endif - - Tcl_MutexLock(&envMutex); - index = TclpFindVariable(name, &length); - - /* - * First make sure that the environment variable exists to avoid - * doing needless work and to avoid recursion on the unset. - */ - - if (index == -1) { - Tcl_MutexUnlock(&envMutex); - return; - } - /* - * Remember the old value so we can free it if Tcl created the string. - */ - - oldValue = environ[index]; - - /* - * Update the system environment. This must be done before we - * update the interpreters or we will recurse. - */ - -#ifdef USE_PUTENV - string = ckalloc(length+2); - memcpy((VOID *) string, (VOID *) name, (size_t) length); - string[length] = '='; - string[length+1] = '\0'; - - Tcl_UtfToExternalDString(NULL, string, -1, &envString); - ckfree(string); - string = Tcl_DStringValue(&envString); - putenv(string); - - /* - * Watch out for versions of putenv that copy the string (e.g. VC++). - * In this case we need to free the string immediately. Otherwise - * update the string in the cache. - */ - - if (environ[index] != string) { - Tcl_DStringFree(&envString); - } else { - ReplaceString(oldValue, string); - } -#else - for (envPtr = environ+index+1; ; envPtr++) { - envPtr[-1] = *envPtr; - if (*envPtr == NULL) { - break; - } - } - ReplaceString(oldValue, NULL); -#endif - - Tcl_MutexUnlock(&envMutex); -} - -/* - *--------------------------------------------------------------------------- - * - * TclGetEnv -- - * - * Retrieve the value of an environment variable. - * - * Results: - * The result is a pointer to a string specifying the value of the - * environment variable, or NULL if that environment variable does - * not exist. Storage for the result string is allocated in valuePtr; - * the caller must call Tcl_DStringFree() when the result is no - * longer needed. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -TclGetEnv(name, valuePtr) - CONST char *name; /* Name of environment variable to find - * (UTF-8). */ - Tcl_DString *valuePtr; /* Uninitialized or free DString in which - * the value of the environment variable is - * stored. */ -{ - int length, index; - char *result; - - Tcl_MutexLock(&envMutex); - index = TclpFindVariable(name, &length); - result = NULL; - if (index != -1) { - Tcl_DString envStr; - - result = Tcl_ExternalToUtfDString(NULL, environ[index], -1, &envStr); - result += length; - if (*result == '=') { - result++; - Tcl_DStringInit(valuePtr); - Tcl_DStringAppend(valuePtr, result, -1); - result = Tcl_DStringValue(valuePtr); - } else { - result = NULL; - } - Tcl_DStringFree(&envStr); - } - Tcl_MutexUnlock(&envMutex); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * EnvTraceProc -- - * - * This procedure is invoked whenever an environment variable - * is read, modified or deleted. It propagates the change to the global - * "environ" array. - * - * Results: - * Always returns NULL to indicate success. - * - * Side effects: - * Environment variable changes get propagated. If the whole - * "env" array is deleted, then we stop managing things for - * this interpreter (usually this happens because the whole - * interpreter is being deleted). - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static char * -EnvTraceProc(clientData, interp, name1, name2, flags) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Interpreter whose "env" variable is - * being modified. */ - char *name1; /* Better be "env". */ - char *name2; /* Name of variable being modified, or NULL - * if whole array is being deleted (UTF-8). */ - int flags; /* Indicates what's happening. */ -{ - /* - * For array traces, let TclSetupEnv do all the work. - */ - - if (flags & TCL_TRACE_ARRAY) { - TclSetupEnv(interp); - return NULL; - } - - /* - * If name2 is NULL, then return and do nothing. - */ - - if (name2 == NULL) { - return NULL; - } - - /* - * If a value is being set, call TclSetEnv to do all of the work. - */ - - if (flags & TCL_TRACE_WRITES) { - char *value; - - value = Tcl_GetVar2(interp, "env", name2, TCL_GLOBAL_ONLY); - TclSetEnv(name2, value); - } - - /* - * If a value is being read, call TclGetEnv to do all of the work. - */ - - if (flags & TCL_TRACE_READS) { - Tcl_DString valueString; - char *value; - - value = TclGetEnv(name2, &valueString); - if (value == NULL) { - return "no such variable"; - } - Tcl_SetVar2(interp, name1, name2, value, 0); - Tcl_DStringFree(&valueString); - } - - /* - * For unset traces, let TclUnsetEnv do all the work. - */ - - if (flags & TCL_TRACE_UNSETS) { - TclUnsetEnv(name2); - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * ReplaceString -- - * - * Replace one string with another in the environment variable - * cache. The cache keeps track of all of the environment - * variables that Tcl has modified so they can be freed later. - * - * Results: - * None. - * - * Side effects: - * May free the old string. - * - *---------------------------------------------------------------------- - */ - -static void -ReplaceString(oldStr, newStr) - CONST char *oldStr; /* Old environment string. */ - char *newStr; /* New environment string. */ -{ - int i; - char **newCache; - - /* - * Check to see if the old value was allocated by Tcl. If so, - * it needs to be deallocated to avoid memory leaks. Note that this - * algorithm is O(n), not O(1). This will result in n-squared behavior - * if lots of environment changes are being made. - */ - - for (i = 0; i < cacheSize; i++) { - if ((environCache[i] == oldStr) || (environCache[i] == NULL)) { - break; - } - } - if (i < cacheSize) { - /* - * Replace or delete the old value. - */ - - if (environCache[i]) { - ckfree(environCache[i]); - } - - if (newStr) { - environCache[i] = newStr; - } else { - for (; i < cacheSize-1; i++) { - environCache[i] = environCache[i+1]; - } - environCache[cacheSize-1] = NULL; - } - } else { - int allocatedSize = (cacheSize + 5) * sizeof(char *); - - /* - * We need to grow the cache in order to hold the new string. - */ - - newCache = (char **) ckalloc((unsigned) allocatedSize); - (VOID *) memset(newCache, (int) 0, (size_t) allocatedSize); - - if (environCache) { - memcpy((VOID *) newCache, (VOID *) environCache, - (size_t) (cacheSize * sizeof(char*))); - ckfree((char *) environCache); - } - environCache = newCache; - environCache[cacheSize] = (char *) newStr; - environCache[cacheSize+1] = NULL; - cacheSize += 5; - } -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeEnvironment -- - * - * This function releases any storage allocated by this module - * that isn't still in use by the global environment. Any - * strings that are still in the environment will be leaked. - * - * Results: - * None. - * - * Side effects: - * May deallocate storage. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeEnvironment() -{ - /* - * For now we just deallocate the cache array and none of the environment - * strings. This may leak more memory that strictly necessary, since some - * of the strings may no longer be in the environment. However, - * determining which ones are ok to delete is n-squared, and is pretty - * unlikely, so we don't bother. - */ - - if (environCache) { - ckfree((char *) environCache); - environCache = NULL; - cacheSize = 0; -#ifndef USE_PUTENV - environSize = 0; -#endif - } -} - - - - diff --git a/generic/tclEvent.c b/generic/tclEvent.c deleted file mode 100644 index 7499577..0000000 --- a/generic/tclEvent.c +++ /dev/null @@ -1,1129 +0,0 @@ -/* - * tclEvent.c -- - * - * This file implements some general event related interfaces including - * background errors, exit handlers, and the "vwait" and "update" - * command procedures. - * - * Copyright (c) 1990-1994 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclEvent.c,v 1.4 1999/04/16 00:46:46 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * The data structure below is used to report background errors. One - * such structure is allocated for each error; it holds information - * about the interpreter and the error until bgerror can be invoked - * later as an idle handler. - */ - -typedef struct BgError { - Tcl_Interp *interp; /* Interpreter in which error occurred. NULL - * means this error report has been cancelled - * (a previous report generated a break). */ - char *errorMsg; /* Copy of the error message (the interp's - * result when the error occurred). - * Malloc-ed. */ - char *errorInfo; /* Value of the errorInfo variable - * (malloc-ed). */ - char *errorCode; /* Value of the errorCode variable - * (malloc-ed). */ - struct BgError *nextPtr; /* Next in list of all pending error - * reports for this interpreter, or NULL - * for end of list. */ -} BgError; - -/* - * One of the structures below is associated with the "tclBgError" - * assoc data for each interpreter. It keeps track of the head and - * tail of the list of pending background errors for the interpreter. - */ - -typedef struct ErrAssocData { - BgError *firstBgPtr; /* First in list of all background errors - * waiting to be processed for this - * interpreter (NULL if none). */ - BgError *lastBgPtr; /* Last in list of all background errors - * waiting to be processed for this - * interpreter (NULL if none). */ -} ErrAssocData; - -/* - * For each exit handler created with a call to Tcl_CreateExitHandler - * there is a structure of the following type: - */ - -typedef struct ExitHandler { - Tcl_ExitProc *proc; /* Procedure to call when process exits. */ - ClientData clientData; /* One word of information to pass to proc. */ - struct ExitHandler *nextPtr;/* Next in list of all exit handlers for - * this application, or NULL for end of list. */ -} ExitHandler; - -/* - * There is both per-process and per-thread exit handlers. - * The first list is controlled by a mutex. The other is in - * thread local storage. - */ - -static ExitHandler *firstExitPtr = NULL; - /* First in list of all exit handlers for - * application. */ -TCL_DECLARE_MUTEX(exitMutex) - -/* - * This variable is set to 1 when Tcl_Finalize is called, and at the end of - * its work, it is reset to 0. The variable is checked by TclInExit() to - * allow different behavior for exit-time processing, e.g. in closing of - * files and pipes. - */ - -static int inFinalize = 0; -static int subsystemsInitialized = 0; -static int encodingsInitialized = 0; - -static Tcl_Obj *tclLibraryPath = NULL; - -typedef struct ThreadSpecificData { - ExitHandler *firstExitPtr; /* First in list of all exit handlers for - * this thread. */ - int inExit; /* True when this thread is exiting. This - * is used as a hack to decide to close - * the standard channels. */ -} ThreadSpecificData; -static Tcl_ThreadDataKey dataKey; - -/* - * Prototypes for procedures referenced only in this file: - */ - -static void BgErrorDeleteProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp)); -static void HandleBgErrors _ANSI_ARGS_((ClientData clientData)); -static char * VwaitVarProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, - int flags)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_BackgroundError -- - * - * This procedure is invoked to handle errors that occur in Tcl - * commands that are invoked in "background" (e.g. from event or - * timer bindings). - * - * Results: - * None. - * - * Side effects: - * The command "bgerror" is invoked later as an idle handler to - * process the error, passing it the error message. If that fails, - * then an error message is output on stderr. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_BackgroundError(interp) - Tcl_Interp *interp; /* Interpreter in which an error has - * occurred. */ -{ - BgError *errPtr; - char *errResult, *varValue; - ErrAssocData *assocPtr; - int length; - - /* - * The Tcl_AddErrorInfo call below (with an empty string) ensures that - * errorInfo gets properly set. It's needed in cases where the error - * came from a utility procedure like Tcl_GetVar instead of Tcl_Eval; - * in these cases errorInfo still won't have been set when this - * procedure is called. - */ - - Tcl_AddErrorInfo(interp, ""); - - errResult = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length); - - errPtr = (BgError *) ckalloc(sizeof(BgError)); - errPtr->interp = interp; - errPtr->errorMsg = (char *) ckalloc((unsigned) (length + 1)); - memcpy(errPtr->errorMsg, errResult, (size_t) (length + 1)); - varValue = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - if (varValue == NULL) { - varValue = errPtr->errorMsg; - } - errPtr->errorInfo = (char *) ckalloc((unsigned) (strlen(varValue) + 1)); - strcpy(errPtr->errorInfo, varValue); - varValue = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY); - if (varValue == NULL) { - varValue = ""; - } - errPtr->errorCode = (char *) ckalloc((unsigned) (strlen(varValue) + 1)); - strcpy(errPtr->errorCode, varValue); - errPtr->nextPtr = NULL; - - assocPtr = (ErrAssocData *) Tcl_GetAssocData(interp, "tclBgError", - (Tcl_InterpDeleteProc **) NULL); - if (assocPtr == NULL) { - - /* - * This is the first time a background error has occurred in - * this interpreter. Create associated data to keep track of - * pending error reports. - */ - - assocPtr = (ErrAssocData *) ckalloc(sizeof(ErrAssocData)); - assocPtr->firstBgPtr = NULL; - assocPtr->lastBgPtr = NULL; - Tcl_SetAssocData(interp, "tclBgError", BgErrorDeleteProc, - (ClientData) assocPtr); - } - if (assocPtr->firstBgPtr == NULL) { - assocPtr->firstBgPtr = errPtr; - Tcl_DoWhenIdle(HandleBgErrors, (ClientData) assocPtr); - } else { - assocPtr->lastBgPtr->nextPtr = errPtr; - } - assocPtr->lastBgPtr = errPtr; - Tcl_ResetResult(interp); -} - -/* - *---------------------------------------------------------------------- - * - * HandleBgErrors -- - * - * This procedure is invoked as an idle handler to process all of - * the accumulated background errors. - * - * Results: - * None. - * - * Side effects: - * Depends on what actions "bgerror" takes for the errors. - * - *---------------------------------------------------------------------- - */ - -static void -HandleBgErrors(clientData) - ClientData clientData; /* Pointer to ErrAssocData structure. */ -{ - Tcl_Interp *interp; - char *argv[2]; - int code; - BgError *errPtr; - ErrAssocData *assocPtr = (ErrAssocData *) clientData; - Tcl_Channel errChannel; - - Tcl_Preserve((ClientData) assocPtr); - - while (assocPtr->firstBgPtr != NULL) { - interp = assocPtr->firstBgPtr->interp; - if (interp == NULL) { - goto doneWithInterp; - } - - /* - * Restore important state variables to what they were at - * the time the error occurred. - */ - - Tcl_SetVar(interp, "errorInfo", assocPtr->firstBgPtr->errorInfo, - TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "errorCode", assocPtr->firstBgPtr->errorCode, - TCL_GLOBAL_ONLY); - - /* - * Create and invoke the bgerror command. - */ - - argv[0] = "bgerror"; - argv[1] = assocPtr->firstBgPtr->errorMsg; - - Tcl_AllowExceptions(interp); - Tcl_Preserve((ClientData) interp); - code = TclGlobalInvoke(interp, 2, argv, 0); - if (code == TCL_ERROR) { - - /* - * If the interpreter is safe, we look for a hidden command - * named "bgerror" and call that with the error information. - * Otherwise, simply ignore the error. The rationale is that - * this could be an error caused by a malicious applet trying - * to cause an infinite barrage of error messages. The hidden - * "bgerror" command can be used by a security policy to - * interpose on such attacks and e.g. kill the applet after a - * few attempts. - */ - - if (Tcl_IsSafe(interp)) { - Tcl_SavedResult save; - - Tcl_SaveResult(interp, &save); - TclGlobalInvoke(interp, 2, argv, TCL_INVOKE_HIDDEN); - Tcl_RestoreResult(interp, &save); - - goto doneWithInterp; - } - - /* - * We have to get the error output channel at the latest possible - * time, because the eval (above) might have changed the channel. - */ - - errChannel = Tcl_GetStdChannel(TCL_STDERR); - if (errChannel != (Tcl_Channel) NULL) { - char *string; - int len; - - string = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &len); - if (strcmp(string, "\"bgerror\" is an invalid command name or ambiguous abbreviation") == 0) { - Tcl_WriteChars(errChannel, assocPtr->firstBgPtr->errorInfo, -1); - Tcl_WriteChars(errChannel, "\n", -1); - } else { - Tcl_WriteChars(errChannel, - "bgerror failed to handle background error.\n", - -1); - Tcl_WriteChars(errChannel, " Original error: ", -1); - Tcl_WriteChars(errChannel, assocPtr->firstBgPtr->errorMsg, - -1); - Tcl_WriteChars(errChannel, "\n", -1); - Tcl_WriteChars(errChannel, " Error in bgerror: ", -1); - Tcl_WriteChars(errChannel, string, len); - Tcl_WriteChars(errChannel, "\n", -1); - } - Tcl_Flush(errChannel); - } - } else if (code == TCL_BREAK) { - - /* - * Break means cancel any remaining error reports for this - * interpreter. - */ - - for (errPtr = assocPtr->firstBgPtr; errPtr != NULL; - errPtr = errPtr->nextPtr) { - if (errPtr->interp == interp) { - errPtr->interp = NULL; - } - } - } - - /* - * Discard the command and the information about the error report. - */ - -doneWithInterp: - - if (assocPtr->firstBgPtr) { - ckfree(assocPtr->firstBgPtr->errorMsg); - ckfree(assocPtr->firstBgPtr->errorInfo); - ckfree(assocPtr->firstBgPtr->errorCode); - errPtr = assocPtr->firstBgPtr->nextPtr; - ckfree((char *) assocPtr->firstBgPtr); - assocPtr->firstBgPtr = errPtr; - } - - if (interp != NULL) { - Tcl_Release((ClientData) interp); - } - } - assocPtr->lastBgPtr = NULL; - - Tcl_Release((ClientData) assocPtr); -} - -/* - *---------------------------------------------------------------------- - * - * BgErrorDeleteProc -- - * - * This procedure is associated with the "tclBgError" assoc data - * for an interpreter; it is invoked when the interpreter is - * deleted in order to free the information assoicated with any - * pending error reports. - * - * Results: - * None. - * - * Side effects: - * Background error information is freed: if there were any - * pending error reports, they are cancelled. - * - *---------------------------------------------------------------------- - */ - -static void -BgErrorDeleteProc(clientData, interp) - ClientData clientData; /* Pointer to ErrAssocData structure. */ - Tcl_Interp *interp; /* Interpreter being deleted. */ -{ - ErrAssocData *assocPtr = (ErrAssocData *) clientData; - BgError *errPtr; - - while (assocPtr->firstBgPtr != NULL) { - errPtr = assocPtr->firstBgPtr; - assocPtr->firstBgPtr = errPtr->nextPtr; - ckfree(errPtr->errorMsg); - ckfree(errPtr->errorInfo); - ckfree(errPtr->errorCode); - ckfree((char *) errPtr); - } - Tcl_CancelIdleCall(HandleBgErrors, (ClientData) assocPtr); - Tcl_EventuallyFree((ClientData) assocPtr, TCL_DYNAMIC); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateExitHandler -- - * - * Arrange for a given procedure to be invoked just before the - * application exits. - * - * Results: - * None. - * - * Side effects: - * Proc will be invoked with clientData as argument when the - * application exits. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_CreateExitHandler(proc, clientData) - Tcl_ExitProc *proc; /* Procedure to invoke. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ -{ - ExitHandler *exitPtr; - - exitPtr = (ExitHandler *) ckalloc(sizeof(ExitHandler)); - exitPtr->proc = proc; - exitPtr->clientData = clientData; - Tcl_MutexLock(&exitMutex); - exitPtr->nextPtr = firstExitPtr; - firstExitPtr = exitPtr; - Tcl_MutexUnlock(&exitMutex); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteExitHandler -- - * - * This procedure cancels an existing exit handler matching proc - * and clientData, if such a handler exits. - * - * Results: - * None. - * - * Side effects: - * If there is an exit handler corresponding to proc and clientData - * then it is cancelled; if no such handler exists then nothing - * happens. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteExitHandler(proc, clientData) - Tcl_ExitProc *proc; /* Procedure that was previously registered. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ -{ - ExitHandler *exitPtr, *prevPtr; - - Tcl_MutexLock(&exitMutex); - for (prevPtr = NULL, exitPtr = firstExitPtr; exitPtr != NULL; - prevPtr = exitPtr, exitPtr = exitPtr->nextPtr) { - if ((exitPtr->proc == proc) - && (exitPtr->clientData == clientData)) { - if (prevPtr == NULL) { - firstExitPtr = exitPtr->nextPtr; - } else { - prevPtr->nextPtr = exitPtr->nextPtr; - } - Tcl_MutexUnlock(&exitMutex); - ckfree((char *) exitPtr); - return; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateThreadExitHandler -- - * - * Arrange for a given procedure to be invoked just before the - * current thread exits. - * - * Results: - * None. - * - * Side effects: - * Proc will be invoked with clientData as argument when the - * application exits. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_CreateThreadExitHandler(proc, clientData) - Tcl_ExitProc *proc; /* Procedure to invoke. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ -{ - ExitHandler *exitPtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - exitPtr = (ExitHandler *) ckalloc(sizeof(ExitHandler)); - exitPtr->proc = proc; - exitPtr->clientData = clientData; - exitPtr->nextPtr = tsdPtr->firstExitPtr; - tsdPtr->firstExitPtr = exitPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteThreadExitHandler -- - * - * This procedure cancels an existing exit handler matching proc - * and clientData, if such a handler exits. - * - * Results: - * None. - * - * Side effects: - * If there is an exit handler corresponding to proc and clientData - * then it is cancelled; if no such handler exists then nothing - * happens. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteThreadExitHandler(proc, clientData) - Tcl_ExitProc *proc; /* Procedure that was previously registered. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ -{ - ExitHandler *exitPtr, *prevPtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - for (prevPtr = NULL, exitPtr = tsdPtr->firstExitPtr; exitPtr != NULL; - prevPtr = exitPtr, exitPtr = exitPtr->nextPtr) { - if ((exitPtr->proc == proc) - && (exitPtr->clientData == clientData)) { - if (prevPtr == NULL) { - tsdPtr->firstExitPtr = exitPtr->nextPtr; - } else { - prevPtr->nextPtr = exitPtr->nextPtr; - } - ckfree((char *) exitPtr); - return; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Exit -- - * - * This procedure is called to terminate the application. - * - * Results: - * None. - * - * Side effects: - * All existing exit handlers are invoked, then the application - * ends. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_Exit(status) - int status; /* Exit status for application; typically - * 0 for normal return, 1 for error return. */ -{ - Tcl_Finalize(); - TclpExit(status); -} - -/* - *------------------------------------------------------------------------- - * - * TclSetLibraryPath -- - * - * Set the path that will be used for searching for init.tcl and - * encodings when an interp is being created. - * - * Results: - * None. - * - * Side effects: - * Changing the library path will affect what directories are - * examined when looking for encodings for all interps from that - * point forward. - * - * The refcount of the new library path is incremented and the - * refcount of the old path is decremented. - * - *------------------------------------------------------------------------- - */ - -void -TclSetLibraryPath(pathPtr) - Tcl_Obj *pathPtr; /* A Tcl list object whose elements are - * the new library path. */ -{ - Tcl_MutexLock(&exitMutex); - if (pathPtr != NULL) { - Tcl_IncrRefCount(pathPtr); - } - if (tclLibraryPath != NULL) { - Tcl_DecrRefCount(tclLibraryPath); - } - tclLibraryPath = pathPtr; - Tcl_MutexUnlock(&exitMutex); -} - -/* - *------------------------------------------------------------------------- - * - * TclGetLibraryPath -- - * - * Return a Tcl list object whose elements are the library path. - * The caller should not modify the contents of the returned object. - * - * Results: - * As above. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -Tcl_Obj * -TclGetLibraryPath() -{ - return tclLibraryPath; -} - -/* - *------------------------------------------------------------------------- - * - * TclInitSubsystems -- - * - * Initialize various subsytems in Tcl. This should be called the - * first time an interp is created, or before any of the subsystems - * are used. This function ensures an order for the initialization - * of subsystems: - * - * 1. that cannot be initialized in lazy order because they are - * mutually dependent. - * - * 2. so that they can be finalized in a known order w/o causing - * the subsequent re-initialization of a subsystem in the act of - * shutting down another. - * - * Results: - * None. - * - * Side effects: - * Varied, see the respective initialization routines. - * - *------------------------------------------------------------------------- - */ - -void -TclInitSubsystems(argv0) - CONST char *argv0; /* Name of executable from argv[0] to main() - * in native multi-byte encoding. */ -{ - ThreadSpecificData *tsdPtr; - - if (inFinalize != 0) { - panic("TclInitSubsystems called while finalizing"); - } - - /* - * Grab the thread local storage pointer before doing anything because - * the initialization routines will be registering exit handlers. - * We use this pointer to detect if this is the first time this - * thread has created an interpreter. - */ - - tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); - if (subsystemsInitialized == 0) { - /* - * Double check inside the mutex. There are definitly calls - * back into this routine from some of the procedures below. - */ - - TclpInitLock(); - if (subsystemsInitialized == 0) { - /* - * Have to set this bit here to avoid deadlock with the - * routines below us that call into TclInitSubsystems. - */ - - subsystemsInitialized = 1; - - tclExecutableName = NULL; - - /* - * Initialize locks used by the memory allocators before anything - * interesting happens so we can use the allocators in the - * implementation of self-initializing locks. - */ -#if USE_TCLALLOC - TclInitAlloc(); -#endif -#ifdef TCL_MEM_DEBUG - TclInitDbCkalloc(); -#endif - - TclpInitPlatform(); - TclInitObjSubsystem(); - TclInitIOSubsystem(); - TclInitEncodingSubsystem(); - TclInitNamespaceSubsystem(); - } - TclpInitUnlock(); - } - - if (tsdPtr == NULL) { - /* - * First time this thread has created an interpreter. - * We fetch the key again just in case no exit handlers were - * registered by this point. - */ - - (void) TCL_TSD_INIT(&dataKey); - TclInitNotifier(); - } -} - -/* - *------------------------------------------------------------------------- - * - * TclFindEncodings -- - * - * Find and load the encoding file for this operating system. - * Before this is called, Tcl makes assumptions about the - * native string representation, but the true encoding is not - * assured. - * - * Results: - * None. - * - * Side effects: - * Varied, see the respective initialization routines. - * - *------------------------------------------------------------------------- - */ - -void -TclFindEncodings(argv0) - CONST char *argv0; /* Name of executable from argv[0] to main() - * in native multi-byte encoding. */ -{ - char *native; - Tcl_Obj *pathPtr; - Tcl_DString libPath, buffer; - - if (encodingsInitialized == 0) { - /* - * Double check inside the mutex. There may be calls - * back into this routine from some of the procedures below. - */ - - TclpInitLock(); - if (encodingsInitialized == 0) { - /* - * Have to set this bit here to avoid deadlock with the - * routines below us that call into TclInitSubsystems. - */ - - encodingsInitialized = 1; - - native = TclpFindExecutable(argv0); - TclpInitLibraryPath(native); - - /* - * The library path was set in the TclpInitLibraryPath routine. - * The string set is a dirty UTF string. To preserve the value - * convert the UTF string back to native before setting the new - * default encoding. - */ - - pathPtr = TclGetLibraryPath(); - if (pathPtr != NULL) { - Tcl_UtfToExternalDString(NULL, Tcl_GetString(pathPtr), -1, - &libPath); - } - - TclpSetInitialEncodings(); - - /* - * Now convert the native sting back to native string back to UTF. - */ - - if (pathPtr != NULL) { - Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&libPath), -1, - &buffer); - pathPtr = Tcl_NewStringObj(Tcl_DStringValue(&buffer), -1); - TclSetLibraryPath(pathPtr); - - Tcl_DStringFree(&libPath); - Tcl_DStringFree(&buffer); - } - } - TclpInitUnlock(); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Finalize -- - * - * Shut down Tcl. First calls registered exit handlers, then - * carefully shuts down various subsystems. - * Called by Tcl_Exit or when the Tcl shared library is being - * unloaded. - * - * Results: - * None. - * - * Side effects: - * Varied, see the respective finalization routines. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_Finalize() -{ - ExitHandler *exitPtr; - - TclpInitLock(); - if (subsystemsInitialized != 0) { - subsystemsInitialized = 0; - encodingsInitialized = 0; - - /* - * Invoke exit handlers first. - */ - - Tcl_MutexLock(&exitMutex); - inFinalize = 1; - for (exitPtr = firstExitPtr; exitPtr != NULL; exitPtr = firstExitPtr) { - /* - * Be careful to remove the handler from the list before - * invoking its callback. This protects us against - * double-freeing if the callback should call - * Tcl_DeleteExitHandler on itself. - */ - - firstExitPtr = exitPtr->nextPtr; - Tcl_MutexUnlock(&exitMutex); - (*exitPtr->proc)(exitPtr->clientData); - ckfree((char *) exitPtr); - Tcl_MutexLock(&exitMutex); - } - firstExitPtr = NULL; - Tcl_MutexUnlock(&exitMutex); - - /* - * Clean up after the current thread now, after exit handlers. - * In particular, the testexithandler command sets up something - * that writes to standard output, which gets closed. - * Note that there is no thread-local storage after this call. - */ - - Tcl_FinalizeThread(); - - /* - * Now finalize the Tcl execution environment. Note that this - * must be done after the exit handlers, because there are - * order dependencies. - */ - - TclFinalizeCompExecEnv(); - TclFinalizeEnvironment(); - - TclFinalizeEncodingSubsystem(); - - if (tclLibraryPath != NULL) { - Tcl_DecrRefCount(tclLibraryPath); - tclLibraryPath = NULL; - } - if (tclExecutableName != NULL) { - ckfree(tclExecutableName); - tclExecutableName = NULL; - } - if (tclNativeExecutableName != NULL) { - ckfree(tclNativeExecutableName); - tclNativeExecutableName = NULL; - } - if (tclDefaultEncodingDir != NULL) { - ckfree(tclDefaultEncodingDir); - tclDefaultEncodingDir = NULL; - } - - Tcl_SetPanicProc(NULL); - - /* - * Free synchronization objects. There really should only be one - * thread alive at this moment. - */ - - TclFinalizeSynchronization(); - - /* - * We defer unloading of packages until very late - * to avoid memory access issues. Both exit callbacks and - * synchronization variables may be stored in packages. - */ - - TclFinalizeLoad(); - - /* - * There shouldn't be any malloc'ed memory after this. - */ - - TclFinalizeMemorySubsystem(); - inFinalize = 0; - } - TclpInitUnlock(); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FinalizeThread -- - * - * Runs the exit handlers to allow Tcl to clean up its state - * about a particular thread. - * - * Results: - * None. - * - * Side effects: - * Varied, see the respective finalization routines. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_FinalizeThread() -{ - ExitHandler *exitPtr; - ThreadSpecificData *tsdPtr = - (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); - - if (tsdPtr != NULL) { - /* - * Invoke thread exit handlers first. - */ - - tsdPtr->inExit = 1; - for (exitPtr = tsdPtr->firstExitPtr; exitPtr != NULL; - exitPtr = tsdPtr->firstExitPtr) { - /* - * Be careful to remove the handler from the list before invoking - * its callback. This protects us against double-freeing if the - * callback should call Tcl_DeleteThreadExitHandler on itself. - */ - - tsdPtr->firstExitPtr = exitPtr->nextPtr; - (*exitPtr->proc)(exitPtr->clientData); - ckfree((char *) exitPtr); - } - TclFinalizeIOSubsystem(); - TclFinalizeNotifier(); - - /* - * Blow away all thread local storage blocks. - */ - - TclFinalizeThreadData(); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclInExit -- - * - * Determines if we are in the middle of exit-time cleanup. - * - * Results: - * If we are in the middle of exiting, 1, otherwise 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclInExit() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - return tsdPtr->inExit; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_VwaitObjCmd -- - * - * This procedure is invoked to process the "vwait" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_VwaitObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int done, foundEvent; - char *nameString; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "name"); - return TCL_ERROR; - } - nameString = Tcl_GetString(objv[1]); - if (Tcl_TraceVar(interp, nameString, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - VwaitVarProc, (ClientData) &done) != TCL_OK) { - return TCL_ERROR; - }; - done = 0; - foundEvent = 1; - while (!done && foundEvent) { - foundEvent = Tcl_DoOneEvent(TCL_ALL_EVENTS); - } - Tcl_UntraceVar(interp, nameString, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - VwaitVarProc, (ClientData) &done); - - /* - * Clear out the interpreter's result, since it may have been set - * by event handlers. - */ - - Tcl_ResetResult(interp); - if (!foundEvent) { - Tcl_AppendResult(interp, "can't wait for variable \"", nameString, - "\": would wait forever", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - - /* ARGSUSED */ -static char * -VwaitVarProc(clientData, interp, name1, name2, flags) - ClientData clientData; /* Pointer to integer to set to 1. */ - Tcl_Interp *interp; /* Interpreter containing variable. */ - char *name1; /* Name of variable. */ - char *name2; /* Second part of variable name. */ - int flags; /* Information about what happened. */ -{ - int *donePtr = (int *) clientData; - - *donePtr = 1; - return (char *) NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UpdateObjCmd -- - * - * This procedure is invoked to process the "update" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_UpdateObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int optionIndex; - int flags = 0; /* Initialized to avoid compiler warning. */ - static char *updateOptions[] = {"idletasks", (char *) NULL}; - enum updateOptions {REGEXP_IDLETASKS}; - - if (objc == 1) { - flags = TCL_ALL_EVENTS|TCL_DONT_WAIT; - } else if (objc == 2) { - if (Tcl_GetIndexFromObj(interp, objv[1], updateOptions, - "option", 0, &optionIndex) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum updateOptions) optionIndex) { - case REGEXP_IDLETASKS: { - flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT; - break; - } - default: { - panic("Tcl_UpdateObjCmd: bad option index to UpdateOptions"); - } - } - } else { - Tcl_WrongNumArgs(interp, 1, objv, "?idletasks?"); - return TCL_ERROR; - } - - while (Tcl_DoOneEvent(flags) != 0) { - /* Empty loop body */ - } - - /* - * Must clear the interpreter's result because event handlers could - * have executed commands. - */ - - Tcl_ResetResult(interp); - return TCL_OK; -} diff --git a/generic/tclExecute.c b/generic/tclExecute.c deleted file mode 100644 index 4378d34..0000000 --- a/generic/tclExecute.c +++ /dev/null @@ -1,5136 +0,0 @@ -/* - * tclExecute.c -- - * - * This file contains procedures that execute byte-compiled Tcl - * commands. - * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclExecute.c,v 1.6 1999/04/16 00:46:46 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclCompile.h" - -#ifdef NO_FLOAT_H -# include "../compat/float.h" -#else -# include -#endif -#ifndef TCL_NO_MATH -#include "tclMath.h" -#endif - -/* - * The stuff below is a bit of a hack so that this file can be used - * in environments that include no UNIX, i.e. no errno. Just define - * errno here. - */ - -#ifndef TCL_GENERIC_ONLY -#include "tclPort.h" -#else -#define NO_ERRNO_H -#endif - -#ifdef NO_ERRNO_H -int errno; -#define EDOM 33 -#define ERANGE 34 -#endif - -/* - * Boolean flag indicating whether the Tcl bytecode interpreter has been - * initialized. - */ - -static int execInitialized = 0; -TCL_DECLARE_MUTEX(execMutex) - -/* - * Variable that controls whether execution tracing is enabled and, if so, - * what level of tracing is desired: - * 0: no execution tracing - * 1: trace invocations of Tcl procs only - * 2: trace invocations of all (not compiled away) commands - * 3: display each instruction executed - * This variable is linked to the Tcl variable "tcl_traceExec". - */ - -int tclTraceExec = 0; - -typedef struct ThreadSpecificData { - /* - * The following global variable is use to signal matherr that Tcl - * is responsible for the arithmetic, so errors can be handled in a - * fashion appropriate for Tcl. Zero means no Tcl math is in - * progress; non-zero means Tcl is doing math. - */ - - int mathInProgress; - -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - -/* - * The variable below serves no useful purpose except to generate - * a reference to matherr, so that the Tcl version of matherr is - * linked in rather than the system version. Without this reference - * the need for matherr won't be discovered during linking until after - * libtcl.a has been processed, so Tcl's version won't be used. - */ - -#ifdef NEED_MATHERR -extern int matherr(); -int (*tclMatherrPtr)() = matherr; -#endif - -/* - * Mapping from expression instruction opcodes to strings; used for error - * messages. Note that these entries must match the order and number of the - * expression opcodes (e.g., INST_LOR) in tclCompile.h. - */ - -static char *operatorStrings[] = { - "||", "&&", "|", "^", "&", "==", "!=", "<", ">", "<=", ">=", "<<", ">>", - "+", "-", "*", "/", "%", "+", "-", "~", "!", - "BUILTIN FUNCTION", "FUNCTION" -}; - -/* - * Mapping from Tcl result codes to strings; used for error and debugging - * messages. - */ - -#ifdef TCL_COMPILE_DEBUG -static char *resultStrings[] = { - "TCL_OK", "TCL_ERROR", "TCL_RETURN", "TCL_BREAK", "TCL_CONTINUE" -}; -#endif - -/* - * Macros for testing floating-point values for certain special cases. Test - * for not-a-number by comparing a value against itself; test for infinity - * by comparing against the largest floating-point value. - */ - -#define IS_NAN(v) ((v) != (v)) -#ifdef DBL_MAX -# define IS_INF(v) (((v) > DBL_MAX) || ((v) < -DBL_MAX)) -#else -# define IS_INF(v) 0 -#endif - -/* - * Macro to adjust the program counter and restart the instruction execution - * loop after each instruction is executed. - */ - -#define ADJUST_PC(instBytes) \ - pc += (instBytes); \ - continue - -/* - * Macros used to cache often-referenced Tcl evaluation stack information - * in local variables. Note that a DECACHE_STACK_INFO()-CACHE_STACK_INFO() - * pair must surround any call inside TclExecuteByteCode (and a few other - * procedures that use this scheme) that could result in a recursive call - * to TclExecuteByteCode. - */ - -#define CACHE_STACK_INFO() \ - stackPtr = eePtr->stackPtr; \ - stackTop = eePtr->stackTop - -#define DECACHE_STACK_INFO() \ - eePtr->stackTop = stackTop - -/* - * Macros used to access items on the Tcl evaluation stack. PUSH_OBJECT - * increments the object's ref count since it makes the stack have another - * reference pointing to the object. However, POP_OBJECT does not decrement - * the ref count. This is because the stack may hold the only reference to - * the object, so the object would be destroyed if its ref count were - * decremented before the caller had a chance to, e.g., store it in a - * variable. It is the caller's responsibility to decrement the ref count - * when it is finished with an object. - * - * WARNING! It is essential that objPtr only appear once in the PUSH_OBJECT - * macro. The actual parameter might be an expression with side effects, - * and this ensures that it will be executed only once. - */ - -#define PUSH_OBJECT(objPtr) \ - Tcl_IncrRefCount(stackPtr[++stackTop] = (objPtr)) - -#define POP_OBJECT() \ - (stackPtr[stackTop--]) - -/* - * Macros used to trace instruction execution. The macros TRACE, - * TRACE_WITH_OBJ, and O2S are only used inside TclExecuteByteCode. - * O2S is only used in TRACE* calls to get a string from an object. - */ - -#ifdef TCL_COMPILE_DEBUG -#define TRACE(a) \ - if (traceInstructions) { \ - fprintf(stdout, "%2d: %2d (%u) %s ", iPtr->numLevels, stackTop, \ - (unsigned int)(pc - codePtr->codeStart), \ - GetOpcodeName(pc)); \ - printf a; \ - } -#define TRACE_WITH_OBJ(a, objPtr) \ - if (traceInstructions) { \ - fprintf(stdout, "%2d: %2d (%u) %s ", iPtr->numLevels, stackTop, \ - (unsigned int)(pc - codePtr->codeStart), \ - GetOpcodeName(pc)); \ - printf a; \ - TclPrintObject(stdout, (objPtr), 30); \ - fprintf(stdout, "\n"); \ - } -#define O2S(objPtr) \ - Tcl_GetString(objPtr) -#else -#define TRACE(a) -#define TRACE_WITH_OBJ(a, objPtr) -#define O2S(objPtr) -#endif /* TCL_COMPILE_DEBUG */ - -/* - * Declarations for local procedures to this file: - */ - -static void CallTraceProcedure _ANSI_ARGS_((Tcl_Interp *interp, - Trace *tracePtr, Command *cmdPtr, - char *command, int numChars, - int objc, Tcl_Obj *objv[])); -static void DupCmdNameInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr, - Tcl_Obj *copyPtr)); -static int ExprAbsFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); -static int ExprBinaryFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); -static int ExprCallMathFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, int objc, Tcl_Obj **objv)); -static int ExprDoubleFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); -static int ExprIntFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); -static int ExprRandFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); -static int ExprRoundFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); -static int ExprSrandFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); -static int ExprUnaryFunc _ANSI_ARGS_((Tcl_Interp *interp, - ExecEnv *eePtr, ClientData clientData)); -#ifdef TCL_COMPILE_STATS -static int EvalStatsCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -#endif -static void FreeCmdNameInternalRep _ANSI_ARGS_(( - Tcl_Obj *objPtr)); -#ifdef TCL_COMPILE_DEBUG -static char * GetOpcodeName _ANSI_ARGS_((unsigned char *pc)); -#endif -static ExceptionRange * GetExceptRangeForPc _ANSI_ARGS_((unsigned char *pc, - int catchOnly, ByteCode* codePtr)); -static char * GetSrcInfoForPc _ANSI_ARGS_((unsigned char *pc, - ByteCode* codePtr, int *lengthPtr)); -static void GrowEvaluationStack _ANSI_ARGS_((ExecEnv *eePtr)); -static void IllegalExprOperandType _ANSI_ARGS_(( - Tcl_Interp *interp, unsigned char *pc, - Tcl_Obj *opndPtr)); -static void InitByteCodeExecution _ANSI_ARGS_(( - Tcl_Interp *interp)); -#ifdef TCL_COMPILE_DEBUG -static void PrintByteCodeInfo _ANSI_ARGS_((ByteCode *codePtr)); -#endif -static int SetCmdNameFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -#ifdef TCL_COMPILE_DEBUG -static char * StringForResultCode _ANSI_ARGS_((int result)); -static void ValidatePcAndStackTop _ANSI_ARGS_(( - ByteCode *codePtr, unsigned char *pc, - int stackTop, int stackLowerBound, - int stackUpperBound)); -#endif - -/* - * Table describing the built-in math functions. Entries in this table are - * indexed by the values of the INST_CALL_BUILTIN_FUNC instruction's - * operand byte. - */ - -BuiltinFunc builtinFuncTable[] = { -#ifndef TCL_NO_MATH - {"acos", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) acos}, - {"asin", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) asin}, - {"atan", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) atan}, - {"atan2", 2, {TCL_DOUBLE, TCL_DOUBLE}, ExprBinaryFunc, (ClientData) atan2}, - {"ceil", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) ceil}, - {"cos", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) cos}, - {"cosh", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) cosh}, - {"exp", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) exp}, - {"floor", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) floor}, - {"fmod", 2, {TCL_DOUBLE, TCL_DOUBLE}, ExprBinaryFunc, (ClientData) fmod}, - {"hypot", 2, {TCL_DOUBLE, TCL_DOUBLE}, ExprBinaryFunc, (ClientData) hypot}, - {"log", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) log}, - {"log10", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) log10}, - {"pow", 2, {TCL_DOUBLE, TCL_DOUBLE}, ExprBinaryFunc, (ClientData) pow}, - {"sin", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) sin}, - {"sinh", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) sinh}, - {"sqrt", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) sqrt}, - {"tan", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) tan}, - {"tanh", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) tanh}, -#endif - {"abs", 1, {TCL_EITHER}, ExprAbsFunc, 0}, - {"double", 1, {TCL_EITHER}, ExprDoubleFunc, 0}, - {"int", 1, {TCL_EITHER}, ExprIntFunc, 0}, - {"rand", 0, {TCL_EITHER}, ExprRandFunc, 0}, /* NOTE: rand takes no args. */ - {"round", 1, {TCL_EITHER}, ExprRoundFunc, 0}, - {"srand", 1, {TCL_INT}, ExprSrandFunc, 0}, - {0}, -}; - -/* - * The structure below defines the command name Tcl object type by means of - * procedures that can be invoked by generic object code. Objects of this - * type cache the Command pointer that results from looking up command names - * in the command hashtable. Such objects appear as the zeroth ("command - * name") argument in a Tcl command. - */ - -Tcl_ObjType tclCmdNameType = { - "cmdName", /* name */ - FreeCmdNameInternalRep, /* freeIntRepProc */ - DupCmdNameInternalRep, /* dupIntRepProc */ - (Tcl_UpdateStringProc *) NULL, /* updateStringProc */ - SetCmdNameFromAny /* setFromAnyProc */ -}; - -/* - *---------------------------------------------------------------------- - * - * InitByteCodeExecution -- - * - * This procedure is called once to initialize the Tcl bytecode - * interpreter. - * - * Results: - * None. - * - * Side effects: - * This procedure initializes the array of instruction names. If - * compiling with the TCL_COMPILE_STATS flag, it initializes the - * array that counts the executions of each instruction and it - * creates the "evalstats" command. It also registers the command name - * Tcl_ObjType. It also establishes the link between the Tcl - * "tcl_traceExec" and C "tclTraceExec" variables. - * - *---------------------------------------------------------------------- - */ - -static void -InitByteCodeExecution(interp) - Tcl_Interp *interp; /* Interpreter for which the Tcl variable - * "tcl_traceExec" is linked to control - * instruction tracing. */ -{ - Tcl_RegisterObjType(&tclCmdNameType); - if (Tcl_LinkVar(interp, "tcl_traceExec", (char *) &tclTraceExec, - TCL_LINK_INT) != TCL_OK) { - panic("InitByteCodeExecution: can't create link for tcl_traceExec variable"); - } - -#ifdef TCL_COMPILE_STATS - Tcl_CreateCommand(interp, "evalstats", EvalStatsCmd, - (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); -#endif /* TCL_COMPILE_STATS */ -} - -/* - *---------------------------------------------------------------------- - * - * TclCreateExecEnv -- - * - * This procedure creates a new execution environment for Tcl bytecode - * execution. An ExecEnv points to a Tcl evaluation stack. An ExecEnv - * is typically created once for each Tcl interpreter (Interp - * structure) and recursively passed to TclExecuteByteCode to execute - * ByteCode sequences for nested commands. - * - * Results: - * A newly allocated ExecEnv is returned. This points to an empty - * evaluation stack of the standard initial size. - * - * Side effects: - * The bytecode interpreter is also initialized here, as this - * procedure will be called before any call to TclExecuteByteCode. - * - *---------------------------------------------------------------------- - */ - -#define TCL_STACK_INITIAL_SIZE 2000 - -ExecEnv * -TclCreateExecEnv(interp) - Tcl_Interp *interp; /* Interpreter for which the execution - * environment is being created. */ -{ - ExecEnv *eePtr = (ExecEnv *) ckalloc(sizeof(ExecEnv)); - - eePtr->stackPtr = (Tcl_Obj **) - ckalloc((unsigned) (TCL_STACK_INITIAL_SIZE * sizeof(Tcl_Obj *))); - eePtr->stackTop = -1; - eePtr->stackEnd = (TCL_STACK_INITIAL_SIZE - 1); - - Tcl_MutexLock(&execMutex); - if (!execInitialized) { - TclInitAuxDataTypeTable(); - InitByteCodeExecution(interp); - execInitialized = 1; - } - Tcl_MutexUnlock(&execMutex); - - return eePtr; -} -#undef TCL_STACK_INITIAL_SIZE - -/* - *---------------------------------------------------------------------- - * - * TclDeleteExecEnv -- - * - * Frees the storage for an ExecEnv. - * - * Results: - * None. - * - * Side effects: - * Storage for an ExecEnv and its contained storage (e.g. the - * evaluation stack) is freed. - * - *---------------------------------------------------------------------- - */ - -void -TclDeleteExecEnv(eePtr) - ExecEnv *eePtr; /* Execution environment to free. */ -{ - ckfree((char *) eePtr->stackPtr); - ckfree((char *) eePtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeExecution -- - * - * Finalizes the execution environment setup so that it can be - * later reinitialized. - * - * Results: - * None. - * - * Side effects: - * After this call, the next time TclCreateExecEnv will be called - * it will call InitByteCodeExecution. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeExecution() -{ - Tcl_MutexLock(&execMutex); - execInitialized = 0; - Tcl_MutexUnlock(&execMutex); - TclFinalizeAuxDataTypeTable(); -} - -/* - *---------------------------------------------------------------------- - * - * GrowEvaluationStack -- - * - * This procedure grows a Tcl evaluation stack stored in an ExecEnv. - * - * Results: - * None. - * - * Side effects: - * The size of the evaluation stack is doubled. - * - *---------------------------------------------------------------------- - */ - -static void -GrowEvaluationStack(eePtr) - register ExecEnv *eePtr; /* Points to the ExecEnv with an evaluation - * stack to enlarge. */ -{ - /* - * The current Tcl stack elements are stored from eePtr->stackPtr[0] - * to eePtr->stackPtr[eePtr->stackEnd] (inclusive). - */ - - int currElems = (eePtr->stackEnd + 1); - int newElems = 2*currElems; - int currBytes = currElems * sizeof(Tcl_Obj *); - int newBytes = 2*currBytes; - Tcl_Obj **newStackPtr = (Tcl_Obj **) ckalloc((unsigned) newBytes); - - /* - * Copy the existing stack items to the new stack space, free the old - * storage if appropriate, and mark new space as malloc'ed. - */ - - memcpy((VOID *) newStackPtr, (VOID *) eePtr->stackPtr, - (size_t) currBytes); - ckfree((char *) eePtr->stackPtr); - eePtr->stackPtr = newStackPtr; - eePtr->stackEnd = (newElems - 1); /* i.e. index of last usable item */ -} - -/* - *---------------------------------------------------------------------- - * - * TclExecuteByteCode -- - * - * This procedure executes the instructions of a ByteCode structure. - * It returns when a "done" instruction is executed or an error occurs. - * - * Results: - * The return value is one of the return codes defined in tcl.h - * (such as TCL_OK), and interp->objResultPtr refers to a Tcl object - * that either contains the result of executing the code or an - * error message. - * - * Side effects: - * Almost certainly, depending on the ByteCode's instructions. - * - *---------------------------------------------------------------------- - */ - -int -TclExecuteByteCode(interp, codePtr) - Tcl_Interp *interp; /* Token for command interpreter. */ - ByteCode *codePtr; /* The bytecode sequence to interpret. */ -{ - Interp *iPtr = (Interp *) interp; - ExecEnv *eePtr = iPtr->execEnvPtr; - /* Points to the execution environment. */ - register Tcl_Obj **stackPtr = eePtr->stackPtr; - /* Cached evaluation stack base pointer. */ - register int stackTop = eePtr->stackTop; - /* Cached top index of evaluation stack. */ - register unsigned char *pc = codePtr->codeStart; - /* The current program counter. */ - int opnd; /* Current instruction's operand byte. */ - int pcAdjustment; /* Hold pc adjustment after instruction. */ - int initStackTop = stackTop;/* Stack top at start of execution. */ - ExceptionRange *rangePtr; /* Points to closest loop or catch exception - * range enclosing the pc. Used by various - * instructions and processCatch to - * process break, continue, and errors. */ - int result = TCL_OK; /* Return code returned after execution. */ - int traceInstructions = (tclTraceExec == 3); - Tcl_Obj *valuePtr, *value2Ptr, *objPtr; - char *bytes; - int length; - long i; - - /* - * This procedure uses a stack to hold information about catch commands. - * This information is the current operand stack top when starting to - * execute the code for each catch command. It starts out with stack- - * allocated space but uses dynamically-allocated storage if needed. - */ - -#define STATIC_CATCH_STACK_SIZE 4 - int (catchStackStorage[STATIC_CATCH_STACK_SIZE]); - int *catchStackPtr = catchStackStorage; - int catchTop = -1; - -#ifdef TCL_COMPILE_DEBUG - if (tclTraceExec >= 2) { - PrintByteCodeInfo(codePtr); - fprintf(stdout, " Starting stack top=%d\n", eePtr->stackTop); - fflush(stdout); - } -#endif - -#ifdef TCL_COMPILE_STATS - iPtr->stats.numExecutions++; -#endif - - /* - * Make sure the catch stack is large enough to hold the maximum number - * of catch commands that could ever be executing at the same time. This - * will be no more than the exception range array's depth. - */ - - if (codePtr->maxExceptDepth > STATIC_CATCH_STACK_SIZE) { - catchStackPtr = (int *) - ckalloc(codePtr->maxExceptDepth * sizeof(int)); - } - - /* - * Make sure the stack has enough room to execute this ByteCode. - */ - - while ((stackTop + codePtr->maxStackDepth) > eePtr->stackEnd) { - GrowEvaluationStack(eePtr); - stackPtr = eePtr->stackPtr; - } - - /* - * Loop executing instructions until a "done" instruction, a TCL_RETURN, - * or some error. - */ - - for (;;) { -#ifdef TCL_COMPILE_DEBUG - ValidatePcAndStackTop(codePtr, pc, stackTop, initStackTop, - eePtr->stackEnd); -#else /* not TCL_COMPILE_DEBUG */ - if (traceInstructions) { - fprintf(stdout, "%2d: %2d ", iPtr->numLevels, stackTop); - TclPrintInstruction(codePtr, pc); - fflush(stdout); - } -#endif /* TCL_COMPILE_DEBUG */ - -#ifdef TCL_COMPILE_STATS - iPtr->stats.instructionCount[*pc]++; -#endif - switch (*pc) { - case INST_DONE: - /* - * Pop the topmost object from the stack, set the interpreter's - * object result to point to it, and return. - */ - valuePtr = POP_OBJECT(); - Tcl_SetObjResult(interp, valuePtr); - TclDecrRefCount(valuePtr); - if (stackTop != initStackTop) { - fprintf(stderr, "\nTclExecuteByteCode: done instruction at pc %u: stack top %d != entry stack top %d\n", - (unsigned int)(pc - codePtr->codeStart), - (unsigned int) stackTop, - (unsigned int) initStackTop); - panic("TclExecuteByteCode execution failure: end stack top != start stack top"); - } - TRACE_WITH_OBJ(("=> return code=%d, result=", result), - iPtr->objResultPtr); -#ifdef TCL_COMPILE_DEBUG - if (traceInstructions) { - fprintf(stdout, "\n"); - } -#endif - goto done; - - case INST_PUSH1: -#ifdef TCL_COMPILE_DEBUG - valuePtr = codePtr->objArrayPtr[TclGetUInt1AtPtr(pc+1)]; - PUSH_OBJECT(valuePtr); - TRACE_WITH_OBJ(("%u => ", TclGetInt1AtPtr(pc+1)), valuePtr); -#else - PUSH_OBJECT(codePtr->objArrayPtr[TclGetUInt1AtPtr(pc+1)]); -#endif /* TCL_COMPILE_DEBUG */ - ADJUST_PC(2); - - case INST_PUSH4: - valuePtr = codePtr->objArrayPtr[TclGetUInt4AtPtr(pc+1)]; - PUSH_OBJECT(valuePtr); - TRACE_WITH_OBJ(("%u => ", TclGetUInt4AtPtr(pc+1)), valuePtr); - ADJUST_PC(5); - - case INST_POP: - valuePtr = POP_OBJECT(); - TRACE_WITH_OBJ(("=> discarding "), valuePtr); - TclDecrRefCount(valuePtr); /* finished with pop'ed object. */ - ADJUST_PC(1); - - case INST_DUP: - valuePtr = stackPtr[stackTop]; - PUSH_OBJECT(Tcl_DuplicateObj(valuePtr)); - TRACE_WITH_OBJ(("=> "), valuePtr); - ADJUST_PC(1); - - case INST_CONCAT1: - opnd = TclGetUInt1AtPtr(pc+1); - { - Tcl_Obj *concatObjPtr; - int totalLen = 0; - - /* - * Concatenate strings (with no separators) from the top - * opnd items on the stack starting with the deepest item. - * First, determine how many characters are needed. - */ - - for (i = (stackTop - (opnd-1)); i <= stackTop; i++) { - bytes = Tcl_GetStringFromObj(stackPtr[i], &length); - if (bytes != NULL) { - totalLen += length; - } - } - - /* - * Initialize the new append string object by appending the - * strings of the opnd stack objects. Also pop the objects. - */ - - TclNewObj(concatObjPtr); - if (totalLen > 0) { - char *p = (char *) ckalloc((unsigned) (totalLen + 1)); - concatObjPtr->bytes = p; - concatObjPtr->length = totalLen; - for (i = (stackTop - (opnd-1)); i <= stackTop; i++) { - valuePtr = stackPtr[i]; - bytes = Tcl_GetStringFromObj(valuePtr, &length); - if (bytes != NULL) { - memcpy((VOID *) p, (VOID *) bytes, - (size_t) length); - p += length; - } - TclDecrRefCount(valuePtr); - } - *p = '\0'; - } else { - for (i = (stackTop - (opnd-1)); i <= stackTop; i++) { - Tcl_DecrRefCount(stackPtr[i]); - } - } - stackTop -= opnd; - - PUSH_OBJECT(concatObjPtr); - TRACE_WITH_OBJ(("%u => ", opnd), concatObjPtr); - ADJUST_PC(2); - } - - case INST_INVOKE_STK4: - opnd = TclGetUInt4AtPtr(pc+1); - pcAdjustment = 5; - goto doInvocation; - - case INST_INVOKE_STK1: - opnd = TclGetUInt1AtPtr(pc+1); - pcAdjustment = 2; - - doInvocation: - { - int objc = opnd; /* The number of arguments. */ - Tcl_Obj **objv; /* The array of argument objects. */ - Command *cmdPtr; /* Points to command's Command struct. */ - int newPcOffset; /* New inst offset for break, continue. */ -#ifdef TCL_COMPILE_DEBUG - int isUnknownCmd = 0; - char cmdNameBuf[21]; -#endif /* TCL_COMPILE_DEBUG */ - - /* - * If the interpreter was deleted, return an error. - */ - - if (iPtr->flags & DELETED) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "attempt to call eval in deleted interpreter", -1); - Tcl_SetErrorCode(interp, "CORE", "IDELETE", - "attempt to call eval in deleted interpreter", - (char *) NULL); - result = TCL_ERROR; - goto checkForCatch; - } - - /* - * Find the procedure to execute this command. If the - * command is not found, handle it with the "unknown" proc. - */ - - objv = &(stackPtr[stackTop - (objc-1)]); - cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objv[0]); - if (cmdPtr == NULL) { - cmdPtr = (Command *) Tcl_FindCommand(interp, "unknown", - (Tcl_Namespace *) NULL, TCL_GLOBAL_ONLY); - if (cmdPtr == NULL) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "invalid command name \"", - Tcl_GetString(objv[0]), "\"", - (char *) NULL); - TRACE(("%u => unknown proc not found: ", objc)); - result = TCL_ERROR; - goto checkForCatch; - } -#ifdef TCL_COMPILE_DEBUG - isUnknownCmd = 1; -#endif /*TCL_COMPILE_DEBUG*/ - stackTop++; /* need room for new inserted objv[0] */ - for (i = objc-1; i >= 0; i--) { - objv[i+1] = objv[i]; - } - objc++; - objv[0] = Tcl_NewStringObj("unknown", -1); - Tcl_IncrRefCount(objv[0]); - } - - /* - * Call any trace procedures. - */ - - if (iPtr->tracePtr != NULL) { - Trace *tracePtr, *nextTracePtr; - - for (tracePtr = iPtr->tracePtr; tracePtr != NULL; - tracePtr = nextTracePtr) { - nextTracePtr = tracePtr->nextPtr; - if (iPtr->numLevels <= tracePtr->level) { - int numChars; - char *cmd = GetSrcInfoForPc(pc, codePtr, - &numChars); - if (cmd != NULL) { - DECACHE_STACK_INFO(); - CallTraceProcedure(interp, tracePtr, cmdPtr, - cmd, numChars, objc, objv); - CACHE_STACK_INFO(); - } - } - } - } - - /* - * Finally, invoke the command's Tcl_ObjCmdProc. First reset - * the interpreter's string and object results to their - * default empty values since they could have gotten changed - * by earlier invocations. - */ - - Tcl_ResetResult(interp); - if (tclTraceExec >= 2) { -#ifdef TCL_COMPILE_DEBUG - if (traceInstructions) { - strncpy(cmdNameBuf, Tcl_GetString(objv[0]), 20); - TRACE(("%u => call ", (isUnknownCmd? objc-1:objc))); - } else { - fprintf(stdout, "%d: (%u) invoking ", - iPtr->numLevels, - (unsigned int)(pc - codePtr->codeStart)); - } - for (i = 0; i < objc; i++) { - TclPrintObject(stdout, objv[i], 15); - fprintf(stdout, " "); - } - fprintf(stdout, "\n"); - fflush(stdout); -#else /* TCL_COMPILE_DEBUG */ - fprintf(stdout, "%d: (%u) invoking %s\n", - iPtr->numLevels, - (unsigned int)(pc - codePtr->codeStart), - Tcl_GetString(objv[0])); -#endif /*TCL_COMPILE_DEBUG*/ - } - - iPtr->cmdCount++; - DECACHE_STACK_INFO(); - result = (*cmdPtr->objProc)(cmdPtr->objClientData, interp, - objc, objv); - if (Tcl_AsyncReady()) { - result = Tcl_AsyncInvoke(interp, result); - } - CACHE_STACK_INFO(); - - /* - * If the interpreter has a non-empty string result, the - * result object is either empty or stale because some - * procedure set interp->result directly. If so, move the - * string result to the result object, then reset the - * string result. - */ - - if (*(iPtr->result) != 0) { - (void) Tcl_GetObjResult(interp); - } - - /* - * Pop the objc top stack elements and decrement their ref - * counts. - */ - - for (i = 0; i < objc; i++) { - valuePtr = stackPtr[stackTop]; - TclDecrRefCount(valuePtr); - stackTop--; - } - - /* - * Process the result of the Tcl_ObjCmdProc call. - */ - - switch (result) { - case TCL_OK: - /* - * Push the call's object result and continue execution - * with the next instruction. - */ - PUSH_OBJECT(Tcl_GetObjResult(interp)); - TRACE_WITH_OBJ(("%u => ...after \"%.20s\", result=", - objc, cmdNameBuf), Tcl_GetObjResult(interp)); - ADJUST_PC(pcAdjustment); - - case TCL_BREAK: - case TCL_CONTINUE: - /* - * The invoked command requested a break or continue. - * Find the closest enclosing loop or catch exception - * range, if any. If a loop is found, terminate its - * execution or skip to its next iteration. If the - * closest is a catch exception range, jump to its - * catchOffset. If no enclosing range is found, stop - * execution and return the TCL_BREAK or TCL_CONTINUE. - */ - rangePtr = GetExceptRangeForPc(pc, /*catchOnly*/ 0, - codePtr); - if (rangePtr == NULL) { - TRACE(("%u => ... after \"%.20s\", no encl. loop or catch, returning %s\n", - objc, cmdNameBuf, - StringForResultCode(result))); - goto abnormalReturn; /* no catch exists to check */ - } - newPcOffset = 0; - switch (rangePtr->type) { - case LOOP_EXCEPTION_RANGE: - if (result == TCL_BREAK) { - newPcOffset = rangePtr->breakOffset; - } else if (rangePtr->continueOffset == -1) { - TRACE(("%u => ... after \"%.20s\", %s, loop w/o continue, checking for catch\n", - objc, cmdNameBuf, - StringForResultCode(result))); - goto checkForCatch; - } else { - newPcOffset = rangePtr->continueOffset; - } - TRACE(("%u => ... after \"%.20s\", %s, range at %d, new pc %d\n", - objc, cmdNameBuf, - StringForResultCode(result), - rangePtr->codeOffset, newPcOffset)); - break; - case CATCH_EXCEPTION_RANGE: - TRACE(("%u => ... after \"%.20s\", %s...\n", - objc, cmdNameBuf, - StringForResultCode(result))); - goto processCatch; /* it will use rangePtr */ - default: - panic("TclExecuteByteCode: bad ExceptionRange type\n"); - } - result = TCL_OK; - pc = (codePtr->codeStart + newPcOffset); - continue; /* restart outer instruction loop at pc */ - - case TCL_ERROR: - /* - * The invoked command returned an error. Look for an - * enclosing catch exception range, if any. - */ - TRACE_WITH_OBJ(("%u => ... after \"%.20s\", TCL_ERROR ", - objc, cmdNameBuf), Tcl_GetObjResult(interp)); - goto checkForCatch; - - case TCL_RETURN: - /* - * The invoked command requested that the current - * procedure stop execution and return. First check - * for an enclosing catch exception range, if any. - */ - TRACE(("%u => ... after \"%.20s\", TCL_RETURN\n", - objc, cmdNameBuf)); - goto checkForCatch; - - default: - TRACE_WITH_OBJ(("%u => ... after \"%.20s\", OTHER RETURN CODE %d ", - objc, cmdNameBuf, result), - Tcl_GetObjResult(interp)); - goto checkForCatch; - } - } - - case INST_EVAL_STK: - objPtr = POP_OBJECT(); - DECACHE_STACK_INFO(); - result = Tcl_EvalObjEx(interp, objPtr, 0); - CACHE_STACK_INFO(); - if (result == TCL_OK) { - /* - * Normal return; push the eval's object result. - */ - PUSH_OBJECT(Tcl_GetObjResult(interp)); - TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(objPtr)), - Tcl_GetObjResult(interp)); - TclDecrRefCount(objPtr); - ADJUST_PC(1); - } else if ((result == TCL_BREAK) || (result == TCL_CONTINUE)) { - /* - * Find the closest enclosing loop or catch exception range, - * if any. If a loop is found, terminate its execution or - * skip to its next iteration. If the closest is a catch - * exception range, jump to its catchOffset. If no enclosing - * range is found, stop execution and return that same - * TCL_BREAK or TCL_CONTINUE. - */ - - int newPcOffset = 0; /* Pc offset computed during break, - * continue, error processing. Init. - * to avoid compiler warning. */ - - rangePtr = GetExceptRangeForPc(pc, /*catchOnly*/ 0, - codePtr); - if (rangePtr == NULL) { - TRACE(("\"%.30s\" => no encl. loop or catch, returning %s\n", - O2S(objPtr), StringForResultCode(result))); - Tcl_DecrRefCount(objPtr); - goto abnormalReturn; /* no catch exists to check */ - } - switch (rangePtr->type) { - case LOOP_EXCEPTION_RANGE: - if (result == TCL_BREAK) { - newPcOffset = rangePtr->breakOffset; - } else if (rangePtr->continueOffset == -1) { - TRACE(("\"%.30s\" => %s, loop w/o continue, checking for catch\n", - O2S(objPtr), StringForResultCode(result))); - Tcl_DecrRefCount(objPtr); - goto checkForCatch; - } else { - newPcOffset = rangePtr->continueOffset; - } - result = TCL_OK; - TRACE_WITH_OBJ(("\"%.30s\" => %s, range at %d, new pc %d ", - O2S(objPtr), StringForResultCode(result), - rangePtr->codeOffset, newPcOffset), valuePtr); - break; - case CATCH_EXCEPTION_RANGE: - TRACE_WITH_OBJ(("\"%.30s\" => %s ", - O2S(objPtr), StringForResultCode(result)), - valuePtr); - Tcl_DecrRefCount(objPtr); - goto processCatch; /* it will use rangePtr */ - default: - panic("TclExecuteByteCode: unrecognized ExceptionRange type %d\n", rangePtr->type); - } - Tcl_DecrRefCount(objPtr); - pc = (codePtr->codeStart + newPcOffset); - continue; /* restart outer instruction loop at pc */ - } else { /* eval returned TCL_ERROR, TCL_RETURN, unknown code */ - TRACE_WITH_OBJ(("\"%.30s\" => ERROR: ", O2S(objPtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - goto checkForCatch; - } - - case INST_EXPR_STK: - objPtr = POP_OBJECT(); - Tcl_ResetResult(interp); - DECACHE_STACK_INFO(); - result = Tcl_ExprObj(interp, objPtr, &valuePtr); - CACHE_STACK_INFO(); - if (result != TCL_OK) { - TRACE_WITH_OBJ(("\"%.30s\" => ERROR: ", - O2S(objPtr)), Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - goto checkForCatch; - } - stackPtr[++stackTop] = valuePtr; /* already has right refct */ - TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(objPtr)), valuePtr); - TclDecrRefCount(objPtr); - ADJUST_PC(1); - - case INST_LOAD_SCALAR1: -#ifdef TCL_COMPILE_DEBUG - opnd = TclGetInt1AtPtr(pc+1); - DECACHE_STACK_INFO(); - valuePtr = TclGetIndexedScalar(interp, opnd, - /*leaveErrorMsg*/ 1); - CACHE_STACK_INFO(); - if (valuePtr == NULL) { - TRACE_WITH_OBJ(("%u => ERROR: ", opnd), - Tcl_GetObjResult(interp)); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(valuePtr); - TRACE_WITH_OBJ(("%u => ", opnd), valuePtr); -#else /* TCL_COMPILE_DEBUG */ - DECACHE_STACK_INFO(); - valuePtr = TclGetIndexedScalar(interp, TclGetInt1AtPtr(pc+1), - /*leaveErrorMsg*/ 1); - CACHE_STACK_INFO(); - if (valuePtr == NULL) { - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(valuePtr); -#endif /* TCL_COMPILE_DEBUG */ - ADJUST_PC(2); - - case INST_LOAD_SCALAR4: - opnd = TclGetUInt4AtPtr(pc+1); - DECACHE_STACK_INFO(); - valuePtr = TclGetIndexedScalar(interp, opnd, - /*leaveErrorMsg*/ 1); - CACHE_STACK_INFO(); - if (valuePtr == NULL) { - TRACE_WITH_OBJ(("%u => ERROR: ", opnd), - Tcl_GetObjResult(interp)); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(valuePtr); - TRACE_WITH_OBJ(("%u => ", opnd), valuePtr); - ADJUST_PC(5); - - case INST_LOAD_SCALAR_STK: - objPtr = POP_OBJECT(); /* scalar name */ - DECACHE_STACK_INFO(); - valuePtr = Tcl_ObjGetVar2(interp, objPtr, NULL, TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (valuePtr == NULL) { - TRACE_WITH_OBJ(("\"%.30s\" => ERROR: ", O2S(objPtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(valuePtr); - TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(objPtr)), valuePtr); - TclDecrRefCount(objPtr); - ADJUST_PC(1); - - case INST_LOAD_ARRAY4: - opnd = TclGetUInt4AtPtr(pc+1); - pcAdjustment = 5; - goto doLoadArray; - - case INST_LOAD_ARRAY1: - opnd = TclGetUInt1AtPtr(pc+1); - pcAdjustment = 2; - - doLoadArray: - { - Tcl_Obj *elemPtr = POP_OBJECT(); - - DECACHE_STACK_INFO(); - valuePtr = TclGetElementOfIndexedArray(interp, opnd, - elemPtr, /*leaveErrorMsg*/ 1); - CACHE_STACK_INFO(); - if (valuePtr == NULL) { - TRACE_WITH_OBJ(("%u \"%.30s\" => ERROR: ", - opnd, O2S(elemPtr)), Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(elemPtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(valuePtr); - TRACE_WITH_OBJ(("%u \"%.30s\" => ", - opnd, O2S(elemPtr)),valuePtr); - TclDecrRefCount(elemPtr); - } - ADJUST_PC(pcAdjustment); - - case INST_LOAD_ARRAY_STK: - { - Tcl_Obj *elemPtr = POP_OBJECT(); - - objPtr = POP_OBJECT(); /* array name */ - DECACHE_STACK_INFO(); - valuePtr = Tcl_ObjGetVar2(interp, objPtr, elemPtr, - TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (valuePtr == NULL) { - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" => ERROR: ", - O2S(objPtr), O2S(elemPtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(elemPtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(valuePtr); - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" => ", - O2S(objPtr), O2S(elemPtr)), valuePtr); - TclDecrRefCount(objPtr); - TclDecrRefCount(elemPtr); - } - ADJUST_PC(1); - - case INST_LOAD_STK: - objPtr = POP_OBJECT(); /* variable name */ - DECACHE_STACK_INFO(); - valuePtr = Tcl_ObjGetVar2(interp, objPtr, NULL, TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (valuePtr == NULL) { - TRACE_WITH_OBJ(("\"%.30s\" => ERROR: ", - O2S(objPtr)), Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(valuePtr); - TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(objPtr)), valuePtr); - TclDecrRefCount(objPtr); - ADJUST_PC(1); - - case INST_STORE_SCALAR4: - opnd = TclGetUInt4AtPtr(pc+1); - pcAdjustment = 5; - goto doStoreScalar; - - case INST_STORE_SCALAR1: - opnd = TclGetUInt1AtPtr(pc+1); - pcAdjustment = 2; - - doStoreScalar: - valuePtr = POP_OBJECT(); - DECACHE_STACK_INFO(); - value2Ptr = TclSetIndexedScalar(interp, opnd, valuePtr, - /*leaveErrorMsg*/ 1); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("%u <- \"%.30s\" => ERROR: ", - opnd, O2S(valuePtr)), Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("%u <- \"%.30s\" => ", - opnd, O2S(valuePtr)), value2Ptr); - TclDecrRefCount(valuePtr); - ADJUST_PC(pcAdjustment); - - case INST_STORE_SCALAR_STK: - valuePtr = POP_OBJECT(); - objPtr = POP_OBJECT(); /* scalar name */ - DECACHE_STACK_INFO(); - value2Ptr = Tcl_ObjSetVar2(interp, objPtr, NULL, valuePtr, - TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("\"%.30s\" <- \"%.30s\" => ERROR: ", - O2S(objPtr), O2S(valuePtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("\"%.30s\" <- \"%.30s\" => ", - O2S(objPtr), O2S(valuePtr)), value2Ptr); - TclDecrRefCount(objPtr); - TclDecrRefCount(valuePtr); - ADJUST_PC(1); - - case INST_STORE_ARRAY4: - opnd = TclGetUInt4AtPtr(pc+1); - pcAdjustment = 5; - goto doStoreArray; - - case INST_STORE_ARRAY1: - opnd = TclGetUInt1AtPtr(pc+1); - pcAdjustment = 2; - - doStoreArray: - { - Tcl_Obj *elemPtr; - - valuePtr = POP_OBJECT(); - elemPtr = POP_OBJECT(); - DECACHE_STACK_INFO(); - value2Ptr = TclSetElementOfIndexedArray(interp, opnd, - elemPtr, valuePtr, TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("%u \"%.30s\" <- \"%.30s\" => ERROR: ", - opnd, O2S(elemPtr), O2S(valuePtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(elemPtr); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("%u \"%.30s\" <- \"%.30s\" => ", - opnd, O2S(elemPtr), O2S(valuePtr)), value2Ptr); - TclDecrRefCount(elemPtr); - TclDecrRefCount(valuePtr); - } - ADJUST_PC(pcAdjustment); - - case INST_STORE_ARRAY_STK: - { - Tcl_Obj *elemPtr; - - valuePtr = POP_OBJECT(); - elemPtr = POP_OBJECT(); - objPtr = POP_OBJECT(); /* array name */ - DECACHE_STACK_INFO(); - value2Ptr = Tcl_ObjSetVar2(interp, objPtr, elemPtr, valuePtr, - TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" <- \"%.30s\" => ERROR: ", - O2S(objPtr), O2S(elemPtr), O2S(valuePtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(elemPtr); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" <- \"%.30s\" => ", - O2S(objPtr), O2S(elemPtr), O2S(valuePtr)), - value2Ptr); - TclDecrRefCount(objPtr); - TclDecrRefCount(elemPtr); - TclDecrRefCount(valuePtr); - } - ADJUST_PC(1); - - case INST_STORE_STK: - valuePtr = POP_OBJECT(); - objPtr = POP_OBJECT(); /* variable name */ - DECACHE_STACK_INFO(); - value2Ptr = Tcl_ObjSetVar2(interp, objPtr, NULL, valuePtr, - TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("\"%.30s\" <- \"%.30s\" => ERROR: ", - O2S(objPtr), O2S(valuePtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("\"%.30s\" <- \"%.30s\" => ", - O2S(objPtr), O2S(valuePtr)), value2Ptr); - TclDecrRefCount(objPtr); - TclDecrRefCount(valuePtr); - ADJUST_PC(1); - - case INST_INCR_SCALAR1: - opnd = TclGetUInt1AtPtr(pc+1); - valuePtr = POP_OBJECT(); - if (valuePtr->typePtr != &tclIntType) { - result = tclIntType.setFromAnyProc(interp, valuePtr); - if (result != TCL_OK) { - TRACE_WITH_OBJ(("%u (by %s) => ERROR converting increment amount to int: ", - opnd, O2S(valuePtr)), Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(valuePtr); - goto checkForCatch; - } - } - i = valuePtr->internalRep.longValue; - DECACHE_STACK_INFO(); - value2Ptr = TclIncrIndexedScalar(interp, opnd, i); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("%u (by %ld) => ERROR: ", opnd, i), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("%u (by %ld) => ", opnd, i), value2Ptr); - TclDecrRefCount(valuePtr); - ADJUST_PC(2); - - case INST_INCR_SCALAR_STK: - case INST_INCR_STK: - valuePtr = POP_OBJECT(); - objPtr = POP_OBJECT(); /* scalar name */ - if (valuePtr->typePtr != &tclIntType) { - result = tclIntType.setFromAnyProc(interp, valuePtr); - if (result != TCL_OK) { - TRACE_WITH_OBJ(("\"%.30s\" (by %s) => ERROR converting increment amount to int: ", - O2S(objPtr), O2S(valuePtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(valuePtr); - goto checkForCatch; - } - } - i = valuePtr->internalRep.longValue; - DECACHE_STACK_INFO(); - value2Ptr = TclIncrVar2(interp, objPtr, (Tcl_Obj *) NULL, i, - TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("\"%.30s\" (by %ld) => ERROR: ", - O2S(objPtr), i), Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("\"%.30s\" (by %ld) => ", O2S(objPtr), i), - value2Ptr); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(valuePtr); - ADJUST_PC(1); - - case INST_INCR_ARRAY1: - { - Tcl_Obj *elemPtr; - - opnd = TclGetUInt1AtPtr(pc+1); - valuePtr = POP_OBJECT(); - elemPtr = POP_OBJECT(); - if (valuePtr->typePtr != &tclIntType) { - result = tclIntType.setFromAnyProc(interp, valuePtr); - if (result != TCL_OK) { - TRACE_WITH_OBJ(("%u \"%.30s\" (by %s) => ERROR converting increment amount to int: ", - opnd, O2S(elemPtr), O2S(valuePtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(elemPtr); - Tcl_DecrRefCount(valuePtr); - goto checkForCatch; - } - } - i = valuePtr->internalRep.longValue; - DECACHE_STACK_INFO(); - value2Ptr = TclIncrElementOfIndexedArray(interp, opnd, - elemPtr, i); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("%u \"%.30s\" (by %ld) => ERROR: ", - opnd, O2S(elemPtr), i), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(elemPtr); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("%u \"%.30s\" (by %ld) => ", - opnd, O2S(elemPtr), i), value2Ptr); - Tcl_DecrRefCount(elemPtr); - Tcl_DecrRefCount(valuePtr); - } - ADJUST_PC(2); - - case INST_INCR_ARRAY_STK: - { - Tcl_Obj *elemPtr; - - valuePtr = POP_OBJECT(); - elemPtr = POP_OBJECT(); - objPtr = POP_OBJECT(); /* array name */ - if (valuePtr->typePtr != &tclIntType) { - result = tclIntType.setFromAnyProc(interp, valuePtr); - if (result != TCL_OK) { - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" (by %s) => ERROR converting increment amount to int: ", - O2S(objPtr), O2S(elemPtr), O2S(valuePtr)), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(elemPtr); - Tcl_DecrRefCount(valuePtr); - goto checkForCatch; - } - } - i = valuePtr->internalRep.longValue; - DECACHE_STACK_INFO(); - value2Ptr = TclIncrVar2(interp, objPtr, elemPtr, i, - TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" (by %ld) => ERROR: ", - O2S(objPtr), O2S(elemPtr), i), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(elemPtr); - Tcl_DecrRefCount(valuePtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" (by %ld) => ", - O2S(objPtr), O2S(elemPtr), i), value2Ptr); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(elemPtr); - Tcl_DecrRefCount(valuePtr); - } - ADJUST_PC(1); - - case INST_INCR_SCALAR1_IMM: - opnd = TclGetUInt1AtPtr(pc+1); - i = TclGetInt1AtPtr(pc+2); - DECACHE_STACK_INFO(); - value2Ptr = TclIncrIndexedScalar(interp, opnd, i); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("%u %ld => ERROR: ", opnd, i), - Tcl_GetObjResult(interp)); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("%u %ld => ", opnd, i), value2Ptr); - ADJUST_PC(3); - - case INST_INCR_SCALAR_STK_IMM: - case INST_INCR_STK_IMM: - objPtr = POP_OBJECT(); /* variable name */ - i = TclGetInt1AtPtr(pc+1); - DECACHE_STACK_INFO(); - value2Ptr = TclIncrVar2(interp, objPtr, (Tcl_Obj *) NULL, i, - TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("\"%.30s\" %ld => ERROR: ", - O2S(objPtr), i), Tcl_GetObjResult(interp)); - result = TCL_ERROR; - Tcl_DecrRefCount(objPtr); - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("\"%.30s\" %ld => ", O2S(objPtr), i), - value2Ptr); - TclDecrRefCount(objPtr); - ADJUST_PC(2); - - case INST_INCR_ARRAY1_IMM: - { - Tcl_Obj *elemPtr; - - opnd = TclGetUInt1AtPtr(pc+1); - i = TclGetInt1AtPtr(pc+2); - elemPtr = POP_OBJECT(); - DECACHE_STACK_INFO(); - value2Ptr = TclIncrElementOfIndexedArray(interp, opnd, - elemPtr, i); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("%u \"%.30s\" (by %ld) => ERROR: ", - opnd, O2S(elemPtr), i), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(elemPtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("%u \"%.30s\" (by %ld) => ", - opnd, O2S(elemPtr), i), value2Ptr); - Tcl_DecrRefCount(elemPtr); - } - ADJUST_PC(3); - - case INST_INCR_ARRAY_STK_IMM: - { - Tcl_Obj *elemPtr; - - i = TclGetInt1AtPtr(pc+1); - elemPtr = POP_OBJECT(); - objPtr = POP_OBJECT(); /* array name */ - DECACHE_STACK_INFO(); - value2Ptr = TclIncrVar2(interp, objPtr, elemPtr, i, - TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" (by %ld) => ERROR: ", - O2S(objPtr), O2S(elemPtr), i), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(elemPtr); - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(value2Ptr); - TRACE_WITH_OBJ(("\"%.30s(%.30s)\" (by %ld) => ", - O2S(objPtr), O2S(elemPtr), i), value2Ptr); - Tcl_DecrRefCount(objPtr); - Tcl_DecrRefCount(elemPtr); - } - ADJUST_PC(2); - - case INST_JUMP1: -#ifdef TCL_COMPILE_DEBUG - opnd = TclGetInt1AtPtr(pc+1); - TRACE(("%d => new pc %u\n", opnd, - (unsigned int)(pc + opnd - codePtr->codeStart))); - pc += opnd; -#else - pc += TclGetInt1AtPtr(pc+1); -#endif /* TCL_COMPILE_DEBUG */ - continue; - - case INST_JUMP4: - opnd = TclGetInt4AtPtr(pc+1); - TRACE(("%d => new pc %u\n", opnd, - (unsigned int)(pc + opnd - codePtr->codeStart))); - ADJUST_PC(opnd); - - case INST_JUMP_TRUE4: - opnd = TclGetInt4AtPtr(pc+1); - pcAdjustment = 5; - goto doJumpTrue; - - case INST_JUMP_TRUE1: - opnd = TclGetInt1AtPtr(pc+1); - pcAdjustment = 2; - - doJumpTrue: - { - int b; - - valuePtr = POP_OBJECT(); - if (valuePtr->typePtr == &tclIntType) { - b = (valuePtr->internalRep.longValue != 0); - } else if (valuePtr->typePtr == &tclDoubleType) { - b = (valuePtr->internalRep.doubleValue != 0.0); - } else { - result = Tcl_GetBooleanFromObj(interp, valuePtr, &b); - if (result != TCL_OK) { - TRACE_WITH_OBJ(("%d => ERROR: ", opnd), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(valuePtr); - goto checkForCatch; - } - } - if (b) { - TRACE(("%d => %.20s true, new pc %u\n", - opnd, O2S(valuePtr), - (unsigned int)(pc+opnd - codePtr->codeStart))); - TclDecrRefCount(valuePtr); - ADJUST_PC(opnd); - } else { - TRACE(("%d => %.20s false\n", opnd, O2S(valuePtr))); - TclDecrRefCount(valuePtr); - ADJUST_PC(pcAdjustment); - } - } - - case INST_JUMP_FALSE4: - opnd = TclGetInt4AtPtr(pc+1); - pcAdjustment = 5; - goto doJumpFalse; - - case INST_JUMP_FALSE1: - opnd = TclGetInt1AtPtr(pc+1); - pcAdjustment = 2; - - doJumpFalse: - { - int b; - - valuePtr = POP_OBJECT(); - if (valuePtr->typePtr == &tclIntType) { - b = (valuePtr->internalRep.longValue != 0); - } else if (valuePtr->typePtr == &tclDoubleType) { - b = (valuePtr->internalRep.doubleValue != 0.0); - } else { - result = Tcl_GetBooleanFromObj(interp, valuePtr, &b); - if (result != TCL_OK) { - TRACE_WITH_OBJ(("%d => ERROR: ", opnd), - Tcl_GetObjResult(interp)); - Tcl_DecrRefCount(valuePtr); - goto checkForCatch; - } - } - if (b) { - TRACE(("%d => %.20s true\n", opnd, O2S(valuePtr))); - TclDecrRefCount(valuePtr); - ADJUST_PC(pcAdjustment); - } else { - TRACE(("%d => %.20s false, new pc %u\n", - opnd, O2S(valuePtr), - (unsigned int)(pc + opnd - codePtr->codeStart))); - TclDecrRefCount(valuePtr); - ADJUST_PC(opnd); - } - } - - case INST_LOR: - case INST_LAND: - { - /* - * Operands must be boolean or numeric. No int->double - * conversions are performed. - */ - - int i1, i2; - int iResult; - char *s; - Tcl_ObjType *t1Ptr, *t2Ptr; - - value2Ptr = POP_OBJECT(); - valuePtr = POP_OBJECT(); - t1Ptr = valuePtr->typePtr; - t2Ptr = value2Ptr->typePtr; - - if ((t1Ptr == &tclIntType) || (t1Ptr == &tclBooleanType)) { - i1 = (valuePtr->internalRep.longValue != 0); - } else if (t1Ptr == &tclDoubleType) { - i1 = (valuePtr->internalRep.doubleValue != 0.0); - } else { - s = Tcl_GetStringFromObj(valuePtr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - valuePtr, &i); - i1 = (i != 0); - } else { - result = Tcl_GetBooleanFromObj((Tcl_Interp *) NULL, - valuePtr, &i1); - i1 = (i1 != 0); - } - if (result != TCL_OK) { - TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", - O2S(valuePtr), - (t1Ptr? t1Ptr->name : "null"))); - IllegalExprOperandType(interp, pc, valuePtr); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto checkForCatch; - } - } - - if ((t2Ptr == &tclIntType) || (t2Ptr == &tclBooleanType)) { - i2 = (value2Ptr->internalRep.longValue != 0); - } else if (t2Ptr == &tclDoubleType) { - i2 = (value2Ptr->internalRep.doubleValue != 0.0); - } else { - s = Tcl_GetStringFromObj(value2Ptr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - value2Ptr, &i); - i2 = (i != 0); - } else { - result = Tcl_GetBooleanFromObj((Tcl_Interp *) NULL, - value2Ptr, &i2); - } - if (result != TCL_OK) { - TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", - O2S(value2Ptr), - (t2Ptr? t2Ptr->name : "null"))); - IllegalExprOperandType(interp, pc, value2Ptr); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto checkForCatch; - } - } - - /* - * Reuse the valuePtr object already on stack if possible. - */ - - if (*pc == INST_LOR) { - iResult = (i1 || i2); - } else { - iResult = (i1 && i2); - } - if (Tcl_IsShared(valuePtr)) { - PUSH_OBJECT(Tcl_NewLongObj(iResult)); - TRACE(("%.20s %.20s => %d\n", - O2S(valuePtr), O2S(value2Ptr), iResult)); - TclDecrRefCount(valuePtr); - } else { /* reuse the valuePtr object */ - TRACE(("%.20s %.20s => %d\n", - O2S(valuePtr), O2S(value2Ptr), iResult)); - Tcl_SetLongObj(valuePtr, iResult); - ++stackTop; /* valuePtr now on stk top has right r.c. */ - } - TclDecrRefCount(value2Ptr); - } - ADJUST_PC(1); - - case INST_EQ: - case INST_NEQ: - case INST_LT: - case INST_GT: - case INST_LE: - case INST_GE: - { - /* - * Any type is allowed but the two operands must have the - * same type. We will compute value op value2. - */ - - Tcl_ObjType *t1Ptr, *t2Ptr; - char *s1 = NULL; /* Init. avoids compiler warning. */ - char *s2 = NULL; /* Init. avoids compiler warning. */ - long i2 = 0; /* Init. avoids compiler warning. */ - double d1 = 0.0; /* Init. avoids compiler warning. */ - double d2 = 0.0; /* Init. avoids compiler warning. */ - long iResult = 0; /* Init. avoids compiler warning. */ - - value2Ptr = POP_OBJECT(); - valuePtr = POP_OBJECT(); - t1Ptr = valuePtr->typePtr; - t2Ptr = value2Ptr->typePtr; - - if ((t1Ptr != &tclIntType) && (t1Ptr != &tclDoubleType)) { - s1 = Tcl_GetStringFromObj(valuePtr, &length); - if (TclLooksLikeInt(s1, length)) { - (void) Tcl_GetLongFromObj((Tcl_Interp *) NULL, - valuePtr, &i); - } else { - (void) Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, - valuePtr, &d1); - } - t1Ptr = valuePtr->typePtr; - } - if ((t2Ptr != &tclIntType) && (t2Ptr != &tclDoubleType)) { - s2 = Tcl_GetStringFromObj(value2Ptr, &length); - if (TclLooksLikeInt(s2, length)) { - (void) Tcl_GetLongFromObj((Tcl_Interp *) NULL, - value2Ptr, &i2); - } else { - (void) Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, - value2Ptr, &d2); - } - t2Ptr = value2Ptr->typePtr; - } - - if (((t1Ptr != &tclIntType) && (t1Ptr != &tclDoubleType)) - || ((t2Ptr != &tclIntType) && (t2Ptr != &tclDoubleType))) { - /* - * One operand is not numeric. Compare as strings. - */ - int cmpValue; - s1 = Tcl_GetString(valuePtr); - s2 = Tcl_GetString(value2Ptr); - cmpValue = strcmp(s1, s2); - switch (*pc) { - case INST_EQ: - iResult = (cmpValue == 0); - break; - case INST_NEQ: - iResult = (cmpValue != 0); - break; - case INST_LT: - iResult = (cmpValue < 0); - break; - case INST_GT: - iResult = (cmpValue > 0); - break; - case INST_LE: - iResult = (cmpValue <= 0); - break; - case INST_GE: - iResult = (cmpValue >= 0); - break; - } - } else if ((t1Ptr == &tclDoubleType) - || (t2Ptr == &tclDoubleType)) { - /* - * Compare as doubles. - */ - if (t1Ptr == &tclDoubleType) { - d1 = valuePtr->internalRep.doubleValue; - if (t2Ptr == &tclIntType) { - d2 = value2Ptr->internalRep.longValue; - } else { - d2 = value2Ptr->internalRep.doubleValue; - } - } else { /* t1Ptr is int, t2Ptr is double */ - d1 = valuePtr->internalRep.longValue; - d2 = value2Ptr->internalRep.doubleValue; - } - switch (*pc) { - case INST_EQ: - iResult = d1 == d2; - break; - case INST_NEQ: - iResult = d1 != d2; - break; - case INST_LT: - iResult = d1 < d2; - break; - case INST_GT: - iResult = d1 > d2; - break; - case INST_LE: - iResult = d1 <= d2; - break; - case INST_GE: - iResult = d1 >= d2; - break; - } - } else { - /* - * Compare as ints. - */ - i = valuePtr->internalRep.longValue; - i2 = value2Ptr->internalRep.longValue; - switch (*pc) { - case INST_EQ: - iResult = i == i2; - break; - case INST_NEQ: - iResult = i != i2; - break; - case INST_LT: - iResult = i < i2; - break; - case INST_GT: - iResult = i > i2; - break; - case INST_LE: - iResult = i <= i2; - break; - case INST_GE: - iResult = i >= i2; - break; - } - } - - /* - * Reuse the valuePtr object already on stack if possible. - */ - - if (Tcl_IsShared(valuePtr)) { - PUSH_OBJECT(Tcl_NewLongObj(iResult)); - TRACE(("%.20s %.20s => %ld\n", - O2S(valuePtr), O2S(value2Ptr), iResult)); - TclDecrRefCount(valuePtr); - } else { /* reuse the valuePtr object */ - TRACE(("%.20s %.20s => %ld\n", - O2S(valuePtr), O2S(value2Ptr), iResult)); - Tcl_SetLongObj(valuePtr, iResult); - ++stackTop; /* valuePtr now on stk top has right r.c. */ - } - TclDecrRefCount(value2Ptr); - } - ADJUST_PC(1); - - case INST_MOD: - case INST_LSHIFT: - case INST_RSHIFT: - case INST_BITOR: - case INST_BITXOR: - case INST_BITAND: - { - /* - * Only integers are allowed. We compute value op value2. - */ - - long i2, rem, negative; - long iResult = 0; /* Init. avoids compiler warning. */ - - value2Ptr = POP_OBJECT(); - valuePtr = POP_OBJECT(); - if (valuePtr->typePtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - } else { /* try to convert to int */ - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - valuePtr, &i); - if (result != TCL_OK) { - TRACE(("%.20s %.20s => ILLEGAL 1st TYPE %s\n", - O2S(valuePtr), O2S(value2Ptr), - (valuePtr->typePtr? - valuePtr->typePtr->name : "null"))); - IllegalExprOperandType(interp, pc, valuePtr); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto checkForCatch; - } - } - if (value2Ptr->typePtr == &tclIntType) { - i2 = value2Ptr->internalRep.longValue; - } else { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - value2Ptr, &i2); - if (result != TCL_OK) { - TRACE(("%.20s %.20s => ILLEGAL 2nd TYPE %s\n", - O2S(valuePtr), O2S(value2Ptr), - (value2Ptr->typePtr? - value2Ptr->typePtr->name : "null"))); - IllegalExprOperandType(interp, pc, value2Ptr); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto checkForCatch; - } - } - - switch (*pc) { - case INST_MOD: - /* - * This code is tricky: C doesn't guarantee much about - * the quotient or remainder, but Tcl does. The - * remainder always has the same sign as the divisor and - * a smaller absolute value. - */ - if (i2 == 0) { - TRACE(("%ld %ld => DIVIDE BY ZERO\n", i, i2)); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto divideByZero; - } - negative = 0; - if (i2 < 0) { - i2 = -i2; - i = -i; - negative = 1; - } - rem = i % i2; - if (rem < 0) { - rem += i2; - } - if (negative) { - rem = -rem; - } - iResult = rem; - break; - case INST_LSHIFT: - iResult = i << i2; - break; - case INST_RSHIFT: - /* - * The following code is a bit tricky: it ensures that - * right shifts propagate the sign bit even on machines - * where ">>" won't do it by default. - */ - if (i < 0) { - iResult = ~((~i) >> i2); - } else { - iResult = i >> i2; - } - break; - case INST_BITOR: - iResult = i | i2; - break; - case INST_BITXOR: - iResult = i ^ i2; - break; - case INST_BITAND: - iResult = i & i2; - break; - } - - /* - * Reuse the valuePtr object already on stack if possible. - */ - - if (Tcl_IsShared(valuePtr)) { - PUSH_OBJECT(Tcl_NewLongObj(iResult)); - TRACE(("%ld %ld => %ld\n", i, i2, iResult)); - TclDecrRefCount(valuePtr); - } else { /* reuse the valuePtr object */ - TRACE(("%ld %ld => %ld\n", i, i2, iResult)); - Tcl_SetLongObj(valuePtr, iResult); - ++stackTop; /* valuePtr now on stk top has right r.c. */ - } - TclDecrRefCount(value2Ptr); - } - ADJUST_PC(1); - - case INST_ADD: - case INST_SUB: - case INST_MULT: - case INST_DIV: - { - /* - * Operands must be numeric and ints get converted to floats - * if necessary. We compute value op value2. - */ - - Tcl_ObjType *t1Ptr, *t2Ptr; - long i2, quot, rem; - double d1, d2; - long iResult = 0; /* Init. avoids compiler warning. */ - double dResult = 0.0; /* Init. avoids compiler warning. */ - int doDouble = 0; /* 1 if doing floating arithmetic */ - - value2Ptr = POP_OBJECT(); - valuePtr = POP_OBJECT(); - t1Ptr = valuePtr->typePtr; - t2Ptr = value2Ptr->typePtr; - - if (t1Ptr == &tclIntType) { - i = valuePtr->internalRep.longValue; - } else if ((t1Ptr == &tclDoubleType) - && (valuePtr->bytes == NULL)) { - /* - * We can only use the internal rep directly if there is - * no string rep. Otherwise the string rep might actually - * look like an integer, which is preferred. - */ - - d1 = valuePtr->internalRep.doubleValue; - } else { - char *s = Tcl_GetStringFromObj(valuePtr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - valuePtr, &i); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, - valuePtr, &d1); - } - if (result != TCL_OK) { - TRACE(("%.20s %.20s => ILLEGAL 1st TYPE %s\n", - s, O2S(valuePtr), - (valuePtr->typePtr? - valuePtr->typePtr->name : "null"))); - IllegalExprOperandType(interp, pc, valuePtr); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto checkForCatch; - } - t1Ptr = valuePtr->typePtr; - } - - if (t2Ptr == &tclIntType) { - i2 = value2Ptr->internalRep.longValue; - } else if ((t2Ptr == &tclDoubleType) - && (value2Ptr->bytes == NULL)) { - /* - * We can only use the internal rep directly if there is - * no string rep. Otherwise the string rep might actually - * look like an integer, which is preferred. - */ - - d2 = value2Ptr->internalRep.doubleValue; - } else { - char *s = Tcl_GetStringFromObj(value2Ptr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - value2Ptr, &i2); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, - value2Ptr, &d2); - } - if (result != TCL_OK) { - TRACE(("%.20s %.20s => ILLEGAL 2nd TYPE %s\n", - O2S(value2Ptr), s, - (value2Ptr->typePtr? - value2Ptr->typePtr->name : "null"))); - IllegalExprOperandType(interp, pc, value2Ptr); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto checkForCatch; - } - t2Ptr = value2Ptr->typePtr; - } - - if ((t1Ptr == &tclDoubleType) || (t2Ptr == &tclDoubleType)) { - /* - * Do double arithmetic. - */ - doDouble = 1; - if (t1Ptr == &tclIntType) { - d1 = i; /* promote value 1 to double */ - } else if (t2Ptr == &tclIntType) { - d2 = i2; /* promote value 2 to double */ - } - switch (*pc) { - case INST_ADD: - dResult = d1 + d2; - break; - case INST_SUB: - dResult = d1 - d2; - break; - case INST_MULT: - dResult = d1 * d2; - break; - case INST_DIV: - if (d2 == 0.0) { - TRACE(("%.6g %.6g => DIVIDE BY ZERO\n", d1, d2)); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto divideByZero; - } - dResult = d1 / d2; - break; - } - - /* - * Check now for IEEE floating-point error. - */ - - if (IS_NAN(dResult) || IS_INF(dResult)) { - TRACE(("%.20s %.20s => IEEE FLOATING PT ERROR\n", - O2S(valuePtr), O2S(value2Ptr))); - TclExprFloatError(interp, dResult); - result = TCL_ERROR; - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto checkForCatch; - } - } else { - /* - * Do integer arithmetic. - */ - switch (*pc) { - case INST_ADD: - iResult = i + i2; - break; - case INST_SUB: - iResult = i - i2; - break; - case INST_MULT: - iResult = i * i2; - break; - case INST_DIV: - /* - * This code is tricky: C doesn't guarantee much - * about the quotient or remainder, but Tcl does. - * The remainder always has the same sign as the - * divisor and a smaller absolute value. - */ - if (i2 == 0) { - TRACE(("%ld %ld => DIVIDE BY ZERO\n", i, i2)); - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - goto divideByZero; - } - if (i2 < 0) { - i2 = -i2; - i = -i; - } - quot = i / i2; - rem = i % i2; - if (rem < 0) { - quot -= 1; - } - iResult = quot; - break; - } - } - - /* - * Reuse the valuePtr object already on stack if possible. - */ - - if (Tcl_IsShared(valuePtr)) { - if (doDouble) { - PUSH_OBJECT(Tcl_NewDoubleObj(dResult)); - TRACE(("%.6g %.6g => %.6g\n", d1, d2, dResult)); - } else { - PUSH_OBJECT(Tcl_NewLongObj(iResult)); - TRACE(("%ld %ld => %ld\n", i, i2, iResult)); - } - TclDecrRefCount(valuePtr); - } else { /* reuse the valuePtr object */ - if (doDouble) { /* NB: stack top is off by 1 */ - TRACE(("%.6g %.6g => %.6g\n", d1, d2, dResult)); - Tcl_SetDoubleObj(valuePtr, dResult); - } else { - TRACE(("%ld %ld => %ld\n", i, i2, iResult)); - Tcl_SetLongObj(valuePtr, iResult); - } - ++stackTop; /* valuePtr now on stk top has right r.c. */ - } - TclDecrRefCount(value2Ptr); - } - ADJUST_PC(1); - - case INST_UPLUS: - { - /* - * Operand must be numeric. - */ - - double d; - Tcl_ObjType *tPtr; - - valuePtr = stackPtr[stackTop]; - tPtr = valuePtr->typePtr; - if ((tPtr != &tclIntType) && ((tPtr != &tclDoubleType) - || (valuePtr->bytes != NULL))) { - char *s = Tcl_GetStringFromObj(valuePtr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - valuePtr, &i); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, - valuePtr, &d); - } - if (result != TCL_OK) { - TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", - s, (tPtr? tPtr->name : "null"))); - IllegalExprOperandType(interp, pc, valuePtr); - goto checkForCatch; - } - tPtr = valuePtr->typePtr; - } - - /* - * Ensure that the operand's string rep is the same as the - * formatted version of its internal rep. This makes sure - * that "expr +000123" yields "83", not "000123". We - * implement this by _discarding_ the string rep since we - * know it will be regenerated, if needed later, by - * formatting the internal rep's value. - */ - - if (Tcl_IsShared(valuePtr)) { - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - objPtr = Tcl_NewLongObj(i); - } else { - d = valuePtr->internalRep.doubleValue; - objPtr = Tcl_NewDoubleObj(d); - } - Tcl_IncrRefCount(objPtr); - Tcl_DecrRefCount(valuePtr); - valuePtr = objPtr; - stackPtr[stackTop] = valuePtr; - } else { - Tcl_InvalidateStringRep(valuePtr); - } - TRACE_WITH_OBJ(("%s => ", O2S(valuePtr)), valuePtr); - } - ADJUST_PC(1); - - case INST_UMINUS: - case INST_LNOT: - { - /* - * The operand must be numeric. If the operand object is - * unshared modify it directly, otherwise create a copy to - * modify: this is "copy on write". free any old string - * representation since it is now invalid. - */ - - double d; - Tcl_ObjType *tPtr; - - valuePtr = POP_OBJECT(); - tPtr = valuePtr->typePtr; - if ((tPtr != &tclIntType) && ((tPtr != &tclDoubleType) - || (valuePtr->bytes != NULL))) { - char *s = Tcl_GetStringFromObj(valuePtr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - valuePtr, &i); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, - valuePtr, &d); - } - if (result != TCL_OK) { - TRACE(("\"%.20s\" => ILLEGAL TYPE %s\n", - s, (tPtr? tPtr->name : "null"))); - IllegalExprOperandType(interp, pc, valuePtr); - Tcl_DecrRefCount(valuePtr); - goto checkForCatch; - } - tPtr = valuePtr->typePtr; - } - - if (Tcl_IsShared(valuePtr)) { - /* - * Create a new object. - */ - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - objPtr = Tcl_NewLongObj( - (*pc == INST_UMINUS)? -i : !i); - TRACE_WITH_OBJ(("%ld => ", i), objPtr); - } else { - d = valuePtr->internalRep.doubleValue; - if (*pc == INST_UMINUS) { - objPtr = Tcl_NewDoubleObj(-d); - } else { - /* - * Should be able to use "!d", but apparently - * some compilers can't handle it. - */ - objPtr = Tcl_NewLongObj((d==0.0)? 1 : 0); - } - TRACE_WITH_OBJ(("%.6g => ", d), objPtr); - } - PUSH_OBJECT(objPtr); - TclDecrRefCount(valuePtr); - } else { - /* - * valuePtr is unshared. Modify it directly. - */ - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - Tcl_SetLongObj(valuePtr, - (*pc == INST_UMINUS)? -i : !i); - TRACE_WITH_OBJ(("%ld => ", i), valuePtr); - } else { - d = valuePtr->internalRep.doubleValue; - if (*pc == INST_UMINUS) { - Tcl_SetDoubleObj(valuePtr, -d); - } else { - /* - * Should be able to use "!d", but apparently - * some compilers can't handle it. - */ - Tcl_SetLongObj(valuePtr, (d==0.0)? 1 : 0); - } - TRACE_WITH_OBJ(("%.6g => ", d), valuePtr); - } - ++stackTop; /* valuePtr now on stk top has right r.c. */ - } - } - ADJUST_PC(1); - - case INST_BITNOT: - { - /* - * The operand must be an integer. If the operand object is - * unshared modify it directly, otherwise modify a copy. - * Free any old string representation since it is now - * invalid. - */ - - Tcl_ObjType *tPtr; - - valuePtr = POP_OBJECT(); - tPtr = valuePtr->typePtr; - if (tPtr != &tclIntType) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - valuePtr, &i); - if (result != TCL_OK) { /* try to convert to double */ - TRACE(("\"%.20s\" => ILLEGAL TYPE %s\n", - O2S(valuePtr), (tPtr? tPtr->name : "null"))); - IllegalExprOperandType(interp, pc, valuePtr); - Tcl_DecrRefCount(valuePtr); - goto checkForCatch; - } - } - - i = valuePtr->internalRep.longValue; - if (Tcl_IsShared(valuePtr)) { - PUSH_OBJECT(Tcl_NewLongObj(~i)); - TRACE(("0x%lx => (%lu)\n", i, ~i)); - TclDecrRefCount(valuePtr); - } else { - /* - * valuePtr is unshared. Modify it directly. - */ - Tcl_SetLongObj(valuePtr, ~i); - ++stackTop; /* valuePtr now on stk top has right r.c. */ - TRACE(("0x%lx => (%lu)\n", i, ~i)); - } - } - ADJUST_PC(1); - - case INST_CALL_BUILTIN_FUNC1: - opnd = TclGetUInt1AtPtr(pc+1); - { - /* - * Call one of the built-in Tcl math functions. - */ - - BuiltinFunc *mathFuncPtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if ((opnd < 0) || (opnd > LAST_BUILTIN_FUNC)) { - TRACE(("UNRECOGNIZED BUILTIN FUNC CODE %d\n", opnd)); - panic("TclExecuteByteCode: unrecognized builtin function code %d", opnd); - } - mathFuncPtr = &(builtinFuncTable[opnd]); - DECACHE_STACK_INFO(); - tsdPtr->mathInProgress++; - result = (*mathFuncPtr->proc)(interp, eePtr, - mathFuncPtr->clientData); - tsdPtr->mathInProgress--; - CACHE_STACK_INFO(); - if (result != TCL_OK) { - goto checkForCatch; - } - TRACE_WITH_OBJ(("%d => ", opnd), stackPtr[stackTop]); - } - ADJUST_PC(2); - - case INST_CALL_FUNC1: - opnd = TclGetUInt1AtPtr(pc+1); - { - /* - * Call a non-builtin Tcl math function previously - * registered by a call to Tcl_CreateMathFunc. - */ - - int objc = opnd; /* Number of arguments. The function name - * is the 0-th argument. */ - Tcl_Obj **objv; /* The array of arguments. The function - * name is objv[0]. */ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - objv = &(stackPtr[stackTop - (objc-1)]); /* "objv[0]" */ - DECACHE_STACK_INFO(); - tsdPtr->mathInProgress++; - result = ExprCallMathFunc(interp, eePtr, objc, objv); - tsdPtr->mathInProgress--; - CACHE_STACK_INFO(); - if (result != TCL_OK) { - goto checkForCatch; - } - TRACE_WITH_OBJ(("%d => ", objc), stackPtr[stackTop]); - ADJUST_PC(2); - } - - case INST_TRY_CVT_TO_NUMERIC: - { - /* - * Try to convert the topmost stack object to an int or - * double object. This is done in order to support Tcl's - * policy of interpreting operands if at all possible as - * first integers, else floating-point numbers. - */ - - double d; - char *s; - Tcl_ObjType *tPtr; - int converted, shared; - - valuePtr = stackPtr[stackTop]; - tPtr = valuePtr->typePtr; - converted = 0; - if ((tPtr != &tclIntType) && ((tPtr != &tclDoubleType) - || (valuePtr->bytes != NULL))) { - s = Tcl_GetStringFromObj(valuePtr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, - valuePtr, &i); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, - valuePtr, &d); - } - if (result == TCL_OK) { - converted = 1; - } - result = TCL_OK; /* reset the result variable */ - tPtr = valuePtr->typePtr; - } - - /* - * Ensure that the topmost stack object, if numeric, has a - * string rep the same as the formatted version of its - * internal rep. This is used, e.g., to make sure that "expr - * {0001}" yields "1", not "0001". We implement this by - * _discarding_ the string rep since we know it will be - * regenerated, if needed later, by formatting the internal - * rep's value. Also check if there has been an IEEE - * floating point error. - */ - - if ((tPtr == &tclIntType) || (tPtr == &tclDoubleType)) { - shared = 0; - if (Tcl_IsShared(valuePtr)) { - shared = 1; - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - objPtr = Tcl_NewLongObj(i); - } else { - d = valuePtr->internalRep.doubleValue; - objPtr = Tcl_NewDoubleObj(d); - } - Tcl_IncrRefCount(objPtr); - TclDecrRefCount(valuePtr); - valuePtr = objPtr; - stackPtr[stackTop] = valuePtr; - tPtr = valuePtr->typePtr; - } else { - Tcl_InvalidateStringRep(valuePtr); - } - - if (tPtr == &tclDoubleType) { - d = valuePtr->internalRep.doubleValue; - if (IS_NAN(d) || IS_INF(d)) { - TRACE(("\"%.20s\" => IEEE FLOATING PT ERROR\n", - O2S(valuePtr))); - TclExprFloatError(interp, d); - result = TCL_ERROR; - goto checkForCatch; - } - } - shared = shared; /* lint, shared not used. */ - converted = converted; /* lint, converted not used. */ - TRACE(("\"%.20s\" => numeric, %s, %s\n", O2S(valuePtr), - (converted? "converted" : "not converted"), - (shared? "shared" : "not shared"))); - } else { - TRACE(("\"%.20s\" => not numeric\n", O2S(valuePtr))); - } - } - ADJUST_PC(1); - - case INST_BREAK: - /* - * First reset the interpreter's result. Then find the closest - * enclosing loop or catch exception range, if any. If a loop is - * found, terminate its execution. If the closest is a catch - * exception range, jump to its catchOffset. If no enclosing - * range is found, stop execution and return TCL_BREAK. - */ - - Tcl_ResetResult(interp); - rangePtr = GetExceptRangeForPc(pc, /*catchOnly*/ 0, codePtr); - if (rangePtr == NULL) { - TRACE(("=> no encl. loop or catch, returning TCL_BREAK\n")); - result = TCL_BREAK; - goto abnormalReturn; /* no catch exists to check */ - } - switch (rangePtr->type) { - case LOOP_EXCEPTION_RANGE: - result = TCL_OK; - TRACE(("=> range at %d, new pc %d\n", - rangePtr->codeOffset, rangePtr->breakOffset)); - break; - case CATCH_EXCEPTION_RANGE: - result = TCL_BREAK; - TRACE(("=> ...\n")); - goto processCatch; /* it will use rangePtr */ - default: - panic("TclExecuteByteCode: unrecognized ExceptionRange type %d\n", rangePtr->type); - } - pc = (codePtr->codeStart + rangePtr->breakOffset); - continue; /* restart outer instruction loop at pc */ - - case INST_CONTINUE: - /* - * Find the closest enclosing loop or catch exception range, - * if any. If a loop is found, skip to its next iteration. - * If the closest is a catch exception range, jump to its - * catchOffset. If no enclosing range is found, stop - * execution and return TCL_CONTINUE. - */ - - Tcl_ResetResult(interp); - rangePtr = GetExceptRangeForPc(pc, /*catchOnly*/ 0, codePtr); - if (rangePtr == NULL) { - TRACE(("=> no encl. loop or catch, returning TCL_CONTINUE\n")); - result = TCL_CONTINUE; - goto abnormalReturn; - } - switch (rangePtr->type) { - case LOOP_EXCEPTION_RANGE: - if (rangePtr->continueOffset == -1) { - TRACE(("=> loop w/o continue, checking for catch\n")); - goto checkForCatch; - } else { - result = TCL_OK; - TRACE(("=> range at %d, new pc %d\n", - rangePtr->codeOffset, rangePtr->continueOffset)); - } - break; - case CATCH_EXCEPTION_RANGE: - result = TCL_CONTINUE; - TRACE(("=> ...\n")); - goto processCatch; /* it will use rangePtr */ - default: - panic("TclExecuteByteCode: unrecognized ExceptionRange type %d\n", rangePtr->type); - } - pc = (codePtr->codeStart + rangePtr->continueOffset); - continue; /* restart outer instruction loop at pc */ - - case INST_FOREACH_START4: - opnd = TclGetUInt4AtPtr(pc+1); - { - /* - * Initialize the temporary local var that holds the count - * of the number of iterations of the loop body to -1. - */ - - ForeachInfo *infoPtr = (ForeachInfo *) - codePtr->auxDataArrayPtr[opnd].clientData; - int iterTmpIndex = infoPtr->loopCtTemp; - Var *compiledLocals = iPtr->varFramePtr->compiledLocals; - Var *iterVarPtr = &(compiledLocals[iterTmpIndex]); - Tcl_Obj *oldValuePtr = iterVarPtr->value.objPtr; - - if (oldValuePtr == NULL) { - iterVarPtr->value.objPtr = Tcl_NewLongObj(-1); - Tcl_IncrRefCount(iterVarPtr->value.objPtr); - } else { - Tcl_SetLongObj(oldValuePtr, -1); - } - TclSetVarScalar(iterVarPtr); - TclClearVarUndefined(iterVarPtr); - TRACE(("%u => loop iter count temp %d\n", - opnd, iterTmpIndex)); - } - ADJUST_PC(5); - - case INST_FOREACH_STEP4: - opnd = TclGetUInt4AtPtr(pc+1); - { - /* - * "Step" a foreach loop (i.e., begin its next iteration) by - * assigning the next value list element to each loop var. - */ - - ForeachInfo *infoPtr = (ForeachInfo *) - codePtr->auxDataArrayPtr[opnd].clientData; - ForeachVarList *varListPtr; - int numLists = infoPtr->numLists; - Var *compiledLocals = iPtr->varFramePtr->compiledLocals; - Tcl_Obj *listPtr; - List *listRepPtr; - Var *iterVarPtr, *listVarPtr; - int iterNum, listTmpIndex, listLen, numVars; - int varIndex, valIndex, continueLoop, j; - - /* - * Increment the temp holding the loop iteration number. - */ - - iterVarPtr = &(compiledLocals[infoPtr->loopCtTemp]); - valuePtr = iterVarPtr->value.objPtr; - iterNum = (valuePtr->internalRep.longValue + 1); - Tcl_SetLongObj(valuePtr, iterNum); - - /* - * Check whether all value lists are exhausted and we should - * stop the loop. - */ - - continueLoop = 0; - listTmpIndex = infoPtr->firstValueTemp; - for (i = 0; i < numLists; i++) { - varListPtr = infoPtr->varLists[i]; - numVars = varListPtr->numVars; - - listVarPtr = &(compiledLocals[listTmpIndex]); - listPtr = listVarPtr->value.objPtr; - result = Tcl_ListObjLength(interp, listPtr, &listLen); - if (result != TCL_OK) { - TRACE_WITH_OBJ(("%u => ERROR converting list %ld, \"%s\": ", - opnd, i, O2S(listPtr)), - Tcl_GetObjResult(interp)); - goto checkForCatch; - } - if (listLen > (iterNum * numVars)) { - continueLoop = 1; - } - listTmpIndex++; - } - - /* - * If some var in some var list still has a remaining list - * element iterate one more time. Assign to var the next - * element from its value list. We already checked above - * that each list temp holds a valid list object. - */ - - if (continueLoop) { - listTmpIndex = infoPtr->firstValueTemp; - for (i = 0; i < numLists; i++) { - varListPtr = infoPtr->varLists[i]; - numVars = varListPtr->numVars; - - listVarPtr = &(compiledLocals[listTmpIndex]); - listPtr = listVarPtr->value.objPtr; - listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - listLen = listRepPtr->elemCount; - - valIndex = (iterNum * numVars); - for (j = 0; j < numVars; j++) { - int setEmptyStr = 0; - if (valIndex >= listLen) { - setEmptyStr = 1; - valuePtr = Tcl_NewObj(); - } else { - valuePtr = listRepPtr->elements[valIndex]; - } - - varIndex = varListPtr->varIndexes[j]; - DECACHE_STACK_INFO(); - value2Ptr = TclSetIndexedScalar(interp, - varIndex, valuePtr, /*leaveErrorMsg*/ 1); - CACHE_STACK_INFO(); - if (value2Ptr == NULL) { - TRACE_WITH_OBJ(("%u => ERROR init. index temp %d: ", - opnd, varIndex), - Tcl_GetObjResult(interp)); - if (setEmptyStr) { - Tcl_DecrRefCount(valuePtr); - } - result = TCL_ERROR; - goto checkForCatch; - } - valIndex++; - } - listTmpIndex++; - } - } - - /* - * Push 1 if at least one value list had a remaining element - * and the loop should continue. Otherwise push 0. - */ - - PUSH_OBJECT(Tcl_NewLongObj(continueLoop)); - TRACE(("%u => %d lists, iter %d, %s loop\n", - opnd, numLists, iterNum, - (continueLoop? "continue" : "exit"))); - } - ADJUST_PC(5); - - case INST_BEGIN_CATCH4: - /* - * Record start of the catch command with exception range index - * equal to the operand. Push the current stack depth onto the - * special catch stack. - */ - catchStackPtr[++catchTop] = stackTop; - TRACE(("%u => catchTop=%d, stackTop=%d\n", - TclGetUInt4AtPtr(pc+1), catchTop, stackTop)); - ADJUST_PC(5); - - case INST_END_CATCH: - catchTop--; - result = TCL_OK; - TRACE(("=> catchTop=%d\n", catchTop)); - ADJUST_PC(1); - - case INST_PUSH_RESULT: - PUSH_OBJECT(Tcl_GetObjResult(interp)); - TRACE_WITH_OBJ(("=> "), Tcl_GetObjResult(interp)); - ADJUST_PC(1); - - case INST_PUSH_RETURN_CODE: - PUSH_OBJECT(Tcl_NewLongObj(result)); - TRACE(("=> %u\n", result)); - ADJUST_PC(1); - - default: - panic("TclExecuteByteCode: unrecognized opCode %u", *pc); - } /* end of switch on opCode */ - - /* - * Division by zero in an expression. Control only reaches this - * point by "goto divideByZero". - */ - - divideByZero: - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), "divide by zero", -1); - Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", - (char *) NULL); - result = TCL_ERROR; - - /* - * Execution has generated an "exception" such as TCL_ERROR. If the - * exception is an error, record information about what was being - * executed when the error occurred. Find the closest enclosing - * catch range, if any. If no enclosing catch range is found, stop - * execution and return the "exception" code. - */ - - checkForCatch: - if ((result == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) { - bytes = GetSrcInfoForPc(pc, codePtr, &length); - if (bytes != NULL) { - Tcl_LogCommandInfo(interp, codePtr->source, bytes, length); - iPtr->flags |= ERR_ALREADY_LOGGED; - } - } - rangePtr = GetExceptRangeForPc(pc, /*catchOnly*/ 1, codePtr); - if (rangePtr == NULL) { -#ifdef TCL_COMPILE_DEBUG - if (traceInstructions) { - fprintf(stdout, " ... no enclosing catch, returning %s\n", - StringForResultCode(result)); - } -#endif - goto abnormalReturn; - } - - /* - * A catch exception range (rangePtr) was found to handle an - * "exception". It was found either by checkForCatch just above or - * by an instruction during break, continue, or error processing. - * Jump to its catchOffset after unwinding the operand stack to - * the depth it had when starting to execute the range's catch - * command. - */ - - processCatch: - while (stackTop > catchStackPtr[catchTop]) { - valuePtr = POP_OBJECT(); - TclDecrRefCount(valuePtr); - } -#ifdef TCL_COMPILE_DEBUG - if (traceInstructions) { - fprintf(stdout, " ... found catch at %d, catchTop=%d, unwound to %d, new pc %u\n", - rangePtr->codeOffset, catchTop, catchStackPtr[catchTop], - (unsigned int)(rangePtr->catchOffset)); - } -#endif - pc = (codePtr->codeStart + rangePtr->catchOffset); - continue; /* restart the execution loop at pc */ - } /* end of infinite loop dispatching on instructions */ - - /* - * Abnormal return code. Restore the stack to state it had when starting - * to execute the ByteCode. - */ - - abnormalReturn: - while (stackTop > initStackTop) { - valuePtr = POP_OBJECT(); - Tcl_DecrRefCount(valuePtr); - } - - /* - * Free the catch stack array if malloc'ed storage was used. - */ - - done: - if (catchStackPtr != catchStackStorage) { - ckfree((char *) catchStackPtr); - } - eePtr->stackTop = initStackTop; - return result; -#undef STATIC_CATCH_STACK_SIZE -} - -#ifdef TCL_COMPILE_DEBUG -/* - *---------------------------------------------------------------------- - * - * PrintByteCodeInfo -- - * - * This procedure prints a summary about a bytecode object to stdout. - * It is called by TclExecuteByteCode when starting to execute the - * bytecode object if tclTraceExec has the value 2 or more. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -PrintByteCodeInfo(codePtr) - register ByteCode *codePtr; /* The bytecode whose summary is printed - * to stdout. */ -{ - Proc *procPtr = codePtr->procPtr; - Interp *iPtr = (Interp *) *codePtr->interpHandle; - - fprintf(stdout, "\nExecuting ByteCode 0x%x, refCt %u, epoch %u, interp 0x%x (epoch %u)\n", - (unsigned int) codePtr, codePtr->refCount, - codePtr->compileEpoch, (unsigned int) iPtr, - iPtr->compileEpoch); - - fprintf(stdout, " Source: "); - TclPrintSource(stdout, codePtr->source, 60); - - fprintf(stdout, "\n Cmds %d, src %d, inst %u, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n", - codePtr->numCommands, codePtr->numSrcBytes, - codePtr->numCodeBytes, codePtr->numLitObjects, - codePtr->numAuxDataItems, codePtr->maxStackDepth, -#ifdef TCL_COMPILE_STATS - (codePtr->numSrcBytes? - ((float)codePtr->structureSize)/((float)codePtr->numSrcBytes) : 0.0)); -#else - 0.0); -#endif -#ifdef TCL_COMPILE_STATS - fprintf(stdout, " Code %d = header %d+inst %d+litObj %d+exc %d+aux %d+cmdMap %d\n", - codePtr->structureSize, - (sizeof(ByteCode) - (sizeof(size_t) + sizeof(Tcl_Time))), - codePtr->numCodeBytes, - (codePtr->numLitObjects * sizeof(Tcl_Obj *)), - (codePtr->numExceptRanges * sizeof(ExceptionRange)), - (codePtr->numAuxDataItems * sizeof(AuxData)), - codePtr->numCmdLocBytes); -#endif /* TCL_COMPILE_STATS */ - if (procPtr != NULL) { - fprintf(stdout, - " Proc 0x%x, refCt %d, args %d, compiled locals %d\n", - (unsigned int) procPtr, procPtr->refCount, - procPtr->numArgs, procPtr->numCompiledLocals); - } -} -#endif /* TCL_COMPILE_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * ValidatePcAndStackTop -- - * - * This procedure is called by TclExecuteByteCode when debugging to - * verify that the program counter and stack top are valid during - * execution. - * - * Results: - * None. - * - * Side effects: - * Prints a message to stderr and panics if either the pc or stack - * top are invalid. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_COMPILE_DEBUG -static void -ValidatePcAndStackTop(codePtr, pc, stackTop, stackLowerBound, - stackUpperBound) - register ByteCode *codePtr; /* The bytecode whose summary is printed - * to stdout. */ - unsigned char *pc; /* Points to first byte of a bytecode - * instruction. The program counter. */ - int stackTop; /* Current stack top. Must be between - * stackLowerBound and stackUpperBound - * (inclusive). */ - int stackLowerBound; /* Smallest legal value for stackTop. */ - int stackUpperBound; /* Greatest legal value for stackTop. */ -{ - unsigned int relativePc = (unsigned int) (pc - codePtr->codeStart); - unsigned int codeStart = (unsigned int) codePtr->codeStart; - unsigned int codeEnd = (unsigned int) - (codePtr->codeStart + codePtr->numCodeBytes); - unsigned char opCode = *pc; - - if (((unsigned int) pc < codeStart) || ((unsigned int) pc > codeEnd)) { - fprintf(stderr, "\nBad instruction pc 0x%x in TclExecuteByteCode\n", - (unsigned int) pc); - panic("TclExecuteByteCode execution failure: bad pc"); - } - if ((unsigned int) opCode > LAST_INST_OPCODE) { - fprintf(stderr, "\nBad opcode %d at pc %u in TclExecuteByteCode\n", - (unsigned int) opCode, relativePc); - panic("TclExecuteByteCode execution failure: bad opcode"); - } - if ((stackTop < stackLowerBound) || (stackTop > stackUpperBound)) { - int numChars; - char *cmd = GetSrcInfoForPc(pc, codePtr, &numChars); - char *ellipsis = ""; - - fprintf(stderr, "\nBad stack top %d at pc %u in TclExecuteByteCode", - stackTop, relativePc); - if (cmd != NULL) { - if (numChars > 100) { - numChars = 100; - ellipsis = "..."; - } - fprintf(stderr, "\n executing %.*s%s\n", numChars, cmd, - ellipsis); - } else { - fprintf(stderr, "\n"); - } - panic("TclExecuteByteCode execution failure: bad stack top"); - } -} -#endif /* TCL_COMPILE_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * IllegalExprOperandType -- - * - * Used by TclExecuteByteCode to add an error message to errorInfo - * when an illegal operand type is detected by an expression - * instruction. The argument opndPtr holds the operand object in error. - * - * Results: - * None. - * - * Side effects: - * An error message is appended to errorInfo. - * - *---------------------------------------------------------------------- - */ - -static void -IllegalExprOperandType(interp, pc, opndPtr) - Tcl_Interp *interp; /* Interpreter to which error information - * pertains. */ - unsigned char *pc; /* Points to the instruction being executed - * when the illegal type was found. */ - Tcl_Obj *opndPtr; /* Points to the operand holding the value - * with the illegal type. */ -{ - unsigned char opCode = *pc; - int isDouble; - - Tcl_ResetResult(interp); - if ((opndPtr->bytes == NULL) || (opndPtr->length == 0)) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't use empty string as operand of \"", - operatorStrings[opCode - INST_LOR], "\"", (char *) NULL); - } else { - isDouble = 1; - if (opndPtr->typePtr != &tclDoubleType) { - /* - * See if the operand can be interpreted as a double in order to - * improve the error message. - */ - - char *s = Tcl_GetString(opndPtr); - double d; - - if (Tcl_GetDouble((Tcl_Interp *) NULL, s, &d) != TCL_OK) { - isDouble = 0; - } - } - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "can't use ", - (isDouble? "floating-point value" : "non-numeric string"), - " as operand of \"", operatorStrings[opCode - INST_LOR], - "\"", (char *) NULL); - } -} - -/* - *---------------------------------------------------------------------- - * - * CallTraceProcedure -- - * - * Invokes a trace procedure registered with an interpreter. These - * procedures trace command execution. Currently this trace procedure - * is called with the address of the string-based Tcl_CmdProc for the - * command, not the Tcl_ObjCmdProc. - * - * Results: - * None. - * - * Side effects: - * Those side effects made by the trace procedure. - * - *---------------------------------------------------------------------- - */ - -static void -CallTraceProcedure(interp, tracePtr, cmdPtr, command, numChars, objc, objv) - Tcl_Interp *interp; /* The current interpreter. */ - register Trace *tracePtr; /* Describes the trace procedure to call. */ - Command *cmdPtr; /* Points to command's Command struct. */ - char *command; /* Points to the first character of the - * command's source before substitutions. */ - int numChars; /* The number of characters in the - * command's source. */ - register int objc; /* Number of arguments for the command. */ - Tcl_Obj *objv[]; /* Pointers to Tcl_Obj of each argument. */ -{ - Interp *iPtr = (Interp *) interp; - register char **argv; - register int i; - int length; - char *p; - - /* - * Get the string rep from the objv argument objects and place their - * pointers in argv. First make sure argv is large enough to hold the - * objc args plus 1 extra word for the zero end-of-argv word. - */ - - argv = (char **) ckalloc((unsigned)(objc + 1) * sizeof(char *)); - for (i = 0; i < objc; i++) { - argv[i] = Tcl_GetStringFromObj(objv[i], &length); - } - argv[objc] = 0; - - /* - * Copy the command characters into a new string. - */ - - p = (char *) ckalloc((unsigned) (numChars + 1)); - memcpy((VOID *) p, (VOID *) command, (size_t) numChars); - p[numChars] = '\0'; - - /* - * Call the trace procedure then free allocated storage. - */ - - (*tracePtr->proc)(tracePtr->clientData, interp, iPtr->numLevels, - p, cmdPtr->proc, cmdPtr->clientData, objc, argv); - - ckfree((char *) argv); - ckfree((char *) p); -} - -/* - *---------------------------------------------------------------------- - * - * GetSrcInfoForPc -- - * - * Given a program counter value, finds the closest command in the - * bytecode code unit's CmdLocation array and returns information about - * that command's source: a pointer to its first byte and the number of - * characters. - * - * Results: - * If a command is found that encloses the program counter value, a - * pointer to the command's source is returned and the length of the - * source is stored at *lengthPtr. If multiple commands resulted in - * code at pc, information about the closest enclosing command is - * returned. If no matching command is found, NULL is returned and - * *lengthPtr is unchanged. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static char * -GetSrcInfoForPc(pc, codePtr, lengthPtr) - unsigned char *pc; /* The program counter value for which to - * return the closest command's source info. - * This points to a bytecode instruction - * in codePtr's code. */ - ByteCode *codePtr; /* The bytecode sequence in which to look - * up the command source for the pc. */ - int *lengthPtr; /* If non-NULL, the location where the - * length of the command's source should be - * stored. If NULL, no length is stored. */ -{ - register int pcOffset = (pc - codePtr->codeStart); - int numCmds = codePtr->numCommands; - unsigned char *codeDeltaNext, *codeLengthNext; - unsigned char *srcDeltaNext, *srcLengthNext; - int codeOffset, codeLen, codeEnd, srcOffset, srcLen, delta, i; - int bestDist = INT_MAX; /* Distance of pc to best cmd's start pc. */ - int bestSrcOffset = -1; /* Initialized to avoid compiler warning. */ - int bestSrcLength = -1; /* Initialized to avoid compiler warning. */ - - if ((pcOffset < 0) || (pcOffset >= codePtr->numCodeBytes)) { - return NULL; - } - - /* - * Decode the code and source offset and length for each command. The - * closest enclosing command is the last one whose code started before - * pcOffset. - */ - - codeDeltaNext = codePtr->codeDeltaStart; - codeLengthNext = codePtr->codeLengthStart; - srcDeltaNext = codePtr->srcDeltaStart; - srcLengthNext = codePtr->srcLengthStart; - codeOffset = srcOffset = 0; - for (i = 0; i < numCmds; i++) { - if ((unsigned int) (*codeDeltaNext) == (unsigned int) 0xFF) { - codeDeltaNext++; - delta = TclGetInt4AtPtr(codeDeltaNext); - codeDeltaNext += 4; - } else { - delta = TclGetInt1AtPtr(codeDeltaNext); - codeDeltaNext++; - } - codeOffset += delta; - - if ((unsigned int) (*codeLengthNext) == (unsigned int) 0xFF) { - codeLengthNext++; - codeLen = TclGetInt4AtPtr(codeLengthNext); - codeLengthNext += 4; - } else { - codeLen = TclGetInt1AtPtr(codeLengthNext); - codeLengthNext++; - } - codeEnd = (codeOffset + codeLen - 1); - - if ((unsigned int) (*srcDeltaNext) == (unsigned int) 0xFF) { - srcDeltaNext++; - delta = TclGetInt4AtPtr(srcDeltaNext); - srcDeltaNext += 4; - } else { - delta = TclGetInt1AtPtr(srcDeltaNext); - srcDeltaNext++; - } - srcOffset += delta; - - if ((unsigned int) (*srcLengthNext) == (unsigned int) 0xFF) { - srcLengthNext++; - srcLen = TclGetInt4AtPtr(srcLengthNext); - srcLengthNext += 4; - } else { - srcLen = TclGetInt1AtPtr(srcLengthNext); - srcLengthNext++; - } - - if (codeOffset > pcOffset) { /* best cmd already found */ - break; - } else if (pcOffset <= codeEnd) { /* this cmd's code encloses pc */ - int dist = (pcOffset - codeOffset); - if (dist <= bestDist) { - bestDist = dist; - bestSrcOffset = srcOffset; - bestSrcLength = srcLen; - } - } - } - - if (bestDist == INT_MAX) { - return NULL; - } - - if (lengthPtr != NULL) { - *lengthPtr = bestSrcLength; - } - return (codePtr->source + bestSrcOffset); -} - -/* - *---------------------------------------------------------------------- - * - * GetExceptRangeForPc -- - * - * Given a program counter value, return the closest enclosing - * ExceptionRange. - * - * Results: - * In the normal case, catchOnly is 0 (false) and this procedure - * returns a pointer to the most closely enclosing ExceptionRange - * structure regardless of whether it is a loop or catch exception - * range. This is appropriate when processing a TCL_BREAK or - * TCL_CONTINUE, which will be "handled" either by a loop exception - * range or a closer catch range. If catchOnly is nonzero, this - * procedure ignores loop exception ranges and returns a pointer to the - * closest catch range. If no matching ExceptionRange is found that - * encloses pc, a NULL is returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static ExceptionRange * -GetExceptRangeForPc(pc, catchOnly, codePtr) - unsigned char *pc; /* The program counter value for which to - * search for a closest enclosing exception - * range. This points to a bytecode - * instruction in codePtr's code. */ - int catchOnly; /* If 0, consider either loop or catch - * ExceptionRanges in search. If nonzero - * consider only catch ranges (and ignore - * any closer loop ranges). */ - ByteCode* codePtr; /* Points to the ByteCode in which to search - * for the enclosing ExceptionRange. */ -{ - ExceptionRange *rangeArrayPtr; - int numRanges = codePtr->numExceptRanges; - register ExceptionRange *rangePtr; - int pcOffset = (pc - codePtr->codeStart); - register int i, level; - - if (numRanges == 0) { - return NULL; - } - rangeArrayPtr = codePtr->exceptArrayPtr; - - for (level = codePtr->maxExceptDepth; level >= 0; level--) { - for (i = 0; i < numRanges; i++) { - rangePtr = &(rangeArrayPtr[i]); - if (rangePtr->nestingLevel == level) { - int start = rangePtr->codeOffset; - int end = (start + rangePtr->numCodeBytes); - if ((start <= pcOffset) && (pcOffset < end)) { - if ((!catchOnly) - || (rangePtr->type == CATCH_EXCEPTION_RANGE)) { - return rangePtr; - } - } - } - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * GetOpcodeName -- - * - * This procedure is called by the TRACE and TRACE_WITH_OBJ macros - * used in TclExecuteByteCode when debugging. It returns the name of - * the bytecode instruction at a specified instruction pc. - * - * Results: - * A character string for the instruction. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_COMPILE_DEBUG -static char * -GetOpcodeName(pc) - unsigned char *pc; /* Points to the instruction whose name - * should be returned. */ -{ - unsigned char opCode = *pc; - - return instructionTable[opCode].name; -} -#endif /* TCL_COMPILE_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Math Functions -- - * - * This page contains the procedures that implement all of the - * built-in math functions for expressions. - * - * Results: - * Each procedure returns TCL_OK if it succeeds and pushes an - * Tcl object holding the result. If it fails it returns TCL_ERROR - * and leaves an error message in the interpreter's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -ExprUnaryFunc(interp, eePtr, clientData) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - ClientData clientData; /* Contains the address of a procedure that - * takes one double argument and returns a - * double result. */ -{ - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - register Tcl_Obj *valuePtr; - Tcl_ObjType *tPtr; - double d, dResult; - long i; - int length, result; - - double (*func) _ANSI_ARGS_((double)) = - (double (*)_ANSI_ARGS_((double))) clientData; - - /* - * Set stackPtr and stackTop from eePtr. - */ - - result = TCL_OK; - CACHE_STACK_INFO(); - - /* - * Pop the function's argument from the evaluation stack. Convert it - * to a double if necessary. - */ - - valuePtr = POP_OBJECT(); - tPtr = valuePtr->typePtr; - - if (tPtr == &tclIntType) { - d = (double) valuePtr->internalRep.longValue; - } else if (tPtr == &tclDoubleType) { - d = valuePtr->internalRep.doubleValue; - } else { - char *s = Tcl_GetStringFromObj(valuePtr, &length); - - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, valuePtr, &i); - d = (double) valuePtr->internalRep.longValue; - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, valuePtr, &d); - } - if (result != TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "argument to math function didn't have numeric value", -1); - goto done; - } - } - - errno = 0; - dResult = (*func)(d); - if ((errno != 0) || IS_NAN(dResult) || IS_INF(dResult)) { - TclExprFloatError(interp, dResult); - result = TCL_ERROR; - goto done; - } - - /* - * Push a Tcl object holding the result. - */ - - PUSH_OBJECT(Tcl_NewDoubleObj(dResult)); - - /* - * Reflect the change to stackTop back in eePtr. - */ - - done: - Tcl_DecrRefCount(valuePtr); - DECACHE_STACK_INFO(); - return result; -} - -static int -ExprBinaryFunc(interp, eePtr, clientData) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - ClientData clientData; /* Contains the address of a procedure that - * takes two double arguments and - * returns a double result. */ -{ - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - register Tcl_Obj *valuePtr, *value2Ptr; - Tcl_ObjType *tPtr; - double d1, d2, dResult; - long i; - char *s; - int length, result; - - double (*func) _ANSI_ARGS_((double, double)) - = (double (*)_ANSI_ARGS_((double, double))) clientData; - - /* - * Set stackPtr and stackTop from eePtr. - */ - - result = TCL_OK; - CACHE_STACK_INFO(); - - /* - * Pop the function's two arguments from the evaluation stack. Convert - * them to doubles if necessary. - */ - - value2Ptr = POP_OBJECT(); - valuePtr = POP_OBJECT(); - - tPtr = valuePtr->typePtr; - if (tPtr == &tclIntType) { - d1 = (double) valuePtr->internalRep.longValue; - } else if (tPtr == &tclDoubleType) { - d1 = valuePtr->internalRep.doubleValue; - } else { - s = Tcl_GetStringFromObj(valuePtr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, valuePtr, &i); - d1 = (double) valuePtr->internalRep.longValue; - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, valuePtr, &d1); - } - if (result != TCL_OK) { - badArg: - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "argument to math function didn't have numeric value", -1); - goto done; - } - } - - tPtr = value2Ptr->typePtr; - if (tPtr == &tclIntType) { - d2 = value2Ptr->internalRep.longValue; - } else if (tPtr == &tclDoubleType) { - d2 = value2Ptr->internalRep.doubleValue; - } else { - s = Tcl_GetStringFromObj(value2Ptr, &length); - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, value2Ptr, &i); - d2 = (double) value2Ptr->internalRep.longValue; - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, value2Ptr, &d2); - } - if (result != TCL_OK) { - goto badArg; - } - } - - errno = 0; - dResult = (*func)(d1, d2); - if ((errno != 0) || IS_NAN(dResult) || IS_INF(dResult)) { - TclExprFloatError(interp, dResult); - result = TCL_ERROR; - goto done; - } - - /* - * Push a Tcl object holding the result. - */ - - PUSH_OBJECT(Tcl_NewDoubleObj(dResult)); - - /* - * Reflect the change to stackTop back in eePtr. - */ - - done: - Tcl_DecrRefCount(valuePtr); - Tcl_DecrRefCount(value2Ptr); - DECACHE_STACK_INFO(); - return result; -} - -static int -ExprAbsFunc(interp, eePtr, clientData) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - ClientData clientData; /* Ignored. */ -{ - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - register Tcl_Obj *valuePtr; - Tcl_ObjType *tPtr; - long i, iResult; - double d, dResult; - int length, result; - - /* - * Set stackPtr and stackTop from eePtr. - */ - - result = TCL_OK; - CACHE_STACK_INFO(); - - /* - * Pop the argument from the evaluation stack. - */ - - valuePtr = POP_OBJECT(); - tPtr = valuePtr->typePtr; - - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - } else if (tPtr == &tclDoubleType) { - d = valuePtr->internalRep.doubleValue; - } else { - char *s = Tcl_GetStringFromObj(valuePtr, &length); - - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, valuePtr, &i); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, valuePtr, &d); - } - if (result != TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "argument to math function didn't have numeric value", -1); - goto done; - } - tPtr = valuePtr->typePtr; - } - - /* - * Push a Tcl object with the result. - */ - - if (tPtr == &tclIntType) { - if (i < 0) { - iResult = -i; - if (iResult < 0) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "integer value too large to represent", -1); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", - "integer value too large to represent", (char *) NULL); - result = TCL_ERROR; - goto done; - } - } else { - iResult = i; - } - PUSH_OBJECT(Tcl_NewLongObj(iResult)); - } else { - if (d < 0.0) { - dResult = -d; - } else { - dResult = d; - } - if (IS_NAN(dResult) || IS_INF(dResult)) { - TclExprFloatError(interp, dResult); - result = TCL_ERROR; - goto done; - } - PUSH_OBJECT(Tcl_NewDoubleObj(dResult)); - } - - /* - * Reflect the change to stackTop back in eePtr. - */ - - done: - Tcl_DecrRefCount(valuePtr); - DECACHE_STACK_INFO(); - return result; -} - -static int -ExprDoubleFunc(interp, eePtr, clientData) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - ClientData clientData; /* Ignored. */ -{ - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - register Tcl_Obj *valuePtr; - double dResult; - long i; - int length, result; - - /* - * Set stackPtr and stackTop from eePtr. - */ - - result = TCL_OK; - CACHE_STACK_INFO(); - - /* - * Pop the argument from the evaluation stack. - */ - - valuePtr = POP_OBJECT(); - if (valuePtr->typePtr == &tclIntType) { - dResult = (double) valuePtr->internalRep.longValue; - } else if (valuePtr->typePtr == &tclDoubleType) { - dResult = valuePtr->internalRep.doubleValue; - } else { - char *s = Tcl_GetStringFromObj(valuePtr, &length); - - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, valuePtr, &i); - dResult = (double) valuePtr->internalRep.longValue; - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, valuePtr, - &dResult); - } - if (result != TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "argument to math function didn't have numeric value", -1); - goto done; - } - } - - /* - * Push a Tcl object with the result. - */ - - PUSH_OBJECT(Tcl_NewDoubleObj(dResult)); - - /* - * Reflect the change to stackTop back in eePtr. - */ - - done: - Tcl_DecrRefCount(valuePtr); - DECACHE_STACK_INFO(); - return result; -} - -static int -ExprIntFunc(interp, eePtr, clientData) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - ClientData clientData; /* Ignored. */ -{ - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - register Tcl_Obj *valuePtr; - Tcl_ObjType *tPtr; - long i = 0; /* Initialized to avoid compiler warning. */ - long iResult; - double d; - int length, result; - - /* - * Set stackPtr and stackTop from eePtr. - */ - - result = TCL_OK; - CACHE_STACK_INFO(); - - /* - * Pop the argument from the evaluation stack. - */ - - valuePtr = POP_OBJECT(); - tPtr = valuePtr->typePtr; - - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - } else if (tPtr == &tclDoubleType) { - d = valuePtr->internalRep.doubleValue; - } else { - char *s = Tcl_GetStringFromObj(valuePtr, &length); - - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, valuePtr, &i); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, valuePtr, &d); - } - if (result != TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "argument to math function didn't have numeric value", -1); - goto done; - } - tPtr = valuePtr->typePtr; - } - - /* - * Push a Tcl object with the result. - */ - - if (tPtr == &tclIntType) { - iResult = i; - } else { - if (d < 0.0) { - if (d < (double) (long) LONG_MIN) { - tooLarge: - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "integer value too large to represent", -1); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", - "integer value too large to represent", (char *) NULL); - result = TCL_ERROR; - goto done; - } - } else { - if (d > (double) LONG_MAX) { - goto tooLarge; - } - } - if (IS_NAN(d) || IS_INF(d)) { - TclExprFloatError(interp, d); - result = TCL_ERROR; - goto done; - } - iResult = (long) d; - } - PUSH_OBJECT(Tcl_NewLongObj(iResult)); - - /* - * Reflect the change to stackTop back in eePtr. - */ - - done: - Tcl_DecrRefCount(valuePtr); - DECACHE_STACK_INFO(); - return result; -} - -static int -ExprRandFunc(interp, eePtr, clientData) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - ClientData clientData; /* Ignored. */ -{ - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - Interp *iPtr = (Interp *) interp; - double dResult; - int tmp; - - if (!(iPtr->flags & RAND_SEED_INITIALIZED)) { - iPtr->flags |= RAND_SEED_INITIALIZED; - iPtr->randSeed = TclpGetClicks(); - } - - /* - * Set stackPtr and stackTop from eePtr. - */ - - CACHE_STACK_INFO(); - - /* - * Generate the random number using the linear congruential - * generator defined by the following recurrence: - * seed = ( IA * seed ) mod IM - * where IA is 16807 and IM is (2^31) - 1. In order to avoid - * potential problems with integer overflow, the code uses - * additional constants IQ and IR such that - * IM = IA*IQ + IR - * For details on how this algorithm works, refer to the following - * papers: - * - * S.K. Park & K.W. Miller, "Random number generators: good ones - * are hard to find," Comm ACM 31(10):1192-1201, Oct 1988 - * - * W.H. Press & S.A. Teukolsky, "Portable random number - * generators," Computers in Physics 6(5):522-524, Sep/Oct 1992. - */ - -#define RAND_IA 16807 -#define RAND_IM 2147483647 -#define RAND_IQ 127773 -#define RAND_IR 2836 -#define RAND_MASK 123459876 - - if (iPtr->randSeed == 0) { - /* - * Don't allow a 0 seed, since it breaks the generator. Shift - * it to some other value. - */ - - iPtr->randSeed = 123459876; - } - tmp = iPtr->randSeed/RAND_IQ; - iPtr->randSeed = RAND_IA*(iPtr->randSeed - tmp*RAND_IQ) - RAND_IR*tmp; - if (iPtr->randSeed < 0) { - iPtr->randSeed += RAND_IM; - } - - /* - * On 64-bit architectures we need to mask off the upper bits to - * ensure we only have a 32-bit range. The constant has the - * bizarre form below in order to make sure that it doesn't - * get sign-extended (the rules for sign extension are very - * concat, particularly on 64-bit machines). - */ - - iPtr->randSeed &= ((((unsigned long) 0xfffffff) << 4) | 0xf); - dResult = iPtr->randSeed * (1.0/RAND_IM); - - /* - * Push a Tcl object with the result. - */ - - PUSH_OBJECT(Tcl_NewDoubleObj(dResult)); - - /* - * Reflect the change to stackTop back in eePtr. - */ - - DECACHE_STACK_INFO(); - return TCL_OK; -} - -static int -ExprRoundFunc(interp, eePtr, clientData) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - ClientData clientData; /* Ignored. */ -{ - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - Tcl_Obj *valuePtr; - Tcl_ObjType *tPtr; - long i = 0; /* Initialized to avoid compiler warning. */ - long iResult; - double d, temp; - int length, result; - - /* - * Set stackPtr and stackTop from eePtr. - */ - - result = TCL_OK; - CACHE_STACK_INFO(); - - /* - * Pop the argument from the evaluation stack. - */ - - valuePtr = POP_OBJECT(); - tPtr = valuePtr->typePtr; - - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - } else if (tPtr == &tclDoubleType) { - d = valuePtr->internalRep.doubleValue; - } else { - char *s = Tcl_GetStringFromObj(valuePtr, &length); - - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, valuePtr, &i); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, valuePtr, &d); - } - if (result != TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "argument to math function didn't have numeric value", -1); - goto done; - } - tPtr = valuePtr->typePtr; - } - - /* - * Push a Tcl object with the result. - */ - - if (tPtr == &tclIntType) { - iResult = i; - } else { - if (d < 0.0) { - if (d <= (((double) (long) LONG_MIN) - 0.5)) { - tooLarge: - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "integer value too large to represent", -1); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", - "integer value too large to represent", - (char *) NULL); - result = TCL_ERROR; - goto done; - } - temp = (long) (d - 0.5); - } else { - if (d >= (((double) LONG_MAX + 0.5))) { - goto tooLarge; - } - temp = (long) (d + 0.5); - } - if (IS_NAN(temp) || IS_INF(temp)) { - TclExprFloatError(interp, temp); - result = TCL_ERROR; - goto done; - } - iResult = (long) temp; - } - PUSH_OBJECT(Tcl_NewLongObj(iResult)); - - /* - * Reflect the change to stackTop back in eePtr. - */ - - done: - Tcl_DecrRefCount(valuePtr); - DECACHE_STACK_INFO(); - return result; -} - -static int -ExprSrandFunc(interp, eePtr, clientData) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - ClientData clientData; /* Ignored. */ -{ - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - Interp *iPtr = (Interp *) interp; - Tcl_Obj *valuePtr; - Tcl_ObjType *tPtr; - long i = 0; /* Initialized to avoid compiler warning. */ - int isDouble, result; - - /* - * Set stackPtr and stackTop from eePtr. - */ - - CACHE_STACK_INFO(); - - /* - * Pop the argument from the evaluation stack. Use the value - * to reset the random number seed. - */ - - valuePtr = POP_OBJECT(); - tPtr = valuePtr->typePtr; - - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - } else { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, valuePtr, &i); - if (result != TCL_OK) { - /* - * See if the operand can be interpreted as a double in order to - * improve the error message. - */ - - isDouble = 1; - if (valuePtr->typePtr != &tclDoubleType) { - char *s = Tcl_GetString(valuePtr); - double d; - - if (Tcl_GetDouble((Tcl_Interp *) NULL, s, &d) != TCL_OK) { - isDouble = 0; - } - } - - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "can't use ", - (isDouble? "floating-point value":"non-numeric string"), - " as argument to srand", (char *) NULL); - Tcl_DecrRefCount(valuePtr); - DECACHE_STACK_INFO(); - return result; - } - } - - /* - * Reset the seed. - */ - - iPtr->flags |= RAND_SEED_INITIALIZED; - iPtr->randSeed = i; - - /* - * To avoid duplicating the random number generation code we simply - * clean up our state and call the real random number function. That - * function will always succeed. - */ - - Tcl_DecrRefCount(valuePtr); - DECACHE_STACK_INFO(); - - ExprRandFunc(interp, eePtr, clientData); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ExprCallMathFunc -- - * - * This procedure is invoked to call a non-builtin math function - * during the execution of an expression. - * - * Results: - * TCL_OK is returned if all went well and the function's value - * was computed successfully. If an error occurred, TCL_ERROR - * is returned and an error message is left in the interpreter's - * result. After a successful return this procedure pushes a Tcl object - * holding the result. - * - * Side effects: - * None, unless the called math function has side effects. - * - *---------------------------------------------------------------------- - */ - -static int -ExprCallMathFunc(interp, eePtr, objc, objv) - Tcl_Interp *interp; /* The interpreter in which to execute the - * function. */ - ExecEnv *eePtr; /* Points to the environment for executing - * the function. */ - int objc; /* Number of arguments. The function name is - * the 0-th argument. */ - Tcl_Obj **objv; /* The array of arguments. The function name - * is objv[0]. */ -{ - Interp *iPtr = (Interp *) interp; - Tcl_Obj **stackPtr; /* Cached evaluation stack base pointer. */ - register int stackTop; /* Cached top index of evaluation stack. */ - char *funcName; - Tcl_HashEntry *hPtr; - MathFunc *mathFuncPtr; /* Information about math function. */ - Tcl_Value args[MAX_MATH_ARGS]; /* Arguments for function call. */ - Tcl_Value funcResult; /* Result of function call as Tcl_Value. */ - register Tcl_Obj *valuePtr; - Tcl_ObjType *tPtr; - long i; - double d; - int j, k, length, result; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - Tcl_ResetResult(interp); - - /* - * Set stackPtr and stackTop from eePtr. - */ - - CACHE_STACK_INFO(); - - /* - * Look up the MathFunc record for the function. - */ - - funcName = Tcl_GetString(objv[0]); - hPtr = Tcl_FindHashEntry(&iPtr->mathFuncTable, funcName); - if (hPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown math function \"", funcName, "\"", (char *) NULL); - result = TCL_ERROR; - goto done; - } - mathFuncPtr = (MathFunc *) Tcl_GetHashValue(hPtr); - if (mathFuncPtr->numArgs != (objc-1)) { - panic("ExprCallMathFunc: expected number of args %d != actual number %d", - mathFuncPtr->numArgs, objc); - result = TCL_ERROR; - goto done; - } - - /* - * Collect the arguments for the function, if there are any, into the - * array "args". Note that args[0] will have the Tcl_Value that - * corresponds to objv[1]. - */ - - for (j = 1, k = 0; j < objc; j++, k++) { - valuePtr = objv[j]; - tPtr = valuePtr->typePtr; - - if (tPtr == &tclIntType) { - i = valuePtr->internalRep.longValue; - } else if (tPtr == &tclDoubleType) { - d = valuePtr->internalRep.doubleValue; - } else { - /* - * Try to convert to int first then double. - */ - - char *s = Tcl_GetStringFromObj(valuePtr, &length); - - if (TclLooksLikeInt(s, length)) { - result = Tcl_GetLongFromObj((Tcl_Interp *) NULL, valuePtr, &i); - } else { - result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, - valuePtr, &d); - } - if (result != TCL_OK) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "argument to math function didn't have numeric value", -1); - goto done; - } - tPtr = valuePtr->typePtr; - } - - /* - * Copy the object's numeric value to the argument record, - * converting it if necessary. - */ - - if (tPtr == &tclIntType) { - if (mathFuncPtr->argTypes[k] == TCL_DOUBLE) { - args[k].type = TCL_DOUBLE; - args[k].doubleValue = i; - } else { - args[k].type = TCL_INT; - args[k].intValue = i; - } - } else { - if (mathFuncPtr->argTypes[k] == TCL_INT) { - args[k].type = TCL_INT; - args[k].intValue = (long) d; - } else { - args[k].type = TCL_DOUBLE; - args[k].doubleValue = d; - } - } - } - - /* - * Invoke the function and copy its result back into valuePtr. - */ - - tsdPtr->mathInProgress++; - result = (*mathFuncPtr->proc)(mathFuncPtr->clientData, interp, args, - &funcResult); - tsdPtr->mathInProgress--; - if (result != TCL_OK) { - goto done; - } - - /* - * Pop the objc top stack elements and decrement their ref counts. - */ - - i = (stackTop - (objc-1)); - while (i <= stackTop) { - valuePtr = stackPtr[i]; - Tcl_DecrRefCount(valuePtr); - i++; - } - stackTop -= objc; - - /* - * Push the call's object result. - */ - - if (funcResult.type == TCL_INT) { - PUSH_OBJECT(Tcl_NewLongObj(funcResult.intValue)); - } else { - d = funcResult.doubleValue; - if (IS_NAN(d) || IS_INF(d)) { - TclExprFloatError(interp, d); - result = TCL_ERROR; - goto done; - } - PUSH_OBJECT(Tcl_NewDoubleObj(d)); - } - - /* - * Reflect the change to stackTop back in eePtr. - */ - - done: - DECACHE_STACK_INFO(); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclExprFloatError -- - * - * This procedure is called when an error occurs during a - * floating-point operation. It reads errno and sets - * interp->objResultPtr accordingly. - * - * Results: - * interp->objResultPtr is set to hold an error message. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -TclExprFloatError(interp, value) - Tcl_Interp *interp; /* Where to store error message. */ - double value; /* Value returned after error; used to - * distinguish underflows from overflows. */ -{ - char *s; - - Tcl_ResetResult(interp); - if ((errno == EDOM) || (value != value)) { - s = "domain error: argument not in valid range"; - Tcl_AppendToObj(Tcl_GetObjResult(interp), s, -1); - Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", s, (char *) NULL); - } else if ((errno == ERANGE) || IS_INF(value)) { - if (value == 0.0) { - s = "floating-point value too small to represent"; - Tcl_AppendToObj(Tcl_GetObjResult(interp), s, -1); - Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", s, (char *) NULL); - } else { - s = "floating-point value too large to represent"; - Tcl_AppendToObj(Tcl_GetObjResult(interp), s, -1); - Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", s, (char *) NULL); - } - } else { - char msg[64 + TCL_INTEGER_SPACE]; - - sprintf(msg, "unknown floating-point error, errno = %d", errno); - Tcl_AppendToObj(Tcl_GetObjResult(interp), msg, -1); - Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", msg, (char *) NULL); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclMathInProgress -- - * - * This procedure is called to find out if Tcl is doing math - * in this thread. - * - * Results: - * 0 or 1. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclMathInProgress() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - return tsdPtr->mathInProgress; -} - -#ifdef TCL_COMPILE_STATS -/* - *---------------------------------------------------------------------- - * - * TclLog2 -- - * - * Procedure used while collecting compilation statistics to determine - * the log base 2 of an integer. - * - * Results: - * Returns the log base 2 of the operand. If the argument is less - * than or equal to zero, a zero is returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclLog2(value) - register int value; /* The integer for which to compute the - * log base 2. */ -{ - register int n = value; - register int result = 0; - - while (n > 1) { - n = n >> 1; - result++; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * EvalStatsCmd -- - * - * Implements the "evalstats" command that prints instruction execution - * counts to stdout. - * - * Results: - * Standard Tcl results. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -EvalStatsCmd(unused, interp, argc, argv) - ClientData unused; /* Unused. */ - Tcl_Interp *interp; /* The current interpreter. */ - int argc; /* The number of arguments. */ - char **argv; /* The argument strings. */ -{ - Interp *iPtr = (Interp *) interp; - LiteralTable *globalTablePtr = &(iPtr->literalTable); - ByteCodeStats *statsPtr = &(iPtr->stats); - double totalCodeBytes, currentCodeBytes; - double totalLiteralBytes, currentLiteralBytes; - double objBytesIfUnshared, strBytesIfUnshared, sharingBytesSaved; - double strBytesSharedMultX, strBytesSharedOnce; - double numInstructions, currentHeaderBytes; - long numCurrentByteCodes, numByteCodeLits; - long refCountSum, literalMgmtBytes, sum; - int numSharedMultX, numSharedOnce; - int decadeHigh, minSizeDecade, maxSizeDecade, length, i; - char *litTableStats; - LiteralEntry *entryPtr; - - numInstructions = 0.0; - for (i = 0; i < 256; i++) { - if (statsPtr->instructionCount[i] != 0) { - numInstructions += statsPtr->instructionCount[i]; - } - } - - totalLiteralBytes = sizeof(LiteralTable) - + iPtr->literalTable.numBuckets * sizeof(LiteralEntry *) - + (statsPtr->numLiteralsCreated * sizeof(LiteralEntry)) - + (statsPtr->numLiteralsCreated * sizeof(Tcl_Obj)) - + statsPtr->totalLitStringBytes; - totalCodeBytes = statsPtr->totalByteCodeBytes + totalLiteralBytes; - - numCurrentByteCodes = - statsPtr->numCompilations - statsPtr->numByteCodesFreed; - currentHeaderBytes = numCurrentByteCodes - * (sizeof(ByteCode) - (sizeof(size_t) + sizeof(Tcl_Time))); - literalMgmtBytes = sizeof(LiteralTable) - + (iPtr->literalTable.numBuckets * sizeof(LiteralEntry *)) - + (iPtr->literalTable.numEntries * sizeof(LiteralEntry)); - currentLiteralBytes = literalMgmtBytes - + iPtr->literalTable.numEntries * sizeof(Tcl_Obj) - + statsPtr->currentLitStringBytes; - currentCodeBytes = statsPtr->currentByteCodeBytes + currentLiteralBytes; - - /* - * Summary statistics, total and current source and ByteCode sizes. - */ - - fprintf(stdout, "\n----------------------------------------------------------------\n"); - fprintf(stdout, - "Compilation and execution statistics for interpreter 0x%x\n", - (unsigned int) iPtr); - - fprintf(stdout, "\nNumber ByteCodes executed %ld\n", - statsPtr->numExecutions); - fprintf(stdout, "Number ByteCodes compiled %ld\n", - statsPtr->numCompilations); - fprintf(stdout, " Mean executions/compile %.1f\n", - ((float)statsPtr->numExecutions) / ((float)statsPtr->numCompilations)); - - fprintf(stdout, "\nInstructions executed %.0f\n", - numInstructions); - fprintf(stdout, " Mean inst/compile %.0f\n", - numInstructions / statsPtr->numCompilations); - fprintf(stdout, " Mean inst/execution %.0f\n", - numInstructions / statsPtr->numExecutions); - - fprintf(stdout, "\nTotal ByteCodes %ld\n", - statsPtr->numCompilations); - fprintf(stdout, " Source bytes %.6g\n", - statsPtr->totalSrcBytes); - fprintf(stdout, " Code bytes %.6g\n", - totalCodeBytes); - fprintf(stdout, " ByteCode bytes %.6g\n", - statsPtr->totalByteCodeBytes); - fprintf(stdout, " Literal bytes %.6g\n", - totalLiteralBytes); - fprintf(stdout, " table %d + bkts %d + entries %ld + objects %ld + strings %.6g\n", - sizeof(LiteralTable), - iPtr->literalTable.numBuckets * sizeof(LiteralEntry *), - statsPtr->numLiteralsCreated * sizeof(LiteralEntry), - statsPtr->numLiteralsCreated * sizeof(Tcl_Obj), - statsPtr->totalLitStringBytes); - fprintf(stdout, " Mean code/compile %.1f\n", - totalCodeBytes / statsPtr->numCompilations); - fprintf(stdout, " Mean code/source %.1f\n", - totalCodeBytes / statsPtr->totalSrcBytes); - - fprintf(stdout, "\nCurrent ByteCodes %ld\n", - numCurrentByteCodes); - fprintf(stdout, " Source bytes %.6g\n", - statsPtr->currentSrcBytes); - fprintf(stdout, " Code bytes %.6g\n", - currentCodeBytes); - fprintf(stdout, " ByteCode bytes %.6g\n", - statsPtr->currentByteCodeBytes); - fprintf(stdout, " Literal bytes %.6g\n", - currentLiteralBytes); - fprintf(stdout, " table %d + bkts %d + entries %d + objects %d + strings %.6g\n", - sizeof(LiteralTable), - iPtr->literalTable.numBuckets * sizeof(LiteralEntry *), - iPtr->literalTable.numEntries * sizeof(LiteralEntry), - iPtr->literalTable.numEntries * sizeof(Tcl_Obj), - statsPtr->currentLitStringBytes); - fprintf(stdout, " Mean code/source %.1f\n", - currentCodeBytes / statsPtr->currentSrcBytes); - fprintf(stdout, " Code + source bytes %.6g (%0.1f mean code/src)\n", - (currentCodeBytes + statsPtr->currentSrcBytes), - (currentCodeBytes / statsPtr->currentSrcBytes) + 1.0); - - /* - * Literal table statistics. - */ - - numByteCodeLits = 0; - refCountSum = 0; - numSharedMultX = 0; - numSharedOnce = 0; - objBytesIfUnshared = 0.0; - strBytesIfUnshared = 0.0; - strBytesSharedMultX = 0.0; - strBytesSharedOnce = 0.0; - for (i = 0; i < globalTablePtr->numBuckets; i++) { - for (entryPtr = globalTablePtr->buckets[i]; entryPtr != NULL; - entryPtr = entryPtr->nextPtr) { - if (entryPtr->objPtr->typePtr == &tclByteCodeType) { - numByteCodeLits++; - } - (void) Tcl_GetStringFromObj(entryPtr->objPtr, &length); - refCountSum += entryPtr->refCount; - objBytesIfUnshared += (entryPtr->refCount * sizeof(Tcl_Obj)); - strBytesIfUnshared += (entryPtr->refCount * (length+1)); - if (entryPtr->refCount > 1) { - numSharedMultX++; - strBytesSharedMultX += (length+1); - } else { - numSharedOnce++; - strBytesSharedOnce += (length+1); - } - } - } - sharingBytesSaved = (objBytesIfUnshared + strBytesIfUnshared) - - currentLiteralBytes; - - fprintf(stdout, "\nTotal objects (all interps) %ld\n", - tclObjsAlloced); - fprintf(stdout, "Current objects %ld\n", - (tclObjsAlloced - tclObjsFreed)); - fprintf(stdout, "Total literal objects %ld\n", - statsPtr->numLiteralsCreated); - - fprintf(stdout, "\nCurrent literal objects %d (%0.1f%% of current objects)\n", - globalTablePtr->numEntries, - (globalTablePtr->numEntries * 100.0) / (tclObjsAlloced-tclObjsFreed)); - fprintf(stdout, " ByteCode literals %ld (%0.1f%% of current literals)\n", - numByteCodeLits, - (numByteCodeLits * 100.0) / globalTablePtr->numEntries); - fprintf(stdout, " Literals reused > 1x %d\n", - numSharedMultX); - fprintf(stdout, " Mean reference count %.2f\n", - ((double) refCountSum) / globalTablePtr->numEntries); - fprintf(stdout, " Mean len, str reused >1x %.2f\n", - (numSharedMultX? (strBytesSharedMultX/numSharedMultX) : 0.0)); - fprintf(stdout, " Mean len, str used 1x %.2f\n", - (numSharedOnce? (strBytesSharedOnce/numSharedOnce) : 0.0)); - fprintf(stdout, " Total sharing savings %.6g (%0.1f%% of bytes if no sharing)\n", - sharingBytesSaved, - (sharingBytesSaved * 100.0) / (objBytesIfUnshared + strBytesIfUnshared)); - fprintf(stdout, " Bytes with sharing %.6g\n", - currentLiteralBytes); - fprintf(stdout, " table %d + bkts %d + entries %d + objects %d + strings %.6g\n", - sizeof(LiteralTable), - iPtr->literalTable.numBuckets * sizeof(LiteralEntry *), - iPtr->literalTable.numEntries * sizeof(LiteralEntry), - iPtr->literalTable.numEntries * sizeof(Tcl_Obj), - statsPtr->currentLitStringBytes); - fprintf(stdout, " Bytes if no sharing %.6g = objects %.6g + strings %.6g\n", - (objBytesIfUnshared + strBytesIfUnshared), - objBytesIfUnshared, strBytesIfUnshared); - fprintf(stdout, " String sharing savings %.6g = unshared %.6g - shared %.6g\n", - (strBytesIfUnshared - statsPtr->currentLitStringBytes), - strBytesIfUnshared, statsPtr->currentLitStringBytes); - fprintf(stdout, " Literal mgmt overhead %ld (%0.1f%% of bytes with sharing)\n", - literalMgmtBytes, - (literalMgmtBytes * 100.0) / currentLiteralBytes); - fprintf(stdout, " table %d + buckets %d + entries %d\n", - sizeof(LiteralTable), - iPtr->literalTable.numBuckets * sizeof(LiteralEntry *), - iPtr->literalTable.numEntries * sizeof(LiteralEntry)); - - /* - * Breakdown of current ByteCode space requirements. - */ - - fprintf(stdout, "\nBreakdown of current ByteCode requirements:\n"); - fprintf(stdout, " Bytes Pct of Avg per\n"); - fprintf(stdout, " total ByteCode\n"); - fprintf(stdout, "Total %12.6g 100.00%% %8.1f\n", - statsPtr->currentByteCodeBytes, - statsPtr->currentByteCodeBytes / numCurrentByteCodes); - fprintf(stdout, "Header %12.6g %8.1f%% %8.1f\n", - currentHeaderBytes, - ((currentHeaderBytes * 100.0) / statsPtr->currentByteCodeBytes), - currentHeaderBytes / numCurrentByteCodes); - fprintf(stdout, "Instructions %12.6g %8.1f%% %8.1f\n", - statsPtr->currentInstBytes, - ((statsPtr->currentInstBytes * 100.0) / statsPtr->currentByteCodeBytes), - statsPtr->currentInstBytes / numCurrentByteCodes); - fprintf(stdout, "Literal ptr array %12.6g %8.1f%% %8.1f\n", - statsPtr->currentLitBytes, - ((statsPtr->currentLitBytes * 100.0) / statsPtr->currentByteCodeBytes), - statsPtr->currentLitBytes / numCurrentByteCodes); - fprintf(stdout, "Exception table %12.6g %8.1f%% %8.1f\n", - statsPtr->currentExceptBytes, - ((statsPtr->currentExceptBytes * 100.0) / statsPtr->currentByteCodeBytes), - statsPtr->currentExceptBytes / numCurrentByteCodes); - fprintf(stdout, "Auxiliary data %12.6g %8.1f%% %8.1f\n", - statsPtr->currentAuxBytes, - ((statsPtr->currentAuxBytes * 100.0) / statsPtr->currentByteCodeBytes), - statsPtr->currentAuxBytes / numCurrentByteCodes); - fprintf(stdout, "Command map %12.6g %8.1f%% %8.1f\n", - statsPtr->currentCmdMapBytes, - ((statsPtr->currentCmdMapBytes * 100.0) / statsPtr->currentByteCodeBytes), - statsPtr->currentCmdMapBytes / numCurrentByteCodes); - - /* - * Detailed literal statistics. - */ - - fprintf(stdout, "\nLiteral string sizes:\n"); - fprintf(stdout, " Up to length Percentage\n"); - maxSizeDecade = 0; - for (i = 31; i >= 0; i--) { - if (statsPtr->literalCount[i] > 0) { - maxSizeDecade = i; - break; - } - } - sum = 0; - for (i = 0; i <= maxSizeDecade; i++) { - decadeHigh = (1 << (i+1)) - 1; - sum += statsPtr->literalCount[i]; - fprintf(stdout, " %10d %8.0f%%\n", - decadeHigh, (sum * 100.0) / statsPtr->numLiteralsCreated); - } - - litTableStats = TclLiteralStats(globalTablePtr); - fprintf(stdout, "\nCurrent literal table statistics:\n%s\n", - litTableStats); - ckfree((char *) litTableStats); - - /* - * Source and ByteCode size distributions. - */ - - fprintf(stdout, "\nSource sizes:\n"); - fprintf(stdout, " Up to size Percentage\n"); - minSizeDecade = maxSizeDecade = 0; - for (i = 0; i < 31; i++) { - if (statsPtr->srcCount[i] > 0) { - minSizeDecade = i; - break; - } - } - for (i = 31; i >= 0; i--) { - if (statsPtr->srcCount[i] > 0) { - maxSizeDecade = i; - break; - } - } - sum = 0; - for (i = minSizeDecade; i <= maxSizeDecade; i++) { - decadeHigh = (1 << (i+1)) - 1; - sum += statsPtr->srcCount[i]; - fprintf(stdout, " %10d %8.0f%%\n", - decadeHigh, (sum * 100.0) / statsPtr->numCompilations); - } - - fprintf(stdout, "\nByteCode sizes:\n"); - fprintf(stdout, " Up to size Percentage\n"); - minSizeDecade = maxSizeDecade = 0; - for (i = 0; i < 31; i++) { - if (statsPtr->byteCodeCount[i] > 0) { - minSizeDecade = i; - break; - } - } - for (i = 31; i >= 0; i--) { - if (statsPtr->byteCodeCount[i] > 0) { - maxSizeDecade = i; - break; - } - } - sum = 0; - for (i = minSizeDecade; i <= maxSizeDecade; i++) { - decadeHigh = (1 << (i+1)) - 1; - sum += statsPtr->byteCodeCount[i]; - fprintf(stdout, " %10d %8.0f%%\n", - decadeHigh, (sum * 100.0) / statsPtr->numCompilations); - } - - fprintf(stdout, "\nByteCode longevity (excludes current ByteCodes):\n"); - fprintf(stdout, " Up to ms Percentage\n"); - minSizeDecade = maxSizeDecade = 0; - for (i = 0; i < 31; i++) { - if (statsPtr->lifetimeCount[i] > 0) { - minSizeDecade = i; - break; - } - } - for (i = 31; i >= 0; i--) { - if (statsPtr->lifetimeCount[i] > 0) { - maxSizeDecade = i; - break; - } - } - sum = 0; - for (i = minSizeDecade; i <= maxSizeDecade; i++) { - decadeHigh = (1 << (i+1)) - 1; - sum += statsPtr->lifetimeCount[i]; - fprintf(stdout, " %12.3f %8.0f%%\n", - decadeHigh / 1000.0, - (sum * 100.0) / statsPtr->numByteCodesFreed); - } - - /* - * Instruction counts. - */ - - fprintf(stdout, "\nInstruction counts:\n"); - for (i = 0; i <= LAST_INST_OPCODE; i++) { - if (statsPtr->instructionCount[i]) { - fprintf(stdout, "%20s %8ld %6.1f%%\n", - instructionTable[i].name, - statsPtr->instructionCount[i], - (statsPtr->instructionCount[i]*100.0) / numInstructions); - } - } - - fprintf(stdout, "\nInstructions NEVER executed:\n"); - for (i = 0; i <= LAST_INST_OPCODE; i++) { - if (statsPtr->instructionCount[i] == 0) { - fprintf(stdout, "%20s\n", - instructionTable[i].name); - } - } - -#ifdef TCL_MEM_DEBUG - fprintf(stdout, "\nHeap Statistics:\n"); - TclDumpMemoryInfo(stdout); -#endif - fprintf(stdout, "\n----------------------------------------------------------------\n"); - return TCL_OK; -} -#endif /* TCL_COMPILE_STATS */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetCommandFromObj -- - * - * Returns the command specified by the name in a Tcl_Obj. - * - * Results: - * Returns a token for the command if it is found. Otherwise, if it - * can't be found or there is an error, returns NULL. - * - * Side effects: - * May update the internal representation for the object, caching - * the command reference so that the next time this procedure is - * called with the same object, the command can be found quickly. - * - *---------------------------------------------------------------------- - */ - -Tcl_Command -Tcl_GetCommandFromObj(interp, objPtr) - Tcl_Interp *interp; /* The interpreter in which to resolve the - * command and to report errors. */ - register Tcl_Obj *objPtr; /* The object containing the command's - * name. If the name starts with "::", will - * be looked up in global namespace. Else, - * looked up first in the current namespace - * if contextNsPtr is NULL, then in global - * namespace. */ -{ - Interp *iPtr = (Interp *) interp; - register ResolvedCmdName *resPtr; - register Command *cmdPtr; - Namespace *currNsPtr; - int result; - - /* - * Get the internal representation, converting to a command type if - * needed. The internal representation is a ResolvedCmdName that points - * to the actual command. - */ - - if (objPtr->typePtr != &tclCmdNameType) { - result = tclCmdNameType.setFromAnyProc(interp, objPtr); - if (result != TCL_OK) { - return (Tcl_Command) NULL; - } - } - resPtr = (ResolvedCmdName *) objPtr->internalRep.otherValuePtr; - - /* - * Get the current namespace. - */ - - if (iPtr->varFramePtr != NULL) { - currNsPtr = iPtr->varFramePtr->nsPtr; - } else { - currNsPtr = iPtr->globalNsPtr; - } - - /* - * Check the context namespace and the namespace epoch of the resolved - * symbol to make sure that it is fresh. If not, then force another - * conversion to the command type, to discard the old rep and create a - * new one. Note that we verify that the namespace id of the context - * namespace is the same as the one we cached; this insures that the - * namespace wasn't deleted and a new one created at the same address - * with the same command epoch. - */ - - cmdPtr = NULL; - if ((resPtr != NULL) - && (resPtr->refNsPtr == currNsPtr) - && (resPtr->refNsId == currNsPtr->nsId) - && (resPtr->refNsCmdEpoch == currNsPtr->cmdRefEpoch)) { - cmdPtr = resPtr->cmdPtr; - if (cmdPtr->cmdEpoch != resPtr->cmdEpoch) { - cmdPtr = NULL; - } - } - - if (cmdPtr == NULL) { - result = tclCmdNameType.setFromAnyProc(interp, objPtr); - if (result != TCL_OK) { - return (Tcl_Command) NULL; - } - resPtr = (ResolvedCmdName *) objPtr->internalRep.otherValuePtr; - if (resPtr != NULL) { - cmdPtr = resPtr->cmdPtr; - } - } - return (Tcl_Command) cmdPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclSetCmdNameObj -- - * - * Modify an object to be an CmdName object that refers to the argument - * Command structure. - * - * Results: - * None. - * - * Side effects: - * The object's old internal rep is freed. It's string rep is not - * changed. The refcount in the Command structure is incremented to - * keep it from being freed if the command is later deleted until - * TclExecuteByteCode has a chance to recognize that it was deleted. - * - *---------------------------------------------------------------------- - */ - -void -TclSetCmdNameObj(interp, objPtr, cmdPtr) - Tcl_Interp *interp; /* Points to interpreter containing command - * that should be cached in objPtr. */ - register Tcl_Obj *objPtr; /* Points to Tcl object to be changed to - * a CmdName object. */ - Command *cmdPtr; /* Points to Command structure that the - * CmdName object should refer to. */ -{ - Interp *iPtr = (Interp *) interp; - register ResolvedCmdName *resPtr; - Tcl_ObjType *oldTypePtr = objPtr->typePtr; - register Namespace *currNsPtr; - - if (oldTypePtr == &tclCmdNameType) { - return; - } - - /* - * Get the current namespace. - */ - - if (iPtr->varFramePtr != NULL) { - currNsPtr = iPtr->varFramePtr->nsPtr; - } else { - currNsPtr = iPtr->globalNsPtr; - } - - cmdPtr->refCount++; - resPtr = (ResolvedCmdName *) ckalloc(sizeof(ResolvedCmdName)); - resPtr->cmdPtr = cmdPtr; - resPtr->refNsPtr = currNsPtr; - resPtr->refNsId = currNsPtr->nsId; - resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; - resPtr->cmdEpoch = cmdPtr->cmdEpoch; - resPtr->refCount = 1; - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) resPtr; - objPtr->internalRep.twoPtrValue.ptr2 = NULL; - objPtr->typePtr = &tclCmdNameType; -} - -/* - *---------------------------------------------------------------------- - * - * FreeCmdNameInternalRep -- - * - * Frees the resources associated with a cmdName object's internal - * representation. - * - * Results: - * None. - * - * Side effects: - * Decrements the ref count of any cached ResolvedCmdName structure - * pointed to by the cmdName's internal representation. If this is - * the last use of the ResolvedCmdName, it is freed. This in turn - * decrements the ref count of the Command structure pointed to by - * the ResolvedSymbol, which may free the Command structure. - * - *---------------------------------------------------------------------- - */ - -static void -FreeCmdNameInternalRep(objPtr) - register Tcl_Obj *objPtr; /* CmdName object with internal - * representation to free. */ -{ - register ResolvedCmdName *resPtr = - (ResolvedCmdName *) objPtr->internalRep.otherValuePtr; - - if (resPtr != NULL) { - /* - * Decrement the reference count of the ResolvedCmdName structure. - * If there are no more uses, free the ResolvedCmdName structure. - */ - - resPtr->refCount--; - if (resPtr->refCount == 0) { - /* - * Now free the cached command, unless it is still in its - * hash table or if there are other references to it - * from other cmdName objects. - */ - - Command *cmdPtr = resPtr->cmdPtr; - TclCleanupCommand(cmdPtr); - ckfree((char *) resPtr); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * DupCmdNameInternalRep -- - * - * Initialize the internal representation of an cmdName Tcl_Obj to a - * copy of the internal representation of an existing cmdName object. - * - * Results: - * None. - * - * Side effects: - * "copyPtr"s internal rep is set to point to the ResolvedCmdName - * structure corresponding to "srcPtr"s internal rep. Increments the - * ref count of the ResolvedCmdName structure pointed to by the - * cmdName's internal representation. - * - *---------------------------------------------------------------------- - */ - -static void -DupCmdNameInternalRep(srcPtr, copyPtr) - Tcl_Obj *srcPtr; /* Object with internal rep to copy. */ - register Tcl_Obj *copyPtr; /* Object with internal rep to set. */ -{ - register ResolvedCmdName *resPtr = - (ResolvedCmdName *) srcPtr->internalRep.otherValuePtr; - - copyPtr->internalRep.twoPtrValue.ptr1 = (VOID *) resPtr; - copyPtr->internalRep.twoPtrValue.ptr2 = NULL; - if (resPtr != NULL) { - resPtr->refCount++; - } - copyPtr->typePtr = &tclCmdNameType; -} - -/* - *---------------------------------------------------------------------- - * - * SetCmdNameFromAny -- - * - * Generate an cmdName internal form for the Tcl object "objPtr". - * - * Results: - * The return value is a standard Tcl result. The conversion always - * succeeds and TCL_OK is returned. - * - * Side effects: - * A pointer to a ResolvedCmdName structure that holds a cached pointer - * to the command with a name that matches objPtr's string rep is - * stored as objPtr's internal representation. This ResolvedCmdName - * pointer will be NULL if no matching command was found. The ref count - * of the cached Command's structure (if any) is also incremented. - * - *---------------------------------------------------------------------- - */ - -static int -SetCmdNameFromAny(interp, objPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object to convert. */ -{ - Interp *iPtr = (Interp *) interp; - char *name; - Tcl_Command cmd; - register Command *cmdPtr; - Namespace *currNsPtr; - register ResolvedCmdName *resPtr; - - /* - * Get "objPtr"s string representation. Make it up-to-date if necessary. - */ - - name = objPtr->bytes; - if (name == NULL) { - name = Tcl_GetString(objPtr); - } - - /* - * Find the Command structure, if any, that describes the command called - * "name". Build a ResolvedCmdName that holds a cached pointer to this - * Command, and bump the reference count in the referenced Command - * structure. A Command structure will not be deleted as long as it is - * referenced from a CmdName object. - */ - - cmd = Tcl_FindCommand(interp, name, (Tcl_Namespace *) NULL, - /*flags*/ 0); - cmdPtr = (Command *) cmd; - if (cmdPtr != NULL) { - /* - * Get the current namespace. - */ - - if (iPtr->varFramePtr != NULL) { - currNsPtr = iPtr->varFramePtr->nsPtr; - } else { - currNsPtr = iPtr->globalNsPtr; - } - - cmdPtr->refCount++; - resPtr = (ResolvedCmdName *) ckalloc(sizeof(ResolvedCmdName)); - resPtr->cmdPtr = cmdPtr; - resPtr->refNsPtr = currNsPtr; - resPtr->refNsId = currNsPtr->nsId; - resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; - resPtr->cmdEpoch = cmdPtr->cmdEpoch; - resPtr->refCount = 1; - } else { - resPtr = NULL; /* no command named "name" was found */ - } - - /* - * Free the old internalRep before setting the new one. We do this as - * late as possible to allow the conversion code, in particular - * GetStringFromObj, to use that old internalRep. If no Command - * structure was found, leave NULL as the cached value. - */ - - if ((objPtr->typePtr != NULL) - && (objPtr->typePtr->freeIntRepProc != NULL)) { - objPtr->typePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) resPtr; - objPtr->internalRep.twoPtrValue.ptr2 = NULL; - objPtr->typePtr = &tclCmdNameType; - return TCL_OK; -} - -#ifdef TCL_COMPILE_DEBUG -/* - *---------------------------------------------------------------------- - * - * StringForResultCode -- - * - * Procedure that returns a human-readable string representing a - * Tcl result code such as TCL_ERROR. - * - * Results: - * If the result code is one of the standard Tcl return codes, the - * result is a string representing that code such as "TCL_ERROR". - * Otherwise, the result string is that code formatted as a - * sequence of decimal digit characters. Note that the resulting - * string must not be modified by the caller. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static char * -StringForResultCode(result) - int result; /* The Tcl result code for which to - * generate a string. */ -{ - static char buf[TCL_INTEGER_SPACE]; - - if ((result >= TCL_OK) && (result <= TCL_CONTINUE)) { - return resultStrings[result]; - } - TclFormatInt(buf, result); - return buf; -} -#endif /* TCL_COMPILE_DEBUG */ diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c deleted file mode 100644 index b69358b..0000000 --- a/generic/tclFCmd.c +++ /dev/null @@ -1,841 +0,0 @@ -/* - * tclFCmd.c - * - * This file implements the generic portion of file manipulation - * subcommands of the "file" command. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclFCmd.c,v 1.4 1999/04/16 00:46:46 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * Declarations for local procedures defined in this file: - */ - -static int CopyRenameOneFile _ANSI_ARGS_((Tcl_Interp *interp, - char *source, char *dest, int copyFlag, - int force)); -static char * FileBasename _ANSI_ARGS_((Tcl_Interp *interp, - char *path, Tcl_DString *bufferPtr)); -static int FileCopyRename _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv, int copyFlag)); -static int FileForceOption _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv, int *forcePtr)); - -/* - *--------------------------------------------------------------------------- - * - * TclFileRenameCmd - * - * This procedure implements the "rename" subcommand of the "file" - * command. Filename arguments need to be translated to native - * format before being passed to platform-specific code that - * implements rename functionality. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *--------------------------------------------------------------------------- - */ - -int -TclFileRenameCmd(interp, argc, argv) - Tcl_Interp *interp; /* Interp for error reporting. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings passed to Tcl_FileCmd. */ -{ - return FileCopyRename(interp, argc, argv, 0); -} - -/* - *--------------------------------------------------------------------------- - * - * TclFileCopyCmd - * - * This procedure implements the "copy" subcommand of the "file" - * command. Filename arguments need to be translated to native - * format before being passed to platform-specific code that - * implements copy functionality. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *--------------------------------------------------------------------------- - */ - -int -TclFileCopyCmd(interp, argc, argv) - Tcl_Interp *interp; /* Used for error reporting */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings passed to Tcl_FileCmd. */ -{ - return FileCopyRename(interp, argc, argv, 1); -} - -/* - *--------------------------------------------------------------------------- - * - * FileCopyRename -- - * - * Performs the work of TclFileRenameCmd and TclFileCopyCmd. - * See comments for those procedures. - * - * Results: - * See above. - * - * Side effects: - * See above. - * - *--------------------------------------------------------------------------- - */ - -static int -FileCopyRename(interp, argc, argv, copyFlag) - Tcl_Interp *interp; /* Used for error reporting. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings passed to Tcl_FileCmd. */ - int copyFlag; /* If non-zero, copy source(s). Otherwise, - * rename them. */ -{ - int i, result, force; - struct stat statBuf; - Tcl_DString targetBuffer; - char *target; - - i = FileForceOption(interp, argc - 2, argv + 2, &force); - if (i < 0) { - return TCL_ERROR; - } - i += 2; - if ((argc - i) < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ", argv[1], " ?options? source ?source ...? target\"", - (char *) NULL); - return TCL_ERROR; - } - - /* - * If target doesn't exist or isn't a directory, try the copy/rename. - * More than 2 arguments is only valid if the target is an existing - * directory. - */ - - target = Tcl_TranslateFileName(interp, argv[argc - 1], &targetBuffer); - if (target == NULL) { - return TCL_ERROR; - } - - result = TCL_OK; - - /* - * Call TclpStat() so that if target is a symlink that points to a - * directory we will put the sources in that directory instead of - * overwriting the symlink. - */ - - if ((TclpStat(target, &statBuf) != 0) || !S_ISDIR(statBuf.st_mode)) { - if ((argc - i) > 2) { - errno = ENOTDIR; - Tcl_PosixError(interp); - Tcl_AppendResult(interp, "error ", - ((copyFlag) ? "copying" : "renaming"), ": target \"", - argv[argc - 1], "\" is not a directory", (char *) NULL); - result = TCL_ERROR; - } else { - /* - * Even though already have target == translated(argv[i+1]), - * pass the original argument down, so if there's an error, the - * error message will reflect the original arguments. - */ - - result = CopyRenameOneFile(interp, argv[i], argv[i + 1], copyFlag, - force); - } - Tcl_DStringFree(&targetBuffer); - return result; - } - - /* - * Move each source file into target directory. Extract the basename - * from each source, and append it to the end of the target path. - */ - - for ( ; i < argc - 1; i++) { - char *jargv[2]; - char *source, *newFileName; - Tcl_DString sourceBuffer, newFileNameBuffer; - - source = FileBasename(interp, argv[i], &sourceBuffer); - if (source == NULL) { - result = TCL_ERROR; - break; - } - jargv[0] = argv[argc - 1]; - jargv[1] = source; - Tcl_DStringInit(&newFileNameBuffer); - newFileName = Tcl_JoinPath(2, jargv, &newFileNameBuffer); - result = CopyRenameOneFile(interp, argv[i], newFileName, copyFlag, - force); - Tcl_DStringFree(&sourceBuffer); - Tcl_DStringFree(&newFileNameBuffer); - - if (result == TCL_ERROR) { - break; - } - } - Tcl_DStringFree(&targetBuffer); - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * TclFileMakeDirsCmd - * - * This procedure implements the "mkdir" subcommand of the "file" - * command. Filename arguments need to be translated to native - * format before being passed to platform-specific code that - * implements mkdir functionality. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ -int -TclFileMakeDirsCmd(interp, argc, argv) - Tcl_Interp *interp; /* Used for error reporting. */ - int argc; /* Number of arguments */ - char **argv; /* Argument strings passed to Tcl_FileCmd. */ -{ - Tcl_DString nameBuffer, targetBuffer; - char *errfile; - int result, i, j, pargc; - char **pargv; - struct stat statBuf; - - pargv = NULL; - errfile = NULL; - Tcl_DStringInit(&nameBuffer); - Tcl_DStringInit(&targetBuffer); - - result = TCL_OK; - for (i = 2; i < argc; i++) { - char *name = Tcl_TranslateFileName(interp, argv[i], &nameBuffer); - if (name == NULL) { - result = TCL_ERROR; - break; - } - - Tcl_SplitPath(name, &pargc, &pargv); - if (pargc == 0) { - errno = ENOENT; - errfile = argv[i]; - break; - } - for (j = 0; j < pargc; j++) { - char *target = Tcl_JoinPath(j + 1, pargv, &targetBuffer); - - /* - * Call TclpStat() so that if target is a symlink that points - * to a directory we will create subdirectories in that - * directory. - */ - - if (TclpStat(target, &statBuf) == 0) { - if (!S_ISDIR(statBuf.st_mode)) { - errno = EEXIST; - errfile = target; - goto done; - } - } else if ((errno != ENOENT) - || (TclpCreateDirectory(target) != TCL_OK)) { - errfile = target; - goto done; - } - Tcl_DStringFree(&targetBuffer); - } - ckfree((char *) pargv); - pargv = NULL; - Tcl_DStringFree(&nameBuffer); - } - - done: - if (errfile != NULL) { - Tcl_AppendResult(interp, "can't create directory \"", - errfile, "\": ", Tcl_PosixError(interp), (char *) NULL); - result = TCL_ERROR; - } - - Tcl_DStringFree(&nameBuffer); - Tcl_DStringFree(&targetBuffer); - if (pargv != NULL) { - ckfree((char *) pargv); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclFileDeleteCmd - * - * This procedure implements the "delete" subcommand of the "file" - * command. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - -int -TclFileDeleteCmd(interp, argc, argv) - Tcl_Interp *interp; /* Used for error reporting */ - int argc; /* Number of arguments */ - char **argv; /* Argument strings passed to Tcl_FileCmd. */ -{ - Tcl_DString nameBuffer, errorBuffer; - int i, force, result; - char *errfile; - - i = FileForceOption(interp, argc - 2, argv + 2, &force); - if (i < 0) { - return TCL_ERROR; - } - i += 2; - if ((argc - i) < 1) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ", argv[1], " ?options? file ?file ...?\"", (char *) NULL); - return TCL_ERROR; - } - - errfile = NULL; - result = TCL_OK; - Tcl_DStringInit(&errorBuffer); - Tcl_DStringInit(&nameBuffer); - - for ( ; i < argc; i++) { - struct stat statBuf; - char *name; - - errfile = argv[i]; - Tcl_DStringSetLength(&nameBuffer, 0); - name = Tcl_TranslateFileName(interp, argv[i], &nameBuffer); - if (name == NULL) { - result = TCL_ERROR; - goto done; - } - - /* - * Call lstat() to get info so can delete symbolic link itself. - */ - - if (TclpLstat(name, &statBuf) != 0) { - /* - * Trying to delete a file that does not exist is not - * considered an error, just a no-op - */ - - if (errno != ENOENT) { - result = TCL_ERROR; - } - } else if (S_ISDIR(statBuf.st_mode)) { - result = TclpRemoveDirectory(name, force, &errorBuffer); - if (result != TCL_OK) { - if ((force == 0) && (errno == EEXIST)) { - Tcl_AppendResult(interp, "error deleting \"", argv[i], - "\": directory not empty", (char *) NULL); - Tcl_PosixError(interp); - goto done; - } - - /* - * If possible, use the untranslated name for the file. - */ - - errfile = Tcl_DStringValue(&errorBuffer); - if (strcmp(name, errfile) == 0) { - errfile = argv[i]; - } - } - } else { - result = TclpDeleteFile(name); - } - - if (result == TCL_ERROR) { - break; - } - } - if (result != TCL_OK) { - Tcl_AppendResult(interp, "error deleting \"", errfile, - "\": ", Tcl_PosixError(interp), (char *) NULL); - } - done: - Tcl_DStringFree(&errorBuffer); - Tcl_DStringFree(&nameBuffer); - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * CopyRenameOneFile - * - * Copies or renames specified source file or directory hierarchy - * to the specified target. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Target is overwritten if the force flag is set. Attempting to - * copy/rename a file onto a directory or a directory onto a file - * will always result in an error. - * - *---------------------------------------------------------------------- - */ - -static int -CopyRenameOneFile(interp, source, target, copyFlag, force) - Tcl_Interp *interp; /* Used for error reporting. */ - char *source; /* Pathname of file to copy. May need to - * be translated. */ - char *target; /* Pathname of file to create/overwrite. - * May need to be translated. */ - int copyFlag; /* If non-zero, copy files. Otherwise, - * rename them. */ - int force; /* If non-zero, overwrite target file if it - * exists. Otherwise, error if target already - * exists. */ -{ - int result; - Tcl_DString sourcePath, targetPath, errorBuffer; - char *targetName, *sourceName, *errfile; - struct stat sourceStatBuf, targetStatBuf; - - sourceName = Tcl_TranslateFileName(interp, source, &sourcePath); - if (sourceName == NULL) { - return TCL_ERROR; - } - targetName = Tcl_TranslateFileName(interp, target, &targetPath); - if (targetName == NULL) { - Tcl_DStringFree(&sourcePath); - return TCL_ERROR; - } - - errfile = NULL; - result = TCL_ERROR; - Tcl_DStringInit(&errorBuffer); - - /* - * We want to copy/rename links and not the files they point to, so we - * use lstat(). If target is a link, we also want to replace the - * link and not the file it points to, so we also use lstat() on the - * target. - */ - - if (TclpLstat(sourceName, &sourceStatBuf) != 0) { - errfile = source; - goto done; - } - if (TclpLstat(targetName, &targetStatBuf) != 0) { - if (errno != ENOENT) { - errfile = target; - goto done; - } - } else { - if (force == 0) { - errno = EEXIST; - errfile = target; - goto done; - } - - /* - * Prevent copying or renaming a file onto itself. Under Windows, - * stat always returns 0 for st_ino. However, the Windows-specific - * code knows how to deal with copying or renaming a file on top of - * itself. It might be a good idea to write a stat that worked. - */ - - if ((sourceStatBuf.st_ino != 0) && (targetStatBuf.st_ino != 0)) { - if ((sourceStatBuf.st_ino == targetStatBuf.st_ino) && - (sourceStatBuf.st_dev == targetStatBuf.st_dev)) { - result = TCL_OK; - goto done; - } - } - - /* - * Prevent copying/renaming a file onto a directory and - * vice-versa. This is a policy decision based on the fact that - * existing implementations of copy and rename on all platforms - * also prevent this. - */ - - if (S_ISDIR(sourceStatBuf.st_mode) - && !S_ISDIR(targetStatBuf.st_mode)) { - errno = EISDIR; - Tcl_AppendResult(interp, "can't overwrite file \"", target, - "\" with directory \"", source, "\"", (char *) NULL); - goto done; - } - if (!S_ISDIR(sourceStatBuf.st_mode) - && S_ISDIR(targetStatBuf.st_mode)) { - errno = EISDIR; - Tcl_AppendResult(interp, "can't overwrite directory \"", target, - "\" with file \"", source, "\"", (char *) NULL); - goto done; - } - } - - if (copyFlag == 0) { - result = TclpRenameFile(sourceName, targetName); - if (result == TCL_OK) { - goto done; - } - - if (errno == EINVAL) { - Tcl_AppendResult(interp, "error renaming \"", source, "\" to \"", - target, "\": trying to rename a volume or ", - "move a directory into itself", (char *) NULL); - goto done; - } else if (errno != EXDEV) { - errfile = target; - goto done; - } - - /* - * The rename failed because the move was across file systems. - * Fall through to copy file and then remove original. Note that - * the low-level TclpRenameFile is allowed to implement - * cross-filesystem moves itself. - */ - } - - if (S_ISDIR(sourceStatBuf.st_mode)) { - result = TclpCopyDirectory(sourceName, targetName, &errorBuffer); - if (result != TCL_OK) { - errfile = Tcl_DStringValue(&errorBuffer); - if (strcmp(errfile, sourceName) == 0) { - errfile = source; - } else if (strcmp(errfile, targetName) == 0) { - errfile = target; - } - } - } else { - result = TclpCopyFile(sourceName, targetName); - if (result != TCL_OK) { - /* - * Well, there really shouldn't be a problem with source, - * because up there we checked to see if it was ok to copy it. - */ - - errfile = target; - } - } - if ((copyFlag == 0) && (result == TCL_OK)) { - if (S_ISDIR(sourceStatBuf.st_mode)) { - result = TclpRemoveDirectory(sourceName, 1, &errorBuffer); - if (result != TCL_OK) { - errfile = Tcl_DStringValue(&errorBuffer); - if (strcmp(errfile, sourceName) == 0) { - errfile = source; - } - } - } else { - result = TclpDeleteFile(sourceName); - if (result != TCL_OK) { - errfile = source; - } - } - if (result != TCL_OK) { - Tcl_AppendResult(interp, "can't unlink \"", errfile, "\": ", - Tcl_PosixError(interp), (char *) NULL); - errfile = NULL; - } - } - - done: - if (errfile != NULL) { - Tcl_AppendResult(interp, - ((copyFlag) ? "error copying \"" : "error renaming \""), - source, (char *) NULL); - if (errfile != source) { - Tcl_AppendResult(interp, "\" to \"", target, (char *) NULL); - if (errfile != target) { - Tcl_AppendResult(interp, "\": \"", errfile, (char *) NULL); - } - } - Tcl_AppendResult(interp, "\": ", Tcl_PosixError(interp), - (char *) NULL); - } - Tcl_DStringFree(&errorBuffer); - Tcl_DStringFree(&sourcePath); - Tcl_DStringFree(&targetPath); - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * FileForceOption -- - * - * Helps parse command line options for file commands that take - * the "-force" and "--" options. - * - * Results: - * The return value is how many arguments from argv were consumed - * by this function, or -1 if there was an error parsing the - * options. If an error occurred, an error message is left in the - * interp's result. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static int -FileForceOption(interp, argc, argv, forcePtr) - Tcl_Interp *interp; /* Interp, for error return. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. First command line - * option, if it exists, begins at 0. */ - int *forcePtr; /* If the "-force" was specified, *forcePtr - * is filled with 1, otherwise with 0. */ -{ - int force, i; - - force = 0; - for (i = 0; i < argc; i++) { - if (argv[i][0] != '-') { - break; - } - if (strcmp(argv[i], "-force") == 0) { - force = 1; - } else if (strcmp(argv[i], "--") == 0) { - i++; - break; - } else { - Tcl_AppendResult(interp, "bad option \"", argv[i], - "\": should be -force or --", (char *)NULL); - return -1; - } - } - *forcePtr = force; - return i; -} -/* - *--------------------------------------------------------------------------- - * - * FileBasename -- - * - * Given a path in either tcl format (with / separators), or in the - * platform-specific format for the current platform, return all the - * characters in the path after the last directory separator. But, - * if path is the root directory, returns no characters. - * - * Results: - * Appends the string that represents the basename to the end of - * the specified initialized DString, returning a pointer to the - * resulting string. If there is an error, an error message is left - * in interp, NULL is returned, and the Tcl_DString is unmodified. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static char * -FileBasename(interp, path, bufferPtr) - Tcl_Interp *interp; /* Interp, for error return. */ - char *path; /* Path whose basename to extract. */ - Tcl_DString *bufferPtr; /* Initialized DString that receives - * basename. */ -{ - int argc; - char **argv; - - Tcl_SplitPath(path, &argc, &argv); - if (argc == 0) { - Tcl_DStringInit(bufferPtr); - } else { - if ((argc == 1) && (*path == '~')) { - Tcl_DString buffer; - - ckfree((char *) argv); - path = Tcl_TranslateFileName(interp, path, &buffer); - if (path == NULL) { - return NULL; - } - Tcl_SplitPath(path, &argc, &argv); - Tcl_DStringFree(&buffer); - } - Tcl_DStringInit(bufferPtr); - - /* - * Return the last component, unless it is the only component, and it - * is the root of an absolute path. - */ - - if (argc > 0) { - if ((argc > 1) - || (Tcl_GetPathType(argv[0]) == TCL_PATH_RELATIVE)) { - Tcl_DStringAppend(bufferPtr, argv[argc - 1], -1); - } - } - } - ckfree((char *) argv); - return Tcl_DStringValue(bufferPtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclFileAttrsCmd -- - * - * Sets or gets the platform-specific attributes of a file. The objc-objv - * points to the file name with the rest of the command line following. - * This routine uses platform-specific tables of option strings - * and callbacks. The callback to get the attributes take three - * parameters: - * Tcl_Interp *interp; The interp to report errors with. - * Since this is an object-based API, - * the object form of the result should be - * used. - * CONST char *fileName; This is extracted using - * Tcl_TranslateFileName. - * TclObj **attrObjPtrPtr; A new object to hold the attribute - * is allocated and put here. - * The first two parameters of the callback used to write out the - * attributes are the same. The third parameter is: - * CONST *attrObjPtr; A pointer to the object that has - * the new attribute. - * They both return standard TCL errors; if the routine to get - * an attribute fails, no object is allocated and *attrObjPtrPtr - * is unchanged. - * - * Results: - * Standard TCL error. - * - * Side effects: - * May set file attributes for the file name. - * - *---------------------------------------------------------------------- - */ - -int -TclFileAttrsCmd(interp, objc, objv) - Tcl_Interp *interp; /* The interpreter for error reporting. */ - int objc; /* Number of command line arguments. */ - Tcl_Obj *CONST objv[]; /* The command line objects. */ -{ - char *fileName; - int result; - Tcl_DString buffer; - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, - "name ?option? ?value? ?option value ...?"); - return TCL_ERROR; - } - - fileName = Tcl_GetString(objv[2]); - fileName = Tcl_TranslateFileName(interp, fileName, &buffer); - if (fileName == NULL) { - return TCL_ERROR; - } - - objc -= 3; - objv += 3; - result = TCL_ERROR; - - if (objc == 0) { - /* - * Get all attributes. - */ - - int index; - Tcl_Obj *listPtr, *objPtr; - - listPtr = Tcl_NewListObj(0, NULL); - for (index = 0; tclpFileAttrStrings[index] != NULL; index++) { - objPtr = Tcl_NewStringObj(tclpFileAttrStrings[index], -1); - Tcl_ListObjAppendElement(interp, listPtr, objPtr); - - if ((*tclpFileAttrProcs[index].getProc)(interp, index, fileName, - &objPtr) != TCL_OK) { - Tcl_DecrRefCount(listPtr); - goto end; - } - Tcl_ListObjAppendElement(interp, listPtr, objPtr); - } - Tcl_SetObjResult(interp, listPtr); - } else if (objc == 1) { - /* - * Get one attribute. - */ - - int index; - Tcl_Obj *objPtr; - - if (Tcl_GetIndexFromObj(interp, objv[0], tclpFileAttrStrings, - "option", 0, &index) != TCL_OK) { - goto end; - } - if ((*tclpFileAttrProcs[index].getProc)(interp, index, fileName, - &objPtr) != TCL_OK) { - goto end; - } - Tcl_SetObjResult(interp, objPtr); - } else { - /* - * Set option/value pairs. - */ - - int i, index; - - for (i = 0; i < objc ; i += 2) { - if (Tcl_GetIndexFromObj(interp, objv[i], tclpFileAttrStrings, - "option", 0, &index) != TCL_OK) { - goto end; - } - if (i + 1 == objc) { - Tcl_AppendResult(interp, "value for \"", - Tcl_GetString(objv[i]), "\" missing", - (char *) NULL); - goto end; - } - if ((*tclpFileAttrProcs[index].setProc)(interp, index, fileName, - objv[i + 1]) != TCL_OK) { - goto end; - } - } - } - result = TCL_OK; - - end: - Tcl_DStringFree(&buffer); - return result; -} diff --git a/generic/tclFileName.c b/generic/tclFileName.c deleted file mode 100644 index 06e83a3..0000000 --- a/generic/tclFileName.c +++ /dev/null @@ -1,1720 +0,0 @@ -/* - * tclFileName.c -- - * - * This file contains routines for converting file names betwen - * native and network form. - * - * Copyright (c) 1995-1998 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. - * - * RCS: @(#) $Id: tclFileName.c,v 1.6 1999/04/16 00:46:46 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclRegexp.h" - -/* - * The following regular expression matches the root portion of a Windows - * absolute or volume relative path. It will match both UNC and drive relative - * paths. - */ - -#define WIN_ROOT_PATTERN "^(([a-zA-Z]:)|[/\\\\][/\\\\]+([^/\\\\]+)[/\\\\]+([^/\\\\]+)|([/\\\\]))([/\\\\])*" - -/* - * The following regular expression matches the root portion of a Macintosh - * absolute path. It will match degenerate Unix-style paths, tilde paths, - * Unix-style paths, and Mac paths. - */ - -#define MAC_ROOT_PATTERN "^((/+([.][.]?/+)*([.][.]?)?)|(~[^:/]*)(/[^:]*)?|(~[^:]*)(:.*)?|/+([.][.]?/+)*([^:/]+)(/[^:]*)?|([^:]+):.*)$" - -/* - * The following variables are used to hold precompiled regular expressions - * for use in filename matching. - */ - -typedef struct ThreadSpecificData { - int initialized; - Tcl_Obj *winRootPatternPtr; - Tcl_Obj *macRootPatternPtr; -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - -/* - * The following variable is set in the TclPlatformInit call to one - * of: TCL_PLATFORM_UNIX, TCL_PLATFORM_MAC, or TCL_PLATFORM_WINDOWS. - */ - -TclPlatformType tclPlatform = TCL_PLATFORM_UNIX; - -/* - * Prototypes for local procedures defined in this file: - */ - -static char * DoTildeSubst _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *user, Tcl_DString *resultPtr)); -static CONST char * ExtractWinRoot _ANSI_ARGS_((CONST char *path, - Tcl_DString *resultPtr, int offset)); -static void FileNameCleanup _ANSI_ARGS_((ClientData clientData)); -static void FileNameInit _ANSI_ARGS_((void)); -static int SkipToChar _ANSI_ARGS_((char **stringPtr, - char *match)); -static char * SplitMacPath _ANSI_ARGS_((CONST char *path, - Tcl_DString *bufPtr)); -static char * SplitWinPath _ANSI_ARGS_((CONST char *path, - Tcl_DString *bufPtr)); -static char * SplitUnixPath _ANSI_ARGS_((CONST char *path, - Tcl_DString *bufPtr)); - -/* - *---------------------------------------------------------------------- - * - * FileNameInit -- - * - * This procedure initializes the patterns used by this module. - * - * Results: - * None. - * - * Side effects: - * Compiles the regular expressions. - * - *---------------------------------------------------------------------- - */ - -static void -FileNameInit() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - if (!tsdPtr->initialized) { - tsdPtr->initialized = 1; - tsdPtr->winRootPatternPtr = Tcl_NewStringObj(WIN_ROOT_PATTERN, -1); - tsdPtr->macRootPatternPtr = Tcl_NewStringObj(MAC_ROOT_PATTERN, -1); - Tcl_CreateThreadExitHandler(FileNameCleanup, NULL); - } -} - -/* - *---------------------------------------------------------------------- - * - * FileNameCleanup -- - * - * This procedure is a Tcl_ExitProc used to clean up the static - * data structures used in this file. - * - * Results: - * None. - * - * Side effects: - * Deallocates storage used by the procedures in this file. - * - *---------------------------------------------------------------------- - */ - -static void -FileNameCleanup(clientData) - ClientData clientData; /* Not used. */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - Tcl_DecrRefCount(tsdPtr->winRootPatternPtr); - Tcl_DecrRefCount(tsdPtr->macRootPatternPtr); - tsdPtr->initialized = 0; -} - -/* - *---------------------------------------------------------------------- - * - * ExtractWinRoot -- - * - * Matches the root portion of a Windows path and appends it - * to the specified Tcl_DString. - * - * Results: - * Returns the position in the path immediately after the root - * including any trailing slashes. - * Appends a cleaned up version of the root to the Tcl_DString - * at the specified offest. - * - * Side effects: - * Modifies the specified Tcl_DString. - * - *---------------------------------------------------------------------- - */ - -static CONST char * -ExtractWinRoot(path, resultPtr, offset) - CONST char *path; /* Path to parse. */ - Tcl_DString *resultPtr; /* Buffer to hold result. */ - int offset; /* Offset in buffer where result should be - * stored. */ -{ - int length; - Tcl_RegExp re; - char *dummy, *tail, *drive, *hostStart, *hostEnd, *shareStart, - *shareEnd, *lastSlash; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * Initialize the path name parser for Windows path names. - */ - - FileNameInit(); - - re = Tcl_GetRegExpFromObj(NULL, tsdPtr->winRootPatternPtr, REG_ADVANCED); - - /* - * Match the root portion of a Windows path name. - */ - - if (!Tcl_RegExpExec(NULL, re, path, path)) { - return path; - } - - Tcl_DStringSetLength(resultPtr, offset); - - Tcl_RegExpRange(re, 0, &dummy, &tail); - Tcl_RegExpRange(re, 2, &drive, &dummy); - Tcl_RegExpRange(re, 3, &hostStart, &hostEnd); - Tcl_RegExpRange(re, 4, &shareStart, &shareEnd); - Tcl_RegExpRange(re, 6, &lastSlash, &dummy); - - if (drive != NULL) { - Tcl_DStringAppend(resultPtr, drive, 2); - if (lastSlash != NULL) { - Tcl_DStringAppend(resultPtr, "/", 1); - } - } else if (shareStart != NULL) { - Tcl_DStringAppend(resultPtr, "//", 2); - length = hostEnd - hostStart; - Tcl_DStringAppend(resultPtr, hostStart, length); - Tcl_DStringAppend(resultPtr, "/", 1); - length = shareEnd - shareStart; - Tcl_DStringAppend(resultPtr, shareStart, length); - } else { - Tcl_DStringAppend(resultPtr, "/", 1); - } - return tail; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetPathType -- - * - * Determines whether a given path is relative to the current - * directory, relative to the current volume, or absolute. - * - * Results: - * Returns one of TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, or - * TCL_PATH_VOLUME_RELATIVE. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_PathType -Tcl_GetPathType(path) - char *path; -{ - ThreadSpecificData *tsdPtr; - Tcl_PathType type = TCL_PATH_ABSOLUTE; - Tcl_RegExp re; - - switch (tclPlatform) { - case TCL_PLATFORM_UNIX: - /* - * Paths that begin with / or ~ are absolute. - */ - - if ((path[0] != '/') && (path[0] != '~')) { - type = TCL_PATH_RELATIVE; - } - break; - - case TCL_PLATFORM_MAC: - if (path[0] == ':') { - type = TCL_PATH_RELATIVE; - } else if (path[0] != '~') { - tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * Since we have eliminated the easy cases, use the - * root pattern to look for the other types. - */ - - FileNameInit(); - re = Tcl_GetRegExpFromObj(NULL, tsdPtr->macRootPatternPtr, - REG_ADVANCED); - - if (!Tcl_RegExpExec(NULL, re, path, path)) { - type = TCL_PATH_RELATIVE; - } else { - char *unixRoot, *dummy; - - Tcl_RegExpRange(re, 2, &unixRoot, &dummy); - if (unixRoot) { - type = TCL_PATH_RELATIVE; - } - } - } - break; - - case TCL_PLATFORM_WINDOWS: - if (path[0] != '~') { - tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * Since we have eliminated the easy cases, check for - * drive relative paths using the regular expression. - */ - - FileNameInit(); - re = Tcl_GetRegExpFromObj(NULL, tsdPtr->winRootPatternPtr, - REG_ADVANCED); - - if (Tcl_RegExpExec(NULL, re, path, path)) { - char *drive, *dummy, *unixRoot, *lastSlash; - - Tcl_RegExpRange(re, 2, &drive, &dummy); - Tcl_RegExpRange(re, 5, &unixRoot, &dummy); - Tcl_RegExpRange(re, 6, &lastSlash, &dummy); - - if (unixRoot || (drive && !lastSlash)) { - type = TCL_PATH_VOLUME_RELATIVE; - } - } else { - type = TCL_PATH_RELATIVE; - } - } - break; - } - return type; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SplitPath -- - * - * Split a path into a list of path components. The first element - * of the list will have the same path type as the original path. - * - * Results: - * Returns a standard Tcl result. The interpreter result contains - * a list of path components. - * *argvPtr will be filled in with the address of an array - * whose elements point to the elements of path, in order. - * *argcPtr will get filled in with the number of valid elements - * in the array. A single block of memory is dynamically allocated - * to hold both the argv array and a copy of the path elements. - * The caller must eventually free this memory by calling ckfree() - * on *argvPtr. Note: *argvPtr and *argcPtr are only modified - * if the procedure returns normally. - * - * Side effects: - * Allocates memory. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SplitPath(path, argcPtr, argvPtr) - CONST char *path; /* Pointer to string containing a path. */ - int *argcPtr; /* Pointer to location to fill in with - * the number of elements in the path. */ - char ***argvPtr; /* Pointer to place to store pointer to array - * of pointers to path elements. */ -{ - int i, size; - char *p; - Tcl_DString buffer; - - Tcl_DStringInit(&buffer); - - /* - * Perform platform specific splitting. These routines will leave the - * result in the specified buffer. Individual elements are terminated - * with a null character. - */ - - p = NULL; /* Needed only to prevent gcc warnings. */ - switch (tclPlatform) { - case TCL_PLATFORM_UNIX: - p = SplitUnixPath(path, &buffer); - break; - - case TCL_PLATFORM_WINDOWS: - p = SplitWinPath(path, &buffer); - break; - - case TCL_PLATFORM_MAC: - p = SplitMacPath(path, &buffer); - break; - } - - /* - * Compute the number of elements in the result. - */ - - size = Tcl_DStringLength(&buffer); - *argcPtr = 0; - for (i = 0; i < size; i++) { - if (p[i] == '\0') { - (*argcPtr)++; - } - } - - /* - * Allocate a buffer large enough to hold the contents of the - * DString plus the argv pointers and the terminating NULL pointer. - */ - - *argvPtr = (char **) ckalloc((unsigned) - ((((*argcPtr) + 1) * sizeof(char *)) + size)); - - /* - * Position p after the last argv pointer and copy the contents of - * the DString. - */ - - p = (char *) &(*argvPtr)[(*argcPtr) + 1]; - memcpy((VOID *) p, (VOID *) Tcl_DStringValue(&buffer), (size_t) size); - - /* - * Now set up the argv pointers. - */ - - for (i = 0; i < *argcPtr; i++) { - (*argvPtr)[i] = p; - while ((*p++) != '\0') {} - } - (*argvPtr)[i] = NULL; - - Tcl_DStringFree(&buffer); -} - -/* - *---------------------------------------------------------------------- - * - * SplitUnixPath -- - * - * This routine is used by Tcl_SplitPath to handle splitting - * Unix paths. - * - * Results: - * Stores a null separated array of strings in the specified - * Tcl_DString. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static char * -SplitUnixPath(path, bufPtr) - CONST char *path; /* Pointer to string containing a path. */ - Tcl_DString *bufPtr; /* Pointer to DString to use for the result. */ -{ - int length; - CONST char *p, *elementStart; - - /* - * Deal with the root directory as a special case. - */ - - if (path[0] == '/') { - Tcl_DStringAppend(bufPtr, "/", 2); - p = path+1; - } else { - p = path; - } - - /* - * Split on slashes. Embedded elements that start with tilde will be - * prefixed with "./" so they are not affected by tilde substitution. - */ - - for (;;) { - elementStart = p; - while ((*p != '\0') && (*p != '/')) { - p++; - } - length = p - elementStart; - if (length > 0) { - if ((elementStart[0] == '~') && (elementStart != path)) { - Tcl_DStringAppend(bufPtr, "./", 2); - } - Tcl_DStringAppend(bufPtr, elementStart, length); - Tcl_DStringAppend(bufPtr, "", 1); - } - if (*p++ == '\0') { - break; - } - } - return Tcl_DStringValue(bufPtr); -} - -/* - *---------------------------------------------------------------------- - * - * SplitWinPath -- - * - * This routine is used by Tcl_SplitPath to handle splitting - * Windows paths. - * - * Results: - * Stores a null separated array of strings in the specified - * Tcl_DString. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static char * -SplitWinPath(path, bufPtr) - CONST char *path; /* Pointer to string containing a path. */ - Tcl_DString *bufPtr; /* Pointer to DString to use for the result. */ -{ - int length; - CONST char *p, *elementStart; - - p = ExtractWinRoot(path, bufPtr, 0); - - /* - * Terminate the root portion, if we matched something. - */ - - if (p != path) { - Tcl_DStringAppend(bufPtr, "", 1); - } - - /* - * Split on slashes. Embedded elements that start with tilde will be - * prefixed with "./" so they are not affected by tilde substitution. - */ - - do { - elementStart = p; - while ((*p != '\0') && (*p != '/') && (*p != '\\')) { - p++; - } - length = p - elementStart; - if (length > 0) { - if ((elementStart[0] == '~') && (elementStart != path)) { - Tcl_DStringAppend(bufPtr, "./", 2); - } - Tcl_DStringAppend(bufPtr, elementStart, length); - Tcl_DStringAppend(bufPtr, "", 1); - } - } while (*p++ != '\0'); - - return Tcl_DStringValue(bufPtr); -} - -/* - *---------------------------------------------------------------------- - * - * SplitMacPath -- - * - * This routine is used by Tcl_SplitPath to handle splitting - * Macintosh paths. - * - * Results: - * Returns a newly allocated argv array. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static char * -SplitMacPath(path, bufPtr) - CONST char *path; /* Pointer to string containing a path. */ - Tcl_DString *bufPtr; /* Pointer to DString to use for the result. */ -{ - int isMac = 0; /* 1 if is Mac-style, 0 if Unix-style path. */ - int i, length; - CONST char *p, *elementStart; - Tcl_RegExp re; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * Initialize the path name parser for Macintosh path names. - */ - - FileNameInit(); - - /* - * Match the root portion of a Mac path name. - */ - - i = 0; /* Needed only to prevent gcc warnings. */ - - re = Tcl_GetRegExpFromObj(NULL, tsdPtr->macRootPatternPtr, REG_ADVANCED); - - if (Tcl_RegExpExec(NULL, re, path, path) == 1) { - char *start, *end; - - /* - * Treat degenerate absolute paths like / and /../.. as - * Mac relative file names for lack of anything else to do. - */ - - Tcl_RegExpRange(re, 2, &start, &end); - if (start) { - Tcl_DStringAppend(bufPtr, ":", 1); - Tcl_RegExpRange(re, 0, &start, &end); - Tcl_DStringAppend(bufPtr, path, end - start + 1); - return Tcl_DStringValue(bufPtr); - } - - Tcl_RegExpRange(re, 5, &start, &end); - if (start) { - /* - * Unix-style tilde prefixed paths. - */ - - isMac = 0; - i = 5; - } else { - Tcl_RegExpRange(re, 7, &start, &end); - if (start) { - /* - * Mac-style tilde prefixed paths. - */ - - isMac = 1; - i = 7; - } else { - Tcl_RegExpRange(re, 10, &start, &end); - if (start) { - - /* - * Normal Unix style paths. - */ - - isMac = 0; - i = 10; - } else { - Tcl_RegExpRange(re, 12, &start, &end); - if (start) { - - /* - * Normal Mac style paths. - */ - - isMac = 1; - i = 12; - } - } - } - } - - Tcl_RegExpRange(re, i, &start, &end); - length = end - start; - - /* - * Append the element and terminate it with a : and a null. Note that - * we are forcing the DString to contain an extra null at the end. - */ - - Tcl_DStringAppend(bufPtr, start, length); - Tcl_DStringAppend(bufPtr, ":", 2); - p = end; - } else { - isMac = (strchr(path, ':') != NULL); - p = path; - } - - if (isMac) { - - /* - * p is pointing at the first colon in the path. There - * will always be one, since this is a Mac-style path. - */ - - elementStart = p++; - while ((p = strchr(p, ':')) != NULL) { - length = p - elementStart; - if (length == 1) { - while (*p == ':') { - Tcl_DStringAppend(bufPtr, "::", 3); - elementStart = p++; - } - } else { - /* - * If this is a simple component, drop the leading colon. - */ - - if ((elementStart[1] != '~') - && (strchr(elementStart+1, '/') == NULL)) { - elementStart++; - length--; - } - Tcl_DStringAppend(bufPtr, elementStart, length); - Tcl_DStringAppend(bufPtr, "", 1); - elementStart = p++; - } - } - if (elementStart[1] != '\0' || elementStart == path) { - if ((elementStart[1] != '~') && (elementStart[1] != '\0') - && (strchr(elementStart+1, '/') == NULL)) { - elementStart++; - } - Tcl_DStringAppend(bufPtr, elementStart, -1); - Tcl_DStringAppend(bufPtr, "", 1); - } - } else { - - /* - * Split on slashes, suppress extra /'s, and convert .. to ::. - */ - - for (;;) { - elementStart = p; - while ((*p != '\0') && (*p != '/')) { - p++; - } - length = p - elementStart; - if (length > 0) { - if ((length == 1) && (elementStart[0] == '.')) { - Tcl_DStringAppend(bufPtr, ":", 2); - } else if ((length == 2) && (elementStart[0] == '.') - && (elementStart[1] == '.')) { - Tcl_DStringAppend(bufPtr, "::", 3); - } else { - if (*elementStart == '~') { - Tcl_DStringAppend(bufPtr, ":", 1); - } - Tcl_DStringAppend(bufPtr, elementStart, length); - Tcl_DStringAppend(bufPtr, "", 1); - } - } - if (*p++ == '\0') { - break; - } - } - } - return Tcl_DStringValue(bufPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_JoinPath -- - * - * Combine a list of paths in a platform specific manner. - * - * Results: - * Appends the joined path to the end of the specified - * returning a pointer to the resulting string. Note that - * the Tcl_DString must already be initialized. - * - * Side effects: - * Modifies the Tcl_DString. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_JoinPath(argc, argv, resultPtr) - int argc; - char **argv; - Tcl_DString *resultPtr; /* Pointer to previously initialized DString. */ -{ - int oldLength, length, i, needsSep; - Tcl_DString buffer; - char c, *dest; - CONST char *p; - - Tcl_DStringInit(&buffer); - oldLength = Tcl_DStringLength(resultPtr); - - switch (tclPlatform) { - case TCL_PLATFORM_UNIX: - for (i = 0; i < argc; i++) { - p = argv[i]; - /* - * If the path is absolute, reset the result buffer. - * Consume any duplicate leading slashes or a ./ in - * front of a tilde prefixed path that isn't at the - * beginning of the path. - */ - - if (*p == '/') { - Tcl_DStringSetLength(resultPtr, oldLength); - Tcl_DStringAppend(resultPtr, "/", 1); - while (*p == '/') { - p++; - } - } else if (*p == '~') { - Tcl_DStringSetLength(resultPtr, oldLength); - } else if ((Tcl_DStringLength(resultPtr) != oldLength) - && (p[0] == '.') && (p[1] == '/') - && (p[2] == '~')) { - p += 2; - } - - if (*p == '\0') { - continue; - } - - /* - * Append a separator if needed. - */ - - length = Tcl_DStringLength(resultPtr); - if ((length != oldLength) - && (Tcl_DStringValue(resultPtr)[length-1] != '/')) { - Tcl_DStringAppend(resultPtr, "/", 1); - length++; - } - - /* - * Append the element, eliminating duplicate and trailing - * slashes. - */ - - Tcl_DStringSetLength(resultPtr, (int) (length + strlen(p))); - dest = Tcl_DStringValue(resultPtr) + length; - for (; *p != '\0'; p++) { - if (*p == '/') { - while (p[1] == '/') { - p++; - } - if (p[1] != '\0') { - *dest++ = '/'; - } - } else { - *dest++ = *p; - } - } - length = dest - Tcl_DStringValue(resultPtr); - Tcl_DStringSetLength(resultPtr, length); - } - break; - - case TCL_PLATFORM_WINDOWS: - /* - * Iterate over all of the components. If a component is - * absolute, then reset the result and start building the - * path from the current component on. - */ - - for (i = 0; i < argc; i++) { - p = ExtractWinRoot(argv[i], resultPtr, oldLength); - length = Tcl_DStringLength(resultPtr); - - /* - * If the pointer didn't move, then this is a relative path - * or a tilde prefixed path. - */ - - if (p == argv[i]) { - /* - * Remove the ./ from tilde prefixed elements unless - * it is the first component. - */ - - if ((length != oldLength) - && (p[0] == '.') - && ((p[1] == '/') || (p[1] == '\\')) - && (p[2] == '~')) { - p += 2; - } else if (*p == '~') { - Tcl_DStringSetLength(resultPtr, oldLength); - length = oldLength; - } - } - - if (*p != '\0') { - /* - * Check to see if we need to append a separator. - */ - - - if (length != oldLength) { - c = Tcl_DStringValue(resultPtr)[length-1]; - if ((c != '/') && (c != ':')) { - Tcl_DStringAppend(resultPtr, "/", 1); - } - } - - /* - * Append the element, eliminating duplicate and - * trailing slashes. - */ - - length = Tcl_DStringLength(resultPtr); - Tcl_DStringSetLength(resultPtr, (int) (length + strlen(p))); - dest = Tcl_DStringValue(resultPtr) + length; - for (; *p != '\0'; p++) { - if ((*p == '/') || (*p == '\\')) { - while ((p[1] == '/') || (p[1] == '\\')) { - p++; - } - if (p[1] != '\0') { - *dest++ = '/'; - } - } else { - *dest++ = *p; - } - } - length = dest - Tcl_DStringValue(resultPtr); - Tcl_DStringSetLength(resultPtr, length); - } - } - break; - - case TCL_PLATFORM_MAC: - needsSep = 1; - for (i = 0; i < argc; i++) { - Tcl_DStringSetLength(&buffer, 0); - p = SplitMacPath(argv[i], &buffer); - if ((*p != ':') && (*p != '\0') - && (strchr(p, ':') != NULL)) { - Tcl_DStringSetLength(resultPtr, oldLength); - length = strlen(p); - Tcl_DStringAppend(resultPtr, p, length); - needsSep = 0; - p += length+1; - } - - /* - * Now append the rest of the path elements, skipping - * : unless it is the first element of the path, and - * watching out for :: et al. so we don't end up with - * too many colons in the result. - */ - - for (; *p != '\0'; p += length+1) { - if (p[0] == ':' && p[1] == '\0') { - if (Tcl_DStringLength(resultPtr) != oldLength) { - p++; - } else { - needsSep = 0; - } - } else { - c = p[1]; - if (*p == ':') { - if (!needsSep) { - p++; - } - } else { - if (needsSep) { - Tcl_DStringAppend(resultPtr, ":", 1); - } - } - needsSep = (c == ':') ? 0 : 1; - } - length = strlen(p); - Tcl_DStringAppend(resultPtr, p, length); - } - } - break; - - } - Tcl_DStringFree(&buffer); - return Tcl_DStringValue(resultPtr); -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_TranslateFileName -- - * - * Converts a file name into a form usable by the native system - * interfaces. If the name starts with a tilde, it will produce a - * name where the tilde and following characters have been replaced - * by the home directory location for the named user. - * - * Results: - * The return value is a pointer to a string containing the name - * after tilde substitution. If there was no tilde substitution, - * the return value is a pointer to a copy of the original string. - * If there was an error in processing the name, then an error - * message is left in the interp's result (if interp was not NULL) - * and the return value is NULL. Space for the return value is - * allocated in bufferPtr; the caller must call Tcl_DStringFree() - * to free the space if the return value was not NULL. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_TranslateFileName(interp, name, bufferPtr) - Tcl_Interp *interp; /* Interpreter in which to store error - * message (if necessary). */ - char *name; /* File name, which may begin with "~" (to - * indicate current user's home directory) or - * "~" (to indicate any user's home - * directory). */ - Tcl_DString *bufferPtr; /* Uninitialized or free DString filled - * with name after tilde substitution. */ -{ - register char *p; - - /* - * Handle tilde substitutions, if needed. - */ - - if (name[0] == '~') { - int argc, length; - char **argv; - Tcl_DString temp; - - Tcl_SplitPath(name, &argc, &argv); - - /* - * Strip the trailing ':' off of a Mac path before passing the user - * name to DoTildeSubst. - */ - - if (tclPlatform == TCL_PLATFORM_MAC) { - length = strlen(argv[0]); - argv[0][length-1] = '\0'; - } - - Tcl_DStringInit(&temp); - argv[0] = DoTildeSubst(interp, argv[0]+1, &temp); - if (argv[0] == NULL) { - Tcl_DStringFree(&temp); - ckfree((char *)argv); - return NULL; - } - Tcl_DStringInit(bufferPtr); - Tcl_JoinPath(argc, argv, bufferPtr); - Tcl_DStringFree(&temp); - ckfree((char*)argv); - } else { - Tcl_DStringInit(bufferPtr); - Tcl_JoinPath(1, &name, bufferPtr); - } - - /* - * Convert forward slashes to backslashes in Windows paths because - * some system interfaces don't accept forward slashes. - */ - - if (tclPlatform == TCL_PLATFORM_WINDOWS) { - for (p = Tcl_DStringValue(bufferPtr); *p != '\0'; p++) { - if (*p == '/') { - *p = '\\'; - } - } - } - return Tcl_DStringValue(bufferPtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclGetExtension -- - * - * This function returns a pointer to the beginning of the - * extension part of a file name. - * - * Results: - * Returns a pointer into name which indicates where the extension - * starts. If there is no extension, returns NULL. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -TclGetExtension(name) - char *name; /* File name to parse. */ -{ - char *p, *lastSep; - - /* - * First find the last directory separator. - */ - - lastSep = NULL; /* Needed only to prevent gcc warnings. */ - switch (tclPlatform) { - case TCL_PLATFORM_UNIX: - lastSep = strrchr(name, '/'); - break; - - case TCL_PLATFORM_MAC: - if (strchr(name, ':') == NULL) { - lastSep = strrchr(name, '/'); - } else { - lastSep = strrchr(name, ':'); - } - break; - - case TCL_PLATFORM_WINDOWS: - lastSep = NULL; - for (p = name; *p != '\0'; p++) { - if (strchr("/\\:", *p) != NULL) { - lastSep = p; - } - } - break; - } - p = strrchr(name, '.'); - if ((p != NULL) && (lastSep != NULL) - && (lastSep > p)) { - p = NULL; - } - - /* - * In earlier versions, we used to back up to the first period in a series - * so that "foo..o" would be split into "foo" and "..o". This is a - * confusing and usually incorrect behavior, so now we split at the last - * period in the name. - */ - - return p; -} - -/* - *---------------------------------------------------------------------- - * - * DoTildeSubst -- - * - * Given a string following a tilde, this routine returns the - * corresponding home directory. - * - * Results: - * The result is a pointer to a static string containing the home - * directory in native format. If there was an error in processing - * the substitution, then an error message is left in the interp's - * result and the return value is NULL. On success, the results - * are appended to resultPtr, and the contents of resultPtr are - * returned. - * - * Side effects: - * Information may be left in resultPtr. - * - *---------------------------------------------------------------------- - */ - -static char * -DoTildeSubst(interp, user, resultPtr) - Tcl_Interp *interp; /* Interpreter in which to store error - * message (if necessary). */ - CONST char *user; /* Name of user whose home directory should be - * substituted, or "" for current user. */ - Tcl_DString *resultPtr; /* Initialized DString filled with name - * after tilde substitution. */ -{ - char *dir; - - if (*user == '\0') { - Tcl_DString dirString; - - dir = TclGetEnv("HOME", &dirString); - if (dir == NULL) { - if (interp) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "couldn't find HOME environment ", - "variable to expand path", (char *) NULL); - } - return NULL; - } - Tcl_JoinPath(1, &dir, resultPtr); - Tcl_DStringFree(&dirString); - } else { - if (TclpGetUserHome(user, resultPtr) == NULL) { - if (interp) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "user \"", user, "\" doesn't exist", - (char *) NULL); - } - return NULL; - } - } - return resultPtr->string; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GlobObjCmd -- - * - * This procedure is invoked to process the "glob" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_GlobObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int index, i, noComplain, skip, length; - char *string; - static char *options[] = {"-nocomplain", "--", NULL}; - enum options {GLOB_NOCOMPLAIN, GLOB_LAST}; - - noComplain = 0; - for (skip = 1; skip < objc; skip++) { - string = Tcl_GetString(objv[skip]); - if (string[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[skip], options, "switch", - TCL_EXACT, &index) != TCL_OK) { - return TCL_ERROR; - } - if (index == GLOB_NOCOMPLAIN) { - noComplain = 1; - } else { - skip++; - break; - } - } - if (skip >= objc) { - Tcl_WrongNumArgs(interp, 1, objv, "?switches? name ?name ...?"); - return TCL_ERROR; - } - - for (i = skip; i < objc; i++) { - string = Tcl_GetString(objv[i]); - if (TclGlob(interp, string, noComplain) != TCL_OK) { - return TCL_ERROR; - } - } - if (noComplain == 0) { - Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length); - if (length == 0) { - char *sep = ""; - - Tcl_AppendResult(interp, "no files matched glob pattern", - (objc == 2) ? " \"" : "s \"", (char *) NULL); - for (i = skip; i < objc; i++) { - string = Tcl_GetString(objv[i]); - Tcl_AppendResult(interp, sep, string, (char *) NULL); - sep = " "; - } - Tcl_AppendResult(interp, "\"", (char *) NULL); - return TCL_ERROR; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclGlob -- - * - * This procedure prepares arguments for the TclDoGlob call. - * It sets the separator string based on the platform, performs - * tilde substitution, and calls TclDoGlob. - * - * Results: - * The return value is a standard Tcl result indicating whether - * an error occurred in globbing. After a normal return the - * result in interp (set by TclDoGlob) holds all of the file names - * given by the dir and rem arguments. After an error the - * result in interp will hold an error message. - * - * Side effects: - * The currentArgString is written to. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -TclGlob(interp, pattern, noComplain) - Tcl_Interp *interp; /* Interpreter for returning error message - * or appending list of matching file names. */ - char *pattern; /* Glob pattern to match. Must not refer - * to a static string. */ - int noComplain; /* Flag to turn off storing error messages - * in interp. */ -{ - char *separators; - char *head, *tail; - char c; - int result; - Tcl_DString buffer; - - separators = NULL; /* lint. */ - switch (tclPlatform) { - case TCL_PLATFORM_UNIX: - separators = "/"; - break; - case TCL_PLATFORM_WINDOWS: - separators = "/\\:"; - break; - case TCL_PLATFORM_MAC: - separators = (strchr(pattern, ':') == NULL) - ? "/" : ":"; - break; - } - - Tcl_DStringInit(&buffer); - - /* - * Perform tilde substitution, if needed. - */ - - if (pattern[0] == '~') { - char *p; - - /* - * Find the first path separator after the tilde. - */ - - for (tail = pattern; *tail != '\0'; tail++) { - if (*tail == '\\') { - if (strchr(separators, tail[1]) != NULL) { - break; - } - } else if (strchr(separators, *tail) != NULL) { - break; - } - } - - /* - * Determine the home directory for the specified user. Note that - * we don't allow special characters in the user name. - */ - - c = *tail; - *tail = '\0'; - p = strpbrk(pattern+1, "\\[]*?{}"); - if (p == NULL) { - head = DoTildeSubst(interp, pattern+1, &buffer); - } else { - if (!noComplain) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "globbing characters not ", - "supported in user names", (char *) NULL); - } - head = NULL; - } - *tail = c; - if (head == NULL) { - if (noComplain) { - /* - * We should in fact pass down the nocomplain flag - * or save the interp result or use another mechanism - * so the interp result is not mangled on errors in that case. - * but that would a bigger change than reasonable for a patch - * release. - * (see fileName.test 15.2-15.4 for expected behaviour) - */ - Tcl_ResetResult(interp); - return TCL_OK; - } else { - return TCL_ERROR; - } - } - if (head != Tcl_DStringValue(&buffer)) { - Tcl_DStringAppend(&buffer, head, -1); - } - } else { - tail = pattern; - } - - result = TclDoGlob(interp, separators, &buffer, tail); - Tcl_DStringFree(&buffer); - if (result != TCL_OK) { - if (noComplain) { - Tcl_ResetResult(interp); - return TCL_OK; - } - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * SkipToChar -- - * - * This function traverses a glob pattern looking for the next - * unquoted occurance of the specified character at the same braces - * nesting level. - * - * Results: - * Updates stringPtr to point to the matching character, or to - * the end of the string if nothing matched. The return value - * is 1 if a match was found at the top level, otherwise it is 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -SkipToChar(stringPtr, match) - char **stringPtr; /* Pointer string to check. */ - char *match; /* Pointer to character to find. */ -{ - int quoted, level; - register char *p; - - quoted = 0; - level = 0; - - for (p = *stringPtr; *p != '\0'; p++) { - if (quoted) { - quoted = 0; - continue; - } - if ((level == 0) && (*p == *match)) { - *stringPtr = p; - return 1; - } - if (*p == '{') { - level++; - } else if (*p == '}') { - level--; - } else if (*p == '\\') { - quoted = 1; - } - } - *stringPtr = p; - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclDoGlob -- - * - * This recursive procedure forms the heart of the globbing - * code. It performs a depth-first traversal of the tree - * given by the path name to be globbed. The directory and - * remainder are assumed to be native format paths. - * - * Results: - * The return value is a standard Tcl result indicating whether - * an error occurred in globbing. After a normal return the - * result in interp will be set to hold all of the file names - * given by the dir and rem arguments. After an error the - * result in interp will hold an error message. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclDoGlob(interp, separators, headPtr, tail) - Tcl_Interp *interp; /* Interpreter to use for error reporting - * (e.g. unmatched brace). */ - char *separators; /* String containing separator characters - * that should be used to identify globbing - * boundaries. */ - Tcl_DString *headPtr; /* Completely expanded prefix. */ - char *tail; /* The unexpanded remainder of the path. - * Must not be a pointer to a static string. */ -{ - int baseLength, quoted, count; - int result = TCL_OK; - char *name, *p, *openBrace, *closeBrace, *firstSpecialChar, savedChar; - char lastChar = 0; - int length = Tcl_DStringLength(headPtr); - - if (length > 0) { - lastChar = Tcl_DStringValue(headPtr)[length-1]; - } - - /* - * Consume any leading directory separators, leaving tail pointing - * just past the last initial separator. - */ - - count = 0; - name = tail; - for (; *tail != '\0'; tail++) { - if ((*tail == '\\') && (strchr(separators, tail[1]) != NULL)) { - tail++; - } else if (strchr(separators, *tail) == NULL) { - break; - } - count++; - } - - /* - * Deal with path separators. On the Mac, we have to watch out - * for multiple separators, since they are special in Mac-style - * paths. - */ - - switch (tclPlatform) { - case TCL_PLATFORM_MAC: - if (*separators == '/') { - if (((length == 0) && (count == 0)) - || ((length > 0) && (lastChar != ':'))) { - Tcl_DStringAppend(headPtr, ":", 1); - } - } else { - if (count == 0) { - if ((length > 0) && (lastChar != ':')) { - Tcl_DStringAppend(headPtr, ":", 1); - } - } else { - if (lastChar == ':') { - count--; - } - while (count-- > 0) { - Tcl_DStringAppend(headPtr, ":", 1); - } - } - } - break; - case TCL_PLATFORM_WINDOWS: - /* - * If this is a drive relative path, add the colon and the - * trailing slash if needed. Otherwise add the slash if - * this is the first absolute element, or a later relative - * element. Add an extra slash if this is a UNC path. - */ - - if (*name == ':') { - Tcl_DStringAppend(headPtr, ":", 1); - if (count > 1) { - Tcl_DStringAppend(headPtr, "/", 1); - } - } else if ((*tail != '\0') - && (((length > 0) - && (strchr(separators, lastChar) == NULL)) - || ((length == 0) && (count > 0)))) { - Tcl_DStringAppend(headPtr, "/", 1); - if ((length == 0) && (count > 1)) { - Tcl_DStringAppend(headPtr, "/", 1); - } - } - - break; - case TCL_PLATFORM_UNIX: - /* - * Add a separator if this is the first absolute element, or - * a later relative element. - */ - - if ((*tail != '\0') - && (((length > 0) - && (strchr(separators, lastChar) == NULL)) - || ((length == 0) && (count > 0)))) { - Tcl_DStringAppend(headPtr, "/", 1); - } - break; - } - - /* - * Look for the first matching pair of braces or the first - * directory separator that is not inside a pair of braces. - */ - - openBrace = closeBrace = NULL; - quoted = 0; - for (p = tail; *p != '\0'; p++) { - if (quoted) { - quoted = 0; - } else if (*p == '\\') { - quoted = 1; - if (strchr(separators, p[1]) != NULL) { - break; /* Quoted directory separator. */ - } - } else if (strchr(separators, *p) != NULL) { - break; /* Unquoted directory separator. */ - } else if (*p == '{') { - openBrace = p; - p++; - if (SkipToChar(&p, "}")) { - closeBrace = p; /* Balanced braces. */ - break; - } - Tcl_SetResult(interp, "unmatched open-brace in file name", - TCL_STATIC); - return TCL_ERROR; - } else if (*p == '}') { - Tcl_SetResult(interp, "unmatched close-brace in file name", - TCL_STATIC); - return TCL_ERROR; - } - } - - /* - * Substitute the alternate patterns from the braces and recurse. - */ - - if (openBrace != NULL) { - char *element; - Tcl_DString newName; - Tcl_DStringInit(&newName); - - /* - * For each element within in the outermost pair of braces, - * append the element and the remainder to the fixed portion - * before the first brace and recursively call TclDoGlob. - */ - - Tcl_DStringAppend(&newName, tail, openBrace-tail); - baseLength = Tcl_DStringLength(&newName); - length = Tcl_DStringLength(headPtr); - *closeBrace = '\0'; - for (p = openBrace; p != closeBrace; ) { - p++; - element = p; - SkipToChar(&p, ","); - Tcl_DStringSetLength(headPtr, length); - Tcl_DStringSetLength(&newName, baseLength); - Tcl_DStringAppend(&newName, element, p-element); - Tcl_DStringAppend(&newName, closeBrace+1, -1); - result = TclDoGlob(interp, separators, - headPtr, Tcl_DStringValue(&newName)); - if (result != TCL_OK) { - break; - } - } - *closeBrace = '}'; - Tcl_DStringFree(&newName); - return result; - } - - /* - * At this point, there are no more brace substitutions to perform on - * this path component. The variable p is pointing at a quoted or - * unquoted directory separator or the end of the string. So we need - * to check for special globbing characters in the current pattern. - * We avoid modifying tail if p is pointing at the end of the string. - */ - - if (*p != '\0') { - - /* - * Note that we are modifying the string in place. This won't work - * if the string is a static. - */ - - savedChar = *p; - *p = '\0'; - firstSpecialChar = strpbrk(tail, "*[]?\\"); - *p = savedChar; - } else { - firstSpecialChar = strpbrk(tail, "*[]?\\"); - } - - if (firstSpecialChar != NULL) { - /* - * Look for matching files in the current directory. The - * implementation of this function is platform specific, but may - * recursively call TclDoGlob. For each file that matches, it will - * add the match onto the interp's result, or call TclDoGlob if there - * are more characters to be processed. - */ - - return TclpMatchFiles(interp, separators, headPtr, tail, p); - } - Tcl_DStringAppend(headPtr, tail, p-tail); - if (*p != '\0') { - return TclDoGlob(interp, separators, headPtr, p); - } - - /* - * There are no more wildcards in the pattern and no more unprocessed - * characters in the tail, so now we can construct the path and verify - * the existence of the file. - */ - - switch (tclPlatform) { - case TCL_PLATFORM_MAC: { - if (strchr(Tcl_DStringValue(headPtr), ':') == NULL) { - Tcl_DStringAppend(headPtr, ":", 1); - } - name = Tcl_DStringValue(headPtr); - if (TclpAccess(name, F_OK) == 0) { - if ((name[1] != '\0') && (strchr(name+1, ':') == NULL)) { - Tcl_AppendElement(interp, name + 1); - } else { - Tcl_AppendElement(interp, name); - } - } - break; - } - case TCL_PLATFORM_WINDOWS: { - int exists; - - /* - * We need to convert slashes to backslashes before checking - * for the existence of the file. Once we are done, we need - * to convert the slashes back. - */ - - if (Tcl_DStringLength(headPtr) == 0) { - if (((*name == '\\') && (name[1] == '/' || name[1] == '\\')) - || (*name == '/')) { - Tcl_DStringAppend(headPtr, "\\", 1); - } else { - Tcl_DStringAppend(headPtr, ".", 1); - } - } else { - for (p = Tcl_DStringValue(headPtr); *p != '\0'; p++) { - if (*p == '/') { - *p = '\\'; - } - } - } - name = Tcl_DStringValue(headPtr); - exists = (TclpAccess(name, F_OK) == 0); - - for (p = name; *p != '\0'; p++) { - if (*p == '\\') { - *p = '/'; - } - } - if (exists) { - Tcl_AppendElement(interp, name); - } - break; - } - case TCL_PLATFORM_UNIX: { - if (Tcl_DStringLength(headPtr) == 0) { - if ((*name == '\\' && name[1] == '/') || (*name == '/')) { - Tcl_DStringAppend(headPtr, "/", 1); - } else { - Tcl_DStringAppend(headPtr, ".", 1); - } - } - name = Tcl_DStringValue(headPtr); - if (TclpAccess(name, F_OK) == 0) { - Tcl_AppendElement(interp, name); - } - break; - } - } - - return TCL_OK; -} diff --git a/generic/tclGet.c b/generic/tclGet.c deleted file mode 100644 index 27e49cc..0000000 --- a/generic/tclGet.c +++ /dev/null @@ -1,320 +0,0 @@ -/* - * tclGet.c -- - * - * This file contains procedures to convert strings into - * other forms, like integers or floating-point numbers or - * booleans, doing syntax checking along the way. - * - * Copyright (c) 1990-1993 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. - * - * RCS: @(#) $Id: tclGet.c,v 1.3 1999/04/16 00:46:46 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetInt -- - * - * Given a string, produce the corresponding integer value. - * - * Results: - * The return value is normally TCL_OK; in this case *intPtr - * will be set to the integer value equivalent to string. If - * string is improperly formed then TCL_ERROR is returned and - * an error message will be left in the interp's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetInt(interp, string, intPtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting. */ - char *string; /* String containing a (possibly signed) - * integer in a form acceptable to strtol. */ - int *intPtr; /* Place to store converted result. */ -{ - char *end, *p; - long i; - - /* - * Note: use strtoul instead of strtol for integer conversions - * to allow full-size unsigned numbers, but don't depend on strtoul - * to handle sign characters; it won't in some implementations. - */ - - errno = 0; - for (p = string; isspace(UCHAR(*p)); p++) { /* INTL: ISO space. */ - /* Empty loop body. */ - } - if (*p == '-') { - p++; - i = -((long)strtoul(p, &end, 0)); /* INTL: Tcl source. */ - } else if (*p == '+') { - p++; - i = strtoul(p, &end, 0); /* INTL: Tcl source. */ - } else { - i = strtoul(p, &end, 0); /* INTL: Tcl source. */ - } - if (end == p) { - badInteger: - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "expected integer but got \"", string, - "\"", (char *) NULL); - } - return TCL_ERROR; - } - - /* - * The second test below is needed on platforms where "long" is - * larger than "int" to detect values that fit in a long but not in - * an int. - */ - - if ((errno == ERANGE) || (((long)(int) i) != i)) { - if (interp != (Tcl_Interp *) NULL) { - Tcl_SetResult(interp, "integer value too large to represent", - TCL_STATIC); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", - Tcl_GetStringResult(interp), (char *) NULL); - } - return TCL_ERROR; - } - while ((*end != '\0') && isspace(UCHAR(*end))) { /* INTL: ISO space. */ - end++; - } - if (*end != 0) { - goto badInteger; - } - *intPtr = (int) i; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclGetLong -- - * - * Given a string, produce the corresponding long integer value. - * This routine is a version of Tcl_GetInt but returns a "long" - * instead of an "int". - * - * Results: - * The return value is normally TCL_OK; in this case *longPtr - * will be set to the long integer value equivalent to string. If - * string is improperly formed then TCL_ERROR is returned and - * an error message will be left in the interp's result if interp - * is non-NULL. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclGetLong(interp, string, longPtr) - Tcl_Interp *interp; /* Interpreter used for error reporting - * if not NULL. */ - char *string; /* String containing a (possibly signed) - * long integer in a form acceptable to - * strtoul. */ - long *longPtr; /* Place to store converted long result. */ -{ - char *end, *p; - long i; - - /* - * Note: don't depend on strtoul to handle sign characters; it won't - * in some implementations. - */ - - errno = 0; - for (p = string; isspace(UCHAR(*p)); p++) { /* INTL: ISO space. */ - /* Empty loop body. */ - } - if (*p == '-') { - p++; - i = -(int)strtoul(p, &end, 0); /* INTL: Tcl source. */ - } else if (*p == '+') { - p++; - i = strtoul(p, &end, 0); /* INTL: Tcl source. */ - } else { - i = strtoul(p, &end, 0); /* INTL: Tcl source. */ - } - if (end == p) { - badInteger: - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "expected integer but got \"", string, - "\"", (char *) NULL); - } - return TCL_ERROR; - } - if (errno == ERANGE) { - if (interp != (Tcl_Interp *) NULL) { - Tcl_SetResult(interp, "integer value too large to represent", - TCL_STATIC); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", - Tcl_GetStringResult(interp), (char *) NULL); - } - return TCL_ERROR; - } - while ((*end != '\0') && isspace(UCHAR(*end))) { /* INTL: ISO space. */ - end++; - } - if (*end != 0) { - goto badInteger; - } - *longPtr = i; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetDouble -- - * - * Given a string, produce the corresponding double-precision - * floating-point value. - * - * Results: - * The return value is normally TCL_OK; in this case *doublePtr - * will be set to the double-precision value equivalent to string. - * If string is improperly formed then TCL_ERROR is returned and - * an error message will be left in the interp's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetDouble(interp, string, doublePtr) - Tcl_Interp *interp; /* Interpreter used for error reporting. */ - char *string; /* String containing a floating-point number - * in a form acceptable to strtod. */ - double *doublePtr; /* Place to store converted result. */ -{ - char *end; - double d; - - errno = 0; - d = strtod(string, &end); /* INTL: Tcl source. */ - if (end == string) { - badDouble: - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, - "expected floating-point number but got \"", - string, "\"", (char *) NULL); - } - return TCL_ERROR; - } - if (errno != 0) { - if (interp != (Tcl_Interp *) NULL) { - TclExprFloatError(interp, d); - } - return TCL_ERROR; - } - while ((*end != 0) && isspace(UCHAR(*end))) { /* INTL: ISO space. */ - end++; - } - if (*end != 0) { - goto badDouble; - } - *doublePtr = d; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetBoolean -- - * - * Given a string, return a 0/1 boolean value corresponding - * to the string. - * - * Results: - * The return value is normally TCL_OK; in this case *boolPtr - * will be set to the 0/1 value equivalent to string. If - * string is improperly formed then TCL_ERROR is returned and - * an error message will be left in the interp's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetBoolean(interp, string, boolPtr) - Tcl_Interp *interp; /* Interpreter used for error reporting. */ - char *string; /* String containing a boolean number - * specified either as 1/0 or true/false or - * yes/no. */ - int *boolPtr; /* Place to store converted result, which - * will be 0 or 1. */ -{ - int i; - char lowerCase[10], c; - size_t length; - - /* - * Convert the input string to all lower-case. - * INTL: This code will work on UTF strings. - */ - - for (i = 0; i < 9; i++) { - c = string[i]; - if (c == 0) { - break; - } - if ((c >= 'A') && (c <= 'Z')) { - c += (char) ('a' - 'A'); - } - lowerCase[i] = c; - } - lowerCase[i] = 0; - - length = strlen(lowerCase); - c = lowerCase[0]; - if ((c == '0') && (lowerCase[1] == '\0')) { - *boolPtr = 0; - } else if ((c == '1') && (lowerCase[1] == '\0')) { - *boolPtr = 1; - } else if ((c == 'y') && (strncmp(lowerCase, "yes", length) == 0)) { - *boolPtr = 1; - } else if ((c == 'n') && (strncmp(lowerCase, "no", length) == 0)) { - *boolPtr = 0; - } else if ((c == 't') && (strncmp(lowerCase, "true", length) == 0)) { - *boolPtr = 1; - } else if ((c == 'f') && (strncmp(lowerCase, "false", length) == 0)) { - *boolPtr = 0; - } else if ((c == 'o') && (length >= 2)) { - if (strncmp(lowerCase, "on", length) == 0) { - *boolPtr = 1; - } else if (strncmp(lowerCase, "off", length) == 0) { - *boolPtr = 0; - } else { - goto badBoolean; - } - } else { - badBoolean: - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "expected boolean value but got \"", - string, "\"", (char *) NULL); - } - return TCL_ERROR; - } - return TCL_OK; -} diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y deleted file mode 100644 index 2f519dce..0000000 --- a/generic/tclGetDate.y +++ /dev/null @@ -1,958 +0,0 @@ -/* - * tclGetDate.y -- - * - * Contains yacc grammar for parsing date and time strings. - * The output of this file should be the file tclDate.c which - * is used directly in the Tcl sources. - * - * Copyright (c) 1992-1995 Karl Lehenbauer and Mark Diekhans. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclGetDate.y,v 1.4 1999/04/16 00:46:46 stanton Exp $ - */ - -%{ -/* - * tclDate.c -- - * - * This file is generated from a yacc grammar defined in - * the file tclGetDate.y. It should not be edited directly. - * - * Copyright (c) 1992-1995 Karl Lehenbauer and Mark Diekhans. - * Copyright (c) 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. - * - * SCCSID - */ - -#include "tclInt.h" -#include "tclPort.h" - -#ifdef MAC_TCL -# define EPOCH 1904 -# define START_OF_TIME 1904 -# define END_OF_TIME 2039 -#else -# define EPOCH 1970 -# define START_OF_TIME 1902 -# define END_OF_TIME 2037 -#endif - -/* - * The offset of tm_year of struct tm returned by localtime, gmtime, etc. - * I don't know how universal this is; K&R II, the NetBSD manpages, and - * ../compat/strftime.c all agree that tm_year is the year-1900. However, - * some systems may have a different value. This #define should be the - * same as in ../compat/strftime.c. - */ -#define TM_YEAR_BASE 1900 - -#define HOUR(x) ((int) (60 * x)) -#define SECSPERDAY (24L * 60L * 60L) - - -/* - * An entry in the lexical lookup table. - */ -typedef struct _TABLE { - char *name; - int type; - time_t value; -} TABLE; - - -/* - * Daylight-savings mode: on, off, or not yet known. - */ -typedef enum _DSTMODE { - DSTon, DSToff, DSTmaybe -} DSTMODE; - -/* - * Meridian: am, pm, or 24-hour style. - */ -typedef enum _MERIDIAN { - MERam, MERpm, MER24 -} MERIDIAN; - - -/* - * Global variables. We could get rid of most of these by using a good - * union as the yacc stack. (This routine was originally written before - * yacc had the %union construct.) Maybe someday; right now we only use - * the %union very rarely. - */ -static char *yyInput; -static DSTMODE yyDSTmode; -static time_t yyDayOrdinal; -static time_t yyDayNumber; -static int yyHaveDate; -static int yyHaveDay; -static int yyHaveRel; -static int yyHaveTime; -static int yyHaveZone; -static time_t yyTimezone; -static time_t yyDay; -static time_t yyHour; -static time_t yyMinutes; -static time_t yyMonth; -static time_t yySeconds; -static time_t yyYear; -static MERIDIAN yyMeridian; -static time_t yyRelMonth; -static time_t yyRelSeconds; - - -/* - * Prototypes of internal functions. - */ -static void yyerror _ANSI_ARGS_((char *s)); -static time_t ToSeconds _ANSI_ARGS_((time_t Hours, time_t Minutes, - time_t Seconds, MERIDIAN Meridian)); -static int Convert _ANSI_ARGS_((time_t Month, time_t Day, time_t Year, - time_t Hours, time_t Minutes, time_t Seconds, - MERIDIAN Meridia, DSTMODE DSTmode, time_t *TimePtr)); -static time_t DSTcorrect _ANSI_ARGS_((time_t Start, time_t Future)); -static time_t RelativeDate _ANSI_ARGS_((time_t Start, time_t DayOrdinal, - time_t DayNumber)); -static int RelativeMonth _ANSI_ARGS_((time_t Start, time_t RelMonth, - time_t *TimePtr)); -static int LookupWord _ANSI_ARGS_((char *buff)); -static int yylex _ANSI_ARGS_((void)); - -int -yyparse _ANSI_ARGS_((void)); -%} - -%union { - time_t Number; - enum _MERIDIAN Meridian; -} - -%token tAGO tDAY tDAYZONE tID tMERIDIAN tMINUTE_UNIT tMONTH tMONTH_UNIT -%token tSEC_UNIT tSNUMBER tUNUMBER tZONE tEPOCH tDST - -%type tDAY tDAYZONE tMINUTE_UNIT tMONTH tMONTH_UNIT tDST -%type tSEC_UNIT tSNUMBER tUNUMBER tZONE -%type tMERIDIAN o_merid - -%% - -spec : /* NULL */ - | spec item - ; - -item : time { - yyHaveTime++; - } - | zone { - yyHaveZone++; - } - | date { - yyHaveDate++; - } - | day { - yyHaveDay++; - } - | rel { - yyHaveRel++; - } - | number - ; - -time : tUNUMBER tMERIDIAN { - yyHour = $1; - yyMinutes = 0; - yySeconds = 0; - yyMeridian = $2; - } - | tUNUMBER ':' tUNUMBER o_merid { - yyHour = $1; - yyMinutes = $3; - yySeconds = 0; - yyMeridian = $4; - } - | tUNUMBER ':' tUNUMBER tSNUMBER { - yyHour = $1; - yyMinutes = $3; - yyMeridian = MER24; - yyDSTmode = DSToff; - yyTimezone = - ($4 % 100 + ($4 / 100) * 60); - } - | tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid { - yyHour = $1; - yyMinutes = $3; - yySeconds = $5; - yyMeridian = $6; - } - | tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER { - yyHour = $1; - yyMinutes = $3; - yySeconds = $5; - yyMeridian = MER24; - yyDSTmode = DSToff; - yyTimezone = - ($6 % 100 + ($6 / 100) * 60); - } - ; - -zone : tZONE tDST { - yyTimezone = $1; - yyDSTmode = DSTon; - } - | tZONE { - yyTimezone = $1; - yyDSTmode = DSToff; - } - | tDAYZONE { - yyTimezone = $1; - yyDSTmode = DSTon; - } - ; - -day : tDAY { - yyDayOrdinal = 1; - yyDayNumber = $1; - } - | tDAY ',' { - yyDayOrdinal = 1; - yyDayNumber = $1; - } - | tUNUMBER tDAY { - yyDayOrdinal = $1; - yyDayNumber = $2; - } - ; - -date : tUNUMBER '/' tUNUMBER { - yyMonth = $1; - yyDay = $3; - } - | tUNUMBER '/' tUNUMBER '/' tUNUMBER { - yyMonth = $1; - yyDay = $3; - yyYear = $5; - } - | tMONTH tUNUMBER { - yyMonth = $1; - yyDay = $2; - } - | tMONTH tUNUMBER ',' tUNUMBER { - yyMonth = $1; - yyDay = $2; - yyYear = $4; - } - | tUNUMBER tMONTH { - yyMonth = $2; - yyDay = $1; - } - | tEPOCH { - yyMonth = 1; - yyDay = 1; - yyYear = EPOCH; - } - | tUNUMBER tMONTH tUNUMBER { - yyMonth = $2; - yyDay = $1; - yyYear = $3; - } - ; - -rel : relunit tAGO { - yyRelSeconds = -yyRelSeconds; - yyRelMonth = -yyRelMonth; - } - | relunit - ; - -relunit : tUNUMBER tMINUTE_UNIT { - yyRelSeconds += $1 * $2 * 60L; - } - | tSNUMBER tMINUTE_UNIT { - yyRelSeconds += $1 * $2 * 60L; - } - | tMINUTE_UNIT { - yyRelSeconds += $1 * 60L; - } - | tSNUMBER tSEC_UNIT { - yyRelSeconds += $1; - } - | tUNUMBER tSEC_UNIT { - yyRelSeconds += $1; - } - | tSEC_UNIT { - yyRelSeconds++; - } - | tSNUMBER tMONTH_UNIT { - yyRelMonth += $1 * $2; - } - | tUNUMBER tMONTH_UNIT { - yyRelMonth += $1 * $2; - } - | tMONTH_UNIT { - yyRelMonth += $1; - } - ; - -number : tUNUMBER - { - if (yyHaveTime && yyHaveDate && !yyHaveRel) { - yyYear = $1; - } else { - yyHaveTime++; - if ($1 < 100) { - yyHour = 0; - yyMinutes = $1; - } else { - yyHour = $1 / 100; - yyMinutes = $1 % 100; - } - yySeconds = 0; - yyMeridian = MER24; - } - } -; - -o_merid : /* NULL */ { - $$ = MER24; - } - | tMERIDIAN { - $$ = $1; - } - ; - -%% - -/* - * Month and day table. - */ -static TABLE MonthDayTable[] = { - { "january", tMONTH, 1 }, - { "february", tMONTH, 2 }, - { "march", tMONTH, 3 }, - { "april", tMONTH, 4 }, - { "may", tMONTH, 5 }, - { "june", tMONTH, 6 }, - { "july", tMONTH, 7 }, - { "august", tMONTH, 8 }, - { "september", tMONTH, 9 }, - { "sept", tMONTH, 9 }, - { "october", tMONTH, 10 }, - { "november", tMONTH, 11 }, - { "december", tMONTH, 12 }, - { "sunday", tDAY, 0 }, - { "monday", tDAY, 1 }, - { "tuesday", tDAY, 2 }, - { "tues", tDAY, 2 }, - { "wednesday", tDAY, 3 }, - { "wednes", tDAY, 3 }, - { "thursday", tDAY, 4 }, - { "thur", tDAY, 4 }, - { "thurs", tDAY, 4 }, - { "friday", tDAY, 5 }, - { "saturday", tDAY, 6 }, - { NULL } -}; - -/* - * Time units table. - */ -static TABLE UnitsTable[] = { - { "year", tMONTH_UNIT, 12 }, - { "month", tMONTH_UNIT, 1 }, - { "fortnight", tMINUTE_UNIT, 14 * 24 * 60 }, - { "week", tMINUTE_UNIT, 7 * 24 * 60 }, - { "day", tMINUTE_UNIT, 1 * 24 * 60 }, - { "hour", tMINUTE_UNIT, 60 }, - { "minute", tMINUTE_UNIT, 1 }, - { "min", tMINUTE_UNIT, 1 }, - { "second", tSEC_UNIT, 1 }, - { "sec", tSEC_UNIT, 1 }, - { NULL } -}; - -/* - * Assorted relative-time words. - */ -static TABLE OtherTable[] = { - { "tomorrow", tMINUTE_UNIT, 1 * 24 * 60 }, - { "yesterday", tMINUTE_UNIT, -1 * 24 * 60 }, - { "today", tMINUTE_UNIT, 0 }, - { "now", tMINUTE_UNIT, 0 }, - { "last", tUNUMBER, -1 }, - { "this", tMINUTE_UNIT, 0 }, - { "next", tUNUMBER, 2 }, -#if 0 - { "first", tUNUMBER, 1 }, -/* { "second", tUNUMBER, 2 }, */ - { "third", tUNUMBER, 3 }, - { "fourth", tUNUMBER, 4 }, - { "fifth", tUNUMBER, 5 }, - { "sixth", tUNUMBER, 6 }, - { "seventh", tUNUMBER, 7 }, - { "eighth", tUNUMBER, 8 }, - { "ninth", tUNUMBER, 9 }, - { "tenth", tUNUMBER, 10 }, - { "eleventh", tUNUMBER, 11 }, - { "twelfth", tUNUMBER, 12 }, -#endif - { "ago", tAGO, 1 }, - { "epoch", tEPOCH, 0 }, - { NULL } -}; - -/* - * The timezone table. (Note: This table was modified to not use any floating - * point constants to work around an SGI compiler bug). - */ -static TABLE TimezoneTable[] = { - { "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */ - { "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */ - { "utc", tZONE, HOUR( 0) }, - { "wet", tZONE, HOUR( 0) } , /* Western European */ - { "bst", tDAYZONE, HOUR( 0) }, /* British Summer */ - { "wat", tZONE, HOUR( 1) }, /* West Africa */ - { "at", tZONE, HOUR( 2) }, /* Azores */ -#if 0 - /* For completeness. BST is also British Summer, and GST is - * also Guam Standard. */ - { "bst", tZONE, HOUR( 3) }, /* Brazil Standard */ - { "gst", tZONE, HOUR( 3) }, /* Greenland Standard */ -#endif - { "nft", tZONE, HOUR( 7/2) }, /* Newfoundland */ - { "nst", tZONE, HOUR( 7/2) }, /* Newfoundland Standard */ - { "ndt", tDAYZONE, HOUR( 7/2) }, /* Newfoundland Daylight */ - { "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */ - { "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */ - { "est", tZONE, HOUR( 5) }, /* Eastern Standard */ - { "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */ - { "cst", tZONE, HOUR( 6) }, /* Central Standard */ - { "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */ - { "mst", tZONE, HOUR( 7) }, /* Mountain Standard */ - { "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */ - { "pst", tZONE, HOUR( 8) }, /* Pacific Standard */ - { "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */ - { "yst", tZONE, HOUR( 9) }, /* Yukon Standard */ - { "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */ - { "hst", tZONE, HOUR(10) }, /* Hawaii Standard */ - { "hdt", tDAYZONE, HOUR(10) }, /* Hawaii Daylight */ - { "cat", tZONE, HOUR(10) }, /* Central Alaska */ - { "ahst", tZONE, HOUR(10) }, /* Alaska-Hawaii Standard */ - { "nt", tZONE, HOUR(11) }, /* Nome */ - { "idlw", tZONE, HOUR(12) }, /* International Date Line West */ - { "cet", tZONE, -HOUR( 1) }, /* Central European */ - { "met", tZONE, -HOUR( 1) }, /* Middle European */ - { "mewt", tZONE, -HOUR( 1) }, /* Middle European Winter */ - { "mest", tDAYZONE, -HOUR( 1) }, /* Middle European Summer */ - { "swt", tZONE, -HOUR( 1) }, /* Swedish Winter */ - { "sst", tDAYZONE, -HOUR( 1) }, /* Swedish Summer */ - { "fwt", tZONE, -HOUR( 1) }, /* French Winter */ - { "fst", tDAYZONE, -HOUR( 1) }, /* French Summer */ - { "eet", tZONE, -HOUR( 2) }, /* Eastern Europe, USSR Zone 1 */ - { "bt", tZONE, -HOUR( 3) }, /* Baghdad, USSR Zone 2 */ - { "it", tZONE, -HOUR( 7/2) }, /* Iran */ - { "zp4", tZONE, -HOUR( 4) }, /* USSR Zone 3 */ - { "zp5", tZONE, -HOUR( 5) }, /* USSR Zone 4 */ - { "ist", tZONE, -HOUR(11/2) }, /* Indian Standard */ - { "zp6", tZONE, -HOUR( 6) }, /* USSR Zone 5 */ -#if 0 - /* For completeness. NST is also Newfoundland Stanard, nad SST is - * also Swedish Summer. */ - { "nst", tZONE, -HOUR(13/2) }, /* North Sumatra */ - { "sst", tZONE, -HOUR( 7) }, /* South Sumatra, USSR Zone 6 */ -#endif /* 0 */ - { "wast", tZONE, -HOUR( 7) }, /* West Australian Standard */ - { "wadt", tDAYZONE, -HOUR( 7) }, /* West Australian Daylight */ - { "jt", tZONE, -HOUR(15/2) }, /* Java (3pm in Cronusland!) */ - { "cct", tZONE, -HOUR( 8) }, /* China Coast, USSR Zone 7 */ - { "jst", tZONE, -HOUR( 9) }, /* Japan Standard, USSR Zone 8 */ - { "cast", tZONE, -HOUR(19/2) }, /* Central Australian Standard */ - { "cadt", tDAYZONE, -HOUR(19/2) }, /* Central Australian Daylight */ - { "east", tZONE, -HOUR(10) }, /* Eastern Australian Standard */ - { "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylight */ - { "gst", tZONE, -HOUR(10) }, /* Guam Standard, USSR Zone 9 */ - { "nzt", tZONE, -HOUR(12) }, /* New Zealand */ - { "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */ - { "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */ - { "idle", tZONE, -HOUR(12) }, /* International Date Line East */ - /* ADDED BY Marco Nijdam */ - { "dst", tDST, HOUR( 0) }, /* DST on (hour is ignored) */ - /* End ADDED */ - { NULL } -}; - -/* - * Military timezone table. - */ -static TABLE MilitaryTable[] = { - { "a", tZONE, HOUR( 1) }, - { "b", tZONE, HOUR( 2) }, - { "c", tZONE, HOUR( 3) }, - { "d", tZONE, HOUR( 4) }, - { "e", tZONE, HOUR( 5) }, - { "f", tZONE, HOUR( 6) }, - { "g", tZONE, HOUR( 7) }, - { "h", tZONE, HOUR( 8) }, - { "i", tZONE, HOUR( 9) }, - { "k", tZONE, HOUR( 10) }, - { "l", tZONE, HOUR( 11) }, - { "m", tZONE, HOUR( 12) }, - { "n", tZONE, HOUR(- 1) }, - { "o", tZONE, HOUR(- 2) }, - { "p", tZONE, HOUR(- 3) }, - { "q", tZONE, HOUR(- 4) }, - { "r", tZONE, HOUR(- 5) }, - { "s", tZONE, HOUR(- 6) }, - { "t", tZONE, HOUR(- 7) }, - { "u", tZONE, HOUR(- 8) }, - { "v", tZONE, HOUR(- 9) }, - { "w", tZONE, HOUR(-10) }, - { "x", tZONE, HOUR(-11) }, - { "y", tZONE, HOUR(-12) }, - { "z", tZONE, HOUR( 0) }, - { NULL } -}; - - -/* - * Dump error messages in the bit bucket. - */ -static void -yyerror(s) - char *s; -{ -} - - -static time_t -ToSeconds(Hours, Minutes, Seconds, Meridian) - time_t Hours; - time_t Minutes; - time_t Seconds; - MERIDIAN Meridian; -{ - if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59) - return -1; - switch (Meridian) { - case MER24: - if (Hours < 0 || Hours > 23) - return -1; - return (Hours * 60L + Minutes) * 60L + Seconds; - case MERam: - if (Hours < 1 || Hours > 12) - return -1; - return ((Hours % 12) * 60L + Minutes) * 60L + Seconds; - case MERpm: - if (Hours < 1 || Hours > 12) - return -1; - return (((Hours % 12) + 12) * 60L + Minutes) * 60L + Seconds; - } - return -1; /* Should never be reached */ -} - - -static int -Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode, TimePtr) - time_t Month; - time_t Day; - time_t Year; - time_t Hours; - time_t Minutes; - time_t Seconds; - MERIDIAN Meridian; - DSTMODE DSTmode; - time_t *TimePtr; -{ - static int DaysInMonth[12] = { - 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 - }; - time_t tod; - time_t Julian; - int i; - - DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) - ? 29 : 28; - if (Month < 1 || Month > 12 - || Year < START_OF_TIME || Year > END_OF_TIME - || Day < 1 || Day > DaysInMonth[(int)--Month]) - return -1; - - for (Julian = Day - 1, i = 0; i < Month; i++) - Julian += DaysInMonth[i]; - if (Year >= EPOCH) { - for (i = EPOCH; i < Year; i++) - Julian += 365 + (i % 4 == 0); - } else { - for (i = Year; i < EPOCH; i++) - Julian -= 365 + (i % 4 == 0); - } - Julian *= SECSPERDAY; - Julian += yyTimezone * 60L; - if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0) - return -1; - Julian += tod; - if (DSTmode == DSTon - || (DSTmode == DSTmaybe && TclpGetDate((TclpTime_t)&Julian, 0)->tm_isdst)) - Julian -= 60 * 60; - *TimePtr = Julian; - return 0; -} - - -static time_t -DSTcorrect(Start, Future) - time_t Start; - time_t Future; -{ - time_t StartDay; - time_t FutureDay; - - StartDay = (TclpGetDate((TclpTime_t)&Start, 0)->tm_hour + 1) % 24; - FutureDay = (TclpGetDate((TclpTime_t)&Future, 0)->tm_hour + 1) % 24; - return (Future - Start) + (StartDay - FutureDay) * 60L * 60L; -} - - -static time_t -RelativeDate(Start, DayOrdinal, DayNumber) - time_t Start; - time_t DayOrdinal; - time_t DayNumber; -{ - struct tm *tm; - time_t now; - - now = Start; - tm = TclpGetDate((TclpTime_t)&now, 0); - now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7); - now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1); - return DSTcorrect(Start, now); -} - - -static int -RelativeMonth(Start, RelMonth, TimePtr) - time_t Start; - time_t RelMonth; - time_t *TimePtr; -{ - struct tm *tm; - time_t Month; - time_t Year; - time_t Julian; - int result; - - if (RelMonth == 0) { - *TimePtr = 0; - return 0; - } - tm = TclpGetDate((TclpTime_t)&Start, 0); - Month = 12 * (tm->tm_year + TM_YEAR_BASE) + tm->tm_mon + RelMonth; - Year = Month / 12; - Month = Month % 12 + 1; - result = Convert(Month, (time_t) tm->tm_mday, Year, - (time_t) tm->tm_hour, (time_t) tm->tm_min, (time_t) tm->tm_sec, - MER24, DSTmaybe, &Julian); - /* - * The following iteration takes into account the case were we jump - * into a "short month". Far example, "one month from Jan 31" will - * fail because there is no Feb 31. The code below will reduce the - * day and try converting the date until we succed or the date equals - * 28 (which always works unless the date is bad in another way). - */ - - while ((result != 0) && (tm->tm_mday > 28)) { - tm->tm_mday--; - result = Convert(Month, (time_t) tm->tm_mday, Year, - (time_t) tm->tm_hour, (time_t) tm->tm_min, (time_t) tm->tm_sec, - MER24, DSTmaybe, &Julian); - } - if (result != 0) { - return -1; - } - *TimePtr = DSTcorrect(Start, Julian); - return 0; -} - - -static int -LookupWord(buff) - char *buff; -{ - register char *p; - register char *q; - register TABLE *tp; - int i; - int abbrev; - - /* - * Make it lowercase. - */ - - Tcl_UtfToLower(buff); - - if (strcmp(buff, "am") == 0 || strcmp(buff, "a.m.") == 0) { - yylval.Meridian = MERam; - return tMERIDIAN; - } - if (strcmp(buff, "pm") == 0 || strcmp(buff, "p.m.") == 0) { - yylval.Meridian = MERpm; - return tMERIDIAN; - } - - /* - * See if we have an abbreviation for a month. - */ - if (strlen(buff) == 3) { - abbrev = 1; - } else if (strlen(buff) == 4 && buff[3] == '.') { - abbrev = 1; - buff[3] = '\0'; - } else { - abbrev = 0; - } - - for (tp = MonthDayTable; tp->name; tp++) { - if (abbrev) { - if (strncmp(buff, tp->name, 3) == 0) { - yylval.Number = tp->value; - return tp->type; - } - } else if (strcmp(buff, tp->name) == 0) { - yylval.Number = tp->value; - return tp->type; - } - } - - for (tp = TimezoneTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - yylval.Number = tp->value; - return tp->type; - } - } - - for (tp = UnitsTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - yylval.Number = tp->value; - return tp->type; - } - } - - /* - * Strip off any plural and try the units table again. - */ - i = strlen(buff) - 1; - if (buff[i] == 's') { - buff[i] = '\0'; - for (tp = UnitsTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - yylval.Number = tp->value; - return tp->type; - } - } - } - - for (tp = OtherTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - yylval.Number = tp->value; - return tp->type; - } - } - - /* - * Military timezones. - */ - if (buff[1] == '\0' && !(*buff & 0x80) - && isalpha(UCHAR(*buff))) { /* INTL: ISO only */ - for (tp = MilitaryTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - yylval.Number = tp->value; - return tp->type; - } - } - } - - /* - * Drop out any periods and try the timezone table again. - */ - for (i = 0, p = q = buff; *q; q++) - if (*q != '.') { - *p++ = *q; - } else { - i++; - } - *p = '\0'; - if (i) { - for (tp = TimezoneTable; tp->name; tp++) { - if (strcmp(buff, tp->name) == 0) { - yylval.Number = tp->value; - return tp->type; - } - } - } - - return tID; -} - - -static int -yylex() -{ - register char c; - register char *p; - char buff[20]; - int Count; - int sign; - - for ( ; ; ) { - while (isspace((unsigned char) (*yyInput))) { - yyInput++; - } - - if (isdigit(c = *yyInput) || c == '-' || c == '+') { /* INTL: digit */ - if (c == '-' || c == '+') { - sign = c == '-' ? -1 : 1; - if (!isdigit(*++yyInput)) { /* INTL: digit */ - /* - * skip the '-' sign - */ - continue; - } - } else { - sign = 0; - } - for (yylval.Number = 0; - isdigit(c = *yyInput++); ) { /* INTL: digit */ - yylval.Number = 10 * yylval.Number + c - '0'; - } - yyInput--; - if (sign < 0) { - yylval.Number = -yylval.Number; - } - return sign ? tSNUMBER : tUNUMBER; - } - if (!(c & 0x80) && isalpha(UCHAR(c))) { /* INTL: ISO only. */ - for (p = buff; isalpha(c = *yyInput++) /* INTL: ISO only. */ - || c == '.'; ) { - if (p < &buff[sizeof buff - 1]) { - *p++ = c; - } - } - *p = '\0'; - yyInput--; - return LookupWord(buff); - } - if (c != '(') { - return *yyInput++; - } - Count = 0; - do { - c = *yyInput++; - if (c == '\0') { - return c; - } else if (c == '(') { - Count++; - } else if (c == ')') { - Count--; - } - } while (Count > 0); - } -} - -/* - * Specify zone is of -50000 to force GMT. (This allows BST to work). - */ - -int -TclGetDate(p, now, zone, timePtr) - char *p; - unsigned long now; - long zone; - unsigned long *timePtr; -{ - struct tm *tm; - time_t Start; - time_t Time; - time_t tod; - int thisyear; - - yyInput = p; - tm = TclpGetDate((TclpTime_t) &now, 0); - thisyear = tm->tm_year + TM_YEAR_BASE; - yyYear = thisyear; - yyMonth = tm->tm_mon + 1; - yyDay = tm->tm_mday; - yyTimezone = zone; - if (zone == -50000) { - yyDSTmode = DSToff; /* assume GMT */ - yyTimezone = 0; - } else { - yyDSTmode = DSTmaybe; - } - yyHour = 0; - yyMinutes = 0; - yySeconds = 0; - yyMeridian = MER24; - yyRelSeconds = 0; - yyRelMonth = 0; - yyHaveDate = 0; - yyHaveDay = 0; - yyHaveRel = 0; - yyHaveTime = 0; - yyHaveZone = 0; - - if (yyparse() || yyHaveTime > 1 || yyHaveZone > 1 || yyHaveDate > 1 || - yyHaveDay > 1) { - return -1; - } - - if (yyHaveDate || yyHaveTime || yyHaveDay) { - if (TclDateYear < 0) { - TclDateYear = -TclDateYear; - } - /* - * The following line handles years that are specified using - * only two digits. The line of code below implements a policy - * defined by the X/Open workgroup on the millinium rollover. - * Note: some of those dates may not actually be valid on some - * platforms. The POSIX standard startes that the dates 70-99 - * shall refer to 1970-1999 and 00-38 shall refer to 2000-2038. - * This later definition should work on all platforms. - */ - - if (TclDateYear < 100) { - if (TclDateYear >= 69) { - TclDateYear += 1900; - } else { - TclDateYear += 2000; - } - } - if (Convert(yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds, - yyMeridian, yyDSTmode, &Start) < 0) { - return -1; - } - } else { - Start = now; - if (!yyHaveRel) { - Start -= ((tm->tm_hour * 60L) + tm->tm_min * 60L) + tm->tm_sec; - } - } - - Start += yyRelSeconds; - if (RelativeMonth(Start, yyRelMonth, &Time) < 0) { - return -1; - } - Start += Time; - - if (yyHaveDay && !yyHaveDate) { - tod = RelativeDate(Start, yyDayOrdinal, yyDayNumber); - Start += tod; - } - - *timePtr = Start; - return 0; -} diff --git a/generic/tclHash.c b/generic/tclHash.c deleted file mode 100644 index 973c003..0000000 --- a/generic/tclHash.c +++ /dev/null @@ -1,926 +0,0 @@ -/* - * tclHash.c -- - * - * Implementation of in-memory hash tables for Tcl and Tcl-based - * applications. - * - * Copyright (c) 1991-1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclHash.c,v 1.3 1999/04/16 00:46:46 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * When there are this many entries per bucket, on average, rebuild - * the hash table to make it larger. - */ - -#define REBUILD_MULTIPLIER 3 - - -/* - * The following macro takes a preliminary integer hash value and - * produces an index into a hash tables bucket list. The idea is - * to make it so that preliminary values that are arbitrarily similar - * will end up in different buckets. The hash function was taken - * from a random-number generator. - */ - -#define RANDOM_INDEX(tablePtr, i) \ - (((((long) (i))*1103515245) >> (tablePtr)->downShift) & (tablePtr)->mask) - -/* - * Procedure prototypes for static procedures in this file: - */ - -static Tcl_HashEntry * ArrayFind _ANSI_ARGS_((Tcl_HashTable *tablePtr, - CONST char *key)); -static Tcl_HashEntry * ArrayCreate _ANSI_ARGS_((Tcl_HashTable *tablePtr, - CONST char *key, int *newPtr)); -static Tcl_HashEntry * BogusFind _ANSI_ARGS_((Tcl_HashTable *tablePtr, - CONST char *key)); -static Tcl_HashEntry * BogusCreate _ANSI_ARGS_((Tcl_HashTable *tablePtr, - CONST char *key, int *newPtr)); -static unsigned int HashString _ANSI_ARGS_((CONST char *string)); -static void RebuildTable _ANSI_ARGS_((Tcl_HashTable *tablePtr)); -static Tcl_HashEntry * StringFind _ANSI_ARGS_((Tcl_HashTable *tablePtr, - CONST char *key)); -static Tcl_HashEntry * StringCreate _ANSI_ARGS_((Tcl_HashTable *tablePtr, - CONST char *key, int *newPtr)); -static Tcl_HashEntry * OneWordFind _ANSI_ARGS_((Tcl_HashTable *tablePtr, - CONST char *key)); -static Tcl_HashEntry * OneWordCreate _ANSI_ARGS_((Tcl_HashTable *tablePtr, - CONST char *key, int *newPtr)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_InitHashTable -- - * - * Given storage for a hash table, set up the fields to prepare - * the hash table for use. - * - * Results: - * None. - * - * Side effects: - * TablePtr is now ready to be passed to Tcl_FindHashEntry and - * Tcl_CreateHashEntry. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_InitHashTable(tablePtr, keyType) - register Tcl_HashTable *tablePtr; /* Pointer to table record, which - * is supplied by the caller. */ - int keyType; /* Type of keys to use in table: - * TCL_STRING_KEYS, TCL_ONE_WORD_KEYS, - * or an integer >= 2. */ -{ -#if (TCL_SMALL_HASH_TABLE != 4) - panic("Tcl_InitHashTable: TCL_SMALL_HASH_TABLE is %d, not 4\n", - TCL_SMALL_HASH_TABLE); -#endif - - tablePtr->buckets = tablePtr->staticBuckets; - tablePtr->staticBuckets[0] = tablePtr->staticBuckets[1] = 0; - tablePtr->staticBuckets[2] = tablePtr->staticBuckets[3] = 0; - tablePtr->numBuckets = TCL_SMALL_HASH_TABLE; - tablePtr->numEntries = 0; - tablePtr->rebuildSize = TCL_SMALL_HASH_TABLE*REBUILD_MULTIPLIER; - tablePtr->downShift = 28; - tablePtr->mask = 3; - tablePtr->keyType = keyType; - if (keyType == TCL_STRING_KEYS) { - tablePtr->findProc = StringFind; - tablePtr->createProc = StringCreate; - } else if (keyType == TCL_ONE_WORD_KEYS) { - tablePtr->findProc = OneWordFind; - tablePtr->createProc = OneWordCreate; - } else { - tablePtr->findProc = ArrayFind; - tablePtr->createProc = ArrayCreate; - }; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteHashEntry -- - * - * Remove a single entry from a hash table. - * - * Results: - * None. - * - * Side effects: - * The entry given by entryPtr is deleted from its table and - * should never again be used by the caller. It is up to the - * caller to free the clientData field of the entry, if that - * is relevant. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteHashEntry(entryPtr) - Tcl_HashEntry *entryPtr; -{ - register Tcl_HashEntry *prevPtr; - - if (*entryPtr->bucketPtr == entryPtr) { - *entryPtr->bucketPtr = entryPtr->nextPtr; - } else { - for (prevPtr = *entryPtr->bucketPtr; ; prevPtr = prevPtr->nextPtr) { - if (prevPtr == NULL) { - panic("malformed bucket chain in Tcl_DeleteHashEntry"); - } - if (prevPtr->nextPtr == entryPtr) { - prevPtr->nextPtr = entryPtr->nextPtr; - break; - } - } - } - entryPtr->tablePtr->numEntries--; - ckfree((char *) entryPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteHashTable -- - * - * Free up everything associated with a hash table except for - * the record for the table itself. - * - * Results: - * None. - * - * Side effects: - * The hash table is no longer useable. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteHashTable(tablePtr) - register Tcl_HashTable *tablePtr; /* Table to delete. */ -{ - register Tcl_HashEntry *hPtr, *nextPtr; - int i; - - /* - * Free up all the entries in the table. - */ - - for (i = 0; i < tablePtr->numBuckets; i++) { - hPtr = tablePtr->buckets[i]; - while (hPtr != NULL) { - nextPtr = hPtr->nextPtr; - ckfree((char *) hPtr); - hPtr = nextPtr; - } - } - - /* - * Free up the bucket array, if it was dynamically allocated. - */ - - if (tablePtr->buckets != tablePtr->staticBuckets) { - ckfree((char *) tablePtr->buckets); - } - - /* - * Arrange for panics if the table is used again without - * re-initialization. - */ - - tablePtr->findProc = BogusFind; - tablePtr->createProc = BogusCreate; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FirstHashEntry -- - * - * Locate the first entry in a hash table and set up a record - * that can be used to step through all the remaining entries - * of the table. - * - * Results: - * The return value is a pointer to the first entry in tablePtr, - * or NULL if tablePtr has no entries in it. The memory at - * *searchPtr is initialized so that subsequent calls to - * Tcl_NextHashEntry will return all of the entries in the table, - * one at a time. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_HashEntry * -Tcl_FirstHashEntry(tablePtr, searchPtr) - Tcl_HashTable *tablePtr; /* Table to search. */ - Tcl_HashSearch *searchPtr; /* Place to store information about - * progress through the table. */ -{ - searchPtr->tablePtr = tablePtr; - searchPtr->nextIndex = 0; - searchPtr->nextEntryPtr = NULL; - return Tcl_NextHashEntry(searchPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_NextHashEntry -- - * - * Once a hash table enumeration has been initiated by calling - * Tcl_FirstHashEntry, this procedure may be called to return - * successive elements of the table. - * - * Results: - * The return value is the next entry in the hash table being - * enumerated, or NULL if the end of the table is reached. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_HashEntry * -Tcl_NextHashEntry(searchPtr) - register Tcl_HashSearch *searchPtr; /* Place to store information about - * progress through the table. Must - * have been initialized by calling - * Tcl_FirstHashEntry. */ -{ - Tcl_HashEntry *hPtr; - - while (searchPtr->nextEntryPtr == NULL) { - if (searchPtr->nextIndex >= searchPtr->tablePtr->numBuckets) { - return NULL; - } - searchPtr->nextEntryPtr = - searchPtr->tablePtr->buckets[searchPtr->nextIndex]; - searchPtr->nextIndex++; - } - hPtr = searchPtr->nextEntryPtr; - searchPtr->nextEntryPtr = hPtr->nextPtr; - return hPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_HashStats -- - * - * Return statistics describing the layout of the hash table - * in its hash buckets. - * - * Results: - * The return value is a malloc-ed string containing information - * about tablePtr. It is the caller's responsibility to free - * this string. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_HashStats(tablePtr) - Tcl_HashTable *tablePtr; /* Table for which to produce stats. */ -{ -#define NUM_COUNTERS 10 - int count[NUM_COUNTERS], overflow, i, j; - double average, tmp; - register Tcl_HashEntry *hPtr; - char *result, *p; - - /* - * Compute a histogram of bucket usage. - */ - - for (i = 0; i < NUM_COUNTERS; i++) { - count[i] = 0; - } - overflow = 0; - average = 0.0; - for (i = 0; i < tablePtr->numBuckets; i++) { - j = 0; - for (hPtr = tablePtr->buckets[i]; hPtr != NULL; hPtr = hPtr->nextPtr) { - j++; - } - if (j < NUM_COUNTERS) { - count[j]++; - } else { - overflow++; - } - tmp = j; - average += (tmp+1.0)*(tmp/tablePtr->numEntries)/2.0; - } - - /* - * Print out the histogram and a few other pieces of information. - */ - - result = (char *) ckalloc((unsigned) ((NUM_COUNTERS*60) + 300)); - sprintf(result, "%d entries in table, %d buckets\n", - tablePtr->numEntries, tablePtr->numBuckets); - p = result + strlen(result); - for (i = 0; i < NUM_COUNTERS; i++) { - sprintf(p, "number of buckets with %d entries: %d\n", - i, count[i]); - p += strlen(p); - } - sprintf(p, "number of buckets with %d or more entries: %d\n", - NUM_COUNTERS, overflow); - p += strlen(p); - sprintf(p, "average search distance for entry: %.1f", average); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * HashString -- - * - * Compute a one-word summary of a text string, which can be - * used to generate a hash index. - * - * Results: - * The return value is a one-word summary of the information in - * string. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static unsigned int -HashString(string) - register CONST char *string;/* String from which to compute hash value. */ -{ - register unsigned int result; - register int c; - - /* - * I tried a zillion different hash functions and asked many other - * people for advice. Many people had their own favorite functions, - * all different, but no-one had much idea why they were good ones. - * I chose the one below (multiply by 9 and add new character) - * because of the following reasons: - * - * 1. Multiplying by 10 is perfect for keys that are decimal strings, - * and multiplying by 9 is just about as good. - * 2. Times-9 is (shift-left-3) plus (old). This means that each - * character's bits hang around in the low-order bits of the - * hash value for ever, plus they spread fairly rapidly up to - * the high-order bits to fill out the hash value. This seems - * works well both for decimal and non-decimal strings. - */ - - result = 0; - while (1) { - c = *string; - string++; - if (c == 0) { - break; - } - result += (result<<3) + c; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * StringFind -- - * - * Given a hash table with string keys, and a string key, find - * the entry with a matching key. - * - * Results: - * The return value is a token for the matching entry in the - * hash table, or NULL if there was no matching entry. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Tcl_HashEntry * -StringFind(tablePtr, key) - Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ - CONST char *key; /* Key to use to find matching entry. */ -{ - register Tcl_HashEntry *hPtr; - register CONST char *p1, *p2; - int index; - - index = HashString(key) & tablePtr->mask; - - /* - * Search all of the entries in the appropriate bucket. - */ - - for (hPtr = tablePtr->buckets[index]; hPtr != NULL; - hPtr = hPtr->nextPtr) { - for (p1 = key, p2 = hPtr->key.string; ; p1++, p2++) { - if (*p1 != *p2) { - break; - } - if (*p1 == '\0') { - return hPtr; - } - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * StringCreate -- - * - * Given a hash table with string keys, and a string key, find - * the entry with a matching key. If there is no matching entry, - * then create a new entry that does match. - * - * Results: - * The return value is a pointer to the matching entry. If this - * is a newly-created entry, then *newPtr will be set to a non-zero - * value; otherwise *newPtr will be set to 0. If this is a new - * entry the value stored in the entry will initially be 0. - * - * Side effects: - * A new entry may be added to the hash table. - * - *---------------------------------------------------------------------- - */ - -static Tcl_HashEntry * -StringCreate(tablePtr, key, newPtr) - Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ - CONST char *key; /* Key to use to find or create matching - * entry. */ - int *newPtr; /* Store info here telling whether a new - * entry was created. */ -{ - register Tcl_HashEntry *hPtr; - register CONST char *p1, *p2; - int index; - - index = HashString(key) & tablePtr->mask; - - /* - * Search all of the entries in this bucket. - */ - - for (hPtr = tablePtr->buckets[index]; hPtr != NULL; - hPtr = hPtr->nextPtr) { - for (p1 = key, p2 = hPtr->key.string; ; p1++, p2++) { - if (*p1 != *p2) { - break; - } - if (*p1 == '\0') { - *newPtr = 0; - return hPtr; - } - } - } - - /* - * Entry not found. Add a new one to the bucket. - */ - - *newPtr = 1; - hPtr = (Tcl_HashEntry *) ckalloc((unsigned) - (sizeof(Tcl_HashEntry) + strlen(key) - (sizeof(hPtr->key) -1))); - hPtr->tablePtr = tablePtr; - hPtr->bucketPtr = &(tablePtr->buckets[index]); - hPtr->nextPtr = *hPtr->bucketPtr; - hPtr->clientData = 0; - strcpy(hPtr->key.string, key); - *hPtr->bucketPtr = hPtr; - tablePtr->numEntries++; - - /* - * If the table has exceeded a decent size, rebuild it with many - * more buckets. - */ - - if (tablePtr->numEntries >= tablePtr->rebuildSize) { - RebuildTable(tablePtr); - } - return hPtr; -} - -/* - *---------------------------------------------------------------------- - * - * OneWordFind -- - * - * Given a hash table with one-word keys, and a one-word key, find - * the entry with a matching key. - * - * Results: - * The return value is a token for the matching entry in the - * hash table, or NULL if there was no matching entry. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Tcl_HashEntry * -OneWordFind(tablePtr, key) - Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ - register CONST char *key; /* Key to use to find matching entry. */ -{ - register Tcl_HashEntry *hPtr; - int index; - - index = RANDOM_INDEX(tablePtr, key); - - /* - * Search all of the entries in the appropriate bucket. - */ - - for (hPtr = tablePtr->buckets[index]; hPtr != NULL; - hPtr = hPtr->nextPtr) { - if (hPtr->key.oneWordValue == key) { - return hPtr; - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * OneWordCreate -- - * - * Given a hash table with one-word keys, and a one-word key, find - * the entry with a matching key. If there is no matching entry, - * then create a new entry that does match. - * - * Results: - * The return value is a pointer to the matching entry. If this - * is a newly-created entry, then *newPtr will be set to a non-zero - * value; otherwise *newPtr will be set to 0. If this is a new - * entry the value stored in the entry will initially be 0. - * - * Side effects: - * A new entry may be added to the hash table. - * - *---------------------------------------------------------------------- - */ - -static Tcl_HashEntry * -OneWordCreate(tablePtr, key, newPtr) - Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ - register CONST char *key; /* Key to use to find or create matching - * entry. */ - int *newPtr; /* Store info here telling whether a new - * entry was created. */ -{ - register Tcl_HashEntry *hPtr; - int index; - - index = RANDOM_INDEX(tablePtr, key); - - /* - * Search all of the entries in this bucket. - */ - - for (hPtr = tablePtr->buckets[index]; hPtr != NULL; - hPtr = hPtr->nextPtr) { - if (hPtr->key.oneWordValue == key) { - *newPtr = 0; - return hPtr; - } - } - - /* - * Entry not found. Add a new one to the bucket. - */ - - *newPtr = 1; - hPtr = (Tcl_HashEntry *) ckalloc(sizeof(Tcl_HashEntry)); - hPtr->tablePtr = tablePtr; - hPtr->bucketPtr = &(tablePtr->buckets[index]); - hPtr->nextPtr = *hPtr->bucketPtr; - hPtr->clientData = 0; - hPtr->key.oneWordValue = (char *) key; /* CONST XXXX */ - *hPtr->bucketPtr = hPtr; - tablePtr->numEntries++; - - /* - * If the table has exceeded a decent size, rebuild it with many - * more buckets. - */ - - if (tablePtr->numEntries >= tablePtr->rebuildSize) { - RebuildTable(tablePtr); - } - return hPtr; -} - -/* - *---------------------------------------------------------------------- - * - * ArrayFind -- - * - * Given a hash table with array-of-int keys, and a key, find - * the entry with a matching key. - * - * Results: - * The return value is a token for the matching entry in the - * hash table, or NULL if there was no matching entry. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Tcl_HashEntry * -ArrayFind(tablePtr, key) - Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ - CONST char *key; /* Key to use to find matching entry. */ -{ - register Tcl_HashEntry *hPtr; - int *arrayPtr = (int *) key; - register int *iPtr1, *iPtr2; - int index, count; - - for (index = 0, count = tablePtr->keyType, iPtr1 = arrayPtr; - count > 0; count--, iPtr1++) { - index += *iPtr1; - } - index = RANDOM_INDEX(tablePtr, index); - - /* - * Search all of the entries in the appropriate bucket. - */ - - for (hPtr = tablePtr->buckets[index]; hPtr != NULL; - hPtr = hPtr->nextPtr) { - for (iPtr1 = arrayPtr, iPtr2 = hPtr->key.words, - count = tablePtr->keyType; ; count--, iPtr1++, iPtr2++) { - if (count == 0) { - return hPtr; - } - if (*iPtr1 != *iPtr2) { - break; - } - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * ArrayCreate -- - * - * Given a hash table with one-word keys, and a one-word key, find - * the entry with a matching key. If there is no matching entry, - * then create a new entry that does match. - * - * Results: - * The return value is a pointer to the matching entry. If this - * is a newly-created entry, then *newPtr will be set to a non-zero - * value; otherwise *newPtr will be set to 0. If this is a new - * entry the value stored in the entry will initially be 0. - * - * Side effects: - * A new entry may be added to the hash table. - * - *---------------------------------------------------------------------- - */ - -static Tcl_HashEntry * -ArrayCreate(tablePtr, key, newPtr) - Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ - register CONST char *key; /* Key to use to find or create matching - * entry. */ - int *newPtr; /* Store info here telling whether a new - * entry was created. */ -{ - register Tcl_HashEntry *hPtr; - int *arrayPtr = (int *) key; - register int *iPtr1, *iPtr2; - int index, count; - - for (index = 0, count = tablePtr->keyType, iPtr1 = arrayPtr; - count > 0; count--, iPtr1++) { - index += *iPtr1; - } - index = RANDOM_INDEX(tablePtr, index); - - /* - * Search all of the entries in the appropriate bucket. - */ - - for (hPtr = tablePtr->buckets[index]; hPtr != NULL; - hPtr = hPtr->nextPtr) { - for (iPtr1 = arrayPtr, iPtr2 = hPtr->key.words, - count = tablePtr->keyType; ; count--, iPtr1++, iPtr2++) { - if (count == 0) { - *newPtr = 0; - return hPtr; - } - if (*iPtr1 != *iPtr2) { - break; - } - } - } - - /* - * Entry not found. Add a new one to the bucket. - */ - - *newPtr = 1; - hPtr = (Tcl_HashEntry *) ckalloc((unsigned) (sizeof(Tcl_HashEntry) - + (tablePtr->keyType*sizeof(int)) - 4)); - hPtr->tablePtr = tablePtr; - hPtr->bucketPtr = &(tablePtr->buckets[index]); - hPtr->nextPtr = *hPtr->bucketPtr; - hPtr->clientData = 0; - for (iPtr1 = arrayPtr, iPtr2 = hPtr->key.words, count = tablePtr->keyType; - count > 0; count--, iPtr1++, iPtr2++) { - *iPtr2 = *iPtr1; - } - *hPtr->bucketPtr = hPtr; - tablePtr->numEntries++; - - /* - * If the table has exceeded a decent size, rebuild it with many - * more buckets. - */ - - if (tablePtr->numEntries >= tablePtr->rebuildSize) { - RebuildTable(tablePtr); - } - return hPtr; -} - -/* - *---------------------------------------------------------------------- - * - * BogusFind -- - * - * This procedure is invoked when an Tcl_FindHashEntry is called - * on a table that has been deleted. - * - * Results: - * If panic returns (which it shouldn't) this procedure returns - * NULL. - * - * Side effects: - * Generates a panic. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static Tcl_HashEntry * -BogusFind(tablePtr, key) - Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ - CONST char *key; /* Key to use to find matching entry. */ -{ - panic("called Tcl_FindHashEntry on deleted table"); - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * BogusCreate -- - * - * This procedure is invoked when an Tcl_CreateHashEntry is called - * on a table that has been deleted. - * - * Results: - * If panic returns (which it shouldn't) this procedure returns - * NULL. - * - * Side effects: - * Generates a panic. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static Tcl_HashEntry * -BogusCreate(tablePtr, key, newPtr) - Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ - CONST char *key; /* Key to use to find or create matching - * entry. */ - int *newPtr; /* Store info here telling whether a new - * entry was created. */ -{ - panic("called Tcl_CreateHashEntry on deleted table"); - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * RebuildTable -- - * - * This procedure is invoked when the ratio of entries to hash - * buckets becomes too large. It creates a new table with a - * larger bucket array and moves all of the entries into the - * new table. - * - * Results: - * None. - * - * Side effects: - * Memory gets reallocated and entries get re-hashed to new - * buckets. - * - *---------------------------------------------------------------------- - */ - -static void -RebuildTable(tablePtr) - register Tcl_HashTable *tablePtr; /* Table to enlarge. */ -{ - int oldSize, count, index; - Tcl_HashEntry **oldBuckets; - register Tcl_HashEntry **oldChainPtr, **newChainPtr; - register Tcl_HashEntry *hPtr; - - oldSize = tablePtr->numBuckets; - oldBuckets = tablePtr->buckets; - - /* - * Allocate and initialize the new bucket array, and set up - * hashing constants for new array size. - */ - - tablePtr->numBuckets *= 4; - tablePtr->buckets = (Tcl_HashEntry **) ckalloc((unsigned) - (tablePtr->numBuckets * sizeof(Tcl_HashEntry *))); - for (count = tablePtr->numBuckets, newChainPtr = tablePtr->buckets; - count > 0; count--, newChainPtr++) { - *newChainPtr = NULL; - } - tablePtr->rebuildSize *= 4; - tablePtr->downShift -= 2; - tablePtr->mask = (tablePtr->mask << 2) + 3; - - /* - * Rehash all of the existing entries into the new bucket array. - */ - - for (oldChainPtr = oldBuckets; oldSize > 0; oldSize--, oldChainPtr++) { - for (hPtr = *oldChainPtr; hPtr != NULL; hPtr = *oldChainPtr) { - *oldChainPtr = hPtr->nextPtr; - if (tablePtr->keyType == TCL_STRING_KEYS) { - index = HashString(hPtr->key.string) & tablePtr->mask; - } else if (tablePtr->keyType == TCL_ONE_WORD_KEYS) { - index = RANDOM_INDEX(tablePtr, hPtr->key.oneWordValue); - } else { - register int *iPtr; - int count; - - for (index = 0, count = tablePtr->keyType, - iPtr = hPtr->key.words; count > 0; count--, iPtr++) { - index += *iPtr; - } - index = RANDOM_INDEX(tablePtr, index); - } - hPtr->bucketPtr = &(tablePtr->buckets[index]); - hPtr->nextPtr = *hPtr->bucketPtr; - *hPtr->bucketPtr = hPtr; - } - } - - /* - * Free up the old bucket array, if it was dynamically allocated. - */ - - if (oldBuckets != tablePtr->staticBuckets) { - ckfree((char *) oldBuckets); - } -} diff --git a/generic/tclHistory.c b/generic/tclHistory.c deleted file mode 100644 index 5f2a9f2..0000000 --- a/generic/tclHistory.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * tclHistory.c -- - * - * This module and the Tcl library file history.tcl together implement - * Tcl command history. Tcl_RecordAndEval(Obj) can be called to record - * commands ("events") before they are executed. Commands defined in - * history.tcl may be used to perform history substitutions. - * - * Copyright (c) 1990-1993 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. - * - * RCS: @(#) $Id: tclHistory.c,v 1.3 1999/04/16 00:46:47 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - - -/* - *---------------------------------------------------------------------- - * - * Tcl_RecordAndEval -- - * - * This procedure adds its command argument to the current list of - * recorded events and then executes the command by calling - * Tcl_Eval. - * - * Results: - * The return value is a standard Tcl return value, the result of - * executing cmd. - * - * Side effects: - * The command is recorded and executed. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_RecordAndEval(interp, cmd, flags) - Tcl_Interp *interp; /* Token for interpreter in which command - * will be executed. */ - char *cmd; /* Command to record. */ - int flags; /* Additional flags. TCL_NO_EVAL means - * only record: don't execute command. - * TCL_EVAL_GLOBAL means use Tcl_GlobalEval - * instead of Tcl_Eval. */ -{ - register Tcl_Obj *cmdPtr; - int length = strlen(cmd); - int result; - - if (length > 0) { - /* - * Call Tcl_RecordAndEvalObj to do the actual work. - */ - - cmdPtr = Tcl_NewStringObj(cmd, length); - Tcl_IncrRefCount(cmdPtr); - result = Tcl_RecordAndEvalObj(interp, cmdPtr, flags); - - /* - * Move the interpreter's object result to the string result, - * then reset the object result. - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - - /* - * Discard the Tcl object created to hold the command. - */ - - Tcl_DecrRefCount(cmdPtr); - } else { - /* - * An empty string. Just reset the interpreter's result. - */ - - Tcl_ResetResult(interp); - result = TCL_OK; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RecordAndEvalObj -- - * - * This procedure adds the command held in its argument object to the - * current list of recorded events and then executes the command by - * calling Tcl_EvalObj. - * - * Results: - * The return value is a standard Tcl return value, the result of - * executing the command. - * - * Side effects: - * The command is recorded and executed. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_RecordAndEvalObj(interp, cmdPtr, flags) - Tcl_Interp *interp; /* Token for interpreter in which command - * will be executed. */ - Tcl_Obj *cmdPtr; /* Points to object holding the command to - * record and execute. */ - int flags; /* Additional flags. TCL_NO_EVAL means - * record only: don't execute the command. - * TCL_EVAL_GLOBAL means evaluate the - * script in global variable context instead - * of the current procedure. */ -{ - int result; - Tcl_Obj *list[3]; - register Tcl_Obj *objPtr; - - /* - * Do recording by eval'ing a tcl history command: history add $cmd. - */ - - list[0] = Tcl_NewStringObj("history", -1); - list[1] = Tcl_NewStringObj("add", -1); - list[2] = cmdPtr; - - objPtr = Tcl_NewListObj(3, list); - Tcl_IncrRefCount(objPtr); - (void) Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_GLOBAL); - Tcl_DecrRefCount(objPtr); - - /* - * Execute the command. - */ - - result = TCL_OK; - if (!(flags & TCL_NO_EVAL)) { - result = Tcl_EvalObjEx(interp, cmdPtr, flags & TCL_EVAL_GLOBAL); - } - return result; -} diff --git a/generic/tclIO.c b/generic/tclIO.c deleted file mode 100644 index 32c844e..0000000 --- a/generic/tclIO.c +++ /dev/null @@ -1,7603 +0,0 @@ -/* - * tclIO.c -- - * - * This file provides the generic portions (those that are the same on - * all platforms and for all channel types) of Tcl's IO facilities. - * - * Copyright (c) 1998 Scriptics Corporation - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclIO.c,v 1.6 1999/04/16 00:46:47 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * Make sure that both EAGAIN and EWOULDBLOCK are defined. This does not - * compile on systems where neither is defined. We want both defined so - * that we can test safely for both. In the code we still have to test for - * both because there may be systems on which both are defined and have - * different values. - */ - -#if ((!defined(EWOULDBLOCK)) && (defined(EAGAIN))) -# define EWOULDBLOCK EAGAIN -#endif -#if ((!defined(EAGAIN)) && (defined(EWOULDBLOCK))) -# define EAGAIN EWOULDBLOCK -#endif -#if ((!defined(EAGAIN)) && (!defined(EWOULDBLOCK))) - error one of EWOULDBLOCK or EAGAIN must be defined -#endif - -/* - * The following structure encapsulates the state for a background channel - * copy. Note that the data buffer for the copy will be appended to this - * structure. - */ - -typedef struct CopyState { - struct Channel *readPtr; /* Pointer to input channel. */ - struct Channel *writePtr; /* Pointer to output channel. */ - int readFlags; /* Original read channel flags. */ - int writeFlags; /* Original write channel flags. */ - int toRead; /* Number of bytes to copy, or -1. */ - int total; /* Total bytes transferred (written). */ - Tcl_Interp *interp; /* Interp that started the copy. */ - Tcl_Obj *cmdPtr; /* Command to be invoked at completion. */ - int bufSize; /* Size of appended buffer. */ - char buffer[1]; /* Copy buffer, this must be the last - * field. */ -} CopyState; - -/* - * struct ChannelBuffer: - * - * Buffers data being sent to or from a channel. - */ - -typedef struct ChannelBuffer { - int nextAdded; /* The next position into which a character - * will be put in the buffer. */ - int nextRemoved; /* Position of next byte to be removed - * from the buffer. */ - int bufLength; /* How big is the buffer? */ - struct ChannelBuffer *nextPtr; - /* Next buffer in chain. */ - char buf[4]; /* Placeholder for real buffer. The real - * buffer occuppies this space + bufSize-4 - * bytes. This must be the last field in - * the structure. */ -} ChannelBuffer; - -#define CHANNELBUFFER_HEADER_SIZE (sizeof(ChannelBuffer) - 4) - -/* - * How much extra space to allocate in buffer to hold bytes from previous - * buffer (when converting to UTF-8) or to hold bytes that will go to - * next buffer (when converting from UTF-8). - */ - -#define BUFFER_PADDING 16 - -/* - * The following defines the *default* buffer size for channels. - */ - -#define CHANNELBUFFER_DEFAULT_SIZE (1024 * 4) - -/* - * Structure to record a close callback. One such record exists for - * each close callback registered for a channel. - */ - -typedef struct CloseCallback { - Tcl_CloseProc *proc; /* The procedure to call. */ - ClientData clientData; /* Arbitrary one-word data to pass - * to the callback. */ - struct CloseCallback *nextPtr; /* For chaining close callbacks. */ -} CloseCallback; - -/* - * The following structure describes the information saved from a call to - * "fileevent". This is used later when the event being waited for to - * invoke the saved script in the interpreter designed in this record. - */ - -typedef struct EventScriptRecord { - struct Channel *chanPtr; /* The channel for which this script is - * registered. This is used only when an - * error occurs during evaluation of the - * script, to delete the handler. */ - Tcl_Obj *scriptPtr; /* Script to invoke. */ - Tcl_Interp *interp; /* In what interpreter to invoke script? */ - int mask; /* Events must overlap current mask for the - * stored script to be invoked. */ - struct EventScriptRecord *nextPtr; - /* Next in chain of records. */ -} EventScriptRecord; - -/* - * struct Channel: - * - * One of these structures is allocated for each open channel. It contains data - * specific to the channel but which belongs to the generic part of the Tcl - * channel mechanism, and it points at an instance specific (and type - * specific) * instance data, and at a channel type structure. - */ - -typedef struct Channel { - char *channelName; /* The name of the channel instance in Tcl - * commands. Storage is owned by the generic IO - * code, is dynamically allocated. */ - int flags; /* ORed combination of the flags defined - * below. */ - Tcl_Encoding encoding; /* Encoding to apply when reading or writing - * data on this channel. NULL means no - * encoding is applied to data. */ - Tcl_EncodingState inputEncodingState; - /* Current encoding state, used when converting - * input data bytes to UTF-8. */ - int inputEncodingFlags; /* Encoding flags to pass to conversion - * routine when converting input data bytes to - * UTF-8. May be TCL_ENCODING_START before - * converting first byte and TCL_ENCODING_END - * when EOF is seen. */ - Tcl_EncodingState outputEncodingState; - /* Current encoding state, used when converting - * UTF-8 to output data bytes. */ - int outputEncodingFlags; /* Encoding flags to pass to conversion - * routine when converting UTF-8 to output - * data bytes. May be TCL_ENCODING_START - * before converting first byte and - * TCL_ENCODING_END when EOF is seen. */ - Tcl_EolTranslation inputTranslation; - /* What translation to apply for end of line - * sequences on input? */ - Tcl_EolTranslation outputTranslation; - /* What translation to use for generating - * end of line sequences in output? */ - int inEofChar; /* If nonzero, use this as a signal of EOF - * on input. */ - int outEofChar; /* If nonzero, append this to the channel - * when it is closed if it is open for - * writing. */ - int unreportedError; /* Non-zero if an error report was deferred - * because it happened in the background. The - * value is the POSIX error code. */ - ClientData instanceData; /* Instance-specific data provided by - * creator of channel. */ - - Tcl_ChannelType *typePtr; /* Pointer to channel type structure. */ - int refCount; /* How many interpreters hold references to - * this IO channel? */ - CloseCallback *closeCbPtr; /* Callbacks registered to be called when the - * channel is closed. */ - char *outputStage; /* Temporary staging buffer used when - * translating EOL before converting from - * UTF-8 to external form. */ - ChannelBuffer *curOutPtr; /* Current output buffer being filled. */ - ChannelBuffer *outQueueHead;/* Points at first buffer in output queue. */ - ChannelBuffer *outQueueTail;/* Points at last buffer in output queue. */ - - ChannelBuffer *saveInBufPtr;/* Buffer saved for input queue - eliminates - * need to allocate a new buffer for "gets" - * that crosses buffer boundaries. */ - ChannelBuffer *inQueueHead; /* Points at first buffer in input queue. */ - ChannelBuffer *inQueueTail; /* Points at last buffer in input queue. */ - - struct ChannelHandler *chPtr;/* List of channel handlers registered - * for this channel. */ - int interestMask; /* Mask of all events this channel has - * handlers for. */ - struct Channel *nextChanPtr;/* Next in list of channels currently open. */ - EventScriptRecord *scriptRecordPtr; - /* Chain of all scripts registered for - * event handlers ("fileevent") on this - * channel. */ - int bufSize; /* What size buffers to allocate? */ - Tcl_TimerToken timer; /* Handle to wakeup timer for this channel. */ - CopyState *csPtr; /* State of background copy, or NULL. */ -} Channel; - -/* - * Values for the flags field in Channel. Any ORed combination of the - * following flags can be stored in the field. These flags record various - * options and state bits about the channel. In addition to the flags below, - * the channel can also have TCL_READABLE (1<<1) and TCL_WRITABLE (1<<2) set. - */ - -#define CHANNEL_NONBLOCKING (1<<3) /* Channel is currently in - * nonblocking mode. */ -#define CHANNEL_LINEBUFFERED (1<<4) /* Output to the channel must be - * flushed after every newline. */ -#define CHANNEL_UNBUFFERED (1<<5) /* Output to the channel must always - * be flushed immediately. */ -#define BUFFER_READY (1<<6) /* Current output buffer (the - * curOutPtr field in the - * channel structure) should be - * output as soon as possible even - * though it may not be full. */ -#define BG_FLUSH_SCHEDULED (1<<7) /* A background flush of the - * queued output buffers has been - * scheduled. */ -#define CHANNEL_CLOSED (1<<8) /* Channel has been closed. No - * further Tcl-level IO on the - * channel is allowed. */ -#define CHANNEL_EOF (1<<9) /* EOF occurred on this channel. - * This bit is cleared before every - * input operation. */ -#define CHANNEL_STICKY_EOF (1<<10) /* EOF occurred on this channel because - * we saw the input eofChar. This bit - * prevents clearing of the EOF bit - * before every input operation. */ -#define CHANNEL_BLOCKED (1<<11) /* EWOULDBLOCK or EAGAIN occurred - * on this channel. This bit is - * cleared before every input or - * output operation. */ -#define INPUT_SAW_CR (1<<12) /* Channel is in CRLF eol input - * translation mode and the last - * byte seen was a "\r". */ -#define INPUT_NEED_NL (1<<15) /* Saw a '\r' at end of last buffer, - * and there should be a '\n' at - * beginning of next buffer. */ -#define CHANNEL_DEAD (1<<13) /* The channel has been closed by - * the exit handler (on exit) but - * not deallocated. When any IO - * operation sees this flag on a - * channel, it does not call driver - * level functions to avoid referring - * to deallocated data. */ -#define CHANNEL_NEED_MORE_DATA (1<<14) /* The last input operation failed - * because there was not enough data - * to complete the operation. This - * flag is set when gets fails to - * get a complete line or when read - * fails to get a complete character. - * When set, file events will not be - * delivered for buffered data until - * the state of the channel changes. */ - -/* - * For each channel handler registered in a call to Tcl_CreateChannelHandler, - * there is one record of the following type. All of records for a specific - * channel are chained together in a singly linked list which is stored in - * the channel structure. - */ - -typedef struct ChannelHandler { - Channel *chanPtr; /* The channel structure for this channel. */ - int mask; /* Mask of desired events. */ - Tcl_ChannelProc *proc; /* Procedure to call in the type of - * Tcl_CreateChannelHandler. */ - ClientData clientData; /* Argument to pass to procedure. */ - struct ChannelHandler *nextPtr; - /* Next one in list of registered handlers. */ -} ChannelHandler; - -/* - * This structure keeps track of the current ChannelHandler being invoked in - * the current invocation of ChannelHandlerEventProc. There is a potential - * problem if a ChannelHandler is deleted while it is the current one, since - * ChannelHandlerEventProc needs to look at the nextPtr field. To handle this - * problem, structures of the type below indicate the next handler to be - * processed for any (recursively nested) dispatches in progress. The - * nextHandlerPtr field is updated if the handler being pointed to is deleted. - * The nextPtr field is used to chain together all recursive invocations, so - * that Tcl_DeleteChannelHandler can find all the recursively nested - * invocations of ChannelHandlerEventProc and compare the handler being - * deleted against the NEXT handler to be invoked in that invocation; when it - * finds such a situation, Tcl_DeleteChannelHandler updates the nextHandlerPtr - * field of the structure to the next handler. - */ - -typedef struct NextChannelHandler { - ChannelHandler *nextHandlerPtr; /* The next handler to be invoked in - * this invocation. */ - struct NextChannelHandler *nestedHandlerPtr; - /* Next nested invocation of - * ChannelHandlerEventProc. */ -} NextChannelHandler; - - -/* - * The following structure describes the event that is added to the Tcl - * event queue by the channel handler check procedure. - */ - -typedef struct ChannelHandlerEvent { - Tcl_Event header; /* Standard header for all events. */ - Channel *chanPtr; /* The channel that is ready. */ - int readyMask; /* Events that have occurred. */ -} ChannelHandlerEvent; - -/* - * The following structure is used by Tcl_GetsObj() to encapsulates the - * state for a "gets" operation. - */ - -typedef struct GetsState { - Tcl_Obj *objPtr; /* The object to which UTF-8 characters - * will be appended. */ - char **dstPtr; /* Pointer into objPtr's string rep where - * next character should be stored. */ - Tcl_Encoding encoding; /* The encoding to use to convert raw bytes - * to UTF-8. */ - ChannelBuffer *bufPtr; /* The current buffer of raw bytes being - * emptied. */ - Tcl_EncodingState state; /* The encoding state just before the last - * external to UTF-8 conversion in - * FilterInputBytes(). */ - int rawRead; /* The number of bytes removed from bufPtr - * in the last call to FilterInputBytes(). */ - int bytesWrote; /* The number of bytes of UTF-8 data - * appended to objPtr during the last call to - * FilterInputBytes(). */ - int charsWrote; /* The corresponding number of UTF-8 - * characters appended to objPtr during the - * last call to FilterInputBytes(). */ - int totalChars; /* The total number of UTF-8 characters - * appended to objPtr so far, just before the - * last call to FilterInputBytes(). */ -} GetsState; - -/* - * All static variables used in this file are collected into a single - * instance of the following structure. For multi-threaded implementations, - * there is one instance of this structure for each thread. - * - * Notice that different structures with the same name appear in other - * files. The structure defined below is used in this file only. - */ - -typedef struct ThreadSpecificData { - - /* - * This variable holds the list of nested ChannelHandlerEventProc - * invocations. - */ - NextChannelHandler *nestedHandlerPtr; - - /* - * List of all channels currently open. - */ - Channel *firstChanPtr; -#ifdef oldcode - /* - * Has a channel exit handler been created yet? - */ - int channelExitHandlerCreated; - - /* - * Has the channel event source been created and registered with the - * notifier? - */ - int channelEventSourceCreated; -#endif - /* - * Static variables to hold channels for stdin, stdout and stderr. - */ - Tcl_Channel stdinChannel; - int stdinInitialized; - Tcl_Channel stdoutChannel; - int stdoutInitialized; - Tcl_Channel stderrChannel; - int stderrInitialized; - -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - - -/* - * Static functions in this file: - */ - -static ChannelBuffer * AllocChannelBuffer _ANSI_ARGS_((int length)); -static void ChannelEventScriptInvoker _ANSI_ARGS_(( - ClientData clientData, int flags)); -static void ChannelTimerProc _ANSI_ARGS_(( - ClientData clientData)); -static int CheckChannelErrors _ANSI_ARGS_((Channel *chanPtr, - int direction)); -static int CheckFlush _ANSI_ARGS_((Channel *chanPtr, - ChannelBuffer *bufPtr, int newlineFlag)); -static int CheckForDeadChannel _ANSI_ARGS_((Tcl_Interp *interp, - Channel *chan)); -static void CheckForStdChannelsBeingClosed _ANSI_ARGS_(( - Tcl_Channel chan)); -static void CleanupChannelHandlers _ANSI_ARGS_(( - Tcl_Interp *interp, Channel *chanPtr)); -static int CloseChannel _ANSI_ARGS_((Tcl_Interp *interp, - Channel *chanPtr, int errorCode)); -static void CommonGetsCleanup _ANSI_ARGS_((Channel *chanPtr, - Tcl_Encoding encoding)); -static int CopyAndTranslateBuffer _ANSI_ARGS_(( - Channel *chanPtr, char *result, int space)); -static int CopyData _ANSI_ARGS_((CopyState *csPtr, int mask)); -static void CopyEventProc _ANSI_ARGS_((ClientData clientData, - int mask)); -static void CreateScriptRecord _ANSI_ARGS_(( - Tcl_Interp *interp, Channel *chanPtr, - int mask, Tcl_Obj *scriptPtr)); -static void DeleteChannelTable _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp)); -static void DeleteScriptRecord _ANSI_ARGS_((Tcl_Interp *interp, - Channel *chanPtr, int mask)); -static void DiscardInputQueued _ANSI_ARGS_(( - Channel *chanPtr, int discardSavedBuffers)); -static void DiscardOutputQueued _ANSI_ARGS_(( - Channel *chanPtr)); -static int DoRead _ANSI_ARGS_((Channel *chanPtr, char *srcPtr, - int slen)); -static int DoWrite _ANSI_ARGS_((Channel *chanPtr, char *src, - int srcLen)); -static int FilterInputBytes _ANSI_ARGS_((Channel *chanPtr, - GetsState *statePtr)); -static int FlushChannel _ANSI_ARGS_((Tcl_Interp *interp, - Channel *chanPtr, int calledFromAsyncFlush)); -static Tcl_HashTable * GetChannelTable _ANSI_ARGS_((Tcl_Interp *interp)); -static int GetInput _ANSI_ARGS_((Channel *chanPtr)); -static void PeekAhead _ANSI_ARGS_((Channel *chanPtr, - char **dstEndPtr, GetsState *gsPtr)); -static int ReadBytes _ANSI_ARGS_((Channel *chanPtr, - Tcl_Obj *objPtr, int charsLeft, int *offsetPtr)); -static int ReadChars _ANSI_ARGS_((Channel *chanPtr, - Tcl_Obj *objPtr, int charsLeft, int *offsetPtr, - int *factorPtr)); -static void RecycleBuffer _ANSI_ARGS_((Channel *chanPtr, - ChannelBuffer *bufPtr, int mustDiscard)); -static int SetBlockMode _ANSI_ARGS_((Tcl_Interp *interp, - Channel *chanPtr, int mode)); -static void StopCopy _ANSI_ARGS_((CopyState *csPtr)); -static int TranslateInputEOL _ANSI_ARGS_((Channel *chanPtr, - char *dst, CONST char *src, int *dstLenPtr, - int *srcLenPtr)); -static int TranslateOutputEOL _ANSI_ARGS_((Channel *chanPtr, - char *dst, CONST char *src, int *dstLenPtr, - int *srcLenPtr)); -static void UpdateInterest _ANSI_ARGS_((Channel *chanPtr)); -static int WriteBytes _ANSI_ARGS_((Channel *chanPtr, - CONST char *src, int srcLen)); -static int WriteChars _ANSI_ARGS_((Channel *chanPtr, - CONST char *src, int srcLen)); - - -/* - *--------------------------------------------------------------------------- - * - * TclInitIOSubsystem -- - * - * Initialize all resources used by this subsystem on a per-process - * basis. - * - * Results: - * None. - * - * Side effects: - * Depends on the memory subsystems. - * - *--------------------------------------------------------------------------- - */ - -void -TclInitIOSubsystem() -{ - /* - * By fetching thread local storage we take care of - * allocating it for each thread. - */ - (void) TCL_TSD_INIT(&dataKey); -} - -/* - *------------------------------------------------------------------------- - * - * TclFinalizeIOSubsystem -- - * - * Releases all resources used by this subsystem on a per-process - * basis. Closes all extant channels that have not already been - * closed because they were not owned by any interp. - * - * Results: - * None. - * - * Side effects: - * Depends on encoding and memory subsystems. - * - *------------------------------------------------------------------------- - */ - - /* ARGSUSED */ -void -TclFinalizeIOSubsystem() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - Channel *chanPtr; /* Iterates over open channels. */ - Channel *nextChanPtr; /* Iterates over open channels. */ - - - for (chanPtr = tsdPtr->firstChanPtr; chanPtr != (Channel *) NULL; - chanPtr = nextChanPtr) { - nextChanPtr = chanPtr->nextChanPtr; - - /* - * Set the channel back into blocking mode to ensure that we wait - * for all data to flush out. - */ - - (void) Tcl_SetChannelOption(NULL, (Tcl_Channel) chanPtr, - "-blocking", "on"); - - if ((chanPtr == (Channel *) tsdPtr->stdinChannel) || - (chanPtr == (Channel *) tsdPtr->stdoutChannel) || - (chanPtr == (Channel *) tsdPtr->stderrChannel)) { - - /* - * Decrement the refcount which was earlier artificially bumped - * up to keep the channel from being closed. - */ - - chanPtr->refCount--; - } - - if (chanPtr->refCount <= 0) { - - /* - * Close it only if the refcount indicates that the channel is not - * referenced from any interpreter. If it is, that interpreter will - * close the channel when it gets destroyed. - */ - - (void) Tcl_Close((Tcl_Interp *) NULL, (Tcl_Channel) chanPtr); - - } else { - - /* - * The refcount is greater than zero, so flush the channel. - */ - - Tcl_Flush((Tcl_Channel) chanPtr); - - /* - * Call the device driver to actually close the underlying - * device for this channel. - */ - - if (chanPtr->typePtr->closeProc != TCL_CLOSE2PROC) { - (chanPtr->typePtr->closeProc)(chanPtr->instanceData, - (Tcl_Interp *) NULL); - } else { - (chanPtr->typePtr->close2Proc)(chanPtr->instanceData, - (Tcl_Interp *) NULL, 0); - } - - /* - * Finally, we clean up the fields in the channel data structure - * since all of them have been deleted already. We mark the - * channel with CHANNEL_DEAD to prevent any further IO operations - * on it. - */ - - chanPtr->instanceData = (ClientData) NULL; - chanPtr->flags |= CHANNEL_DEAD; - } - } -} - - - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetStdChannel -- - * - * This function is used to change the channels that are used - * for stdin/stdout/stderr in new interpreters. - * - * Results: - * None - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetStdChannel(channel, type) - Tcl_Channel channel; - int type; /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - switch (type) { - case TCL_STDIN: - tsdPtr->stdinInitialized = 1; - tsdPtr->stdinChannel = channel; - break; - case TCL_STDOUT: - tsdPtr->stdoutInitialized = 1; - tsdPtr->stdoutChannel = channel; - break; - case TCL_STDERR: - tsdPtr->stderrInitialized = 1; - tsdPtr->stderrChannel = channel; - break; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetStdChannel -- - * - * Returns the specified standard channel. - * - * Results: - * Returns the specified standard channel, or NULL. - * - * Side effects: - * May cause the creation of a standard channel and the underlying - * file. - * - *---------------------------------------------------------------------- - */ -Tcl_Channel -Tcl_GetStdChannel(type) - int type; /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */ -{ - Tcl_Channel channel = NULL; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * If the channels were not created yet, create them now and - * store them in the static variables. - */ - - switch (type) { - case TCL_STDIN: - if (!tsdPtr->stdinInitialized) { - tsdPtr->stdinChannel = TclpGetDefaultStdChannel(TCL_STDIN); - tsdPtr->stdinInitialized = 1; - - /* - * Artificially bump the refcount to ensure that the channel - * is only closed on exit. - * - * NOTE: Must only do this if stdinChannel is not NULL. It - * can be NULL in situations where Tcl is unable to connect - * to the standard input. - */ - - if (tsdPtr->stdinChannel != (Tcl_Channel) NULL) { - (void) Tcl_RegisterChannel((Tcl_Interp *) NULL, - tsdPtr->stdinChannel); - } - } - channel = tsdPtr->stdinChannel; - break; - case TCL_STDOUT: - if (!tsdPtr->stdoutInitialized) { - tsdPtr->stdoutChannel = TclpGetDefaultStdChannel(TCL_STDOUT); - tsdPtr->stdoutInitialized = 1; - if (tsdPtr->stdoutChannel != (Tcl_Channel) NULL) { - (void) Tcl_RegisterChannel((Tcl_Interp *) NULL, - tsdPtr->stdoutChannel); - } - } - channel = tsdPtr->stdoutChannel; - break; - case TCL_STDERR: - if (!tsdPtr->stderrInitialized) { - tsdPtr->stderrChannel = TclpGetDefaultStdChannel(TCL_STDERR); - tsdPtr->stderrInitialized = 1; - if (tsdPtr->stderrChannel != (Tcl_Channel) NULL) { - (void) Tcl_RegisterChannel((Tcl_Interp *) NULL, - tsdPtr->stderrChannel); - } - } - channel = tsdPtr->stderrChannel; - break; - } - return channel; -} - - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateCloseHandler - * - * Creates a close callback which will be called when the channel is - * closed. - * - * Results: - * None. - * - * Side effects: - * Causes the callback to be called in the future when the channel - * will be closed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_CreateCloseHandler(chan, proc, clientData) - Tcl_Channel chan; /* The channel for which to create the - * close callback. */ - Tcl_CloseProc *proc; /* The callback routine to call when the - * channel will be closed. */ - ClientData clientData; /* Arbitrary data to pass to the - * close callback. */ -{ - Channel *chanPtr; - CloseCallback *cbPtr; - - chanPtr = (Channel *) chan; - - cbPtr = (CloseCallback *) ckalloc((unsigned) sizeof(CloseCallback)); - cbPtr->proc = proc; - cbPtr->clientData = clientData; - - cbPtr->nextPtr = chanPtr->closeCbPtr; - chanPtr->closeCbPtr = cbPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteCloseHandler -- - * - * Removes a callback that would have been called on closing - * the channel. If there is no matching callback then this - * function has no effect. - * - * Results: - * None. - * - * Side effects: - * The callback will not be called in the future when the channel - * is eventually closed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteCloseHandler(chan, proc, clientData) - Tcl_Channel chan; /* The channel for which to cancel the - * close callback. */ - Tcl_CloseProc *proc; /* The procedure for the callback to - * remove. */ - ClientData clientData; /* The callback data for the callback - * to remove. */ -{ - Channel *chanPtr; - CloseCallback *cbPtr, *cbPrevPtr; - - chanPtr = (Channel *) chan; - for (cbPtr = chanPtr->closeCbPtr, cbPrevPtr = (CloseCallback *) NULL; - cbPtr != (CloseCallback *) NULL; - cbPtr = cbPtr->nextPtr) { - if ((cbPtr->proc == proc) && (cbPtr->clientData == clientData)) { - if (cbPrevPtr == (CloseCallback *) NULL) { - chanPtr->closeCbPtr = cbPtr->nextPtr; - } - ckfree((char *) cbPtr); - break; - } else { - cbPrevPtr = cbPtr; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * GetChannelTable -- - * - * Gets and potentially initializes the channel table for an - * interpreter. If it is initializing the table it also inserts - * channels for stdin, stdout and stderr if the interpreter is - * trusted. - * - * Results: - * A pointer to the hash table created, for use by the caller. - * - * Side effects: - * Initializes the channel table for an interpreter. May create - * channels for stdin, stdout and stderr. - * - *---------------------------------------------------------------------- - */ - -static Tcl_HashTable * -GetChannelTable(interp) - Tcl_Interp *interp; -{ - Tcl_HashTable *hTblPtr; /* Hash table of channels. */ - Tcl_Channel stdinChan, stdoutChan, stderrChan; - - hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, "tclIO", NULL); - if (hTblPtr == (Tcl_HashTable *) NULL) { - hTblPtr = (Tcl_HashTable *) ckalloc((unsigned) sizeof(Tcl_HashTable)); - Tcl_InitHashTable(hTblPtr, TCL_STRING_KEYS); - - (void) Tcl_SetAssocData(interp, "tclIO", - (Tcl_InterpDeleteProc *) DeleteChannelTable, - (ClientData) hTblPtr); - - /* - * If the interpreter is trusted (not "safe"), insert channels - * for stdin, stdout and stderr (possibly creating them in the - * process). - */ - - if (Tcl_IsSafe(interp) == 0) { - stdinChan = Tcl_GetStdChannel(TCL_STDIN); - if (stdinChan != NULL) { - Tcl_RegisterChannel(interp, stdinChan); - } - stdoutChan = Tcl_GetStdChannel(TCL_STDOUT); - if (stdoutChan != NULL) { - Tcl_RegisterChannel(interp, stdoutChan); - } - stderrChan = Tcl_GetStdChannel(TCL_STDERR); - if (stderrChan != NULL) { - Tcl_RegisterChannel(interp, stderrChan); - } - } - - } - return hTblPtr; -} - -/* - *---------------------------------------------------------------------- - * - * DeleteChannelTable -- - * - * Deletes the channel table for an interpreter, closing any open - * channels whose refcount reaches zero. This procedure is invoked - * when an interpreter is deleted, via the AssocData cleanup - * mechanism. - * - * Results: - * None. - * - * Side effects: - * Deletes the hash table of channels. May close channels. May flush - * output on closed channels. Removes any channeEvent handlers that were - * registered in this interpreter. - * - *---------------------------------------------------------------------- - */ - -static void -DeleteChannelTable(clientData, interp) - ClientData clientData; /* The per-interpreter data structure. */ - Tcl_Interp *interp; /* The interpreter being deleted. */ -{ - Tcl_HashTable *hTblPtr; /* The hash table. */ - Tcl_HashSearch hSearch; /* Search variable. */ - Tcl_HashEntry *hPtr; /* Search variable. */ - Channel *chanPtr; /* Channel being deleted. */ - EventScriptRecord *sPtr, *prevPtr, *nextPtr; - /* Variables to loop over all channel events - * registered, to delete the ones that refer - * to the interpreter being deleted. */ - - /* - * Delete all the registered channels - this will close channels whose - * refcount reaches zero. - */ - - hTblPtr = (Tcl_HashTable *) clientData; - for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); - hPtr != (Tcl_HashEntry *) NULL; - hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch)) { - - chanPtr = (Channel *) Tcl_GetHashValue(hPtr); - - /* - * Remove any fileevents registered in this interpreter. - */ - - for (sPtr = chanPtr->scriptRecordPtr, - prevPtr = (EventScriptRecord *) NULL; - sPtr != (EventScriptRecord *) NULL; - sPtr = nextPtr) { - nextPtr = sPtr->nextPtr; - if (sPtr->interp == interp) { - if (prevPtr == (EventScriptRecord *) NULL) { - chanPtr->scriptRecordPtr = nextPtr; - } else { - prevPtr->nextPtr = nextPtr; - } - - Tcl_DeleteChannelHandler((Tcl_Channel) chanPtr, - ChannelEventScriptInvoker, (ClientData) sPtr); - - Tcl_DecrRefCount(sPtr->scriptPtr); - ckfree((char *) sPtr); - } else { - prevPtr = sPtr; - } - } - - /* - * Cannot call Tcl_UnregisterChannel because that procedure calls - * Tcl_GetAssocData to get the channel table, which might already - * be inaccessible from the interpreter structure. Instead, we - * emulate the behavior of Tcl_UnregisterChannel directly here. - */ - - Tcl_DeleteHashEntry(hPtr); - chanPtr->refCount--; - if (chanPtr->refCount <= 0) { - if (!(chanPtr->flags & BG_FLUSH_SCHEDULED)) { - (void) Tcl_Close(interp, (Tcl_Channel) chanPtr); - } - } - } - Tcl_DeleteHashTable(hTblPtr); - ckfree((char *) hTblPtr); -} - -/* - *---------------------------------------------------------------------- - * - * CheckForStdChannelsBeingClosed -- - * - * Perform special handling for standard channels being closed. When - * given a standard channel, if the refcount is now 1, it means that - * the last reference to the standard channel is being explicitly - * closed. Now bump the refcount artificially down to 0, to ensure the - * normal handling of channels being closed will occur. Also reset the - * static pointer to the channel to NULL, to avoid dangling references. - * - * Results: - * None. - * - * Side effects: - * Manipulates the refcount on standard channels. May smash the global - * static pointer to a standard channel. - * - *---------------------------------------------------------------------- - */ - -static void -CheckForStdChannelsBeingClosed(chan) - Tcl_Channel chan; -{ - Channel *chanPtr = (Channel *) chan; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if ((chan == tsdPtr->stdinChannel) && (tsdPtr->stdinInitialized)) { - if (chanPtr->refCount < 2) { - chanPtr->refCount = 0; - tsdPtr->stdinChannel = NULL; - return; - } - } else if ((chan == tsdPtr->stdoutChannel) && (tsdPtr->stdoutInitialized)) { - if (chanPtr->refCount < 2) { - chanPtr->refCount = 0; - tsdPtr->stdoutChannel = NULL; - return; - } - } else if ((chan == tsdPtr->stderrChannel) && (tsdPtr->stderrInitialized)) { - if (chanPtr->refCount < 2) { - chanPtr->refCount = 0; - tsdPtr->stderrChannel = NULL; - return; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RegisterChannel -- - * - * Adds an already-open channel to the channel table of an interpreter. - * If the interpreter passed as argument is NULL, it only increments - * the channel refCount. - * - * Results: - * None. - * - * Side effects: - * May increment the reference count of a channel. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_RegisterChannel(interp, chan) - Tcl_Interp *interp; /* Interpreter in which to add the channel. */ - Tcl_Channel chan; /* The channel to add to this interpreter - * channel table. */ -{ - Tcl_HashTable *hTblPtr; /* Hash table of channels. */ - Tcl_HashEntry *hPtr; /* Search variable. */ - int new; /* Is the hash entry new or does it exist? */ - Channel *chanPtr; /* The actual channel. */ - - chanPtr = (Channel *) chan; - - if (chanPtr->channelName == (char *) NULL) { - panic("Tcl_RegisterChannel: channel without name"); - } - if (interp != (Tcl_Interp *) NULL) { - hTblPtr = GetChannelTable(interp); - hPtr = Tcl_CreateHashEntry(hTblPtr, chanPtr->channelName, &new); - if (new == 0) { - if (chan == (Tcl_Channel) Tcl_GetHashValue(hPtr)) { - return; - } - panic("Tcl_RegisterChannel: duplicate channel names"); - } - Tcl_SetHashValue(hPtr, (ClientData) chanPtr); - } - chanPtr->refCount++; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UnregisterChannel -- - * - * Deletes the hash entry for a channel associated with an interpreter. - * If the interpreter given as argument is NULL, it only decrements the - * reference count. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Deletes the hash entry for a channel associated with an interpreter. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UnregisterChannel(interp, chan) - Tcl_Interp *interp; /* Interpreter in which channel is defined. */ - Tcl_Channel chan; /* Channel to delete. */ -{ - Tcl_HashTable *hTblPtr; /* Hash table of channels. */ - Tcl_HashEntry *hPtr; /* Search variable. */ - Channel *chanPtr; /* The real IO channel. */ - - chanPtr = (Channel *) chan; - - if (interp != (Tcl_Interp *) NULL) { - hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, "tclIO", NULL); - if (hTblPtr == (Tcl_HashTable *) NULL) { - return TCL_OK; - } - hPtr = Tcl_FindHashEntry(hTblPtr, chanPtr->channelName); - if (hPtr == (Tcl_HashEntry *) NULL) { - return TCL_OK; - } - if ((Channel *) Tcl_GetHashValue(hPtr) != chanPtr) { - return TCL_OK; - } - Tcl_DeleteHashEntry(hPtr); - - /* - * Remove channel handlers that refer to this interpreter, so that they - * will not be present if the actual close is delayed and more events - * happen on the channel. This may occur if the channel is shared - * between several interpreters, or if the channel has async - * flushing active. - */ - - CleanupChannelHandlers(interp, chanPtr); - } - - chanPtr->refCount--; - - /* - * Perform special handling for standard channels being closed. If the - * refCount is now 1 it means that the last reference to the standard - * channel is being explicitly closed, so bump the refCount down - * artificially to 0. This will ensure that the channel is actually - * closed, below. Also set the static pointer to NULL for the channel. - */ - - CheckForStdChannelsBeingClosed(chan); - - /* - * If the refCount reached zero, close the actual channel. - */ - - if (chanPtr->refCount <= 0) { - - /* - * Ensure that if there is another buffer, it gets flushed - * whether or not we are doing a background flush. - */ - - if ((chanPtr->curOutPtr != NULL) && - (chanPtr->curOutPtr->nextAdded > - chanPtr->curOutPtr->nextRemoved)) { - chanPtr->flags |= BUFFER_READY; - } - chanPtr->flags |= CHANNEL_CLOSED; - if (!(chanPtr->flags & BG_FLUSH_SCHEDULED)) { - if (Tcl_Close(interp, chan) != TCL_OK) { - return TCL_ERROR; - } - } - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_GetChannel -- - * - * Finds an existing Tcl_Channel structure by name in a given - * interpreter. This function is public because it is used by - * channel-type-specific functions. - * - * Results: - * A Tcl_Channel or NULL on failure. If failed, interp's result - * object contains an error message. *modePtr is filled with the - * modes in which the channel was opened. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -Tcl_Channel -Tcl_GetChannel(interp, chanName, modePtr) - Tcl_Interp *interp; /* Interpreter in which to find or create - * the channel. */ - char *chanName; /* The name of the channel. */ - int *modePtr; /* Where to store the mode in which the - * channel was opened? Will contain an ORed - * combination of TCL_READABLE and - * TCL_WRITABLE, if non-NULL. */ -{ - Channel *chanPtr; /* The actual channel. */ - Tcl_HashTable *hTblPtr; /* Hash table of channels. */ - Tcl_HashEntry *hPtr; /* Search variable. */ - char *name; /* Translated name. */ - - /* - * Substitute "stdin", etc. Note that even though we immediately - * find the channel using Tcl_GetStdChannel, we still need to look - * it up in the specified interpreter to ensure that it is present - * in the channel table. Otherwise, safe interpreters would always - * have access to the standard channels. - */ - - name = chanName; - if ((chanName[0] == 's') && (chanName[1] == 't')) { - chanPtr = NULL; - if (strcmp(chanName, "stdin") == 0) { - chanPtr = (Channel *)Tcl_GetStdChannel(TCL_STDIN); - } else if (strcmp(chanName, "stdout") == 0) { - chanPtr = (Channel *)Tcl_GetStdChannel(TCL_STDOUT); - } else if (strcmp(chanName, "stderr") == 0) { - chanPtr = (Channel *)Tcl_GetStdChannel(TCL_STDERR); - } - if (chanPtr != NULL) { - name = chanPtr->channelName; - } - } - - hTblPtr = GetChannelTable(interp); - hPtr = Tcl_FindHashEntry(hTblPtr, name); - if (hPtr == (Tcl_HashEntry *) NULL) { - Tcl_AppendResult(interp, "can not find channel named \"", - chanName, "\"", (char *) NULL); - return NULL; - } - - chanPtr = (Channel *) Tcl_GetHashValue(hPtr); - if (modePtr != NULL) { - *modePtr = (chanPtr->flags & (TCL_READABLE|TCL_WRITABLE)); - } - - return (Tcl_Channel) chanPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateChannel -- - * - * Creates a new entry in the hash table for a Tcl_Channel - * record. - * - * Results: - * Returns the new Tcl_Channel. - * - * Side effects: - * Creates a new Tcl_Channel instance and inserts it into the - * hash table. - * - *---------------------------------------------------------------------- - */ - -Tcl_Channel -Tcl_CreateChannel(typePtr, chanName, instanceData, mask) - Tcl_ChannelType *typePtr; /* The channel type record. */ - char *chanName; /* Name of channel to record. */ - ClientData instanceData; /* Instance specific data. */ - int mask; /* TCL_READABLE & TCL_WRITABLE to indicate - * if the channel is readable, writable. */ -{ - Channel *chanPtr; /* The channel structure newly created. */ - CONST char *name; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - chanPtr = (Channel *) ckalloc((unsigned) sizeof(Channel)); - - if (chanName != (char *) NULL) { - chanPtr->channelName = ckalloc((unsigned) (strlen(chanName) + 1)); - strcpy(chanPtr->channelName, chanName); - } else { - panic("Tcl_CreateChannel: NULL channel name"); - } - - chanPtr->flags = mask; - - /* - * Set the channel to system default encoding. - */ - - chanPtr->encoding = NULL; - name = Tcl_GetEncodingName(NULL); - if (strcmp(name, "binary") != 0) { - chanPtr->encoding = Tcl_GetEncoding(NULL, name); - } - chanPtr->inputEncodingState = NULL; - chanPtr->inputEncodingFlags = TCL_ENCODING_START; - chanPtr->outputEncodingState = NULL; - chanPtr->outputEncodingFlags = TCL_ENCODING_START; - - /* - * Set the channel up initially in AUTO input translation mode to - * accept "\n", "\r" and "\r\n". Output translation mode is set to - * a platform specific default value. The eofChar is set to 0 for both - * input and output, so that Tcl does not look for an in-file EOF - * indicator (e.g. ^Z) and does not append an EOF indicator to files. - */ - - chanPtr->inputTranslation = TCL_TRANSLATE_AUTO; - chanPtr->outputTranslation = TCL_PLATFORM_TRANSLATION; - chanPtr->inEofChar = 0; - chanPtr->outEofChar = 0; - - chanPtr->unreportedError = 0; - chanPtr->instanceData = instanceData; - chanPtr->typePtr = typePtr; - chanPtr->refCount = 0; - chanPtr->closeCbPtr = (CloseCallback *) NULL; - chanPtr->curOutPtr = (ChannelBuffer *) NULL; - chanPtr->outQueueHead = (ChannelBuffer *) NULL; - chanPtr->outQueueTail = (ChannelBuffer *) NULL; - chanPtr->saveInBufPtr = (ChannelBuffer *) NULL; - chanPtr->inQueueHead = (ChannelBuffer *) NULL; - chanPtr->inQueueTail = (ChannelBuffer *) NULL; - chanPtr->chPtr = (ChannelHandler *) NULL; - chanPtr->interestMask = 0; - chanPtr->scriptRecordPtr = (EventScriptRecord *) NULL; - chanPtr->bufSize = CHANNELBUFFER_DEFAULT_SIZE; - chanPtr->timer = NULL; - chanPtr->csPtr = NULL; - - chanPtr->outputStage = NULL; - if ((chanPtr->encoding != NULL) && (chanPtr->flags & TCL_WRITABLE)) { - chanPtr->outputStage = (char *) - ckalloc((unsigned) (chanPtr->bufSize + 2)); - } - - /* - * Link the channel into the list of all channels; create an on-exit - * handler if there is not one already, to close off all the channels - * in the list on exit. - */ - - chanPtr->nextChanPtr = tsdPtr->firstChanPtr; - tsdPtr->firstChanPtr = chanPtr; - - /* - * Install this channel in the first empty standard channel slot, if - * the channel was previously closed explicitly. - */ - - if ((tsdPtr->stdinChannel == NULL) && (tsdPtr->stdinInitialized == 1)) { - Tcl_SetStdChannel((Tcl_Channel)chanPtr, TCL_STDIN); - Tcl_RegisterChannel((Tcl_Interp *) NULL, (Tcl_Channel) chanPtr); - } else if ((tsdPtr->stdoutChannel == NULL) && (tsdPtr->stdoutInitialized == 1)) { - Tcl_SetStdChannel((Tcl_Channel)chanPtr, TCL_STDOUT); - Tcl_RegisterChannel((Tcl_Interp *) NULL, (Tcl_Channel) chanPtr); - } else if ((tsdPtr->stderrChannel == NULL) && (tsdPtr->stderrInitialized == 1)) { - Tcl_SetStdChannel((Tcl_Channel)chanPtr, TCL_STDERR); - Tcl_RegisterChannel((Tcl_Interp *) NULL, (Tcl_Channel) chanPtr); - } - return (Tcl_Channel) chanPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetChannelMode -- - * - * Computes a mask indicating whether the channel is open for - * reading and writing. - * - * Results: - * An OR-ed combination of TCL_READABLE and TCL_WRITABLE. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetChannelMode(chan) - Tcl_Channel chan; /* The channel for which the mode is - * being computed. */ -{ - Channel *chanPtr; /* The actual channel. */ - - chanPtr = (Channel *) chan; - return (chanPtr->flags & (TCL_READABLE | TCL_WRITABLE)); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetChannelName -- - * - * Returns the string identifying the channel name. - * - * Results: - * The string containing the channel name. This memory is - * owned by the generic layer and should not be modified by - * the caller. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetChannelName(chan) - Tcl_Channel chan; /* The channel for which to return the name. */ -{ - Channel *chanPtr; /* The actual channel. */ - - chanPtr = (Channel *) chan; - return chanPtr->channelName; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetChannelType -- - * - * Given a channel structure, returns the channel type structure. - * - * Results: - * Returns a pointer to the channel type structure. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_ChannelType * -Tcl_GetChannelType(chan) - Tcl_Channel chan; /* The channel to return type for. */ -{ - Channel *chanPtr; /* The actual channel. */ - - chanPtr = (Channel *) chan; - return chanPtr->typePtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetChannelHandle -- - * - * Returns an OS handle associated with a channel. - * - * Results: - * Returns TCL_OK and places the handle in handlePtr, or returns - * TCL_ERROR on failure. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetChannelHandle(chan, direction, handlePtr) - Tcl_Channel chan; /* The channel to get file from. */ - int direction; /* TCL_WRITABLE or TCL_READABLE. */ - ClientData *handlePtr; /* Where to store handle */ -{ - Channel *chanPtr; /* The actual channel. */ - ClientData handle; - int result; - - chanPtr = (Channel *) chan; - result = (chanPtr->typePtr->getHandleProc)(chanPtr->instanceData, - direction, &handle); - if (handlePtr) { - *handlePtr = handle; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetChannelInstanceData -- - * - * Returns the client data associated with a channel. - * - * Results: - * The client data. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -ClientData -Tcl_GetChannelInstanceData(chan) - Tcl_Channel chan; /* Channel for which to return client data. */ -{ - Channel *chanPtr; /* The actual channel. */ - - chanPtr = (Channel *) chan; - return chanPtr->instanceData; -} - -/* - *--------------------------------------------------------------------------- - * - * AllocChannelBuffer -- - * - * A channel buffer has BUFFER_PADDING bytes extra at beginning to - * hold any bytes of a native-encoding character that got split by - * the end of the previous buffer and need to be moved to the - * beginning of the next buffer to make a contiguous string so it - * can be converted to UTF-8. - * - * A channel buffer has BUFFER_PADDING bytes extra at the end to - * hold any bytes of a native-encoding character (generated from a - * UTF-8 character) that overflow past the end of the buffer and - * need to be moved to the next buffer. - * - * Results: - * A newly allocated channel buffer. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static ChannelBuffer * -AllocChannelBuffer(length) - int length; /* Desired length of channel buffer. */ -{ - ChannelBuffer *bufPtr; - int n; - - n = length + CHANNELBUFFER_HEADER_SIZE + BUFFER_PADDING + BUFFER_PADDING; - bufPtr = (ChannelBuffer *) ckalloc((unsigned) n); - bufPtr->nextAdded = BUFFER_PADDING; - bufPtr->nextRemoved = BUFFER_PADDING; - bufPtr->bufLength = length + BUFFER_PADDING; - bufPtr->nextPtr = (ChannelBuffer *) NULL; - return bufPtr; -} - -/* - *---------------------------------------------------------------------- - * - * RecycleBuffer -- - * - * Helper function to recycle input and output buffers. Ensures - * that two input buffers are saved (one in the input queue and - * another in the saveInBufPtr field) and that curOutPtr is set - * to a buffer. Only if these conditions are met is the buffer - * freed to the OS. - * - * Results: - * None. - * - * Side effects: - * May free a buffer to the OS. - * - *---------------------------------------------------------------------- - */ - -static void -RecycleBuffer(chanPtr, bufPtr, mustDiscard) - Channel *chanPtr; /* Channel for which to recycle buffers. */ - ChannelBuffer *bufPtr; /* The buffer to recycle. */ - int mustDiscard; /* If nonzero, free the buffer to the - * OS, always. */ -{ - /* - * Do we have to free the buffer to the OS? - */ - - if (mustDiscard) { - ckfree((char *) bufPtr); - return; - } - - /* - * Only save buffers for the input queue if the channel is readable. - */ - - if (chanPtr->flags & TCL_READABLE) { - if (chanPtr->inQueueHead == (ChannelBuffer *) NULL) { - chanPtr->inQueueHead = bufPtr; - chanPtr->inQueueTail = bufPtr; - goto keepit; - } - if (chanPtr->saveInBufPtr == (ChannelBuffer *) NULL) { - chanPtr->saveInBufPtr = bufPtr; - goto keepit; - } - } - - /* - * Only save buffers for the output queue if the channel is writable. - */ - - if (chanPtr->flags & TCL_WRITABLE) { - if (chanPtr->curOutPtr == (ChannelBuffer *) NULL) { - chanPtr->curOutPtr = bufPtr; - goto keepit; - } - } - - /* - * If we reached this code we return the buffer to the OS. - */ - - ckfree((char *) bufPtr); - return; - -keepit: - bufPtr->nextRemoved = BUFFER_PADDING; - bufPtr->nextAdded = BUFFER_PADDING; - bufPtr->nextPtr = (ChannelBuffer *) NULL; -} - -/* - *---------------------------------------------------------------------- - * - * DiscardOutputQueued -- - * - * Discards all output queued in the output queue of a channel. - * - * Results: - * None. - * - * Side effects: - * Recycles buffers. - * - *---------------------------------------------------------------------- - */ - -static void -DiscardOutputQueued(chanPtr) - Channel *chanPtr; /* The channel for which to discard output. */ -{ - ChannelBuffer *bufPtr; - - while (chanPtr->outQueueHead != (ChannelBuffer *) NULL) { - bufPtr = chanPtr->outQueueHead; - chanPtr->outQueueHead = bufPtr->nextPtr; - RecycleBuffer(chanPtr, bufPtr, 0); - } - chanPtr->outQueueHead = (ChannelBuffer *) NULL; - chanPtr->outQueueTail = (ChannelBuffer *) NULL; -} - -/* - *---------------------------------------------------------------------- - * - * CheckForDeadChannel -- - * - * This function checks is a given channel is Dead. - * (A channel that has been closed but not yet deallocated.) - * - * Results: - * True (1) if channel is Dead, False (0) if channel is Ok - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -static int -CheckForDeadChannel(interp, chanPtr) - Tcl_Interp *interp; /* For error reporting (can be NULL) */ - Channel *chanPtr; /* The channel to check. */ -{ - if (chanPtr->flags & CHANNEL_DEAD) { - Tcl_SetErrno(EINVAL); - if (interp) { - Tcl_AppendResult(interp, - "unable to access channel: invalid channel", - (char *) NULL); - } - return 1; - } - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * FlushChannel -- - * - * This function flushes as much of the queued output as is possible - * now. If calledFromAsyncFlush is nonzero, it is being called in an - * event handler to flush channel output asynchronously. - * - * Results: - * 0 if successful, else the error code that was returned by the - * channel type operation. - * - * Side effects: - * May produce output on a channel. May block indefinitely if the - * channel is synchronous. May schedule an async flush on the channel. - * May recycle memory for buffers in the output queue. - * - *---------------------------------------------------------------------- - */ - -static int -FlushChannel(interp, chanPtr, calledFromAsyncFlush) - Tcl_Interp *interp; /* For error reporting during close. */ - Channel *chanPtr; /* The channel to flush on. */ - int calledFromAsyncFlush; /* If nonzero then we are being - * called from an asynchronous - * flush callback. */ -{ - ChannelBuffer *bufPtr; /* Iterates over buffered output - * queue. */ - int toWrite; /* Amount of output data in current - * buffer available to be written. */ - int written; /* Amount of output data actually - * written in current round. */ - int errorCode = 0; /* Stores POSIX error codes from - * channel driver operations. */ - int wroteSome = 0; /* Set to one if any data was - * written to the driver. */ - - /* - * Prevent writing on a dead channel -- a channel that has been closed - * but not yet deallocated. This can occur if the exit handler for the - * channel deallocation runs before all channels are deregistered in - * all interpreters. - */ - - if (CheckForDeadChannel(interp,chanPtr)) return -1; - - /* - * Loop over the queued buffers and attempt to flush as - * much as possible of the queued output to the channel. - */ - - while (1) { - - /* - * If the queue is empty and there is a ready current buffer, OR if - * the current buffer is full, then move the current buffer to the - * queue. - */ - - if (((chanPtr->curOutPtr != (ChannelBuffer *) NULL) && - (chanPtr->curOutPtr->nextAdded == chanPtr->curOutPtr->bufLength)) - || ((chanPtr->flags & BUFFER_READY) && - (chanPtr->outQueueHead == (ChannelBuffer *) NULL))) { - chanPtr->flags &= (~(BUFFER_READY)); - chanPtr->curOutPtr->nextPtr = (ChannelBuffer *) NULL; - if (chanPtr->outQueueHead == (ChannelBuffer *) NULL) { - chanPtr->outQueueHead = chanPtr->curOutPtr; - } else { - chanPtr->outQueueTail->nextPtr = chanPtr->curOutPtr; - } - chanPtr->outQueueTail = chanPtr->curOutPtr; - chanPtr->curOutPtr = (ChannelBuffer *) NULL; - } - bufPtr = chanPtr->outQueueHead; - - /* - * If we are not being called from an async flush and an async - * flush is active, we just return without producing any output. - */ - - if ((!calledFromAsyncFlush) && - (chanPtr->flags & BG_FLUSH_SCHEDULED)) { - return 0; - } - - /* - * If the output queue is still empty, break out of the while loop. - */ - - if (bufPtr == (ChannelBuffer *) NULL) { - break; /* Out of the "while (1)". */ - } - - /* - * Produce the output on the channel. - */ - - toWrite = bufPtr->nextAdded - bufPtr->nextRemoved; - written = (chanPtr->typePtr->outputProc) (chanPtr->instanceData, - (char *) bufPtr->buf + bufPtr->nextRemoved, toWrite, - &errorCode); - - /* - * If the write failed completely attempt to start the asynchronous - * flush mechanism and break out of this loop - do not attempt to - * write any more output at this time. - */ - - if (written < 0) { - - /* - * If the last attempt to write was interrupted, simply retry. - */ - - if (errorCode == EINTR) { - errorCode = 0; - continue; - } - - /* - * If the channel is non-blocking and we would have blocked, - * start a background flushing handler and break out of the loop. - */ - - if ((errorCode == EWOULDBLOCK) || (errorCode == EAGAIN)) { - if (chanPtr->flags & CHANNEL_NONBLOCKING) { - if (!(chanPtr->flags & BG_FLUSH_SCHEDULED)) { - chanPtr->flags |= BG_FLUSH_SCHEDULED; - UpdateInterest(chanPtr); - } - errorCode = 0; - break; - } else { - panic("Blocking channel driver did not block on output"); - } - } - - /* - * Decide whether to report the error upwards or defer it. - */ - - if (calledFromAsyncFlush) { - if (chanPtr->unreportedError == 0) { - chanPtr->unreportedError = errorCode; - } - } else { - Tcl_SetErrno(errorCode); - if (interp != NULL) { - Tcl_SetResult(interp, - Tcl_PosixError(interp), TCL_VOLATILE); - } - } - - /* - * When we get an error we throw away all the output - * currently queued. - */ - - DiscardOutputQueued(chanPtr); - continue; - } else { - wroteSome = 1; - } - - bufPtr->nextRemoved += written; - - /* - * If this buffer is now empty, recycle it. - */ - - if (bufPtr->nextRemoved == bufPtr->nextAdded) { - chanPtr->outQueueHead = bufPtr->nextPtr; - if (chanPtr->outQueueHead == (ChannelBuffer *) NULL) { - chanPtr->outQueueTail = (ChannelBuffer *) NULL; - } - RecycleBuffer(chanPtr, bufPtr, 0); - } - } /* Closes "while (1)". */ - - /* - * If we wrote some data while flushing in the background, we are done. - * We can't finish the background flush until we run out of data and - * the channel becomes writable again. This ensures that all of the - * pending data has been flushed at the system level. - */ - - if (chanPtr->flags & BG_FLUSH_SCHEDULED) { - if (wroteSome) { - return errorCode; - } else if (chanPtr->outQueueHead == (ChannelBuffer *) NULL) { - chanPtr->flags &= (~(BG_FLUSH_SCHEDULED)); - (chanPtr->typePtr->watchProc)(chanPtr->instanceData, - chanPtr->interestMask); - } - } - - /* - * If the channel is flagged as closed, delete it when the refCount - * drops to zero, the output queue is empty and there is no output - * in the current output buffer. - */ - - if ((chanPtr->flags & CHANNEL_CLOSED) && (chanPtr->refCount <= 0) && - (chanPtr->outQueueHead == (ChannelBuffer *) NULL) && - ((chanPtr->curOutPtr == (ChannelBuffer *) NULL) || - (chanPtr->curOutPtr->nextAdded == - chanPtr->curOutPtr->nextRemoved))) { - return CloseChannel(interp, chanPtr, errorCode); - } - return errorCode; -} - -/* - *---------------------------------------------------------------------- - * - * CloseChannel -- - * - * Utility procedure to close a channel and free its associated - * resources. - * - * Results: - * 0 on success or a POSIX error code if the operation failed. - * - * Side effects: - * May close the actual channel; may free memory. - * - *---------------------------------------------------------------------- - */ - -static int -CloseChannel(interp, chanPtr, errorCode) - Tcl_Interp *interp; /* For error reporting. */ - Channel *chanPtr; /* The channel to close. */ - int errorCode; /* Status of operation so far. */ -{ - int result = 0; /* Of calling driver close - * operation. */ - Channel *prevChanPtr; /* Preceding channel in list of - * all channels - used to splice a - * channel out of the list on close. */ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (chanPtr == NULL) { - return result; - } - - /* - * No more input can be consumed so discard any leftover input. - */ - - DiscardInputQueued(chanPtr, 1); - - /* - * Discard a leftover buffer in the current output buffer field. - */ - - if (chanPtr->curOutPtr != (ChannelBuffer *) NULL) { - ckfree((char *) chanPtr->curOutPtr); - chanPtr->curOutPtr = (ChannelBuffer *) NULL; - } - - /* - * The caller guarantees that there are no more buffers - * queued for output. - */ - - if (chanPtr->outQueueHead != (ChannelBuffer *) NULL) { - panic("TclFlush, closed channel: queued output left"); - } - - /* - * If the EOF character is set in the channel, append that to the - * output device. - */ - - if ((chanPtr->outEofChar != 0) && (chanPtr->flags & TCL_WRITABLE)) { - int dummy; - char c; - - c = (char) chanPtr->outEofChar; - (chanPtr->typePtr->outputProc) (chanPtr->instanceData, &c, 1, &dummy); - } - - /* - * Remove TCL_READABLE and TCL_WRITABLE from chanPtr->flags, so - * that close callbacks can not do input or output (assuming they - * squirreled the channel away in their clientData). This also - * prevents infinite loops if the callback calls any C API that - * could call FlushChannel. - */ - - chanPtr->flags &= (~(TCL_READABLE|TCL_WRITABLE)); - - /* - * Splice this channel out of the list of all channels. - */ - - if (chanPtr == tsdPtr->firstChanPtr) { - tsdPtr->firstChanPtr = chanPtr->nextChanPtr; - } else { - for (prevChanPtr = tsdPtr->firstChanPtr; - (prevChanPtr != (Channel *) NULL) && - (prevChanPtr->nextChanPtr != chanPtr); - prevChanPtr = prevChanPtr->nextChanPtr) { - /* Empty loop body. */ - } - if (prevChanPtr == (Channel *) NULL) { - panic("FlushChannel: damaged channel list"); - } - prevChanPtr->nextChanPtr = chanPtr->nextChanPtr; - } - - /* - * Close and free the channel driver state. - */ - - if (chanPtr->typePtr->closeProc != TCL_CLOSE2PROC) { - result = (chanPtr->typePtr->closeProc)(chanPtr->instanceData, interp); - } else { - result = (chanPtr->typePtr->close2Proc)(chanPtr->instanceData, interp, - 0); - } - - if (chanPtr->channelName != (char *) NULL) { - ckfree(chanPtr->channelName); - } - Tcl_FreeEncoding(chanPtr->encoding); - if (chanPtr->outputStage != NULL) { - ckfree((char *) chanPtr->outputStage); - } - - /* - * If we are being called synchronously, report either - * any latent error on the channel or the current error. - */ - - if (chanPtr->unreportedError != 0) { - errorCode = chanPtr->unreportedError; - } - if (errorCode == 0) { - errorCode = result; - if (errorCode != 0) { - Tcl_SetErrno(errorCode); - } - } - - /* - * Cancel any outstanding timer. - */ - - Tcl_DeleteTimerHandler(chanPtr->timer); - - /* - * Mark the channel as deleted by clearing the type structure. - */ - - chanPtr->typePtr = NULL; - - Tcl_EventuallyFree((ClientData) chanPtr, TCL_DYNAMIC); - - return errorCode; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Close -- - * - * Closes a channel. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Closes the channel if this is the last reference. - * - * NOTE: - * Tcl_Close removes the channel as far as the user is concerned. - * However, it may continue to exist for a while longer if it has - * a background flush scheduled. The device itself is eventually - * closed and the channel record removed, in CloseChannel, above. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_Close(interp, chan) - Tcl_Interp *interp; /* Interpreter for errors. */ - Tcl_Channel chan; /* The channel being closed. Must - * not be referenced in any - * interpreter. */ -{ - ChannelHandler *chPtr, *chNext; /* Iterate over channel handlers. */ - CloseCallback *cbPtr; /* Iterate over close callbacks - * for this channel. */ - EventScriptRecord *ePtr, *eNextPtr; /* Iterate over eventscript records. */ - Channel *chanPtr; /* The real IO channel. */ - int result; /* Of calling FlushChannel. */ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - NextChannelHandler *nhPtr; - - if (chan == (Tcl_Channel) NULL) { - return TCL_OK; - } - - /* - * Perform special handling for standard channels being closed. If the - * refCount is now 1 it means that the last reference to the standard - * channel is being explicitly closed, so bump the refCount down - * artificially to 0. This will ensure that the channel is actually - * closed, below. Also set the static pointer to NULL for the channel. - */ - - CheckForStdChannelsBeingClosed(chan); - - chanPtr = (Channel *) chan; - if (chanPtr->refCount > 0) { - panic("called Tcl_Close on channel with refCount > 0"); - } - - /* - * Remove any references to channel handlers for this channel that - * may be about to be invoked. - */ - - for (nhPtr = tsdPtr->nestedHandlerPtr; - nhPtr != (NextChannelHandler *) NULL; - nhPtr = nhPtr->nestedHandlerPtr) { - if (nhPtr->nextHandlerPtr && - (nhPtr->nextHandlerPtr->chanPtr == chanPtr)) { - nhPtr->nextHandlerPtr = NULL; - } - } - - /* - * Remove all the channel handler records attached to the channel - * itself. - */ - - for (chPtr = chanPtr->chPtr; - chPtr != (ChannelHandler *) NULL; - chPtr = chNext) { - chNext = chPtr->nextPtr; - ckfree((char *) chPtr); - } - chanPtr->chPtr = (ChannelHandler *) NULL; - - - /* - * Cancel any pending copy operation. - */ - - StopCopy(chanPtr->csPtr); - - /* - * Must set the interest mask now to 0, otherwise infinite loops - * will occur if Tcl_DoOneEvent is called before the channel is - * finally deleted in FlushChannel. This can happen if the channel - * has a background flush active. - */ - - chanPtr->interestMask = 0; - - /* - * Remove any EventScript records for this channel. - */ - - for (ePtr = chanPtr->scriptRecordPtr; - ePtr != (EventScriptRecord *) NULL; - ePtr = eNextPtr) { - eNextPtr = ePtr->nextPtr; - Tcl_DecrRefCount(ePtr->scriptPtr); - ckfree((char *) ePtr); - } - chanPtr->scriptRecordPtr = (EventScriptRecord *) NULL; - - /* - * Invoke the registered close callbacks and delete their records. - */ - - while (chanPtr->closeCbPtr != (CloseCallback *) NULL) { - cbPtr = chanPtr->closeCbPtr; - chanPtr->closeCbPtr = cbPtr->nextPtr; - (cbPtr->proc) (cbPtr->clientData); - ckfree((char *) cbPtr); - } - - /* - * Ensure that the last output buffer will be flushed. - */ - - if ((chanPtr->curOutPtr != (ChannelBuffer *) NULL) && - (chanPtr->curOutPtr->nextAdded > chanPtr->curOutPtr->nextRemoved)) { - chanPtr->flags |= BUFFER_READY; - } - - /* - * If this channel supports it, close the read side, since we don't need it - * anymore and this will help avoid deadlocks on some channel types. - */ - - if (chanPtr->typePtr->closeProc == TCL_CLOSE2PROC) { - result = (chanPtr->typePtr->close2Proc)(chanPtr->instanceData, interp, - TCL_CLOSE_READ); - } else { - result = 0; - } - - /* - * The call to FlushChannel will flush any queued output and invoke - * the close function of the channel driver, or it will set up the - * channel to be flushed and closed asynchronously. - */ - - chanPtr->flags |= CHANNEL_CLOSED; - if ((FlushChannel(interp, chanPtr, 0) != 0) || (result != 0)) { - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Write -- - * - * Puts a sequence of bytes into an output buffer, may queue the - * buffer for output if it gets full, and also remembers whether the - * current buffer is ready e.g. if it contains a newline and we are in - * line buffering mode. - * - * Results: - * The number of bytes written or -1 in case of error. If -1, - * Tcl_GetErrno will return the error code. - * - * Side effects: - * May buffer up output and may cause output to be produced on the - * channel. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Write(chan, src, srcLen) - Tcl_Channel chan; /* The channel to buffer output for. */ - char *src; /* Data to queue in output buffer. */ - int srcLen; /* Length of data in bytes, or < 0 for - * strlen(). */ -{ - Channel *chanPtr; - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_WRITABLE) != 0) { - return -1; - } - if (srcLen < 0) { - srcLen = strlen(src); - } - return DoWrite(chanPtr, src, srcLen); -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_WriteChars -- - * - * Takes a sequence of UTF-8 characters and converts them for output - * using the channel's current encoding, may queue the buffer for - * output if it gets full, and also remembers whether the current - * buffer is ready e.g. if it contains a newline and we are in - * line buffering mode. - * - * Results: - * The number of bytes written or -1 in case of error. If -1, - * Tcl_GetErrno will return the error code. - * - * Side effects: - * May buffer up output and may cause output to be produced on the - * channel. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_WriteChars(chan, src, len) - Tcl_Channel chan; /* The channel to buffer output for. */ - CONST char *src; /* UTF-8 characters to queue in output buffer. */ - int len; /* Length of string in bytes, or < 0 for - * strlen(). */ -{ - Channel *chanPtr; - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_WRITABLE) != 0) { - return -1; - } - if (len < 0) { - len = strlen(src); - } - if (chanPtr->encoding == NULL) { - /* - * Inefficient way to convert UTF-8 to byte-array, but the - * code parallels the way it is done for objects. - */ - - Tcl_Obj *objPtr; - int result; - - objPtr = Tcl_NewStringObj(src, len); - src = (char *) Tcl_GetByteArrayFromObj(objPtr, &len); - result = WriteBytes(chanPtr, src, len); - Tcl_DecrRefCount(objPtr); - return result; - } - return WriteChars(chanPtr, src, len); -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_WriteObj -- - * - * Takes the Tcl object and queues its contents for output. If the - * encoding of the channel is NULL, takes the byte-array representation - * of the object and queues those bytes for output. Otherwise, takes - * the characters in the UTF-8 (string) representation of the object - * and converts them for output using the channel's current encoding. - * May flush internal buffers to output if one becomes full or is ready - * for some other reason, e.g. if it contains a newline and the channel - * is in line buffering mode. - * - * Results: - * The number of bytes written or -1 in case of error. If -1, - * Tcl_GetErrno() will return the error code. - * - * Side effects: - * May buffer up output and may cause output to be produced on the - * channel. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_WriteObj(chan, objPtr) - Tcl_Channel chan; /* The channel to buffer output for. */ - Tcl_Obj *objPtr; /* The object to write. */ -{ - Channel *chanPtr; - char *src; - int srcLen; - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_WRITABLE) != 0) { - return -1; - } - if (chanPtr->encoding == NULL) { - src = (char *) Tcl_GetByteArrayFromObj(objPtr, &srcLen); - return WriteBytes(chanPtr, src, srcLen); - } else { - src = Tcl_GetStringFromObj(objPtr, &srcLen); - return WriteChars(chanPtr, src, srcLen); - } -} - -/* - *---------------------------------------------------------------------- - * - * WriteBytes -- - * - * Write a sequence of bytes into an output buffer, may queue the - * buffer for output if it gets full, and also remembers whether the - * current buffer is ready e.g. if it contains a newline and we are in - * line buffering mode. - * - * Results: - * The number of bytes written or -1 in case of error. If -1, - * Tcl_GetErrno will return the error code. - * - * Side effects: - * May buffer up output and may cause output to be produced on the - * channel. - * - *---------------------------------------------------------------------- - */ - -static int -WriteBytes(chanPtr, src, srcLen) - Channel *chanPtr; /* The channel to buffer output for. */ - CONST char *src; /* Bytes to write. */ - int srcLen; /* Number of bytes to write. */ -{ - ChannelBuffer *bufPtr; - char *dst; - int dstLen, dstMax, sawLF, savedLF, total, toWrite; - - total = 0; - sawLF = 0; - savedLF = 0; - - /* - * Loop over all bytes in src, storing them in output buffer with - * proper EOL translation. - */ - - while (srcLen + savedLF > 0) { - bufPtr = chanPtr->curOutPtr; - if (bufPtr == NULL) { - bufPtr = AllocChannelBuffer(chanPtr->bufSize); - chanPtr->curOutPtr = bufPtr; - } - dst = bufPtr->buf + bufPtr->nextAdded; - dstMax = bufPtr->bufLength - bufPtr->nextAdded; - dstLen = dstMax; - - toWrite = dstLen; - if (toWrite > srcLen) { - toWrite = srcLen; - } - - if (savedLF) { - /* - * A '\n' was left over from last call to TranslateOutputEOL() - * and we need to store it in this buffer. If the channel is - * line-based, we will need to flush it. - */ - - *dst++ = '\n'; - dstLen--; - sawLF++; - } - sawLF += TranslateOutputEOL(chanPtr, dst, src, &dstLen, &toWrite); - dstLen += savedLF; - savedLF = 0; - - if (dstLen > dstMax) { - savedLF = 1; - dstLen = dstMax; - } - bufPtr->nextAdded += dstLen; - if (CheckFlush(chanPtr, bufPtr, sawLF) != 0) { - return -1; - } - total += dstLen; - src += toWrite; - srcLen -= toWrite; - sawLF = 0; - } - return total; -} - -/* - *---------------------------------------------------------------------- - * - * WriteChars -- - * - * Convert UTF-8 bytes to the channel's external encoding and - * write the produced bytes into an output buffer, may queue the - * buffer for output if it gets full, and also remembers whether the - * current buffer is ready e.g. if it contains a newline and we are in - * line buffering mode. - * - * Results: - * The number of bytes written or -1 in case of error. If -1, - * Tcl_GetErrno will return the error code. - * - * Side effects: - * May buffer up output and may cause output to be produced on the - * channel. - * - *---------------------------------------------------------------------- - */ - -static int -WriteChars(chanPtr, src, srcLen) - Channel *chanPtr; /* The channel to buffer output for. */ - CONST char *src; /* UTF-8 string to write. */ - int srcLen; /* Length of UTF-8 string in bytes. */ -{ - ChannelBuffer *bufPtr; - char *dst, *stage; - int saved, savedLF, sawLF, total, toWrite, flags; - int dstWrote, dstLen, stageLen, stageMax, stageRead; - Tcl_Encoding encoding; - char safe[BUFFER_PADDING]; - - total = 0; - sawLF = 0; - savedLF = 0; - saved = 0; - encoding = chanPtr->encoding; - - /* - * Loop over all UTF-8 characters in src, storing them in staging buffer - * with proper EOL translation. - */ - - while (srcLen + savedLF > 0) { - stage = chanPtr->outputStage; - stageMax = chanPtr->bufSize; - stageLen = stageMax; - - toWrite = stageLen; - if (toWrite > srcLen) { - toWrite = srcLen; - } - - if (savedLF) { - /* - * A '\n' was left over from last call to TranslateOutputEOL() - * and we need to store it in the staging buffer. If the - * channel is line-based, we will need to flush the output - * buffer (after translating the staging buffer). - */ - - *stage++ = '\n'; - stageLen--; - sawLF++; - } - sawLF += TranslateOutputEOL(chanPtr, stage, src, &stageLen, &toWrite); - - stage -= savedLF; - stageLen += savedLF; - savedLF = 0; - - if (stageLen > stageMax) { - savedLF = 1; - stageLen = stageMax; - } - src += toWrite; - srcLen -= toWrite; - - flags = chanPtr->outputEncodingFlags; - if (srcLen == 0) { - flags |= TCL_ENCODING_END; - } - - /* - * Loop over all UTF-8 characters in staging buffer, converting them - * to external encoding, storing them in output buffer. - */ - - while (stageLen + saved > 0) { - bufPtr = chanPtr->curOutPtr; - if (bufPtr == NULL) { - bufPtr = AllocChannelBuffer(chanPtr->bufSize); - chanPtr->curOutPtr = bufPtr; - } - dst = bufPtr->buf + bufPtr->nextAdded; - dstLen = bufPtr->bufLength - bufPtr->nextAdded; - - if (saved != 0) { - /* - * Here's some translated bytes left over from the last - * buffer that we need to stick at the beginning of this - * buffer. - */ - - memcpy((VOID *) dst, (VOID *) safe, (size_t) saved); - bufPtr->nextAdded += saved; - dst += saved; - dstLen -= saved; - saved = 0; - } - - Tcl_UtfToExternal(NULL, encoding, stage, stageLen, flags, - &chanPtr->outputEncodingState, dst, - dstLen + BUFFER_PADDING, &stageRead, &dstWrote, NULL); - if (stageRead + dstWrote == 0) { - /* - * We have an incomplete UTF-8 character at the end of the - * staging buffer. It will get moved to the beginning of the - * staging buffer followed by more bytes from src. - */ - - src -= stageLen; - srcLen += stageLen; - stageLen = 0; - savedLF = 0; - break; - } - bufPtr->nextAdded += dstWrote; - if (bufPtr->nextAdded > bufPtr->bufLength) { - /* - * When translating from UTF-8 to external encoding, we - * allowed the translation to produce a character that - * crossed the end of the output buffer, so that we would - * get a completely full buffer before flushing it. The - * extra bytes will be moved to the beginning of the next - * buffer. - */ - - saved = bufPtr->nextAdded - bufPtr->bufLength; - memcpy((VOID *) safe, (VOID *) (dst + dstLen), (size_t) saved); - bufPtr->nextAdded = bufPtr->bufLength; - } - if (CheckFlush(chanPtr, bufPtr, sawLF) != 0) { - return -1; - } - - total += dstWrote; - stage += stageRead; - stageLen -= stageRead; - sawLF = 0; - } - } - return total; -} - -/* - *--------------------------------------------------------------------------- - * - * TranslateOutputEOL -- - * - * Helper function for WriteBytes() and WriteChars(). Converts the - * '\n' characters in the source buffer into the appropriate EOL - * form specified by the output translation mode. - * - * EOL translation stops either when the source buffer is empty - * or the output buffer is full. - * - * When converting to CRLF mode and there is only 1 byte left in - * the output buffer, this routine stores the '\r' in the last - * byte and then stores the '\n' in the byte just past the end of the - * buffer. The caller is responsible for passing in a buffer that - * is large enough to hold the extra byte. - * - * Results: - * The return value is 1 if a '\n' was translated from the source - * buffer, or 0 otherwise -- this can be used by the caller to - * decide to flush a line-based channel even though the channel - * buffer is not full. - * - * *dstLenPtr is filled with how many bytes of the output buffer - * were used. As mentioned above, this can be one more that - * the output buffer's specified length if a CRLF was stored. - * - * *srcLenPtr is filled with how many bytes of the source buffer - * were consumed. - * - * Side effects: - * It may be obvious, but bears mentioning that when converting - * in CRLF mode (which requires two bytes of storage in the output - * buffer), the number of bytes consumed from the source buffer - * will be less than the number of bytes stored in the output buffer. - * - *--------------------------------------------------------------------------- - */ - -static int -TranslateOutputEOL(chanPtr, dst, src, dstLenPtr, srcLenPtr) - Channel *chanPtr; /* Channel being read, for translation and - * buffering modes. */ - char *dst; /* Output buffer filled with UTF-8 chars by - * applying appropriate EOL translation to - * source characters. */ - CONST char *src; /* Source UTF-8 characters. */ - int *dstLenPtr; /* On entry, the maximum length of output - * buffer in bytes. On exit, the number of - * bytes actually used in output buffer. */ - int *srcLenPtr; /* On entry, the length of source buffer. - * On exit, the number of bytes read from - * the source buffer. */ -{ - char *dstEnd; - int srcLen, newlineFound; - - newlineFound = 0; - srcLen = *srcLenPtr; - - switch (chanPtr->outputTranslation) { - case TCL_TRANSLATE_LF: { - for (dstEnd = dst + srcLen; dst < dstEnd; ) { - if (*src == '\n') { - newlineFound = 1; - } - *dst++ = *src++; - } - *dstLenPtr = srcLen; - break; - } - case TCL_TRANSLATE_CR: { - for (dstEnd = dst + srcLen; dst < dstEnd;) { - if (*src == '\n') { - *dst++ = '\r'; - newlineFound = 1; - src++; - } else { - *dst++ = *src++; - } - } - *dstLenPtr = srcLen; - break; - } - case TCL_TRANSLATE_CRLF: { - /* - * Since this causes the number of bytes to grow, we - * start off trying to put 'srcLen' bytes into the - * output buffer, but allow it to store more bytes, as - * long as there's still source bytes and room in the - * output buffer. - */ - - char *dstStart, *dstMax; - CONST char *srcStart; - - dstStart = dst; - dstMax = dst + *dstLenPtr; - - srcStart = src; - - if (srcLen < *dstLenPtr) { - dstEnd = dst + srcLen; - } else { - dstEnd = dst + *dstLenPtr; - } - while (dst < dstEnd) { - if (*src == '\n') { - if (dstEnd < dstMax) { - dstEnd++; - } - *dst++ = '\r'; - newlineFound = 1; - } - *dst++ = *src++; - } - *srcLenPtr = src - srcStart; - *dstLenPtr = dst - dstStart; - break; - } - default: { - break; - } - } - return newlineFound; -} - -/* - *--------------------------------------------------------------------------- - * - * CheckFlush -- - * - * Helper function for WriteBytes() and WriteChars(). If the - * channel buffer is ready to be flushed, flush it. - * - * Results: - * The return value is -1 if there was a problem flushing the - * channel buffer, or 0 otherwise. - * - * Side effects: - * The buffer will be recycled if it is flushed. - * - *--------------------------------------------------------------------------- - */ - -static int -CheckFlush(chanPtr, bufPtr, newlineFlag) - Channel *chanPtr; /* Channel being read, for buffering mode. */ - ChannelBuffer *bufPtr; /* Channel buffer to possibly flush. */ - int newlineFlag; /* Non-zero if a the channel buffer - * contains a newline. */ -{ - /* - * The current buffer is ready for output: - * 1. if it is full. - * 2. if it contains a newline and this channel is line-buffered. - * 3. if it contains any output and this channel is unbuffered. - */ - - if ((chanPtr->flags & BUFFER_READY) == 0) { - if (bufPtr->nextAdded == bufPtr->bufLength) { - chanPtr->flags |= BUFFER_READY; - } else if (chanPtr->flags & CHANNEL_LINEBUFFERED) { - if (newlineFlag != 0) { - chanPtr->flags |= BUFFER_READY; - } - } else if (chanPtr->flags & CHANNEL_UNBUFFERED) { - chanPtr->flags |= BUFFER_READY; - } - } - if (chanPtr->flags & BUFFER_READY) { - if (FlushChannel(NULL, chanPtr, 0) != 0) { - return -1; - } - } - return 0; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_Gets -- - * - * Reads a complete line of input from the channel into a Tcl_DString. - * - * Results: - * Length of line read (in characters) or -1 if error, EOF, or blocked. - * If -1, use Tcl_GetErrno() to retrieve the POSIX error code for the - * error or condition that occurred. - * - * Side effects: - * May flush output on the channel. May cause input to be consumed - * from the channel. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_Gets(chan, lineRead) - Tcl_Channel chan; /* Channel from which to read. */ - Tcl_DString *lineRead; /* The line read will be appended to this - * DString as UTF-8 characters. The caller - * must have initialized it and is responsible - * for managing the storage. */ -{ - Tcl_Obj *objPtr; - int charsStored, length; - char *string; - - objPtr = Tcl_NewObj(); - charsStored = Tcl_GetsObj(chan, objPtr); - if (charsStored > 0) { - string = Tcl_GetStringFromObj(objPtr, &length); - Tcl_DStringAppend(lineRead, string, length); - } - Tcl_DecrRefCount(objPtr); - return charsStored; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_GetsObj -- - * - * Accumulate input from the input channel until end-of-line or - * end-of-file has been seen. Bytes read from the input channel - * are converted to UTF-8 using the encoding specified by the - * channel. - * - * Results: - * Number of characters accumulated in the object or -1 if error, - * blocked, or EOF. If -1, use Tcl_GetErrno() to retrieve the - * POSIX error code for the error or condition that occurred. - * - * Side effects: - * Consumes input from the channel. - * - * On reading EOF, leave channel pointing at EOF char. - * On reading EOL, leave channel pointing after EOL, but don't - * return EOL in dst buffer. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_GetsObj(chan, objPtr) - Tcl_Channel chan; /* Channel from which to read. */ - Tcl_Obj *objPtr; /* The line read will be appended to this - * object as UTF-8 characters. */ -{ - GetsState gs; - Channel *chanPtr; - int inEofChar, skip, copiedTotal; - ChannelBuffer *bufPtr; - Tcl_Encoding encoding; - char *dst, *dstEnd, *eol, *eof; - Tcl_EncodingState oldState; - int oldLength, oldFlags, oldRemoved; - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_READABLE) != 0) { - copiedTotal = -1; - goto done; - } - - bufPtr = chanPtr->inQueueHead; - encoding = chanPtr->encoding; - - /* - * Preserved so we can restore the channel's state in case we don't - * find a newline in the available input. - */ - - Tcl_GetStringFromObj(objPtr, &oldLength); - oldFlags = chanPtr->inputEncodingFlags; - oldState = chanPtr->inputEncodingState; - oldRemoved = BUFFER_PADDING; - if (bufPtr != NULL) { - oldRemoved = bufPtr->nextRemoved; - } - - /* - * If there is no encoding, use "iso8859-1" -- Tcl_GetsObj() doesn't - * produce ByteArray objects. To avoid circularity problems, - * "iso8859-1" is builtin to Tcl. - */ - - if (encoding == NULL) { - encoding = Tcl_GetEncoding(NULL, "iso8859-1"); - } - - /* - * Object used by FilterInputBytes to keep track of how much data has - * been consumed from the channel buffers. - */ - - gs.objPtr = objPtr; - gs.dstPtr = &dst; - gs.encoding = encoding; - gs.bufPtr = bufPtr; - gs.state = oldState; - gs.rawRead = 0; - gs.bytesWrote = 0; - gs.charsWrote = 0; - gs.totalChars = 0; - - dst = objPtr->bytes + oldLength; - dstEnd = dst; - - skip = 0; - eof = NULL; - inEofChar = chanPtr->inEofChar; - - while (1) { - if (dst >= dstEnd) { - if (FilterInputBytes(chanPtr, &gs) != 0) { - goto restore; - } - dstEnd = dst + gs.bytesWrote; - } - - /* - * Remember if EOF char is seen, then look for EOL anyhow, because - * the EOL might be before the EOF char. - */ - - if (inEofChar != '\0') { - for (eol = dst; eol < dstEnd; eol++) { - if (*eol == inEofChar) { - dstEnd = eol; - eof = eol; - break; - } - } - } - - /* - * On EOL, leave current file position pointing after the EOL, but - * don't store the EOL in the output string. - */ - - eol = dst; - switch (chanPtr->inputTranslation) { - case TCL_TRANSLATE_LF: { - for (eol = dst; eol < dstEnd; eol++) { - if (*eol == '\n') { - skip = 1; - goto goteol; - } - } - break; - } - case TCL_TRANSLATE_CR: { - for (eol = dst; eol < dstEnd; eol++) { - if (*eol == '\r') { - skip = 1; - goto goteol; - } - } - break; - } - case TCL_TRANSLATE_CRLF: { - for (eol = dst; eol < dstEnd; eol++) { - if (*eol == '\r') { - eol++; - if (eol >= dstEnd) { - int offset; - - offset = eol - objPtr->bytes; - dst = dstEnd; - if (FilterInputBytes(chanPtr, &gs) != 0) { - goto restore; - } - dstEnd = dst + gs.bytesWrote; - eol = objPtr->bytes + offset; - if (eol >= dstEnd) { - skip = 0; - goto goteol; - } - } - if (*eol == '\n') { - eol--; - skip = 2; - goto goteol; - } - } - } - break; - } - case TCL_TRANSLATE_AUTO: { - skip = 1; - if (chanPtr->flags & INPUT_SAW_CR) { - chanPtr->flags &= ~INPUT_SAW_CR; - if (*eol == '\n') { - /* - * Skip the raw bytes that make up the '\n'. - */ - - char tmp[1 + TCL_UTF_MAX]; - int rawRead; - - bufPtr = gs.bufPtr; - Tcl_ExternalToUtf(NULL, gs.encoding, - bufPtr->buf + bufPtr->nextRemoved, - gs.rawRead, chanPtr->inputEncodingFlags, - &gs.state, tmp, 1 + TCL_UTF_MAX, &rawRead, - NULL, NULL); - bufPtr->nextRemoved += rawRead; - gs.rawRead -= rawRead; - gs.bytesWrote--; - gs.charsWrote--; - memmove(dst, dst + 1, (size_t) (dstEnd - dst)); - dstEnd--; - } - } - for (eol = dst; eol < dstEnd; eol++) { - if (*eol == '\r') { - eol++; - if (eol == dstEnd) { - /* - * If buffer ended on \r, peek ahead to see if a - * \n is available. - */ - - int offset; - - offset = eol - objPtr->bytes; - dst = dstEnd; - PeekAhead(chanPtr, &dstEnd, &gs); - eol = objPtr->bytes + offset; - if (eol >= dstEnd) { - eol--; - chanPtr->flags |= INPUT_SAW_CR; - goto goteol; - } - } - if (*eol == '\n') { - skip++; - } - eol--; - goto goteol; - } else if (*eol == '\n') { - goto goteol; - } - } - } - } - if (eof != NULL) { - /* - * EOF character was seen. On EOF, leave current file position - * pointing at the EOF character, but don't store the EOF - * character in the output string. - */ - - dstEnd = eof; - chanPtr->flags |= (CHANNEL_EOF | CHANNEL_STICKY_EOF); - chanPtr->inputEncodingFlags |= TCL_ENCODING_END; - } - if (chanPtr->flags & CHANNEL_EOF) { - skip = 0; - eol = dstEnd; - if (eol == objPtr->bytes) { - /* - * If we didn't produce any bytes before encountering EOF, - * caller needs to see -1. - */ - - Tcl_SetObjLength(objPtr, 0); - CommonGetsCleanup(chanPtr, encoding); - copiedTotal = -1; - goto done; - } - goto goteol; - } - dst = dstEnd; - } - - /* - * Found EOL or EOF, but the output buffer may now contain too many - * UTF-8 characters. We need to know how many raw bytes correspond to - * the number of UTF-8 characters we want, plus how many raw bytes - * correspond to the character(s) making up EOL (if any), so we can - * remove the correct number of bytes from the channel buffer. - */ - - goteol: - bufPtr = gs.bufPtr; - chanPtr->inputEncodingState = gs.state; - Tcl_ExternalToUtf(NULL, gs.encoding, bufPtr->buf + bufPtr->nextRemoved, - gs.rawRead, chanPtr->inputEncodingFlags, - &chanPtr->inputEncodingState, dst, eol - dst + skip + TCL_UTF_MAX, - &gs.rawRead, NULL, &gs.charsWrote); - bufPtr->nextRemoved += gs.rawRead; - - /* - * Recycle all the emptied buffers. - */ - - Tcl_SetObjLength(objPtr, eol - objPtr->bytes); - CommonGetsCleanup(chanPtr, encoding); - chanPtr->flags &= ~CHANNEL_BLOCKED; - copiedTotal = gs.totalChars + gs.charsWrote - skip; - goto done; - - /* - * Couldn't get a complete line. This only happens if we get a error - * reading from the channel or we are non-blocking and there wasn't - * an EOL or EOF in the data available. - */ - - restore: - bufPtr = chanPtr->inQueueHead; - bufPtr->nextRemoved = oldRemoved; - - for (bufPtr = bufPtr->nextPtr; bufPtr != NULL; bufPtr = bufPtr->nextPtr) { - bufPtr->nextRemoved = BUFFER_PADDING; - } - CommonGetsCleanup(chanPtr, encoding); - - chanPtr->inputEncodingState = oldState; - chanPtr->inputEncodingFlags = oldFlags; - Tcl_SetObjLength(objPtr, oldLength); - - /* - * We didn't get a complete line so we need to indicate to UpdateInterest - * that the gets blocked. It will wait for more data instead of firing - * a timer, avoiding a busy wait. This is where we are assuming that the - * next operation is a gets. No more file events will be delivered on - * this channel until new data arrives or some operation is performed - * on the channel (e.g. gets, read, fconfigure) that changes the blocking - * state. Note that this means a file event will not be delivered even - * though a read would be able to consume the buffered data. - */ - - chanPtr->flags |= CHANNEL_NEED_MORE_DATA; - copiedTotal = -1; - - done: - /* - * Update the notifier state so we don't block while there is still - * data in the buffers. - */ - - UpdateInterest(chanPtr); - return copiedTotal; -} - -/* - *--------------------------------------------------------------------------- - * - * FilterInputBytes -- - * - * Helper function for Tcl_GetsObj. Produces UTF-8 characters from - * raw bytes read from the channel. - * - * Consumes available bytes from channel buffers. When channel - * buffers are exhausted, reads more bytes from channel device into - * a new channel buffer. It is the caller's responsibility to - * free the channel buffers that have been exhausted. - * - * Results: - * The return value is -1 if there was an error reading from the - * channel, 0 otherwise. - * - * Side effects: - * Status object keeps track of how much data from channel buffers - * has been consumed and where UTF-8 bytes should be stored. - * - *--------------------------------------------------------------------------- - */ - -static int -FilterInputBytes(chanPtr, gsPtr) - Channel *chanPtr; /* Channel to read. */ - GetsState *gsPtr; /* Current state of gets operation. */ -{ - ChannelBuffer *bufPtr; - char *raw, *rawStart, *rawEnd; - char *dst; - int offset, toRead, dstNeeded, spaceLeft, result, rawLen, length; - Tcl_Obj *objPtr; -#define ENCODING_LINESIZE 30 /* Lower bound on how many bytes to convert - * at a time. Since we don't know a priori - * how many bytes of storage this many source - * bytes will use, we actually need at least - * ENCODING_LINESIZE * TCL_MAX_UTF bytes of - * room. */ - - objPtr = gsPtr->objPtr; - - /* - * Subtract the number of bytes that were removed from channel buffer - * during last call. - */ - - bufPtr = gsPtr->bufPtr; - if (bufPtr != NULL) { - bufPtr->nextRemoved += gsPtr->rawRead; - if (bufPtr->nextRemoved >= bufPtr->nextAdded) { - bufPtr = bufPtr->nextPtr; - } - } - gsPtr->totalChars += gsPtr->charsWrote; - - if ((bufPtr == NULL) || (bufPtr->nextAdded == BUFFER_PADDING)) { - /* - * All channel buffers were exhausted and the caller still hasn't - * seen EOL. Need to read more bytes from the channel device. - * Side effect is to allocate another channel buffer. - */ - - read: - if (chanPtr->flags & CHANNEL_BLOCKED) { - if (chanPtr->flags & CHANNEL_NONBLOCKING) { - gsPtr->charsWrote = 0; - gsPtr->rawRead = 0; - return -1; - } - chanPtr->flags &= ~CHANNEL_BLOCKED; - } - if (GetInput(chanPtr) != 0) { - gsPtr->charsWrote = 0; - gsPtr->rawRead = 0; - return -1; - } - bufPtr = chanPtr->inQueueTail; - gsPtr->bufPtr = bufPtr; - } - - /* - * Convert some of the bytes from the channel buffer to UTF-8. Space in - * objPtr's string rep is used to hold the UTF-8 characters. Grow the - * string rep if we need more space. - */ - - rawStart = bufPtr->buf + bufPtr->nextRemoved; - raw = rawStart; - rawEnd = bufPtr->buf + bufPtr->nextAdded; - rawLen = rawEnd - rawStart; - - dst = *gsPtr->dstPtr; - offset = dst - objPtr->bytes; - toRead = ENCODING_LINESIZE; - if (toRead > rawLen) { - toRead = rawLen; - } - dstNeeded = toRead * TCL_UTF_MAX + 1; - spaceLeft = objPtr->length - offset - TCL_UTF_MAX - 1; - if (dstNeeded > spaceLeft) { - length = offset * 2; - if (offset < dstNeeded) { - length = offset + dstNeeded; - } - length += TCL_UTF_MAX + 1; - Tcl_SetObjLength(objPtr, length); - spaceLeft = length - offset; - dst = objPtr->bytes + offset; - *gsPtr->dstPtr = dst; - } - gsPtr->state = chanPtr->inputEncodingState; - result = Tcl_ExternalToUtf(NULL, gsPtr->encoding, raw, rawLen, - chanPtr->inputEncodingFlags, &chanPtr->inputEncodingState, - dst, spaceLeft, &gsPtr->rawRead, &gsPtr->bytesWrote, - &gsPtr->charsWrote); - if (result == TCL_CONVERT_MULTIBYTE) { - /* - * The last few bytes in this channel buffer were the start of a - * multibyte sequence. If this buffer was full, then move them to - * the next buffer so the bytes will be contiguous. - */ - - ChannelBuffer *nextPtr; - int extra; - - nextPtr = bufPtr->nextPtr; - if (bufPtr->nextAdded < bufPtr->bufLength) { - if (gsPtr->rawRead > 0) { - /* - * Some raw bytes were converted to UTF-8. Fall through, - * returning those UTF-8 characters because a EOL might be - * present in them. - */ - } else if (chanPtr->flags & CHANNEL_EOF) { - /* - * There was a partial character followed by EOF on the - * device. Fall through, returning that nothing was found. - */ - - bufPtr->nextRemoved = bufPtr->nextAdded; - } else { - /* - * There are no more cached raw bytes left. See if we can - * get some more. - */ - - goto read; - } - } else { - if (nextPtr == NULL) { - nextPtr = AllocChannelBuffer(chanPtr->bufSize); - bufPtr->nextPtr = nextPtr; - chanPtr->inQueueTail = nextPtr; - } - extra = rawLen - gsPtr->rawRead; - memcpy((VOID *) (nextPtr->buf + BUFFER_PADDING - extra), - (VOID *) (raw + gsPtr->rawRead), (size_t) extra); - nextPtr->nextRemoved -= extra; - bufPtr->nextAdded -= extra; - } - } - - gsPtr->bufPtr = bufPtr; - return 0; -} - -/* - *--------------------------------------------------------------------------- - * - * PeekAhead -- - * - * Helper function used by Tcl_GetsObj(). Called when we've seen a - * \r at the end of the UTF-8 string and want to look ahead one - * character to see if it is a \n. - * - * Results: - * *gsPtr->dstPtr is filled with a pointer to the start of the range of - * UTF-8 characters that were found by peeking and *dstEndPtr is filled - * with a pointer to the bytes just after the end of the range. - * - * Side effects: - * If no more raw bytes were available in one of the channel buffers, - * tries to perform a non-blocking read to get more bytes from the - * channel device. - * - *--------------------------------------------------------------------------- - */ - -static void -PeekAhead(chanPtr, dstEndPtr, gsPtr) - Channel *chanPtr; /* The channel to read. */ - char **dstEndPtr; /* Filled with pointer to end of new range - * of UTF-8 characters. */ - GetsState *gsPtr; /* Current state of gets operation. */ -{ - ChannelBuffer *bufPtr; - Tcl_DriverBlockModeProc *blockModeProc; - int bytesLeft; - - bufPtr = gsPtr->bufPtr; - - /* - * If there's any more raw input that's still buffered, we'll peek into - * that. Otherwise, only get more data from the channel driver if it - * looks like there might actually be more data. The assumption is that - * if the channel buffer is filled right up to the end, then there - * might be more data to read. - */ - - blockModeProc = NULL; - if (bufPtr->nextPtr == NULL) { - bytesLeft = bufPtr->nextAdded - (bufPtr->nextRemoved + gsPtr->rawRead); - if (bytesLeft == 0) { - if (bufPtr->nextAdded < bufPtr->bufLength) { - /* - * Don't peek ahead if last read was short read. - */ - - goto cleanup; - } - if ((chanPtr->flags & CHANNEL_NONBLOCKING) == 0) { - blockModeProc = chanPtr->typePtr->blockModeProc; - if (blockModeProc == NULL) { - /* - * Don't peek ahead if cannot set non-blocking mode. - */ - - goto cleanup; - } - (*blockModeProc)(chanPtr->instanceData, TCL_MODE_NONBLOCKING); - } - } - } - if (FilterInputBytes(chanPtr, gsPtr) == 0) { - *dstEndPtr = *gsPtr->dstPtr + gsPtr->bytesWrote; - } - if (blockModeProc != NULL) { - (*blockModeProc)(chanPtr->instanceData, TCL_MODE_BLOCKING); - } - return; - - cleanup: - bufPtr->nextRemoved += gsPtr->rawRead; - gsPtr->rawRead = 0; - gsPtr->totalChars += gsPtr->charsWrote; - gsPtr->bytesWrote = 0; - gsPtr->charsWrote = 0; -} - -/* - *--------------------------------------------------------------------------- - * - * CommonGetsCleanup -- - * - * Helper function for Tcl_GetsObj() to restore the channel after - * a "gets" operation. - * - * Results: - * None. - * - * Side effects: - * Encoding may be freed. - * - *--------------------------------------------------------------------------- - */ - -static void -CommonGetsCleanup(chanPtr, encoding) - Channel *chanPtr; - Tcl_Encoding encoding; -{ - ChannelBuffer *bufPtr, *nextPtr; - - bufPtr = chanPtr->inQueueHead; - for ( ; bufPtr != NULL; bufPtr = nextPtr) { - nextPtr = bufPtr->nextPtr; - if (bufPtr->nextRemoved < bufPtr->nextAdded) { - break; - } - RecycleBuffer(chanPtr, bufPtr, 0); - } - chanPtr->inQueueHead = bufPtr; - if (bufPtr == NULL) { - chanPtr->inQueueTail = NULL; - } else { - /* - * If any multi-byte characters were split across channel buffer - * boundaries, the split-up bytes were moved to the next channel - * buffer by FilterInputBytes(). Move the bytes back to their - * original buffer because the caller could change the channel's - * encoding which could change the interpretation of whether those - * bytes really made up multi-byte characters after all. - */ - - nextPtr = bufPtr->nextPtr; - for ( ; nextPtr != NULL; nextPtr = bufPtr->nextPtr) { - int extra; - - extra = bufPtr->bufLength - bufPtr->nextAdded; - if (extra > 0) { - memcpy((VOID *) (bufPtr->buf + bufPtr->nextAdded), - (VOID *) (nextPtr->buf + BUFFER_PADDING - extra), - (size_t) extra); - bufPtr->nextAdded += extra; - nextPtr->nextRemoved = BUFFER_PADDING; - } - bufPtr = nextPtr; - } - } - if (chanPtr->encoding == NULL) { - Tcl_FreeEncoding(encoding); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Read -- - * - * Reads a given number of bytes from a channel. EOL and EOF - * translation is done on the bytes being read, so the the number - * of bytes consumed from the channel may not be equal to the - * number of bytes stored in the destination buffer. - * - * No encoding conversions are applied to the bytes being read. - * - * Results: - * The number of bytes read, or -1 on error. Use Tcl_GetErrno() - * to retrieve the error code for the error that occurred. - * - * Side effects: - * May cause input to be buffered. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Read(chan, dst, bytesToRead) - Tcl_Channel chan; /* The channel from which to read. */ - char *dst; /* Where to store input read. */ - int bytesToRead; /* Maximum number of bytes to read. */ -{ - Channel *chanPtr; - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_READABLE) != 0) { - return -1; - } - - return DoRead(chanPtr, dst, bytesToRead); -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_ReadChars -- - * - * Reads from the channel until the requested number of characters - * have been seen, EOF is seen, or the channel would block. EOL - * and EOF translation is done. If reading binary data, the raw - * bytes are wrapped in a Tcl byte array object. Otherwise, the raw - * bytes are converted to UTF-8 using the channel's current encoding - * and stored in a Tcl string object. - * - * Results: - * The number of characters read, or -1 on error. Use Tcl_GetErrno() - * to retrieve the error code for the error that occurred. - * - * Side effects: - * May cause input to be buffered. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_ReadChars(chan, objPtr, toRead, appendFlag) - Tcl_Channel chan; /* The channel to read. */ - Tcl_Obj *objPtr; /* Input data is stored in this object. */ - int toRead; /* Maximum number of characters to store, - * or -1 to read all available data (up to EOF - * or when channel blocks). */ - int appendFlag; /* If non-zero, data read from the channel - * will be appended to the object. Otherwise, - * the data will replace the existing contents - * of the object. */ - -{ - Channel *chanPtr; - int offset, factor, copied, copiedNow, result; - ChannelBuffer *bufPtr; - Tcl_Encoding encoding; -#define UTF_EXPANSION_FACTOR 1024 - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_READABLE) != 0) { - copied = -1; - goto done; - } - - encoding = chanPtr->encoding; - factor = UTF_EXPANSION_FACTOR; - - if (appendFlag == 0) { - if (encoding == NULL) { - Tcl_SetByteArrayLength(objPtr, 0); - } else { - Tcl_SetObjLength(objPtr, 0); - } - offset = 0; - } else { - if (encoding == NULL) { - Tcl_GetByteArrayFromObj(objPtr, &offset); - } else { - Tcl_GetStringFromObj(objPtr, &offset); - } - } - - for (copied = 0; (unsigned) toRead > 0; ) { - copiedNow = -1; - if (chanPtr->inQueueHead != NULL) { - if (encoding == NULL) { - copiedNow = ReadBytes(chanPtr, objPtr, toRead, &offset); - } else { - copiedNow = ReadChars(chanPtr, objPtr, toRead, &offset, - &factor); - } - - /* - * If the current buffer is empty recycle it. - */ - - bufPtr = chanPtr->inQueueHead; - if (bufPtr->nextRemoved == bufPtr->nextAdded) { - ChannelBuffer *nextPtr; - - nextPtr = bufPtr->nextPtr; - RecycleBuffer(chanPtr, bufPtr, 0); - chanPtr->inQueueHead = nextPtr; - if (nextPtr == NULL) { - chanPtr->inQueueTail = nextPtr; - } - } - } - if (copiedNow < 0) { - if (chanPtr->flags & CHANNEL_EOF) { - break; - } - if (chanPtr->flags & CHANNEL_BLOCKED) { - if (chanPtr->flags & CHANNEL_NONBLOCKING) { - break; - } - chanPtr->flags &= ~CHANNEL_BLOCKED; - } - result = GetInput(chanPtr); - if (result != 0) { - if (result == EAGAIN) { - break; - } - copied = -1; - goto done; - } - } else { - copied += copiedNow; - toRead -= copiedNow; - } - } - chanPtr->flags &= ~CHANNEL_BLOCKED; - if (encoding == NULL) { - Tcl_SetByteArrayLength(objPtr, offset); - } else { - Tcl_SetObjLength(objPtr, offset); - } - - done: - /* - * Update the notifier state so we don't block while there is still - * data in the buffers. - */ - - UpdateInterest(chanPtr); - return copied; -} -/* - *--------------------------------------------------------------------------- - * - * ReadBytes -- - * - * Reads from the channel until the requested number of bytes have - * been seen, EOF is seen, or the channel would block. Bytes from - * the channel are stored in objPtr as a ByteArray object. EOL - * and EOF translation are done. - * - * 'bytesToRead' can safely be a very large number because - * space is only allocated to hold data read from the channel - * as needed. - * - * Results: - * The return value is the number of bytes appended to the object - * and *offsetPtr is filled with the total number of bytes in the - * object (greater than the return value if there were already bytes - * in the object). - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static int -ReadBytes(chanPtr, objPtr, bytesToRead, offsetPtr) - Channel *chanPtr; /* The channel to read. */ - int bytesToRead; /* Maximum number of characters to store, - * or < 0 to get all available characters. - * Characters are obtained from the first - * buffer in the queue -- even if this number - * is larger than the number of characters - * available in the first buffer, only the - * characters from the first buffer are - * returned. */ - Tcl_Obj *objPtr; /* Input data is appended to this ByteArray - * object. Its length is how much space - * has been allocated to hold data, not how - * many bytes of data have been stored in the - * object. */ - int *offsetPtr; /* On input, contains how many bytes of - * objPtr have been used to hold data. On - * output, filled with how many bytes are now - * being used. */ -{ - int toRead, srcLen, srcRead, dstWrote, offset, length; - ChannelBuffer *bufPtr; - char *src, *dst; - - offset = *offsetPtr; - - bufPtr = chanPtr->inQueueHead; - src = bufPtr->buf + bufPtr->nextRemoved; - srcLen = bufPtr->nextAdded - bufPtr->nextRemoved; - - toRead = bytesToRead; - if ((unsigned) toRead > (unsigned) srcLen) { - toRead = srcLen; - } - - dst = (char *) Tcl_GetByteArrayFromObj(objPtr, &length); - if (toRead > length - offset - 1) { - /* - * Double the existing size of the object or make enough room to - * hold all the characters we may get from the source buffer, - * whichever is larger. - */ - - length = offset * 2; - if (offset < toRead) { - length = offset + toRead + 1; - } - dst = (char *) Tcl_SetByteArrayLength(objPtr, length); - } - dst += offset; - - if (chanPtr->flags & INPUT_NEED_NL) { - chanPtr->flags &= ~INPUT_NEED_NL; - if ((srcLen == 0) || (*src != '\n')) { - *dst = '\r'; - *offsetPtr += 1; - return 1; - } - *dst++ = '\n'; - src++; - srcLen--; - toRead--; - } - - srcRead = srcLen; - dstWrote = toRead; - if (TranslateInputEOL(chanPtr, dst, src, &dstWrote, &srcRead) != 0) { - if (dstWrote == 0) { - return -1; - } - } - bufPtr->nextRemoved += srcRead; - *offsetPtr += dstWrote; - return dstWrote; -} - -/* - *--------------------------------------------------------------------------- - * - * ReadChars -- - * - * Reads from the channel until the requested number of UTF-8 - * characters have been seen, EOF is seen, or the channel would - * block. Raw bytes from the channel are converted to UTF-8 - * and stored in objPtr. EOL and EOF translation is done. - * - * 'charsToRead' can safely be a very large number because - * space is only allocated to hold data read from the channel - * as needed. - * - * Results: - * The return value is the number of characters appended to - * the object, *offsetPtr is filled with the number of bytes that - * were appended, and *factorPtr is filled with the expansion - * factor used to guess how many bytes of UTF-8 to allocate to - * hold N source bytes. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static int -ReadChars(chanPtr, objPtr, charsToRead, offsetPtr, factorPtr) - Channel *chanPtr; /* The channel to read. */ - int charsToRead; /* Maximum number of characters to store, - * or -1 to get all available characters. - * Characters are obtained from the first - * buffer in the queue -- even if this number - * is larger than the number of characters - * available in the first buffer, only the - * characters from the first buffer are - * returned. */ - Tcl_Obj *objPtr; /* Input data is appended to this object. - * objPtr->length is how much space has been - * allocated to hold data, not how many bytes - * of data have been stored in the object. */ - int *offsetPtr; /* On input, contains how many bytes of - * objPtr have been used to hold data. On - * output, filled with how many bytes are now - * being used. */ - int *factorPtr; /* On input, contains a guess of how many - * bytes need to be allocated to hold the - * result of converting N source bytes to - * UTF-8. On output, contains another guess - * based on the data seen so far. */ -{ - int toRead, factor, offset, spaceLeft, length; - int srcLen, srcRead, dstNeeded, dstRead, dstWrote, numChars; - ChannelBuffer *bufPtr; - char *src, *dst; - Tcl_EncodingState oldState; - - factor = *factorPtr; - offset = *offsetPtr; - - bufPtr = chanPtr->inQueueHead; - src = bufPtr->buf + bufPtr->nextRemoved; - srcLen = bufPtr->nextAdded - bufPtr->nextRemoved; - - toRead = charsToRead; - if ((unsigned) toRead > (unsigned) srcLen) { - toRead = srcLen; - } - - /* - * 'factor' is how much we guess that the bytes in the source buffer - * will expand when converted to UTF-8 chars. This guess comes from - * analyzing how many characters were produced by the previous - * pass. - */ - - dstNeeded = toRead * factor / UTF_EXPANSION_FACTOR; - spaceLeft = objPtr->length - offset - TCL_UTF_MAX - 1; - - if (dstNeeded > spaceLeft) { - /* - * Double the existing size of the object or make enough room to - * hold all the characters we want from the source buffer, - * whichever is larger. - */ - - length = offset * 2; - if (offset < dstNeeded) { - length = offset + dstNeeded; - } - spaceLeft = length - offset; - length += TCL_UTF_MAX + 1; - Tcl_SetObjLength(objPtr, length); - } - if (toRead == srcLen) { - /* - * Want to convert the whole buffer in one pass. If we have - * enough space, convert it using all available space in object - * rather than using the factor. - */ - - dstNeeded = spaceLeft; - } - dst = objPtr->bytes + offset; - - oldState = chanPtr->inputEncodingState; - if (chanPtr->flags & INPUT_NEED_NL) { - /* - * We want a '\n' because the last character we saw was '\r'. - */ - - chanPtr->flags &= ~INPUT_NEED_NL; - Tcl_ExternalToUtf(NULL, chanPtr->encoding, src, srcLen, - chanPtr->inputEncodingFlags, &chanPtr->inputEncodingState, - dst, TCL_UTF_MAX + 1, &srcRead, &dstWrote, &numChars); - if ((dstWrote > 0) && (*dst == '\n')) { - /* - * The next char was a '\n'. Consume it and produce a '\n'. - */ - - bufPtr->nextRemoved += srcRead; - } else { - /* - * The next char was not a '\n'. Produce a '\r'. - */ - - *dst = '\r'; - } - chanPtr->inputEncodingFlags &= ~TCL_ENCODING_START; - *offsetPtr += 1; - return 1; - } - - Tcl_ExternalToUtf(NULL, chanPtr->encoding, src, srcLen, - chanPtr->inputEncodingFlags, &chanPtr->inputEncodingState, dst, - dstNeeded + TCL_UTF_MAX, &srcRead, &dstWrote, &numChars); - if (srcRead == 0) { - /* - * Not enough bytes in src buffer to make a complete char. Copy - * the bytes to the next buffer to make a new contiguous string, - * then tell the caller to fill the buffer with more bytes. - */ - - ChannelBuffer *nextPtr; - - nextPtr = bufPtr->nextPtr; - if (nextPtr == NULL) { - /* - * There isn't enough data in the buffers to complete the next - * character, so we need to wait for more data before the next - * file event can be delivered. - */ - - chanPtr->flags |= CHANNEL_NEED_MORE_DATA; - return -1; - } - nextPtr->nextRemoved -= srcLen; - memcpy((VOID *) (nextPtr->buf + nextPtr->nextRemoved), (VOID *) src, - (size_t) srcLen); - RecycleBuffer(chanPtr, bufPtr, 0); - chanPtr->inQueueHead = nextPtr; - return ReadChars(chanPtr, objPtr, charsToRead, offsetPtr, factorPtr); - } - - dstRead = dstWrote; - if (TranslateInputEOL(chanPtr, dst, dst, &dstWrote, &dstRead) != 0) { - /* - * Hit EOF char. How many bytes of src correspond to where the - * EOF was located in dst? - */ - - if (dstWrote == 0) { - return -1; - } - chanPtr->inputEncodingState = oldState; - Tcl_ExternalToUtf(NULL, chanPtr->encoding, src, srcLen, - chanPtr->inputEncodingFlags, &chanPtr->inputEncodingState, - dst, dstRead + TCL_UTF_MAX, &srcRead, &dstWrote, &numChars); - TranslateInputEOL(chanPtr, dst, dst, &dstWrote, &dstRead); - } - - /* - * The number of characters that we got may be less than the number - * that we started with because "\r\n" sequences may have been - * turned into just '\n' in dst. - */ - - numChars -= (dstRead - dstWrote); - - if ((unsigned) numChars > (unsigned) toRead) { - /* - * Got too many chars. - */ - - char *eof; - - eof = Tcl_UtfAtIndex(dst, toRead); - chanPtr->inputEncodingState = oldState; - Tcl_ExternalToUtf(NULL, chanPtr->encoding, src, srcLen, - chanPtr->inputEncodingFlags, &chanPtr->inputEncodingState, - dst, eof - dst + TCL_UTF_MAX, &srcRead, &dstWrote, &numChars); - dstRead = dstWrote; - TranslateInputEOL(chanPtr, dst, dst, &dstWrote, &dstRead); - numChars -= (dstRead - dstWrote); - } - chanPtr->inputEncodingFlags &= ~TCL_ENCODING_START; - - bufPtr->nextRemoved += srcRead; - if (dstWrote > srcRead + 1) { - *factorPtr = dstWrote * UTF_EXPANSION_FACTOR / srcRead; - } - *offsetPtr += dstWrote; - return numChars; -} - -/* - *--------------------------------------------------------------------------- - * - * TranslateInputEOL -- - * - * Perform input EOL and EOF translation on the source buffer, - * leaving the translated result in the destination buffer. - * - * Results: - * The return value is 1 if the EOF character was found when copying - * bytes to the destination buffer, 0 otherwise. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static int -TranslateInputEOL(chanPtr, dstStart, srcStart, dstLenPtr, srcLenPtr) - Channel *chanPtr; /* Channel being read, for EOL translation - * and EOF character. */ - char *dstStart; /* Output buffer filled with chars by - * applying appropriate EOL translation to - * source characters. */ - CONST char *srcStart; /* Source characters. */ - int *dstLenPtr; /* On entry, the maximum length of output - * buffer in bytes; must be <= *srcLenPtr. On - * exit, the number of bytes actually used in - * output buffer. */ - int *srcLenPtr; /* On entry, the length of source buffer. - * On exit, the number of bytes read from - * the source buffer. */ -{ - int dstLen, srcLen, inEofChar; - CONST char *eof; - - dstLen = *dstLenPtr; - - eof = NULL; - inEofChar = chanPtr->inEofChar; - if (inEofChar != '\0') { - /* - * Find EOF in translated buffer then compress out the EOL. The - * source buffer may be much longer than the destination buffer -- - * we only want to return EOF if the EOF has been copied to the - * destination buffer. - */ - - CONST char *src, *srcMax; - - srcMax = srcStart + *srcLenPtr; - for (src = srcStart; src < srcMax; src++) { - if (*src == inEofChar) { - eof = src; - srcLen = src - srcStart; - if (srcLen < dstLen) { - dstLen = srcLen; - } - *srcLenPtr = srcLen; - break; - } - } - } - switch (chanPtr->inputTranslation) { - case TCL_TRANSLATE_LF: { - if (dstStart != srcStart) { - memcpy((VOID *) dstStart, (VOID *) srcStart, (size_t) dstLen); - } - srcLen = dstLen; - break; - } - case TCL_TRANSLATE_CR: { - char *dst, *dstEnd; - - if (dstStart != srcStart) { - memcpy((VOID *) dstStart, (VOID *) srcStart, (size_t) dstLen); - } - dstEnd = dstStart + dstLen; - for (dst = dstStart; dst < dstEnd; dst++) { - if (*dst == '\r') { - *dst = '\n'; - } - } - srcLen = dstLen; - break; - } - case TCL_TRANSLATE_CRLF: { - char *dst; - CONST char *src, *srcEnd, *srcMax; - - dst = dstStart; - src = srcStart; - srcEnd = srcStart + dstLen; - srcMax = srcStart + *srcLenPtr; - - for ( ; src < srcEnd; ) { - if (*src == '\r') { - src++; - if (src >= srcMax) { - chanPtr->flags |= INPUT_NEED_NL; - } else if (*src == '\n') { - *dst++ = *src++; - } else { - *dst++ = '\r'; - } - } else { - *dst++ = *src++; - } - } - srcLen = src - srcStart; - dstLen = dst - dstStart; - break; - } - case TCL_TRANSLATE_AUTO: { - char *dst; - CONST char *src, *srcEnd, *srcMax; - - dst = dstStart; - src = srcStart; - srcEnd = srcStart + dstLen; - srcMax = srcStart + *srcLenPtr; - - if ((chanPtr->flags & INPUT_SAW_CR) && (src < srcMax)) { - if (*src == '\n') { - src++; - } - chanPtr->flags &= ~INPUT_SAW_CR; - } - for ( ; src < srcEnd; ) { - if (*src == '\r') { - src++; - if (src >= srcMax) { - chanPtr->flags |= INPUT_SAW_CR; - } else if (*src == '\n') { - if (srcEnd < srcMax) { - srcEnd++; - } - src++; - } - *dst++ = '\n'; - } else { - *dst++ = *src++; - } - } - srcLen = src - srcStart; - dstLen = dst - dstStart; - break; - } - default: { /* lint. */ - return 0; - } - } - *dstLenPtr = dstLen; - - if ((eof != NULL) && (srcStart + srcLen >= eof)) { - /* - * EOF character was seen in EOL translated range. Leave current - * file position pointing at the EOF character, but don't store the - * EOF character in the output string. - */ - - chanPtr->flags |= (CHANNEL_EOF | CHANNEL_STICKY_EOF); - chanPtr->inputEncodingFlags |= TCL_ENCODING_END; - chanPtr->flags &= ~(INPUT_SAW_CR | INPUT_NEED_NL); - return 1; - } - - *srcLenPtr = srcLen; - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Ungets -- - * - * Causes the supplied string to be added to the input queue of - * the channel, at either the head or tail of the queue. - * - * Results: - * The number of bytes stored in the channel, or -1 on error. - * - * Side effects: - * Adds input to the input queue of a channel. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Ungets(chan, str, len, atEnd) - Tcl_Channel chan; /* The channel for which to add the input. */ - char *str; /* The input itself. */ - int len; /* The length of the input. */ - int atEnd; /* If non-zero, add at end of queue; otherwise - * add at head of queue. */ -{ - Channel *chanPtr; /* The real IO channel. */ - ChannelBuffer *bufPtr; /* Buffer to contain the data. */ - int i, flags; - - chanPtr = (Channel *) chan; - - /* - * CheckChannelErrors clears too many flag bits in this one case. - */ - - flags = chanPtr->flags; - if (CheckChannelErrors(chanPtr, TCL_READABLE) != 0) { - len = -1; - goto done; - } - chanPtr->flags = flags; - - /* - * If we have encountered a sticky EOF, just punt without storing. - * (sticky EOF is set if we have seen the input eofChar, to prevent - * reading beyond the eofChar). Otherwise, clear the EOF flags, and - * clear the BLOCKED bit. We want to discover these conditions anew - * in each operation. - */ - - if (chanPtr->flags & CHANNEL_STICKY_EOF) { - goto done; - } - chanPtr->flags &= (~(CHANNEL_BLOCKED | CHANNEL_EOF)); - - bufPtr = AllocChannelBuffer(len); - for (i = 0; i < len; i++) { - bufPtr->buf[i] = str[i]; - } - bufPtr->nextAdded += len; - - if (chanPtr->inQueueHead == (ChannelBuffer *) NULL) { - bufPtr->nextPtr = (ChannelBuffer *) NULL; - chanPtr->inQueueHead = bufPtr; - chanPtr->inQueueTail = bufPtr; - } else if (atEnd) { - bufPtr->nextPtr = (ChannelBuffer *) NULL; - chanPtr->inQueueTail->nextPtr = bufPtr; - chanPtr->inQueueTail = bufPtr; - } else { - bufPtr->nextPtr = chanPtr->inQueueHead; - chanPtr->inQueueHead = bufPtr; - } - - done: - /* - * Update the notifier state so we don't block while there is still - * data in the buffers. - */ - - UpdateInterest(chanPtr); - return len; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Flush -- - * - * Flushes output data on a channel. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May flush output queued on this channel. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Flush(chan) - Tcl_Channel chan; /* The Channel to flush. */ -{ - int result; /* Of calling FlushChannel. */ - Channel *chanPtr; /* The actual channel. */ - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_WRITABLE) != 0) { - return -1; - } - - /* - * Force current output buffer to be output also. - */ - - if ((chanPtr->curOutPtr != NULL) - && (chanPtr->curOutPtr->nextAdded > 0)) { - chanPtr->flags |= BUFFER_READY; - } - - result = FlushChannel(NULL, chanPtr, 0); - if (result != 0) { - return TCL_ERROR; - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * DiscardInputQueued -- - * - * Discards any input read from the channel but not yet consumed - * by Tcl reading commands. - * - * Results: - * None. - * - * Side effects: - * May discard input from the channel. If discardLastBuffer is zero, - * leaves one buffer in place for back-filling. - * - *---------------------------------------------------------------------- - */ - -static void -DiscardInputQueued(chanPtr, discardSavedBuffers) - Channel *chanPtr; /* Channel on which to discard - * the queued input. */ - int discardSavedBuffers; /* If non-zero, discard all buffers including - * last one. */ -{ - ChannelBuffer *bufPtr, *nxtPtr; /* Loop variables. */ - - bufPtr = chanPtr->inQueueHead; - chanPtr->inQueueHead = (ChannelBuffer *) NULL; - chanPtr->inQueueTail = (ChannelBuffer *) NULL; - for (; bufPtr != (ChannelBuffer *) NULL; bufPtr = nxtPtr) { - nxtPtr = bufPtr->nextPtr; - RecycleBuffer(chanPtr, bufPtr, discardSavedBuffers); - } - - /* - * If discardSavedBuffers is nonzero, must also discard any previously - * saved buffer in the saveInBufPtr field. - */ - - if (discardSavedBuffers) { - if (chanPtr->saveInBufPtr != (ChannelBuffer *) NULL) { - ckfree((char *) chanPtr->saveInBufPtr); - chanPtr->saveInBufPtr = (ChannelBuffer *) NULL; - } - } -} - -/* - *--------------------------------------------------------------------------- - * - * GetInput -- - * - * Reads input data from a device into a channel buffer. - * - * Results: - * The return value is the Posix error code if an error occurred while - * reading from the file, or 0 otherwise. - * - * Side effects: - * Reads from the underlying device. - * - *--------------------------------------------------------------------------- - */ - -static int -GetInput(chanPtr) - Channel *chanPtr; /* Channel to read input from. */ -{ - int toRead; /* How much to read? */ - int result; /* Of calling driver. */ - int nread; /* How much was read from channel? */ - ChannelBuffer *bufPtr; /* New buffer to add to input queue. */ - - /* - * Prevent reading from a dead channel -- a channel that has been closed - * but not yet deallocated, which can happen if the exit handler for - * channel cleanup has run but the channel is still registered in some - * interpreter. - */ - - if (CheckForDeadChannel(NULL, chanPtr)) { - return EINVAL; - } - - /* - * See if we can fill an existing buffer. If we can, read only - * as much as will fit in it. Otherwise allocate a new buffer, - * add it to the input queue and attempt to fill it to the max. - */ - - bufPtr = chanPtr->inQueueTail; - if ((bufPtr != NULL) && (bufPtr->nextAdded < bufPtr->bufLength)) { - toRead = bufPtr->bufLength - bufPtr->nextAdded; - } else { - bufPtr = chanPtr->saveInBufPtr; - chanPtr->saveInBufPtr = NULL; - if (bufPtr == NULL) { - bufPtr = AllocChannelBuffer(chanPtr->bufSize); - } - bufPtr->nextPtr = (ChannelBuffer *) NULL; - - toRead = chanPtr->bufSize; - if (chanPtr->inQueueTail == NULL) { - chanPtr->inQueueHead = bufPtr; - } else { - chanPtr->inQueueTail->nextPtr = bufPtr; - } - chanPtr->inQueueTail = bufPtr; - } - - /* - * If EOF is set, we should avoid calling the driver because on some - * platforms it is impossible to read from a device after EOF. - */ - - if (chanPtr->flags & CHANNEL_EOF) { - return 0; - } - - nread = (*chanPtr->typePtr->inputProc)(chanPtr->instanceData, - bufPtr->buf + bufPtr->nextAdded, toRead, &result); - - if (nread > 0) { - bufPtr->nextAdded += nread; - - /* - * If we get a short read, signal up that we may be BLOCKED. We - * should avoid calling the driver because on some platforms we - * will block in the low level reading code even though the - * channel is set into nonblocking mode. - */ - - if (nread < toRead) { - chanPtr->flags |= CHANNEL_BLOCKED; - } - } else if (nread == 0) { - chanPtr->flags |= CHANNEL_EOF; - chanPtr->inputEncodingFlags |= TCL_ENCODING_END; - } else if (nread < 0) { - if ((result == EWOULDBLOCK) || (result == EAGAIN)) { - chanPtr->flags |= CHANNEL_BLOCKED; - result = EAGAIN; - } - Tcl_SetErrno(result); - return result; - } - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Seek -- - * - * Implements seeking on Tcl Channels. This is a public function - * so that other C facilities may be implemented on top of it. - * - * Results: - * The new access point or -1 on error. If error, use Tcl_GetErrno() - * to retrieve the POSIX error code for the error that occurred. - * - * Side effects: - * May flush output on the channel. May discard queued input. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Seek(chan, offset, mode) - Tcl_Channel chan; /* The channel on which to seek. */ - int offset; /* Offset to seek to. */ - int mode; /* Relative to which location to seek? */ -{ - Channel *chanPtr; /* The real IO channel. */ - ChannelBuffer *bufPtr; - int inputBuffered, outputBuffered; - int result; /* Of device driver operations. */ - int curPos; /* Position on the device. */ - int wasAsync; /* Was the channel nonblocking before the - * seek operation? If so, must restore to - * nonblocking mode after the seek. */ - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_WRITABLE | TCL_READABLE) != 0) { - return -1; - } - - /* - * Disallow seek on dead channels -- channels that have been closed but - * not yet been deallocated. Such channels can be found if the exit - * handler for channel cleanup has run but the channel is still - * registered in an interpreter. - */ - - if (CheckForDeadChannel(NULL,chanPtr)) return -1; - - /* - * Disallow seek on channels whose type does not have a seek procedure - * defined. This means that the channel does not support seeking. - */ - - if (chanPtr->typePtr->seekProc == (Tcl_DriverSeekProc *) NULL) { - Tcl_SetErrno(EINVAL); - return -1; - } - - /* - * Compute how much input and output is buffered. If both input and - * output is buffered, cannot compute the current position. - */ - - for (bufPtr = chanPtr->inQueueHead, inputBuffered = 0; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - inputBuffered += (bufPtr->nextAdded - bufPtr->nextRemoved); - } - for (bufPtr = chanPtr->outQueueHead, outputBuffered = 0; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - outputBuffered += (bufPtr->nextAdded - bufPtr->nextRemoved); - } - if ((chanPtr->curOutPtr != (ChannelBuffer *) NULL) && - (chanPtr->curOutPtr->nextAdded > chanPtr->curOutPtr->nextRemoved)) { - chanPtr->flags |= BUFFER_READY; - outputBuffered += - (chanPtr->curOutPtr->nextAdded - chanPtr->curOutPtr->nextRemoved); - } - - if ((inputBuffered != 0) && (outputBuffered != 0)) { - Tcl_SetErrno(EFAULT); - return -1; - } - - /* - * If we are seeking relative to the current position, compute the - * corrected offset taking into account the amount of unread input. - */ - - if (mode == SEEK_CUR) { - offset -= inputBuffered; - } - - /* - * Discard any queued input - this input should not be read after - * the seek. - */ - - DiscardInputQueued(chanPtr, 0); - - /* - * Reset EOF and BLOCKED flags. We invalidate them by moving the - * access point. Also clear CR related flags. - */ - - chanPtr->flags &= - (~(CHANNEL_EOF | CHANNEL_STICKY_EOF | CHANNEL_BLOCKED | INPUT_SAW_CR)); - - /* - * If the channel is in asynchronous output mode, switch it back - * to synchronous mode and cancel any async flush that may be - * scheduled. After the flush, the channel will be put back into - * asynchronous output mode. - */ - - wasAsync = 0; - if (chanPtr->flags & CHANNEL_NONBLOCKING) { - wasAsync = 1; - result = 0; - if (chanPtr->typePtr->blockModeProc != NULL) { - result = (chanPtr->typePtr->blockModeProc) (chanPtr->instanceData, - TCL_MODE_BLOCKING); - } - if (result != 0) { - Tcl_SetErrno(result); - return -1; - } - chanPtr->flags &= (~(CHANNEL_NONBLOCKING)); - if (chanPtr->flags & BG_FLUSH_SCHEDULED) { - chanPtr->flags &= (~(BG_FLUSH_SCHEDULED)); - } - } - - /* - * If the flush fails we cannot recover the original position. In - * that case the seek is not attempted because we do not know where - * the access position is - instead we return the error. FlushChannel - * has already called Tcl_SetErrno() to report the error upwards. - * If the flush succeeds we do the seek also. - */ - - if (FlushChannel(NULL, chanPtr, 0) != 0) { - curPos = -1; - } else { - - /* - * Now seek to the new position in the channel as requested by the - * caller. - */ - - curPos = (chanPtr->typePtr->seekProc) (chanPtr->instanceData, - (long) offset, mode, &result); - if (curPos == -1) { - Tcl_SetErrno(result); - } - } - - /* - * Restore to nonblocking mode if that was the previous behavior. - * - * NOTE: Even if there was an async flush active we do not restore - * it now because we already flushed all the queued output, above. - */ - - if (wasAsync) { - chanPtr->flags |= CHANNEL_NONBLOCKING; - result = 0; - if (chanPtr->typePtr->blockModeProc != NULL) { - result = (chanPtr->typePtr->blockModeProc) (chanPtr->instanceData, - TCL_MODE_NONBLOCKING); - } - if (result != 0) { - Tcl_SetErrno(result); - return -1; - } - } - - return curPos; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Tell -- - * - * Returns the position of the next character to be read/written on - * this channel. - * - * Results: - * A nonnegative integer on success, -1 on failure. If failed, - * use Tcl_GetErrno() to retrieve the POSIX error code for the - * error that occurred. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Tell(chan) - Tcl_Channel chan; /* The channel to return pos for. */ -{ - Channel *chanPtr; /* The actual channel to tell on. */ - ChannelBuffer *bufPtr; - int inputBuffered, outputBuffered; - int result; /* Of calling device driver. */ - int curPos; /* Position on device. */ - - chanPtr = (Channel *) chan; - if (CheckChannelErrors(chanPtr, TCL_WRITABLE | TCL_READABLE) != 0) { - return -1; - } - - /* - * Disallow tell on dead channels -- channels that have been closed but - * not yet been deallocated. Such channels can be found if the exit - * handler for channel cleanup has run but the channel is still - * registered in an interpreter. - */ - - if (CheckForDeadChannel(NULL,chanPtr)) { - return -1; - } - - /* - * Disallow tell on channels whose type does not have a seek procedure - * defined. This means that the channel does not support seeking. - */ - - if (chanPtr->typePtr->seekProc == (Tcl_DriverSeekProc *) NULL) { - Tcl_SetErrno(EINVAL); - return -1; - } - - /* - * Compute how much input and output is buffered. If both input and - * output is buffered, cannot compute the current position. - */ - - for (bufPtr = chanPtr->inQueueHead, inputBuffered = 0; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - inputBuffered += (bufPtr->nextAdded - bufPtr->nextRemoved); - } - for (bufPtr = chanPtr->outQueueHead, outputBuffered = 0; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - outputBuffered += (bufPtr->nextAdded - bufPtr->nextRemoved); - } - if ((chanPtr->curOutPtr != (ChannelBuffer *) NULL) && - (chanPtr->curOutPtr->nextAdded > chanPtr->curOutPtr->nextRemoved)) { - chanPtr->flags |= BUFFER_READY; - outputBuffered += - (chanPtr->curOutPtr->nextAdded - chanPtr->curOutPtr->nextRemoved); - } - - if ((inputBuffered != 0) && (outputBuffered != 0)) { - Tcl_SetErrno(EFAULT); - return -1; - } - - /* - * Get the current position in the device and compute the position - * where the next character will be read or written. - */ - - curPos = (chanPtr->typePtr->seekProc) (chanPtr->instanceData, - (long) 0, SEEK_CUR, &result); - if (curPos == -1) { - Tcl_SetErrno(result); - return -1; - } - if (inputBuffered != 0) { - return (curPos - inputBuffered); - } - return (curPos + outputBuffered); -} - -/* - *--------------------------------------------------------------------------- - * - * CheckChannelErrors -- - * - * See if the channel is in an ready state and can perform the - * desired operation. - * - * Results: - * The return value is 0 if the channel is OK, otherwise the - * return value is -1 and errno is set to indicate the error. - * - * Side effects: - * May clear the EOF and/or BLOCKED bits if reading from channel. - * - *--------------------------------------------------------------------------- - */ - -static int -CheckChannelErrors(chanPtr, direction) - Channel *chanPtr; /* Channel to check. */ - int direction; /* Test if channel supports desired operation: - * TCL_READABLE, TCL_WRITABLE. */ -{ - /* - * Check for unreported error. - */ - - if (chanPtr->unreportedError != 0) { - Tcl_SetErrno(chanPtr->unreportedError); - chanPtr->unreportedError = 0; - return -1; - } - - /* - * Fail if the channel is not opened for desired operation. - */ - - if ((chanPtr->flags & direction) == 0) { - Tcl_SetErrno(EACCES); - return -1; - } - - /* - * Fail if the channel is in the middle of a background copy. - */ - - if (chanPtr->csPtr != NULL) { - Tcl_SetErrno(EBUSY); - return -1; - } - - if (direction == TCL_READABLE) { - /* - * If we have not encountered a sticky EOF, clear the EOF bit - * (sticky EOF is set if we have seen the input eofChar, to prevent - * reading beyond the eofChar). Also, always clear the BLOCKED bit. - * We want to discover these conditions anew in each operation. - */ - - if ((chanPtr->flags & CHANNEL_STICKY_EOF) == 0) { - chanPtr->flags &= ~CHANNEL_EOF; - } - chanPtr->flags &= ~(CHANNEL_BLOCKED | CHANNEL_NEED_MORE_DATA); - } - - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Eof -- - * - * Returns 1 if the channel is at EOF, 0 otherwise. - * - * Results: - * 1 or 0, always. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Eof(chan) - Tcl_Channel chan; /* Does this channel have EOF? */ -{ - Channel *chanPtr; /* The real channel structure. */ - - chanPtr = (Channel *) chan; - return ((chanPtr->flags & CHANNEL_STICKY_EOF) || - ((chanPtr->flags & CHANNEL_EOF) && (Tcl_InputBuffered(chan) == 0))) - ? 1 : 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InputBlocked -- - * - * Returns 1 if input is blocked on this channel, 0 otherwise. - * - * Results: - * 0 or 1, always. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_InputBlocked(chan) - Tcl_Channel chan; /* Is this channel blocked? */ -{ - Channel *chanPtr; /* The real channel structure. */ - - chanPtr = (Channel *) chan; - return (chanPtr->flags & CHANNEL_BLOCKED) ? 1 : 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InputBuffered -- - * - * Returns the number of bytes of input currently buffered in the - * internal buffer of a channel. - * - * Results: - * The number of input bytes buffered, or zero if the channel is not - * open for reading. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_InputBuffered(chan) - Tcl_Channel chan; /* The channel to query. */ -{ - Channel *chanPtr; - int bytesBuffered; - ChannelBuffer *bufPtr; - - chanPtr = (Channel *) chan; - for (bytesBuffered = 0, bufPtr = chanPtr->inQueueHead; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - bytesBuffered += (bufPtr->nextAdded - bufPtr->nextRemoved); - } - return bytesBuffered; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetChannelBufferSize -- - * - * Sets the size of buffers to allocate to store input or output - * in the channel. The size must be between 10 bytes and 1 MByte. - * - * Results: - * None. - * - * Side effects: - * Sets the size of buffers subsequently allocated for this channel. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetChannelBufferSize(chan, sz) - Tcl_Channel chan; /* The channel whose buffer size - * to set. */ - int sz; /* The size to set. */ -{ - Channel *chanPtr; - - /* - * If the buffer size is smaller than 10 bytes or larger than one MByte, - * do not accept the requested size and leave the current buffer size. - */ - - if (sz < 10) { - return; - } - if (sz > (1024 * 1024)) { - return; - } - - chanPtr = (Channel *) chan; - chanPtr->bufSize = sz; - - if (chanPtr->outputStage != NULL) { - ckfree((char *) chanPtr->outputStage); - chanPtr->outputStage = NULL; - } - if ((chanPtr->encoding != NULL) && (chanPtr->flags & TCL_WRITABLE)) { - chanPtr->outputStage = (char *) - ckalloc((unsigned) (chanPtr->bufSize + 2)); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetChannelBufferSize -- - * - * Retrieves the size of buffers to allocate for this channel. - * - * Results: - * The size. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetChannelBufferSize(chan) - Tcl_Channel chan; /* The channel for which to find the - * buffer size. */ -{ - Channel *chanPtr; - - chanPtr = (Channel *) chan; - return chanPtr->bufSize; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_BadChannelOption -- - * - * This procedure generates a "bad option" error message in an - * (optional) interpreter. It is used by channel drivers when - * a invalid Set/Get option is requested. Its purpose is to concatenate - * the generic options list to the specific ones and factorize - * the generic options error message string. - * - * Results: - * TCL_ERROR. - * - * Side effects: - * An error message is generated in interp's result object to - * indicate that a command was invoked with the a bad option - * The message has the form - * bad option "blah": should be one of - * <...generic options...>+<...specific options...> - * "blah" is the optionName argument and "" - * is a space separated list of specific option words. - * The function takes good care of inserting minus signs before - * each option, commas after, and an "or" before the last option. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_BadChannelOption(interp, optionName, optionList) - Tcl_Interp *interp; /* Current interpreter. (can be NULL)*/ - char *optionName; /* 'bad option' name */ - char *optionList; /* Specific options list to append - * to the standard generic options. - * can be NULL for generic options - * only. - */ -{ - if (interp) { - CONST char *genericopt = - "blocking buffering buffersize eofchar translation"; - char **argv; - int argc, i; - Tcl_DString ds; - - Tcl_DStringInit(&ds); - Tcl_DStringAppend(&ds, (char *) genericopt, -1); - if (optionList && (*optionList)) { - Tcl_DStringAppend(&ds, " ", 1); - Tcl_DStringAppend(&ds, optionList, -1); - } - if (Tcl_SplitList(interp, Tcl_DStringValue(&ds), - &argc, &argv) != TCL_OK) { - panic("malformed option list in channel driver"); - } - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "bad option \"", optionName, - "\": should be one of ", (char *) NULL); - argc--; - for (i = 0; i < argc; i++) { - Tcl_AppendResult(interp, "-", argv[i], ", ", (char *) NULL); - } - Tcl_AppendResult(interp, "or -", argv[i], (char *) NULL); - Tcl_DStringFree(&ds); - ckfree((char *) argv); - } - Tcl_SetErrno(EINVAL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetChannelOption -- - * - * 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: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetChannelOption(interp, chan, optionName, dsPtr) - Tcl_Interp *interp; /* For error reporting - can be NULL. */ - Tcl_Channel chan; /* Channel on which to get option. */ - char *optionName; /* Option to get. */ - Tcl_DString *dsPtr; /* Where to store value(s). */ -{ - size_t len; /* Length of optionName string. */ - char optionVal[128]; /* Buffer for sprintf. */ - Channel *chanPtr = (Channel *) chan; - int flags; - - /* - * If we are in the middle of a background copy, use the saved flags. - */ - - if (chanPtr->csPtr) { - if (chanPtr == chanPtr->csPtr->readPtr) { - flags = chanPtr->csPtr->readFlags; - } else { - flags = chanPtr->csPtr->writeFlags; - } - } else { - flags = chanPtr->flags; - } - - /* - * Disallow options on dead channels -- channels that have been closed but - * not yet been deallocated. Such channels can be found if the exit - * handler for channel cleanup has run but the channel is still - * registered in an interpreter. - */ - - if (CheckForDeadChannel(interp,chanPtr)) return TCL_ERROR; - - /* - * If the optionName is NULL it means that we want a list of all - * options and values. - */ - - if (optionName == (char *) NULL) { - len = 0; - } else { - len = strlen(optionName); - } - - if ((len == 0) || ((len > 2) && (optionName[1] == 'b') && - (strncmp(optionName, "-blocking", len) == 0))) { - if (len == 0) { - Tcl_DStringAppendElement(dsPtr, "-blocking"); - } - Tcl_DStringAppendElement(dsPtr, - (flags & CHANNEL_NONBLOCKING) ? "0" : "1"); - if (len > 0) { - return TCL_OK; - } - } - if ((len == 0) || ((len > 7) && (optionName[1] == 'b') && - (strncmp(optionName, "-buffering", len) == 0))) { - if (len == 0) { - Tcl_DStringAppendElement(dsPtr, "-buffering"); - } - if (flags & CHANNEL_LINEBUFFERED) { - Tcl_DStringAppendElement(dsPtr, "line"); - } else if (flags & CHANNEL_UNBUFFERED) { - Tcl_DStringAppendElement(dsPtr, "none"); - } else { - Tcl_DStringAppendElement(dsPtr, "full"); - } - if (len > 0) { - return TCL_OK; - } - } - if ((len == 0) || ((len > 7) && (optionName[1] == 'b') && - (strncmp(optionName, "-buffersize", len) == 0))) { - if (len == 0) { - Tcl_DStringAppendElement(dsPtr, "-buffersize"); - } - TclFormatInt(optionVal, chanPtr->bufSize); - Tcl_DStringAppendElement(dsPtr, optionVal); - if (len > 0) { - return TCL_OK; - } - } - if ((len == 0) || - ((len > 2) && (optionName[1] == 'e') && - (strncmp(optionName, "-encoding", len) == 0))) { - if (len == 0) { - Tcl_DStringAppendElement(dsPtr, "-encoding"); - } - if (chanPtr->encoding == NULL) { - Tcl_DStringAppendElement(dsPtr, "binary"); - } else { - Tcl_DStringAppendElement(dsPtr, - Tcl_GetEncodingName(chanPtr->encoding)); - } - if (len > 0) { - return TCL_OK; - } - } - if ((len == 0) || - ((len > 2) && (optionName[1] == 'e') && - (strncmp(optionName, "-eofchar", len) == 0))) { - if (len == 0) { - Tcl_DStringAppendElement(dsPtr, "-eofchar"); - } - if (((flags & (TCL_READABLE|TCL_WRITABLE)) == - (TCL_READABLE|TCL_WRITABLE)) && (len == 0)) { - Tcl_DStringStartSublist(dsPtr); - } - if (flags & TCL_READABLE) { - if (chanPtr->inEofChar == 0) { - Tcl_DStringAppendElement(dsPtr, ""); - } else { - char buf[4]; - - sprintf(buf, "%c", chanPtr->inEofChar); - Tcl_DStringAppendElement(dsPtr, buf); - } - } - if (flags & TCL_WRITABLE) { - if (chanPtr->outEofChar == 0) { - Tcl_DStringAppendElement(dsPtr, ""); - } else { - char buf[4]; - - sprintf(buf, "%c", chanPtr->outEofChar); - Tcl_DStringAppendElement(dsPtr, buf); - } - } - if (((flags & (TCL_READABLE|TCL_WRITABLE)) == - (TCL_READABLE|TCL_WRITABLE)) && (len == 0)) { - Tcl_DStringEndSublist(dsPtr); - } - if (len > 0) { - return TCL_OK; - } - } - if ((len == 0) || - ((len > 1) && (optionName[1] == 't') && - (strncmp(optionName, "-translation", len) == 0))) { - if (len == 0) { - Tcl_DStringAppendElement(dsPtr, "-translation"); - } - if (((flags & (TCL_READABLE|TCL_WRITABLE)) == - (TCL_READABLE|TCL_WRITABLE)) && (len == 0)) { - Tcl_DStringStartSublist(dsPtr); - } - if (flags & TCL_READABLE) { - if (chanPtr->inputTranslation == TCL_TRANSLATE_AUTO) { - Tcl_DStringAppendElement(dsPtr, "auto"); - } else if (chanPtr->inputTranslation == TCL_TRANSLATE_CR) { - Tcl_DStringAppendElement(dsPtr, "cr"); - } else if (chanPtr->inputTranslation == TCL_TRANSLATE_CRLF) { - Tcl_DStringAppendElement(dsPtr, "crlf"); - } else { - Tcl_DStringAppendElement(dsPtr, "lf"); - } - } - if (flags & TCL_WRITABLE) { - if (chanPtr->outputTranslation == TCL_TRANSLATE_AUTO) { - Tcl_DStringAppendElement(dsPtr, "auto"); - } else if (chanPtr->outputTranslation == TCL_TRANSLATE_CR) { - Tcl_DStringAppendElement(dsPtr, "cr"); - } else if (chanPtr->outputTranslation == TCL_TRANSLATE_CRLF) { - Tcl_DStringAppendElement(dsPtr, "crlf"); - } else { - Tcl_DStringAppendElement(dsPtr, "lf"); - } - } - if (((flags & (TCL_READABLE|TCL_WRITABLE)) == - (TCL_READABLE|TCL_WRITABLE)) && (len == 0)) { - Tcl_DStringEndSublist(dsPtr); - } - if (len > 0) { - return TCL_OK; - } - } - if (chanPtr->typePtr->getOptionProc != (Tcl_DriverGetOptionProc *) NULL) { - /* - * let the driver specific handle additional options - * and result code and message. - */ - - return (chanPtr->typePtr->getOptionProc) (chanPtr->instanceData, - interp, optionName, dsPtr); - } else { - /* - * no driver specific options case. - */ - - if (len == 0) { - return TCL_OK; - } - return Tcl_BadChannelOption(interp, optionName, NULL); - } -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_SetChannelOption -- - * - * Sets an option on a channel. - * - * Results: - * A standard Tcl result. On error, sets interp's result object - * if interp is not NULL. - * - * Side effects: - * May modify an option on a device. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_SetChannelOption(interp, chan, optionName, newValue) - Tcl_Interp *interp; /* For error reporting - can be NULL. */ - Tcl_Channel chan; /* Channel on which to set mode. */ - char *optionName; /* Which option to set? */ - char *newValue; /* New value for option. */ -{ - int newMode; /* New (numeric) mode to sert. */ - Channel *chanPtr; /* The real IO channel. */ - size_t len; /* Length of optionName string. */ - int argc; - char **argv; - - chanPtr = (Channel *) chan; - - /* - * If the channel is in the middle of a background copy, fail. - */ - - if (chanPtr->csPtr) { - if (interp) { - Tcl_AppendResult(interp, - "unable to set channel options: background copy in progress", - (char *) NULL); - } - return TCL_ERROR; - } - - - /* - * Disallow options on dead channels -- channels that have been closed but - * not yet been deallocated. Such channels can be found if the exit - * handler for channel cleanup has run but the channel is still - * registered in an interpreter. - */ - - if (CheckForDeadChannel(NULL,chanPtr)) return TCL_ERROR; - - len = strlen(optionName); - - if ((len > 2) && (optionName[1] == 'b') && - (strncmp(optionName, "-blocking", len) == 0)) { - if (Tcl_GetBoolean(interp, newValue, &newMode) == TCL_ERROR) { - return TCL_ERROR; - } - if (newMode) { - newMode = TCL_MODE_BLOCKING; - } else { - newMode = TCL_MODE_NONBLOCKING; - } - return SetBlockMode(interp, chanPtr, newMode); - } else if ((len > 7) && (optionName[1] == 'b') && - (strncmp(optionName, "-buffering", len) == 0)) { - len = strlen(newValue); - if ((newValue[0] == 'f') && (strncmp(newValue, "full", len) == 0)) { - chanPtr->flags &= - (~(CHANNEL_UNBUFFERED|CHANNEL_LINEBUFFERED)); - } else if ((newValue[0] == 'l') && - (strncmp(newValue, "line", len) == 0)) { - chanPtr->flags &= (~(CHANNEL_UNBUFFERED)); - chanPtr->flags |= CHANNEL_LINEBUFFERED; - } else if ((newValue[0] == 'n') && - (strncmp(newValue, "none", len) == 0)) { - chanPtr->flags &= (~(CHANNEL_LINEBUFFERED)); - chanPtr->flags |= CHANNEL_UNBUFFERED; - } else { - if (interp) { - Tcl_AppendResult(interp, "bad value for -buffering: ", - "must be one of full, line, or none", - (char *) NULL); - return TCL_ERROR; - } - } - return TCL_OK; - } else if ((len > 7) && (optionName[1] == 'b') && - (strncmp(optionName, "-buffersize", len) == 0)) { - chanPtr->bufSize = atoi(newValue); /* INTL: "C", UTF safe. */ - if ((chanPtr->bufSize < 10) || (chanPtr->bufSize > (1024 * 1024))) { - chanPtr->bufSize = CHANNELBUFFER_DEFAULT_SIZE; - } - } else if ((len > 2) && (optionName[1] == 'e') && - (strncmp(optionName, "-encoding", len) == 0)) { - Tcl_Encoding encoding; - - if ((newValue[0] == '\0') || (strcmp(newValue, "binary") == 0)) { - encoding = NULL; - } else { - encoding = Tcl_GetEncoding(interp, newValue); - if (encoding == NULL) { - return TCL_ERROR; - } - } - Tcl_FreeEncoding(chanPtr->encoding); - chanPtr->encoding = encoding; - chanPtr->inputEncodingState = NULL; - chanPtr->inputEncodingFlags = TCL_ENCODING_START; - chanPtr->outputEncodingState = NULL; - chanPtr->outputEncodingFlags = TCL_ENCODING_START; - chanPtr->flags &= ~CHANNEL_NEED_MORE_DATA; - UpdateInterest(chanPtr); - } else if ((len > 2) && (optionName[1] == 'e') && - (strncmp(optionName, "-eofchar", len) == 0)) { - if (Tcl_SplitList(interp, newValue, &argc, &argv) == TCL_ERROR) { - return TCL_ERROR; - } - if (argc == 0) { - chanPtr->inEofChar = 0; - chanPtr->outEofChar = 0; - } else if (argc == 1) { - if (chanPtr->flags & TCL_WRITABLE) { - chanPtr->outEofChar = (int) argv[0][0]; - } - if (chanPtr->flags & TCL_READABLE) { - chanPtr->inEofChar = (int) argv[0][0]; - } - } else if (argc != 2) { - if (interp) { - Tcl_AppendResult(interp, - "bad value for -eofchar: should be a list of one or", - " two elements", (char *) NULL); - } - ckfree((char *) argv); - return TCL_ERROR; - } else { - if (chanPtr->flags & TCL_READABLE) { - chanPtr->inEofChar = (int) argv[0][0]; - } - if (chanPtr->flags & TCL_WRITABLE) { - chanPtr->outEofChar = (int) argv[1][0]; - } - } - if (argv != (char **) NULL) { - ckfree((char *) argv); - } - return TCL_OK; - } else if ((len > 1) && (optionName[1] == 't') && - (strncmp(optionName, "-translation", len) == 0)) { - char *readMode, *writeMode; - - if (Tcl_SplitList(interp, newValue, &argc, &argv) == TCL_ERROR) { - return TCL_ERROR; - } - - if (argc == 1) { - readMode = (chanPtr->flags & TCL_READABLE) ? argv[0] : NULL; - writeMode = (chanPtr->flags & TCL_WRITABLE) ? argv[0] : NULL; - } else if (argc == 2) { - readMode = (chanPtr->flags & TCL_READABLE) ? argv[0] : NULL; - writeMode = (chanPtr->flags & TCL_WRITABLE) ? argv[1] : NULL; - } else { - if (interp) { - Tcl_AppendResult(interp, - "bad value for -translation: must be a one or two", - " element list", (char *) NULL); - } - ckfree((char *) argv); - return TCL_ERROR; - } - - if (readMode) { - if (*readMode == '\0') { - newMode = chanPtr->inputTranslation; - } else if (strcmp(readMode, "auto") == 0) { - newMode = TCL_TRANSLATE_AUTO; - } else if (strcmp(readMode, "binary") == 0) { - newMode = TCL_TRANSLATE_LF; - chanPtr->inEofChar = 0; - Tcl_FreeEncoding(chanPtr->encoding); - chanPtr->encoding = NULL; - } else if (strcmp(readMode, "lf") == 0) { - newMode = TCL_TRANSLATE_LF; - } else if (strcmp(readMode, "cr") == 0) { - newMode = TCL_TRANSLATE_CR; - } else if (strcmp(readMode, "crlf") == 0) { - newMode = TCL_TRANSLATE_CRLF; - } else if (strcmp(readMode, "platform") == 0) { - newMode = TCL_PLATFORM_TRANSLATION; - } else { - if (interp) { - Tcl_AppendResult(interp, - "bad value for -translation: ", - "must be one of auto, binary, cr, lf, crlf,", - " or platform", (char *) NULL); - } - ckfree((char *) argv); - return TCL_ERROR; - } - - /* - * Reset the EOL flags since we need to look at any buffered - * data to see if the new translation mode allows us to - * complete the line. - */ - - if (newMode != chanPtr->inputTranslation) { - chanPtr->inputTranslation = (Tcl_EolTranslation) newMode; - chanPtr->flags &= ~(INPUT_SAW_CR); - chanPtr->flags &= ~(CHANNEL_NEED_MORE_DATA); - UpdateInterest(chanPtr); - } - } - if (writeMode) { - if (*writeMode == '\0') { - /* Do nothing. */ - } else if (strcmp(writeMode, "auto") == 0) { - /* - * This is a hack to get TCP sockets to produce output - * in CRLF mode if they are being set into AUTO mode. - * A better solution for achieving this effect will be - * coded later. - */ - - if (strcmp(chanPtr->typePtr->typeName, "tcp") == 0) { - chanPtr->outputTranslation = TCL_TRANSLATE_CRLF; - } else { - chanPtr->outputTranslation = TCL_PLATFORM_TRANSLATION; - } - } else if (strcmp(writeMode, "binary") == 0) { - chanPtr->outEofChar = 0; - chanPtr->outputTranslation = TCL_TRANSLATE_LF; - Tcl_FreeEncoding(chanPtr->encoding); - chanPtr->encoding = NULL; - } else if (strcmp(writeMode, "lf") == 0) { - chanPtr->outputTranslation = TCL_TRANSLATE_LF; - } else if (strcmp(writeMode, "cr") == 0) { - chanPtr->outputTranslation = TCL_TRANSLATE_CR; - } else if (strcmp(writeMode, "crlf") == 0) { - chanPtr->outputTranslation = TCL_TRANSLATE_CRLF; - } else if (strcmp(writeMode, "platform") == 0) { - chanPtr->outputTranslation = TCL_PLATFORM_TRANSLATION; - } else { - if (interp) { - Tcl_AppendResult(interp, - "bad value for -translation: ", - "must be one of auto, binary, cr, lf, crlf,", - " or platform", (char *) NULL); - } - ckfree((char *) argv); - return TCL_ERROR; - } - } - ckfree((char *) argv); - return TCL_OK; - } else if (chanPtr->typePtr->setOptionProc != NULL) { - return (*chanPtr->typePtr->setOptionProc)(chanPtr->instanceData, - interp, optionName, newValue); - } else { - return Tcl_BadChannelOption(interp, optionName, (char *) NULL); - } - - /* - * If bufsize changes, need to get rid of old utility buffer. - */ - - if (chanPtr->saveInBufPtr != NULL) { - RecycleBuffer(chanPtr, chanPtr->saveInBufPtr, 1); - chanPtr->saveInBufPtr = NULL; - } - if (chanPtr->inQueueHead != NULL) { - if ((chanPtr->inQueueHead->nextPtr == NULL) - && (chanPtr->inQueueHead->nextAdded == - chanPtr->inQueueHead->nextRemoved)) { - RecycleBuffer(chanPtr, chanPtr->inQueueHead, 1); - chanPtr->inQueueHead = NULL; - chanPtr->inQueueTail = NULL; - } - } - - /* - * If encoding or bufsize changes, need to update output staging buffer. - */ - - if (chanPtr->outputStage != NULL) { - ckfree((char *) chanPtr->outputStage); - chanPtr->outputStage = NULL; - } - if ((chanPtr->encoding != NULL) && (chanPtr->flags & TCL_WRITABLE)) { - chanPtr->outputStage = (char *) - ckalloc((unsigned) (chanPtr->bufSize + 2)); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * CleanupChannelHandlers -- - * - * Removes channel handlers that refer to the supplied interpreter, - * so that if the actual channel is not closed now, these handlers - * will not run on subsequent events on the channel. This would be - * erroneous, because the interpreter no longer has a reference to - * this channel. - * - * Results: - * None. - * - * Side effects: - * Removes channel handlers. - * - *---------------------------------------------------------------------- - */ - -static void -CleanupChannelHandlers(interp, chanPtr) - Tcl_Interp *interp; - Channel *chanPtr; -{ - EventScriptRecord *sPtr, *prevPtr, *nextPtr; - - /* - * Remove fileevent records on this channel that refer to the - * given interpreter. - */ - - for (sPtr = chanPtr->scriptRecordPtr, - prevPtr = (EventScriptRecord *) NULL; - sPtr != (EventScriptRecord *) NULL; - sPtr = nextPtr) { - nextPtr = sPtr->nextPtr; - if (sPtr->interp == interp) { - if (prevPtr == (EventScriptRecord *) NULL) { - chanPtr->scriptRecordPtr = nextPtr; - } else { - prevPtr->nextPtr = nextPtr; - } - - Tcl_DeleteChannelHandler((Tcl_Channel) chanPtr, - ChannelEventScriptInvoker, (ClientData) sPtr); - - Tcl_DecrRefCount(sPtr->scriptPtr); - ckfree((char *) sPtr); - } else { - prevPtr = sPtr; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_NotifyChannel -- - * - * This procedure is called by a channel driver when a driver - * detects an event on a channel. This procedure is responsible - * for actually handling the event by invoking any channel - * handler callbacks. - * - * Results: - * None. - * - * Side effects: - * Whatever the channel handler callback procedure does. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_NotifyChannel(channel, mask) - Tcl_Channel channel; /* Channel that detected an event. */ - int mask; /* OR'ed combination of TCL_READABLE, - * TCL_WRITABLE, or TCL_EXCEPTION: indicates - * which events were detected. */ -{ - Channel *chanPtr = (Channel *) channel; - ChannelHandler *chPtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - NextChannelHandler nh; - - /* - * Preserve the channel struct in case the script closes it. - */ - - Tcl_Preserve((ClientData) channel); - - /* - * If we are flushing in the background, be sure to call FlushChannel - * for writable events. Note that we have to discard the writable - * event so we don't call any write handlers before the flush is - * complete. - */ - - if ((chanPtr->flags & BG_FLUSH_SCHEDULED) && (mask & TCL_WRITABLE)) { - FlushChannel(NULL, chanPtr, 1); - mask &= ~TCL_WRITABLE; - } - - /* - * Add this invocation to the list of recursive invocations of - * ChannelHandlerEventProc. - */ - - nh.nextHandlerPtr = (ChannelHandler *) NULL; - nh.nestedHandlerPtr = tsdPtr->nestedHandlerPtr; - tsdPtr->nestedHandlerPtr = &nh; - - for (chPtr = chanPtr->chPtr; chPtr != (ChannelHandler *) NULL; ) { - - /* - * If this channel handler is interested in any of the events that - * have occurred on the channel, invoke its procedure. - */ - - if ((chPtr->mask & mask) != 0) { - nh.nextHandlerPtr = chPtr->nextPtr; - (*(chPtr->proc))(chPtr->clientData, mask); - chPtr = nh.nextHandlerPtr; - } else { - chPtr = chPtr->nextPtr; - } - } - - /* - * Update the notifier interest, since it may have changed after - * invoking event handlers. - */ - - if (chanPtr->typePtr != NULL) { - UpdateInterest(chanPtr); - } - - Tcl_Release((ClientData) channel); - - tsdPtr->nestedHandlerPtr = nh.nestedHandlerPtr; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateInterest -- - * - * Arrange for the notifier to call us back at appropriate times - * based on the current state of the channel. - * - * Results: - * None. - * - * Side effects: - * May schedule a timer or driver handler. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateInterest(chanPtr) - Channel *chanPtr; /* Channel to update. */ -{ - int mask = chanPtr->interestMask; - - /* - * If there are flushed buffers waiting to be written, then - * we need to watch for the channel to become writable. - */ - - if (chanPtr->flags & BG_FLUSH_SCHEDULED) { - mask |= TCL_WRITABLE; - } - - /* - * If there is data in the input queue, and we aren't waiting for more - * data, then we need to schedule a timer so we don't block in the - * notifier. Also, cancel the read interest so we don't get duplicate - * events. - */ - - if (mask & TCL_READABLE) { - if (!(chanPtr->flags & CHANNEL_NEED_MORE_DATA) - && (chanPtr->inQueueHead != (ChannelBuffer *) NULL) - && (chanPtr->inQueueHead->nextRemoved < - chanPtr->inQueueHead->nextAdded)) { - mask &= ~TCL_READABLE; - if (!chanPtr->timer) { - chanPtr->timer = Tcl_CreateTimerHandler(0, ChannelTimerProc, - (ClientData) chanPtr); - } - } - } - (chanPtr->typePtr->watchProc)(chanPtr->instanceData, mask); -} - -/* - *---------------------------------------------------------------------- - * - * ChannelTimerProc -- - * - * Timer handler scheduled by UpdateInterest to monitor the - * channel buffers until they are empty. - * - * Results: - * None. - * - * Side effects: - * May invoke channel handlers. - * - *---------------------------------------------------------------------- - */ - -static void -ChannelTimerProc(clientData) - ClientData clientData; -{ - Channel *chanPtr = (Channel *) clientData; - - if (!(chanPtr->flags & CHANNEL_NEED_MORE_DATA) - && (chanPtr->interestMask & TCL_READABLE) - && (chanPtr->inQueueHead != (ChannelBuffer *) NULL) - && (chanPtr->inQueueHead->nextRemoved < - chanPtr->inQueueHead->nextAdded)) { - /* - * Restart the timer in case a channel handler reenters the - * event loop before UpdateInterest gets called by Tcl_NotifyChannel. - */ - - chanPtr->timer = Tcl_CreateTimerHandler(0, ChannelTimerProc, - (ClientData) chanPtr); - Tcl_NotifyChannel((Tcl_Channel)chanPtr, TCL_READABLE); - - } else { - chanPtr->timer = NULL; - UpdateInterest(chanPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateChannelHandler -- - * - * Arrange for a given procedure to be invoked whenever the - * channel indicated by the chanPtr arg becomes readable or - * writable. - * - * Results: - * None. - * - * Side effects: - * From now on, whenever the I/O channel given by chanPtr becomes - * ready in the way indicated by mask, proc will be invoked. - * See the manual entry for details on the calling sequence - * to proc. If there is already an event handler for chan, proc - * and clientData, then the mask will be updated. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_CreateChannelHandler(chan, mask, proc, clientData) - Tcl_Channel chan; /* The channel to create the handler for. */ - int mask; /* OR'ed combination of TCL_READABLE, - * TCL_WRITABLE, and TCL_EXCEPTION: - * indicates conditions under which - * proc should be called. Use 0 to - * disable a registered handler. */ - Tcl_ChannelProc *proc; /* Procedure to call for each - * selected event. */ - ClientData clientData; /* Arbitrary data to pass to proc. */ -{ - ChannelHandler *chPtr; - Channel *chanPtr; - - chanPtr = (Channel *) chan; - - /* - * Check whether this channel handler is not already registered. If - * it is not, create a new record, else reuse existing record (smash - * current values). - */ - - for (chPtr = chanPtr->chPtr; - chPtr != (ChannelHandler *) NULL; - chPtr = chPtr->nextPtr) { - if ((chPtr->chanPtr == chanPtr) && (chPtr->proc == proc) && - (chPtr->clientData == clientData)) { - break; - } - } - if (chPtr == (ChannelHandler *) NULL) { - chPtr = (ChannelHandler *) ckalloc((unsigned) sizeof(ChannelHandler)); - chPtr->mask = 0; - chPtr->proc = proc; - chPtr->clientData = clientData; - chPtr->chanPtr = chanPtr; - chPtr->nextPtr = chanPtr->chPtr; - chanPtr->chPtr = chPtr; - } - - /* - * The remainder of the initialization below is done regardless of - * whether or not this is a new record or a modification of an old - * one. - */ - - chPtr->mask = mask; - - /* - * Recompute the interest mask for the channel - this call may actually - * be disabling an existing handler. - */ - - chanPtr->interestMask = 0; - for (chPtr = chanPtr->chPtr; - chPtr != (ChannelHandler *) NULL; - chPtr = chPtr->nextPtr) { - chanPtr->interestMask |= chPtr->mask; - } - - UpdateInterest(chanPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteChannelHandler -- - * - * Cancel a previously arranged callback arrangement for an IO - * channel. - * - * Results: - * None. - * - * Side effects: - * If a callback was previously registered for this chan, proc and - * clientData , it is removed and the callback will no longer be called - * when the channel becomes ready for IO. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteChannelHandler(chan, proc, clientData) - Tcl_Channel chan; /* The channel for which to remove the - * callback. */ - Tcl_ChannelProc *proc; /* The procedure in the callback to delete. */ - ClientData clientData; /* The client data in the callback - * to delete. */ - -{ - ChannelHandler *chPtr, *prevChPtr; - Channel *chanPtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - NextChannelHandler *nhPtr; - - chanPtr = (Channel *) chan; - - /* - * Find the entry and the previous one in the list. - */ - - for (prevChPtr = (ChannelHandler *) NULL, chPtr = chanPtr->chPtr; - chPtr != (ChannelHandler *) NULL; - chPtr = chPtr->nextPtr) { - if ((chPtr->chanPtr == chanPtr) && (chPtr->clientData == clientData) - && (chPtr->proc == proc)) { - break; - } - prevChPtr = chPtr; - } - - /* - * If not found, return without doing anything. - */ - - if (chPtr == (ChannelHandler *) NULL) { - return; - } - - /* - * If ChannelHandlerEventProc is about to process this handler, tell it to - * process the next one instead - we are going to delete *this* one. - */ - - for (nhPtr = tsdPtr->nestedHandlerPtr; - nhPtr != (NextChannelHandler *) NULL; - nhPtr = nhPtr->nestedHandlerPtr) { - if (nhPtr->nextHandlerPtr == chPtr) { - nhPtr->nextHandlerPtr = chPtr->nextPtr; - } - } - - /* - * Splice it out of the list of channel handlers. - */ - - if (prevChPtr == (ChannelHandler *) NULL) { - chanPtr->chPtr = chPtr->nextPtr; - } else { - prevChPtr->nextPtr = chPtr->nextPtr; - } - ckfree((char *) chPtr); - - /* - * Recompute the interest list for the channel, so that infinite loops - * will not result if Tcl_DeleteChannelHandler is called inside an - * event. - */ - - chanPtr->interestMask = 0; - for (chPtr = chanPtr->chPtr; - chPtr != (ChannelHandler *) NULL; - chPtr = chPtr->nextPtr) { - chanPtr->interestMask |= chPtr->mask; - } - - UpdateInterest(chanPtr); -} - -/* - *---------------------------------------------------------------------- - * - * DeleteScriptRecord -- - * - * Delete a script record for this combination of channel, interp - * and mask. - * - * Results: - * None. - * - * Side effects: - * Deletes a script record and cancels a channel event handler. - * - *---------------------------------------------------------------------- - */ - -static void -DeleteScriptRecord(interp, chanPtr, mask) - Tcl_Interp *interp; /* Interpreter in which script was to be - * executed. */ - Channel *chanPtr; /* The channel for which to delete the - * script record (if any). */ - int mask; /* Events in mask must exactly match mask - * of script to delete. */ -{ - EventScriptRecord *esPtr, *prevEsPtr; - - for (esPtr = chanPtr->scriptRecordPtr, - prevEsPtr = (EventScriptRecord *) NULL; - esPtr != (EventScriptRecord *) NULL; - prevEsPtr = esPtr, esPtr = esPtr->nextPtr) { - if ((esPtr->interp == interp) && (esPtr->mask == mask)) { - if (esPtr == chanPtr->scriptRecordPtr) { - chanPtr->scriptRecordPtr = esPtr->nextPtr; - } else { - prevEsPtr->nextPtr = esPtr->nextPtr; - } - - Tcl_DeleteChannelHandler((Tcl_Channel) chanPtr, - ChannelEventScriptInvoker, (ClientData) esPtr); - - Tcl_DecrRefCount(esPtr->scriptPtr); - ckfree((char *) esPtr); - - break; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * CreateScriptRecord -- - * - * Creates a record to store a script to be executed when a specific - * event fires on a specific channel. - * - * Results: - * None. - * - * Side effects: - * Causes the script to be stored for later execution. - * - *---------------------------------------------------------------------- - */ - -static void -CreateScriptRecord(interp, chanPtr, mask, scriptPtr) - Tcl_Interp *interp; /* Interpreter in which to execute - * the stored script. */ - Channel *chanPtr; /* Channel for which script is to - * be stored. */ - int mask; /* Set of events for which script - * will be invoked. */ - Tcl_Obj *scriptPtr; /* Pointer to script object. */ -{ - EventScriptRecord *esPtr; - - for (esPtr = chanPtr->scriptRecordPtr; - esPtr != (EventScriptRecord *) NULL; - esPtr = esPtr->nextPtr) { - if ((esPtr->interp == interp) && (esPtr->mask == mask)) { - Tcl_DecrRefCount(esPtr->scriptPtr); - esPtr->scriptPtr = (Tcl_Obj *) NULL; - break; - } - } - if (esPtr == (EventScriptRecord *) NULL) { - esPtr = (EventScriptRecord *) ckalloc((unsigned) - sizeof(EventScriptRecord)); - Tcl_CreateChannelHandler((Tcl_Channel) chanPtr, mask, - ChannelEventScriptInvoker, (ClientData) esPtr); - esPtr->nextPtr = chanPtr->scriptRecordPtr; - chanPtr->scriptRecordPtr = esPtr; - } - esPtr->chanPtr = chanPtr; - esPtr->interp = interp; - esPtr->mask = mask; - Tcl_IncrRefCount(scriptPtr); - esPtr->scriptPtr = scriptPtr; -} - -/* - *---------------------------------------------------------------------- - * - * ChannelEventScriptInvoker -- - * - * Invokes a script scheduled by "fileevent" for when the channel - * becomes ready for IO. This function is invoked by the channel - * handler which was created by the Tcl "fileevent" command. - * - * Results: - * None. - * - * Side effects: - * Whatever the script does. - * - *---------------------------------------------------------------------- - */ - -static void -ChannelEventScriptInvoker(clientData, mask) - ClientData clientData; /* The script+interp record. */ - int mask; /* Not used. */ -{ - Tcl_Interp *interp; /* Interpreter in which to eval the script. */ - Channel *chanPtr; /* The channel for which this handler is - * registered. */ - EventScriptRecord *esPtr; /* The event script + interpreter to eval it - * in. */ - int result; /* Result of call to eval script. */ - - esPtr = (EventScriptRecord *) clientData; - - chanPtr = esPtr->chanPtr; - mask = esPtr->mask; - interp = esPtr->interp; - - /* - * We must preserve the interpreter so we can report errors on it - * later. Note that we do not need to preserve the channel because - * that is done by Tcl_NotifyChannel before calling channel handlers. - */ - - Tcl_Preserve((ClientData) interp); - result = Tcl_EvalObjEx(interp, esPtr->scriptPtr, TCL_EVAL_GLOBAL); - - /* - * On error, cause a background error and remove the channel handler - * and the script record. - * - * NOTE: Must delete channel handler before causing the background error - * because the background error may want to reinstall the handler. - */ - - if (result != TCL_OK) { - if (chanPtr->typePtr != NULL) { - DeleteScriptRecord(interp, chanPtr, mask); - } - Tcl_BackgroundError(interp); - } - Tcl_Release((ClientData) interp); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FileEventObjCmd -- - * - * This procedure implements the "fileevent" Tcl command. See the - * user documentation for details on what it does. This command is - * based on the Tk command "fileevent" which in turn is based on work - * contributed by Mark Diekhans. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May create a channel handler for the specified channel. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_FileEventObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Interpreter in which the channel - * for which to create the handler - * is found. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Channel *chanPtr; /* The channel to create - * the handler for. */ - Tcl_Channel chan; /* The opaque type for the channel. */ - char *chanName; - int modeIndex; /* Index of mode argument. */ - int mask; - static char *modeOptions[] = {"readable", "writable", NULL}; - static int maskArray[] = {TCL_READABLE, TCL_WRITABLE}; - - if ((objc != 3) && (objc != 4)) { - Tcl_WrongNumArgs(interp, 1, objv, "channelId event ?script?"); - return TCL_ERROR; - } - if (Tcl_GetIndexFromObj(interp, objv[2], modeOptions, "event name", 0, - &modeIndex) != TCL_OK) { - return TCL_ERROR; - } - mask = maskArray[modeIndex]; - - chanName = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, chanName, NULL); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - chanPtr = (Channel *) chan; - if ((chanPtr->flags & mask) == 0) { - Tcl_AppendResult(interp, "channel is not ", - (mask == TCL_READABLE) ? "readable" : "writable", - (char *) NULL); - return TCL_ERROR; - } - - /* - * If we are supposed to return the script, do so. - */ - - if (objc == 3) { - EventScriptRecord *esPtr; - for (esPtr = chanPtr->scriptRecordPtr; - esPtr != (EventScriptRecord *) NULL; - esPtr = esPtr->nextPtr) { - if ((esPtr->interp == interp) && (esPtr->mask == mask)) { - Tcl_SetObjResult(interp, esPtr->scriptPtr); - break; - } - } - return TCL_OK; - } - - /* - * If we are supposed to delete a stored script, do so. - */ - - if (*(Tcl_GetString(objv[3])) == '\0') { - DeleteScriptRecord(interp, chanPtr, mask); - return TCL_OK; - } - - /* - * Make the script record that will link between the event and the - * script to invoke. This also creates a channel event handler which - * will evaluate the script in the supplied interpreter. - */ - - CreateScriptRecord(interp, chanPtr, mask, objv[3]); - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclTestChannelCmd -- - * - * Implements the Tcl "testchannel" debugging command and its - * subcommands. This is part of the testing environment but must be - * in this file instead of tclTest.c because it needs access to the - * fields of struct Channel. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -TclTestChannelCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Interpreter for result. */ - int argc; /* Count of additional args. */ - char **argv; /* Additional arg strings. */ -{ - char *cmdName; /* Sub command. */ - Tcl_HashTable *hTblPtr; /* Hash table of channels. */ - Tcl_HashSearch hSearch; /* Search variable. */ - Tcl_HashEntry *hPtr; /* Search variable. */ - Channel *chanPtr; /* The actual channel. */ - Tcl_Channel chan; /* The opaque type. */ - size_t len; /* Length of subcommand string. */ - int IOQueued; /* How much IO is queued inside channel? */ - ChannelBuffer *bufPtr; /* For iterating over queued IO. */ - char buf[TCL_INTEGER_SPACE];/* For sprintf. */ - - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " subcommand ?additional args..?\"", (char *) NULL); - return TCL_ERROR; - } - cmdName = argv[1]; - len = strlen(cmdName); - - chanPtr = (Channel *) NULL; - - if (argc > 2) { - chan = Tcl_GetChannel(interp, argv[2], NULL); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - chanPtr = (Channel *) chan; - } - - - if ((cmdName[0] == 'i') && (strncmp(cmdName, "info", len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " info channelName\"", (char *) NULL); - return TCL_ERROR; - } - Tcl_AppendElement(interp, argv[2]); - Tcl_AppendElement(interp, chanPtr->typePtr->typeName); - if (chanPtr->flags & TCL_READABLE) { - Tcl_AppendElement(interp, "read"); - } else { - Tcl_AppendElement(interp, ""); - } - if (chanPtr->flags & TCL_WRITABLE) { - Tcl_AppendElement(interp, "write"); - } else { - Tcl_AppendElement(interp, ""); - } - if (chanPtr->flags & CHANNEL_NONBLOCKING) { - Tcl_AppendElement(interp, "nonblocking"); - } else { - Tcl_AppendElement(interp, "blocking"); - } - if (chanPtr->flags & CHANNEL_LINEBUFFERED) { - Tcl_AppendElement(interp, "line"); - } else if (chanPtr->flags & CHANNEL_UNBUFFERED) { - Tcl_AppendElement(interp, "none"); - } else { - Tcl_AppendElement(interp, "full"); - } - if (chanPtr->flags & BG_FLUSH_SCHEDULED) { - Tcl_AppendElement(interp, "async_flush"); - } else { - Tcl_AppendElement(interp, ""); - } - if (chanPtr->flags & CHANNEL_EOF) { - Tcl_AppendElement(interp, "eof"); - } else { - Tcl_AppendElement(interp, ""); - } - if (chanPtr->flags & CHANNEL_BLOCKED) { - Tcl_AppendElement(interp, "blocked"); - } else { - Tcl_AppendElement(interp, "unblocked"); - } - if (chanPtr->inputTranslation == TCL_TRANSLATE_AUTO) { - Tcl_AppendElement(interp, "auto"); - if (chanPtr->flags & INPUT_SAW_CR) { - Tcl_AppendElement(interp, "saw_cr"); - } else { - Tcl_AppendElement(interp, ""); - } - } else if (chanPtr->inputTranslation == TCL_TRANSLATE_LF) { - Tcl_AppendElement(interp, "lf"); - Tcl_AppendElement(interp, ""); - } else if (chanPtr->inputTranslation == TCL_TRANSLATE_CR) { - Tcl_AppendElement(interp, "cr"); - Tcl_AppendElement(interp, ""); - } else if (chanPtr->inputTranslation == TCL_TRANSLATE_CRLF) { - Tcl_AppendElement(interp, "crlf"); - if (chanPtr->flags & INPUT_SAW_CR) { - Tcl_AppendElement(interp, "queued_cr"); - } else { - Tcl_AppendElement(interp, ""); - } - } - if (chanPtr->outputTranslation == TCL_TRANSLATE_AUTO) { - Tcl_AppendElement(interp, "auto"); - } else if (chanPtr->outputTranslation == TCL_TRANSLATE_LF) { - Tcl_AppendElement(interp, "lf"); - } else if (chanPtr->outputTranslation == TCL_TRANSLATE_CR) { - Tcl_AppendElement(interp, "cr"); - } else if (chanPtr->outputTranslation == TCL_TRANSLATE_CRLF) { - Tcl_AppendElement(interp, "crlf"); - } - for (IOQueued = 0, bufPtr = chanPtr->inQueueHead; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - IOQueued += bufPtr->nextAdded - bufPtr->nextRemoved; - } - TclFormatInt(buf, IOQueued); - Tcl_AppendElement(interp, buf); - - IOQueued = 0; - if (chanPtr->curOutPtr != (ChannelBuffer *) NULL) { - IOQueued = chanPtr->curOutPtr->nextAdded - - chanPtr->curOutPtr->nextRemoved; - } - for (bufPtr = chanPtr->outQueueHead; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - IOQueued += (bufPtr->nextAdded - bufPtr->nextRemoved); - } - TclFormatInt(buf, IOQueued); - Tcl_AppendElement(interp, buf); - - TclFormatInt(buf, Tcl_Tell((Tcl_Channel) chanPtr)); - Tcl_AppendElement(interp, buf); - - TclFormatInt(buf, chanPtr->refCount); - Tcl_AppendElement(interp, buf); - - return TCL_OK; - } - - if ((cmdName[0] == 'i') && - (strncmp(cmdName, "inputbuffered", len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", - (char *) NULL); - return TCL_ERROR; - } - - for (IOQueued = 0, bufPtr = chanPtr->inQueueHead; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - IOQueued += bufPtr->nextAdded - bufPtr->nextRemoved; - } - TclFormatInt(buf, IOQueued); - Tcl_AppendResult(interp, buf, (char *) NULL); - return TCL_OK; - } - - if ((cmdName[0] == 'm') && (strncmp(cmdName, "mode", len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", - (char *) NULL); - return TCL_ERROR; - } - - if (chanPtr->flags & TCL_READABLE) { - Tcl_AppendElement(interp, "read"); - } else { - Tcl_AppendElement(interp, ""); - } - if (chanPtr->flags & TCL_WRITABLE) { - Tcl_AppendElement(interp, "write"); - } else { - Tcl_AppendElement(interp, ""); - } - return TCL_OK; - } - - if ((cmdName[0] == 'n') && (strncmp(cmdName, "name", len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", - (char *) NULL); - return TCL_ERROR; - } - Tcl_AppendResult(interp, chanPtr->channelName, (char *) NULL); - return TCL_OK; - } - - if ((cmdName[0] == 'o') && (strncmp(cmdName, "open", len) == 0)) { - hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, "tclIO", NULL); - if (hTblPtr == (Tcl_HashTable *) NULL) { - return TCL_OK; - } - for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); - hPtr != (Tcl_HashEntry *) NULL; - hPtr = Tcl_NextHashEntry(&hSearch)) { - Tcl_AppendElement(interp, Tcl_GetHashKey(hTblPtr, hPtr)); - } - return TCL_OK; - } - - if ((cmdName[0] == 'o') && - (strncmp(cmdName, "outputbuffered", len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", - (char *) NULL); - return TCL_ERROR; - } - - IOQueued = 0; - if (chanPtr->curOutPtr != (ChannelBuffer *) NULL) { - IOQueued = chanPtr->curOutPtr->nextAdded - - chanPtr->curOutPtr->nextRemoved; - } - for (bufPtr = chanPtr->outQueueHead; - bufPtr != (ChannelBuffer *) NULL; - bufPtr = bufPtr->nextPtr) { - IOQueued += (bufPtr->nextAdded - bufPtr->nextRemoved); - } - TclFormatInt(buf, IOQueued); - Tcl_AppendResult(interp, buf, (char *) NULL); - return TCL_OK; - } - - if ((cmdName[0] == 'q') && - (strncmp(cmdName, "queuedcr", len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", - (char *) NULL); - return TCL_ERROR; - } - - Tcl_AppendResult(interp, - (chanPtr->flags & INPUT_SAW_CR) ? "1" : "0", - (char *) NULL); - return TCL_OK; - } - - if ((cmdName[0] == 'r') && (strncmp(cmdName, "readable", len) == 0)) { - hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, "tclIO", NULL); - if (hTblPtr == (Tcl_HashTable *) NULL) { - return TCL_OK; - } - for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); - hPtr != (Tcl_HashEntry *) NULL; - hPtr = Tcl_NextHashEntry(&hSearch)) { - chanPtr = (Channel *) Tcl_GetHashValue(hPtr); - if (chanPtr->flags & TCL_READABLE) { - Tcl_AppendElement(interp, Tcl_GetHashKey(hTblPtr, hPtr)); - } - } - return TCL_OK; - } - - if ((cmdName[0] == 'r') && (strncmp(cmdName, "refcount", len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", - (char *) NULL); - return TCL_ERROR; - } - - TclFormatInt(buf, chanPtr->refCount); - Tcl_AppendResult(interp, buf, (char *) NULL); - return TCL_OK; - } - - if ((cmdName[0] == 't') && (strncmp(cmdName, "type", len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "channel name required", - (char *) NULL); - return TCL_ERROR; - } - Tcl_AppendResult(interp, chanPtr->typePtr->typeName, (char *) NULL); - return TCL_OK; - } - - if ((cmdName[0] == 'w') && (strncmp(cmdName, "writable", len) == 0)) { - hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, "tclIO", NULL); - if (hTblPtr == (Tcl_HashTable *) NULL) { - return TCL_OK; - } - for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); - hPtr != (Tcl_HashEntry *) NULL; - hPtr = Tcl_NextHashEntry(&hSearch)) { - chanPtr = (Channel *) Tcl_GetHashValue(hPtr); - if (chanPtr->flags & TCL_WRITABLE) { - Tcl_AppendElement(interp, Tcl_GetHashKey(hTblPtr, hPtr)); - } - } - return TCL_OK; - } - - Tcl_AppendResult(interp, "bad option \"", cmdName, "\": should be ", - "info, open, readable, or writable", - (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * TclTestChannelEventCmd -- - * - * This procedure implements the "testchannelevent" command. It is - * used to test the Tcl channel event mechanism. It is present in - * this file instead of tclTest.c because it needs access to the - * internal structure of the channel. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates, deletes and returns channel event handlers. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -TclTestChannelEventCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_Obj *resultListPtr; - Channel *chanPtr; - EventScriptRecord *esPtr, *prevEsPtr, *nextEsPtr; - char *cmd; - int index, i, mask, len; - - if ((argc < 3) || (argc > 5)) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName cmd ?arg1? ?arg2?\"", (char *) NULL); - return TCL_ERROR; - } - chanPtr = (Channel *) Tcl_GetChannel(interp, argv[1], NULL); - if (chanPtr == (Channel *) NULL) { - return TCL_ERROR; - } - cmd = argv[2]; - len = strlen(cmd); - if ((cmd[0] == 'a') && (strncmp(cmd, "add", (unsigned) len) == 0)) { - if (argc != 5) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName add eventSpec script\"", (char *) NULL); - return TCL_ERROR; - } - if (strcmp(argv[3], "readable") == 0) { - mask = TCL_READABLE; - } else if (strcmp(argv[3], "writable") == 0) { - mask = TCL_WRITABLE; - } else if (strcmp(argv[3], "none") == 0) { - mask = 0; - } else { - Tcl_AppendResult(interp, "bad event name \"", argv[3], - "\": must be readable, writable, or none", (char *) NULL); - return TCL_ERROR; - } - - esPtr = (EventScriptRecord *) ckalloc((unsigned) - sizeof(EventScriptRecord)); - esPtr->nextPtr = chanPtr->scriptRecordPtr; - chanPtr->scriptRecordPtr = esPtr; - - esPtr->chanPtr = chanPtr; - esPtr->interp = interp; - esPtr->mask = mask; - esPtr->scriptPtr = Tcl_NewStringObj(argv[4], -1); - Tcl_IncrRefCount(esPtr->scriptPtr); - - Tcl_CreateChannelHandler((Tcl_Channel) chanPtr, mask, - ChannelEventScriptInvoker, (ClientData) esPtr); - - return TCL_OK; - } - - if ((cmd[0] == 'd') && (strncmp(cmd, "delete", (unsigned) len) == 0)) { - if (argc != 4) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName delete index\"", (char *) NULL); - return TCL_ERROR; - } - if (Tcl_GetInt(interp, argv[3], &index) == TCL_ERROR) { - return TCL_ERROR; - } - if (index < 0) { - Tcl_AppendResult(interp, "bad event index: ", argv[3], - ": must be nonnegative", (char *) NULL); - return TCL_ERROR; - } - for (i = 0, esPtr = chanPtr->scriptRecordPtr; - (i < index) && (esPtr != (EventScriptRecord *) NULL); - i++, esPtr = esPtr->nextPtr) { - /* Empty loop body. */ - } - if (esPtr == (EventScriptRecord *) NULL) { - Tcl_AppendResult(interp, "bad event index ", argv[3], - ": out of range", (char *) NULL); - return TCL_ERROR; - } - if (esPtr == chanPtr->scriptRecordPtr) { - chanPtr->scriptRecordPtr = esPtr->nextPtr; - } else { - for (prevEsPtr = chanPtr->scriptRecordPtr; - (prevEsPtr != (EventScriptRecord *) NULL) && - (prevEsPtr->nextPtr != esPtr); - prevEsPtr = prevEsPtr->nextPtr) { - /* Empty loop body. */ - } - if (prevEsPtr == (EventScriptRecord *) NULL) { - panic("TclTestChannelEventCmd: damaged event script list"); - } - prevEsPtr->nextPtr = esPtr->nextPtr; - } - Tcl_DeleteChannelHandler((Tcl_Channel) chanPtr, - ChannelEventScriptInvoker, (ClientData) esPtr); - Tcl_DecrRefCount(esPtr->scriptPtr); - ckfree((char *) esPtr); - - return TCL_OK; - } - - if ((cmd[0] == 'l') && (strncmp(cmd, "list", (unsigned) len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName list\"", (char *) NULL); - return TCL_ERROR; - } - resultListPtr = Tcl_GetObjResult(interp); - for (esPtr = chanPtr->scriptRecordPtr; - esPtr != (EventScriptRecord *) NULL; - esPtr = esPtr->nextPtr) { - if (esPtr->mask) { - Tcl_ListObjAppendElement(interp, resultListPtr, Tcl_NewStringObj( - (esPtr->mask == TCL_READABLE) ? "readable" : "writable", -1)); - } else { - Tcl_ListObjAppendElement(interp, resultListPtr, - Tcl_NewStringObj("none", -1)); - } - Tcl_ListObjAppendElement(interp, resultListPtr, esPtr->scriptPtr); - } - Tcl_SetObjResult(interp, resultListPtr); - return TCL_OK; - } - - if ((cmd[0] == 'r') && (strncmp(cmd, "removeall", (unsigned) len) == 0)) { - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName removeall\"", (char *) NULL); - return TCL_ERROR; - } - for (esPtr = chanPtr->scriptRecordPtr; - esPtr != (EventScriptRecord *) NULL; - esPtr = nextEsPtr) { - nextEsPtr = esPtr->nextPtr; - Tcl_DeleteChannelHandler((Tcl_Channel) chanPtr, - ChannelEventScriptInvoker, (ClientData) esPtr); - Tcl_DecrRefCount(esPtr->scriptPtr); - ckfree((char *) esPtr); - } - chanPtr->scriptRecordPtr = (EventScriptRecord *) NULL; - return TCL_OK; - } - - if ((cmd[0] == 's') && (strncmp(cmd, "set", (unsigned) len) == 0)) { - if (argc != 5) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " channelName delete index event\"", (char *) NULL); - return TCL_ERROR; - } - if (Tcl_GetInt(interp, argv[3], &index) == TCL_ERROR) { - return TCL_ERROR; - } - if (index < 0) { - Tcl_AppendResult(interp, "bad event index: ", argv[3], - ": must be nonnegative", (char *) NULL); - return TCL_ERROR; - } - for (i = 0, esPtr = chanPtr->scriptRecordPtr; - (i < index) && (esPtr != (EventScriptRecord *) NULL); - i++, esPtr = esPtr->nextPtr) { - /* Empty loop body. */ - } - if (esPtr == (EventScriptRecord *) NULL) { - Tcl_AppendResult(interp, "bad event index ", argv[3], - ": out of range", (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[4], "readable") == 0) { - mask = TCL_READABLE; - } else if (strcmp(argv[4], "writable") == 0) { - mask = TCL_WRITABLE; - } else if (strcmp(argv[4], "none") == 0) { - mask = 0; - } else { - Tcl_AppendResult(interp, "bad event name \"", argv[4], - "\": must be readable, writable, or none", (char *) NULL); - return TCL_ERROR; - } - esPtr->mask = mask; - Tcl_CreateChannelHandler((Tcl_Channel) chanPtr, mask, - ChannelEventScriptInvoker, (ClientData) esPtr); - return TCL_OK; - } - Tcl_AppendResult(interp, "bad command ", cmd, ", must be one of ", - "add, delete, list, set, or removeall", (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * TclCopyChannel -- - * - * This routine copies data from one channel to another, either - * synchronously or asynchronously. If a command script is - * supplied, the operation runs in the background. The script - * is invoked when the copy completes. Otherwise the function - * waits until the copy is completed before returning. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May schedule a background copy operation that causes both - * channels to be marked busy. - * - *---------------------------------------------------------------------- - */ - -int -TclCopyChannel(interp, inChan, outChan, toRead, cmdPtr) - Tcl_Interp *interp; /* Current interpreter. */ - Tcl_Channel inChan; /* Channel to read from. */ - Tcl_Channel outChan; /* Channel to write to. */ - int toRead; /* Amount of data to copy, or -1 for all. */ - Tcl_Obj *cmdPtr; /* Pointer to script to execute or NULL. */ -{ - Channel *inPtr = (Channel *) inChan; - Channel *outPtr = (Channel *) outChan; - int readFlags, writeFlags; - CopyState *csPtr; - int nonBlocking = (cmdPtr) ? CHANNEL_NONBLOCKING : 0; - - if (inPtr->csPtr) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "channel \"", - Tcl_GetChannelName(inChan), "\" is busy", NULL); - return TCL_ERROR; - } - if (outPtr->csPtr) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "channel \"", - Tcl_GetChannelName(outChan), "\" is busy", NULL); - return TCL_ERROR; - } - - readFlags = inPtr->flags; - writeFlags = outPtr->flags; - - /* - * Set up the blocking mode appropriately. Background copies need - * non-blocking channels. Foreground copies need blocking channels. - * If there is an error, restore the old blocking mode. - */ - - if (nonBlocking != (readFlags & CHANNEL_NONBLOCKING)) { - if (SetBlockMode(interp, inPtr, - nonBlocking ? TCL_MODE_NONBLOCKING : TCL_MODE_BLOCKING) - != TCL_OK) { - return TCL_ERROR; - } - } - if (inPtr != outPtr) { - if (nonBlocking != (writeFlags & CHANNEL_NONBLOCKING)) { - if (SetBlockMode(NULL, outPtr, - nonBlocking ? TCL_MODE_BLOCKING : TCL_MODE_NONBLOCKING) - != TCL_OK) { - if (nonBlocking != (readFlags & CHANNEL_NONBLOCKING)) { - SetBlockMode(NULL, inPtr, - (readFlags & CHANNEL_NONBLOCKING) - ? TCL_MODE_NONBLOCKING : TCL_MODE_BLOCKING); - return TCL_ERROR; - } - } - } - } - - /* - * Make sure the output side is unbuffered. - */ - - outPtr->flags = (outPtr->flags & ~(CHANNEL_LINEBUFFERED)) - | CHANNEL_UNBUFFERED; - - /* - * Allocate a new CopyState to maintain info about the current copy in - * progress. This structure will be deallocated when the copy is - * completed. - */ - - csPtr = (CopyState*) ckalloc(sizeof(CopyState) + inPtr->bufSize); - csPtr->bufSize = inPtr->bufSize; - csPtr->readPtr = inPtr; - csPtr->writePtr = outPtr; - csPtr->readFlags = readFlags; - csPtr->writeFlags = writeFlags; - csPtr->toRead = toRead; - csPtr->total = 0; - csPtr->interp = interp; - if (cmdPtr) { - Tcl_IncrRefCount(cmdPtr); - } - csPtr->cmdPtr = cmdPtr; - inPtr->csPtr = csPtr; - outPtr->csPtr = csPtr; - - /* - * Start copying data between the channels. - */ - - return CopyData(csPtr, 0); -} - -/* - *---------------------------------------------------------------------- - * - * CopyData -- - * - * This function implements the lowest level of the copying - * mechanism for TclCopyChannel. - * - * Results: - * Returns TCL_OK on success, else TCL_ERROR. - * - * Side effects: - * Moves data between channels, may create channel handlers. - * - *---------------------------------------------------------------------- - */ - -static int -CopyData(csPtr, mask) - CopyState *csPtr; /* State of copy operation. */ - int mask; /* Current channel event flags. */ -{ - Tcl_Interp *interp; - Tcl_Obj *cmdPtr, *errObj = NULL; - Tcl_Channel inChan, outChan; - int result = TCL_OK; - int size; - int total; - - inChan = (Tcl_Channel)csPtr->readPtr; - outChan = (Tcl_Channel)csPtr->writePtr; - interp = csPtr->interp; - cmdPtr = csPtr->cmdPtr; - - /* - * Copy the data the slow way, using the translation mechanism. - */ - - while (csPtr->toRead != 0) { - - /* - * Check for unreported background errors. - */ - - if (csPtr->readPtr->unreportedError != 0) { - Tcl_SetErrno(csPtr->readPtr->unreportedError); - csPtr->readPtr->unreportedError = 0; - goto readError; - } - if (csPtr->writePtr->unreportedError != 0) { - Tcl_SetErrno(csPtr->writePtr->unreportedError); - csPtr->writePtr->unreportedError = 0; - goto writeError; - } - - /* - * Read up to bufSize bytes. - */ - - if ((csPtr->toRead == -1) - || (csPtr->toRead > csPtr->bufSize)) { - size = csPtr->bufSize; - } else { - size = csPtr->toRead; - } - size = DoRead(csPtr->readPtr, csPtr->buffer, size); - - if (size < 0) { - readError: - errObj = Tcl_NewObj(); - Tcl_AppendStringsToObj(errObj, "error reading \"", - Tcl_GetChannelName(inChan), "\": ", - Tcl_PosixError(interp), (char *) NULL); - break; - } else if (size == 0) { - /* - * We had an underflow on the read side. If we are at EOF, - * then the copying is done, otherwise set up a channel - * handler to detect when the channel becomes readable again. - */ - - if (Tcl_Eof(inChan)) { - break; - } else if (!(mask & TCL_READABLE)) { - if (mask & TCL_WRITABLE) { - Tcl_DeleteChannelHandler(outChan, CopyEventProc, - (ClientData) csPtr); - } - Tcl_CreateChannelHandler(inChan, TCL_READABLE, - CopyEventProc, (ClientData) csPtr); - } - return TCL_OK; - } - - /* - * Now write the buffer out. - */ - - size = DoWrite(csPtr->writePtr, csPtr->buffer, size); - if (size < 0) { - writeError: - errObj = Tcl_NewObj(); - Tcl_AppendStringsToObj(errObj, "error writing \"", - Tcl_GetChannelName(outChan), "\": ", - Tcl_PosixError(interp), (char *) NULL); - break; - } - - /* - * Check to see if the write is happening in the background. If so, - * stop copying and wait for the channel to become writable again. - */ - - if (csPtr->writePtr->flags & BG_FLUSH_SCHEDULED) { - if (!(mask & TCL_WRITABLE)) { - if (mask & TCL_READABLE) { - Tcl_DeleteChannelHandler(outChan, CopyEventProc, - (ClientData) csPtr); - } - Tcl_CreateChannelHandler(outChan, TCL_WRITABLE, - CopyEventProc, (ClientData) csPtr); - } - return TCL_OK; - } - - /* - * Update the current byte count if we care. - */ - - if (csPtr->toRead != -1) { - csPtr->toRead -= size; - } - csPtr->total += size; - - /* - * For background copies, we only do one buffer per invocation so - * we don't starve the rest of the system. - */ - - if (cmdPtr) { - /* - * The first time we enter this code, there won't be a - * channel handler established yet, so do it here. - */ - - if (mask == 0) { - Tcl_CreateChannelHandler(outChan, TCL_WRITABLE, - CopyEventProc, (ClientData) csPtr); - } - return TCL_OK; - } - } - - /* - * Make the callback or return the number of bytes transferred. - * The local total is used because StopCopy frees csPtr. - */ - - total = csPtr->total; - if (cmdPtr) { - /* - * Get a private copy of the command so we can mutate it - * by adding arguments. Note that StopCopy frees our saved - * reference to the original command obj. - */ - - cmdPtr = Tcl_DuplicateObj(cmdPtr); - Tcl_IncrRefCount(cmdPtr); - StopCopy(csPtr); - Tcl_Preserve((ClientData) interp); - - Tcl_ListObjAppendElement(interp, cmdPtr, Tcl_NewIntObj(total)); - if (errObj) { - Tcl_ListObjAppendElement(interp, cmdPtr, errObj); - } - if (Tcl_EvalObjEx(interp, cmdPtr, TCL_EVAL_GLOBAL) != TCL_OK) { - Tcl_BackgroundError(interp); - result = TCL_ERROR; - } - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) interp); - } else { - StopCopy(csPtr); - if (errObj) { - Tcl_SetObjResult(interp, errObj); - result = TCL_ERROR; - } else { - Tcl_ResetResult(interp); - Tcl_SetIntObj(Tcl_GetObjResult(interp), total); - } - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * DoRead -- - * - * Reads a given number of bytes from a channel. - * - * Results: - * The number of characters read, or -1 on error. Use Tcl_GetErrno() - * to retrieve the error code for the error that occurred. - * - * Side effects: - * May cause input to be buffered. - * - *---------------------------------------------------------------------- - */ - -static int -DoRead(chanPtr, bufPtr, toRead) - Channel *chanPtr; /* The channel from which to read. */ - char *bufPtr; /* Where to store input read. */ - int toRead; /* Maximum number of bytes to read. */ -{ - int copied; /* How many characters were copied into - * the result string? */ - int copiedNow; /* How many characters were copied from - * the current input buffer? */ - int result; /* Of calling GetInput. */ - - /* - * If we have not encountered a sticky EOF, clear the EOF bit. Either - * way clear the BLOCKED bit. We want to discover these anew during - * each operation. - */ - - if (!(chanPtr->flags & CHANNEL_STICKY_EOF)) { - chanPtr->flags &= ~CHANNEL_EOF; - } - chanPtr->flags &= ~(CHANNEL_BLOCKED | CHANNEL_NEED_MORE_DATA); - - for (copied = 0; copied < toRead; copied += copiedNow) { - copiedNow = CopyAndTranslateBuffer(chanPtr, bufPtr + copied, - toRead - copied); - if (copiedNow == 0) { - if (chanPtr->flags & CHANNEL_EOF) { - goto done; - } - if (chanPtr->flags & CHANNEL_BLOCKED) { - if (chanPtr->flags & CHANNEL_NONBLOCKING) { - goto done; - } - chanPtr->flags &= (~(CHANNEL_BLOCKED)); - } - result = GetInput(chanPtr); - if (result != 0) { - if (result != EAGAIN) { - copied = -1; - } - goto done; - } - } - } - - chanPtr->flags &= (~(CHANNEL_BLOCKED)); - - done: - /* - * Update the notifier state so we don't block while there is still - * data in the buffers. - */ - - UpdateInterest(chanPtr); - return copied; -} - -/* - *---------------------------------------------------------------------- - * - * CopyAndTranslateBuffer -- - * - * Copy at most one buffer of input to the result space, doing - * eol translations according to mode in effect currently. - * - * Results: - * Number of bytes stored in the result buffer (as opposed to the - * number of bytes read from the channel). May return - * zero if no input is available to be translated. - * - * Side effects: - * Consumes buffered input. May deallocate one buffer. - * - *---------------------------------------------------------------------- - */ - -static int -CopyAndTranslateBuffer(chanPtr, result, space) - Channel *chanPtr; /* The channel from which to read input. */ - char *result; /* Where to store the copied input. */ - int space; /* How many bytes are available in result - * to store the copied input? */ -{ - int bytesInBuffer; /* How many bytes are available to be - * copied in the current input buffer? */ - int copied; /* How many characters were already copied - * into the destination space? */ - ChannelBuffer *bufPtr; /* The buffer from which to copy bytes. */ - int i; /* Iterates over the copied input looking - * for the input eofChar. */ - - /* - * If there is no input at all, return zero. The invariant is that either - * there is no buffer in the queue, or if the first buffer is empty, it - * is also the last buffer (and thus there is no input in the queue). - * Note also that if the buffer is empty, we leave it in the queue. - */ - - if (chanPtr->inQueueHead == (ChannelBuffer *) NULL) { - return 0; - } - bufPtr = chanPtr->inQueueHead; - bytesInBuffer = bufPtr->nextAdded - bufPtr->nextRemoved; - - copied = 0; - switch (chanPtr->inputTranslation) { - case TCL_TRANSLATE_LF: { - if (bytesInBuffer == 0) { - return 0; - } - - /* - * Copy the current chunk into the result buffer. - */ - - if (bytesInBuffer < space) { - space = bytesInBuffer; - } - memcpy((VOID *) result, - (VOID *) (bufPtr->buf + bufPtr->nextRemoved), - (size_t) space); - bufPtr->nextRemoved += space; - copied = space; - break; - } - case TCL_TRANSLATE_CR: { - char *end; - - if (bytesInBuffer == 0) { - return 0; - } - - /* - * Copy the current chunk into the result buffer, then - * replace all \r with \n. - */ - - if (bytesInBuffer < space) { - space = bytesInBuffer; - } - memcpy((VOID *) result, - (VOID *) (bufPtr->buf + bufPtr->nextRemoved), - (size_t) space); - bufPtr->nextRemoved += space; - copied = space; - - for (end = result + copied; result < end; result++) { - if (*result == '\r') { - *result = '\n'; - } - } - break; - } - case TCL_TRANSLATE_CRLF: { - char *src, *end, *dst; - int curByte; - - /* - * If there is a held-back "\r" at EOF, produce it now. - */ - - if (bytesInBuffer == 0) { - if ((chanPtr->flags & (INPUT_SAW_CR | CHANNEL_EOF)) == - (INPUT_SAW_CR | CHANNEL_EOF)) { - result[0] = '\r'; - chanPtr->flags &= ~INPUT_SAW_CR; - return 1; - } - return 0; - } - - /* - * Copy the current chunk and replace "\r\n" with "\n" - * (but not standalone "\r"!). - */ - - if (bytesInBuffer < space) { - space = bytesInBuffer; - } - memcpy((VOID *) result, - (VOID *) (bufPtr->buf + bufPtr->nextRemoved), - (size_t) space); - bufPtr->nextRemoved += space; - copied = space; - - end = result + copied; - dst = result; - for (src = result; src < end; src++) { - curByte = *src; - if (curByte == '\n') { - chanPtr->flags &= ~INPUT_SAW_CR; - } else if (chanPtr->flags & INPUT_SAW_CR) { - chanPtr->flags &= ~INPUT_SAW_CR; - *dst = '\r'; - dst++; - } - if (curByte == '\r') { - chanPtr->flags |= INPUT_SAW_CR; - } else { - *dst = (char) curByte; - dst++; - } - } - copied = dst - result; - break; - } - case TCL_TRANSLATE_AUTO: { - char *src, *end, *dst; - int curByte; - - if (bytesInBuffer == 0) { - return 0; - } - - /* - * Loop over the current buffer, converting "\r" and "\r\n" - * to "\n". - */ - - if (bytesInBuffer < space) { - space = bytesInBuffer; - } - memcpy((VOID *) result, - (VOID *) (bufPtr->buf + bufPtr->nextRemoved), - (size_t) space); - bufPtr->nextRemoved += space; - copied = space; - - end = result + copied; - dst = result; - for (src = result; src < end; src++) { - curByte = *src; - if (curByte == '\r') { - chanPtr->flags |= INPUT_SAW_CR; - *dst = '\n'; - dst++; - } else { - if ((curByte != '\n') || - !(chanPtr->flags & INPUT_SAW_CR)) { - *dst = (char) curByte; - dst++; - } - chanPtr->flags &= ~INPUT_SAW_CR; - } - } - copied = dst - result; - break; - } - default: { - panic("unknown eol translation mode"); - } - } - - /* - * If an in-stream EOF character is set for this channel, check that - * the input we copied so far does not contain the EOF char. If it does, - * copy only up to and excluding that character. - */ - - if (chanPtr->inEofChar != 0) { - for (i = 0; i < copied; i++) { - if (result[i] == (char) chanPtr->inEofChar) { - /* - * Set sticky EOF so that no further input is presented - * to the caller. - */ - - chanPtr->flags |= (CHANNEL_EOF | CHANNEL_STICKY_EOF); - chanPtr->inputEncodingFlags |= TCL_ENCODING_END; - copied = i; - break; - } - } - } - - /* - * If the current buffer is empty recycle it. - */ - - if (bufPtr->nextRemoved == bufPtr->nextAdded) { - chanPtr->inQueueHead = bufPtr->nextPtr; - if (chanPtr->inQueueHead == (ChannelBuffer *) NULL) { - chanPtr->inQueueTail = (ChannelBuffer *) NULL; - } - RecycleBuffer(chanPtr, bufPtr, 0); - } - - /* - * Return the number of characters copied into the result buffer. - * This may be different from the number of bytes consumed, because - * of EOL translations. - */ - - return copied; -} - -/* - *---------------------------------------------------------------------- - * - * DoWrite -- - * - * Puts a sequence of characters into an output buffer, may queue the - * buffer for output if it gets full, and also remembers whether the - * current buffer is ready e.g. if it contains a newline and we are in - * line buffering mode. - * - * Results: - * The number of bytes written or -1 in case of error. If -1, - * Tcl_GetErrno will return the error code. - * - * Side effects: - * May buffer up output and may cause output to be produced on the - * channel. - * - *---------------------------------------------------------------------- - */ - -static int -DoWrite(chanPtr, src, srcLen) - Channel *chanPtr; /* The channel to buffer output for. */ - char *src; /* Data to write. */ - int srcLen; /* Number of bytes to write. */ -{ - ChannelBuffer *outBufPtr; /* Current output buffer. */ - int foundNewline; /* Did we find a newline in output? */ - char *dPtr; - char *sPtr; /* Search variables for newline. */ - int crsent; /* In CRLF eol translation mode, - * remember the fact that a CR was - * output to the channel without - * its following NL. */ - int i; /* Loop index for newline search. */ - int destCopied; /* How many bytes were used in this - * destination buffer to hold the - * output? */ - int totalDestCopied; /* How many bytes total were - * copied to the channel buffer? */ - int srcCopied; /* How many bytes were copied from - * the source string? */ - char *destPtr; /* Where in line to copy to? */ - - /* - * If we are in network (or windows) translation mode, record the fact - * that we have not yet sent a CR to the channel. - */ - - crsent = 0; - - /* - * Loop filling buffers and flushing them until all output has been - * consumed. - */ - - srcCopied = 0; - totalDestCopied = 0; - - while (srcLen > 0) { - - /* - * Make sure there is a current output buffer to accept output. - */ - - if (chanPtr->curOutPtr == (ChannelBuffer *) NULL) { - chanPtr->curOutPtr = AllocChannelBuffer(chanPtr->bufSize); - } - - outBufPtr = chanPtr->curOutPtr; - - destCopied = outBufPtr->bufLength - outBufPtr->nextAdded; - if (destCopied > srcLen) { - destCopied = srcLen; - } - - destPtr = outBufPtr->buf + outBufPtr->nextAdded; - switch (chanPtr->outputTranslation) { - case TCL_TRANSLATE_LF: - srcCopied = destCopied; - memcpy((VOID *) destPtr, (VOID *) src, (size_t) destCopied); - break; - case TCL_TRANSLATE_CR: - srcCopied = destCopied; - memcpy((VOID *) destPtr, (VOID *) src, (size_t) destCopied); - for (dPtr = destPtr; dPtr < destPtr + destCopied; dPtr++) { - if (*dPtr == '\n') { - *dPtr = '\r'; - } - } - break; - case TCL_TRANSLATE_CRLF: - for (srcCopied = 0, dPtr = destPtr, sPtr = src; - dPtr < destPtr + destCopied; - dPtr++, sPtr++, srcCopied++) { - if (*sPtr == '\n') { - if (crsent) { - *dPtr = '\n'; - crsent = 0; - } else { - *dPtr = '\r'; - crsent = 1; - sPtr--, srcCopied--; - } - } else { - *dPtr = *sPtr; - } - } - break; - case TCL_TRANSLATE_AUTO: - panic("Tcl_Write: AUTO output translation mode not supported"); - default: - panic("Tcl_Write: unknown output translation mode"); - } - - /* - * The current buffer is ready for output if it is full, or if it - * contains a newline and this channel is line-buffered, or if it - * contains any output and this channel is unbuffered. - */ - - outBufPtr->nextAdded += destCopied; - if (!(chanPtr->flags & BUFFER_READY)) { - if (outBufPtr->nextAdded == outBufPtr->bufLength) { - chanPtr->flags |= BUFFER_READY; - } else if (chanPtr->flags & CHANNEL_LINEBUFFERED) { - for (sPtr = src, i = 0, foundNewline = 0; - (i < srcCopied) && (!foundNewline); - i++, sPtr++) { - if (*sPtr == '\n') { - foundNewline = 1; - break; - } - } - if (foundNewline) { - chanPtr->flags |= BUFFER_READY; - } - } else if (chanPtr->flags & CHANNEL_UNBUFFERED) { - chanPtr->flags |= BUFFER_READY; - } - } - - totalDestCopied += srcCopied; - src += srcCopied; - srcLen -= srcCopied; - - if (chanPtr->flags & BUFFER_READY) { - if (FlushChannel(NULL, chanPtr, 0) != 0) { - return -1; - } - } - } /* Closes "while" */ - - return totalDestCopied; -} - -/* - *---------------------------------------------------------------------- - * - * CopyEventProc -- - * - * This routine is invoked as a channel event handler for - * the background copy operation. It is just a trivial wrapper - * around the CopyData routine. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -CopyEventProc(clientData, mask) - ClientData clientData; - int mask; -{ - (void) CopyData((CopyState *)clientData, mask); -} - -/* - *---------------------------------------------------------------------- - * - * StopCopy -- - * - * This routine halts a copy that is in progress. - * - * Results: - * None. - * - * Side effects: - * Removes any pending channel handlers and restores the blocking - * and buffering modes of the channels. The CopyState is freed. - * - *---------------------------------------------------------------------- - */ - -static void -StopCopy(csPtr) - CopyState *csPtr; /* State for bg copy to stop . */ -{ - int nonBlocking; - - if (!csPtr) { - return; - } - - /* - * Restore the old blocking mode and output buffering mode. - */ - - nonBlocking = (csPtr->readFlags & CHANNEL_NONBLOCKING); - if (nonBlocking != (csPtr->readPtr->flags & CHANNEL_NONBLOCKING)) { - SetBlockMode(NULL, csPtr->readPtr, - nonBlocking ? TCL_MODE_NONBLOCKING : TCL_MODE_BLOCKING); - } - if (csPtr->writePtr != csPtr->writePtr) { - if (nonBlocking != (csPtr->writePtr->flags & CHANNEL_NONBLOCKING)) { - SetBlockMode(NULL, csPtr->writePtr, - nonBlocking ? TCL_MODE_NONBLOCKING : TCL_MODE_BLOCKING); - } - } - csPtr->writePtr->flags &= ~(CHANNEL_LINEBUFFERED | CHANNEL_UNBUFFERED); - csPtr->writePtr->flags |= - csPtr->writeFlags & (CHANNEL_LINEBUFFERED | CHANNEL_UNBUFFERED); - - - if (csPtr->cmdPtr) { - Tcl_DeleteChannelHandler((Tcl_Channel)csPtr->readPtr, CopyEventProc, - (ClientData)csPtr); - if (csPtr->readPtr != csPtr->writePtr) { - Tcl_DeleteChannelHandler((Tcl_Channel)csPtr->writePtr, - CopyEventProc, (ClientData)csPtr); - } - Tcl_DecrRefCount(csPtr->cmdPtr); - } - csPtr->readPtr->csPtr = NULL; - csPtr->writePtr->csPtr = NULL; - ckfree((char*) csPtr); -} - -/* - *---------------------------------------------------------------------- - * - * SetBlockMode -- - * - * This function sets the blocking mode for a channel and updates - * the state flags. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Modifies the blocking mode of the channel and possibly generates - * an error. - * - *---------------------------------------------------------------------- - */ - -static int -SetBlockMode(interp, chanPtr, mode) - Tcl_Interp *interp; /* Interp for error reporting. */ - Channel *chanPtr; /* Channel to modify. */ - int mode; /* One of TCL_MODE_BLOCKING or - * TCL_MODE_NONBLOCKING. */ -{ - int result = 0; - if (chanPtr->typePtr->blockModeProc != NULL) { - result = (chanPtr->typePtr->blockModeProc) (chanPtr->instanceData, - mode); - } - if (result != 0) { - Tcl_SetErrno(result); - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "error setting blocking mode: ", - Tcl_PosixError(interp), (char *) NULL); - } - return TCL_ERROR; - } - if (mode == TCL_MODE_BLOCKING) { - chanPtr->flags &= (~(CHANNEL_NONBLOCKING | BG_FLUSH_SCHEDULED)); - } else { - chanPtr->flags |= CHANNEL_NONBLOCKING; - } - return TCL_OK; -} diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c deleted file mode 100644 index f88840b..0000000 --- a/generic/tclIOCmd.c +++ /dev/null @@ -1,1537 +0,0 @@ -/* - * tclIOCmd.c -- - * - * Contains the definitions of most of the Tcl commands relating to IO. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclIOCmd.c,v 1.5 1999/04/16 00:46:47 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * Callback structure for accept callback in a TCP server. - */ - -typedef struct AcceptCallback { - char *script; /* Script to invoke. */ - Tcl_Interp *interp; /* Interpreter in which to run it. */ -} AcceptCallback; - -/* - * Static functions for this file: - */ - -static void AcceptCallbackProc _ANSI_ARGS_((ClientData callbackData, - Tcl_Channel chan, char *address, int port)); -static void RegisterTcpServerInterpCleanup _ANSI_ARGS_((Tcl_Interp *interp, - AcceptCallback *acceptCallbackPtr)); -static void TcpAcceptCallbacksDeleteProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp)); -static void TcpServerCloseProc _ANSI_ARGS_((ClientData callbackData)); -static void UnregisterTcpServerInterpCleanupProc _ANSI_ARGS_(( - Tcl_Interp *interp, AcceptCallback *acceptCallbackPtr)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_PutsObjCmd -- - * - * This procedure is invoked to process the "puts" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Produces output on a channel. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_PutsObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; /* The channel to puts on. */ - int i; /* Counter. */ - int newline; /* Add a newline at end? */ - char *channelId; /* Name of channel for puts. */ - int result; /* Result of puts operation. */ - int mode; /* Mode in which channel is opened. */ - char *arg; - int length; - - i = 1; - newline = 1; - if ((objc >= 2) && (strcmp(Tcl_GetString(objv[1]), "-nonewline") == 0)) { - newline = 0; - i++; - } - if ((i < (objc-3)) || (i >= objc)) { - Tcl_WrongNumArgs(interp, 1, objv, "?-nonewline? ?channelId? string"); - return TCL_ERROR; - } - - /* - * The code below provides backwards compatibility with an old - * form of the command that is no longer recommended or documented. - */ - - if (i == (objc-3)) { - arg = Tcl_GetStringFromObj(objv[i + 2], &length); - if (strncmp(arg, "nonewline", (size_t) length) != 0) { - Tcl_AppendResult(interp, "bad argument \"", arg, - "\": should be \"nonewline\"", (char *) NULL); - return TCL_ERROR; - } - newline = 0; - } - if (i == (objc - 1)) { - channelId = "stdout"; - } else { - channelId = Tcl_GetString(objv[i]); - i++; - } - chan = Tcl_GetChannel(interp, channelId, &mode); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - if ((mode & TCL_WRITABLE) == 0) { - Tcl_AppendResult(interp, "channel \"", channelId, - "\" wasn't opened for writing", (char *) NULL); - return TCL_ERROR; - } - - result = Tcl_WriteObj(chan, objv[i]); - if (result < 0) { - goto error; - } - if (newline != 0) { - result = Tcl_WriteChars(chan, "\n", 1); - if (result < 0) { - goto error; - } - } - return TCL_OK; - - error: - Tcl_AppendResult(interp, "error writing \"", channelId, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FlushObjCmd -- - * - * This procedure is called to process the Tcl "flush" command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May cause output to appear on the specified channel. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_FlushObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; /* The channel to flush on. */ - char *channelId; - int mode; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "channelId"); - return TCL_ERROR; - } - channelId = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, channelId, &mode); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - if ((mode & TCL_WRITABLE) == 0) { - Tcl_AppendResult(interp, "channel \"", channelId, - "\" wasn't opened for writing", (char *) NULL); - return TCL_ERROR; - } - - if (Tcl_Flush(chan) != TCL_OK) { - Tcl_AppendResult(interp, "error flushing \"", channelId, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetsObjCmd -- - * - * This procedure is called to process the Tcl "gets" command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May consume input from channel. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_GetsObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; /* The channel to read from. */ - int lineLen; /* Length of line just read. */ - int mode; /* Mode in which channel is opened. */ - char *name; - Tcl_Obj *resultPtr, *linePtr; - - if ((objc != 2) && (objc != 3)) { - Tcl_WrongNumArgs(interp, 1, objv, "channelId ?varName?"); - return TCL_ERROR; - } - name = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, name, &mode); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - if ((mode & TCL_READABLE) == 0) { - Tcl_AppendResult(interp, "channel \"", name, - "\" wasn't opened for reading", (char *) NULL); - return TCL_ERROR; - } - - resultPtr = Tcl_GetObjResult(interp); - linePtr = resultPtr; - if (objc == 3) { - /* - * Variable gets line, interp get bytecount. - */ - - linePtr = Tcl_NewObj(); - } - - lineLen = Tcl_GetsObj(chan, linePtr); - if (lineLen < 0) { - if (!Tcl_Eof(chan) && !Tcl_InputBlocked(chan)) { - if (linePtr != resultPtr) { - Tcl_DecrRefCount(linePtr); - } - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "error reading \"", name, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - lineLen = -1; - } - if (objc == 3) { - if (Tcl_ObjSetVar2(interp, objv[2], NULL, linePtr, - TCL_LEAVE_ERR_MSG) == NULL) { - Tcl_DecrRefCount(linePtr); - return TCL_ERROR; - } - Tcl_SetIntObj(resultPtr, lineLen); - return TCL_OK; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ReadObjCmd -- - * - * This procedure is invoked to process the Tcl "read" command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May consume input from channel. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ReadObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; /* The channel to read from. */ - int newline, i; /* Discard newline at end? */ - int toRead; /* How many bytes to read? */ - int charactersRead; /* How many characters were read? */ - int mode; /* Mode in which channel is opened. */ - char *name; - Tcl_Obj *resultPtr; - - if ((objc != 2) && (objc != 3)) { - argerror: - Tcl_WrongNumArgs(interp, 1, objv, "channelId ?numBytes?"); - Tcl_AppendResult(interp, " or \"", Tcl_GetString(objv[0]), - " ?-nonewline? channelId\"", (char *) NULL); - return TCL_ERROR; - } - - i = 1; - newline = 0; - if (strcmp(Tcl_GetString(objv[1]), "-nonewline") == 0) { - newline = 1; - i++; - } - - if (i == objc) { - goto argerror; - } - - name = Tcl_GetString(objv[i]); - chan = Tcl_GetChannel(interp, name, &mode); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - if ((mode & TCL_READABLE) == 0) { - Tcl_AppendResult(interp, "channel \"", name, - "\" wasn't opened for reading", (char *) NULL); - return TCL_ERROR; - } - i++; /* Consumed channel name. */ - - /* - * Compute how many bytes to read, and see whether the final - * newline should be dropped. - */ - - toRead = -1; - if (i < objc) { - char *arg; - - arg = Tcl_GetString(objv[i]); - if (isdigit(UCHAR(arg[0]))) { /* INTL: digit */ - if (Tcl_GetIntFromObj(interp, objv[i], &toRead) != TCL_OK) { - return TCL_ERROR; - } - } else if (strcmp(arg, "nonewline") == 0) { - newline = 1; - } else { - Tcl_AppendResult(interp, "bad argument \"", arg, - "\": should be \"nonewline\"", (char *) NULL); - return TCL_ERROR; - } - } - - resultPtr = Tcl_GetObjResult(interp); - charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0); - if (charactersRead < 0) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "error reading \"", name, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - - /* - * If requested, remove the last newline in the channel if at EOF. - */ - - if ((charactersRead > 0) && (newline != 0)) { - char *result; - int length; - - result = Tcl_GetStringFromObj(resultPtr, &length); - if (result[length - 1] == '\n') { - Tcl_SetObjLength(resultPtr, length - 1); - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SeekObjCmd -- - * - * This procedure is invoked to process the Tcl "seek" command. See - * the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Moves the position of the access point on the specified channel. - * May flush queued output. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_SeekObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; /* The channel to tell on. */ - int offset, mode; /* Where to seek? */ - int result; /* Of calling Tcl_Seek. */ - char *chanName; - int optionIndex; - static char *originOptions[] = {"start", "current", "end", (char *) NULL}; - static int modeArray[] = {SEEK_SET, SEEK_CUR, SEEK_END}; - - if ((objc != 3) && (objc != 4)) { - Tcl_WrongNumArgs(interp, 1, objv, "channelId offset ?origin?"); - return TCL_ERROR; - } - chanName = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, chanName, NULL); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - if (Tcl_GetIntFromObj(interp, objv[2], &offset) != TCL_OK) { - return TCL_ERROR; - } - mode = SEEK_SET; - if (objc == 4) { - if (Tcl_GetIndexFromObj(interp, objv[3], originOptions, "origin", 0, - &optionIndex) != TCL_OK) { - return TCL_ERROR; - } - mode = modeArray[optionIndex]; - } - - result = Tcl_Seek(chan, offset, mode); - if (result == -1) { - Tcl_AppendResult(interp, "error during seek on \"", - chanName, "\": ", Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_TellObjCmd -- - * - * This procedure is invoked to process the Tcl "tell" command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_TellObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; /* The channel to tell on. */ - char *chanName; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "channelId"); - return TCL_ERROR; - } - /* - * Try to find a channel with the right name and permissions in - * the IO channel table of this interpreter. - */ - - chanName = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, chanName, NULL); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), Tcl_Tell(chan)); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CloseObjCmd -- - * - * This procedure is invoked to process the Tcl "close" command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May discard queued input; may flush queued output. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_CloseObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; /* The channel to close. */ - char *arg; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "channelId"); - return TCL_ERROR; - } - - arg = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, arg, NULL); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - - if (Tcl_UnregisterChannel(interp, chan) != TCL_OK) { - /* - * If there is an error message and it ends with a newline, remove - * the newline. This is done for command pipeline channels where the - * error output from the subprocesses is stored in interp's result. - * - * NOTE: This is likely to not have any effect on regular error - * messages produced by drivers during the closing of a channel, - * because the Tcl convention is that such error messages do not - * have a terminating newline. - */ - - Tcl_Obj *resultPtr; - char *string; - int len; - - resultPtr = Tcl_GetObjResult(interp); - string = Tcl_GetStringFromObj(resultPtr, &len); - if ((len > 0) && (string[len - 1] == '\n')) { - Tcl_SetObjLength(resultPtr, len - 1); - } - return TCL_ERROR; - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FconfigureObjCmd -- - * - * This procedure is invoked to process the Tcl "fconfigure" command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May modify the behavior of an IO channel. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_FconfigureObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *chanName, *optionName, *valueName; - Tcl_Channel chan; /* The channel to set a mode on. */ - int i; /* Iterate over arg-value pairs. */ - Tcl_DString ds; /* DString to hold result of - * calling Tcl_GetChannelOption. */ - - if ((objc < 2) || (((objc % 2) == 1) && (objc != 3))) { - Tcl_WrongNumArgs(interp, 1, objv, - "channelId ?optionName? ?value? ?optionName value?..."); - return TCL_ERROR; - } - chanName = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, chanName, NULL); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - if (objc == 2) { - Tcl_DStringInit(&ds); - if (Tcl_GetChannelOption(interp, chan, (char *) NULL, &ds) != TCL_OK) { - Tcl_DStringFree(&ds); - return TCL_ERROR; - } - Tcl_DStringResult(interp, &ds); - return TCL_OK; - } - if (objc == 3) { - Tcl_DStringInit(&ds); - optionName = Tcl_GetString(objv[2]); - if (Tcl_GetChannelOption(interp, chan, optionName, &ds) != TCL_OK) { - Tcl_DStringFree(&ds); - return TCL_ERROR; - } - Tcl_DStringResult(interp, &ds); - return TCL_OK; - } - for (i = 3; i < objc; i += 2) { - optionName = Tcl_GetString(objv[i-1]); - valueName = Tcl_GetString(objv[i]); - if (Tcl_SetChannelOption(interp, chan, optionName, valueName) - != TCL_OK) { - return TCL_ERROR; - } - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_EofObjCmd -- - * - * This procedure is invoked to process the Tcl "eof" command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Sets interp's result to boolean true or false depending on whether - * the specified channel has an EOF condition. - * - *--------------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_EofObjCmd(unused, interp, objc, objv) - ClientData unused; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; - int dummy; - char *arg; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "channelId"); - return TCL_ERROR; - } - - arg = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, arg, &dummy); - if (chan == NULL) { - return TCL_ERROR; - } - - Tcl_SetBooleanObj(Tcl_GetObjResult(interp), Tcl_Eof(chan)); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ExecObjCmd -- - * - * This procedure is invoked to process the "exec" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ExecObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ -#ifdef MAC_TCL - - Tcl_AppendResult(interp, "exec not implemented under Mac OS", - (char *)NULL); - return TCL_ERROR; - -#else /* !MAC_TCL */ - - /* - * This procedure generates an argv array for the string arguments. It - * starts out with stack-allocated space but uses dynamically-allocated - * storage if needed. - */ - -#define NUM_ARGS 20 - Tcl_Obj *resultPtr; - char **argv; - char *string; - Tcl_Channel chan; - char *argStorage[NUM_ARGS]; - int argc, background, i, index, keepNewline, result, skip, length; - static char *options[] = { - "-keepnewline", "--", NULL - }; - enum options { - EXEC_KEEPNEWLINE, EXEC_LAST - }; - - /* - * Check for a leading "-keepnewline" argument. - */ - - keepNewline = 0; - for (skip = 1; skip < objc; skip++) { - string = Tcl_GetString(objv[skip]); - if (string[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[skip], options, "switch", - TCL_EXACT, &index) != TCL_OK) { - return TCL_ERROR; - } - if (index == EXEC_KEEPNEWLINE) { - keepNewline = 1; - } else { - skip++; - break; - } - } - if (objc <= skip) { - Tcl_WrongNumArgs(interp, 1, objv, "?switches? arg ?arg ...?"); - return TCL_ERROR; - } - - /* - * See if the command is to be run in background. - */ - - background = 0; - string = Tcl_GetString(objv[objc - 1]); - if ((string[0] == '&') && (string[1] == '\0')) { - objc--; - background = 1; - } - - /* - * Create the string argument array "argv". Make sure argv is large - * enough to hold the argc arguments plus 1 extra for the zero - * end-of-argv word. - */ - - argv = argStorage; - argc = objc - skip; - if ((argc + 1) > sizeof(argv) / sizeof(argv[0])) { - argv = (char **) ckalloc((unsigned)(argc + 1) * sizeof(char *)); - } - - /* - * Copy the string conversions of each (post option) object into the - * argument vector. - */ - - for (i = 0; i < argc; i++) { - argv[i] = Tcl_GetString(objv[i + skip]); - } - argv[argc] = NULL; - chan = Tcl_OpenCommandChannel(interp, argc, argv, - (background ? 0 : TCL_STDOUT | TCL_STDERR)); - - /* - * Free the argv array if malloc'ed storage was used. - */ - - if (argv != argStorage) { - ckfree((char *)argv); - } - - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - - if (background) { - /* - * Store the list of PIDs from the pipeline in interp's result and - * detach the PIDs (instead of waiting for them). - */ - - TclGetAndDetachPids(interp, chan); - if (Tcl_Close(interp, chan) != TCL_OK) { - return TCL_ERROR; - } - return TCL_OK; - } - - resultPtr = Tcl_NewObj(); - if (Tcl_GetChannelHandle(chan, TCL_READABLE, NULL) == TCL_OK) { - if (Tcl_ReadChars(chan, resultPtr, -1, 0) < 0) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "error reading output from command: ", - Tcl_PosixError(interp), (char *) NULL); - Tcl_DecrRefCount(resultPtr); - return TCL_ERROR; - } - } - /* - * If the process produced anything on stderr, it will have been - * returned in the interpreter result. It needs to be appended to - * the result string. - */ - - result = Tcl_Close(interp, chan); - string = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length); - Tcl_AppendToObj(resultPtr, string, length); - - /* - * If the last character of the result is a newline, then remove - * the newline character. - */ - - if (keepNewline == 0) { - string = Tcl_GetStringFromObj(resultPtr, &length); - if ((length > 0) && (string[length - 1] == '\n')) { - Tcl_SetObjLength(resultPtr, length - 1); - } - } - Tcl_SetObjResult(interp, resultPtr); - - return result; -#endif /* !MAC_TCL */ -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_FblockedObjCmd -- - * - * This procedure is invoked to process the Tcl "fblocked" command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Sets interp's result to boolean true or false depending on whether - * the preceeding input operation on the channel would have blocked. - * - *--------------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_FblockedObjCmd(unused, interp, objc, objv) - ClientData unused; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel chan; - int mode; - char *arg; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "channelId"); - return TCL_ERROR; - } - - arg = Tcl_GetString(objv[1]); - chan = Tcl_GetChannel(interp, arg, &mode); - if (chan == NULL) { - return TCL_ERROR; - } - if ((mode & TCL_READABLE) == 0) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "channel \"", - arg, "\" wasn't opened for reading", (char *) NULL); - return TCL_ERROR; - } - - Tcl_SetBooleanObj(Tcl_GetObjResult(interp), Tcl_InputBlocked(chan)); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_OpenObjCmd -- - * - * This procedure is invoked to process the "open" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_OpenObjCmd(notUsed, interp, objc, objv) - ClientData notUsed; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int pipeline, prot; - char *modeString, *what; - Tcl_Channel chan; - - if ((objc < 2) || (objc > 4)) { - Tcl_WrongNumArgs(interp, 1, objv, "fileName ?access? ?permissions?"); - return TCL_ERROR; - } - prot = 0666; - if (objc == 2) { - modeString = "r"; - } else { - modeString = Tcl_GetString(objv[2]); - if (objc == 4) { - if (Tcl_GetIntFromObj(interp, objv[3], &prot) != TCL_OK) { - return TCL_ERROR; - } - } - } - - pipeline = 0; - what = Tcl_GetString(objv[1]); - if (what[0] == '|') { - pipeline = 1; - } - - /* - * Open the file or create a process pipeline. - */ - - if (!pipeline) { - chan = Tcl_OpenFileChannel(interp, what, modeString, prot); - } else { -#ifdef MAC_TCL - Tcl_AppendResult(interp, - "command pipelines not supported on Macintosh OS", - (char *)NULL); - return TCL_ERROR; -#else - int mode, seekFlag, cmdObjc; - char **cmdArgv; - - if (Tcl_SplitList(interp, what+1, &cmdObjc, &cmdArgv) != TCL_OK) { - return TCL_ERROR; - } - - mode = TclGetOpenMode(interp, modeString, &seekFlag); - if (mode == -1) { - chan = NULL; - } else { - int flags = TCL_STDERR | TCL_ENFORCE_MODE; - switch (mode & (O_RDONLY | O_WRONLY | O_RDWR)) { - case O_RDONLY: - flags |= TCL_STDOUT; - break; - case O_WRONLY: - flags |= TCL_STDIN; - break; - case O_RDWR: - flags |= (TCL_STDIN | TCL_STDOUT); - break; - default: - panic("Tcl_OpenCmd: invalid mode value"); - break; - } - chan = Tcl_OpenCommandChannel(interp, cmdObjc, cmdArgv, flags); - } - ckfree((char *) cmdArgv); -#endif - } - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - Tcl_RegisterChannel(interp, chan); - Tcl_AppendResult(interp, Tcl_GetChannelName(chan), (char *) NULL); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TcpAcceptCallbacksDeleteProc -- - * - * Assocdata cleanup routine called when an interpreter is being - * deleted to set the interp field of all the accept callback records - * registered with the interpreter to NULL. This will prevent the - * interpreter from being used in the future to eval accept scripts. - * - * Results: - * None. - * - * Side effects: - * Deallocates memory and sets the interp field of all the accept - * callback records to NULL to prevent this interpreter from being - * used subsequently to eval accept scripts. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static void -TcpAcceptCallbacksDeleteProc(clientData, interp) - ClientData clientData; /* Data which was passed when the assocdata - * was registered. */ - Tcl_Interp *interp; /* Interpreter being deleted - not used. */ -{ - Tcl_HashTable *hTblPtr; - Tcl_HashEntry *hPtr; - Tcl_HashSearch hSearch; - AcceptCallback *acceptCallbackPtr; - - hTblPtr = (Tcl_HashTable *) clientData; - for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); - hPtr != (Tcl_HashEntry *) NULL; - hPtr = Tcl_NextHashEntry(&hSearch)) { - acceptCallbackPtr = (AcceptCallback *) Tcl_GetHashValue(hPtr); - acceptCallbackPtr->interp = (Tcl_Interp *) NULL; - } - Tcl_DeleteHashTable(hTblPtr); - ckfree((char *) hTblPtr); -} - -/* - *---------------------------------------------------------------------- - * - * RegisterTcpServerInterpCleanup -- - * - * Registers an accept callback record to have its interp - * field set to NULL when the interpreter is deleted. - * - * Results: - * None. - * - * Side effects: - * When, in the future, the interpreter is deleted, the interp - * field of the accept callback data structure will be set to - * NULL. This will prevent attempts to eval the accept script - * in a deleted interpreter. - * - *---------------------------------------------------------------------- - */ - -static void -RegisterTcpServerInterpCleanup(interp, acceptCallbackPtr) - Tcl_Interp *interp; /* Interpreter for which we want to be - * informed of deletion. */ - AcceptCallback *acceptCallbackPtr; - /* The accept callback record whose - * interp field we want set to NULL when - * the interpreter is deleted. */ -{ - Tcl_HashTable *hTblPtr; /* Hash table for accept callback - * records to smash when the interpreter - * will be deleted. */ - Tcl_HashEntry *hPtr; /* Entry for this record. */ - int new; /* Is the entry new? */ - - hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, - "tclTCPAcceptCallbacks", - NULL); - if (hTblPtr == (Tcl_HashTable *) NULL) { - hTblPtr = (Tcl_HashTable *) ckalloc((unsigned) sizeof(Tcl_HashTable)); - Tcl_InitHashTable(hTblPtr, TCL_ONE_WORD_KEYS); - (void) Tcl_SetAssocData(interp, "tclTCPAcceptCallbacks", - TcpAcceptCallbacksDeleteProc, (ClientData) hTblPtr); - } - hPtr = Tcl_CreateHashEntry(hTblPtr, (char *) acceptCallbackPtr, &new); - if (!new) { - panic("RegisterTcpServerCleanup: damaged accept record table"); - } - Tcl_SetHashValue(hPtr, (ClientData) acceptCallbackPtr); -} - -/* - *---------------------------------------------------------------------- - * - * UnregisterTcpServerInterpCleanupProc -- - * - * Unregister a previously registered accept callback record. The - * interp field of this record will no longer be set to NULL in - * the future when the interpreter is deleted. - * - * Results: - * None. - * - * Side effects: - * Prevents the interp field of the accept callback record from - * being set to NULL in the future when the interpreter is deleted. - * - *---------------------------------------------------------------------- - */ - -static void -UnregisterTcpServerInterpCleanupProc(interp, acceptCallbackPtr) - Tcl_Interp *interp; /* Interpreter in which the accept callback - * record was registered. */ - AcceptCallback *acceptCallbackPtr; - /* The record for which to delete the - * registration. */ -{ - Tcl_HashTable *hTblPtr; - Tcl_HashEntry *hPtr; - - hTblPtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, - "tclTCPAcceptCallbacks", NULL); - if (hTblPtr == (Tcl_HashTable *) NULL) { - return; - } - hPtr = Tcl_FindHashEntry(hTblPtr, (char *) acceptCallbackPtr); - if (hPtr == (Tcl_HashEntry *) NULL) { - return; - } - Tcl_DeleteHashEntry(hPtr); -} - -/* - *---------------------------------------------------------------------- - * - * AcceptCallbackProc -- - * - * This callback is invoked by the TCP channel driver when it - * accepts a new connection from a client on a server socket. - * - * Results: - * None. - * - * Side effects: - * Whatever the script does. - * - *---------------------------------------------------------------------- - */ - -static void -AcceptCallbackProc(callbackData, chan, address, port) - ClientData callbackData; /* The data stored when the callback - * was created in the call to - * Tcl_OpenTcpServer. */ - Tcl_Channel chan; /* Channel for the newly accepted - * connection. */ - char *address; /* Address of client that was - * accepted. */ - int port; /* Port of client that was accepted. */ -{ - AcceptCallback *acceptCallbackPtr; - Tcl_Interp *interp; - char *script; - char portBuf[TCL_INTEGER_SPACE]; - int result; - - acceptCallbackPtr = (AcceptCallback *) callbackData; - - /* - * Check if the callback is still valid; the interpreter may have gone - * away, this is signalled by setting the interp field of the callback - * data to NULL. - */ - - if (acceptCallbackPtr->interp != (Tcl_Interp *) NULL) { - - script = acceptCallbackPtr->script; - interp = acceptCallbackPtr->interp; - - Tcl_Preserve((ClientData) script); - Tcl_Preserve((ClientData) interp); - - TclFormatInt(portBuf, port); - Tcl_RegisterChannel(interp, chan); - - /* - * Artificially bump the refcount to protect the channel from - * being deleted while the script is being evaluated. - */ - - Tcl_RegisterChannel((Tcl_Interp *) NULL, chan); - - result = Tcl_VarEval(interp, script, " ", Tcl_GetChannelName(chan), - " ", address, " ", portBuf, (char *) NULL); - if (result != TCL_OK) { - Tcl_BackgroundError(interp); - Tcl_UnregisterChannel(interp, chan); - } - - /* - * Decrement the artificially bumped refcount. After this it is - * not safe anymore to use "chan", because it may now be deleted. - */ - - Tcl_UnregisterChannel((Tcl_Interp *) NULL, chan); - - Tcl_Release((ClientData) interp); - Tcl_Release((ClientData) script); - } else { - - /* - * The interpreter has been deleted, so there is no useful - * way to utilize the client socket - just close it. - */ - - Tcl_Close((Tcl_Interp *) NULL, chan); - } -} - -/* - *---------------------------------------------------------------------- - * - * TcpServerCloseProc -- - * - * This callback is called when the TCP server channel for which it - * was registered is being closed. It informs the interpreter in - * which the accept script is evaluated (if that interpreter still - * exists) that this channel no longer needs to be informed if the - * interpreter is deleted. - * - * Results: - * None. - * - * Side effects: - * In the future, if the interpreter is deleted this channel will - * no longer be informed. - * - *---------------------------------------------------------------------- - */ - -static void -TcpServerCloseProc(callbackData) - ClientData callbackData; /* The data passed in the call to - * Tcl_CreateCloseHandler. */ -{ - AcceptCallback *acceptCallbackPtr; - /* The actual data. */ - - acceptCallbackPtr = (AcceptCallback *) callbackData; - if (acceptCallbackPtr->interp != (Tcl_Interp *) NULL) { - UnregisterTcpServerInterpCleanupProc(acceptCallbackPtr->interp, - acceptCallbackPtr); - } - Tcl_EventuallyFree((ClientData) acceptCallbackPtr->script, TCL_DYNAMIC); - ckfree((char *) acceptCallbackPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SocketObjCmd -- - * - * This procedure is invoked to process the "socket" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates a socket based channel. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_SocketObjCmd(notUsed, interp, objc, objv) - ClientData notUsed; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - static char *socketOptions[] = { - "-async", "-myaddr", "-myport","-server", (char *) NULL - }; - enum socketOptions { - SKT_ASYNC, SKT_MYADDR, SKT_MYPORT, SKT_SERVER - }; - int optionIndex, a, server, port; - char *arg, *copyScript, *host, *script; - char *myaddr = NULL; - int myport = 0; - int async = 0; - Tcl_Channel chan; - AcceptCallback *acceptCallbackPtr; - - server = 0; - script = NULL; - - if (TclpHasSockets(interp) != TCL_OK) { - return TCL_ERROR; - } - - for (a = 1; a < objc; a++) { - arg = Tcl_GetString(objv[a]); - if (arg[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[a], socketOptions, - "option", TCL_EXACT, &optionIndex) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum socketOptions) optionIndex) { - case SKT_ASYNC: { - if (server == 1) { - Tcl_AppendResult(interp, - "cannot set -async option for server sockets", - (char *) NULL); - return TCL_ERROR; - } - async = 1; - break; - } - case SKT_MYADDR: { - a++; - if (a >= objc) { - Tcl_AppendResult(interp, - "no argument given for -myaddr option", - (char *) NULL); - return TCL_ERROR; - } - myaddr = Tcl_GetString(objv[a]); - break; - } - case SKT_MYPORT: { - char *myPortName; - a++; - if (a >= objc) { - Tcl_AppendResult(interp, - "no argument given for -myport option", - (char *) NULL); - return TCL_ERROR; - } - myPortName = Tcl_GetString(objv[a]); - if (TclSockGetPort(interp, myPortName, "tcp", &myport) - != TCL_OK) { - return TCL_ERROR; - } - break; - } - case SKT_SERVER: { - if (async == 1) { - Tcl_AppendResult(interp, - "cannot set -async option for server sockets", - (char *) NULL); - return TCL_ERROR; - } - server = 1; - a++; - if (a >= objc) { - Tcl_AppendResult(interp, - "no argument given for -server option", - (char *) NULL); - return TCL_ERROR; - } - script = Tcl_GetString(objv[a]); - break; - } - default: { - panic("Tcl_SocketObjCmd: bad option index to SocketOptions"); - } - } - } - if (server) { - host = myaddr; /* NULL implies INADDR_ANY */ - if (myport != 0) { - Tcl_AppendResult(interp, "Option -myport is not valid for servers", - NULL); - return TCL_ERROR; - } - } else if (a < objc) { - host = Tcl_GetString(objv[a]); - a++; - } else { -wrongNumArgs: - Tcl_AppendResult(interp, "wrong # args: should be either:\n", - Tcl_GetString(objv[0]), - " ?-myaddr addr? ?-myport myport? ?-async? host port\n", - Tcl_GetString(objv[0]), - " -server command ?-myaddr addr? port", - (char *) NULL); - return TCL_ERROR; - } - - if (a == objc-1) { - if (TclSockGetPort(interp, Tcl_GetString(objv[a]), - "tcp", &port) != TCL_OK) { - return TCL_ERROR; - } - } else { - goto wrongNumArgs; - } - - if (server) { - acceptCallbackPtr = (AcceptCallback *) ckalloc((unsigned) - sizeof(AcceptCallback)); - copyScript = ckalloc((unsigned) strlen(script) + 1); - strcpy(copyScript, script); - acceptCallbackPtr->script = copyScript; - acceptCallbackPtr->interp = interp; - chan = Tcl_OpenTcpServer(interp, port, host, AcceptCallbackProc, - (ClientData) acceptCallbackPtr); - if (chan == (Tcl_Channel) NULL) { - ckfree(copyScript); - ckfree((char *) acceptCallbackPtr); - return TCL_ERROR; - } - - /* - * Register with the interpreter to let us know when the - * interpreter is deleted (by having the callback set the - * acceptCallbackPtr->interp field to NULL). This is to - * avoid trying to eval the script in a deleted interpreter. - */ - - RegisterTcpServerInterpCleanup(interp, acceptCallbackPtr); - - /* - * Register a close callback. This callback will inform the - * interpreter (if it still exists) that this channel does not - * need to be informed when the interpreter is deleted. - */ - - Tcl_CreateCloseHandler(chan, TcpServerCloseProc, - (ClientData) acceptCallbackPtr); - } else { - chan = Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - } - Tcl_RegisterChannel(interp, chan); - Tcl_AppendResult(interp, Tcl_GetChannelName(chan), (char *) NULL); - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FcopyObjCmd -- - * - * This procedure is invoked to process the "fcopy" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Moves data between two channels and possibly sets up a - * background copy handler. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_FcopyObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Channel inChan, outChan; - char *arg; - int mode, i; - int toRead, index; - Tcl_Obj *cmdPtr; - static char* switches[] = { "-size", "-command", NULL }; - enum { FcopySize, FcopyCommand }; - - if ((objc < 3) || (objc > 7) || (objc == 4) || (objc == 6)) { - Tcl_WrongNumArgs(interp, 1, objv, - "input output ?-size size? ?-command callback?"); - return TCL_ERROR; - } - - /* - * Parse the channel arguments and verify that they are readable - * or writable, as appropriate. - */ - - arg = Tcl_GetString(objv[1]); - inChan = Tcl_GetChannel(interp, arg, &mode); - if (inChan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - if ((mode & TCL_READABLE) == 0) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "channel \"", - Tcl_GetString(objv[1]), - "\" wasn't opened for reading", (char *) NULL); - return TCL_ERROR; - } - arg = Tcl_GetString(objv[2]); - outChan = Tcl_GetChannel(interp, arg, &mode); - if (outChan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - if ((mode & TCL_WRITABLE) == 0) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "channel \"", - Tcl_GetString(objv[1]), - "\" wasn't opened for writing", (char *) NULL); - return TCL_ERROR; - } - - toRead = -1; - cmdPtr = NULL; - for (i = 3; i < objc; i += 2) { - if (Tcl_GetIndexFromObj(interp, objv[i], switches, "switch", 0, - (int *) &index) != TCL_OK) { - return TCL_ERROR; - } - switch (index) { - case FcopySize: - if (Tcl_GetIntFromObj(interp, objv[i+1], &toRead) != TCL_OK) { - return TCL_ERROR; - } - break; - case FcopyCommand: - cmdPtr = objv[i+1]; - break; - } - } - - return TclCopyChannel(interp, inChan, outChan, toRead, cmdPtr); -} diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c deleted file mode 100644 index 3fb9e8d..0000000 --- a/generic/tclIOSock.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * tclIOSock.c -- - * - * Common routines used by all socket based channel types. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclIOSock.c,v 1.3 1999/04/16 00:46:47 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - *--------------------------------------------------------------------------- - * - * TclSockGetPort -- - * - * Maps from a string, which could be a service name, to a port. - * Used by socket creation code to get port numbers and resolve - * registered service names to port numbers. - * - * Results: - * A standard Tcl result. On success, the port number is returned - * in portPtr. On failure, an error message is left in the interp's - * result. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -int -TclSockGetPort(interp, string, proto, portPtr) - Tcl_Interp *interp; - char *string; /* Integer or service name */ - char *proto; /* "tcp" or "udp", typically */ - int *portPtr; /* Return port number */ -{ - struct servent *sp; /* Protocol info for named services */ - Tcl_DString ds; - char *native; - - if (Tcl_GetInt(NULL, string, portPtr) != TCL_OK) { - /* - * Don't bother translating 'proto' to native. - */ - - native = Tcl_UtfToExternalDString(NULL, string, -1, &ds); - sp = getservbyname(native, proto); /* INTL: Native. */ - Tcl_DStringFree(&ds); - if (sp != NULL) { - *portPtr = ntohs((unsigned short) sp->s_port); - return TCL_OK; - } - } - if (Tcl_GetInt(interp, string, portPtr) != TCL_OK) { - return TCL_ERROR; - } - if (*portPtr > 0xFFFF) { - Tcl_AppendResult(interp, "couldn't open socket: port number too high", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclSockMinimumBuffers -- - * - * Ensure minimum buffer sizes (non zero). - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Sets SO_SNDBUF and SO_RCVBUF sizes. - * - *---------------------------------------------------------------------- - */ - -int -TclSockMinimumBuffers(sock, size) - int sock; /* Socket file descriptor */ - int size; /* Minimum buffer size */ -{ - int current; - int len; - - len = sizeof(int); - getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)¤t, &len); - if (current < size) { - len = sizeof(int); - setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, len); - } - len = sizeof(int); - getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)¤t, &len); - if (current < size) { - len = sizeof(int); - setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&size, len); - } - return TCL_OK; -} diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c deleted file mode 100644 index 6a00e54..0000000 --- a/generic/tclIOUtil.c +++ /dev/null @@ -1,876 +0,0 @@ -/* - * tclIOUtil.c -- - * - * This file contains a collection of utility procedures that - * are shared by the platform specific IO drivers. - * - * Parts of this file are based on code 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. - * - * RCS: @(#) $Id: tclIOUtil.c,v 1.6 1999/04/16 00:46:47 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * The following typedef declarations allow for hooking into the chain - * of functions maintained for 'Tcl_Stat(...)', 'Tcl_Access(...)' & - * 'Tcl_OpenFileChannel(...)'. Basically for each hookable function - * a linked list is defined. - */ - -typedef struct StatProc { - TclStatProc_ *proc; /* Function to process a 'stat()' call */ - struct StatProc *nextPtr; /* The next 'stat()' function to call */ -} StatProc; - -typedef struct AccessProc { - TclAccessProc_ *proc; /* Function to process a 'access()' call */ - struct AccessProc *nextPtr; /* The next 'access()' function to call */ -} AccessProc; - -typedef struct OpenFileChannelProc { - TclOpenFileChannelProc_ *proc; /* Function to process a - * 'Tcl_OpenFileChannel()' call */ - struct OpenFileChannelProc *nextPtr; - /* The next 'Tcl_OpenFileChannel()' - * function to call */ -} OpenFileChannelProc; - -/* - * For each type of hookable function, a static node is declared to - * hold the function pointer for the "built-in" routine (e.g. - * 'TclpStat(...)') and the respective list is initialized as a pointer - * to that node. - * - * The "delete" functions (e.g. 'TclStatDeleteProc(...)') ensure that - * these statically declared list entry cannot be inadvertently removed. - * - * This method avoids the need to call any sort of "initialization" - * function. - * - * All three lists are protected by a global hookMutex. - */ - -static StatProc defaultStatProc = { - &TclpStat, NULL -}; -static StatProc *statProcList = &defaultStatProc; - -static AccessProc defaultAccessProc = { - &TclpAccess, NULL -}; -static AccessProc *accessProcList = &defaultAccessProc; - -static OpenFileChannelProc defaultOpenFileChannelProc = { - &TclpOpenFileChannel, NULL -}; -static OpenFileChannelProc *openFileChannelProcList = - &defaultOpenFileChannelProc; - -TCL_DECLARE_MUTEX(hookMutex) - -/* - *--------------------------------------------------------------------------- - * - * TclGetOpenMode -- - * - * Description: - * Computes a POSIX mode mask for opening a file, from a given string, - * and also sets a flag to indicate whether the caller should seek to - * EOF after opening the file. - * - * Results: - * On success, returns mode to pass to "open". If an error occurs, the - * return value is -1 and if interp is not NULL, sets interp's result - * object to an error message. - * - * Side effects: - * Sets the integer referenced by seekFlagPtr to 1 to tell the caller - * to seek to EOF after opening the file. - * - * Special note: - * This code is based on a prototype implementation contributed - * by Mark Diekhans. - * - *--------------------------------------------------------------------------- - */ - -int -TclGetOpenMode(interp, string, seekFlagPtr) - Tcl_Interp *interp; /* Interpreter to use for error - * reporting - may be NULL. */ - char *string; /* Mode string, e.g. "r+" or - * "RDONLY CREAT". */ - int *seekFlagPtr; /* Set this to 1 if the caller - * should seek to EOF during the - * opening of the file. */ -{ - int mode, modeArgc, c, i, gotRW; - char **modeArgv, *flag; -#define RW_MODES (O_RDONLY|O_WRONLY|O_RDWR) - - /* - * Check for the simpler fopen-like access modes (e.g. "r"). They - * are distinguished from the POSIX access modes by the presence - * of a lower-case first letter. - */ - - *seekFlagPtr = 0; - mode = 0; - - /* - * Guard against international characters before using byte oriented - * routines. - */ - - if (!(string[0] & 0x80) - && islower(UCHAR(string[0]))) { /* INTL: ISO only. */ - switch (string[0]) { - case 'r': - mode = O_RDONLY; - break; - case 'w': - mode = O_WRONLY|O_CREAT|O_TRUNC; - break; - case 'a': - mode = O_WRONLY|O_CREAT; - *seekFlagPtr = 1; - break; - default: - error: - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, - "illegal access mode \"", string, "\"", - (char *) NULL); - } - return -1; - } - if (string[1] == '+') { - mode &= ~(O_RDONLY|O_WRONLY); - mode |= O_RDWR; - if (string[2] != 0) { - goto error; - } - } else if (string[1] != 0) { - goto error; - } - return mode; - } - - /* - * The access modes are specified using a list of POSIX modes - * such as O_CREAT. - * - * IMPORTANT NOTE: We rely on Tcl_SplitList working correctly when - * a NULL interpreter is passed in. - */ - - if (Tcl_SplitList(interp, string, &modeArgc, &modeArgv) != TCL_OK) { - if (interp != (Tcl_Interp *) NULL) { - Tcl_AddErrorInfo(interp, - "\n while processing open access modes \""); - Tcl_AddErrorInfo(interp, string); - Tcl_AddErrorInfo(interp, "\""); - } - return -1; - } - - gotRW = 0; - for (i = 0; i < modeArgc; i++) { - flag = modeArgv[i]; - c = flag[0]; - if ((c == 'R') && (strcmp(flag, "RDONLY") == 0)) { - mode = (mode & ~RW_MODES) | O_RDONLY; - gotRW = 1; - } else if ((c == 'W') && (strcmp(flag, "WRONLY") == 0)) { - mode = (mode & ~RW_MODES) | O_WRONLY; - gotRW = 1; - } else if ((c == 'R') && (strcmp(flag, "RDWR") == 0)) { - mode = (mode & ~RW_MODES) | O_RDWR; - gotRW = 1; - } else if ((c == 'A') && (strcmp(flag, "APPEND") == 0)) { - mode |= O_APPEND; - *seekFlagPtr = 1; - } else if ((c == 'C') && (strcmp(flag, "CREAT") == 0)) { - mode |= O_CREAT; - } else if ((c == 'E') && (strcmp(flag, "EXCL") == 0)) { - mode |= O_EXCL; - } else if ((c == 'N') && (strcmp(flag, "NOCTTY") == 0)) { -#ifdef O_NOCTTY - mode |= O_NOCTTY; -#else - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "access mode \"", flag, - "\" not supported by this system", (char *) NULL); - } - ckfree((char *) modeArgv); - return -1; -#endif - } else if ((c == 'N') && (strcmp(flag, "NONBLOCK") == 0)) { -#if defined(O_NDELAY) || defined(O_NONBLOCK) -# ifdef O_NONBLOCK - mode |= O_NONBLOCK; -# else - mode |= O_NDELAY; -# endif -#else - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "access mode \"", flag, - "\" not supported by this system", (char *) NULL); - } - ckfree((char *) modeArgv); - return -1; -#endif - } else if ((c == 'T') && (strcmp(flag, "TRUNC") == 0)) { - mode |= O_TRUNC; - } else { - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "invalid access mode \"", flag, - "\": must be RDONLY, WRONLY, RDWR, APPEND, CREAT", - " EXCL, NOCTTY, NONBLOCK, or TRUNC", (char *) NULL); - } - ckfree((char *) modeArgv); - return -1; - } - } - ckfree((char *) modeArgv); - if (!gotRW) { - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "access mode must include either", - " RDONLY, WRONLY, or RDWR", (char *) NULL); - } - return -1; - } - return mode; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EvalFile -- - * - * Read in a file and process the entire file as one gigantic - * Tcl command. - * - * Results: - * A standard Tcl result, which is either the result of executing - * the file or an error indicating why the file couldn't be read. - * - * Side effects: - * Depends on the commands in the file. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_EvalFile(interp, fileName) - Tcl_Interp *interp; /* Interpreter in which to process file. */ - char *fileName; /* Name of file to process. Tilde-substitution - * will be performed on this name. */ -{ - int result, length; - struct stat statBuf; - char *oldScriptFile; - Interp *iPtr; - Tcl_DString nameString; - char *name, *string; - Tcl_Channel chan; - Tcl_Obj *objPtr; - - name = Tcl_TranslateFileName(interp, fileName, &nameString); - if (name == NULL) { - return TCL_ERROR; - } - - result = TCL_ERROR; - objPtr = Tcl_NewObj(); - - if (TclStat(name, &statBuf) == -1) { - Tcl_SetErrno(errno); - Tcl_AppendResult(interp, "couldn't read file \"", fileName, - "\": ", Tcl_PosixError(interp), (char *) NULL); - goto end; - } - chan = Tcl_OpenFileChannel(interp, name, "r", 0644); - if (chan == (Tcl_Channel) NULL) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "couldn't read file \"", fileName, - "\": ", Tcl_PosixError(interp), (char *) NULL); - goto end; - } - if (Tcl_ReadChars(chan, objPtr, -1, 0) < 0) { - Tcl_Close(interp, chan); - Tcl_AppendResult(interp, "couldn't read file \"", fileName, - "\": ", Tcl_PosixError(interp), (char *) NULL); - goto end; - } - if (Tcl_Close(interp, chan) != TCL_OK) { - goto end; - } - - iPtr = (Interp *) interp; - oldScriptFile = iPtr->scriptFile; - iPtr->scriptFile = fileName; - string = Tcl_GetStringFromObj(objPtr, &length); - result = Tcl_EvalEx(interp, string, length, 0); - iPtr->scriptFile = oldScriptFile; - - if (result == TCL_RETURN) { - result = TclUpdateReturnInfo(iPtr); - } else if (result == TCL_ERROR) { - char msg[200 + TCL_INTEGER_SPACE]; - - /* - * Record information telling where the error occurred. - */ - - sprintf(msg, "\n (file \"%.150s\" line %d)", fileName, - interp->errorLine); - Tcl_AddErrorInfo(interp, msg); - } - - end: - Tcl_DecrRefCount(objPtr); - Tcl_DStringFree(&nameString); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetErrno -- - * - * Gets the current value of the Tcl error code variable. This is - * currently the global variable "errno" but could in the future - * change to something else. - * - * Results: - * The value of the Tcl error code variable. - * - * Side effects: - * None. Note that the value of the Tcl error code variable is - * UNDEFINED if a call to Tcl_SetErrno did not precede this call. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetErrno() -{ - return errno; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetErrno -- - * - * Sets the Tcl error code variable to the supplied value. - * - * Results: - * None. - * - * Side effects: - * Modifies the value of the Tcl error code variable. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetErrno(err) - int err; /* The new value. */ -{ - errno = err; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PosixError -- - * - * This procedure is typically called after UNIX kernel calls - * return errors. It stores machine-readable information about - * the error in $errorCode returns an information string for - * the caller's use. - * - * Results: - * The return value is a human-readable string describing the - * error. - * - * Side effects: - * The global variable $errorCode is reset. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_PosixError(interp) - Tcl_Interp *interp; /* Interpreter whose $errorCode variable - * is to be changed. */ -{ - char *id, *msg; - - msg = Tcl_ErrnoMsg(errno); - id = Tcl_ErrnoId(); - Tcl_SetErrorCode(interp, "POSIX", id, msg, (char *) NULL); - return msg; -} - -/* - *---------------------------------------------------------------------- - * - * TclStat -- - * - * This procedure replaces the library version of stat and lsat. - * The chain of functions that have been "inserted" into the - * 'statProcList' will be called in succession until either - * a value of zero is returned, or the entire list is visited. - * - * Results: - * See stat documentation. - * - * Side effects: - * See stat documentation. - * - *---------------------------------------------------------------------- - */ - -int -TclStat(path, buf) - CONST char *path; /* Path of file to stat (in current CP). */ - TclStat_ *buf; /* Filled with results of stat call. */ -{ - StatProc *statProcPtr; - int retVal = -1; - - /* - * Call each of the "stat" function in succession. A non-return - * value of -1 indicates the particular function has succeeded. - */ - - Tcl_MutexLock(&hookMutex); - statProcPtr = statProcList; - while ((retVal == -1) && (statProcPtr != NULL)) { - retVal = (*statProcPtr->proc)(path, buf); - statProcPtr = statProcPtr->nextPtr; - } - Tcl_MutexUnlock(&hookMutex); - - return (retVal); -} - -/* - *---------------------------------------------------------------------- - * - * TclAccess -- - * - * This procedure replaces the library version of access. - * The chain of functions that have been "inserted" into the - * 'accessProcList' will be called in succession until either - * a value of zero is returned, or the entire list is visited. - * - * Results: - * See access documentation. - * - * Side effects: - * See access documentation. - * - *---------------------------------------------------------------------- - */ - -int -TclAccess(path, mode) - CONST char *path; /* Path of file to access (in current CP). */ - int mode; /* Permission setting. */ -{ - AccessProc *accessProcPtr; - int retVal = -1; - - /* - * Call each of the "access" function in succession. A non-return - * value of -1 indicates the particular function has succeeded. - */ - - Tcl_MutexLock(&hookMutex); - accessProcPtr = accessProcList; - while ((retVal == -1) && (accessProcPtr != NULL)) { - retVal = (*accessProcPtr->proc)(path, mode); - accessProcPtr = accessProcPtr->nextPtr; - } - Tcl_MutexUnlock(&hookMutex); - - return (retVal); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_OpenFileChannel -- - * - * The chain of functions that have been "inserted" into the - * 'openFileChannelProcList' will be called in succession until - * either a valid file channel is returned, or the entire list is - * visited. - * - * Results: - * The new channel or NULL, if the named file could not be opened. - * - * Side effects: - * May open the channel and may cause creation of a file on the - * file system. - * - *---------------------------------------------------------------------- - */ - -Tcl_Channel -Tcl_OpenFileChannel(interp, fileName, modeString, permissions) - Tcl_Interp *interp; /* Interpreter for error reporting; - * can be NULL. */ - char *fileName; /* Name of file to open. */ - char *modeString; /* A list of POSIX open modes or - * a string such as "rw". */ - int permissions; /* If the open involves creating a - * file, with what modes to create - * it? */ -{ - OpenFileChannelProc *openFileChannelProcPtr; - Tcl_Channel retVal = NULL; - - /* - * Call each of the "Tcl_OpenFileChannel" function in succession. - * A non-NULL return value indicates the particular function has - * succeeded. - */ - - Tcl_MutexLock(&hookMutex); - openFileChannelProcPtr = openFileChannelProcList; - while ((retVal == NULL) && (openFileChannelProcPtr != NULL)) { - retVal = (*openFileChannelProcPtr->proc)(interp, fileName, - modeString, permissions); - openFileChannelProcPtr = openFileChannelProcPtr->nextPtr; - } - Tcl_MutexUnlock(&hookMutex); - - return (retVal); -} - -/* - *---------------------------------------------------------------------- - * - * TclStatInsertProc -- - * - * Insert the passed procedure pointer at the head of the list of - * functions which are used during a call to 'TclStat(...)'. The - * passed function should be have exactly like 'TclStat' when called - * during that time (see 'TclStat(...)' for more informatin). - * The function will be added even if it already in the list. - * - * Results: - * Normally TCL_OK; TCL_ERROR if memory for a new node in the list - * could not be allocated. - * - * Side effects: - * Memory allocataed and modifies the link list for 'TclStat' - * functions. - * - *---------------------------------------------------------------------- - */ - -int -TclStatInsertProc (proc) - TclStatProc_ *proc; -{ - int retVal = TCL_ERROR; - - if (proc != NULL) { - StatProc *newStatProcPtr; - - newStatProcPtr = (StatProc *)Tcl_Alloc(sizeof(StatProc));; - - if (newStatProcPtr != NULL) { - newStatProcPtr->proc = proc; - Tcl_MutexLock(&hookMutex); - newStatProcPtr->nextPtr = statProcList; - statProcList = newStatProcPtr; - Tcl_MutexUnlock(&hookMutex); - - retVal = TCL_OK; - } - } - - return (retVal); -} - -/* - *---------------------------------------------------------------------- - * - * TclStatDeleteProc -- - * - * Removed the passed function pointer from the list of 'TclStat' - * functions. Ensures that the built-in stat function is not - * removvable. - * - * Results: - * TCL_OK if the procedure pointer was successfully removed, - * TCL_ERROR otherwise. - * - * Side effects: - * Memory is deallocated and the respective list updated. - * - *---------------------------------------------------------------------- - */ - -int -TclStatDeleteProc (proc) - TclStatProc_ *proc; -{ - int retVal = TCL_ERROR; - StatProc *tmpStatProcPtr; - StatProc *prevStatProcPtr = NULL; - - Tcl_MutexLock(&hookMutex); - tmpStatProcPtr = statProcList; - /* - * Traverse the 'statProcList' looking for the particular node - * whose 'proc' member matches 'proc' and remove that one from - * the list. Ensure that the "default" node cannot be removed. - */ - - while ((retVal == TCL_ERROR) && (tmpStatProcPtr != &defaultStatProc)) { - if (tmpStatProcPtr->proc == proc) { - if (prevStatProcPtr == NULL) { - statProcList = tmpStatProcPtr->nextPtr; - } else { - prevStatProcPtr->nextPtr = tmpStatProcPtr->nextPtr; - } - - Tcl_Free((char *)tmpStatProcPtr); - - retVal = TCL_OK; - } else { - prevStatProcPtr = tmpStatProcPtr; - tmpStatProcPtr = tmpStatProcPtr->nextPtr; - } - } - - Tcl_MutexUnlock(&hookMutex); - return (retVal); -} - -/* - *---------------------------------------------------------------------- - * - * TclAccessInsertProc -- - * - * Insert the passed procedure pointer at the head of the list of - * functions which are used during a call to 'TclAccess(...)'. The - * passed function should be have exactly like 'TclAccess' when - * called during that time (see 'TclAccess(...)' for more informatin). - * The function will be added even if it already in the list. - * - * Results: - * Normally TCL_OK; TCL_ERROR if memory for a new node in the list - * could not be allocated. - * - * Side effects: - * Memory allocataed and modifies the link list for 'TclAccess' - * functions. - * - *---------------------------------------------------------------------- - */ - -int -TclAccessInsertProc(proc) - TclAccessProc_ *proc; -{ - int retVal = TCL_ERROR; - - if (proc != NULL) { - AccessProc *newAccessProcPtr; - - newAccessProcPtr = (AccessProc *)Tcl_Alloc(sizeof(AccessProc));; - - if (newAccessProcPtr != NULL) { - newAccessProcPtr->proc = proc; - Tcl_MutexLock(&hookMutex); - newAccessProcPtr->nextPtr = accessProcList; - accessProcList = newAccessProcPtr; - Tcl_MutexUnlock(&hookMutex); - - retVal = TCL_OK; - } - } - - return (retVal); -} - -/* - *---------------------------------------------------------------------- - * - * TclAccessDeleteProc -- - * - * Removed the passed function pointer from the list of 'TclAccess' - * functions. Ensures that the built-in access function is not - * removvable. - * - * Results: - * TCL_OK if the procedure pointer was successfully removed, - * TCL_ERROR otherwise. - * - * Side effects: - * Memory is deallocated and the respective list updated. - * - *---------------------------------------------------------------------- - */ - -int -TclAccessDeleteProc(proc) - TclAccessProc_ *proc; -{ - int retVal = TCL_ERROR; - AccessProc *tmpAccessProcPtr; - AccessProc *prevAccessProcPtr = NULL; - - /* - * Traverse the 'accessProcList' looking for the particular node - * whose 'proc' member matches 'proc' and remove that one from - * the list. Ensure that the "default" node cannot be removed. - */ - - Tcl_MutexLock(&hookMutex); - tmpAccessProcPtr = accessProcList; - while ((retVal == TCL_ERROR) && (tmpAccessProcPtr != &defaultAccessProc)) { - if (tmpAccessProcPtr->proc == proc) { - if (prevAccessProcPtr == NULL) { - accessProcList = tmpAccessProcPtr->nextPtr; - } else { - prevAccessProcPtr->nextPtr = tmpAccessProcPtr->nextPtr; - } - - Tcl_Free((char *)tmpAccessProcPtr); - - retVal = TCL_OK; - } else { - prevAccessProcPtr = tmpAccessProcPtr; - tmpAccessProcPtr = tmpAccessProcPtr->nextPtr; - } - } - Tcl_MutexUnlock(&hookMutex); - - return (retVal); -} - -/* - *---------------------------------------------------------------------- - * - * TclOpenFileChannelInsertProc -- - * - * Insert the passed procedure pointer at the head of the list of - * functions which are used during a call to - * 'Tcl_OpenFileChannel(...)'. The passed function should be have - * exactly like 'Tcl_OpenFileChannel' when called during that time - * (see 'Tcl_OpenFileChannel(...)' for more informatin). The - * function will be added even if it already in the list. - * - * Results: - * Normally TCL_OK; TCL_ERROR if memory for a new node in the list - * could not be allocated. - * - * Side effects: - * Memory allocataed and modifies the link list for - * 'Tcl_OpenFileChannel' functions. - * - *---------------------------------------------------------------------- - */ - -int -TclOpenFileChannelInsertProc(proc) - TclOpenFileChannelProc_ *proc; -{ - int retVal = TCL_ERROR; - - if (proc != NULL) { - OpenFileChannelProc *newOpenFileChannelProcPtr; - - newOpenFileChannelProcPtr = - (OpenFileChannelProc *)Tcl_Alloc(sizeof(OpenFileChannelProc));; - - if (newOpenFileChannelProcPtr != NULL) { - newOpenFileChannelProcPtr->proc = proc; - Tcl_MutexLock(&hookMutex); - newOpenFileChannelProcPtr->nextPtr = openFileChannelProcList; - openFileChannelProcList = newOpenFileChannelProcPtr; - Tcl_MutexUnlock(&hookMutex); - - retVal = TCL_OK; - } - } - - return (retVal); -} - -/* - *---------------------------------------------------------------------- - * - * TclOpenFileChannelDeleteProc -- - * - * Removed the passed function pointer from the list of - * 'Tcl_OpenFileChannel' functions. Ensures that the built-in - * open file channel function is not removvable. - * - * Results: - * TCL_OK if the procedure pointer was successfully removed, - * TCL_ERROR otherwise. - * - * Side effects: - * Memory is deallocated and the respective list updated. - * - *---------------------------------------------------------------------- - */ - -int -TclOpenFileChannelDeleteProc(proc) - TclOpenFileChannelProc_ *proc; -{ - int retVal = TCL_ERROR; - OpenFileChannelProc *tmpOpenFileChannelProcPtr = openFileChannelProcList; - OpenFileChannelProc *prevOpenFileChannelProcPtr = NULL; - - /* - * Traverse the 'openFileChannelProcList' looking for the particular - * node whose 'proc' member matches 'proc' and remove that one from - * the list. Ensure that the "default" node cannot be removed. - */ - - Tcl_MutexLock(&hookMutex); - tmpOpenFileChannelProcPtr = openFileChannelProcList; - while ((retVal == TCL_ERROR) && - (tmpOpenFileChannelProcPtr != &defaultOpenFileChannelProc)) { - if (tmpOpenFileChannelProcPtr->proc == proc) { - if (prevOpenFileChannelProcPtr == NULL) { - openFileChannelProcList = tmpOpenFileChannelProcPtr->nextPtr; - } else { - prevOpenFileChannelProcPtr->nextPtr = - tmpOpenFileChannelProcPtr->nextPtr; - } - - Tcl_Free((char *)tmpOpenFileChannelProcPtr); - - retVal = TCL_OK; - } else { - prevOpenFileChannelProcPtr = tmpOpenFileChannelProcPtr; - tmpOpenFileChannelProcPtr = tmpOpenFileChannelProcPtr->nextPtr; - } - } - Tcl_MutexUnlock(&hookMutex); - - return (retVal); -} diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c deleted file mode 100644 index 5acb6c5..0000000 --- a/generic/tclIndexObj.c +++ /dev/null @@ -1,332 +0,0 @@ -/* - * tclIndexObj.c -- - * - * This file implements objects of type "index". This object type - * is used to lookup a keyword in a table of valid values and cache - * the index of the matching entry. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclIndexObj.c,v 1.3 1999/04/16 00:46:47 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * Prototypes for procedures defined later in this file: - */ - -static int SetIndexFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); - -/* - * The structure below defines the index Tcl object type by means of - * procedures that can be invoked by generic object code. - */ - -Tcl_ObjType tclIndexType = { - "index", /* name */ - (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */ - (Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */ - (Tcl_UpdateStringProc *) NULL, /* updateStringProc */ - SetIndexFromAny /* setFromAnyProc */ -}; - -/* - * Boolean flag indicating whether or not the tclIndexType object - * type has been registered with the Tcl compiler. - */ - -static int indexTypeInitialized = 0; - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetIndexFromObj -- - * - * This procedure looks up an object's value in a table of strings - * and returns the index of the matching string, if any. - * - * Results: - * - * If the value of objPtr is identical to or a unique abbreviation - * for one of the entries in objPtr, then the return value is - * TCL_OK and the index of the matching entry is stored at - * *indexPtr. If there isn't a proper match, then TCL_ERROR is - * returned and an error message is left in interp's result (unless - * interp is NULL). The msg argument is used in the error - * message; for example, if msg has the value "option" then the - * error message will say something flag 'bad option "foo": must be - * ...' - * - * Side effects: - * The result of the lookup is cached as the internal rep of - * objPtr, so that repeated lookups can be done quickly. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr; /* Object containing the string to lookup. */ - char **tablePtr; /* Array of strings to compare against the - * value of objPtr; last entry must be NULL - * and there must not be duplicate entries. */ - char *msg; /* Identifying word to use in error messages. */ - int flags; /* 0 or TCL_EXACT */ - int *indexPtr; /* Place to store resulting integer index. */ -{ - - /* - * See if there is a valid cached result from a previous lookup - * (doing the check here saves the overhead of calling - * Tcl_GetIndexFromObjStruct in the common case where the result - * is cached). - */ - - if ((objPtr->typePtr == &tclIndexType) - && (objPtr->internalRep.twoPtrValue.ptr1 == (VOID *) tablePtr)) { - *indexPtr = (int) objPtr->internalRep.twoPtrValue.ptr2; - return TCL_OK; - } - return Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, sizeof(char *), - msg, flags, indexPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetIndexFromObjStruct -- - * - * This procedure looks up an object's value given a starting - * string and an offset for the amount of space between strings. - * This is useful when the strings are embedded in some other - * kind of array. - * - * Results: - * - * If the value of objPtr is identical to or a unique abbreviation - * for one of the entries in objPtr, then the return value is - * TCL_OK and the index of the matching entry is stored at - * *indexPtr. If there isn't a proper match, then TCL_ERROR is - * returned and an error message is left in interp's result (unless - * interp is NULL). The msg argument is used in the error - * message; for example, if msg has the value "option" then the - * error message will say something flag 'bad option "foo": must be - * ...' - * - * Side effects: - * The result of the lookup is cached as the internal rep of - * objPtr, so that repeated lookups can be done quickly. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, - indexPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr; /* Object containing the string to lookup. */ - char **tablePtr; /* The first string in the table. The second - * string will be at this address plus the - * offset, the third plus the offset again, - * etc. The last entry must be NULL - * and there must not be duplicate entries. */ - int offset; /* The number of bytes between entries */ - char *msg; /* Identifying word to use in error messages. */ - int flags; /* 0 or TCL_EXACT */ - int *indexPtr; /* Place to store resulting integer index. */ -{ - int index, length, i, numAbbrev; - char *key, *p1, *p2, **entryPtr; - Tcl_Obj *resultPtr; - - /* - * See if there is a valid cached result from a previous lookup. - */ - - if ((objPtr->typePtr == &tclIndexType) - && (objPtr->internalRep.twoPtrValue.ptr1 == (VOID *) tablePtr)) { - *indexPtr = (int) objPtr->internalRep.twoPtrValue.ptr2; - return TCL_OK; - } - - /* - * Lookup the value of the object in the table. Accept unique - * abbreviations unless TCL_EXACT is set in flags. - */ - - if (!indexTypeInitialized) { - /* - * This is the first time we've done a lookup. Register the - * tclIndexType. - */ - - Tcl_RegisterObjType(&tclIndexType); - indexTypeInitialized = 1; - } - - key = Tcl_GetStringFromObj(objPtr, &length); - index = -1; - numAbbrev = 0; - for (entryPtr = tablePtr, i = 0; *entryPtr != NULL; - entryPtr = (char **) ((long) entryPtr + offset), i++) { - for (p1 = key, p2 = *entryPtr; *p1 == *p2; p1++, p2++) { - if (*p1 == 0) { - index = i; - goto done; - } - } - if (*p1 == 0) { - /* - * The value is an abbreviation for this entry. Continue - * checking other entries to make sure it's unique. If we - * get more than one unique abbreviation, keep searching to - * see if there is an exact match, but remember the number - * of unique abbreviations and don't allow either. - */ - - numAbbrev++; - index = i; - } - } - if ((flags & TCL_EXACT) || (numAbbrev != 1)) { - goto error; - } - - done: - if ((objPtr->typePtr != NULL) - && (objPtr->typePtr->freeIntRepProc != NULL)) { - objPtr->typePtr->freeIntRepProc(objPtr); - } - objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tablePtr; - objPtr->internalRep.twoPtrValue.ptr2 = (VOID *) index; - objPtr->typePtr = &tclIndexType; - *indexPtr = index; - return TCL_OK; - - error: - if (interp != NULL) { - int count; - resultPtr = Tcl_GetObjResult(interp); - Tcl_AppendStringsToObj(resultPtr, - (numAbbrev > 1) ? "ambiguous " : "bad ", msg, " \"", - key, "\": must be ", *tablePtr, (char *) NULL); - for (entryPtr = (char **) ((long) tablePtr + offset), count = 0; - *entryPtr != NULL; - entryPtr = (char **) ((long) entryPtr + offset), count++) { - if ((*((char **) ((long) entryPtr + offset))) == NULL) { - Tcl_AppendStringsToObj(resultPtr, - (count > 0) ? ", or " : " or ", *entryPtr, - (char *) NULL); - } else { - Tcl_AppendStringsToObj(resultPtr, ", ", *entryPtr, - (char *) NULL); - } - } - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * SetIndexFromAny -- - * - * This procedure is called to convert a Tcl object to index - * internal form. However, this doesn't make sense (need to have a - * table of keywords in order to do the conversion) so the - * procedure always generates an error. - * - * Results: - * The return value is always TCL_ERROR, and an error message is - * left in interp's result if interp isn't NULL. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -SetIndexFromAny(interp, objPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object to convert. */ -{ - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "can't convert value to index except via Tcl_GetIndexFromObj API", - -1); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_WrongNumArgs -- - * - * This procedure generates a "wrong # args" error message in an - * interpreter. It is used as a utility function by many command - * procedures. - * - * Results: - * None. - * - * Side effects: - * An error message is generated in interp's result object to - * indicate that a command was invoked with the wrong number of - * arguments. The message has the form - * wrong # args: should be "foo bar additional stuff" - * where "foo" and "bar" are the initial objects in objv (objc - * determines how many of these are printed) and "additional stuff" - * is the contents of the message argument. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_WrongNumArgs(interp, objc, objv, message) - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments to print - * from objv. */ - Tcl_Obj *CONST objv[]; /* Initial argument objects, which - * should be included in the error - * message. */ - char *message; /* Error message to print after the - * leading objects in objv. The - * message may be NULL. */ -{ - Tcl_Obj *objPtr; - char **tablePtr; - int i; - - objPtr = Tcl_GetObjResult(interp); - Tcl_AppendToObj(objPtr, "wrong # args: should be \"", -1); - for (i = 0; i < objc; i++) { - /* - * If the object is an index type use the index table which allows - * for the correct error message even if the subcommand was - * abbreviated. Otherwise, just use the string rep. - */ - - if (objv[i]->typePtr == &tclIndexType) { - tablePtr = ((char **) objv[i]->internalRep.twoPtrValue.ptr1); - Tcl_AppendStringsToObj(objPtr, - tablePtr[(int) objv[i]->internalRep.twoPtrValue.ptr2], - (char *) NULL); - } else { - Tcl_AppendStringsToObj(objPtr, Tcl_GetString(objv[i]), - (char *) NULL); - } - if (i < (objc - 1)) { - Tcl_AppendStringsToObj(objPtr, " ", (char *) NULL); - } - } - if (message) { - Tcl_AppendStringsToObj(objPtr, " ", message, (char *) NULL); - } - Tcl_AppendStringsToObj(objPtr, "\"", (char *) NULL); -} diff --git a/generic/tclInitScript.h b/generic/tclInitScript.h deleted file mode 100644 index a1da091..0000000 --- a/generic/tclInitScript.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * tclInitScript.h -- - * - * This file contains Unix & Windows common init script - * It is not used on the Mac. (the mac init script is in tclMacInit.c) - * - * Copyright (c) 1998 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclInitScript.h,v 1.9 1999/04/16 00:46:47 stanton Exp $ - */ - -/* - * The following string is the startup script executed in new - * interpreters. It looks on disk in several different directories - * for a script "init.tcl" that is compatible with this version - * of Tcl. The init.tcl script does all of the real work of - * initialization. - */ - -static char initScript[] = "if {[info proc tclInit]==\"\"} {\n\ - proc tclInit {} {\n\ - global tcl_libPath tcl_library errorInfo\n\ - rename tclInit {}\n\ - set errors {}\n\ - foreach i $tcl_libPath {\n\ - set tcl_library $i\n\ - set tclfile [file join $i init.tcl]\n\ - if {[file exists $tclfile]} {\n\ - if {[catch {uplevel #0 [list source $tclfile]} msg] != 1} {\n\ - return\n\ - } else {\n\ - append errors \"$tclfile: $msg\n$errorInfo\n\"\n\ - }\n\ - }\n\ - }\n\ - set msg \"Can't find a usable init.tcl in the following directories: \n\"\n\ - append msg \" $tcl_libPath\n\n\"\n\ - append msg \"$errors\n\n\"\n\ - append msg \"This probably means that Tcl wasn't installed properly.\n\"\n\ - error $msg\n\ - }\n\ -}\n\ -tclInit"; - - -/* - * A pointer to a string that holds an initialization script that if non-NULL - * is evaluated in Tcl_Init() prior to the the built-in initialization script - * above. This variable can be modified by the procedure below. - */ - -static char * tclPreInitScript = NULL; - - -/* - *---------------------------------------------------------------------- - * - * TclSetPreInitScript -- - * - * This routine is used to change the value of the internal - * variable, tclPreInitScript. - * - * Results: - * Returns the current value of tclPreInitScript. - * - * Side effects: - * Changes the way Tcl_Init() routine behaves. - * - *---------------------------------------------------------------------- - */ - -char * -TclSetPreInitScript (string) - char *string; /* Pointer to a script. */ -{ - char *prevString = tclPreInitScript; - tclPreInitScript = string; - return(prevString); -} diff --git a/generic/tclInt.decls b/generic/tclInt.decls deleted file mode 100644 index b2d1b44..0000000 --- a/generic/tclInt.decls +++ /dev/null @@ -1,778 +0,0 @@ -# tclInt.decls -- -# -# This file contains the declarations for all unsupported -# functions that are exported by the Tcl library. This file -# is used to generate the tclIntDecls.h, tclIntPlatDecls.h, -# tclIntStub.c, tclPlatStub.c, tclCompileDecls.h and tclCompileStub.c -# files -# -# 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. -# -# RCS: @(#) $Id: tclInt.decls,v 1.5 1999/04/16 00:46:47 stanton Exp $ - -library tcl - -# Define the unsupported generic interfaces. - -interface tclInt - -# Declare each of the functions in the unsupported internal Tcl -# interface. These interfaces are allowed to changed between versions. -# Use at your own risk. Note that the position of functions should not -# be changed between versions to avoid gratuitous incompatibilities. - -declare 0 generic { - int TclAccess(CONST char *path, int mode) -} -declare 1 generic { - int TclAccessDeleteProc(TclAccessProc_ *proc) -} -declare 2 generic { - int TclAccessInsertProc(TclAccessProc_ *proc) -} -declare 3 generic { - void TclAllocateFreeObjects(void) -} -# Replaced by TclpChdir in 8.1: -# declare 4 generic { -# int TclChdir(Tcl_Interp *interp, char *dirName) -# } -declare 5 generic { - int TclCleanupChildren(Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, \ - Tcl_Channel errorChan) -} -declare 6 generic { - void TclCleanupCommand(Command *cmdPtr) -} -declare 7 generic { - int TclCopyAndCollapse(int count, CONST char *src, char *dst) -} -declare 8 generic { - int TclCopyChannel(Tcl_Interp *interp, Tcl_Channel inChan, \ - Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr) -} - -# TclCreatePipeline unofficially exported for use by BLT. - -declare 9 generic { - int TclCreatePipeline(Tcl_Interp *interp, int argc, char **argv, \ - Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, \ - TclFile *errFilePtr) -} -declare 10 generic { - int TclCreateProc(Tcl_Interp *interp, Namespace *nsPtr, char *procName, \ - Tcl_Obj *argsPtr, Tcl_Obj *bodyPtr, Proc **procPtrPtr) -} -declare 11 generic { - void TclDeleteCompiledLocalVars(Interp *iPtr, CallFrame *framePtr) -} -declare 12 generic { - void TclDeleteVars(Interp *iPtr, Tcl_HashTable *tablePtr) -} -declare 13 generic { - int TclDoGlob(Tcl_Interp *interp, char *separators, \ - Tcl_DString *headPtr, char *tail) -} -declare 14 generic { - void TclDumpMemoryInfo(FILE *outFile) -} -# Removed in 8.1: -# declare 15 generic { -# void TclExpandParseValue(ParseValue *pvPtr, int needed) -# } -declare 16 generic { - void TclExprFloatError(Tcl_Interp *interp, double value) -} -declare 17 generic { - int TclFileAttrsCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) -} -declare 18 generic { - int TclFileCopyCmd(Tcl_Interp *interp, int argc, char **argv) -} -declare 19 generic { - int TclFileDeleteCmd(Tcl_Interp *interp, int argc, char **argv) -} -declare 20 generic { - int TclFileMakeDirsCmd(Tcl_Interp *interp, int argc, char **argv) -} -declare 21 generic { - int TclFileRenameCmd(Tcl_Interp *interp, int argc, char **argv) -} -declare 22 generic { - int TclFindElement(Tcl_Interp *interp, CONST char *listStr, \ - int listLength, CONST char **elementPtr, CONST char **nextPtr, \ - int *sizePtr, int *bracePtr) -} -declare 23 generic { - Proc * TclFindProc(Interp *iPtr, char *procName) -} -declare 24 generic { - int TclFormatInt(char *buffer, long n) -} -declare 25 generic { - void TclFreePackageInfo(Interp *iPtr) -} -# Removed in 8.1: -# declare 26 generic { -# char * TclGetCwd(Tcl_Interp *interp) -# } -declare 27 generic { - int TclGetDate(char *p, unsigned long now, long zone, \ - unsigned long *timePtr) -} -declare 28 generic { - Tcl_Channel TclpGetDefaultStdChannel(int type) -} -declare 29 generic { - Tcl_Obj * TclGetElementOfIndexedArray(Tcl_Interp *interp, \ - int localIndex, Tcl_Obj *elemPtr, int leaveErrorMsg) -} -# Replaced by char * TclGetEnv(CONST char *name, Tcl_DString *valuePtr) in 8.1: -# declare 30 generic { -# char * TclGetEnv(CONST char *name) -# } -declare 31 generic { - char * TclGetExtension(char *name) -} -declare 32 generic { - int TclGetFrame(Tcl_Interp *interp, char *str, CallFrame **framePtrPtr) -} -declare 33 generic { - TclCmdProcType TclGetInterpProc(void) -} -declare 34 generic { - int TclGetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr, \ - int endValue, int *indexPtr) -} -declare 35 generic { - Tcl_Obj * TclGetIndexedScalar(Tcl_Interp *interp, int localIndex, \ - int leaveErrorMsg) -} -declare 36 generic { - int TclGetLong(Tcl_Interp *interp, char *str, long *longPtr) -} -declare 37 generic { - int TclGetLoadedPackages(Tcl_Interp *interp, char *targetName) -} -declare 38 generic { - int TclGetNamespaceForQualName(Tcl_Interp *interp, char *qualName, \ - Namespace *cxtNsPtr, int flags, Namespace **nsPtrPtr, \ - Namespace **altNsPtrPtr, Namespace **actualCxtPtrPtr, \ - char **simpleNamePtr) -} -declare 39 generic { - TclObjCmdProcType TclGetObjInterpProc(void) -} -declare 40 generic { - int TclGetOpenMode(Tcl_Interp *interp, char *str, int *seekFlagPtr) -} -declare 41 generic { - Tcl_Command TclGetOriginalCommand(Tcl_Command command) -} -declare 42 generic { - char * TclpGetUserHome(CONST char *name, Tcl_DString *bufferPtr) -} -declare 43 generic { - int TclGlobalInvoke(Tcl_Interp *interp, int argc, char **argv, int flags) -} -declare 44 generic { - int TclGuessPackageName(char *fileName, Tcl_DString *bufPtr) -} -declare 45 generic { - int TclHideUnsafeCommands(Tcl_Interp *interp) -} -declare 46 generic { - int TclInExit(void) -} -declare 47 generic { - Tcl_Obj * TclIncrElementOfIndexedArray(Tcl_Interp *interp, \ - int localIndex, Tcl_Obj *elemPtr, long incrAmount) -} -declare 48 generic { - Tcl_Obj * TclIncrIndexedScalar(Tcl_Interp *interp, int localIndex, \ - long incrAmount) -} -declare 49 generic { - Tcl_Obj * TclIncrVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, \ - Tcl_Obj *part2Ptr, long incrAmount, int part1NotParsed) -} -declare 50 generic { - void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr, \ - Namespace *nsPtr) -} -declare 51 generic { - int TclInterpInit(Tcl_Interp *interp) -} -declare 52 generic { - int TclInvoke(Tcl_Interp *interp, int argc, char **argv, int flags) -} -declare 53 generic { - int TclInvokeObjectCommand(ClientData clientData, Tcl_Interp *interp, \ - int argc, char **argv) -} -declare 54 generic { - int TclInvokeStringCommand(ClientData clientData, Tcl_Interp *interp, \ - int objc, Tcl_Obj *CONST objv[]) -} -declare 55 generic { - Proc * TclIsProc(Command *cmdPtr) -} -# Replaced with TclpLoadFile in 8.1: -# declare 56 generic { -# int TclLoadFile(Tcl_Interp *interp, char *fileName, char *sym1, \ -# char *sym2, Tcl_PackageInitProc **proc1Ptr, \ -# Tcl_PackageInitProc **proc2Ptr) -# } -# Signature changed to take a length in 8.1: -# declare 57 generic { -# int TclLooksLikeInt(char *p) -# } -declare 58 generic { - Var * TclLookupVar(Tcl_Interp *interp, char *part1, char *part2, \ - int flags, char *msg, int createPart1, int createPart2, \ - Var **arrayPtrPtr) -} -declare 59 generic { - int TclpMatchFiles(Tcl_Interp *interp, char *separators, \ - Tcl_DString *dirPtr, char *pattern, char *tail) -} -declare 60 generic { - int TclNeedSpace(char *start, char *end) -} -declare 61 generic { - Tcl_Obj * TclNewProcBodyObj(Proc *procPtr) -} -declare 62 generic { - int TclObjCommandComplete(Tcl_Obj *cmdPtr) -} -declare 63 generic { - int TclObjInterpProc(ClientData clientData, Tcl_Interp *interp, \ - int objc, Tcl_Obj *CONST objv[]) -} -declare 64 generic { - int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], \ - int flags) -} -declare 65 generic { - int TclObjInvokeGlobal(Tcl_Interp *interp, int objc, \ - Tcl_Obj *CONST objv[], int flags) -} -declare 66 generic { - int TclOpenFileChannelDeleteProc(TclOpenFileChannelProc_ *proc) -} -declare 67 generic { - int TclOpenFileChannelInsertProc(TclOpenFileChannelProc_ *proc) -} -declare 68 generic { - int TclpAccess(CONST char *path, int mode) -} -declare 69 generic { - char * TclpAlloc(unsigned int size) -} -declare 70 generic { - int TclpCopyFile(CONST char *source, CONST char *dest) -} -declare 71 generic { - int TclpCopyDirectory(CONST char *source, CONST char *dest, \ - Tcl_DString *errorPtr) -} -declare 72 generic { - int TclpCreateDirectory(CONST char *path) -} -declare 73 generic { - int TclpDeleteFile(CONST char *path) -} -declare 74 generic { - void TclpFree(char *ptr) -} -declare 75 generic { - unsigned long TclpGetClicks(void) -} -declare 76 generic { - unsigned long TclpGetSeconds(void) -} -declare 77 generic { - void TclpGetTime(Tcl_Time *time) -} -declare 78 generic { - int TclpGetTimeZone(unsigned long time) -} -declare 79 generic { - int TclpListVolumes(Tcl_Interp *interp) -} -declare 80 generic { - Tcl_Channel TclpOpenFileChannel(Tcl_Interp *interp, char *fileName, \ - char *modeString, int permissions) -} -declare 81 generic { - char * TclpRealloc(char *ptr, unsigned int size) -} -declare 82 generic { - int TclpRemoveDirectory(CONST char *path, int recursive, \ - Tcl_DString *errorPtr) -} -declare 83 generic { - int TclpRenameFile(CONST char *source, CONST char *dest) -} -# Removed in 8.1: -# declare 84 generic { -# int TclParseBraces(Tcl_Interp *interp, char *str, char **termPtr, \ -# ParseValue *pvPtr) -# } -# declare 85 generic { -# int TclParseNestedCmd(Tcl_Interp *interp, char *str, int flags, \ -# char **termPtr, ParseValue *pvPtr) -# } -# declare 86 generic { -# int TclParseQuotes(Tcl_Interp *interp, char *str, int termChar, \ -# int flags, char **termPtr, ParseValue *pvPtr) -# } -# declare 87 generic { -# void TclPlatformInit(Tcl_Interp *interp) -# } -declare 88 generic { - char * TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp, \ - char *name1, char *name2, int flags) -} -declare 89 generic { - int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp, \ - Tcl_Command cmd) -} -# Removed in 8.1 (only available if compiled with TCL_COMPILE_DEBUG): -# declare 90 generic { -# void TclPrintByteCodeObj(Tcl_Interp *interp, Tcl_Obj *objPtr) -# } -declare 91 generic { - void TclProcCleanupProc(Proc *procPtr) -} -declare 92 generic { - int TclProcCompileProc(Tcl_Interp *interp, Proc *procPtr, \ - Tcl_Obj *bodyPtr, Namespace *nsPtr, CONST char *description, \ - CONST char *procName) -} -declare 93 generic { - void TclProcDeleteProc(ClientData clientData) -} -declare 94 generic { - int TclProcInterpProc(ClientData clientData, Tcl_Interp *interp, \ - int argc, char **argv) -} -declare 95 generic { - int TclpStat(CONST char *path, struct stat *buf) -} -declare 96 generic { - int TclRenameCommand(Tcl_Interp *interp, char *oldName, char *newName) -} -declare 97 generic { - void TclResetShadowedCmdRefs(Tcl_Interp *interp, Command *newCmdPtr) -} -declare 98 generic { - int TclServiceIdle(void) -} -declare 99 generic { - Tcl_Obj * TclSetElementOfIndexedArray(Tcl_Interp *interp, \ - int localIndex, Tcl_Obj *elemPtr, Tcl_Obj *objPtr, int leaveErrorMsg) -} -declare 100 generic { - Tcl_Obj * TclSetIndexedScalar(Tcl_Interp *interp, int localIndex, \ - Tcl_Obj *objPtr, int leaveErrorMsg) -} -# TODO: needs to be implemented -# declare 101 generic { -# char * TclSetPreInitScript(char *string) -# } -declare 102 generic { - void TclSetupEnv(Tcl_Interp *interp) -} -declare 103 generic { - int TclSockGetPort(Tcl_Interp *interp, char *str, char *proto, \ - int *portPtr) -} -declare 104 generic { - int TclSockMinimumBuffers(int sock, int size) -} -declare 105 generic { - int TclStat(CONST char *path, TclStat_ *buf) -} -declare 106 generic { - int TclStatDeleteProc(TclStatProc_ *proc) -} -declare 107 generic { - int TclStatInsertProc(TclStatProc_ *proc) -} -declare 108 generic { - void TclTeardownNamespace(Namespace *nsPtr) -} -declare 109 generic { - int TclUpdateReturnInfo(Interp *iPtr) -} -# Removed in 8.1: -# declare 110 generic { -# char * TclWordEnd(char *start, char *lastChar, int nested, int *semiPtr) -# } - -# Procedures used in conjunction with Tcl namespaces. They are -# defined here instead of in tcl.decls since they are not stable yet. - -declare 111 generic { - void Tcl_AddInterpResolvers(Tcl_Interp *interp, char *name, \ - Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, \ - Tcl_ResolveCompiledVarProc *compiledVarProc) -} -declare 112 generic { - int Tcl_AppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \ - Tcl_Obj *objPtr) -} -declare 113 generic { - Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp *interp, char *name, \ - ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc) -} -declare 114 generic { - void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr) -} -declare 115 generic { - int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr, char *pattern, \ - int resetListFirst) -} -declare 116 generic { - Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, char *name, \ - Tcl_Namespace *contextNsPtr, int flags) -} -declare 117 generic { - Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, char *name, \ - Tcl_Namespace *contextNsPtr, int flags) -} -declare 118 generic { - int Tcl_GetInterpResolvers(Tcl_Interp *interp, char *name, \ - Tcl_ResolverInfo *resInfo) -} -declare 119 generic { - int Tcl_GetNamespaceResolvers(Tcl_Namespace *namespacePtr, \ - Tcl_ResolverInfo *resInfo) -} -declare 120 generic { - Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, char *name, \ - Tcl_Namespace *contextNsPtr, int flags) -} -declare 121 generic { - int Tcl_ForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \ - char *pattern) -} -declare 122 generic { - Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr) -} -declare 123 generic { - void Tcl_GetCommandFullName(Tcl_Interp *interp, Tcl_Command command, \ - Tcl_Obj *objPtr) -} -declare 124 generic { - Tcl_Namespace * Tcl_GetCurrentNamespace(Tcl_Interp *interp) -} -declare 125 generic { - Tcl_Namespace * Tcl_GetGlobalNamespace(Tcl_Interp *interp) -} -declare 126 generic { - void Tcl_GetVariableFullName(Tcl_Interp *interp, Tcl_Var variable, \ - Tcl_Obj *objPtr) -} -declare 127 generic { - int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \ - char *pattern, int allowOverwrite) -} -declare 128 generic { - void Tcl_PopCallFrame(Tcl_Interp* interp) -} -declare 129 generic { - int Tcl_PushCallFrame(Tcl_Interp* interp, Tcl_CallFrame *framePtr, \ - Tcl_Namespace *nsPtr, int isProcCallFrame) -} -declare 130 generic { - int Tcl_RemoveInterpResolvers(Tcl_Interp *interp, char *name) -} -declare 131 generic { - void Tcl_SetNamespaceResolvers(Tcl_Namespace *namespacePtr, \ - Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, \ - Tcl_ResolveCompiledVarProc *compiledVarProc) -} -declare 132 generic { - int TclpHasSockets(Tcl_Interp *interp) -} -declare 133 generic { - struct tm * TclpGetDate(TclpTime_t time, int useGMT) -} -declare 134 generic { - size_t TclpStrftime(char *s, size_t maxsize, CONST char *format, \ - CONST struct tm *t) -} -declare 135 generic { - int TclpCheckStackSpace(void) -} - -# Added in 8.1: - -declare 137 generic { - int TclpChdir(CONST char *dirName) -} -declare 138 generic { - char * TclGetEnv(CONST char *name, Tcl_DString *valuePtr) -} -declare 139 generic { - int TclpLoadFile(Tcl_Interp *interp, char *fileName, char *sym1, \ - char *sym2, Tcl_PackageInitProc **proc1Ptr, \ - Tcl_PackageInitProc **proc2Ptr, ClientData *clientDataPtr) -} -declare 140 generic { - int TclLooksLikeInt(char *bytes, int length) -} - -declare 141 generic { - char *TclpGetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr) -} -############################################################################## - -# Define the platform specific internal Tcl interface. These functions are -# only available on the designated platform. - -interface tclIntPlat - -######################## -# Mac specific internals - -declare 0 mac { - VOID * TclpSysAlloc(long size, int isBin) -} -declare 1 mac { - void TclpSysFree(VOID *ptr) -} -declare 2 mac { - VOID * TclpSysRealloc(VOID *cp, unsigned int size) -} -declare 3 mac { - void TclpExit(int status) -} - -# Prototypes for functions found in the tclMacUtil.c compatability library. - -declare 4 mac { - int FSpGetDefaultDir(FSSpecPtr theSpec) -} -declare 5 mac { - int FSpSetDefaultDir(FSSpecPtr theSpec) -} -declare 6 mac { - OSErr FSpFindFolder(short vRefNum, OSType folderType, \ - Boolean createFolder, FSSpec *spec) -} -declare 7 mac { - void GetGlobalMouse(Point *mouse) -} - -# The following routines are utility functions in Tcl. They are exported -# here because they are needed in Tk. They are not officially supported, -# however. The first set are from the MoreFiles package. - -declare 8 mac { - pascal OSErr FSpGetDirectoryID(CONST FSSpec *spec, long *theDirID, \ - Boolean *isDirectory) -} -declare 9 mac { - pascal short FSpOpenResFileCompat(CONST FSSpec *spec, \ - SignedByte permission) -} -declare 10 mac { - pascal void FSpCreateResFileCompat(CONST FSSpec *spec, OSType creator, \ - OSType fileType, ScriptCode scriptTag) -} - -# Like the MoreFiles routines these fix problems in the standard -# Mac calls. These routines are from tclMacUtils.h. - -declare 11 mac { - int FSpLocationFromPath(int length, CONST char *path, FSSpecPtr theSpec) -} -declare 12 mac { - OSErr FSpPathFromLocation(FSSpecPtr theSpec, int *length, \ - Handle *fullPath) -} - -# Prototypes of Mac only internal functions. - -declare 13 mac { - void TclMacExitHandler(void) -} -declare 14 mac { - void TclMacInitExitToShell(int usePatch) -} -declare 15 mac { - OSErr TclMacInstallExitToShellPatch(ExitToShellProcPtr newProc) -} -declare 16 mac { - int TclMacOSErrorToPosixError(int error) -} -declare 17 mac { - void TclMacRemoveTimer(void *timerToken) -} -declare 18 mac { - void * TclMacStartTimer(long ms) -} -declare 19 mac { - int TclMacTimerExpired(void *timerToken) -} -declare 20 mac { - int TclMacRegisterResourceFork(short fileRef, Tcl_Obj *tokenPtr, \ - int insert) -} -declare 21 mac { - short TclMacUnRegisterResourceFork(char *tokenPtr, Tcl_Obj *resultPtr) -} -declare 22 mac { - int TclMacCreateEnv(void) -} -declare 23 mac { - FILE * TclMacFOpenHack(CONST char *path, CONST char *mode) -} -# Replaced in 8.1 by TclpReadLink: -# declare 24 mac { -# int TclMacReadlink(char *path, char *buf, int size) -# } -declare 25 mac { - int TclMacChmod(char *path, int mode) -} - -############################ -# Windows specific internals - -declare 0 win { - void TclWinConvertError(DWORD errCode) -} -declare 1 win { - void TclWinConvertWSAError(DWORD errCode) -} -declare 2 win { - struct servent * TclWinGetServByName(CONST char *nm, \ - CONST char *proto) -} -declare 3 win { - int TclWinGetSockOpt(SOCKET s, int level, int optname, \ - char FAR * optval, int FAR *optlen) -} -declare 4 win { - HINSTANCE TclWinGetTclInstance(void) -} -# Removed in 8.1: -# declare 5 win { -# HINSTANCE TclWinLoadLibrary(char *name) -# } -declare 6 win { - u_short TclWinNToHS(u_short ns) -} -declare 7 win { - int TclWinSetSockOpt(SOCKET s, int level, int optname, \ - CONST char FAR * optval, int optlen) -} -declare 8 win { - unsigned long TclpGetPid(Tcl_Pid pid) -} -declare 9 win { - int TclWinGetPlatformId(void) -} -declare 10 win { - int TclWinSynchSpawn(void *args, int type, void **trans, Tcl_Pid *pidPtr) -} - -# Pipe channel functions - -declare 11 win { - void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan) -} -declare 12 win { - int TclpCloseFile(TclFile file) -} -declare 13 win { - Tcl_Channel TclpCreateCommandChannel(TclFile readFile, \ - TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr) -} -declare 14 win { - int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe) -} -declare 15 win { - int TclpCreateProcess(Tcl_Interp *interp, int argc, char **argv, \ - TclFile inputFile, TclFile outputFile, TclFile errorFile, \ - Tcl_Pid *pidPtr) -} -# Signature changed in 8.1: -# declare 16 win { -# TclFile TclpCreateTempFile(char *contents, Tcl_DString *namePtr) -# } -# declare 17 win { -# char * TclpGetTZName(void) -# } -declare 18 win { - TclFile TclpMakeFile(Tcl_Channel channel, int direction) -} -declare 19 win { - TclFile TclpOpenFile(CONST char *fname, int mode) -} -declare 20 win { - void TclWinAddProcess(HANDLE hProcess, DWORD id) -} -declare 21 win { - void TclpAsyncMark(Tcl_AsyncHandler async) -} - -# Added in 8.1: -declare 22 win { - TclFile TclpCreateTempFile(CONST char *contents) -} -declare 23 win { - char * TclpGetTZName(int isdst) -} -declare 24 win { - char * TclWinNoBackslash(char *path) -} - -######################### -# Unix specific internals - -# Pipe channel functions - -declare 0 unix { - void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan) -} -declare 1 unix { - int TclpCloseFile(TclFile file) -} -declare 2 unix { - Tcl_Channel TclpCreateCommandChannel(TclFile readFile, \ - TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr) -} -declare 3 unix { - int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe) -} -declare 4 unix { - int TclpCreateProcess(Tcl_Interp *interp, int argc, char **argv, \ - TclFile inputFile, TclFile outputFile, TclFile errorFile, \ - Tcl_Pid *pidPtr) -} -# Signature changed in 8.1: -# declare 5 unix { -# TclFile TclpCreateTempFile(char *contents, -# Tcl_DString *namePtr) -# } -declare 6 unix { - TclFile TclpMakeFile(Tcl_Channel channel, int direction) -} -declare 7 unix { - TclFile TclpOpenFile(CONST char *fname, int mode) -} -declare 8 unix { - int TclUnixWaitForFile(int fd, int mask, int timeout) -} - -# Added in 8.1: - -declare 9 unix { - TclFile TclpCreateTempFile(CONST char *contents) -} diff --git a/generic/tclInt.h b/generic/tclInt.h deleted file mode 100644 index 0590bc5..0000000 --- a/generic/tclInt.h +++ /dev/null @@ -1,2184 +0,0 @@ -/* - * tclInt.h -- - * - * Declarations of things used internally by the Tcl interpreter. - * - * Copyright (c) 1987-1993 The Regents of the University of California. - * Copyright (c) 1993-1997 Lucent Technologies. - * Copyright (c) 1994-1998 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. - * - * RCS: @(#) $Id: tclInt.h,v 1.25 1999/04/16 00:46:48 stanton Exp $ - */ - -#ifndef _TCLINT -#define _TCLINT - -/* - * Common include files needed by most of the Tcl source files are - * included here, so that system-dependent personalizations for the - * include files only have to be made in once place. This results - * in a few extra includes, but greater modularity. The order of - * the three groups of #includes is important. For example, stdio.h - * is needed by tcl.h, and the _ANSI_ARGS_ declaration in tcl.h is - * needed by stdlib.h in some configurations. - */ - -#include - -#ifndef _TCL -#include "tcl.h" -#endif - -#include -#ifdef NO_LIMITS_H -# include "../compat/limits.h" -#else -# include -#endif -#ifdef NO_STDLIB_H -# include "../compat/stdlib.h" -#else -# include -#endif -#ifdef NO_STRING_H -#include "../compat/string.h" -#else -#include -#endif - -#undef TCL_STORAGE_CLASS -#ifdef BUILD_tcl -# define TCL_STORAGE_CLASS DLLEXPORT -#else -# ifdef USE_TCL_STUBS -# define TCL_STORAGE_CLASS -# else -# define TCL_STORAGE_CLASS DLLIMPORT -# endif -#endif - -/* - * The following procedures allow namespaces to be customized to - * support special name resolution rules for commands/variables. - * - */ - -struct Tcl_ResolvedVarInfo; - -typedef Tcl_Var (Tcl_ResolveRuntimeVarProc) _ANSI_ARGS_(( - Tcl_Interp* interp, struct Tcl_ResolvedVarInfo *vinfoPtr)); - -typedef void (Tcl_ResolveVarDeleteProc) _ANSI_ARGS_(( - struct Tcl_ResolvedVarInfo *vinfoPtr)); - -/* - * The following structure encapsulates the routines needed to resolve a - * variable reference at runtime. Any variable specific state will typically - * be appended to this structure. - */ - - -typedef struct Tcl_ResolvedVarInfo { - Tcl_ResolveRuntimeVarProc *fetchProc; - Tcl_ResolveVarDeleteProc *deleteProc; -} Tcl_ResolvedVarInfo; - - - -typedef int (Tcl_ResolveCompiledVarProc) _ANSI_ARGS_(( - Tcl_Interp* interp, char* name, int length, - Tcl_Namespace *context, Tcl_ResolvedVarInfo **rPtr)); - -typedef int (Tcl_ResolveVarProc) _ANSI_ARGS_(( - Tcl_Interp* interp, char* name, Tcl_Namespace *context, - int flags, Tcl_Var *rPtr)); - -typedef int (Tcl_ResolveCmdProc) _ANSI_ARGS_((Tcl_Interp* interp, - char* name, Tcl_Namespace *context, int flags, - Tcl_Command *rPtr)); - -typedef struct Tcl_ResolverInfo { - Tcl_ResolveCmdProc *cmdResProc; /* Procedure handling command name - * resolution. */ - Tcl_ResolveVarProc *varResProc; /* Procedure handling variable name - * resolution for variables that - * can only be handled at runtime. */ - Tcl_ResolveCompiledVarProc *compiledVarResProc; - /* Procedure handling variable name - * resolution at compile time. */ -} Tcl_ResolverInfo; - -/* - *---------------------------------------------------------------- - * Data structures related to namespaces. - *---------------------------------------------------------------- - */ - -/* - * The structure below defines a namespace. - * Note: the first five fields must match exactly the fields in a - * Tcl_Namespace structure (see tcl.h). If you change one, be sure to - * change the other. - */ - -typedef struct Namespace { - char *name; /* The namespace's simple (unqualified) - * name. This contains no ::'s. The name of - * the global namespace is "" although "::" - * is an synonym. */ - char *fullName; /* The namespace's fully qualified name. - * This starts with ::. */ - ClientData clientData; /* An arbitrary value associated with this - * namespace. */ - Tcl_NamespaceDeleteProc *deleteProc; - /* Procedure invoked when deleting the - * namespace to, e.g., free clientData. */ - struct Namespace *parentPtr; /* Points to the namespace that contains - * this one. NULL if this is the global - * namespace. */ - Tcl_HashTable childTable; /* Contains any child namespaces. Indexed - * by strings; values have type - * (Namespace *). */ - long nsId; /* Unique id for the namespace. */ - Tcl_Interp *interp; /* The interpreter containing this - * namespace. */ - int flags; /* OR-ed combination of the namespace - * status flags NS_DYING and NS_DEAD - * listed below. */ - int activationCount; /* Number of "activations" or active call - * frames for this namespace that are on - * the Tcl call stack. The namespace won't - * be freed until activationCount becomes - * zero. */ - int refCount; /* Count of references by namespaceName * - * objects. The namespace can't be freed - * until refCount becomes zero. */ - Tcl_HashTable cmdTable; /* Contains all the commands currently - * registered in the namespace. Indexed by - * strings; values have type (Command *). - * Commands imported by Tcl_Import have - * Command structures that point (via an - * ImportedCmdRef structure) to the - * Command structure in the source - * namespace's command table. */ - Tcl_HashTable varTable; /* Contains all the (global) variables - * currently in this namespace. Indexed - * by strings; values have type (Var *). */ - char **exportArrayPtr; /* Points to an array of string patterns - * specifying which commands are exported. - * A pattern may include "string match" - * style wildcard characters to specify - * multiple commands; however, no namespace - * qualifiers are allowed. NULL if no - * export patterns are registered. */ - int numExportPatterns; /* Number of export patterns currently - * registered using "namespace export". */ - int maxExportPatterns; /* Mumber of export patterns for which - * space is currently allocated. */ - int cmdRefEpoch; /* Incremented if a newly added command - * shadows a command for which this - * namespace has already cached a Command * - * pointer; this causes all its cached - * Command* pointers to be invalidated. */ - int resolverEpoch; /* Incremented whenever the name resolution - * rules change for this namespace; this - * invalidates all byte codes compiled in - * the namespace, causing the code to be - * recompiled under the new rules. */ - Tcl_ResolveCmdProc *cmdResProc; - /* If non-null, this procedure overrides - * the usual command resolution mechanism - * in Tcl. This procedure is invoked - * within Tcl_FindCommand to resolve all - * command references within the namespace. */ - Tcl_ResolveVarProc *varResProc; - /* If non-null, this procedure overrides - * the usual variable resolution mechanism - * in Tcl. This procedure is invoked - * within Tcl_FindNamespaceVar to resolve all - * variable references within the namespace - * at runtime. */ - Tcl_ResolveCompiledVarProc *compiledVarResProc; - /* If non-null, this procedure overrides - * the usual variable resolution mechanism - * in Tcl. This procedure is invoked - * within LookupCompiledLocal to resolve - * variable references within the namespace - * at compile time. */ -} Namespace; - -/* - * Flags used to represent the status of a namespace: - * - * NS_DYING - 1 means Tcl_DeleteNamespace has been called to delete the - * namespace but there are still active call frames on the Tcl - * stack that refer to the namespace. When the last call frame - * referring to it has been popped, it's variables and command - * will be destroyed and it will be marked "dead" (NS_DEAD). - * The namespace can no longer be looked up by name. - * NS_DEAD - 1 means Tcl_DeleteNamespace has been called to delete the - * namespace and no call frames still refer to it. Its - * variables and command have already been destroyed. This bit - * allows the namespace resolution code to recognize that the - * namespace is "deleted". When the last namespaceName object - * in any byte code code unit that refers to the namespace has - * been freed (i.e., when the namespace's refCount is 0), the - * namespace's storage will be freed. - */ - -#define NS_DYING 0x01 -#define NS_DEAD 0x02 - -/* - * Flag passed to TclGetNamespaceForQualName to have it create all namespace - * components of a namespace-qualified name that cannot be found. The new - * namespaces are created within their specified parent. Note that this - * flag's value must not conflict with the values of the flags - * TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY, and FIND_ONLY_NS (defined in - * tclNamesp.c). - */ - -#define CREATE_NS_IF_UNKNOWN 0x800 - -/* - *---------------------------------------------------------------- - * Data structures related to variables. These are used primarily - * in tclVar.c - *---------------------------------------------------------------- - */ - -/* - * The following structure defines a variable trace, which is used to - * invoke a specific C procedure whenever certain operations are performed - * on a variable. - */ - -typedef struct VarTrace { - Tcl_VarTraceProc *traceProc;/* Procedure to call when operations given - * by flags are performed on variable. */ - ClientData clientData; /* Argument to pass to proc. */ - int flags; /* What events the trace procedure is - * interested in: OR-ed combination of - * TCL_TRACE_READS, TCL_TRACE_WRITES, - * TCL_TRACE_UNSETS and TCL_TRACE_ARRAY. */ - struct VarTrace *nextPtr; /* Next in list of traces associated with - * a particular variable. */ -} VarTrace; - -/* - * When a variable trace is active (i.e. its associated procedure is - * executing), one of the following structures is linked into a list - * associated with the variable's interpreter. The information in - * the structure is needed in order for Tcl to behave reasonably - * if traces are deleted while traces are active. - */ - -typedef struct ActiveVarTrace { - struct Var *varPtr; /* Variable that's being traced. */ - struct ActiveVarTrace *nextPtr; - /* Next in list of all active variable - * traces for the interpreter, or NULL - * if no more. */ - VarTrace *nextTracePtr; /* Next trace to check after current - * trace procedure returns; if this - * trace gets deleted, must update pointer - * to avoid using free'd memory. */ -} ActiveVarTrace; - -/* - * The following structure describes an enumerative search in progress on - * an array variable; this are invoked with options to the "array" - * command. - */ - -typedef struct ArraySearch { - int id; /* Integer id used to distinguish among - * multiple concurrent searches for the - * same array. */ - struct Var *varPtr; /* Pointer to array variable that's being - * searched. */ - Tcl_HashSearch search; /* Info kept by the hash module about - * progress through the array. */ - Tcl_HashEntry *nextEntry; /* Non-null means this is the next element - * to be enumerated (it's leftover from - * the Tcl_FirstHashEntry call or from - * an "array anymore" command). NULL - * means must call Tcl_NextHashEntry - * to get value to return. */ - struct ArraySearch *nextPtr;/* Next in list of all active searches - * for this variable, or NULL if this is - * the last one. */ -} ArraySearch; - -/* - * The structure below defines a variable, which associates a string name - * with a Tcl_Obj value. These structures are kept in procedure call frames - * (for local variables recognized by the compiler) or in the heap (for - * global variables and any variable not known to the compiler). For each - * Var structure in the heap, a hash table entry holds the variable name and - * a pointer to the Var structure. - */ - -typedef struct Var { - union { - Tcl_Obj *objPtr; /* The variable's object value. Used for - * scalar variables and array elements. */ - Tcl_HashTable *tablePtr;/* For array variables, this points to - * information about the hash table used - * to implement the associative array. - * Points to malloc-ed data. */ - struct Var *linkPtr; /* If this is a global variable being - * referred to in a procedure, or a variable - * created by "upvar", this field points to - * the referenced variable's Var struct. */ - } value; - char *name; /* NULL if the variable is in a hashtable, - * otherwise points to the variable's - * name. It is used, e.g., by TclLookupVar - * and "info locals". The storage for the - * characters of the name is not owned by - * the Var and must not be freed when - * freeing the Var. */ - Namespace *nsPtr; /* Points to the namespace that contains - * this variable or NULL if the variable is - * a local variable in a Tcl procedure. */ - Tcl_HashEntry *hPtr; /* If variable is in a hashtable, either the - * hash table entry that refers to this - * variable or NULL if the variable has been - * detached from its hash table (e.g. an - * array is deleted, but some of its - * elements are still referred to in - * upvars). NULL if the variable is not in a - * hashtable. This is used to delete an - * variable from its hashtable if it is no - * longer needed. */ - int refCount; /* Counts number of active uses of this - * variable, not including its entry in the - * call frame or the hash table: 1 for each - * additional variable whose linkPtr points - * here, 1 for each nested trace active on - * variable, and 1 if the variable is a - * namespace variable. This record can't be - * deleted until refCount becomes 0. */ - VarTrace *tracePtr; /* First in list of all traces set for this - * variable. */ - ArraySearch *searchPtr; /* First in list of all searches active - * for this variable, or NULL if none. */ - int flags; /* Miscellaneous bits of information about - * variable. See below for definitions. */ -} Var; - -/* - * Flag bits for variables. The first three (VAR_SCALAR, VAR_ARRAY, and - * VAR_LINK) are mutually exclusive and give the "type" of the variable. - * VAR_UNDEFINED is independent of the variable's type. - * - * VAR_SCALAR - 1 means this is a scalar variable and not - * an array or link. The "objPtr" field points - * to the variable's value, a Tcl object. - * VAR_ARRAY - 1 means this is an array variable rather - * than a scalar variable or link. The - * "tablePtr" field points to the array's - * hashtable for its elements. - * VAR_LINK - 1 means this Var structure contains a - * pointer to another Var structure that - * either has the real value or is itself - * another VAR_LINK pointer. Variables like - * this come about through "upvar" and "global" - * commands, or through references to variables - * in enclosing namespaces. - * VAR_UNDEFINED - 1 means that the variable is in the process - * of being deleted. An undefined variable - * logically does not exist and survives only - * while it has a trace, or if it is a global - * variable currently being used by some - * procedure. - * VAR_IN_HASHTABLE - 1 means this variable is in a hashtable and - * the Var structure is malloced. 0 if it is - * a local variable that was assigned a slot - * in a procedure frame by the compiler so the - * Var storage is part of the call frame. - * VAR_TRACE_ACTIVE - 1 means that trace processing is currently - * underway for a read or write access, so - * new read or write accesses should not cause - * trace procedures to be called and the - * variable can't be deleted. - * VAR_ARRAY_ELEMENT - 1 means that this variable is an array - * element, so it is not legal for it to be - * an array itself (the VAR_ARRAY flag had - * better not be set). - * VAR_NAMESPACE_VAR - 1 means that this variable was declared - * as a namespace variable. This flag ensures - * it persists until its namespace is - * destroyed or until the variable is unset; - * it will persist even if it has not been - * initialized and is marked undefined. - * The variable's refCount is incremented to - * reflect the "reference" from its namespace. - * - * The following additional flags are used with the CompiledLocal type - * defined below: - * - * VAR_ARGUMENT - 1 means that this variable holds a procedure - * argument. - * VAR_TEMPORARY - 1 if the local variable is an anonymous - * temporary variable. Temporaries have a NULL - * name. - * VAR_RESOLVED - 1 if name resolution has been done for this - * variable. - */ - -#define VAR_SCALAR 0x1 -#define VAR_ARRAY 0x2 -#define VAR_LINK 0x4 -#define VAR_UNDEFINED 0x8 -#define VAR_IN_HASHTABLE 0x10 -#define VAR_TRACE_ACTIVE 0x20 -#define VAR_ARRAY_ELEMENT 0x40 -#define VAR_NAMESPACE_VAR 0x80 - -#define VAR_ARGUMENT 0x100 -#define VAR_TEMPORARY 0x200 -#define VAR_RESOLVED 0x400 - -/* - * Macros to ensure that various flag bits are set properly for variables. - * The ANSI C "prototypes" for these macros are: - * - * EXTERN void TclSetVarScalar _ANSI_ARGS_((Var *varPtr)); - * EXTERN void TclSetVarArray _ANSI_ARGS_((Var *varPtr)); - * EXTERN void TclSetVarLink _ANSI_ARGS_((Var *varPtr)); - * EXTERN void TclSetVarArrayElement _ANSI_ARGS_((Var *varPtr)); - * EXTERN void TclSetVarUndefined _ANSI_ARGS_((Var *varPtr)); - * EXTERN void TclClearVarUndefined _ANSI_ARGS_((Var *varPtr)); - */ - -#define TclSetVarScalar(varPtr) \ - (varPtr)->flags = ((varPtr)->flags & ~(VAR_ARRAY|VAR_LINK)) | VAR_SCALAR - -#define TclSetVarArray(varPtr) \ - (varPtr)->flags = ((varPtr)->flags & ~(VAR_SCALAR|VAR_LINK)) | VAR_ARRAY - -#define TclSetVarLink(varPtr) \ - (varPtr)->flags = ((varPtr)->flags & ~(VAR_SCALAR|VAR_ARRAY)) | VAR_LINK - -#define TclSetVarArrayElement(varPtr) \ - (varPtr)->flags = ((varPtr)->flags & ~VAR_ARRAY) | VAR_ARRAY_ELEMENT - -#define TclSetVarUndefined(varPtr) \ - (varPtr)->flags |= VAR_UNDEFINED - -#define TclClearVarUndefined(varPtr) \ - (varPtr)->flags &= ~VAR_UNDEFINED - -/* - * Macros to read various flag bits of variables. - * The ANSI C "prototypes" for these macros are: - * - * EXTERN int TclIsVarScalar _ANSI_ARGS_((Var *varPtr)); - * EXTERN int TclIsVarLink _ANSI_ARGS_((Var *varPtr)); - * EXTERN int TclIsVarArray _ANSI_ARGS_((Var *varPtr)); - * EXTERN int TclIsVarUndefined _ANSI_ARGS_((Var *varPtr)); - * EXTERN int TclIsVarArrayElement _ANSI_ARGS_((Var *varPtr)); - * EXTERN int TclIsVarTemporary _ANSI_ARGS_((Var *varPtr)); - * EXTERN int TclIsVarArgument _ANSI_ARGS_((Var *varPtr)); - * EXTERN int TclIsVarResolved _ANSI_ARGS_((Var *varPtr)); - */ - -#define TclIsVarScalar(varPtr) \ - ((varPtr)->flags & VAR_SCALAR) - -#define TclIsVarLink(varPtr) \ - ((varPtr)->flags & VAR_LINK) - -#define TclIsVarArray(varPtr) \ - ((varPtr)->flags & VAR_ARRAY) - -#define TclIsVarUndefined(varPtr) \ - ((varPtr)->flags & VAR_UNDEFINED) - -#define TclIsVarArrayElement(varPtr) \ - ((varPtr)->flags & VAR_ARRAY_ELEMENT) - -#define TclIsVarTemporary(varPtr) \ - ((varPtr)->flags & VAR_TEMPORARY) - -#define TclIsVarArgument(varPtr) \ - ((varPtr)->flags & VAR_ARGUMENT) - -#define TclIsVarResolved(varPtr) \ - ((varPtr)->flags & VAR_RESOLVED) - -/* - *---------------------------------------------------------------- - * Data structures related to procedures. These are used primarily - * in tclProc.c, tclCompile.c, and tclExecute.c. - *---------------------------------------------------------------- - */ - -/* - * Forward declaration to prevent an error when the forward reference to - * Command is encountered in the Proc and ImportRef types declared below. - */ - -struct Command; - -/* - * The variable-length structure below describes a local variable of a - * procedure that was recognized by the compiler. These variables have a - * name, an element in the array of compiler-assigned local variables in the - * procedure's call frame, and various other items of information. If the - * local variable is a formal argument, it may also have a default value. - * The compiler can't recognize local variables whose names are - * expressions (these names are only known at runtime when the expressions - * are evaluated) or local variables that are created as a result of an - * "upvar" or "uplevel" command. These other local variables are kept - * separately in a hash table in the call frame. - */ - -typedef struct CompiledLocal { - struct CompiledLocal *nextPtr; - /* Next compiler-recognized local variable - * for this procedure, or NULL if this is - * the last local. */ - int nameLength; /* The number of characters in local - * variable's name. Used to speed up - * variable lookups. */ - int frameIndex; /* Index in the array of compiler-assigned - * variables in the procedure call frame. */ - int flags; /* Flag bits for the local variable. Same as - * the flags for the Var structure above, - * although only VAR_SCALAR, VAR_ARRAY, - * VAR_LINK, VAR_ARGUMENT, VAR_TEMPORARY, and - * VAR_RESOLVED make sense. */ - Tcl_Obj *defValuePtr; /* Pointer to the default value of an - * argument, if any. NULL if not an argument - * or, if an argument, no default value. */ - Tcl_ResolvedVarInfo *resolveInfo; - /* Customized variable resolution info - * supplied by the Tcl_ResolveCompiledVarProc - * associated with a namespace. Each variable - * is marked by a unique ClientData tag - * during compilation, and that same tag - * is used to find the variable at runtime. */ - char name[4]; /* Name of the local variable starts here. - * If the name is NULL, this will just be - * '\0'. The actual size of this field will - * be large enough to hold the name. MUST - * BE THE LAST FIELD IN THE STRUCTURE! */ -} CompiledLocal; - -/* - * The structure below defines a command procedure, which consists of a - * collection of Tcl commands plus information about arguments and other - * local variables recognized at compile time. - */ - -typedef struct Proc { - struct Interp *iPtr; /* Interpreter for which this command - * is defined. */ - int refCount; /* Reference count: 1 if still present - * in command table plus 1 for each call - * to the procedure that is currently - * active. This structure can be freed - * when refCount becomes zero. */ - struct Command *cmdPtr; /* Points to the Command structure for - * this procedure. This is used to get - * the namespace in which to execute - * the procedure. */ - Tcl_Obj *bodyPtr; /* Points to the ByteCode object for - * procedure's body command. */ - int numArgs; /* Number of formal parameters. */ - int numCompiledLocals; /* Count of local variables recognized by - * the compiler including arguments and - * temporaries. */ - CompiledLocal *firstLocalPtr; /* Pointer to first of the procedure's - * compiler-allocated local variables, or - * NULL if none. The first numArgs entries - * in this list describe the procedure's - * formal arguments. */ - CompiledLocal *lastLocalPtr; /* Pointer to the last allocated local - * variable or NULL if none. This has - * frame index (numCompiledLocals-1). */ -} Proc; - -/* - * The structure below defines a command trace. This is used to allow Tcl - * clients to find out whenever a command is about to be executed. - */ - -typedef struct Trace { - int level; /* Only trace commands at nesting level - * less than or equal to this. */ - Tcl_CmdTraceProc *proc; /* Procedure to call to trace command. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ - struct Trace *nextPtr; /* Next in list of traces for this interp. */ -} Trace; - -/* - * The structure below defines an entry in the assocData hash table which - * is associated with an interpreter. The entry contains a pointer to a - * function to call when the interpreter is deleted, and a pointer to - * a user-defined piece of data. - */ - -typedef struct AssocData { - Tcl_InterpDeleteProc *proc; /* Proc to call when deleting. */ - ClientData clientData; /* Value to pass to proc. */ -} AssocData; - -/* - * The structure below defines a call frame. A call frame defines a naming - * context for a procedure call: its local naming scope (for local - * variables) and its global naming scope (a namespace, perhaps the global - * :: namespace). A call frame can also define the naming context for a - * namespace eval or namespace inscope command: the namespace in which the - * command's code should execute. The Tcl_CallFrame structures exist only - * while procedures or namespace eval/inscope's are being executed, and - * provide a kind of Tcl call stack. - * - * WARNING!! The structure definition must be kept consistent with the - * Tcl_CallFrame structure in tcl.h. If you change one, change the other. - */ - -typedef struct CallFrame { - Namespace *nsPtr; /* Points to the namespace used to resolve - * commands and global variables. */ - int isProcCallFrame; /* If nonzero, the frame was pushed to - * execute a Tcl procedure and may have - * local vars. If 0, the frame was pushed - * to execute a namespace command and var - * references are treated as references to - * namespace vars; varTablePtr and - * compiledLocals are ignored. */ - int objc; /* This and objv below describe the - * arguments for this procedure call. */ - Tcl_Obj *CONST *objv; /* Array of argument objects. */ - struct CallFrame *callerPtr; - /* Value of interp->framePtr when this - * procedure was invoked (i.e. next higher - * in stack of all active procedures). */ - struct CallFrame *callerVarPtr; - /* Value of interp->varFramePtr when this - * procedure was invoked (i.e. determines - * variable scoping within caller). Same - * as callerPtr unless an "uplevel" command - * or something equivalent was active in - * the caller). */ - int level; /* Level of this procedure, for "uplevel" - * purposes (i.e. corresponds to nesting of - * callerVarPtr's, not callerPtr's). 1 for - * outermost procedure, 0 for top-level. */ - Proc *procPtr; /* Points to the structure defining the - * called procedure. Used to get information - * such as the number of compiled local - * variables (local variables assigned - * entries ["slots"] in the compiledLocals - * array below). */ - Tcl_HashTable *varTablePtr; /* Hash table containing local variables not - * recognized by the compiler, or created at - * execution time through, e.g., upvar. - * Initially NULL and created if needed. */ - int numCompiledLocals; /* Count of local variables recognized by - * the compiler including arguments. */ - Var* compiledLocals; /* Points to the array of local variables - * recognized by the compiler. The compiler - * emits code that refers to these variables - * using an index into this array. */ -} CallFrame; - -/* - *---------------------------------------------------------------- - * Data structures and procedures related to TclHandles, which - * are a very lightweight method of preserving enough information - * to determine if an arbitrary malloc'd block has been deleted. - *---------------------------------------------------------------- - */ - -typedef VOID **TclHandle; - -TclHandle TclHandleCreate _ANSI_ARGS_((VOID *ptr)); -void TclHandleFree _ANSI_ARGS_((TclHandle handle)); -TclHandle TclHandlePreserve _ANSI_ARGS_((TclHandle handle)); -void TclHandleRelease _ANSI_ARGS_((TclHandle handle)); - -/* - *---------------------------------------------------------------- - * Data structures related to history. These are used primarily - * in tclHistory.c - *---------------------------------------------------------------- - */ - -/* - * The structure below defines one history event (a previously-executed - * command that can be re-executed in whole or in part). - */ - -typedef struct { - char *command; /* String containing previously-executed - * command. */ - int bytesAvl; /* Total # of bytes available at *event (not - * all are necessarily in use now). */ -} HistoryEvent; - -/* - * The structure below defines a pending revision to the most recent - * history event. Changes are linked together into a list and applied - * during the next call to Tcl_RecordHistory. See the comments at the - * beginning of tclHistory.c for information on revisions. - */ - -typedef struct HistoryRev { - int firstIndex; /* Index of the first byte to replace in - * current history event. */ - int lastIndex; /* Index of last byte to replace in - * current history event. */ - int newSize; /* Number of bytes in newBytes. */ - char *newBytes; /* Replacement for the range given by - * firstIndex and lastIndex (malloced). */ - struct HistoryRev *nextPtr; /* Next in chain of revisions to apply, or - * NULL for end of list. */ -} HistoryRev; - -/* - *---------------------------------------------------------------- - * Data structures related to expressions. These are used only in - * tclExpr.c. - *---------------------------------------------------------------- - */ - -/* - * The data structure below defines a math function (e.g. sin or hypot) - * for use in Tcl expressions. - */ - -#define MAX_MATH_ARGS 5 -typedef struct MathFunc { - int builtinFuncIndex; /* If this is a builtin math function, its - * index in the array of builtin functions. - * (tclCompilation.h lists these indices.) - * The value is -1 if this is a new function - * defined by Tcl_CreateMathFunc. The value - * is also -1 if a builtin function is - * replaced by a Tcl_CreateMathFunc call. */ - int numArgs; /* Number of arguments for function. */ - Tcl_ValueType argTypes[MAX_MATH_ARGS]; - /* Acceptable types for each argument. */ - Tcl_MathProc *proc; /* Procedure that implements this function. - * NULL if isBuiltinFunc is 1. */ - ClientData clientData; /* Additional argument to pass to the - * function when invoking it. NULL if - * isBuiltinFunc is 1. */ -} MathFunc; - -/* - * These are a thin layer over TclpThreadKeyDataGet and TclpThreadKeyDataSet - * when threads are used, or an emulation if there are no threads. These - * are really internal and Tcl clients should use Tcl_GetThreadData. - */ - -EXTERN VOID *TclThreadDataKeyGet _ANSI_ARGS_((Tcl_ThreadDataKey *keyPtr)); -EXTERN void TclThreadDataKeySet _ANSI_ARGS_((Tcl_ThreadDataKey *keyPtr, VOID *data)); - -/* - * This is a convenience macro used to initialize a thread local storage ptr. - */ -#define TCL_TSD_INIT(keyPtr) (ThreadSpecificData *)Tcl_GetThreadData((keyPtr), sizeof(ThreadSpecificData)) - - -#ifdef MAC_TCL -typedef pascal void *(Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); -#else -typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); -#endif - -/* - *---------------------------------------------------------------- - * Data structures related to bytecode compilation and execution. - * These are used primarily in tclCompile.c, tclExecute.c, and - * tclBasic.c. - *---------------------------------------------------------------- - */ - -/* - * Forward declaration to prevent errors when the forward references to - * Tcl_Parse and CompileEnv are encountered in the procedure type - * CompileProc declared below. - */ - -struct Tcl_Parse; -struct CompileEnv; - -/* - * The type of procedures called by the Tcl bytecode compiler to compile - * commands. Pointers to these procedures are kept in the Command structure - * describing each command. When a CompileProc returns, the interpreter's - * result is set to error information, if any. In addition, the CompileProc - * returns an integer value, which is one of the following: - * - * TCL_OK Compilation completed normally. - * TCL_ERROR Compilation failed because of an error; - * the interpreter's result describes what went wrong. - * TCL_OUT_LINE_COMPILE Compilation failed because, e.g., the command is - * too complex for effective inline compilation. The - * CompileProc believes the command is legal but - * should be compiled "out of line" by emitting code - * to invoke its command procedure at runtime. - */ - -#define TCL_OUT_LINE_COMPILE (TCL_CONTINUE + 1) - -typedef int (CompileProc) _ANSI_ARGS_((Tcl_Interp *interp, - struct Tcl_Parse *parsePtr, struct CompileEnv *compEnvPtr)); - -/* - * The data structure defining the execution environment for ByteCode's. - * There is one ExecEnv structure per Tcl interpreter. It holds the - * evaluation stack that holds command operands and results. The stack grows - * towards increasing addresses. The "stackTop" member is cached by - * TclExecuteByteCode in a local variable: it must be set before calling - * TclExecuteByteCode and will be restored by TclExecuteByteCode before it - * returns. - */ - -typedef struct ExecEnv { - Tcl_Obj **stackPtr; /* Points to the first item in the - * evaluation stack on the heap. */ - int stackTop; /* Index of current top of stack; -1 when - * the stack is empty. */ - int stackEnd; /* Index of last usable item in stack. */ -} ExecEnv; - -/* - * The definitions for the LiteralTable and LiteralEntry structures. Each - * interpreter contains a LiteralTable. It is used to reduce the storage - * needed for all the Tcl objects that hold the literals of scripts compiled - * by the interpreter. A literal's object is shared by all the ByteCodes - * that refer to the literal. Each distinct literal has one LiteralEntry - * entry in the LiteralTable. A literal table is a specialized hash table - * that is indexed by the literal's string representation, which may contain - * null characters. - * - * Note that we reduce the space needed for literals by sharing literal - * objects both within a ByteCode (each ByteCode contains a local - * LiteralTable) and across all an interpreter's ByteCodes (with the - * interpreter's global LiteralTable). - */ - -typedef struct LiteralEntry { - struct LiteralEntry *nextPtr; /* Points to next entry in this - * hash bucket or NULL if end of - * chain. */ - Tcl_Obj *objPtr; /* Points to Tcl object that - * holds the literal's bytes and - * length. */ - int refCount; /* If in an interpreter's global - * literal table, the number of - * ByteCode structures that share - * the literal object; the literal - * entry can be freed when refCount - * drops to 0. If in a local literal - * table, -1. */ -} LiteralEntry; - -typedef struct LiteralTable { - LiteralEntry **buckets; /* Pointer to bucket array. Each - * element points to first entry in - * bucket's hash chain, or NULL. */ - LiteralEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; - /* Bucket array used for small - * tables to avoid mallocs and - * frees. */ - int numBuckets; /* Total number of buckets allocated - * at **buckets. */ - int numEntries; /* Total number of entries present - * in table. */ - int rebuildSize; /* Enlarge table when numEntries - * gets to be this large. */ - int mask; /* Mask value used in hashing - * function. */ -} LiteralTable; - -/* - * The following structure defines for each Tcl interpreter various - * statistics-related information about the bytecode compiler and - * interpreter's operation in that interpreter. - */ - -#ifdef TCL_COMPILE_STATS -typedef struct ByteCodeStats { - long numExecutions; /* Number of ByteCodes executed. */ - long numCompilations; /* Number of ByteCodes created. */ - long numByteCodesFreed; /* Number of ByteCodes destroyed. */ - long instructionCount[256]; /* Number of times each instruction was - * executed. */ - - double totalSrcBytes; /* Total source bytes ever compiled. */ - double totalByteCodeBytes; /* Total bytes for all ByteCodes. */ - double currentSrcBytes; /* Src bytes for all current ByteCodes. */ - double currentByteCodeBytes; /* Code bytes in all current ByteCodes. */ - - long srcCount[32]; /* Source size distribution: # of srcs of - * size [2**(n-1)..2**n), n in [0..32). */ - long byteCodeCount[32]; /* ByteCode size distribution. */ - long lifetimeCount[32]; /* ByteCode lifetime distribution (ms). */ - - double currentInstBytes; /* Instruction bytes-current ByteCodes. */ - double currentLitBytes; /* Current literal bytes. */ - double currentExceptBytes; /* Current exception table bytes. */ - double currentAuxBytes; /* Current auxiliary information bytes. */ - double currentCmdMapBytes; /* Current src<->code map bytes. */ - - long numLiteralsCreated; /* Total literal objects ever compiled. */ - double totalLitStringBytes; /* Total string bytes in all literals. */ - double currentLitStringBytes; /* String bytes in current literals. */ - long literalCount[32]; /* Distribution of literal string sizes. */ -} ByteCodeStats; -#endif /* TCL_COMPILE_STATS */ - -/* - *---------------------------------------------------------------- - * Data structures related to commands. - *---------------------------------------------------------------- - */ - -/* - * An imported command is created in an namespace when it imports a "real" - * command from another namespace. An imported command has a Command - * structure that points (via its ClientData value) to the "real" Command - * structure in the source namespace's command table. The real command - * records all the imported commands that refer to it in a list of ImportRef - * structures so that they can be deleted when the real command is deleted. */ - -typedef struct ImportRef { - struct Command *importedCmdPtr; - /* Points to the imported command created in - * an importing namespace; this command - * redirects its invocations to the "real" - * command. */ - struct ImportRef *nextPtr; /* Next element on the linked list of - * imported commands that refer to the - * "real" command. The real command deletes - * these imported commands on this list when - * it is deleted. */ -} ImportRef; - -/* - * Data structure used as the ClientData of imported commands: commands - * created in an namespace when it imports a "real" command from another - * namespace. - */ - -typedef struct ImportedCmdData { - struct Command *realCmdPtr; /* "Real" command that this imported command - * refers to. */ - struct Command *selfPtr; /* Pointer to this imported command. Needed - * only when deleting it in order to remove - * it from the real command's linked list of - * imported commands that refer to it. */ -} ImportedCmdData; - -/* - * A Command structure exists for each command in a namespace. The - * Tcl_Command opaque type actually refers to these structures. - */ - -typedef struct Command { - Tcl_HashEntry *hPtr; /* Pointer to the hash table entry that - * refers to this command. The hash table is - * either a namespace's command table or an - * interpreter's hidden command table. This - * pointer is used to get a command's name - * from its Tcl_Command handle. NULL means - * that the hash table entry has been - * removed already (this can happen if - * deleteProc causes the command to be - * deleted or recreated). */ - Namespace *nsPtr; /* Points to the namespace containing this - * command. */ - int refCount; /* 1 if in command hashtable plus 1 for each - * reference from a CmdName Tcl object - * representing a command's name in a - * ByteCode instruction sequence. This - * structure can be freed when refCount - * becomes zero. */ - int cmdEpoch; /* Incremented to invalidate any references - * that point to this command when it is - * renamed, deleted, hidden, or exposed. */ - CompileProc *compileProc; /* Procedure called to compile command. NULL - * if no compile proc exists for command. */ - Tcl_ObjCmdProc *objProc; /* Object-based command procedure. */ - ClientData objClientData; /* Arbitrary value passed to object proc. */ - Tcl_CmdProc *proc; /* String-based command procedure. */ - ClientData clientData; /* Arbitrary value passed to string proc. */ - Tcl_CmdDeleteProc *deleteProc; - /* Procedure invoked when deleting command - * to, e.g., free all client data. */ - ClientData deleteData; /* Arbitrary value passed to deleteProc. */ - int deleted; /* Means that the command is in the process - * of being deleted (its deleteProc is - * currently executing). Other attempts to - * delete the command should be ignored. */ - ImportRef *importRefPtr; /* List of each imported Command created in - * another namespace when this command is - * imported. These imported commands - * redirect invocations back to this - * command. The list is used to remove all - * those imported commands when deleting - * this "real" command. */ -} Command; - -/* - *---------------------------------------------------------------- - * Data structures related to name resolution procedures. - *---------------------------------------------------------------- - */ - -/* - * The interpreter keeps a linked list of name resolution schemes. - * The scheme for a namespace is consulted first, followed by the - * list of schemes in an interpreter, followed by the default - * name resolution in Tcl. Schemes are added/removed from the - * interpreter's list by calling Tcl_AddInterpResolver and - * Tcl_RemoveInterpResolver. - */ - -typedef struct ResolverScheme { - char *name; /* Name identifying this scheme. */ - Tcl_ResolveCmdProc *cmdResProc; - /* Procedure handling command name - * resolution. */ - Tcl_ResolveVarProc *varResProc; - /* Procedure handling variable name - * resolution for variables that - * can only be handled at runtime. */ - Tcl_ResolveCompiledVarProc *compiledVarResProc; - /* Procedure handling variable name - * resolution at compile time. */ - - struct ResolverScheme *nextPtr; - /* Pointer to next record in linked list. */ -} ResolverScheme; - -/* - *---------------------------------------------------------------- - * This structure defines an interpreter, which is a collection of - * commands plus other state information related to interpreting - * commands, such as variable storage. Primary responsibility for - * this data structure is in tclBasic.c, but almost every Tcl - * source file uses something in here. - *---------------------------------------------------------------- - */ - -typedef struct Interp { - - /* - * Note: the first three fields must match exactly the fields in - * a Tcl_Interp struct (see tcl.h). If you change one, be sure to - * change the other. - * - * The interpreter's result is held in both the string and the - * objResultPtr fields. These fields hold, respectively, the result's - * string or object value. The interpreter's result is always in the - * result field if that is non-empty, otherwise it is in objResultPtr. - * The two fields are kept consistent unless some C code sets - * interp->result directly. Programs should not access result and - * objResultPtr directly; instead, they should always get and set the - * result using procedures such as Tcl_SetObjResult, Tcl_GetObjResult, - * and Tcl_GetStringResult. See the SetResult man page for details. - */ - - char *result; /* If the last command returned a string - * result, this points to it. Should not be - * accessed directly; see comment above. */ - Tcl_FreeProc *freeProc; /* Zero means a string result is statically - * allocated. TCL_DYNAMIC means string - * result was allocated with ckalloc and - * should be freed with ckfree. Other values - * give address of procedure to invoke to - * free the string result. Tcl_Eval must - * free it before executing next command. */ - int errorLine; /* When TCL_ERROR is returned, this gives - * the line number in the command where the - * error occurred (1 means first line). */ - struct TclStubs *stubTable; - /* Pointer to the exported Tcl stub table. - * On previous versions of Tcl this is a - * pointer to the objResultPtr or a pointer - * to a buckets array in a hash table. We - * therefore have to do some careful checking - * before we can use this. */ - - TclHandle handle; /* Handle used to keep track of when this - * interp is deleted. */ - - Namespace *globalNsPtr; /* The interpreter's global namespace. */ - Tcl_HashTable *hiddenCmdTablePtr; - /* Hash table used by tclBasic.c to keep - * track of hidden commands on a per-interp - * basis. */ - ClientData interpInfo; /* Information used by tclInterp.c to keep - * track of master/slave interps on - * a per-interp basis. */ - Tcl_HashTable mathFuncTable;/* Contains all the math functions currently - * defined for the interpreter. Indexed by - * strings (function names); values have - * type (MathFunc *). */ - - - - /* - * Information related to procedures and variables. See tclProc.c - * and tclvar.c for usage. - */ - - int numLevels; /* Keeps track of how many nested calls to - * Tcl_Eval are in progress for this - * interpreter. It's used to delay deletion - * of the table until all Tcl_Eval - * invocations are completed. */ - int maxNestingDepth; /* If numLevels exceeds this value then Tcl - * assumes that infinite recursion has - * occurred and it generates an error. */ - CallFrame *framePtr; /* Points to top-most in stack of all nested - * procedure invocations. NULL means there - * are no active procedures. */ - CallFrame *varFramePtr; /* Points to the call frame whose variables - * are currently in use (same as framePtr - * unless an "uplevel" command is - * executing). NULL means no procedure is - * active or "uplevel 0" is executing. */ - ActiveVarTrace *activeTracePtr; - /* First in list of active traces for - * interp, or NULL if no active traces. */ - int returnCode; /* Completion code to return if current - * procedure exits with TCL_RETURN code. */ - char *errorInfo; /* Value to store in errorInfo if returnCode - * is TCL_ERROR. Malloc'ed, may be NULL */ - char *errorCode; /* Value to store in errorCode if returnCode - * is TCL_ERROR. Malloc'ed, may be NULL */ - - /* - * Information used by Tcl_AppendResult to keep track of partial - * results. See Tcl_AppendResult code for details. - */ - - char *appendResult; /* Storage space for results generated - * by Tcl_AppendResult. Malloc-ed. NULL - * means not yet allocated. */ - int appendAvl; /* Total amount of space available at - * partialResult. */ - int appendUsed; /* Number of non-null bytes currently - * stored at partialResult. */ - - /* - * A cache of compiled regular expressions. See Tcl_RegExpCompile - * in tclUtil.c for details. THIS CACHE IS OBSOLETE and is only - * retained for backward compatibility with Tcl_RegExpCompile. - * New code should use the object interface so the Tcl_Obj caches - * the compiled expression. - */ - -#define NUM_REGEXPS 5 - char *patterns[NUM_REGEXPS];/* Strings corresponding to compiled - * regular expression patterns. NULL - * means that this slot isn't used. - * Malloc-ed. */ - int patLengths[NUM_REGEXPS];/* Number of non-null characters in - * corresponding entry in patterns. - * -1 means entry isn't used. */ - struct TclRegexp *regexps[NUM_REGEXPS]; - /* Compiled forms of above strings. Also - * malloc-ed, or NULL if not in use yet. */ - - /* - * Information about packages. Used only in tclPkg.c. - */ - - Tcl_HashTable packageTable; /* Describes all of the packages loaded - * in or available to this interpreter. - * Keys are package names, values are - * (Package *) pointers. */ - char *packageUnknown; /* Command to invoke during "package - * require" commands for packages that - * aren't described in packageTable. - * Malloc'ed, may be NULL. */ - - /* - * Miscellaneous information: - */ - - int cmdCount; /* Total number of times a command procedure - * has been called for this interpreter. */ - int evalFlags; /* Flags to control next call to Tcl_Eval. - * Normally zero, but may be set before - * calling Tcl_Eval. See below for valid - * values. */ - int termOffset; /* Offset of character just after last one - * compiled or executed by Tcl_EvalObj. */ - LiteralTable literalTable; /* Contains LiteralEntry's describing all - * Tcl objects holding literals of scripts - * compiled by the interpreter. Indexed by - * the string representations of literals. - * Used to avoid creating duplicate - * objects. */ - int compileEpoch; /* Holds the current "compilation epoch" - * for this interpreter. This is - * incremented to invalidate existing - * ByteCodes when, e.g., a command with a - * compile procedure is redefined. */ - Proc *compiledProcPtr; /* If a procedure is being compiled, a - * pointer to its Proc structure; otherwise, - * this is NULL. Set by ObjInterpProc in - * tclProc.c and used by tclCompile.c to - * process local variables appropriately. */ - ResolverScheme *resolverPtr; - /* Linked list of name resolution schemes - * added to this interpreter. Schemes - * are added/removed by calling - * Tcl_AddInterpResolvers and - * Tcl_RemoveInterpResolver. */ - char *scriptFile; /* NULL means there is no nested source - * command active; otherwise this points to - * the name of the file being sourced (it's - * not malloc-ed: it points to an argument - * to Tcl_EvalFile. */ - int flags; /* Various flag bits. See below. */ - long randSeed; /* Seed used for rand() function. */ - Trace *tracePtr; /* List of traces for this interpreter. */ - Tcl_HashTable *assocData; /* Hash table for associating data with - * this interpreter. Cleaned up when - * this interpreter is deleted. */ - struct ExecEnv *execEnvPtr; /* Execution environment for Tcl bytecode - * execution. Contains a pointer to the - * Tcl evaluation stack. */ - Tcl_Obj *emptyObjPtr; /* Points to an object holding an empty - * string. Returned by Tcl_ObjSetVar2 when - * variable traces change a variable in a - * gross way. */ - char resultSpace[TCL_RESULT_SIZE+1]; - /* Static space holding small results. */ - Tcl_Obj *objResultPtr; /* If the last command returned an object - * result, this points to it. Should not be - * accessed directly; see comment above. */ - Tcl_ThreadId threadId; /* ID of thread that owns the interpreter */ - - /* - * Statistical information about the bytecode compiler and interpreter's - * operation. - */ - -#ifdef TCL_COMPILE_STATS - ByteCodeStats stats; /* Holds compilation and execution - * statistics for this interpreter. */ -#endif /* TCL_COMPILE_STATS */ -} Interp; - -/* - * EvalFlag bits for Interp structures: - * - * TCL_BRACKET_TERM 1 means that the current script is terminated by - * a close bracket rather than the end of the string. - * TCL_ALLOW_EXCEPTIONS 1 means it's OK for the script to terminate with - * a code other than TCL_OK or TCL_ERROR; 0 means - * codes other than these should be turned into errors. - */ - -#define TCL_BRACKET_TERM 1 -#define TCL_ALLOW_EXCEPTIONS 4 - -/* - * Flag bits for Interp structures: - * - * DELETED: Non-zero means the interpreter has been deleted: - * don't process any more commands for it, and destroy - * the structure as soon as all nested invocations of - * Tcl_Eval are done. - * ERR_IN_PROGRESS: Non-zero means an error unwind is already in - * progress. Zero means a command proc has been - * invoked since last error occured. - * ERR_ALREADY_LOGGED: Non-zero means information has already been logged - * in $errorInfo for the current Tcl_Eval instance, - * so Tcl_Eval needn't log it (used to implement the - * "error message log" command). - * ERROR_CODE_SET: Non-zero means that Tcl_SetErrorCode has been - * called to record information for the current - * error. Zero means Tcl_Eval must clear the - * errorCode variable if an error is returned. - * EXPR_INITIALIZED: Non-zero means initialization specific to - * expressions has been carried out. - * DONT_COMPILE_CMDS_INLINE: Non-zero means that the bytecode compiler - * should not compile any commands into an inline - * sequence of instructions. This is set 1, for - * example, when command traces are requested. - * RAND_SEED_INITIALIZED: Non-zero means that the randSeed value of the - * interp has not be initialized. This is set 1 - * when we first use the rand() or srand() functions. - * SAFE_INTERP: Non zero means that the current interp is a - * safe interp (ie it has only the safe commands - * installed, less priviledge than a regular interp). - * USE_EVAL_DIRECT: Non-zero means don't use the compiler or byte-code - * interpreter; instead, have Tcl_EvalObj call - * Tcl_EvalEx. Used primarily for testing the - * new parser. - */ - -#define DELETED 1 -#define ERR_IN_PROGRESS 2 -#define ERR_ALREADY_LOGGED 4 -#define ERROR_CODE_SET 8 -#define EXPR_INITIALIZED 0x10 -#define DONT_COMPILE_CMDS_INLINE 0x20 -#define RAND_SEED_INITIALIZED 0x40 -#define SAFE_INTERP 0x80 -#define USE_EVAL_DIRECT 0x100 - -/* - *---------------------------------------------------------------- - * Data structures related to command parsing. These are used in - * tclParse.c and its clients. - *---------------------------------------------------------------- - */ - -/* - * The following data structure is used by various parsing procedures - * to hold information about where to store the results of parsing - * (e.g. the substituted contents of a quoted argument, or the result - * of a nested command). At any given time, the space available - * for output is fixed, but a procedure may be called to expand the - * space available if the current space runs out. - */ - -typedef struct ParseValue { - char *buffer; /* Address of first character in - * output buffer. */ - char *next; /* Place to store next character in - * output buffer. */ - char *end; /* Address of the last usable character - * in the buffer. */ - void (*expandProc) _ANSI_ARGS_((struct ParseValue *pvPtr, int needed)); - /* Procedure to call when space runs out; - * it will make more space. */ - ClientData clientData; /* Arbitrary information for use of - * expandProc. */ -} ParseValue; - - -/* - * Maximum number of levels of nesting permitted in Tcl commands (used - * to catch infinite recursion). - */ - -#define MAX_NESTING_DEPTH 1000 - -/* - * The macro below is used to modify a "char" value (e.g. by casting - * it to an unsigned character) so that it can be used safely with - * macros such as isspace. - */ - -#define UCHAR(c) ((unsigned char) (c)) - -/* - * This macro is used to determine the offset needed to safely allocate any - * data structure in memory. Given a starting offset or size, it "rounds up" - * or "aligns" the offset to the next 8-byte boundary so that any data - * structure can be placed at the resulting offset without fear of an - * alignment error. - * - * WARNING!! DO NOT USE THIS MACRO TO ALIGN POINTERS: it will produce - * the wrong result on platforms that allocate addresses that are divisible - * by 4 or 2. Only use it for offsets or sizes. - */ - -#define TCL_ALIGN(x) (((int)(x) + 7) & ~7) - -/* - * The following macros are used to specify the runtime platform - * setting of the tclPlatform variable. - */ - -typedef enum { - TCL_PLATFORM_UNIX, /* Any Unix-like OS. */ - TCL_PLATFORM_MAC, /* MacOS. */ - TCL_PLATFORM_WINDOWS /* Any Microsoft Windows OS. */ -} TclPlatformType; - -/* - * Flags for TclInvoke: - * - * TCL_INVOKE_HIDDEN Invoke a hidden command; if not set, - * invokes an exposed command. - * TCL_INVOKE_NO_UNKNOWN If set, "unknown" is not invoked if - * the command to be invoked is not found. - * Only has an effect if invoking an exposed - * command, i.e. if TCL_INVOKE_HIDDEN is not - * also set. - * TCL_INVOKE_NO_TRACEBACK Does not record traceback information if - * the invoked command returns an error. Used - * if the caller plans on recording its own - * traceback information. - */ - -#define TCL_INVOKE_HIDDEN (1<<0) -#define TCL_INVOKE_NO_UNKNOWN (1<<1) -#define TCL_INVOKE_NO_TRACEBACK (1<<2) - -/* - * The structure used as the internal representation of Tcl list - * objects. This is an array of pointers to the element objects. This array - * is grown (reallocated and copied) as necessary to hold all the list's - * element pointers. The array might contain more slots than currently used - * to hold all element pointers. This is done to make append operations - * faster. - */ - -typedef struct List { - int maxElemCount; /* Total number of element array slots. */ - int elemCount; /* Current number of list elements. */ - Tcl_Obj **elements; /* Array of pointers to element objects. */ -} List; - - -/* - * The following types are used for getting and storing platform-specific - * file attributes in tclFCmd.c and the various platform-versions of - * that file. This is done to have as much common code as possible - * in the file attributes code. For more information about the callbacks, - * see TclFileAttrsCmd in tclFCmd.c. - */ - -typedef int (TclGetFileAttrProc) _ANSI_ARGS_((Tcl_Interp *interp, - int objIndex, CONST char *fileName, Tcl_Obj **attrObjPtrPtr)); -typedef int (TclSetFileAttrProc) _ANSI_ARGS_((Tcl_Interp *interp, - int objIndex, CONST char *fileName, Tcl_Obj *attrObjPtr)); - -typedef struct TclFileAttrProcs { - TclGetFileAttrProc *getProc; /* The procedure for getting attrs. */ - TclSetFileAttrProc *setProc; /* The procedure for setting attrs. */ -} TclFileAttrProcs; - -/* - * Opaque handle used in pipeline routines to encapsulate platform-dependent - * state. - */ - -typedef struct TclFile_ *TclFile; - -/* - *---------------------------------------------------------------- - * Data structures related to hooking 'TclStat(...)' and - * 'TclAccess(...)'. - *---------------------------------------------------------------- - */ - -typedef struct stat TclStat_; -typedef int (TclStatProc_) _ANSI_ARGS_((CONST char *path, TclStat_ *buf)); -typedef int (TclAccessProc_) _ANSI_ARGS_((CONST char *path, int mode)); -typedef Tcl_Channel (TclOpenFileChannelProc_) _ANSI_ARGS_((Tcl_Interp *interp, - char *fileName, char *modeString, - int permissions)); - -typedef int (*TclCmdProcType) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char *argv[])); -typedef int (*TclObjCmdProcType) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, struct Tcl_Obj * CONST objv[])); - -/* - * Opaque names for platform specific types. - */ - -typedef struct TclpTime_t_ *TclpTime_t; - -/* - *---------------------------------------------------------------- - * Variables shared among Tcl modules but not used by the outside world. - *---------------------------------------------------------------- - */ - -extern Tcl_Time tclBlockTime; -extern int tclBlockTimeSet; -extern char * tclExecutableName; -extern char * tclNativeExecutableName; -extern char * tclDefaultEncodingDir; -extern Tcl_ChannelType tclFileChannelType; -extern char * tclMemDumpFileName; -extern TclPlatformType tclPlatform; -extern char * tclpFileAttrStrings[]; -extern CONST TclFileAttrProcs tclpFileAttrProcs[]; - -/* - * Variables denoting the Tcl object types defined in the core. - */ - -extern Tcl_ObjType tclBooleanType; -extern Tcl_ObjType tclByteArrayType; -extern Tcl_ObjType tclByteCodeType; -extern Tcl_ObjType tclDoubleType; -extern Tcl_ObjType tclIntType; -extern Tcl_ObjType tclListType; -extern Tcl_ObjType tclProcBodyType; -extern Tcl_ObjType tclStringType; - -/* - * The head of the list of free Tcl objects, and the total number of Tcl - * objects ever allocated and freed. - */ - -extern Tcl_Obj * tclFreeObjList; - -#ifdef TCL_COMPILE_STATS -extern long tclObjsAlloced; -extern long tclObjsFreed; -#endif /* TCL_COMPILE_STATS */ - -/* - * Pointer to a heap-allocated string of length zero that the Tcl core uses - * as the value of an empty string representation for an object. This value - * is shared by all new objects allocated by Tcl_NewObj. - */ - -extern char * tclEmptyStringRep; - -/* - *---------------------------------------------------------------- - * Procedures shared among Tcl modules but not used by the outside - * world: - *---------------------------------------------------------------- - */ - -EXTERN int TclAccess _ANSI_ARGS_((CONST char *path, - int mode)); -EXTERN int TclAccessDeleteProc _ANSI_ARGS_((TclAccessProc_ *proc)); -EXTERN int TclAccessInsertProc _ANSI_ARGS_((TclAccessProc_ *proc)); -EXTERN void TclAllocateFreeObjects _ANSI_ARGS_((void)); -EXTERN int TclArraySet _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *arrayNameObj, Tcl_Obj *arrayElemObj)); -EXTERN int TclCleanupChildren _ANSI_ARGS_((Tcl_Interp *interp, - int numPids, Tcl_Pid *pidPtr, - Tcl_Channel errorChan)); -EXTERN void TclCleanupCommand _ANSI_ARGS_((Command *cmdPtr)); -EXTERN int TclCopyChannel _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Channel inChan, Tcl_Channel outChan, - int toRead, Tcl_Obj *cmdPtr)); -/* - * TclCreatePipeline unofficially exported for use by BLT. - */ -EXTERN int TclCreatePipeline _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv, Tcl_Pid **pidArrayPtr, - TclFile *inPipePtr, TclFile *outPipePtr, - TclFile *errFilePtr)); -EXTERN int TclCreateProc _ANSI_ARGS_((Tcl_Interp *interp, - Namespace *nsPtr, char *procName, - Tcl_Obj *argsPtr, Tcl_Obj *bodyPtr, - Proc **procPtrPtr)); -EXTERN void TclDeleteCompiledLocalVars _ANSI_ARGS_(( - Interp *iPtr, CallFrame *framePtr)); -EXTERN void TclDeleteVars _ANSI_ARGS_((Interp *iPtr, - Tcl_HashTable *tablePtr)); -EXTERN int TclDoGlob _ANSI_ARGS_((Tcl_Interp *interp, - char *separators, Tcl_DString *headPtr, - char *tail)); -EXTERN void TclDumpMemoryInfo _ANSI_ARGS_((FILE *outFile)); -EXTERN void TclExpandTokenArray _ANSI_ARGS_(( - Tcl_Parse *parsePtr)); -EXTERN void TclExprFloatError _ANSI_ARGS_((Tcl_Interp *interp, - double value)); -EXTERN int TclFileAttrsCmd _ANSI_ARGS_((Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -EXTERN int TclFileCopyCmd _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv)) ; -EXTERN int TclFileDeleteCmd _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv)); -EXTERN int TclFileMakeDirsCmd _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv)) ; -EXTERN int TclFileRenameCmd _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv)) ; -EXTERN void TclFinalizeAllocSubsystem _ANSI_ARGS_((void)); -EXTERN void TclFinalizeCompExecEnv _ANSI_ARGS_((void)); -EXTERN void TclFinalizeCondition _ANSI_ARGS_(( - Tcl_Condition *condPtr)); -EXTERN void TclFinalizeCompilation _ANSI_ARGS_((void)); -EXTERN void TclFinalizeEncodingSubsystem _ANSI_ARGS_((void)); -EXTERN void TclFinalizeEnvironment _ANSI_ARGS_((void)); -EXTERN void TclFinalizeExecution _ANSI_ARGS_((void)); -EXTERN void TclFinalizeIOSubsystem _ANSI_ARGS_((void)); -EXTERN void TclFinalizeLoad _ANSI_ARGS_((void)); -EXTERN void TclFinalizeMemorySubsystem _ANSI_ARGS_((void)); -EXTERN void TclFinalizeMutex _ANSI_ARGS_((Tcl_Mutex *mutex)); -EXTERN void TclFinalizeNotifier _ANSI_ARGS_((void)); -EXTERN void TclFinalizeSynchronization _ANSI_ARGS_((void)); -EXTERN void TclFinalizeThreadData _ANSI_ARGS_((void)); -EXTERN void TclFindEncodings _ANSI_ARGS_((CONST char *argv0)); -EXTERN Proc * TclFindProc _ANSI_ARGS_((Interp *iPtr, - char *procName)); -EXTERN int TclFormatInt _ANSI_ARGS_((char *buffer, long n)); -EXTERN void TclFreePackageInfo _ANSI_ARGS_((Interp *iPtr)); -EXTERN int TclGetDate _ANSI_ARGS_((char *p, - unsigned long now, long zone, - unsigned long *timePtr)); -EXTERN Tcl_Obj * TclGetElementOfIndexedArray _ANSI_ARGS_(( - Tcl_Interp *interp, int localIndex, - Tcl_Obj *elemPtr, int leaveErrorMsg)); -EXTERN char * TclGetExtension _ANSI_ARGS_((char *name)); -EXTERN int TclGetFrame _ANSI_ARGS_((Tcl_Interp *interp, - char *string, CallFrame **framePtrPtr)); -EXTERN TclCmdProcType TclGetInterpProc _ANSI_ARGS_((void)); -EXTERN int TclGetIntForIndex _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr, int endValue, int *indexPtr)); -EXTERN Tcl_Obj * TclGetIndexedScalar _ANSI_ARGS_((Tcl_Interp *interp, - int localIndex, int leaveErrorMsg)); -EXTERN Tcl_Obj * TclGetLibraryPath _ANSI_ARGS_((void)); -EXTERN int TclGetLong _ANSI_ARGS_((Tcl_Interp *interp, - char *string, long *longPtr)); -EXTERN int TclGetLoadedPackages _ANSI_ARGS_(( - Tcl_Interp *interp, char *targetName)); -EXTERN int TclGetNamespaceForQualName _ANSI_ARGS_(( - Tcl_Interp *interp, char *qualName, - Namespace *cxtNsPtr, int flags, - Namespace **nsPtrPtr, Namespace **altNsPtrPtr, - Namespace **actualCxtPtrPtr, - char **simpleNamePtr)); -EXTERN TclObjCmdProcType TclGetObjInterpProc _ANSI_ARGS_((void)); -EXTERN int TclGetOpenMode _ANSI_ARGS_((Tcl_Interp *interp, - char *string, int *seekFlagPtr)); -EXTERN Tcl_Command TclGetOriginalCommand _ANSI_ARGS_(( - Tcl_Command command)); -EXTERN int TclGlob _ANSI_ARGS_((Tcl_Interp *interp, - char *pattern, int noComplain)); -EXTERN int TclGlobalInvoke _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv, int flags)); -EXTERN int TclGuessPackageName _ANSI_ARGS_((char *fileName, - Tcl_DString *bufPtr)); -EXTERN int TclHideUnsafeCommands _ANSI_ARGS_(( - Tcl_Interp *interp)); -EXTERN int TclInExit _ANSI_ARGS_((void)); -EXTERN Tcl_Obj * TclIncrElementOfIndexedArray _ANSI_ARGS_(( - Tcl_Interp *interp, int localIndex, - Tcl_Obj *elemPtr, long incrAmount)); -EXTERN Tcl_Obj * TclIncrIndexedScalar _ANSI_ARGS_(( - Tcl_Interp *interp, int localIndex, - long incrAmount)); -EXTERN Tcl_Obj * TclIncrVar2 _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, - long incrAmount, int flags)); -EXTERN void TclInitAlloc _ANSI_ARGS_((void)); -EXTERN void TclInitCompiledLocals _ANSI_ARGS_(( - Tcl_Interp *interp, CallFrame *framePtr, - Namespace *nsPtr)); -EXTERN void TclInitDbCkalloc _ANSI_ARGS_((void)); -EXTERN void TclInitEncodingSubsystem _ANSI_ARGS_((void)); -EXTERN void TclInitIOSubsystem _ANSI_ARGS_((void)); -EXTERN void TclInitNamespaceSubsystem _ANSI_ARGS_((void)); -EXTERN void TclInitNotifier _ANSI_ARGS_((void)); -EXTERN void TclInitObjSubsystem _ANSI_ARGS_((void)); -EXTERN void TclInitSubsystems _ANSI_ARGS_((CONST char *argv0)); -EXTERN int TclInvoke _ANSI_ARGS_((Tcl_Interp *interp, - int argc, char **argv, int flags)); -EXTERN int TclInvokeObjectCommand _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int argc, char **argv)); -EXTERN int TclInvokeStringCommand _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -EXTERN int TclIsLocalScalar _ANSI_ARGS_((CONST char *src, - int len)); -EXTERN Proc * TclIsProc _ANSI_ARGS_((Command *cmdPtr)); -EXTERN Var * TclLookupVar _ANSI_ARGS_((Tcl_Interp *interp, - char *part1, char *part2, int flags, char *msg, - int createPart1, int createPart2, - Var **arrayPtrPtr)); -EXTERN int TclMathInProgress _ANSI_ARGS_((void)); -EXTERN int TclNeedSpace _ANSI_ARGS_((char *start, char *end)); -EXTERN Tcl_Obj * TclNewProcBodyObj _ANSI_ARGS_((Proc *procPtr)); -EXTERN int TclObjCommandComplete _ANSI_ARGS_((Tcl_Obj *cmdPtr)); -EXTERN int TclObjInterpProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN int TclObjInvoke _ANSI_ARGS_((Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[], int flags)); -EXTERN int TclObjInvokeGlobal _ANSI_ARGS_((Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[], int flags)); -EXTERN int TclOpenFileChannelDeleteProc _ANSI_ARGS_(( - TclOpenFileChannelProc_ *proc)); -EXTERN int TclOpenFileChannelInsertProc _ANSI_ARGS_(( - TclOpenFileChannelProc_ *proc)); -EXTERN int TclpAccess _ANSI_ARGS_((CONST char *filename, - int mode)); -EXTERN char * TclpAlloc _ANSI_ARGS_((unsigned int size)); -EXTERN int TclpCheckStackSpace _ANSI_ARGS_((void)); -EXTERN int TclpCopyFile _ANSI_ARGS_((CONST char *source, - CONST char *dest)); -EXTERN int TclpCopyDirectory _ANSI_ARGS_((CONST char *source, - CONST char *dest, Tcl_DString *errorPtr)); -EXTERN int TclpCreateDirectory _ANSI_ARGS_((CONST char *path)); -EXTERN int TclpDeleteFile _ANSI_ARGS_((CONST char *path)); -EXTERN void TclpExit _ANSI_ARGS_((int status)); -EXTERN void TclpFinalizeCondition _ANSI_ARGS_(( - Tcl_Condition *condPtr)); -EXTERN void TclpFinalizeMutex _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); -EXTERN void TclpFinalizeThreadData _ANSI_ARGS_(( - Tcl_ThreadDataKey *keyPtr)); -EXTERN void TclpFinalizeThreadDataKey _ANSI_ARGS_(( - Tcl_ThreadDataKey *keyPtr)); -EXTERN char * TclpFindExecutable _ANSI_ARGS_(( - CONST char *argv0)); -EXTERN int TclpFindVariable _ANSI_ARGS_((CONST char *name, - int *lengthPtr)); -EXTERN void TclpFree _ANSI_ARGS_((char *ptr)); -EXTERN unsigned long TclpGetClicks _ANSI_ARGS_((void)); -EXTERN Tcl_Channel TclpGetDefaultStdChannel _ANSI_ARGS_((int type)); -EXTERN unsigned long TclpGetSeconds _ANSI_ARGS_((void)); -EXTERN void TclpGetTime _ANSI_ARGS_((Tcl_Time *time)); -EXTERN int TclpGetTimeZone _ANSI_ARGS_((unsigned long time)); -EXTERN char * TclpGetUserHome _ANSI_ARGS_((CONST char *name, - Tcl_DString *bufferPtr)); -EXTERN int TclpHasSockets _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN void TclpInitLibraryPath _ANSI_ARGS_((CONST char *argv0)); -EXTERN void TclpInitLock _ANSI_ARGS_((void)); -EXTERN void TclpInitPlatform _ANSI_ARGS_((void)); -EXTERN void TclpInitUnlock _ANSI_ARGS_((void)); -EXTERN int TclpListVolumes _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN void TclpMasterLock _ANSI_ARGS_((void)); -EXTERN void TclpMasterUnlock _ANSI_ARGS_((void)); -EXTERN int TclpMatchFiles _ANSI_ARGS_((Tcl_Interp *interp, - char *separators, Tcl_DString *dirPtr, - char *pattern, char *tail)); -EXTERN Tcl_Channel TclpOpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp, - char *fileName, char *modeString, - int permissions)); -EXTERN char * TclpReadlink _ANSI_ARGS_((CONST char *fileName, - Tcl_DString *linkPtr)); -EXTERN char * TclpRealloc _ANSI_ARGS_((char *ptr, - unsigned int size)); -EXTERN void TclpReleaseFile _ANSI_ARGS_((TclFile file)); -EXTERN int TclpRemoveDirectory _ANSI_ARGS_((CONST char *path, - int recursive, Tcl_DString *errorPtr)); -EXTERN int TclpRenameFile _ANSI_ARGS_((CONST char *source, - CONST char *dest)); -EXTERN void TclpSetInitialEncodings _ANSI_ARGS_((void)); -EXTERN void TclpSetVariables _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN VOID * TclpSysAlloc _ANSI_ARGS_((long size, int isBin)); -EXTERN void TclpSysFree _ANSI_ARGS_((VOID *ptr)); -EXTERN VOID * TclpSysRealloc _ANSI_ARGS_((VOID *cp, - unsigned int size)); -EXTERN void TclpUnloadFile _ANSI_ARGS_((ClientData clientData)); -EXTERN char * TclPrecTraceProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, - int flags)); -EXTERN int TclPreventAliasLoop _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *cmdInterp, Tcl_Command cmd)); -EXTERN void TclProcCleanupProc _ANSI_ARGS_((Proc *procPtr)); -EXTERN int TclProcCompileProc _ANSI_ARGS_((Tcl_Interp *interp, - Proc *procPtr, Tcl_Obj *bodyPtr, Namespace *nsPtr, - CONST char *description, CONST char *procName)); -EXTERN void TclProcDeleteProc _ANSI_ARGS_((ClientData clientData)); -EXTERN int TclProcInterpProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -EXTERN int TclpThreadCreate _ANSI_ARGS_((Tcl_ThreadId *idPtr, - Tcl_ThreadCreateProc proc, ClientData clientData)); -EXTERN VOID * TclpThreadDataKeyGet _ANSI_ARGS_(( - Tcl_ThreadDataKey *keyPtr)); -EXTERN void TclpThreadDataKeyInit _ANSI_ARGS_(( - Tcl_ThreadDataKey *keyPtr)); -EXTERN void TclpThreadDataKeySet _ANSI_ARGS_(( - Tcl_ThreadDataKey *keyPtr, VOID *data)); -EXTERN void TclpThreadExit _ANSI_ARGS_((int status)); -EXTERN void TclRememberCondition _ANSI_ARGS_((Tcl_Condition *mutex)); -EXTERN void TclRememberDataKey _ANSI_ARGS_((Tcl_ThreadDataKey *mutex)); -EXTERN void TclRememberMutex _ANSI_ARGS_((Tcl_Mutex *mutex)); -EXTERN int TclRenameCommand _ANSI_ARGS_((Tcl_Interp *interp, - char *oldName, char *newName)) ; -EXTERN void TclResetShadowedCmdRefs _ANSI_ARGS_(( - Tcl_Interp *interp, Command *newCmdPtr)); -EXTERN int TclServiceIdle _ANSI_ARGS_((void)); -EXTERN Tcl_Obj * TclSetElementOfIndexedArray _ANSI_ARGS_(( - Tcl_Interp *interp, int localIndex, - Tcl_Obj *elemPtr, Tcl_Obj *objPtr, - int leaveErrorMsg)); -EXTERN void TclSetLibraryPath _ANSI_ARGS_((Tcl_Obj *pathPtr)); -EXTERN Tcl_Obj * TclSetIndexedScalar _ANSI_ARGS_((Tcl_Interp *interp, - int localIndex, Tcl_Obj *objPtr, - int leaveErrorMsg)); -EXTERN char * TclSetPreInitScript _ANSI_ARGS_((char *string)); -EXTERN void TclSetupEnv _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int TclSockGetPort _ANSI_ARGS_((Tcl_Interp *interp, - char *string, char *proto, int *portPtr)); -EXTERN int TclSockMinimumBuffers _ANSI_ARGS_((int sock, - int size)); -EXTERN int TclStat _ANSI_ARGS_((CONST char *path, - TclStat_ *buf)); -EXTERN int TclStatDeleteProc _ANSI_ARGS_((TclStatProc_ *proc)); -EXTERN int TclStatInsertProc _ANSI_ARGS_((TclStatProc_ *proc)); -EXTERN void TclTeardownNamespace _ANSI_ARGS_((Namespace *nsPtr)); -EXTERN int TclTestChannelCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -EXTERN int TclTestChannelEventCmd _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int argc, char **argv)); -EXTERN void TclTransferResult _ANSI_ARGS_((Tcl_Interp *sourceInterp, - int result, Tcl_Interp *targetInterp)); -EXTERN int TclUpdateReturnInfo _ANSI_ARGS_((Interp *iPtr)); - -/* - *---------------------------------------------------------------- - * Command procedures in the generic core: - *---------------------------------------------------------------- - */ - -EXTERN int Tcl_AfterObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_AppendObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ArrayObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_BinaryObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_BreakObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_CaseObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_CatchObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_CdObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ClockObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_CloseObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ConcatObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ContinueObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_EncodingObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_EofObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ErrorObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_EvalObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ExecObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ExitObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ExprObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_FblockedObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_FconfigureObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_FcopyObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_FileObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_FileEventObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_FlushObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ForObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ForeachObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_FormatObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_GetsObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_GlobalObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_GlobObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_IfObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_IncrObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_InfoObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_InterpObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_JoinObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LappendObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LindexObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LinsertObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LlengthObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ListObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LoadObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LrangeObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LreplaceObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LsearchObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_LsortObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_NamespaceObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_OpenObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_PackageObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_PidObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ProcObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_PutsObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_PwdObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ReadObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_RegexpObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_RegsubObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_RenameObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ReturnObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ScanObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_SeekObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_SetObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_SplitObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_SocketObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_SourceObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_StringObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_SubstObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_SwitchObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_TellObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_TimeObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_TraceObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_UnsetObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_UpdateObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_UplevelObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_UpvarObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_VariableObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_VwaitObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_WhileObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); - -/* - *---------------------------------------------------------------- - * Command procedures found only in the Mac version of the core: - *---------------------------------------------------------------- - */ - -#ifdef MAC_TCL -EXTERN int Tcl_EchoCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -EXTERN int Tcl_LsObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_BeepObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_MacSourceObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ResourceObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -#endif - -/* - *---------------------------------------------------------------- - * Compilation procedures for commands in the generic core: - *---------------------------------------------------------------- - */ - -EXTERN int TclCompileBreakCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileCatchCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileContinueCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileExprCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileForCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileForeachCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileIfCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileIncrCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileSetCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); -EXTERN int TclCompileWhileCmd _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr, struct CompileEnv *envPtr)); - -/* - *---------------------------------------------------------------- - * Macros used by the Tcl core to create and release Tcl objects. - * TclNewObj(objPtr) creates a new object denoting an empty string. - * TclDecrRefCount(objPtr) decrements the object's reference count, - * and frees the object if its reference count is zero. - * These macros are inline versions of Tcl_NewObj() and - * Tcl_DecrRefCount(). Notice that the names differ in not having - * a "_" after the "Tcl". Notice also that these macros reference - * their argument more than once, so you should avoid calling them - * with an expression that is expensive to compute or has - * side effects. The ANSI C "prototypes" for these macros are: - * - * EXTERN void TclNewObj _ANSI_ARGS_((Tcl_Obj *objPtr)); - * EXTERN void TclDecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); - *---------------------------------------------------------------- - */ - -#ifdef TCL_COMPILE_STATS -# define TclIncrObjsAllocated() \ - tclObjsAlloced++ -# define TclIncrObjsFreed() \ - tclObjsFreed++ -#else -# define TclIncrObjsAllocated() -# define TclIncrObjsFreed() -#endif /* TCL_COMPILE_STATS */ - -#ifdef TCL_MEM_DEBUG -# define TclNewObj(objPtr) \ - (objPtr) = (Tcl_Obj *) \ - Tcl_DbCkalloc(sizeof(Tcl_Obj), __FILE__, __LINE__); \ - (objPtr)->refCount = 0; \ - (objPtr)->bytes = tclEmptyStringRep; \ - (objPtr)->length = 0; \ - (objPtr)->typePtr = NULL; \ - TclIncrObjsAllocated() - -# define TclDbNewObj(objPtr, file, line) \ - (objPtr) = (Tcl_Obj *) Tcl_DbCkalloc(sizeof(Tcl_Obj), (file), (line)); \ - (objPtr)->refCount = 0; \ - (objPtr)->bytes = tclEmptyStringRep; \ - (objPtr)->length = 0; \ - (objPtr)->typePtr = NULL; \ - TclIncrObjsAllocated() - -# define TclDecrRefCount(objPtr) \ - if (--(objPtr)->refCount <= 0) { \ - if ((objPtr)->refCount < -1) \ - panic("Reference count for %lx was negative: %s line %d", \ - (objPtr), __FILE__, __LINE__); \ - if (((objPtr)->bytes != NULL) \ - && ((objPtr)->bytes != tclEmptyStringRep)) { \ - ckfree((char *) (objPtr)->bytes); \ - } \ - if (((objPtr)->typePtr != NULL) \ - && ((objPtr)->typePtr->freeIntRepProc != NULL)) { \ - (objPtr)->typePtr->freeIntRepProc(objPtr); \ - } \ - ckfree((char *) (objPtr)); \ - TclIncrObjsFreed(); \ - } - -#else /* not TCL_MEM_DEBUG */ - -#ifdef TCL_THREADS -extern Tcl_Mutex tclObjMutex; -#endif - -# define TclNewObj(objPtr) \ - Tcl_MutexLock(&tclObjMutex); \ - if (tclFreeObjList == NULL) { \ - TclAllocateFreeObjects(); \ - } \ - (objPtr) = tclFreeObjList; \ - tclFreeObjList = (Tcl_Obj *) \ - tclFreeObjList->internalRep.otherValuePtr; \ - (objPtr)->refCount = 0; \ - (objPtr)->bytes = tclEmptyStringRep; \ - (objPtr)->length = 0; \ - (objPtr)->typePtr = NULL; \ - TclIncrObjsAllocated(); \ - Tcl_MutexUnlock(&tclObjMutex) - -# define TclDecrRefCount(objPtr) \ - if (--(objPtr)->refCount <= 0) { \ - if (((objPtr)->bytes != NULL) \ - && ((objPtr)->bytes != tclEmptyStringRep)) { \ - ckfree((char *) (objPtr)->bytes); \ - } \ - if (((objPtr)->typePtr != NULL) \ - && ((objPtr)->typePtr->freeIntRepProc != NULL)) { \ - (objPtr)->typePtr->freeIntRepProc(objPtr); \ - } \ - Tcl_MutexLock(&tclObjMutex); \ - (objPtr)->internalRep.otherValuePtr = (VOID *) tclFreeObjList; \ - tclFreeObjList = (objPtr); \ - TclIncrObjsFreed(); \ - Tcl_MutexUnlock(&tclObjMutex); \ - } -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------- - * Macro used by the Tcl core to set a Tcl_Obj's string representation - * to a copy of the "len" bytes starting at "bytePtr". This code - * works even if the byte array contains NULLs as long as the length - * is correct. Because "len" is referenced multiple times, it should - * be as simple an expression as possible. The ANSI C "prototype" for - * this macro is: - * - * EXTERN void TclInitStringRep _ANSI_ARGS_((Tcl_Obj *objPtr, - * char *bytePtr, int len)); - *---------------------------------------------------------------- - */ - -#define TclInitStringRep(objPtr, bytePtr, len) \ - if ((len) == 0) { \ - (objPtr)->bytes = tclEmptyStringRep; \ - (objPtr)->length = 0; \ - } else { \ - (objPtr)->bytes = (char *) ckalloc((unsigned) ((len) + 1)); \ - memcpy((VOID *) (objPtr)->bytes, (VOID *) (bytePtr), \ - (unsigned) (len)); \ - (objPtr)->bytes[len] = '\0'; \ - (objPtr)->length = (len); \ - } - -/* - *---------------------------------------------------------------- - * Macro used by the Tcl core to get the string representation's - * byte array pointer from a Tcl_Obj. This is an inline version - * of Tcl_GetString(). The macro's expression result is the string - * rep's byte pointer which might be NULL. The bytes referenced by - * this pointer must not be modified by the caller. - * The ANSI C "prototype" for this macro is: - * - * EXTERN char * TclGetString _ANSI_ARGS_((Tcl_Obj *objPtr)); - *---------------------------------------------------------------- - */ - -#define TclGetString(objPtr) \ - ((objPtr)->bytes? (objPtr)->bytes : Tcl_GetString((objPtr))) - -#include "tclIntDecls.h" - -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLIMPORT - -#endif /* _TCLINT */ - diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h deleted file mode 100644 index a2b2ac2..0000000 --- a/generic/tclIntDecls.h +++ /dev/null @@ -1,1134 +0,0 @@ -/* - * tclIntDecls.h -- - * - * This file contains the declarations for all unsupported - * functions that are exported by the Tcl library. These - * interfaces are not guaranteed to remain the same between - * versions. Use at your own risk. - * - * 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. - * - * RCS: @(#) $Id: tclIntDecls.h,v 1.4 1999/04/16 00:46:48 stanton Exp $ - */ - -#ifndef _TCLINTDECLS -#define _TCLINTDECLS - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tclInt.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported function declarations: - */ - -/* 0 */ -EXTERN int TclAccess _ANSI_ARGS_((CONST char * path, int mode)); -/* 1 */ -EXTERN int TclAccessDeleteProc _ANSI_ARGS_(( - TclAccessProc_ * proc)); -/* 2 */ -EXTERN int TclAccessInsertProc _ANSI_ARGS_(( - TclAccessProc_ * proc)); -/* 3 */ -EXTERN void TclAllocateFreeObjects _ANSI_ARGS_((void)); -/* Slot 4 is reserved */ -/* 5 */ -EXTERN int TclCleanupChildren _ANSI_ARGS_((Tcl_Interp * interp, - int numPids, Tcl_Pid * pidPtr, - Tcl_Channel errorChan)); -/* 6 */ -EXTERN void TclCleanupCommand _ANSI_ARGS_((Command * cmdPtr)); -/* 7 */ -EXTERN int TclCopyAndCollapse _ANSI_ARGS_((int count, - CONST char * src, char * dst)); -/* 8 */ -EXTERN int TclCopyChannel _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Channel inChan, Tcl_Channel outChan, - int toRead, Tcl_Obj * cmdPtr)); -/* 9 */ -EXTERN int TclCreatePipeline _ANSI_ARGS_((Tcl_Interp * interp, - int argc, char ** argv, - Tcl_Pid ** pidArrayPtr, TclFile * inPipePtr, - TclFile * outPipePtr, TclFile * errFilePtr)); -/* 10 */ -EXTERN int TclCreateProc _ANSI_ARGS_((Tcl_Interp * interp, - Namespace * nsPtr, char * procName, - Tcl_Obj * argsPtr, Tcl_Obj * bodyPtr, - Proc ** procPtrPtr)); -/* 11 */ -EXTERN void TclDeleteCompiledLocalVars _ANSI_ARGS_(( - Interp * iPtr, CallFrame * framePtr)); -/* 12 */ -EXTERN void TclDeleteVars _ANSI_ARGS_((Interp * iPtr, - Tcl_HashTable * tablePtr)); -/* 13 */ -EXTERN int TclDoGlob _ANSI_ARGS_((Tcl_Interp * interp, - char * separators, Tcl_DString * headPtr, - char * tail)); -/* 14 */ -EXTERN void TclDumpMemoryInfo _ANSI_ARGS_((FILE * outFile)); -/* Slot 15 is reserved */ -/* 16 */ -EXTERN void TclExprFloatError _ANSI_ARGS_((Tcl_Interp * interp, - double value)); -/* 17 */ -EXTERN int TclFileAttrsCmd _ANSI_ARGS_((Tcl_Interp * interp, - int objc, Tcl_Obj *CONST objv[])); -/* 18 */ -EXTERN int TclFileCopyCmd _ANSI_ARGS_((Tcl_Interp * interp, - int argc, char ** argv)); -/* 19 */ -EXTERN int TclFileDeleteCmd _ANSI_ARGS_((Tcl_Interp * interp, - int argc, char ** argv)); -/* 20 */ -EXTERN int TclFileMakeDirsCmd _ANSI_ARGS_((Tcl_Interp * interp, - int argc, char ** argv)); -/* 21 */ -EXTERN int TclFileRenameCmd _ANSI_ARGS_((Tcl_Interp * interp, - int argc, char ** argv)); -/* 22 */ -EXTERN int TclFindElement _ANSI_ARGS_((Tcl_Interp * interp, - CONST char * listStr, int listLength, - CONST char ** elementPtr, - CONST char ** nextPtr, int * sizePtr, - int * bracePtr)); -/* 23 */ -EXTERN Proc * TclFindProc _ANSI_ARGS_((Interp * iPtr, - char * procName)); -/* 24 */ -EXTERN int TclFormatInt _ANSI_ARGS_((char * buffer, long n)); -/* 25 */ -EXTERN void TclFreePackageInfo _ANSI_ARGS_((Interp * iPtr)); -/* Slot 26 is reserved */ -/* 27 */ -EXTERN int TclGetDate _ANSI_ARGS_((char * p, unsigned long now, - long zone, unsigned long * timePtr)); -/* 28 */ -EXTERN Tcl_Channel TclpGetDefaultStdChannel _ANSI_ARGS_((int type)); -/* 29 */ -EXTERN Tcl_Obj * TclGetElementOfIndexedArray _ANSI_ARGS_(( - Tcl_Interp * interp, int localIndex, - Tcl_Obj * elemPtr, int leaveErrorMsg)); -/* Slot 30 is reserved */ -/* 31 */ -EXTERN char * TclGetExtension _ANSI_ARGS_((char * name)); -/* 32 */ -EXTERN int TclGetFrame _ANSI_ARGS_((Tcl_Interp * interp, - char * str, CallFrame ** framePtrPtr)); -/* 33 */ -EXTERN TclCmdProcType TclGetInterpProc _ANSI_ARGS_((void)); -/* 34 */ -EXTERN int TclGetIntForIndex _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * objPtr, int endValue, - int * indexPtr)); -/* 35 */ -EXTERN Tcl_Obj * TclGetIndexedScalar _ANSI_ARGS_((Tcl_Interp * interp, - int localIndex, int leaveErrorMsg)); -/* 36 */ -EXTERN int TclGetLong _ANSI_ARGS_((Tcl_Interp * interp, - char * str, long * longPtr)); -/* 37 */ -EXTERN int TclGetLoadedPackages _ANSI_ARGS_(( - Tcl_Interp * interp, char * targetName)); -/* 38 */ -EXTERN int TclGetNamespaceForQualName _ANSI_ARGS_(( - Tcl_Interp * interp, char * qualName, - Namespace * cxtNsPtr, int flags, - Namespace ** nsPtrPtr, - Namespace ** altNsPtrPtr, - Namespace ** actualCxtPtrPtr, - char ** simpleNamePtr)); -/* 39 */ -EXTERN TclObjCmdProcType TclGetObjInterpProc _ANSI_ARGS_((void)); -/* 40 */ -EXTERN int TclGetOpenMode _ANSI_ARGS_((Tcl_Interp * interp, - char * str, int * seekFlagPtr)); -/* 41 */ -EXTERN Tcl_Command TclGetOriginalCommand _ANSI_ARGS_(( - Tcl_Command command)); -/* 42 */ -EXTERN char * TclpGetUserHome _ANSI_ARGS_((CONST char * name, - Tcl_DString * bufferPtr)); -/* 43 */ -EXTERN int TclGlobalInvoke _ANSI_ARGS_((Tcl_Interp * interp, - int argc, char ** argv, int flags)); -/* 44 */ -EXTERN int TclGuessPackageName _ANSI_ARGS_((char * fileName, - Tcl_DString * bufPtr)); -/* 45 */ -EXTERN int TclHideUnsafeCommands _ANSI_ARGS_(( - Tcl_Interp * interp)); -/* 46 */ -EXTERN int TclInExit _ANSI_ARGS_((void)); -/* 47 */ -EXTERN Tcl_Obj * TclIncrElementOfIndexedArray _ANSI_ARGS_(( - Tcl_Interp * interp, int localIndex, - Tcl_Obj * elemPtr, long incrAmount)); -/* 48 */ -EXTERN Tcl_Obj * TclIncrIndexedScalar _ANSI_ARGS_(( - Tcl_Interp * interp, int localIndex, - long incrAmount)); -/* 49 */ -EXTERN Tcl_Obj * TclIncrVar2 _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, - long incrAmount, int part1NotParsed)); -/* 50 */ -EXTERN void TclInitCompiledLocals _ANSI_ARGS_(( - Tcl_Interp * interp, CallFrame * framePtr, - Namespace * nsPtr)); -/* 51 */ -EXTERN int TclInterpInit _ANSI_ARGS_((Tcl_Interp * interp)); -/* 52 */ -EXTERN int TclInvoke _ANSI_ARGS_((Tcl_Interp * interp, int argc, - char ** argv, int flags)); -/* 53 */ -EXTERN int TclInvokeObjectCommand _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp * interp, - int argc, char ** argv)); -/* 54 */ -EXTERN int TclInvokeStringCommand _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp * interp, - int objc, Tcl_Obj *CONST objv[])); -/* 55 */ -EXTERN Proc * TclIsProc _ANSI_ARGS_((Command * cmdPtr)); -/* Slot 56 is reserved */ -/* Slot 57 is reserved */ -/* 58 */ -EXTERN Var * TclLookupVar _ANSI_ARGS_((Tcl_Interp * interp, - char * part1, char * part2, int flags, - char * msg, int createPart1, int createPart2, - Var ** arrayPtrPtr)); -/* 59 */ -EXTERN int TclpMatchFiles _ANSI_ARGS_((Tcl_Interp * interp, - char * separators, Tcl_DString * dirPtr, - char * pattern, char * tail)); -/* 60 */ -EXTERN int TclNeedSpace _ANSI_ARGS_((char * start, char * end)); -/* 61 */ -EXTERN Tcl_Obj * TclNewProcBodyObj _ANSI_ARGS_((Proc * procPtr)); -/* 62 */ -EXTERN int TclObjCommandComplete _ANSI_ARGS_((Tcl_Obj * cmdPtr)); -/* 63 */ -EXTERN int TclObjInterpProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp * interp, int objc, - Tcl_Obj *CONST objv[])); -/* 64 */ -EXTERN int TclObjInvoke _ANSI_ARGS_((Tcl_Interp * interp, - int objc, Tcl_Obj *CONST objv[], int flags)); -/* 65 */ -EXTERN int TclObjInvokeGlobal _ANSI_ARGS_((Tcl_Interp * interp, - int objc, Tcl_Obj *CONST objv[], int flags)); -/* 66 */ -EXTERN int TclOpenFileChannelDeleteProc _ANSI_ARGS_(( - TclOpenFileChannelProc_ * proc)); -/* 67 */ -EXTERN int TclOpenFileChannelInsertProc _ANSI_ARGS_(( - TclOpenFileChannelProc_ * proc)); -/* 68 */ -EXTERN int TclpAccess _ANSI_ARGS_((CONST char * path, int mode)); -/* 69 */ -EXTERN char * TclpAlloc _ANSI_ARGS_((unsigned int size)); -/* 70 */ -EXTERN int TclpCopyFile _ANSI_ARGS_((CONST char * source, - CONST char * dest)); -/* 71 */ -EXTERN int TclpCopyDirectory _ANSI_ARGS_((CONST char * source, - CONST char * dest, Tcl_DString * errorPtr)); -/* 72 */ -EXTERN int TclpCreateDirectory _ANSI_ARGS_((CONST char * path)); -/* 73 */ -EXTERN int TclpDeleteFile _ANSI_ARGS_((CONST char * path)); -/* 74 */ -EXTERN void TclpFree _ANSI_ARGS_((char * ptr)); -/* 75 */ -EXTERN unsigned long TclpGetClicks _ANSI_ARGS_((void)); -/* 76 */ -EXTERN unsigned long TclpGetSeconds _ANSI_ARGS_((void)); -/* 77 */ -EXTERN void TclpGetTime _ANSI_ARGS_((Tcl_Time * time)); -/* 78 */ -EXTERN int TclpGetTimeZone _ANSI_ARGS_((unsigned long time)); -/* 79 */ -EXTERN int TclpListVolumes _ANSI_ARGS_((Tcl_Interp * interp)); -/* 80 */ -EXTERN Tcl_Channel TclpOpenFileChannel _ANSI_ARGS_((Tcl_Interp * interp, - char * fileName, char * modeString, - int permissions)); -/* 81 */ -EXTERN char * TclpRealloc _ANSI_ARGS_((char * ptr, - unsigned int size)); -/* 82 */ -EXTERN int TclpRemoveDirectory _ANSI_ARGS_((CONST char * path, - int recursive, Tcl_DString * errorPtr)); -/* 83 */ -EXTERN int TclpRenameFile _ANSI_ARGS_((CONST char * source, - CONST char * dest)); -/* Slot 84 is reserved */ -/* Slot 85 is reserved */ -/* Slot 86 is reserved */ -/* Slot 87 is reserved */ -/* 88 */ -EXTERN char * TclPrecTraceProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp * interp, char * name1, - char * name2, int flags)); -/* 89 */ -EXTERN int TclPreventAliasLoop _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Interp * cmdInterp, Tcl_Command cmd)); -/* Slot 90 is reserved */ -/* 91 */ -EXTERN void TclProcCleanupProc _ANSI_ARGS_((Proc * procPtr)); -/* 92 */ -EXTERN int TclProcCompileProc _ANSI_ARGS_((Tcl_Interp * interp, - Proc * procPtr, Tcl_Obj * bodyPtr, - Namespace * nsPtr, CONST char * description, - CONST char * procName)); -/* 93 */ -EXTERN void TclProcDeleteProc _ANSI_ARGS_((ClientData clientData)); -/* 94 */ -EXTERN int TclProcInterpProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp * interp, int argc, char ** argv)); -/* 95 */ -EXTERN int TclpStat _ANSI_ARGS_((CONST char * path, - struct stat * buf)); -/* 96 */ -EXTERN int TclRenameCommand _ANSI_ARGS_((Tcl_Interp * interp, - char * oldName, char * newName)); -/* 97 */ -EXTERN void TclResetShadowedCmdRefs _ANSI_ARGS_(( - Tcl_Interp * interp, Command * newCmdPtr)); -/* 98 */ -EXTERN int TclServiceIdle _ANSI_ARGS_((void)); -/* 99 */ -EXTERN Tcl_Obj * TclSetElementOfIndexedArray _ANSI_ARGS_(( - Tcl_Interp * interp, int localIndex, - Tcl_Obj * elemPtr, Tcl_Obj * objPtr, - int leaveErrorMsg)); -/* 100 */ -EXTERN Tcl_Obj * TclSetIndexedScalar _ANSI_ARGS_((Tcl_Interp * interp, - int localIndex, Tcl_Obj * objPtr, - int leaveErrorMsg)); -/* Slot 101 is reserved */ -/* 102 */ -EXTERN void TclSetupEnv _ANSI_ARGS_((Tcl_Interp * interp)); -/* 103 */ -EXTERN int TclSockGetPort _ANSI_ARGS_((Tcl_Interp * interp, - char * str, char * proto, int * portPtr)); -/* 104 */ -EXTERN int TclSockMinimumBuffers _ANSI_ARGS_((int sock, - int size)); -/* 105 */ -EXTERN int TclStat _ANSI_ARGS_((CONST char * path, - TclStat_ * buf)); -/* 106 */ -EXTERN int TclStatDeleteProc _ANSI_ARGS_((TclStatProc_ * proc)); -/* 107 */ -EXTERN int TclStatInsertProc _ANSI_ARGS_((TclStatProc_ * proc)); -/* 108 */ -EXTERN void TclTeardownNamespace _ANSI_ARGS_((Namespace * nsPtr)); -/* 109 */ -EXTERN int TclUpdateReturnInfo _ANSI_ARGS_((Interp * iPtr)); -/* Slot 110 is reserved */ -/* 111 */ -EXTERN void Tcl_AddInterpResolvers _ANSI_ARGS_(( - Tcl_Interp * interp, char * name, - Tcl_ResolveCmdProc * cmdProc, - Tcl_ResolveVarProc * varProc, - Tcl_ResolveCompiledVarProc * compiledVarProc)); -/* 112 */ -EXTERN int Tcl_AppendExportList _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Namespace * nsPtr, - Tcl_Obj * objPtr)); -/* 113 */ -EXTERN Tcl_Namespace * Tcl_CreateNamespace _ANSI_ARGS_((Tcl_Interp * interp, - char * name, ClientData clientData, - Tcl_NamespaceDeleteProc * deleteProc)); -/* 114 */ -EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_(( - Tcl_Namespace * nsPtr)); -/* 115 */ -EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Namespace * nsPtr, char * pattern, - int resetListFirst)); -/* 116 */ -EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp * interp, - char * name, Tcl_Namespace * contextNsPtr, - int flags)); -/* 117 */ -EXTERN Tcl_Namespace * Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp * interp, - char * name, Tcl_Namespace * contextNsPtr, - int flags)); -/* 118 */ -EXTERN int Tcl_GetInterpResolvers _ANSI_ARGS_(( - Tcl_Interp * interp, char * name, - Tcl_ResolverInfo * resInfo)); -/* 119 */ -EXTERN int Tcl_GetNamespaceResolvers _ANSI_ARGS_(( - Tcl_Namespace * namespacePtr, - Tcl_ResolverInfo * resInfo)); -/* 120 */ -EXTERN Tcl_Var Tcl_FindNamespaceVar _ANSI_ARGS_(( - Tcl_Interp * interp, char * name, - Tcl_Namespace * contextNsPtr, int flags)); -/* 121 */ -EXTERN int Tcl_ForgetImport _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Namespace * nsPtr, char * pattern)); -/* 122 */ -EXTERN Tcl_Command Tcl_GetCommandFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr)); -/* 123 */ -EXTERN void Tcl_GetCommandFullName _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Command command, - Tcl_Obj * objPtr)); -/* 124 */ -EXTERN Tcl_Namespace * Tcl_GetCurrentNamespace _ANSI_ARGS_(( - Tcl_Interp * interp)); -/* 125 */ -EXTERN Tcl_Namespace * Tcl_GetGlobalNamespace _ANSI_ARGS_(( - Tcl_Interp * interp)); -/* 126 */ -EXTERN void Tcl_GetVariableFullName _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Var variable, - Tcl_Obj * objPtr)); -/* 127 */ -EXTERN int Tcl_Import _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Namespace * nsPtr, char * pattern, - int allowOverwrite)); -/* 128 */ -EXTERN void Tcl_PopCallFrame _ANSI_ARGS_((Tcl_Interp* interp)); -/* 129 */ -EXTERN int Tcl_PushCallFrame _ANSI_ARGS_((Tcl_Interp* interp, - Tcl_CallFrame * framePtr, - Tcl_Namespace * nsPtr, int isProcCallFrame)); -/* 130 */ -EXTERN int Tcl_RemoveInterpResolvers _ANSI_ARGS_(( - Tcl_Interp * interp, char * name)); -/* 131 */ -EXTERN void Tcl_SetNamespaceResolvers _ANSI_ARGS_(( - Tcl_Namespace * namespacePtr, - Tcl_ResolveCmdProc * cmdProc, - Tcl_ResolveVarProc * varProc, - Tcl_ResolveCompiledVarProc * compiledVarProc)); -/* 132 */ -EXTERN int TclpHasSockets _ANSI_ARGS_((Tcl_Interp * interp)); -/* 133 */ -EXTERN struct tm * TclpGetDate _ANSI_ARGS_((TclpTime_t time, int useGMT)); -/* 134 */ -EXTERN size_t TclpStrftime _ANSI_ARGS_((char * s, size_t maxsize, - CONST char * format, CONST struct tm * t)); -/* 135 */ -EXTERN int TclpCheckStackSpace _ANSI_ARGS_((void)); -/* Slot 136 is reserved */ -/* 137 */ -EXTERN int TclpChdir _ANSI_ARGS_((CONST char * dirName)); -/* 138 */ -EXTERN char * TclGetEnv _ANSI_ARGS_((CONST char * name, - Tcl_DString * valuePtr)); -/* 139 */ -EXTERN int TclpLoadFile _ANSI_ARGS_((Tcl_Interp * interp, - char * fileName, char * sym1, char * sym2, - Tcl_PackageInitProc ** proc1Ptr, - Tcl_PackageInitProc ** proc2Ptr, - ClientData * clientDataPtr)); -/* 140 */ -EXTERN int TclLooksLikeInt _ANSI_ARGS_((char * bytes, - int length)); -/* 141 */ -EXTERN char * TclpGetCwd _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_DString * cwdPtr)); - -typedef struct TclIntStubs { - int magic; - struct TclIntStubHooks *hooks; - - int (*tclAccess) _ANSI_ARGS_((CONST char * path, int mode)); /* 0 */ - int (*tclAccessDeleteProc) _ANSI_ARGS_((TclAccessProc_ * proc)); /* 1 */ - int (*tclAccessInsertProc) _ANSI_ARGS_((TclAccessProc_ * proc)); /* 2 */ - void (*tclAllocateFreeObjects) _ANSI_ARGS_((void)); /* 3 */ - void *reserved4; - int (*tclCleanupChildren) _ANSI_ARGS_((Tcl_Interp * interp, int numPids, Tcl_Pid * pidPtr, Tcl_Channel errorChan)); /* 5 */ - void (*tclCleanupCommand) _ANSI_ARGS_((Command * cmdPtr)); /* 6 */ - int (*tclCopyAndCollapse) _ANSI_ARGS_((int count, CONST char * src, char * dst)); /* 7 */ - int (*tclCopyChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel inChan, Tcl_Channel outChan, int toRead, Tcl_Obj * cmdPtr)); /* 8 */ - int (*tclCreatePipeline) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv, Tcl_Pid ** pidArrayPtr, TclFile * inPipePtr, TclFile * outPipePtr, TclFile * errFilePtr)); /* 9 */ - int (*tclCreateProc) _ANSI_ARGS_((Tcl_Interp * interp, Namespace * nsPtr, char * procName, Tcl_Obj * argsPtr, Tcl_Obj * bodyPtr, Proc ** procPtrPtr)); /* 10 */ - void (*tclDeleteCompiledLocalVars) _ANSI_ARGS_((Interp * iPtr, CallFrame * framePtr)); /* 11 */ - void (*tclDeleteVars) _ANSI_ARGS_((Interp * iPtr, Tcl_HashTable * tablePtr)); /* 12 */ - int (*tclDoGlob) _ANSI_ARGS_((Tcl_Interp * interp, char * separators, Tcl_DString * headPtr, char * tail)); /* 13 */ - void (*tclDumpMemoryInfo) _ANSI_ARGS_((FILE * outFile)); /* 14 */ - void *reserved15; - void (*tclExprFloatError) _ANSI_ARGS_((Tcl_Interp * interp, double value)); /* 16 */ - int (*tclFileAttrsCmd) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 17 */ - int (*tclFileCopyCmd) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv)); /* 18 */ - int (*tclFileDeleteCmd) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv)); /* 19 */ - int (*tclFileMakeDirsCmd) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv)); /* 20 */ - int (*tclFileRenameCmd) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv)); /* 21 */ - int (*tclFindElement) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * listStr, int listLength, CONST char ** elementPtr, CONST char ** nextPtr, int * sizePtr, int * bracePtr)); /* 22 */ - Proc * (*tclFindProc) _ANSI_ARGS_((Interp * iPtr, char * procName)); /* 23 */ - int (*tclFormatInt) _ANSI_ARGS_((char * buffer, long n)); /* 24 */ - void (*tclFreePackageInfo) _ANSI_ARGS_((Interp * iPtr)); /* 25 */ - void *reserved26; - int (*tclGetDate) _ANSI_ARGS_((char * p, unsigned long now, long zone, unsigned long * timePtr)); /* 27 */ - Tcl_Channel (*tclpGetDefaultStdChannel) _ANSI_ARGS_((int type)); /* 28 */ - Tcl_Obj * (*tclGetElementOfIndexedArray) _ANSI_ARGS_((Tcl_Interp * interp, int localIndex, Tcl_Obj * elemPtr, int leaveErrorMsg)); /* 29 */ - void *reserved30; - char * (*tclGetExtension) _ANSI_ARGS_((char * name)); /* 31 */ - int (*tclGetFrame) _ANSI_ARGS_((Tcl_Interp * interp, char * str, CallFrame ** framePtrPtr)); /* 32 */ - TclCmdProcType (*tclGetInterpProc) _ANSI_ARGS_((void)); /* 33 */ - int (*tclGetIntForIndex) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int endValue, int * indexPtr)); /* 34 */ - Tcl_Obj * (*tclGetIndexedScalar) _ANSI_ARGS_((Tcl_Interp * interp, int localIndex, int leaveErrorMsg)); /* 35 */ - int (*tclGetLong) _ANSI_ARGS_((Tcl_Interp * interp, char * str, long * longPtr)); /* 36 */ - int (*tclGetLoadedPackages) _ANSI_ARGS_((Tcl_Interp * interp, char * targetName)); /* 37 */ - int (*tclGetNamespaceForQualName) _ANSI_ARGS_((Tcl_Interp * interp, char * qualName, Namespace * cxtNsPtr, int flags, Namespace ** nsPtrPtr, Namespace ** altNsPtrPtr, Namespace ** actualCxtPtrPtr, char ** simpleNamePtr)); /* 38 */ - TclObjCmdProcType (*tclGetObjInterpProc) _ANSI_ARGS_((void)); /* 39 */ - int (*tclGetOpenMode) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * seekFlagPtr)); /* 40 */ - Tcl_Command (*tclGetOriginalCommand) _ANSI_ARGS_((Tcl_Command command)); /* 41 */ - char * (*tclpGetUserHome) _ANSI_ARGS_((CONST char * name, Tcl_DString * bufferPtr)); /* 42 */ - int (*tclGlobalInvoke) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv, int flags)); /* 43 */ - int (*tclGuessPackageName) _ANSI_ARGS_((char * fileName, Tcl_DString * bufPtr)); /* 44 */ - int (*tclHideUnsafeCommands) _ANSI_ARGS_((Tcl_Interp * interp)); /* 45 */ - int (*tclInExit) _ANSI_ARGS_((void)); /* 46 */ - Tcl_Obj * (*tclIncrElementOfIndexedArray) _ANSI_ARGS_((Tcl_Interp * interp, int localIndex, Tcl_Obj * elemPtr, long incrAmount)); /* 47 */ - Tcl_Obj * (*tclIncrIndexedScalar) _ANSI_ARGS_((Tcl_Interp * interp, int localIndex, long incrAmount)); /* 48 */ - Tcl_Obj * (*tclIncrVar2) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, long incrAmount, int part1NotParsed)); /* 49 */ - void (*tclInitCompiledLocals) _ANSI_ARGS_((Tcl_Interp * interp, CallFrame * framePtr, Namespace * nsPtr)); /* 50 */ - int (*tclInterpInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 51 */ - int (*tclInvoke) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv, int flags)); /* 52 */ - int (*tclInvokeObjectCommand) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int argc, char ** argv)); /* 53 */ - int (*tclInvokeStringCommand) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 54 */ - Proc * (*tclIsProc) _ANSI_ARGS_((Command * cmdPtr)); /* 55 */ - void *reserved56; - void *reserved57; - Var * (*tclLookupVar) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* 58 */ - int (*tclpMatchFiles) _ANSI_ARGS_((Tcl_Interp * interp, char * separators, Tcl_DString * dirPtr, char * pattern, char * tail)); /* 59 */ - int (*tclNeedSpace) _ANSI_ARGS_((char * start, char * end)); /* 60 */ - Tcl_Obj * (*tclNewProcBodyObj) _ANSI_ARGS_((Proc * procPtr)); /* 61 */ - int (*tclObjCommandComplete) _ANSI_ARGS_((Tcl_Obj * cmdPtr)); /* 62 */ - int (*tclObjInterpProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 63 */ - int (*tclObjInvoke) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], int flags)); /* 64 */ - int (*tclObjInvokeGlobal) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], int flags)); /* 65 */ - int (*tclOpenFileChannelDeleteProc) _ANSI_ARGS_((TclOpenFileChannelProc_ * proc)); /* 66 */ - int (*tclOpenFileChannelInsertProc) _ANSI_ARGS_((TclOpenFileChannelProc_ * proc)); /* 67 */ - int (*tclpAccess) _ANSI_ARGS_((CONST char * path, int mode)); /* 68 */ - char * (*tclpAlloc) _ANSI_ARGS_((unsigned int size)); /* 69 */ - int (*tclpCopyFile) _ANSI_ARGS_((CONST char * source, CONST char * dest)); /* 70 */ - int (*tclpCopyDirectory) _ANSI_ARGS_((CONST char * source, CONST char * dest, Tcl_DString * errorPtr)); /* 71 */ - int (*tclpCreateDirectory) _ANSI_ARGS_((CONST char * path)); /* 72 */ - int (*tclpDeleteFile) _ANSI_ARGS_((CONST char * path)); /* 73 */ - void (*tclpFree) _ANSI_ARGS_((char * ptr)); /* 74 */ - unsigned long (*tclpGetClicks) _ANSI_ARGS_((void)); /* 75 */ - unsigned long (*tclpGetSeconds) _ANSI_ARGS_((void)); /* 76 */ - void (*tclpGetTime) _ANSI_ARGS_((Tcl_Time * time)); /* 77 */ - int (*tclpGetTimeZone) _ANSI_ARGS_((unsigned long time)); /* 78 */ - int (*tclpListVolumes) _ANSI_ARGS_((Tcl_Interp * interp)); /* 79 */ - Tcl_Channel (*tclpOpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, char * fileName, char * modeString, int permissions)); /* 80 */ - char * (*tclpRealloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 81 */ - int (*tclpRemoveDirectory) _ANSI_ARGS_((CONST char * path, int recursive, Tcl_DString * errorPtr)); /* 82 */ - int (*tclpRenameFile) _ANSI_ARGS_((CONST char * source, CONST char * dest)); /* 83 */ - void *reserved84; - void *reserved85; - void *reserved86; - void *reserved87; - char * (*tclPrecTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, char * name1, char * name2, int flags)); /* 88 */ - int (*tclPreventAliasLoop) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Interp * cmdInterp, Tcl_Command cmd)); /* 89 */ - void *reserved90; - void (*tclProcCleanupProc) _ANSI_ARGS_((Proc * procPtr)); /* 91 */ - int (*tclProcCompileProc) _ANSI_ARGS_((Tcl_Interp * interp, Proc * procPtr, Tcl_Obj * bodyPtr, Namespace * nsPtr, CONST char * description, CONST char * procName)); /* 92 */ - void (*tclProcDeleteProc) _ANSI_ARGS_((ClientData clientData)); /* 93 */ - int (*tclProcInterpProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int argc, char ** argv)); /* 94 */ - int (*tclpStat) _ANSI_ARGS_((CONST char * path, struct stat * buf)); /* 95 */ - int (*tclRenameCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * oldName, char * newName)); /* 96 */ - void (*tclResetShadowedCmdRefs) _ANSI_ARGS_((Tcl_Interp * interp, Command * newCmdPtr)); /* 97 */ - int (*tclServiceIdle) _ANSI_ARGS_((void)); /* 98 */ - Tcl_Obj * (*tclSetElementOfIndexedArray) _ANSI_ARGS_((Tcl_Interp * interp, int localIndex, Tcl_Obj * elemPtr, Tcl_Obj * objPtr, int leaveErrorMsg)); /* 99 */ - Tcl_Obj * (*tclSetIndexedScalar) _ANSI_ARGS_((Tcl_Interp * interp, int localIndex, Tcl_Obj * objPtr, int leaveErrorMsg)); /* 100 */ - void *reserved101; - void (*tclSetupEnv) _ANSI_ARGS_((Tcl_Interp * interp)); /* 102 */ - int (*tclSockGetPort) _ANSI_ARGS_((Tcl_Interp * interp, char * str, char * proto, int * portPtr)); /* 103 */ - int (*tclSockMinimumBuffers) _ANSI_ARGS_((int sock, int size)); /* 104 */ - int (*tclStat) _ANSI_ARGS_((CONST char * path, TclStat_ * buf)); /* 105 */ - int (*tclStatDeleteProc) _ANSI_ARGS_((TclStatProc_ * proc)); /* 106 */ - int (*tclStatInsertProc) _ANSI_ARGS_((TclStatProc_ * proc)); /* 107 */ - void (*tclTeardownNamespace) _ANSI_ARGS_((Namespace * nsPtr)); /* 108 */ - int (*tclUpdateReturnInfo) _ANSI_ARGS_((Interp * iPtr)); /* 109 */ - void *reserved110; - void (*tcl_AddInterpResolvers) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_ResolveCmdProc * cmdProc, Tcl_ResolveVarProc * varProc, Tcl_ResolveCompiledVarProc * compiledVarProc)); /* 111 */ - int (*tcl_AppendExportList) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Namespace * nsPtr, Tcl_Obj * objPtr)); /* 112 */ - Tcl_Namespace * (*tcl_CreateNamespace) _ANSI_ARGS_((Tcl_Interp * interp, char * name, ClientData clientData, Tcl_NamespaceDeleteProc * deleteProc)); /* 113 */ - void (*tcl_DeleteNamespace) _ANSI_ARGS_((Tcl_Namespace * nsPtr)); /* 114 */ - int (*tcl_Export) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Namespace * nsPtr, char * pattern, int resetListFirst)); /* 115 */ - Tcl_Command (*tcl_FindCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_Namespace * contextNsPtr, int flags)); /* 116 */ - Tcl_Namespace * (*tcl_FindNamespace) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_Namespace * contextNsPtr, int flags)); /* 117 */ - int (*tcl_GetInterpResolvers) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_ResolverInfo * resInfo)); /* 118 */ - int (*tcl_GetNamespaceResolvers) _ANSI_ARGS_((Tcl_Namespace * namespacePtr, Tcl_ResolverInfo * resInfo)); /* 119 */ - Tcl_Var (*tcl_FindNamespaceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_Namespace * contextNsPtr, int flags)); /* 120 */ - int (*tcl_ForgetImport) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Namespace * nsPtr, char * pattern)); /* 121 */ - Tcl_Command (*tcl_GetCommandFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 122 */ - void (*tcl_GetCommandFullName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Command command, Tcl_Obj * objPtr)); /* 123 */ - Tcl_Namespace * (*tcl_GetCurrentNamespace) _ANSI_ARGS_((Tcl_Interp * interp)); /* 124 */ - Tcl_Namespace * (*tcl_GetGlobalNamespace) _ANSI_ARGS_((Tcl_Interp * interp)); /* 125 */ - void (*tcl_GetVariableFullName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Var variable, Tcl_Obj * objPtr)); /* 126 */ - int (*tcl_Import) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Namespace * nsPtr, char * pattern, int allowOverwrite)); /* 127 */ - void (*tcl_PopCallFrame) _ANSI_ARGS_((Tcl_Interp* interp)); /* 128 */ - int (*tcl_PushCallFrame) _ANSI_ARGS_((Tcl_Interp* interp, Tcl_CallFrame * framePtr, Tcl_Namespace * nsPtr, int isProcCallFrame)); /* 129 */ - int (*tcl_RemoveInterpResolvers) _ANSI_ARGS_((Tcl_Interp * interp, char * name)); /* 130 */ - void (*tcl_SetNamespaceResolvers) _ANSI_ARGS_((Tcl_Namespace * namespacePtr, Tcl_ResolveCmdProc * cmdProc, Tcl_ResolveVarProc * varProc, Tcl_ResolveCompiledVarProc * compiledVarProc)); /* 131 */ - int (*tclpHasSockets) _ANSI_ARGS_((Tcl_Interp * interp)); /* 132 */ - struct tm * (*tclpGetDate) _ANSI_ARGS_((TclpTime_t time, int useGMT)); /* 133 */ - size_t (*tclpStrftime) _ANSI_ARGS_((char * s, size_t maxsize, CONST char * format, CONST struct tm * t)); /* 134 */ - int (*tclpCheckStackSpace) _ANSI_ARGS_((void)); /* 135 */ - void *reserved136; - int (*tclpChdir) _ANSI_ARGS_((CONST char * dirName)); /* 137 */ - char * (*tclGetEnv) _ANSI_ARGS_((CONST char * name, Tcl_DString * valuePtr)); /* 138 */ - int (*tclpLoadFile) _ANSI_ARGS_((Tcl_Interp * interp, char * fileName, char * sym1, char * sym2, Tcl_PackageInitProc ** proc1Ptr, Tcl_PackageInitProc ** proc2Ptr, ClientData * clientDataPtr)); /* 139 */ - int (*tclLooksLikeInt) _ANSI_ARGS_((char * bytes, int length)); /* 140 */ - char * (*tclpGetCwd) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * cwdPtr)); /* 141 */ -} TclIntStubs; - -extern TclIntStubs *tclIntStubsPtr; - -#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) - -/* - * Inline function declarations: - */ - -#ifndef TclAccess -#define TclAccess \ - (tclIntStubsPtr->tclAccess) /* 0 */ -#endif -#ifndef TclAccessDeleteProc -#define TclAccessDeleteProc \ - (tclIntStubsPtr->tclAccessDeleteProc) /* 1 */ -#endif -#ifndef TclAccessInsertProc -#define TclAccessInsertProc \ - (tclIntStubsPtr->tclAccessInsertProc) /* 2 */ -#endif -#ifndef TclAllocateFreeObjects -#define TclAllocateFreeObjects \ - (tclIntStubsPtr->tclAllocateFreeObjects) /* 3 */ -#endif -/* Slot 4 is reserved */ -#ifndef TclCleanupChildren -#define TclCleanupChildren \ - (tclIntStubsPtr->tclCleanupChildren) /* 5 */ -#endif -#ifndef TclCleanupCommand -#define TclCleanupCommand \ - (tclIntStubsPtr->tclCleanupCommand) /* 6 */ -#endif -#ifndef TclCopyAndCollapse -#define TclCopyAndCollapse \ - (tclIntStubsPtr->tclCopyAndCollapse) /* 7 */ -#endif -#ifndef TclCopyChannel -#define TclCopyChannel \ - (tclIntStubsPtr->tclCopyChannel) /* 8 */ -#endif -#ifndef TclCreatePipeline -#define TclCreatePipeline \ - (tclIntStubsPtr->tclCreatePipeline) /* 9 */ -#endif -#ifndef TclCreateProc -#define TclCreateProc \ - (tclIntStubsPtr->tclCreateProc) /* 10 */ -#endif -#ifndef TclDeleteCompiledLocalVars -#define TclDeleteCompiledLocalVars \ - (tclIntStubsPtr->tclDeleteCompiledLocalVars) /* 11 */ -#endif -#ifndef TclDeleteVars -#define TclDeleteVars \ - (tclIntStubsPtr->tclDeleteVars) /* 12 */ -#endif -#ifndef TclDoGlob -#define TclDoGlob \ - (tclIntStubsPtr->tclDoGlob) /* 13 */ -#endif -#ifndef TclDumpMemoryInfo -#define TclDumpMemoryInfo \ - (tclIntStubsPtr->tclDumpMemoryInfo) /* 14 */ -#endif -/* Slot 15 is reserved */ -#ifndef TclExprFloatError -#define TclExprFloatError \ - (tclIntStubsPtr->tclExprFloatError) /* 16 */ -#endif -#ifndef TclFileAttrsCmd -#define TclFileAttrsCmd \ - (tclIntStubsPtr->tclFileAttrsCmd) /* 17 */ -#endif -#ifndef TclFileCopyCmd -#define TclFileCopyCmd \ - (tclIntStubsPtr->tclFileCopyCmd) /* 18 */ -#endif -#ifndef TclFileDeleteCmd -#define TclFileDeleteCmd \ - (tclIntStubsPtr->tclFileDeleteCmd) /* 19 */ -#endif -#ifndef TclFileMakeDirsCmd -#define TclFileMakeDirsCmd \ - (tclIntStubsPtr->tclFileMakeDirsCmd) /* 20 */ -#endif -#ifndef TclFileRenameCmd -#define TclFileRenameCmd \ - (tclIntStubsPtr->tclFileRenameCmd) /* 21 */ -#endif -#ifndef TclFindElement -#define TclFindElement \ - (tclIntStubsPtr->tclFindElement) /* 22 */ -#endif -#ifndef TclFindProc -#define TclFindProc \ - (tclIntStubsPtr->tclFindProc) /* 23 */ -#endif -#ifndef TclFormatInt -#define TclFormatInt \ - (tclIntStubsPtr->tclFormatInt) /* 24 */ -#endif -#ifndef TclFreePackageInfo -#define TclFreePackageInfo \ - (tclIntStubsPtr->tclFreePackageInfo) /* 25 */ -#endif -/* Slot 26 is reserved */ -#ifndef TclGetDate -#define TclGetDate \ - (tclIntStubsPtr->tclGetDate) /* 27 */ -#endif -#ifndef TclpGetDefaultStdChannel -#define TclpGetDefaultStdChannel \ - (tclIntStubsPtr->tclpGetDefaultStdChannel) /* 28 */ -#endif -#ifndef TclGetElementOfIndexedArray -#define TclGetElementOfIndexedArray \ - (tclIntStubsPtr->tclGetElementOfIndexedArray) /* 29 */ -#endif -/* Slot 30 is reserved */ -#ifndef TclGetExtension -#define TclGetExtension \ - (tclIntStubsPtr->tclGetExtension) /* 31 */ -#endif -#ifndef TclGetFrame -#define TclGetFrame \ - (tclIntStubsPtr->tclGetFrame) /* 32 */ -#endif -#ifndef TclGetInterpProc -#define TclGetInterpProc \ - (tclIntStubsPtr->tclGetInterpProc) /* 33 */ -#endif -#ifndef TclGetIntForIndex -#define TclGetIntForIndex \ - (tclIntStubsPtr->tclGetIntForIndex) /* 34 */ -#endif -#ifndef TclGetIndexedScalar -#define TclGetIndexedScalar \ - (tclIntStubsPtr->tclGetIndexedScalar) /* 35 */ -#endif -#ifndef TclGetLong -#define TclGetLong \ - (tclIntStubsPtr->tclGetLong) /* 36 */ -#endif -#ifndef TclGetLoadedPackages -#define TclGetLoadedPackages \ - (tclIntStubsPtr->tclGetLoadedPackages) /* 37 */ -#endif -#ifndef TclGetNamespaceForQualName -#define TclGetNamespaceForQualName \ - (tclIntStubsPtr->tclGetNamespaceForQualName) /* 38 */ -#endif -#ifndef TclGetObjInterpProc -#define TclGetObjInterpProc \ - (tclIntStubsPtr->tclGetObjInterpProc) /* 39 */ -#endif -#ifndef TclGetOpenMode -#define TclGetOpenMode \ - (tclIntStubsPtr->tclGetOpenMode) /* 40 */ -#endif -#ifndef TclGetOriginalCommand -#define TclGetOriginalCommand \ - (tclIntStubsPtr->tclGetOriginalCommand) /* 41 */ -#endif -#ifndef TclpGetUserHome -#define TclpGetUserHome \ - (tclIntStubsPtr->tclpGetUserHome) /* 42 */ -#endif -#ifndef TclGlobalInvoke -#define TclGlobalInvoke \ - (tclIntStubsPtr->tclGlobalInvoke) /* 43 */ -#endif -#ifndef TclGuessPackageName -#define TclGuessPackageName \ - (tclIntStubsPtr->tclGuessPackageName) /* 44 */ -#endif -#ifndef TclHideUnsafeCommands -#define TclHideUnsafeCommands \ - (tclIntStubsPtr->tclHideUnsafeCommands) /* 45 */ -#endif -#ifndef TclInExit -#define TclInExit \ - (tclIntStubsPtr->tclInExit) /* 46 */ -#endif -#ifndef TclIncrElementOfIndexedArray -#define TclIncrElementOfIndexedArray \ - (tclIntStubsPtr->tclIncrElementOfIndexedArray) /* 47 */ -#endif -#ifndef TclIncrIndexedScalar -#define TclIncrIndexedScalar \ - (tclIntStubsPtr->tclIncrIndexedScalar) /* 48 */ -#endif -#ifndef TclIncrVar2 -#define TclIncrVar2 \ - (tclIntStubsPtr->tclIncrVar2) /* 49 */ -#endif -#ifndef TclInitCompiledLocals -#define TclInitCompiledLocals \ - (tclIntStubsPtr->tclInitCompiledLocals) /* 50 */ -#endif -#ifndef TclInterpInit -#define TclInterpInit \ - (tclIntStubsPtr->tclInterpInit) /* 51 */ -#endif -#ifndef TclInvoke -#define TclInvoke \ - (tclIntStubsPtr->tclInvoke) /* 52 */ -#endif -#ifndef TclInvokeObjectCommand -#define TclInvokeObjectCommand \ - (tclIntStubsPtr->tclInvokeObjectCommand) /* 53 */ -#endif -#ifndef TclInvokeStringCommand -#define TclInvokeStringCommand \ - (tclIntStubsPtr->tclInvokeStringCommand) /* 54 */ -#endif -#ifndef TclIsProc -#define TclIsProc \ - (tclIntStubsPtr->tclIsProc) /* 55 */ -#endif -/* Slot 56 is reserved */ -/* Slot 57 is reserved */ -#ifndef TclLookupVar -#define TclLookupVar \ - (tclIntStubsPtr->tclLookupVar) /* 58 */ -#endif -#ifndef TclpMatchFiles -#define TclpMatchFiles \ - (tclIntStubsPtr->tclpMatchFiles) /* 59 */ -#endif -#ifndef TclNeedSpace -#define TclNeedSpace \ - (tclIntStubsPtr->tclNeedSpace) /* 60 */ -#endif -#ifndef TclNewProcBodyObj -#define TclNewProcBodyObj \ - (tclIntStubsPtr->tclNewProcBodyObj) /* 61 */ -#endif -#ifndef TclObjCommandComplete -#define TclObjCommandComplete \ - (tclIntStubsPtr->tclObjCommandComplete) /* 62 */ -#endif -#ifndef TclObjInterpProc -#define TclObjInterpProc \ - (tclIntStubsPtr->tclObjInterpProc) /* 63 */ -#endif -#ifndef TclObjInvoke -#define TclObjInvoke \ - (tclIntStubsPtr->tclObjInvoke) /* 64 */ -#endif -#ifndef TclObjInvokeGlobal -#define TclObjInvokeGlobal \ - (tclIntStubsPtr->tclObjInvokeGlobal) /* 65 */ -#endif -#ifndef TclOpenFileChannelDeleteProc -#define TclOpenFileChannelDeleteProc \ - (tclIntStubsPtr->tclOpenFileChannelDeleteProc) /* 66 */ -#endif -#ifndef TclOpenFileChannelInsertProc -#define TclOpenFileChannelInsertProc \ - (tclIntStubsPtr->tclOpenFileChannelInsertProc) /* 67 */ -#endif -#ifndef TclpAccess -#define TclpAccess \ - (tclIntStubsPtr->tclpAccess) /* 68 */ -#endif -#ifndef TclpAlloc -#define TclpAlloc \ - (tclIntStubsPtr->tclpAlloc) /* 69 */ -#endif -#ifndef TclpCopyFile -#define TclpCopyFile \ - (tclIntStubsPtr->tclpCopyFile) /* 70 */ -#endif -#ifndef TclpCopyDirectory -#define TclpCopyDirectory \ - (tclIntStubsPtr->tclpCopyDirectory) /* 71 */ -#endif -#ifndef TclpCreateDirectory -#define TclpCreateDirectory \ - (tclIntStubsPtr->tclpCreateDirectory) /* 72 */ -#endif -#ifndef TclpDeleteFile -#define TclpDeleteFile \ - (tclIntStubsPtr->tclpDeleteFile) /* 73 */ -#endif -#ifndef TclpFree -#define TclpFree \ - (tclIntStubsPtr->tclpFree) /* 74 */ -#endif -#ifndef TclpGetClicks -#define TclpGetClicks \ - (tclIntStubsPtr->tclpGetClicks) /* 75 */ -#endif -#ifndef TclpGetSeconds -#define TclpGetSeconds \ - (tclIntStubsPtr->tclpGetSeconds) /* 76 */ -#endif -#ifndef TclpGetTime -#define TclpGetTime \ - (tclIntStubsPtr->tclpGetTime) /* 77 */ -#endif -#ifndef TclpGetTimeZone -#define TclpGetTimeZone \ - (tclIntStubsPtr->tclpGetTimeZone) /* 78 */ -#endif -#ifndef TclpListVolumes -#define TclpListVolumes \ - (tclIntStubsPtr->tclpListVolumes) /* 79 */ -#endif -#ifndef TclpOpenFileChannel -#define TclpOpenFileChannel \ - (tclIntStubsPtr->tclpOpenFileChannel) /* 80 */ -#endif -#ifndef TclpRealloc -#define TclpRealloc \ - (tclIntStubsPtr->tclpRealloc) /* 81 */ -#endif -#ifndef TclpRemoveDirectory -#define TclpRemoveDirectory \ - (tclIntStubsPtr->tclpRemoveDirectory) /* 82 */ -#endif -#ifndef TclpRenameFile -#define TclpRenameFile \ - (tclIntStubsPtr->tclpRenameFile) /* 83 */ -#endif -/* Slot 84 is reserved */ -/* Slot 85 is reserved */ -/* Slot 86 is reserved */ -/* Slot 87 is reserved */ -#ifndef TclPrecTraceProc -#define TclPrecTraceProc \ - (tclIntStubsPtr->tclPrecTraceProc) /* 88 */ -#endif -#ifndef TclPreventAliasLoop -#define TclPreventAliasLoop \ - (tclIntStubsPtr->tclPreventAliasLoop) /* 89 */ -#endif -/* Slot 90 is reserved */ -#ifndef TclProcCleanupProc -#define TclProcCleanupProc \ - (tclIntStubsPtr->tclProcCleanupProc) /* 91 */ -#endif -#ifndef TclProcCompileProc -#define TclProcCompileProc \ - (tclIntStubsPtr->tclProcCompileProc) /* 92 */ -#endif -#ifndef TclProcDeleteProc -#define TclProcDeleteProc \ - (tclIntStubsPtr->tclProcDeleteProc) /* 93 */ -#endif -#ifndef TclProcInterpProc -#define TclProcInterpProc \ - (tclIntStubsPtr->tclProcInterpProc) /* 94 */ -#endif -#ifndef TclpStat -#define TclpStat \ - (tclIntStubsPtr->tclpStat) /* 95 */ -#endif -#ifndef TclRenameCommand -#define TclRenameCommand \ - (tclIntStubsPtr->tclRenameCommand) /* 96 */ -#endif -#ifndef TclResetShadowedCmdRefs -#define TclResetShadowedCmdRefs \ - (tclIntStubsPtr->tclResetShadowedCmdRefs) /* 97 */ -#endif -#ifndef TclServiceIdle -#define TclServiceIdle \ - (tclIntStubsPtr->tclServiceIdle) /* 98 */ -#endif -#ifndef TclSetElementOfIndexedArray -#define TclSetElementOfIndexedArray \ - (tclIntStubsPtr->tclSetElementOfIndexedArray) /* 99 */ -#endif -#ifndef TclSetIndexedScalar -#define TclSetIndexedScalar \ - (tclIntStubsPtr->tclSetIndexedScalar) /* 100 */ -#endif -/* Slot 101 is reserved */ -#ifndef TclSetupEnv -#define TclSetupEnv \ - (tclIntStubsPtr->tclSetupEnv) /* 102 */ -#endif -#ifndef TclSockGetPort -#define TclSockGetPort \ - (tclIntStubsPtr->tclSockGetPort) /* 103 */ -#endif -#ifndef TclSockMinimumBuffers -#define TclSockMinimumBuffers \ - (tclIntStubsPtr->tclSockMinimumBuffers) /* 104 */ -#endif -#ifndef TclStat -#define TclStat \ - (tclIntStubsPtr->tclStat) /* 105 */ -#endif -#ifndef TclStatDeleteProc -#define TclStatDeleteProc \ - (tclIntStubsPtr->tclStatDeleteProc) /* 106 */ -#endif -#ifndef TclStatInsertProc -#define TclStatInsertProc \ - (tclIntStubsPtr->tclStatInsertProc) /* 107 */ -#endif -#ifndef TclTeardownNamespace -#define TclTeardownNamespace \ - (tclIntStubsPtr->tclTeardownNamespace) /* 108 */ -#endif -#ifndef TclUpdateReturnInfo -#define TclUpdateReturnInfo \ - (tclIntStubsPtr->tclUpdateReturnInfo) /* 109 */ -#endif -/* Slot 110 is reserved */ -#ifndef Tcl_AddInterpResolvers -#define Tcl_AddInterpResolvers \ - (tclIntStubsPtr->tcl_AddInterpResolvers) /* 111 */ -#endif -#ifndef Tcl_AppendExportList -#define Tcl_AppendExportList \ - (tclIntStubsPtr->tcl_AppendExportList) /* 112 */ -#endif -#ifndef Tcl_CreateNamespace -#define Tcl_CreateNamespace \ - (tclIntStubsPtr->tcl_CreateNamespace) /* 113 */ -#endif -#ifndef Tcl_DeleteNamespace -#define Tcl_DeleteNamespace \ - (tclIntStubsPtr->tcl_DeleteNamespace) /* 114 */ -#endif -#ifndef Tcl_Export -#define Tcl_Export \ - (tclIntStubsPtr->tcl_Export) /* 115 */ -#endif -#ifndef Tcl_FindCommand -#define Tcl_FindCommand \ - (tclIntStubsPtr->tcl_FindCommand) /* 116 */ -#endif -#ifndef Tcl_FindNamespace -#define Tcl_FindNamespace \ - (tclIntStubsPtr->tcl_FindNamespace) /* 117 */ -#endif -#ifndef Tcl_GetInterpResolvers -#define Tcl_GetInterpResolvers \ - (tclIntStubsPtr->tcl_GetInterpResolvers) /* 118 */ -#endif -#ifndef Tcl_GetNamespaceResolvers -#define Tcl_GetNamespaceResolvers \ - (tclIntStubsPtr->tcl_GetNamespaceResolvers) /* 119 */ -#endif -#ifndef Tcl_FindNamespaceVar -#define Tcl_FindNamespaceVar \ - (tclIntStubsPtr->tcl_FindNamespaceVar) /* 120 */ -#endif -#ifndef Tcl_ForgetImport -#define Tcl_ForgetImport \ - (tclIntStubsPtr->tcl_ForgetImport) /* 121 */ -#endif -#ifndef Tcl_GetCommandFromObj -#define Tcl_GetCommandFromObj \ - (tclIntStubsPtr->tcl_GetCommandFromObj) /* 122 */ -#endif -#ifndef Tcl_GetCommandFullName -#define Tcl_GetCommandFullName \ - (tclIntStubsPtr->tcl_GetCommandFullName) /* 123 */ -#endif -#ifndef Tcl_GetCurrentNamespace -#define Tcl_GetCurrentNamespace \ - (tclIntStubsPtr->tcl_GetCurrentNamespace) /* 124 */ -#endif -#ifndef Tcl_GetGlobalNamespace -#define Tcl_GetGlobalNamespace \ - (tclIntStubsPtr->tcl_GetGlobalNamespace) /* 125 */ -#endif -#ifndef Tcl_GetVariableFullName -#define Tcl_GetVariableFullName \ - (tclIntStubsPtr->tcl_GetVariableFullName) /* 126 */ -#endif -#ifndef Tcl_Import -#define Tcl_Import \ - (tclIntStubsPtr->tcl_Import) /* 127 */ -#endif -#ifndef Tcl_PopCallFrame -#define Tcl_PopCallFrame \ - (tclIntStubsPtr->tcl_PopCallFrame) /* 128 */ -#endif -#ifndef Tcl_PushCallFrame -#define Tcl_PushCallFrame \ - (tclIntStubsPtr->tcl_PushCallFrame) /* 129 */ -#endif -#ifndef Tcl_RemoveInterpResolvers -#define Tcl_RemoveInterpResolvers \ - (tclIntStubsPtr->tcl_RemoveInterpResolvers) /* 130 */ -#endif -#ifndef Tcl_SetNamespaceResolvers -#define Tcl_SetNamespaceResolvers \ - (tclIntStubsPtr->tcl_SetNamespaceResolvers) /* 131 */ -#endif -#ifndef TclpHasSockets -#define TclpHasSockets \ - (tclIntStubsPtr->tclpHasSockets) /* 132 */ -#endif -#ifndef TclpGetDate -#define TclpGetDate \ - (tclIntStubsPtr->tclpGetDate) /* 133 */ -#endif -#ifndef TclpStrftime -#define TclpStrftime \ - (tclIntStubsPtr->tclpStrftime) /* 134 */ -#endif -#ifndef TclpCheckStackSpace -#define TclpCheckStackSpace \ - (tclIntStubsPtr->tclpCheckStackSpace) /* 135 */ -#endif -/* Slot 136 is reserved */ -#ifndef TclpChdir -#define TclpChdir \ - (tclIntStubsPtr->tclpChdir) /* 137 */ -#endif -#ifndef TclGetEnv -#define TclGetEnv \ - (tclIntStubsPtr->tclGetEnv) /* 138 */ -#endif -#ifndef TclpLoadFile -#define TclpLoadFile \ - (tclIntStubsPtr->tclpLoadFile) /* 139 */ -#endif -#ifndef TclLooksLikeInt -#define TclLooksLikeInt \ - (tclIntStubsPtr->tclLooksLikeInt) /* 140 */ -#endif -#ifndef TclpGetCwd -#define TclpGetCwd \ - (tclIntStubsPtr->tclpGetCwd) /* 141 */ -#endif - -#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#endif /* _TCLINTDECLS */ diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h deleted file mode 100644 index 628a03b..0000000 --- a/generic/tclIntPlatDecls.h +++ /dev/null @@ -1,519 +0,0 @@ -/* - * tclIntPlatDecls.h -- - * - * This file contains the declarations for all platform dependent - * unsupported functions that are exported by the Tcl library. These - * interfaces are not guaranteed to remain the same between - * versions. Use at your own risk. - * - * Copyright (c) 1998-1999 by Scriptics Corporation. - * All rights reserved. - * - * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.5 1999/04/16 00:46:48 stanton Exp $ - */ - -#ifndef _TCLINTPLATDECLS -#define _TCLINTPLATDECLS - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tclInt.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported function declarations: - */ - -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* 0 */ -EXTERN void TclGetAndDetachPids _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Channel chan)); -/* 1 */ -EXTERN int TclpCloseFile _ANSI_ARGS_((TclFile file)); -/* 2 */ -EXTERN Tcl_Channel TclpCreateCommandChannel _ANSI_ARGS_(( - TclFile readFile, TclFile writeFile, - TclFile errorFile, int numPids, - Tcl_Pid * pidPtr)); -/* 3 */ -EXTERN int TclpCreatePipe _ANSI_ARGS_((TclFile * readPipe, - TclFile * writePipe)); -/* 4 */ -EXTERN int TclpCreateProcess _ANSI_ARGS_((Tcl_Interp * interp, - int argc, char ** argv, TclFile inputFile, - TclFile outputFile, TclFile errorFile, - Tcl_Pid * pidPtr)); -/* Slot 5 is reserved */ -/* 6 */ -EXTERN TclFile TclpMakeFile _ANSI_ARGS_((Tcl_Channel channel, - int direction)); -/* 7 */ -EXTERN TclFile TclpOpenFile _ANSI_ARGS_((CONST char * fname, - int mode)); -/* 8 */ -EXTERN int TclUnixWaitForFile _ANSI_ARGS_((int fd, int mask, - int timeout)); -/* 9 */ -EXTERN TclFile TclpCreateTempFile _ANSI_ARGS_(( - CONST char * contents)); -#endif /* UNIX */ -#ifdef __WIN32__ -/* 0 */ -EXTERN void TclWinConvertError _ANSI_ARGS_((DWORD errCode)); -/* 1 */ -EXTERN void TclWinConvertWSAError _ANSI_ARGS_((DWORD errCode)); -/* 2 */ -EXTERN struct servent * TclWinGetServByName _ANSI_ARGS_((CONST char * nm, - CONST char * proto)); -/* 3 */ -EXTERN int TclWinGetSockOpt _ANSI_ARGS_((SOCKET s, int level, - int optname, char FAR * optval, - int FAR * optlen)); -/* 4 */ -EXTERN HINSTANCE TclWinGetTclInstance _ANSI_ARGS_((void)); -/* Slot 5 is reserved */ -/* 6 */ -EXTERN u_short TclWinNToHS _ANSI_ARGS_((u_short ns)); -/* 7 */ -EXTERN int TclWinSetSockOpt _ANSI_ARGS_((SOCKET s, int level, - int optname, CONST char FAR * optval, - int optlen)); -/* 8 */ -EXTERN unsigned long TclpGetPid _ANSI_ARGS_((Tcl_Pid pid)); -/* 9 */ -EXTERN int TclWinGetPlatformId _ANSI_ARGS_((void)); -/* 10 */ -EXTERN int TclWinSynchSpawn _ANSI_ARGS_((void * args, int type, - void ** trans, Tcl_Pid * pidPtr)); -/* 11 */ -EXTERN void TclGetAndDetachPids _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Channel chan)); -/* 12 */ -EXTERN int TclpCloseFile _ANSI_ARGS_((TclFile file)); -/* 13 */ -EXTERN Tcl_Channel TclpCreateCommandChannel _ANSI_ARGS_(( - TclFile readFile, TclFile writeFile, - TclFile errorFile, int numPids, - Tcl_Pid * pidPtr)); -/* 14 */ -EXTERN int TclpCreatePipe _ANSI_ARGS_((TclFile * readPipe, - TclFile * writePipe)); -/* 15 */ -EXTERN int TclpCreateProcess _ANSI_ARGS_((Tcl_Interp * interp, - int argc, char ** argv, TclFile inputFile, - TclFile outputFile, TclFile errorFile, - Tcl_Pid * pidPtr)); -/* Slot 16 is reserved */ -/* Slot 17 is reserved */ -/* 18 */ -EXTERN TclFile TclpMakeFile _ANSI_ARGS_((Tcl_Channel channel, - int direction)); -/* 19 */ -EXTERN TclFile TclpOpenFile _ANSI_ARGS_((CONST char * fname, - int mode)); -/* 20 */ -EXTERN void TclWinAddProcess _ANSI_ARGS_((HANDLE hProcess, - DWORD id)); -/* 21 */ -EXTERN void TclpAsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async)); -/* 22 */ -EXTERN TclFile TclpCreateTempFile _ANSI_ARGS_(( - CONST char * contents)); -/* 23 */ -EXTERN char * TclpGetTZName _ANSI_ARGS_((int isdst)); -/* 24 */ -EXTERN char * TclWinNoBackslash _ANSI_ARGS_((char * path)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 0 */ -EXTERN VOID * TclpSysAlloc _ANSI_ARGS_((long size, int isBin)); -/* 1 */ -EXTERN void TclpSysFree _ANSI_ARGS_((VOID * ptr)); -/* 2 */ -EXTERN VOID * TclpSysRealloc _ANSI_ARGS_((VOID * cp, - unsigned int size)); -/* 3 */ -EXTERN void TclpExit _ANSI_ARGS_((int status)); -/* 4 */ -EXTERN int FSpGetDefaultDir _ANSI_ARGS_((FSSpecPtr theSpec)); -/* 5 */ -EXTERN int FSpSetDefaultDir _ANSI_ARGS_((FSSpecPtr theSpec)); -/* 6 */ -EXTERN OSErr FSpFindFolder _ANSI_ARGS_((short vRefNum, - OSType folderType, Boolean createFolder, - FSSpec * spec)); -/* 7 */ -EXTERN void GetGlobalMouse _ANSI_ARGS_((Point * mouse)); -/* 8 */ -EXTERN pascal OSErr FSpGetDirectoryID _ANSI_ARGS_((CONST FSSpec * spec, - long * theDirID, Boolean * isDirectory)); -/* 9 */ -EXTERN pascal short FSpOpenResFileCompat _ANSI_ARGS_(( - CONST FSSpec * spec, SignedByte permission)); -/* 10 */ -EXTERN pascal void FSpCreateResFileCompat _ANSI_ARGS_(( - CONST FSSpec * spec, OSType creator, - OSType fileType, ScriptCode scriptTag)); -/* 11 */ -EXTERN int FSpLocationFromPath _ANSI_ARGS_((int length, - CONST char * path, FSSpecPtr theSpec)); -/* 12 */ -EXTERN OSErr FSpPathFromLocation _ANSI_ARGS_((FSSpecPtr theSpec, - int * length, Handle * fullPath)); -/* 13 */ -EXTERN void TclMacExitHandler _ANSI_ARGS_((void)); -/* 14 */ -EXTERN void TclMacInitExitToShell _ANSI_ARGS_((int usePatch)); -/* 15 */ -EXTERN OSErr TclMacInstallExitToShellPatch _ANSI_ARGS_(( - ExitToShellProcPtr newProc)); -/* 16 */ -EXTERN int TclMacOSErrorToPosixError _ANSI_ARGS_((int error)); -/* 17 */ -EXTERN void TclMacRemoveTimer _ANSI_ARGS_((void * timerToken)); -/* 18 */ -EXTERN void * TclMacStartTimer _ANSI_ARGS_((long ms)); -/* 19 */ -EXTERN int TclMacTimerExpired _ANSI_ARGS_((void * timerToken)); -/* 20 */ -EXTERN int TclMacRegisterResourceFork _ANSI_ARGS_(( - short fileRef, Tcl_Obj * tokenPtr, - int insert)); -/* 21 */ -EXTERN short TclMacUnRegisterResourceFork _ANSI_ARGS_(( - char * tokenPtr, Tcl_Obj * resultPtr)); -/* 22 */ -EXTERN int TclMacCreateEnv _ANSI_ARGS_((void)); -/* 23 */ -EXTERN FILE * TclMacFOpenHack _ANSI_ARGS_((CONST char * path, - CONST char * mode)); -/* Slot 24 is reserved */ -/* 25 */ -EXTERN int TclMacChmod _ANSI_ARGS_((char * path, int mode)); -#endif /* MAC_TCL */ - -typedef struct TclIntPlatStubs { - int magic; - struct TclIntPlatStubHooks *hooks; - -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - void (*tclGetAndDetachPids) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 0 */ - int (*tclpCloseFile) _ANSI_ARGS_((TclFile file)); /* 1 */ - Tcl_Channel (*tclpCreateCommandChannel) _ANSI_ARGS_((TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid * pidPtr)); /* 2 */ - int (*tclpCreatePipe) _ANSI_ARGS_((TclFile * readPipe, TclFile * writePipe)); /* 3 */ - int (*tclpCreateProcess) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid * pidPtr)); /* 4 */ - void *reserved5; - TclFile (*tclpMakeFile) _ANSI_ARGS_((Tcl_Channel channel, int direction)); /* 6 */ - TclFile (*tclpOpenFile) _ANSI_ARGS_((CONST char * fname, int mode)); /* 7 */ - int (*tclUnixWaitForFile) _ANSI_ARGS_((int fd, int mask, int timeout)); /* 8 */ - TclFile (*tclpCreateTempFile) _ANSI_ARGS_((CONST char * contents)); /* 9 */ -#endif /* UNIX */ -#ifdef __WIN32__ - void (*tclWinConvertError) _ANSI_ARGS_((DWORD errCode)); /* 0 */ - void (*tclWinConvertWSAError) _ANSI_ARGS_((DWORD errCode)); /* 1 */ - struct servent * (*tclWinGetServByName) _ANSI_ARGS_((CONST char * nm, CONST char * proto)); /* 2 */ - int (*tclWinGetSockOpt) _ANSI_ARGS_((SOCKET s, int level, int optname, char FAR * optval, int FAR * optlen)); /* 3 */ - HINSTANCE (*tclWinGetTclInstance) _ANSI_ARGS_((void)); /* 4 */ - void *reserved5; - u_short (*tclWinNToHS) _ANSI_ARGS_((u_short ns)); /* 6 */ - int (*tclWinSetSockOpt) _ANSI_ARGS_((SOCKET s, int level, int optname, CONST char FAR * optval, int optlen)); /* 7 */ - unsigned long (*tclpGetPid) _ANSI_ARGS_((Tcl_Pid pid)); /* 8 */ - int (*tclWinGetPlatformId) _ANSI_ARGS_((void)); /* 9 */ - int (*tclWinSynchSpawn) _ANSI_ARGS_((void * args, int type, void ** trans, Tcl_Pid * pidPtr)); /* 10 */ - void (*tclGetAndDetachPids) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 11 */ - int (*tclpCloseFile) _ANSI_ARGS_((TclFile file)); /* 12 */ - Tcl_Channel (*tclpCreateCommandChannel) _ANSI_ARGS_((TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid * pidPtr)); /* 13 */ - int (*tclpCreatePipe) _ANSI_ARGS_((TclFile * readPipe, TclFile * writePipe)); /* 14 */ - int (*tclpCreateProcess) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid * pidPtr)); /* 15 */ - void *reserved16; - void *reserved17; - TclFile (*tclpMakeFile) _ANSI_ARGS_((Tcl_Channel channel, int direction)); /* 18 */ - TclFile (*tclpOpenFile) _ANSI_ARGS_((CONST char * fname, int mode)); /* 19 */ - void (*tclWinAddProcess) _ANSI_ARGS_((HANDLE hProcess, DWORD id)); /* 20 */ - void (*tclpAsyncMark) _ANSI_ARGS_((Tcl_AsyncHandler async)); /* 21 */ - TclFile (*tclpCreateTempFile) _ANSI_ARGS_((CONST char * contents)); /* 22 */ - char * (*tclpGetTZName) _ANSI_ARGS_((int isdst)); /* 23 */ - char * (*tclWinNoBackslash) _ANSI_ARGS_((char * path)); /* 24 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - VOID * (*tclpSysAlloc) _ANSI_ARGS_((long size, int isBin)); /* 0 */ - void (*tclpSysFree) _ANSI_ARGS_((VOID * ptr)); /* 1 */ - VOID * (*tclpSysRealloc) _ANSI_ARGS_((VOID * cp, unsigned int size)); /* 2 */ - void (*tclpExit) _ANSI_ARGS_((int status)); /* 3 */ - int (*fSpGetDefaultDir) _ANSI_ARGS_((FSSpecPtr theSpec)); /* 4 */ - int (*fSpSetDefaultDir) _ANSI_ARGS_((FSSpecPtr theSpec)); /* 5 */ - OSErr (*fSpFindFolder) _ANSI_ARGS_((short vRefNum, OSType folderType, Boolean createFolder, FSSpec * spec)); /* 6 */ - void (*getGlobalMouse) _ANSI_ARGS_((Point * mouse)); /* 7 */ - pascal OSErr (*fSpGetDirectoryID) _ANSI_ARGS_((CONST FSSpec * spec, long * theDirID, Boolean * isDirectory)); /* 8 */ - pascal short (*fSpOpenResFileCompat) _ANSI_ARGS_((CONST FSSpec * spec, SignedByte permission)); /* 9 */ - pascal void (*fSpCreateResFileCompat) _ANSI_ARGS_((CONST FSSpec * spec, OSType creator, OSType fileType, ScriptCode scriptTag)); /* 10 */ - int (*fSpLocationFromPath) _ANSI_ARGS_((int length, CONST char * path, FSSpecPtr theSpec)); /* 11 */ - OSErr (*fSpPathFromLocation) _ANSI_ARGS_((FSSpecPtr theSpec, int * length, Handle * fullPath)); /* 12 */ - void (*tclMacExitHandler) _ANSI_ARGS_((void)); /* 13 */ - void (*tclMacInitExitToShell) _ANSI_ARGS_((int usePatch)); /* 14 */ - OSErr (*tclMacInstallExitToShellPatch) _ANSI_ARGS_((ExitToShellProcPtr newProc)); /* 15 */ - int (*tclMacOSErrorToPosixError) _ANSI_ARGS_((int error)); /* 16 */ - void (*tclMacRemoveTimer) _ANSI_ARGS_((void * timerToken)); /* 17 */ - void * (*tclMacStartTimer) _ANSI_ARGS_((long ms)); /* 18 */ - int (*tclMacTimerExpired) _ANSI_ARGS_((void * timerToken)); /* 19 */ - int (*tclMacRegisterResourceFork) _ANSI_ARGS_((short fileRef, Tcl_Obj * tokenPtr, int insert)); /* 20 */ - short (*tclMacUnRegisterResourceFork) _ANSI_ARGS_((char * tokenPtr, Tcl_Obj * resultPtr)); /* 21 */ - int (*tclMacCreateEnv) _ANSI_ARGS_((void)); /* 22 */ - FILE * (*tclMacFOpenHack) _ANSI_ARGS_((CONST char * path, CONST char * mode)); /* 23 */ - void *reserved24; - int (*tclMacChmod) _ANSI_ARGS_((char * path, int mode)); /* 25 */ -#endif /* MAC_TCL */ -} TclIntPlatStubs; - -extern TclIntPlatStubs *tclIntPlatStubsPtr; - -#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) - -/* - * Inline function declarations: - */ - -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef TclGetAndDetachPids -#define TclGetAndDetachPids \ - (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */ -#endif -#ifndef TclpCloseFile -#define TclpCloseFile \ - (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */ -#endif -#ifndef TclpCreateCommandChannel -#define TclpCreateCommandChannel \ - (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */ -#endif -#ifndef TclpCreatePipe -#define TclpCreatePipe \ - (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */ -#endif -#ifndef TclpCreateProcess -#define TclpCreateProcess \ - (tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */ -#endif -/* Slot 5 is reserved */ -#ifndef TclpMakeFile -#define TclpMakeFile \ - (tclIntPlatStubsPtr->tclpMakeFile) /* 6 */ -#endif -#ifndef TclpOpenFile -#define TclpOpenFile \ - (tclIntPlatStubsPtr->tclpOpenFile) /* 7 */ -#endif -#ifndef TclUnixWaitForFile -#define TclUnixWaitForFile \ - (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */ -#endif -#ifndef TclpCreateTempFile -#define TclpCreateTempFile \ - (tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */ -#endif -#endif /* UNIX */ -#ifdef __WIN32__ -#ifndef TclWinConvertError -#define TclWinConvertError \ - (tclIntPlatStubsPtr->tclWinConvertError) /* 0 */ -#endif -#ifndef TclWinConvertWSAError -#define TclWinConvertWSAError \ - (tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */ -#endif -#ifndef TclWinGetServByName -#define TclWinGetServByName \ - (tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */ -#endif -#ifndef TclWinGetSockOpt -#define TclWinGetSockOpt \ - (tclIntPlatStubsPtr->tclWinGetSockOpt) /* 3 */ -#endif -#ifndef TclWinGetTclInstance -#define TclWinGetTclInstance \ - (tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */ -#endif -/* Slot 5 is reserved */ -#ifndef TclWinNToHS -#define TclWinNToHS \ - (tclIntPlatStubsPtr->tclWinNToHS) /* 6 */ -#endif -#ifndef TclWinSetSockOpt -#define TclWinSetSockOpt \ - (tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */ -#endif -#ifndef TclpGetPid -#define TclpGetPid \ - (tclIntPlatStubsPtr->tclpGetPid) /* 8 */ -#endif -#ifndef TclWinGetPlatformId -#define TclWinGetPlatformId \ - (tclIntPlatStubsPtr->tclWinGetPlatformId) /* 9 */ -#endif -#ifndef TclWinSynchSpawn -#define TclWinSynchSpawn \ - (tclIntPlatStubsPtr->tclWinSynchSpawn) /* 10 */ -#endif -#ifndef TclGetAndDetachPids -#define TclGetAndDetachPids \ - (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */ -#endif -#ifndef TclpCloseFile -#define TclpCloseFile \ - (tclIntPlatStubsPtr->tclpCloseFile) /* 12 */ -#endif -#ifndef TclpCreateCommandChannel -#define TclpCreateCommandChannel \ - (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 13 */ -#endif -#ifndef TclpCreatePipe -#define TclpCreatePipe \ - (tclIntPlatStubsPtr->tclpCreatePipe) /* 14 */ -#endif -#ifndef TclpCreateProcess -#define TclpCreateProcess \ - (tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */ -#endif -/* Slot 16 is reserved */ -/* Slot 17 is reserved */ -#ifndef TclpMakeFile -#define TclpMakeFile \ - (tclIntPlatStubsPtr->tclpMakeFile) /* 18 */ -#endif -#ifndef TclpOpenFile -#define TclpOpenFile \ - (tclIntPlatStubsPtr->tclpOpenFile) /* 19 */ -#endif -#ifndef TclWinAddProcess -#define TclWinAddProcess \ - (tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */ -#endif -#ifndef TclpAsyncMark -#define TclpAsyncMark \ - (tclIntPlatStubsPtr->tclpAsyncMark) /* 21 */ -#endif -#ifndef TclpCreateTempFile -#define TclpCreateTempFile \ - (tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */ -#endif -#ifndef TclpGetTZName -#define TclpGetTZName \ - (tclIntPlatStubsPtr->tclpGetTZName) /* 23 */ -#endif -#ifndef TclWinNoBackslash -#define TclWinNoBackslash \ - (tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef TclpSysAlloc -#define TclpSysAlloc \ - (tclIntPlatStubsPtr->tclpSysAlloc) /* 0 */ -#endif -#ifndef TclpSysFree -#define TclpSysFree \ - (tclIntPlatStubsPtr->tclpSysFree) /* 1 */ -#endif -#ifndef TclpSysRealloc -#define TclpSysRealloc \ - (tclIntPlatStubsPtr->tclpSysRealloc) /* 2 */ -#endif -#ifndef TclpExit -#define TclpExit \ - (tclIntPlatStubsPtr->tclpExit) /* 3 */ -#endif -#ifndef FSpGetDefaultDir -#define FSpGetDefaultDir \ - (tclIntPlatStubsPtr->fSpGetDefaultDir) /* 4 */ -#endif -#ifndef FSpSetDefaultDir -#define FSpSetDefaultDir \ - (tclIntPlatStubsPtr->fSpSetDefaultDir) /* 5 */ -#endif -#ifndef FSpFindFolder -#define FSpFindFolder \ - (tclIntPlatStubsPtr->fSpFindFolder) /* 6 */ -#endif -#ifndef GetGlobalMouse -#define GetGlobalMouse \ - (tclIntPlatStubsPtr->getGlobalMouse) /* 7 */ -#endif -#ifndef FSpGetDirectoryID -#define FSpGetDirectoryID \ - (tclIntPlatStubsPtr->fSpGetDirectoryID) /* 8 */ -#endif -#ifndef FSpOpenResFileCompat -#define FSpOpenResFileCompat \ - (tclIntPlatStubsPtr->fSpOpenResFileCompat) /* 9 */ -#endif -#ifndef FSpCreateResFileCompat -#define FSpCreateResFileCompat \ - (tclIntPlatStubsPtr->fSpCreateResFileCompat) /* 10 */ -#endif -#ifndef FSpLocationFromPath -#define FSpLocationFromPath \ - (tclIntPlatStubsPtr->fSpLocationFromPath) /* 11 */ -#endif -#ifndef FSpPathFromLocation -#define FSpPathFromLocation \ - (tclIntPlatStubsPtr->fSpPathFromLocation) /* 12 */ -#endif -#ifndef TclMacExitHandler -#define TclMacExitHandler \ - (tclIntPlatStubsPtr->tclMacExitHandler) /* 13 */ -#endif -#ifndef TclMacInitExitToShell -#define TclMacInitExitToShell \ - (tclIntPlatStubsPtr->tclMacInitExitToShell) /* 14 */ -#endif -#ifndef TclMacInstallExitToShellPatch -#define TclMacInstallExitToShellPatch \ - (tclIntPlatStubsPtr->tclMacInstallExitToShellPatch) /* 15 */ -#endif -#ifndef TclMacOSErrorToPosixError -#define TclMacOSErrorToPosixError \ - (tclIntPlatStubsPtr->tclMacOSErrorToPosixError) /* 16 */ -#endif -#ifndef TclMacRemoveTimer -#define TclMacRemoveTimer \ - (tclIntPlatStubsPtr->tclMacRemoveTimer) /* 17 */ -#endif -#ifndef TclMacStartTimer -#define TclMacStartTimer \ - (tclIntPlatStubsPtr->tclMacStartTimer) /* 18 */ -#endif -#ifndef TclMacTimerExpired -#define TclMacTimerExpired \ - (tclIntPlatStubsPtr->tclMacTimerExpired) /* 19 */ -#endif -#ifndef TclMacRegisterResourceFork -#define TclMacRegisterResourceFork \ - (tclIntPlatStubsPtr->tclMacRegisterResourceFork) /* 20 */ -#endif -#ifndef TclMacUnRegisterResourceFork -#define TclMacUnRegisterResourceFork \ - (tclIntPlatStubsPtr->tclMacUnRegisterResourceFork) /* 21 */ -#endif -#ifndef TclMacCreateEnv -#define TclMacCreateEnv \ - (tclIntPlatStubsPtr->tclMacCreateEnv) /* 22 */ -#endif -#ifndef TclMacFOpenHack -#define TclMacFOpenHack \ - (tclIntPlatStubsPtr->tclMacFOpenHack) /* 23 */ -#endif -/* Slot 24 is reserved */ -#ifndef TclMacChmod -#define TclMacChmod \ - (tclIntPlatStubsPtr->tclMacChmod) /* 25 */ -#endif -#endif /* MAC_TCL */ - -#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#endif /* _TCLINTPLATDECLS */ diff --git a/generic/tclInterp.c b/generic/tclInterp.c deleted file mode 100644 index a5e7563..0000000 --- a/generic/tclInterp.c +++ /dev/null @@ -1,2355 +0,0 @@ -/* - * tclInterp.c -- - * - * This file implements the "interp" command which allows creation - * and manipulation of Tcl interpreters from within Tcl scripts. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclInterp.c,v 1.5 1999/04/16 00:46:49 stanton Exp $ - */ - -#include -#include "tclInt.h" -#include "tclPort.h" - -/* - * Counter for how many aliases were created (global) - */ - -static int aliasCounter = 0; -TCL_DECLARE_MUTEX(cntMutex) - -/* - * struct Alias: - * - * Stores information about an alias. Is stored in the slave interpreter - * and used by the source command to find the target command in the master - * when the source command is invoked. - */ - -typedef struct Alias { - Tcl_Obj *namePtr; /* Name of alias command in slave interp. */ - Tcl_Interp *targetInterp; /* Interp in which target command will be - * invoked. */ - Tcl_Obj *prefixPtr; /* Tcl list making up the prefix of the - * target command to be invoked in the target - * interpreter. Additional arguments - * specified when calling the alias in the - * slave interp will be appended to the prefix - * before the command is invoked. */ - Tcl_Command slaveCmd; /* Source command in slave interpreter, - * bound to command that invokes the target - * command in the target interpreter. */ - Tcl_HashEntry *aliasEntryPtr; - /* Entry for the alias hash table in slave. - * This is used by alias deletion to remove - * the alias from the slave interpreter - * alias table. */ - Tcl_HashEntry *targetEntryPtr; - /* Entry for target command in master. - * This is used in the master interpreter to - * map back from the target command to aliases - * redirecting to it. Random access to this - * hash table is never required - we are using - * a hash table only for convenience. */ -} Alias; - -/* - * - * struct Slave: - * - * Used by the "interp" command to record and find information about slave - * interpreters. Maps from a command name in the master to information about - * a slave interpreter, e.g. what aliases are defined in it. - */ - -typedef struct Slave { - Tcl_Interp *masterInterp; /* Master interpreter for this slave. */ - Tcl_HashEntry *slaveEntryPtr; - /* Hash entry in masters slave table for - * this slave interpreter. Used to find - * this record, and used when deleting the - * slave interpreter to delete it from the - * master's table. */ - Tcl_Interp *slaveInterp; /* The slave interpreter. */ - Tcl_Command interpCmd; /* Interpreter object command. */ - Tcl_HashTable aliasTable; /* Table which maps from names of commands - * in slave interpreter to struct Alias - * defined below. */ -} Slave; - -/* - * struct Target: - * - * Maps from master interpreter commands back to the source commands in slave - * interpreters. This is needed because aliases can be created between sibling - * interpreters and must be deleted when the target interpreter is deleted. In - * case they would not be deleted the source interpreter would be left with a - * "dangling pointer". One such record is stored in the Master record of the - * master interpreter (in the targetTable hashtable, see below) with the - * master for each alias which directs to a command in the master. These - * records are used to remove the source command for an from a slave if/when - * the master is deleted. - */ - -typedef struct Target { - Tcl_Command slaveCmd; /* Command for alias in slave interp. */ - Tcl_Interp *slaveInterp; /* Slave Interpreter. */ -} Target; - -/* - * struct Master: - * - * This record is used for two purposes: First, slaveTable (a hashtable) - * maps from names of commands to slave interpreters. This hashtable is - * used to store information about slave interpreters of this interpreter, - * to map over all slaves, etc. The second purpose is to store information - * about all aliases in slaves (or siblings) which direct to target commands - * in this interpreter (using the targetTable hashtable). - * - * NB: the flags field in the interp structure, used with SAFE_INTERP - * mask denotes whether the interpreter is safe or not. Safe - * interpreters have restricted functionality, can only create safe slave - * interpreters and can only load safe extensions. - */ - -typedef struct Master { - Tcl_HashTable slaveTable; /* Hash table for slave interpreters. - * Maps from command names to Slave records. */ - Tcl_HashTable targetTable; /* Hash table for Target Records. Contains - * all Target records which denote aliases - * from slaves or sibling interpreters that - * direct to commands in this interpreter. This - * table is used to remove dangling pointers - * from the slave (or sibling) interpreters - * when this interpreter is deleted. */ -} Master; - -/* - * The following structure keeps track of all the Master and Slave information - * on a per-interp basis. - */ - -typedef struct InterpInfo { - Master master; /* Keeps track of all interps for which this - * interp is the Master. */ - Slave slave; /* Information necessary for this interp to - * function as a slave. */ -} InterpInfo; - -/* - * Prototypes for local static procedures: - */ - -static int AliasCreate _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp, Tcl_Interp *masterInterp, - Tcl_Obj *namePtr, Tcl_Obj *targetPtr, int objc, - Tcl_Obj *CONST objv[])); -static int AliasDelete _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp, Tcl_Obj *namePtr)); -static int AliasDescribe _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp, Tcl_Obj *objPtr)); -static int AliasList _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp)); -static int AliasObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *currentInterp, int objc, - Tcl_Obj *CONST objv[])); -static void AliasObjCmdDeleteProc _ANSI_ARGS_(( - ClientData clientData)); - -static Tcl_Interp * GetInterp _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *pathPtr)); -static Tcl_Interp * GetInterp2 _ANSI_ARGS_((Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static void InterpInfoDeleteProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp)); -static Tcl_Interp * SlaveCreate _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *pathPtr, int safe)); -static int SlaveEval _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp, int objc, - Tcl_Obj *CONST objv[])); -static int SlaveExpose _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp, int objc, - Tcl_Obj *CONST objv[])); -static int SlaveHide _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp, int objc, - Tcl_Obj *CONST objv[])); -static int SlaveHidden _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp)); -static int SlaveInvokeHidden _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp, int global, int objc, - Tcl_Obj *CONST objv[])); -static int SlaveMarkTrusted _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Interp *slaveInterp)); -static int SlaveObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static void SlaveObjCmdDeleteProc _ANSI_ARGS_(( - ClientData clientData)); - -/* - *--------------------------------------------------------------------------- - * - * TclInterpInit -- - * - * Initializes the invoking interpreter for using the master, slave - * and safe interp facilities. This is called from inside - * Tcl_CreateInterp(). - * - * Results: - * Always returns TCL_OK for backwards compatibility. - * - * Side effects: - * Adds the "interp" command to an interpreter and initializes the - * interpInfoPtr field of the invoking interpreter. - * - *--------------------------------------------------------------------------- - */ - -int -TclInterpInit(interp) - Tcl_Interp *interp; /* Interpreter to initialize. */ -{ - InterpInfo *interpInfoPtr; - Master *masterPtr; - Slave *slavePtr; - - interpInfoPtr = (InterpInfo *) ckalloc(sizeof(InterpInfo)); - ((Interp *) interp)->interpInfo = (ClientData) interpInfoPtr; - - masterPtr = &interpInfoPtr->master; - Tcl_InitHashTable(&masterPtr->slaveTable, TCL_STRING_KEYS); - Tcl_InitHashTable(&masterPtr->targetTable, TCL_ONE_WORD_KEYS); - - slavePtr = &interpInfoPtr->slave; - slavePtr->masterInterp = NULL; - slavePtr->slaveEntryPtr = NULL; - slavePtr->slaveInterp = interp; - slavePtr->interpCmd = NULL; - Tcl_InitHashTable(&slavePtr->aliasTable, TCL_STRING_KEYS); - - Tcl_CreateObjCommand(interp, "interp", Tcl_InterpObjCmd, NULL, NULL); - - Tcl_CallWhenDeleted(interp, InterpInfoDeleteProc, NULL); - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * InterpInfoDeleteProc -- - * - * Invoked when an interpreter is being deleted. It releases all - * storage used by the master/slave/safe interpreter facilities. - * - * Results: - * None. - * - * Side effects: - * Cleans up storage. Sets the interpInfoPtr field of the interp - * to NULL. - * - *--------------------------------------------------------------------------- - */ - -static void -InterpInfoDeleteProc(clientData, interp) - ClientData clientData; /* Ignored. */ - Tcl_Interp *interp; /* Interp being deleted. All commands for - * slave interps should already be deleted. */ -{ - InterpInfo *interpInfoPtr; - Slave *slavePtr; - Master *masterPtr; - Tcl_HashSearch hSearch; - Tcl_HashEntry *hPtr; - Target *targetPtr; - - interpInfoPtr = (InterpInfo *) ((Interp *) interp)->interpInfo; - - /* - * There shouldn't be any commands left. - */ - - masterPtr = &interpInfoPtr->master; - if (masterPtr->slaveTable.numEntries != 0) { - panic("InterpInfoDeleteProc: still exist commands"); - } - Tcl_DeleteHashTable(&masterPtr->slaveTable); - - /* - * Tell any interps that have aliases to this interp that they should - * delete those aliases. If the other interp was already dead, it - * would have removed the target record already. - */ - - hPtr = Tcl_FirstHashEntry(&masterPtr->targetTable, &hSearch); - while (hPtr != NULL) { - targetPtr = (Target *) Tcl_GetHashValue(hPtr); - Tcl_DeleteCommandFromToken(targetPtr->slaveInterp, - targetPtr->slaveCmd); - hPtr = Tcl_NextHashEntry(&hSearch); - } - Tcl_DeleteHashTable(&masterPtr->targetTable); - - slavePtr = &interpInfoPtr->slave; - if (slavePtr->interpCmd != NULL) { - /* - * Tcl_DeleteInterp() was called on this interpreter, rather - * "interp delete" or the equivalent deletion of the command in the - * master. First ensure that the cleanup callback doesn't try to - * delete the interp again. - */ - - slavePtr->slaveInterp = NULL; - Tcl_DeleteCommandFromToken(slavePtr->masterInterp, - slavePtr->interpCmd); - } - - /* - * There shouldn't be any aliases left. - */ - - if (slavePtr->aliasTable.numEntries != 0) { - panic("InterpInfoDeleteProc: still exist aliases"); - } - Tcl_DeleteHashTable(&slavePtr->aliasTable); - - ckfree((char *) interpInfoPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InterpObjCmd -- - * - * This procedure is invoked to process the "interp" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - /* ARGSUSED */ -int -Tcl_InterpObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Unused. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int index; - static char *options[] = { - "alias", "aliases", "create", "delete", - "eval", "exists", "expose", "hide", - "hidden", "issafe", "invokehidden", "marktrusted", - "slaves", "share", "target", "transfer", - NULL - }; - enum option { - OPT_ALIAS, OPT_ALIASES, OPT_CREATE, OPT_DELETE, - OPT_EVAL, OPT_EXISTS, OPT_EXPOSE, OPT_HIDE, - OPT_HIDDEN, OPT_ISSAFE, OPT_INVOKEHID, OPT_MARKTRUSTED, - OPT_SLAVES, OPT_SHARE, OPT_TARGET, OPT_TRANSFER - }; - - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "cmd ?arg ...?"); - return TCL_ERROR; - } - if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum option) index) { - case OPT_ALIAS: { - Tcl_Interp *slaveInterp, *masterInterp; - - if (objc < 4) { - aliasArgs: - Tcl_WrongNumArgs(interp, 2, objv, - "slavePath slaveCmd ?masterPath masterCmd? ?args ..?"); - return TCL_ERROR; - } - slaveInterp = GetInterp(interp, objv[2]); - if (slaveInterp == (Tcl_Interp *) NULL) { - return TCL_ERROR; - } - if (objc == 4) { - return AliasDescribe(interp, slaveInterp, objv[3]); - } - if ((objc == 5) && (Tcl_GetString(objv[4])[0] == '\0')) { - return AliasDelete(interp, slaveInterp, objv[3]); - } - if (objc > 5) { - masterInterp = GetInterp(interp, objv[4]); - if (masterInterp == (Tcl_Interp *) NULL) { - return TCL_ERROR; - } - if (Tcl_GetString(objv[5])[0] == '\0') { - if (objc == 6) { - return AliasDelete(interp, slaveInterp, objv[3]); - } - } else { - return AliasCreate(interp, slaveInterp, masterInterp, - objv[3], objv[5], objc - 6, objv + 6); - } - } - goto aliasArgs; - } - case OPT_ALIASES: { - Tcl_Interp *slaveInterp; - - slaveInterp = GetInterp2(interp, objc, objv); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - return AliasList(interp, slaveInterp); - } - case OPT_CREATE: { - int i, last, safe; - Tcl_Obj *slavePtr; - char buf[16 + TCL_INTEGER_SPACE]; - static char *options[] = { - "-safe", "--", NULL - }; - enum option { - OPT_SAFE, OPT_LAST - }; - - safe = Tcl_IsSafe(interp); - - /* - * Weird historical rules: "-safe" is accepted at the end, too. - */ - - slavePtr = NULL; - last = 0; - for (i = 2; i < objc; i++) { - if ((last == 0) && (Tcl_GetString(objv[i])[0] == '-')) { - if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", - 0, &index) != TCL_OK) { - return TCL_ERROR; - } - if (index == OPT_SAFE) { - safe = 1; - continue; - } - i++; - last = 1; - } - if (slavePtr != NULL) { - Tcl_WrongNumArgs(interp, 2, objv, "?-safe? ?--? ?path?"); - return TCL_ERROR; - } - slavePtr = objv[i]; - } - buf[0] = '\0'; - if (slavePtr == NULL) { - /* - * Create an anonymous interpreter -- we choose its name and - * the name of the command. We check that the command name - * that we use for the interpreter does not collide with an - * existing command in the master interpreter. - */ - - for (i = 0; ; i++) { - Tcl_CmdInfo cmdInfo; - - sprintf(buf, "interp%d", i); - if (Tcl_GetCommandInfo(interp, buf, &cmdInfo) == 0) { - break; - } - } - slavePtr = Tcl_NewStringObj(buf, -1); - } - if (SlaveCreate(interp, slavePtr, safe) == NULL) { - if (buf[0] != '\0') { - Tcl_DecrRefCount(slavePtr); - } - return TCL_ERROR; - } - Tcl_SetObjResult(interp, slavePtr); - return TCL_OK; - } - case OPT_DELETE: { - int i; - InterpInfo *iiPtr; - Tcl_Interp *slaveInterp; - - for (i = 2; i < objc; i++) { - slaveInterp = GetInterp(interp, objv[i]); - if (slaveInterp == NULL) { - return TCL_ERROR; - } else if (slaveInterp == interp) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "cannot delete the current interpreter", - (char *) NULL); - return TCL_ERROR; - } - iiPtr = (InterpInfo *) ((Interp *) slaveInterp)->interpInfo; - Tcl_DeleteCommandFromToken(iiPtr->slave.masterInterp, - iiPtr->slave.interpCmd); - } - return TCL_OK; - } - case OPT_EVAL: { - Tcl_Interp *slaveInterp; - - if (objc < 4) { - Tcl_WrongNumArgs(interp, 2, objv, "path arg ?arg ...?"); - return TCL_ERROR; - } - slaveInterp = GetInterp(interp, objv[2]); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - return SlaveEval(interp, slaveInterp, objc - 3, objv + 3); - } - case OPT_EXISTS: { - int exists; - Tcl_Interp *slaveInterp; - - exists = 1; - slaveInterp = GetInterp2(interp, objc, objv); - if (slaveInterp == NULL) { - if (objc > 3) { - return TCL_ERROR; - } - Tcl_ResetResult(interp); - exists = 0; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), exists); - return TCL_OK; - } - case OPT_EXPOSE: { - Tcl_Interp *slaveInterp; - - if ((objc < 4) || (objc > 5)) { - Tcl_WrongNumArgs(interp, 2, objv, - "path hiddenCmdName ?cmdName?"); - return TCL_ERROR; - } - slaveInterp = GetInterp(interp, objv[2]); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - return SlaveExpose(interp, slaveInterp, objc - 3, objv + 3); - } - case OPT_HIDE: { - Tcl_Interp *slaveInterp; /* A slave. */ - - if ((objc < 4) || (objc > 5)) { - Tcl_WrongNumArgs(interp, 2, objv, - "path cmdName ?hiddenCmdName?"); - return TCL_ERROR; - } - slaveInterp = GetInterp(interp, objv[2]); - if (slaveInterp == (Tcl_Interp *) NULL) { - return TCL_ERROR; - } - return SlaveHide(interp, slaveInterp, objc - 3, objv + 3); - } - case OPT_HIDDEN: { - Tcl_Interp *slaveInterp; /* A slave. */ - - slaveInterp = GetInterp2(interp, objc, objv); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - return SlaveHidden(interp, slaveInterp); - } - case OPT_ISSAFE: { - Tcl_Interp *slaveInterp; - - slaveInterp = GetInterp2(interp, objc, objv); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), Tcl_IsSafe(slaveInterp)); - return TCL_OK; - } - case OPT_INVOKEHID: { - int i, index, global; - Tcl_Interp *slaveInterp; - static char *hiddenOptions[] = { - "-global", "--", NULL - }; - enum hiddenOption { - OPT_GLOBAL, OPT_LAST - }; - - global = 0; - for (i = 3; i < objc; i++) { - if (Tcl_GetString(objv[i])[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[i], hiddenOptions, - "option", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - if (index == OPT_GLOBAL) { - global = 1; - } else { - i++; - break; - } - } - if (objc - i < 1) { - Tcl_WrongNumArgs(interp, 2, objv, - "path ?-global? ?--? cmd ?arg ..?"); - return TCL_ERROR; - } - slaveInterp = GetInterp(interp, objv[2]); - if (slaveInterp == (Tcl_Interp *) NULL) { - return TCL_ERROR; - } - return SlaveInvokeHidden(interp, slaveInterp, global, objc - i, - objv + i); - } - case OPT_MARKTRUSTED: { - Tcl_Interp *slaveInterp; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "path"); - return TCL_ERROR; - } - slaveInterp = GetInterp(interp, objv[2]); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - return SlaveMarkTrusted(interp, slaveInterp); - } - case OPT_SLAVES: { - Tcl_Interp *slaveInterp; - InterpInfo *iiPtr; - Tcl_Obj *resultPtr; - Tcl_HashEntry *hPtr; - Tcl_HashSearch hashSearch; - char *string; - - slaveInterp = GetInterp2(interp, objc, objv); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - iiPtr = (InterpInfo *) ((Interp *) slaveInterp)->interpInfo; - resultPtr = Tcl_GetObjResult(interp); - hPtr = Tcl_FirstHashEntry(&iiPtr->master.slaveTable, &hashSearch); - for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) { - string = Tcl_GetHashKey(&iiPtr->master.slaveTable, hPtr); - Tcl_ListObjAppendElement(NULL, resultPtr, - Tcl_NewStringObj(string, -1)); - } - return TCL_OK; - } - case OPT_SHARE: { - Tcl_Interp *slaveInterp; /* A slave. */ - Tcl_Interp *masterInterp; /* Its master. */ - Tcl_Channel chan; - - if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "srcPath channelId destPath"); - return TCL_ERROR; - } - masterInterp = GetInterp(interp, objv[2]); - if (masterInterp == NULL) { - return TCL_ERROR; - } - chan = Tcl_GetChannel(masterInterp, Tcl_GetString(objv[3]), - NULL); - if (chan == NULL) { - TclTransferResult(masterInterp, TCL_OK, interp); - return TCL_ERROR; - } - slaveInterp = GetInterp(interp, objv[4]); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - Tcl_RegisterChannel(slaveInterp, chan); - return TCL_OK; - } - case OPT_TARGET: { - Tcl_Interp *slaveInterp; - InterpInfo *iiPtr; - Tcl_HashEntry *hPtr; - Alias *aliasPtr; - char *aliasName; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "path alias"); - return TCL_ERROR; - } - - slaveInterp = GetInterp(interp, objv[2]); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - - aliasName = Tcl_GetString(objv[3]); - - iiPtr = (InterpInfo *) ((Interp *) slaveInterp)->interpInfo; - hPtr = Tcl_FindHashEntry(&iiPtr->slave.aliasTable, aliasName); - if (hPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "alias \"", aliasName, "\" in path \"", - Tcl_GetString(objv[2]), "\" not found", - (char *) NULL); - return TCL_ERROR; - } - aliasPtr = (Alias *) Tcl_GetHashValue(hPtr); - if (Tcl_GetInterpPath(interp, aliasPtr->targetInterp) != TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "target interpreter for alias \"", aliasName, - "\" in path \"", Tcl_GetString(objv[2]), - "\" is not my descendant", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; - } - case OPT_TRANSFER: { - Tcl_Interp *slaveInterp; /* A slave. */ - Tcl_Interp *masterInterp; /* Its master. */ - Tcl_Channel chan; - - if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, - "srcPath channelId destPath"); - return TCL_ERROR; - } - masterInterp = GetInterp(interp, objv[2]); - if (masterInterp == NULL) { - return TCL_ERROR; - } - chan = Tcl_GetChannel(masterInterp, Tcl_GetString(objv[3]), NULL); - if (chan == NULL) { - TclTransferResult(masterInterp, TCL_OK, interp); - return TCL_ERROR; - } - slaveInterp = GetInterp(interp, objv[4]); - if (slaveInterp == NULL) { - return TCL_ERROR; - } - Tcl_RegisterChannel(slaveInterp, chan); - if (Tcl_UnregisterChannel(masterInterp, chan) != TCL_OK) { - TclTransferResult(masterInterp, TCL_OK, interp); - return TCL_ERROR; - } - return TCL_OK; - } - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * GetInterp2 -- - * - * Helper function for Tcl_InterpObjCmd() to convert the interp name - * potentially specified on the command line to an Tcl_Interp. - * - * Results: - * The return value is the interp specified on the command line, - * or the interp argument itself if no interp was specified on the - * command line. If the interp could not be found or the wrong - * number of arguments was specified on the command line, the return - * value is NULL and an error message is left in the interp's result. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static Tcl_Interp * -GetInterp2(interp, objc, objv) - Tcl_Interp *interp; /* Default interp if no interp was specified - * on the command line. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - if (objc == 2) { - return interp; - } else if (objc == 3) { - return GetInterp(interp, objv[2]); - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?path?"); - return NULL; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateAlias -- - * - * Creates an alias between two interpreters. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates a new alias, manipulates the result field of slaveInterp. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_CreateAlias(slaveInterp, slaveCmd, targetInterp, targetCmd, argc, argv) - Tcl_Interp *slaveInterp; /* Interpreter for source command. */ - char *slaveCmd; /* Command to install in slave. */ - Tcl_Interp *targetInterp; /* Interpreter for target command. */ - char *targetCmd; /* Name of target command. */ - int argc; /* How many additional arguments? */ - char **argv; /* These are the additional args. */ -{ - Tcl_Obj *slaveObjPtr, *targetObjPtr; - Tcl_Obj **objv; - int i; - int result; - - objv = (Tcl_Obj **) ckalloc((unsigned) sizeof(Tcl_Obj *) * argc); - for (i = 0; i < argc; i++) { - objv[i] = Tcl_NewStringObj(argv[i], -1); - Tcl_IncrRefCount(objv[i]); - } - - slaveObjPtr = Tcl_NewStringObj(slaveCmd, -1); - Tcl_IncrRefCount(slaveObjPtr); - - targetObjPtr = Tcl_NewStringObj(targetCmd, -1); - Tcl_IncrRefCount(targetObjPtr); - - result = AliasCreate(slaveInterp, slaveInterp, targetInterp, slaveObjPtr, - targetObjPtr, argc, objv); - - for (i = 0; i < argc; i++) { - Tcl_DecrRefCount(objv[i]); - } - ckfree((char *) objv); - Tcl_DecrRefCount(targetObjPtr); - Tcl_DecrRefCount(slaveObjPtr); - - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateAliasObj -- - * - * Object version: Creates an alias between two interpreters. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates a new alias. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_CreateAliasObj(slaveInterp, slaveCmd, targetInterp, targetCmd, objc, objv) - Tcl_Interp *slaveInterp; /* Interpreter for source command. */ - char *slaveCmd; /* Command to install in slave. */ - Tcl_Interp *targetInterp; /* Interpreter for target command. */ - char *targetCmd; /* Name of target command. */ - int objc; /* How many additional arguments? */ - Tcl_Obj *CONST objv[]; /* Argument vector. */ -{ - Tcl_Obj *slaveObjPtr, *targetObjPtr; - int result; - - slaveObjPtr = Tcl_NewStringObj(slaveCmd, -1); - Tcl_IncrRefCount(slaveObjPtr); - - targetObjPtr = Tcl_NewStringObj(targetCmd, -1); - Tcl_IncrRefCount(targetObjPtr); - - result = AliasCreate(slaveInterp, slaveInterp, targetInterp, slaveObjPtr, - targetObjPtr, objc, objv); - - Tcl_DecrRefCount(slaveObjPtr); - Tcl_DecrRefCount(targetObjPtr); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetAlias -- - * - * Gets information about an alias. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetAlias(interp, aliasName, targetInterpPtr, targetNamePtr, argcPtr, - argvPtr) - Tcl_Interp *interp; /* Interp to start search from. */ - char *aliasName; /* Name of alias to find. */ - Tcl_Interp **targetInterpPtr; /* (Return) target interpreter. */ - char **targetNamePtr; /* (Return) name of target command. */ - int *argcPtr; /* (Return) count of addnl args. */ - char ***argvPtr; /* (Return) additional arguments. */ -{ - InterpInfo *iiPtr; - Tcl_HashEntry *hPtr; - Alias *aliasPtr; - int i, objc; - Tcl_Obj **objv; - - iiPtr = (InterpInfo *) ((Interp *) interp)->interpInfo; - hPtr = Tcl_FindHashEntry(&iiPtr->slave.aliasTable, aliasName); - if (hPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "alias \"", aliasName, "\" not found", (char *) NULL); - return TCL_ERROR; - } - aliasPtr = (Alias *) Tcl_GetHashValue(hPtr); - Tcl_ListObjGetElements(NULL, aliasPtr->prefixPtr, &objc, &objv); - - if (targetInterpPtr != NULL) { - *targetInterpPtr = aliasPtr->targetInterp; - } - if (targetNamePtr != NULL) { - *targetNamePtr = Tcl_GetString(objv[0]); - } - if (argcPtr != NULL) { - *argcPtr = objc - 1; - } - if (argvPtr != NULL) { - *argvPtr = (char **) ckalloc((unsigned) sizeof(char *) * (objc - 1)); - for (i = 1; i < objc; i++) { - *argvPtr[i - 1] = Tcl_GetString(objv[i]); - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ObjGetAlias -- - * - * Object version: Gets information about an alias. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetAliasObj(interp, aliasName, targetInterpPtr, targetNamePtr, objcPtr, - objvPtr) - Tcl_Interp *interp; /* Interp to start search from. */ - char *aliasName; /* Name of alias to find. */ - Tcl_Interp **targetInterpPtr; /* (Return) target interpreter. */ - char **targetNamePtr; /* (Return) name of target command. */ - int *objcPtr; /* (Return) count of addnl args. */ - Tcl_Obj ***objvPtr; /* (Return) additional args. */ -{ - InterpInfo *iiPtr; - Tcl_HashEntry *hPtr; - Alias *aliasPtr; - int objc; - Tcl_Obj **objv; - - iiPtr = (InterpInfo *) ((Interp *) interp)->interpInfo; - hPtr = Tcl_FindHashEntry(&iiPtr->slave.aliasTable, aliasName); - if (hPtr == (Tcl_HashEntry *) NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "alias \"", aliasName, "\" not found", (char *) NULL); - return TCL_ERROR; - } - aliasPtr = (Alias *) Tcl_GetHashValue(hPtr); - Tcl_ListObjGetElements(NULL, aliasPtr->prefixPtr, &objc, &objv); - - if (targetInterpPtr != (Tcl_Interp **) NULL) { - *targetInterpPtr = aliasPtr->targetInterp; - } - if (targetNamePtr != (char **) NULL) { - *targetNamePtr = Tcl_GetString(objv[0]); - } - if (objcPtr != (int *) NULL) { - *objcPtr = objc - 1; - } - if (objvPtr != (Tcl_Obj ***) NULL) { - *objvPtr = objv + 1; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclPreventAliasLoop -- - * - * When defining an alias or renaming a command, prevent an alias - * loop from being formed. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * If TCL_ERROR is returned, the function also stores an error message - * in the interpreter's result object. - * - * NOTE: - * This function is public internal (instead of being static to - * this file) because it is also used from TclRenameCommand. - * - *---------------------------------------------------------------------- - */ - -int -TclPreventAliasLoop(interp, cmdInterp, cmd) - Tcl_Interp *interp; /* Interp in which to report errors. */ - Tcl_Interp *cmdInterp; /* Interp in which the command is - * being defined. */ - Tcl_Command cmd; /* Tcl command we are attempting - * to define. */ -{ - Command *cmdPtr = (Command *) cmd; - Alias *aliasPtr, *nextAliasPtr; - Tcl_Command aliasCmd; - Command *aliasCmdPtr; - - /* - * If we are not creating or renaming an alias, then it is - * always OK to create or rename the command. - */ - - if (cmdPtr->objProc != AliasObjCmd) { - return TCL_OK; - } - - /* - * OK, we are dealing with an alias, so traverse the chain of aliases. - * If we encounter the alias we are defining (or renaming to) any in - * the chain then we have a loop. - */ - - aliasPtr = (Alias *) cmdPtr->objClientData; - nextAliasPtr = aliasPtr; - while (1) { - int objc; - Tcl_Obj **objv; - - /* - * If the target of the next alias in the chain is the same as - * the source alias, we have a loop. - */ - - Tcl_ListObjGetElements(NULL, nextAliasPtr->prefixPtr, &objc, &objv); - aliasCmd = Tcl_FindCommand(nextAliasPtr->targetInterp, - Tcl_GetString(objv[0]), - Tcl_GetGlobalNamespace(nextAliasPtr->targetInterp), - /*flags*/ 0); - if (aliasCmd == (Tcl_Command) NULL) { - return TCL_OK; - } - aliasCmdPtr = (Command *) aliasCmd; - if (aliasCmdPtr == cmdPtr) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "cannot define or rename alias \"", - Tcl_GetString(aliasPtr->namePtr), - "\": would create a loop", (char *) NULL); - return TCL_ERROR; - } - - /* - * Otherwise, follow the chain one step further. See if the target - * command is an alias - if so, follow the loop to its target - * command. Otherwise we do not have a loop. - */ - - if (aliasCmdPtr->objProc != AliasObjCmd) { - return TCL_OK; - } - nextAliasPtr = (Alias *) aliasCmdPtr->objClientData; - } - - /* NOTREACHED */ -} - -/* - *---------------------------------------------------------------------- - * - * AliasCreate -- - * - * Helper function to do the work to actually create an alias. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * An alias command is created and entered into the alias table - * for the slave interpreter. - * - *---------------------------------------------------------------------- - */ - -static int -AliasCreate(interp, slaveInterp, masterInterp, namePtr, targetNamePtr, - objc, objv) - Tcl_Interp *interp; /* Interp for error reporting. */ - Tcl_Interp *slaveInterp; /* Interp where alias cmd will live or from - * which alias will be deleted. */ - Tcl_Interp *masterInterp; /* Interp in which target command will be - * invoked. */ - Tcl_Obj *namePtr; /* Name of alias cmd. */ - Tcl_Obj *targetNamePtr; /* Name of target cmd. */ - int objc; /* Additional arguments to store */ - Tcl_Obj *CONST objv[]; /* with alias. */ -{ - Alias *aliasPtr; - Tcl_HashEntry *hPtr; - int new; - Target *targetPtr; - Slave *slavePtr; - Master *masterPtr; - - aliasPtr = (Alias *) ckalloc((unsigned) sizeof(Alias)); - aliasPtr->namePtr = namePtr; - Tcl_IncrRefCount(aliasPtr->namePtr); - aliasPtr->targetInterp = masterInterp; - aliasPtr->prefixPtr = Tcl_NewListObj(1, &targetNamePtr); - Tcl_ListObjReplace(NULL, aliasPtr->prefixPtr, 1, 0, objc, objv); - Tcl_IncrRefCount(aliasPtr->prefixPtr); - - aliasPtr->slaveCmd = Tcl_CreateObjCommand(slaveInterp, - Tcl_GetString(namePtr), AliasObjCmd, (ClientData) aliasPtr, - AliasObjCmdDeleteProc); - - if (TclPreventAliasLoop(interp, slaveInterp, aliasPtr->slaveCmd) != TCL_OK) { - /* - * Found an alias loop! The last call to Tcl_CreateObjCommand made - * the alias point to itself. Delete the command and its alias - * record. Be careful to wipe out its client data first, so the - * command doesn't try to delete itself. - */ - - Command *cmdPtr; - - Tcl_DecrRefCount(aliasPtr->namePtr); - Tcl_DecrRefCount(aliasPtr->prefixPtr); - - cmdPtr = (Command *) aliasPtr->slaveCmd; - cmdPtr->clientData = NULL; - cmdPtr->deleteProc = NULL; - cmdPtr->deleteData = NULL; - Tcl_DeleteCommandFromToken(slaveInterp, aliasPtr->slaveCmd); - - ckfree((char *) aliasPtr); - - /* - * The result was already set by TclPreventAliasLoop. - */ - - return TCL_ERROR; - } - - /* - * Make an entry in the alias table. If it already exists delete - * the alias command. Then retry. - */ - - slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave; - while (1) { - Alias *oldAliasPtr; - char *string; - - string = Tcl_GetString(namePtr); - hPtr = Tcl_CreateHashEntry(&slavePtr->aliasTable, string, &new); - if (new != 0) { - break; - } - - oldAliasPtr = (Alias *) Tcl_GetHashValue(hPtr); - Tcl_DeleteCommandFromToken(slaveInterp, oldAliasPtr->slaveCmd); - } - - aliasPtr->aliasEntryPtr = hPtr; - Tcl_SetHashValue(hPtr, (ClientData) aliasPtr); - - /* - * Create the new command. We must do it after deleting any old command, - * because the alias may be pointing at a renamed alias, as in: - * - * interp alias {} foo {} bar # Create an alias "foo" - * rename foo zop # Now rename the alias - * interp alias {} foo {} zop # Now recreate "foo"... - */ - - targetPtr = (Target *) ckalloc((unsigned) sizeof(Target)); - targetPtr->slaveCmd = aliasPtr->slaveCmd; - targetPtr->slaveInterp = slaveInterp; - - Tcl_MutexLock(&cntMutex); - masterPtr = &((InterpInfo *) ((Interp *) masterInterp)->interpInfo)->master; - do { - hPtr = Tcl_CreateHashEntry(&masterPtr->targetTable, - (char *) aliasCounter, &new); - aliasCounter++; - } while (new == 0); - Tcl_MutexUnlock(&cntMutex); - - Tcl_SetHashValue(hPtr, (ClientData) targetPtr); - aliasPtr->targetEntryPtr = hPtr; - - Tcl_SetObjResult(interp, namePtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * AliasDelete -- - * - * Deletes the given alias from the slave interpreter given. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Deletes the alias from the slave interpreter. - * - *---------------------------------------------------------------------- - */ - -static int -AliasDelete(interp, slaveInterp, namePtr) - Tcl_Interp *interp; /* Interpreter for result & errors. */ - Tcl_Interp *slaveInterp; /* Interpreter containing alias. */ - Tcl_Obj *namePtr; /* Name of alias to describe. */ -{ - Slave *slavePtr; - Alias *aliasPtr; - Tcl_HashEntry *hPtr; - - /* - * If the alias has been renamed in the slave, the master can still use - * the original name (with which it was created) to find the alias to - * delete it. - */ - - slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave; - hPtr = Tcl_FindHashEntry(&slavePtr->aliasTable, Tcl_GetString(namePtr)); - if (hPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "alias \"", - Tcl_GetString(namePtr), "\" not found", NULL); - return TCL_ERROR; - } - aliasPtr = (Alias *) Tcl_GetHashValue(hPtr); - Tcl_DeleteCommandFromToken(slaveInterp, aliasPtr->slaveCmd); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * AliasDescribe -- - * - * Sets the interpreter's result object to a Tcl list describing - * the given alias in the given interpreter: its target command - * and the additional arguments to prepend to any invocation - * of the alias. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -AliasDescribe(interp, slaveInterp, namePtr) - Tcl_Interp *interp; /* Interpreter for result & errors. */ - Tcl_Interp *slaveInterp; /* Interpreter containing alias. */ - Tcl_Obj *namePtr; /* Name of alias to describe. */ -{ - Slave *slavePtr; - Tcl_HashEntry *hPtr; - Alias *aliasPtr; - - /* - * If the alias has been renamed in the slave, the master can still use - * the original name (with which it was created) to find the alias to - * describe it. - */ - - slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave; - hPtr = Tcl_FindHashEntry(&slavePtr->aliasTable, Tcl_GetString(namePtr)); - if (hPtr == NULL) { - return TCL_OK; - } - aliasPtr = (Alias *) Tcl_GetHashValue(hPtr); - Tcl_SetObjResult(interp, aliasPtr->prefixPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * AliasList -- - * - * Computes a list of aliases defined in a slave interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -AliasList(interp, slaveInterp) - Tcl_Interp *interp; /* Interp for data return. */ - Tcl_Interp *slaveInterp; /* Interp whose aliases to compute. */ -{ - Tcl_HashEntry *entryPtr; - Tcl_HashSearch hashSearch; - Tcl_Obj *resultPtr; - Alias *aliasPtr; - Slave *slavePtr; - - slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave; - resultPtr = Tcl_GetObjResult(interp); - - entryPtr = Tcl_FirstHashEntry(&slavePtr->aliasTable, &hashSearch); - for ( ; entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&hashSearch)) { - aliasPtr = (Alias *) Tcl_GetHashValue(entryPtr); - Tcl_ListObjAppendElement(NULL, resultPtr, aliasPtr->namePtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * AliasObjCmd -- - * - * This is the procedure that services invocations of aliases in a - * slave interpreter. One such command exists for each alias. When - * invoked, this procedure redirects the invocation to the target - * command in the master interpreter as designated by the Alias - * record associated with this command. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Causes forwarding of the invocation; all possible side effects - * may occur as a result of invoking the command to which the - * invocation is forwarded. - * - *---------------------------------------------------------------------- - */ - -static int -AliasObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Alias record. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument vector. */ -{ - Tcl_Interp *targetInterp; - Alias *aliasPtr; - int result, prefc, cmdc; - Tcl_Obj *cmdPtr; - Tcl_Obj **prefv, **cmdv; - - aliasPtr = (Alias *) clientData; - targetInterp = aliasPtr->targetInterp; - - Tcl_Preserve((ClientData) targetInterp); - - ((Interp *) targetInterp)->numLevels++; - - Tcl_ResetResult(targetInterp); - Tcl_AllowExceptions(targetInterp); - - /* - * Append the arguments to the command prefix and invoke the command - * in the target interp's global namespace. - */ - - Tcl_ListObjGetElements(NULL, aliasPtr->prefixPtr, &prefc, &prefv); - cmdPtr = Tcl_NewListObj(prefc, prefv); - Tcl_ListObjReplace(NULL, cmdPtr, prefc, 0, objc - 1, objv + 1); - Tcl_ListObjGetElements(NULL, cmdPtr, &cmdc, &cmdv); - result = TclObjInvoke(targetInterp, cmdc, cmdv, - TCL_INVOKE_NO_TRACEBACK); - Tcl_DecrRefCount(cmdPtr); - - ((Interp *) targetInterp)->numLevels--; - - /* - * Check if we are at the bottom of the stack for the target interpreter. - * If so, check for special return codes. - */ - - if (((Interp *) targetInterp)->numLevels == 0) { - if (result == TCL_RETURN) { - result = TclUpdateReturnInfo((Interp *) targetInterp); - } - if ((result != TCL_OK) && (result != TCL_ERROR)) { - Tcl_ResetResult(targetInterp); - if (result == TCL_BREAK) { - Tcl_SetObjResult(targetInterp, - Tcl_NewStringObj("invoked \"break\" outside of a loop", - -1)); - } else if (result == TCL_CONTINUE) { - Tcl_SetObjResult(targetInterp, - Tcl_NewStringObj( - "invoked \"continue\" outside of a loop", - -1)); - } else { - char buf[32 + TCL_INTEGER_SPACE]; - - sprintf(buf, "command returned bad code: %d", result); - Tcl_SetObjResult(targetInterp, Tcl_NewStringObj(buf, -1)); - } - result = TCL_ERROR; - } - } - - TclTransferResult(targetInterp, result, interp); - - Tcl_Release((ClientData) targetInterp); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * AliasObjCmdDeleteProc -- - * - * Is invoked when an alias command is deleted in a slave. Cleans up - * all storage associated with this alias. - * - * Results: - * None. - * - * Side effects: - * Deletes the alias record and its entry in the alias table for - * the interpreter. - * - *---------------------------------------------------------------------- - */ - -static void -AliasObjCmdDeleteProc(clientData) - ClientData clientData; /* The alias record for this alias. */ -{ - Alias *aliasPtr; - Target *targetPtr; - - aliasPtr = (Alias *) clientData; - - Tcl_DecrRefCount(aliasPtr->namePtr); - Tcl_DecrRefCount(aliasPtr->prefixPtr); - Tcl_DeleteHashEntry(aliasPtr->aliasEntryPtr); - - targetPtr = (Target *) Tcl_GetHashValue(aliasPtr->targetEntryPtr); - ckfree((char *) targetPtr); - Tcl_DeleteHashEntry(aliasPtr->targetEntryPtr); - - ckfree((char *) aliasPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateSlave -- - * - * Creates a slave interpreter. The slavePath argument denotes the - * name of the new slave relative to the current interpreter; the - * slave is a direct descendant of the one-before-last component of - * the path, e.g. it is a descendant of the current interpreter if - * the slavePath argument contains only one component. Optionally makes - * the slave interpreter safe. - * - * Results: - * Returns the interpreter structure created, or NULL if an error - * occurred. - * - * Side effects: - * Creates a new interpreter and a new interpreter object command in - * the interpreter indicated by the slavePath argument. - * - *---------------------------------------------------------------------- - */ - -Tcl_Interp * -Tcl_CreateSlave(interp, slavePath, isSafe) - Tcl_Interp *interp; /* Interpreter to start search at. */ - char *slavePath; /* Name of slave to create. */ - int isSafe; /* Should new slave be "safe" ? */ -{ - Tcl_Obj *pathPtr; - Tcl_Interp *slaveInterp; - - pathPtr = Tcl_NewStringObj(slavePath, -1); - slaveInterp = SlaveCreate(interp, pathPtr, isSafe); - Tcl_DecrRefCount(pathPtr); - - return slaveInterp; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetSlave -- - * - * Finds a slave interpreter by its path name. - * - * Results: - * Returns a Tcl_Interp * for the named interpreter or NULL if not - * found. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Interp * -Tcl_GetSlave(interp, slavePath) - Tcl_Interp *interp; /* Interpreter to start search from. */ - char *slavePath; /* Path of slave to find. */ -{ - Tcl_Obj *pathPtr; - Tcl_Interp *slaveInterp; - - pathPtr = Tcl_NewStringObj(slavePath, -1); - slaveInterp = GetInterp(interp, pathPtr); - Tcl_DecrRefCount(pathPtr); - - return slaveInterp; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetMaster -- - * - * Finds the master interpreter of a slave interpreter. - * - * Results: - * Returns a Tcl_Interp * for the master interpreter or NULL if none. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Interp * -Tcl_GetMaster(interp) - Tcl_Interp *interp; /* Get the master of this interpreter. */ -{ - Slave *slavePtr; /* Slave record of this interpreter. */ - - if (interp == (Tcl_Interp *) NULL) { - return NULL; - } - slavePtr = &((InterpInfo *) ((Interp *) interp)->interpInfo)->slave; - return slavePtr->masterInterp; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetInterpPath -- - * - * Sets the result of the asking interpreter to a proper Tcl list - * containing the names of interpreters between the asking and - * target interpreters. The target interpreter must be either the - * same as the asking interpreter or one of its slaves (including - * recursively). - * - * Results: - * TCL_OK if the target interpreter is the same as, or a descendant - * of, the asking interpreter; TCL_ERROR else. This way one can - * distinguish between the case where the asking and target interps - * are the same (an empty list is the result, and TCL_OK is returned) - * and when the target is not a descendant of the asking interpreter - * (in which case the Tcl result is an error message and the function - * returns TCL_ERROR). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetInterpPath(askingInterp, targetInterp) - Tcl_Interp *askingInterp; /* Interpreter to start search from. */ - Tcl_Interp *targetInterp; /* Interpreter to find. */ -{ - InterpInfo *iiPtr; - - if (targetInterp == askingInterp) { - return TCL_OK; - } - if (targetInterp == NULL) { - return TCL_ERROR; - } - iiPtr = (InterpInfo *) ((Interp *) targetInterp)->interpInfo; - if (Tcl_GetInterpPath(askingInterp, iiPtr->slave.masterInterp) != TCL_OK) { - return TCL_ERROR; - } - Tcl_AppendElement(askingInterp, - Tcl_GetHashKey(&iiPtr->master.slaveTable, - iiPtr->slave.slaveEntryPtr)); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * GetInterp -- - * - * Helper function to find a slave interpreter given a pathname. - * - * Results: - * Returns the slave interpreter known by that name in the calling - * interpreter, or NULL if no interpreter known by that name exists. - * - * Side effects: - * Assigns to the pointer variable passed in, if not NULL. - * - *---------------------------------------------------------------------- - */ - -static Tcl_Interp * -GetInterp(interp, pathPtr) - Tcl_Interp *interp; /* Interp. to start search from. */ - Tcl_Obj *pathPtr; /* List object containing name of interp. to - * be found. */ -{ - Tcl_HashEntry *hPtr; /* Search element. */ - Slave *slavePtr; /* Interim slave record. */ - Tcl_Obj **objv; - int objc, i; - Tcl_Interp *searchInterp; /* Interim storage for interp. to find. */ - InterpInfo *masterInfoPtr; - - if (Tcl_ListObjGetElements(interp, pathPtr, &objc, &objv) != TCL_OK) { - return NULL; - } - - searchInterp = interp; - for (i = 0; i < objc; i++) { - masterInfoPtr = (InterpInfo *) ((Interp *) searchInterp)->interpInfo; - hPtr = Tcl_FindHashEntry(&masterInfoPtr->master.slaveTable, - Tcl_GetString(objv[i])); - if (hPtr == NULL) { - searchInterp = NULL; - break; - } - slavePtr = (Slave *) Tcl_GetHashValue(hPtr); - searchInterp = slavePtr->slaveInterp; - if (searchInterp == NULL) { - break; - } - } - if (searchInterp == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "could not find interpreter \"", - Tcl_GetString(pathPtr), "\"", (char *) NULL); - } - return searchInterp; -} - -/* - *---------------------------------------------------------------------- - * - * SlaveCreate -- - * - * Helper function to do the actual work of creating a slave interp - * and new object command. Also optionally makes the new slave - * interpreter "safe". - * - * Results: - * Returns the new Tcl_Interp * if successful or NULL if not. If failed, - * the result of the invoking interpreter contains an error message. - * - * Side effects: - * Creates a new slave interpreter and a new object command. - * - *---------------------------------------------------------------------- - */ - -static Tcl_Interp * -SlaveCreate(interp, pathPtr, safe) - Tcl_Interp *interp; /* Interp. to start search from. */ - Tcl_Obj *pathPtr; /* Path (name) of slave to create. */ - int safe; /* Should we make it "safe"? */ -{ - Tcl_Interp *masterInterp, *slaveInterp; - Slave *slavePtr; - InterpInfo *masterInfoPtr; - Tcl_HashEntry *hPtr; - char *path; - int new, objc; - Tcl_Obj **objv; - - if (Tcl_ListObjGetElements(interp, pathPtr, &objc, &objv) != TCL_OK) { - return NULL; - } - if (objc < 2) { - masterInterp = interp; - path = Tcl_GetString(pathPtr); - } else { - Tcl_Obj *objPtr; - - objPtr = Tcl_NewListObj(objc - 1, objv); - masterInterp = GetInterp(interp, objPtr); - Tcl_DecrRefCount(objPtr); - if (masterInterp == NULL) { - return NULL; - } - path = Tcl_GetString(objv[objc - 1]); - } - if (safe == 0) { - safe = Tcl_IsSafe(masterInterp); - } - - masterInfoPtr = (InterpInfo *) ((Interp *) masterInterp)->interpInfo; - hPtr = Tcl_CreateHashEntry(&masterInfoPtr->master.slaveTable, path, &new); - if (new == 0) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "interpreter named \"", path, - "\" already exists, cannot create", (char *) NULL); - return NULL; - } - - slaveInterp = Tcl_CreateInterp(); - slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave; - slavePtr->masterInterp = masterInterp; - slavePtr->slaveEntryPtr = hPtr; - slavePtr->slaveInterp = slaveInterp; - slavePtr->interpCmd = Tcl_CreateObjCommand(masterInterp, path, - SlaveObjCmd, (ClientData) slaveInterp, SlaveObjCmdDeleteProc); - Tcl_InitHashTable(&slavePtr->aliasTable, TCL_STRING_KEYS); - Tcl_SetHashValue(hPtr, (ClientData) slavePtr); - Tcl_SetVar(slaveInterp, "tcl_interactive", "0", TCL_GLOBAL_ONLY); - - /* - * Inherit the recursion limit. - */ - ((Interp *) slaveInterp)->maxNestingDepth = - ((Interp *) masterInterp)->maxNestingDepth ; - - if (safe) { - if (Tcl_MakeSafe(slaveInterp) == TCL_ERROR) { - goto error; - } - } else { - if (Tcl_Init(slaveInterp) == TCL_ERROR) { - goto error; - } - } - return slaveInterp; - - error: - TclTransferResult(slaveInterp, TCL_ERROR, interp); - Tcl_DeleteInterp(slaveInterp); - - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * SlaveObjCmd -- - * - * Command to manipulate an interpreter, e.g. to send commands to it - * to be evaluated. One such command exists for each slave interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See user documentation for details. - * - *---------------------------------------------------------------------- - */ - -static int -SlaveObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Slave interpreter. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Interp *slaveInterp; - int index; - static char *options[] = { - "alias", "aliases", "eval", "expose", - "hide", "hidden", "issafe", "invokehidden", - "marktrusted", NULL - }; - enum options { - OPT_ALIAS, OPT_ALIASES, OPT_EVAL, OPT_EXPOSE, - OPT_HIDE, OPT_HIDDEN, OPT_ISSAFE, OPT_INVOKEHIDDEN, - OPT_MARKTRUSTED - }; - - slaveInterp = (Tcl_Interp *) clientData; - if (slaveInterp == NULL) { - panic("SlaveObjCmd: interpreter has been deleted"); - } - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "cmd ?arg ...?"); - return TCL_ERROR; - } - if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - switch ((enum options) index) { - case OPT_ALIAS: { - if (objc == 3) { - return AliasDescribe(interp, slaveInterp, objv[2]); - } - if (Tcl_GetString(objv[3])[0] == '\0') { - if (objc == 4) { - return AliasDelete(interp, slaveInterp, objv[2]); - } - } else { - return AliasCreate(interp, slaveInterp, interp, objv[2], - objv[3], objc - 4, objv + 4); - } - Tcl_WrongNumArgs(interp, 2, objv, - "aliasName ?targetName? ?args..?"); - return TCL_ERROR; - } - case OPT_ALIASES: { - return AliasList(interp, slaveInterp); - } - case OPT_EVAL: { - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "arg ?arg ...?"); - return TCL_ERROR; - } - return SlaveEval(interp, slaveInterp, objc - 2, objv + 2); - } - case OPT_EXPOSE: { - if ((objc < 3) || (objc > 4)) { - Tcl_WrongNumArgs(interp, 2, objv, "hiddenCmdName ?cmdName?"); - return TCL_ERROR; - } - return SlaveExpose(interp, slaveInterp, objc - 2, objv + 2); - } - case OPT_HIDE: { - if ((objc < 3) || (objc > 4)) { - Tcl_WrongNumArgs(interp, 2, objv, "cmdName ?hiddenCmdName?"); - return TCL_ERROR; - } - return SlaveHide(interp, slaveInterp, objc - 2, objv + 2); - } - case OPT_HIDDEN: { - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - return SlaveHidden(interp, slaveInterp); - } - case OPT_ISSAFE: { - Tcl_SetIntObj(Tcl_GetObjResult(interp), Tcl_IsSafe(slaveInterp)); - return TCL_OK; - } - case OPT_INVOKEHIDDEN: { - int global, i, index; - static char *hiddenOptions[] = { - "-global", "--", NULL - }; - enum hiddenOption { - OPT_GLOBAL, OPT_LAST - }; - global = 0; - for (i = 2; i < objc; i++) { - if (Tcl_GetString(objv[i])[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[i], hiddenOptions, - "option", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - if (index == OPT_GLOBAL) { - global = 1; - } else { - i++; - break; - } - } - if (objc - i < 1) { - Tcl_WrongNumArgs(interp, 2, objv, - "?-global? ?--? cmd ?arg ..?"); - return TCL_ERROR; - } - return SlaveInvokeHidden(interp, slaveInterp, global, objc - i, - objv + i); - } - case OPT_MARKTRUSTED: { - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - return SlaveMarkTrusted(interp, slaveInterp); - } - } - - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * SlaveObjCmdDeleteProc -- - * - * Invoked when an object command for a slave interpreter is deleted; - * cleans up all state associated with the slave interpreter and destroys - * the slave interpreter. - * - * Results: - * None. - * - * Side effects: - * Cleans up all state associated with the slave interpreter and - * destroys the slave interpreter. - * - *---------------------------------------------------------------------- - */ - -static void -SlaveObjCmdDeleteProc(clientData) - ClientData clientData; /* The SlaveRecord for the command. */ -{ - Slave *slavePtr; /* Interim storage for Slave record. */ - Tcl_Interp *slaveInterp; /* And for a slave interp. */ - - slaveInterp = (Tcl_Interp *) clientData; - slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave; - - /* - * Unlink the slave from its master interpreter. - */ - - Tcl_DeleteHashEntry(slavePtr->slaveEntryPtr); - - /* - * Set to NULL so that when the InterpInfo is cleaned up in the slave - * it does not try to delete the command causing all sorts of grief. - * See SlaveRecordDeleteProc(). - */ - - slavePtr->interpCmd = NULL; - - if (slavePtr->slaveInterp != NULL) { - Tcl_DeleteInterp(slavePtr->slaveInterp); - } -} - -/* - *---------------------------------------------------------------------- - * - * SlaveEval -- - * - * Helper function to evaluate a command in a slave interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Whatever the command does. - * - *---------------------------------------------------------------------- - */ - -static int -SlaveEval(interp, slaveInterp, objc, objv) - Tcl_Interp *interp; /* Interp for error return. */ - Tcl_Interp *slaveInterp; /* The slave interpreter in which command - * will be evaluated. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int result; - Tcl_Obj *objPtr; - - Tcl_Preserve((ClientData) slaveInterp); - Tcl_AllowExceptions(slaveInterp); - - if (objc == 1) { - result = Tcl_EvalObjEx(slaveInterp, objv[0], 0); - } else { - objPtr = Tcl_ConcatObj(objc, objv); - Tcl_IncrRefCount(objPtr); - result = Tcl_EvalObjEx(slaveInterp, objPtr, 0); - Tcl_DecrRefCount(objPtr); - } - TclTransferResult(slaveInterp, result, interp); - - Tcl_Release((ClientData) slaveInterp); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * SlaveExpose -- - * - * Helper function to expose a command in a slave interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * After this call scripts in the slave will be able to invoke - * the newly exposed command. - * - *---------------------------------------------------------------------- - */ - -static int -SlaveExpose(interp, slaveInterp, objc, objv) - Tcl_Interp *interp; /* Interp for error return. */ - Tcl_Interp *slaveInterp; /* Interp in which command will be exposed. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument strings. */ -{ - char *name; - - if (Tcl_IsSafe(interp)) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "permission denied: safe interpreter cannot expose commands", - (char *) NULL); - return TCL_ERROR; - } - - name = Tcl_GetString(objv[(objc == 1) ? 0 : 1]); - if (Tcl_ExposeCommand(slaveInterp, Tcl_GetString(objv[0]), - name) != TCL_OK) { - TclTransferResult(slaveInterp, TCL_ERROR, interp); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * SlaveHide -- - * - * Helper function to hide a command in a slave interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * After this call scripts in the slave will no longer be able - * to invoke the named command. - * - *---------------------------------------------------------------------- - */ - -static int -SlaveHide(interp, slaveInterp, objc, objv) - Tcl_Interp *interp; /* Interp for error return. */ - Tcl_Interp *slaveInterp; /* Interp in which command will be exposed. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument strings. */ -{ - char *name; - - if (Tcl_IsSafe(interp)) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "permission denied: safe interpreter cannot hide commands", - (char *) NULL); - return TCL_ERROR; - } - - name = Tcl_GetString(objv[(objc == 1) ? 0 : 1]); - if (Tcl_HideCommand(slaveInterp, Tcl_GetString(objv[0]), - name) != TCL_OK) { - TclTransferResult(slaveInterp, TCL_ERROR, interp); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * SlaveHidden -- - * - * Helper function to compute list of hidden commands in a slave - * interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -SlaveHidden(interp, slaveInterp) - Tcl_Interp *interp; /* Interp for data return. */ - Tcl_Interp *slaveInterp; /* Interp whose hidden commands to query. */ -{ - Tcl_Obj *listObjPtr; /* Local object pointer. */ - Tcl_HashTable *hTblPtr; /* For local searches. */ - Tcl_HashEntry *hPtr; /* For local searches. */ - Tcl_HashSearch hSearch; /* For local searches. */ - - listObjPtr = Tcl_GetObjResult(interp); - hTblPtr = ((Interp *) slaveInterp)->hiddenCmdTablePtr; - if (hTblPtr != (Tcl_HashTable *) NULL) { - for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); - hPtr != (Tcl_HashEntry *) NULL; - hPtr = Tcl_NextHashEntry(&hSearch)) { - - Tcl_ListObjAppendElement(NULL, listObjPtr, - Tcl_NewStringObj(Tcl_GetHashKey(hTblPtr, hPtr), -1)); - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * SlaveInvokeHidden -- - * - * Helper function to invoke a hidden command in a slave interpreter. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Whatever the hidden command does. - * - *---------------------------------------------------------------------- - */ - -static int -SlaveInvokeHidden(interp, slaveInterp, global, objc, objv) - Tcl_Interp *interp; /* Interp for error return. */ - Tcl_Interp *slaveInterp; /* The slave interpreter in which command - * will be invoked. */ - int global; /* Non-zero to invoke in global namespace. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int result; - - if (Tcl_IsSafe(interp)) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), - "not allowed to invoke hidden commands from safe interpreter", - -1); - return TCL_ERROR; - } - - Tcl_Preserve((ClientData) slaveInterp); - Tcl_AllowExceptions(slaveInterp); - - if (global) { - result = TclObjInvokeGlobal(slaveInterp, objc, objv, - TCL_INVOKE_HIDDEN); - } else { - result = TclObjInvoke(slaveInterp, objc, objv, TCL_INVOKE_HIDDEN); - } - - TclTransferResult(slaveInterp, result, interp); - - Tcl_Release((ClientData) slaveInterp); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * SlaveMarkTrusted -- - * - * Helper function to mark a slave interpreter as trusted (unsafe). - * - * Results: - * A standard Tcl result. - * - * Side effects: - * After this call the hard-wired security checks in the core no - * longer prevent the slave from performing certain operations. - * - *---------------------------------------------------------------------- - */ - -static int -SlaveMarkTrusted(interp, slaveInterp) - Tcl_Interp *interp; /* Interp for error return. */ - Tcl_Interp *slaveInterp; /* The slave interpreter which will be - * marked trusted. */ -{ - if (Tcl_IsSafe(interp)) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "permission denied: safe interpreter cannot mark trusted", - (char *) NULL); - return TCL_ERROR; - } - ((Interp *) slaveInterp)->flags &= ~SAFE_INTERP; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_IsSafe -- - * - * Determines whether an interpreter is safe - * - * Results: - * 1 if it is safe, 0 if it is not. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_IsSafe(interp) - Tcl_Interp *interp; /* Is this interpreter "safe" ? */ -{ - Interp *iPtr; - - if (interp == (Tcl_Interp *) NULL) { - return 0; - } - iPtr = (Interp *) interp; - - return ( (iPtr->flags) & SAFE_INTERP ) ? 1 : 0 ; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_MakeSafe -- - * - * Makes its argument interpreter contain only functionality that is - * defined to be part of Safe Tcl. Unsafe commands are hidden, the - * env array is unset, and the standard channels are removed. - * - * Results: - * None. - * - * Side effects: - * Hides commands in its argument interpreter, and removes settings - * and channels. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_MakeSafe(interp) - Tcl_Interp *interp; /* Interpreter to be made safe. */ -{ - Tcl_Channel chan; /* Channel to remove from - * safe interpreter. */ - Interp *iPtr = (Interp *) interp; - - TclHideUnsafeCommands(interp); - - iPtr->flags |= SAFE_INTERP; - - /* - * Unsetting variables : (which should not have been set - * in the first place, but...) - */ - - /* - * No env array in a safe slave. - */ - - Tcl_UnsetVar(interp, "env", TCL_GLOBAL_ONLY); - - /* - * Remove unsafe parts of tcl_platform - */ - - Tcl_UnsetVar2(interp, "tcl_platform", "os", TCL_GLOBAL_ONLY); - Tcl_UnsetVar2(interp, "tcl_platform", "osVersion", TCL_GLOBAL_ONLY); - Tcl_UnsetVar2(interp, "tcl_platform", "machine", TCL_GLOBAL_ONLY); - Tcl_UnsetVar2(interp, "tcl_platform", "user", TCL_GLOBAL_ONLY); - - /* - * Unset path informations variables - * (the only one remaining is [info nameofexecutable]) - */ - - Tcl_UnsetVar(interp, "tclDefaultLibrary", TCL_GLOBAL_ONLY); - Tcl_UnsetVar(interp, "tcl_library", TCL_GLOBAL_ONLY); - Tcl_UnsetVar(interp, "tcl_pkgPath", TCL_GLOBAL_ONLY); - - /* - * Remove the standard channels from the interpreter; safe interpreters - * do not ordinarily have access to stdin, stdout and stderr. - * - * NOTE: These channels are not added to the interpreter by the - * Tcl_CreateInterp call, but may be added later, by another I/O - * operation. We want to ensure that the interpreter does not have - * these channels even if it is being made safe after being used for - * some time.. - */ - - chan = Tcl_GetStdChannel(TCL_STDIN); - if (chan != (Tcl_Channel) NULL) { - Tcl_UnregisterChannel(interp, chan); - } - chan = Tcl_GetStdChannel(TCL_STDOUT); - if (chan != (Tcl_Channel) NULL) { - Tcl_UnregisterChannel(interp, chan); - } - chan = Tcl_GetStdChannel(TCL_STDERR); - if (chan != (Tcl_Channel) NULL) { - Tcl_UnregisterChannel(interp, chan); - } - - return TCL_OK; -} diff --git a/generic/tclLink.c b/generic/tclLink.c deleted file mode 100644 index 20f9191..0000000 --- a/generic/tclLink.c +++ /dev/null @@ -1,430 +0,0 @@ -/* - * tclLink.c -- - * - * This file implements linked variables (a C variable that is - * tied to a Tcl variable). The idea of linked variables was - * first suggested by Andreas Stolcke and this implementation is - * based heavily on a prototype implementation provided by - * him. - * - * Copyright (c) 1993 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. - * - * RCS: @(#) $Id: tclLink.c,v 1.3 1999/04/16 00:46:49 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * For each linked variable there is a data structure of the following - * type, which describes the link and is the clientData for the trace - * set on the Tcl variable. - */ - -typedef struct Link { - Tcl_Interp *interp; /* Interpreter containing Tcl variable. */ - char *varName; /* Name of variable (must be global). This - * is needed during trace callbacks, since - * the actual variable may be aliased at - * that time via upvar. */ - char *addr; /* Location of C variable. */ - int type; /* Type of link (TCL_LINK_INT, etc.). */ - union { - int i; - double d; - } lastValue; /* Last known value of C variable; used to - * avoid string conversions. */ - int flags; /* Miscellaneous one-bit values; see below - * for definitions. */ -} Link; - -/* - * Definitions for flag bits: - * LINK_READ_ONLY - 1 means errors should be generated if Tcl - * script attempts to write variable. - * LINK_BEING_UPDATED - 1 means that a call to Tcl_UpdateLinkedVar - * is in progress for this variable, so - * trace callbacks on the variable should - * be ignored. - */ - -#define LINK_READ_ONLY 1 -#define LINK_BEING_UPDATED 2 - -/* - * Forward references to procedures defined later in this file: - */ - -static char * LinkTraceProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, char *name2, - int flags)); -static char * StringValue _ANSI_ARGS_((Link *linkPtr, - char *buffer)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_LinkVar -- - * - * Link a C variable to a Tcl variable so that changes to either - * one causes the other to change. - * - * Results: - * The return value is TCL_OK if everything went well or TCL_ERROR - * if an error occurred (the interp's result is also set after - * errors). - * - * Side effects: - * The value at *addr is linked to the Tcl variable "varName", - * using "type" to convert between string values for Tcl and - * binary values for *addr. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_LinkVar(interp, varName, addr, type) - Tcl_Interp *interp; /* Interpreter in which varName exists. */ - char *varName; /* Name of a global variable in interp. */ - char *addr; /* Address of a C variable to be linked - * to varName. */ - int type; /* Type of C variable: TCL_LINK_INT, etc. - * Also may have TCL_LINK_READ_ONLY - * OR'ed in. */ -{ - Link *linkPtr; - char buffer[TCL_DOUBLE_SPACE]; - int code; - - linkPtr = (Link *) ckalloc(sizeof(Link)); - linkPtr->interp = interp; - linkPtr->varName = (char *) ckalloc((unsigned) (strlen(varName) + 1)); - strcpy(linkPtr->varName, varName); - linkPtr->addr = addr; - linkPtr->type = type & ~TCL_LINK_READ_ONLY; - if (type & TCL_LINK_READ_ONLY) { - linkPtr->flags = LINK_READ_ONLY; - } else { - linkPtr->flags = 0; - } - if (Tcl_SetVar(interp, varName, StringValue(linkPtr, buffer), - TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { - ckfree(linkPtr->varName); - ckfree((char *) linkPtr); - return TCL_ERROR; - } - code = Tcl_TraceVar(interp, varName, TCL_GLOBAL_ONLY|TCL_TRACE_READS - |TCL_TRACE_WRITES|TCL_TRACE_UNSETS, LinkTraceProc, - (ClientData) linkPtr); - if (code != TCL_OK) { - ckfree(linkPtr->varName); - ckfree((char *) linkPtr); - } - return code; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UnlinkVar -- - * - * Destroy the link between a Tcl variable and a C variable. - * - * Results: - * None. - * - * Side effects: - * If "varName" was previously linked to a C variable, the link - * is broken to make the variable independent. If there was no - * previous link for "varName" then nothing happens. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_UnlinkVar(interp, varName) - Tcl_Interp *interp; /* Interpreter containing variable to unlink. */ - char *varName; /* Global variable in interp to unlink. */ -{ - Link *linkPtr; - - linkPtr = (Link *) Tcl_VarTraceInfo(interp, varName, TCL_GLOBAL_ONLY, - LinkTraceProc, (ClientData) NULL); - if (linkPtr == NULL) { - return; - } - Tcl_UntraceVar(interp, varName, - TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - LinkTraceProc, (ClientData) linkPtr); - ckfree(linkPtr->varName); - ckfree((char *) linkPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UpdateLinkedVar -- - * - * This procedure is invoked after a linked variable has been - * changed by C code. It updates the Tcl variable so that - * traces on the variable will trigger. - * - * Results: - * None. - * - * Side effects: - * The Tcl variable "varName" is updated from its C value, - * causing traces on the variable to trigger. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_UpdateLinkedVar(interp, varName) - Tcl_Interp *interp; /* Interpreter containing variable. */ - char *varName; /* Name of global variable that is linked. */ -{ - Link *linkPtr; - char buffer[TCL_DOUBLE_SPACE]; - int savedFlag; - - linkPtr = (Link *) Tcl_VarTraceInfo(interp, varName, TCL_GLOBAL_ONLY, - LinkTraceProc, (ClientData) NULL); - if (linkPtr == NULL) { - return; - } - savedFlag = linkPtr->flags & LINK_BEING_UPDATED; - linkPtr->flags |= LINK_BEING_UPDATED; - Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer), - TCL_GLOBAL_ONLY); - linkPtr->flags = (linkPtr->flags & ~LINK_BEING_UPDATED) | savedFlag; -} - -/* - *---------------------------------------------------------------------- - * - * LinkTraceProc -- - * - * This procedure is invoked when a linked Tcl variable is read, - * written, or unset from Tcl. It's responsible for keeping the - * C variable in sync with the Tcl variable. - * - * Results: - * If all goes well, NULL is returned; otherwise an error message - * is returned. - * - * Side effects: - * The C variable may be updated to make it consistent with the - * Tcl variable, or the Tcl variable may be overwritten to reject - * a modification. - * - *---------------------------------------------------------------------- - */ - -static char * -LinkTraceProc(clientData, interp, name1, name2, flags) - ClientData clientData; /* Contains information about the link. */ - Tcl_Interp *interp; /* Interpreter containing Tcl variable. */ - char *name1; /* First part of variable name. */ - char *name2; /* Second part of variable name. */ - int flags; /* Miscellaneous additional information. */ -{ - Link *linkPtr = (Link *) clientData; - int changed; - char buffer[TCL_DOUBLE_SPACE]; - char *value, **pp, *result; - Tcl_Obj *objPtr; - - /* - * If the variable is being unset, then just re-create it (with a - * trace) unless the whole interpreter is going away. - */ - - if (flags & TCL_TRACE_UNSETS) { - if (flags & TCL_INTERP_DESTROYED) { - ckfree(linkPtr->varName); - ckfree((char *) linkPtr); - } else if (flags & TCL_TRACE_DESTROYED) { - Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer), - TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, linkPtr->varName, TCL_GLOBAL_ONLY - |TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - LinkTraceProc, (ClientData) linkPtr); - } - return NULL; - } - - /* - * If we were invoked because of a call to Tcl_UpdateLinkedVar, then - * don't do anything at all. In particular, we don't want to get - * upset that the variable is being modified, even if it is - * supposed to be read-only. - */ - - if (linkPtr->flags & LINK_BEING_UPDATED) { - return NULL; - } - - /* - * For read accesses, update the Tcl variable if the C variable - * has changed since the last time we updated the Tcl variable. - */ - - if (flags & TCL_TRACE_READS) { - switch (linkPtr->type) { - case TCL_LINK_INT: - case TCL_LINK_BOOLEAN: - changed = *(int *)(linkPtr->addr) != linkPtr->lastValue.i; - break; - case TCL_LINK_DOUBLE: - changed = *(double *)(linkPtr->addr) != linkPtr->lastValue.d; - break; - case TCL_LINK_STRING: - changed = 1; - break; - default: - return "internal error: bad linked variable type"; - } - if (changed) { - Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer), - TCL_GLOBAL_ONLY); - } - return NULL; - } - - /* - * For writes, first make sure that the variable is writable. Then - * convert the Tcl value to C if possible. If the variable isn't - * writable or can't be converted, then restore the varaible's old - * value and return an error. Another tricky thing: we have to save - * and restore the interpreter's result, since the variable access - * could occur when the result has been partially set. - */ - - if (linkPtr->flags & LINK_READ_ONLY) { - Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer), - TCL_GLOBAL_ONLY); - return "linked variable is read-only"; - } - value = Tcl_GetVar(interp, linkPtr->varName, TCL_GLOBAL_ONLY); - if (value == NULL) { - /* - * This shouldn't ever happen. - */ - return "internal error: linked variable couldn't be read"; - } - - objPtr = Tcl_GetObjResult(interp); - Tcl_IncrRefCount(objPtr); - Tcl_ResetResult(interp); - result = NULL; - - switch (linkPtr->type) { - case TCL_LINK_INT: - if (Tcl_GetInt(interp, value, &linkPtr->lastValue.i) != TCL_OK) { - Tcl_SetObjResult(interp, objPtr); - Tcl_SetVar(interp, linkPtr->varName, - StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY); - result = "variable must have integer value"; - goto end; - } - *(int *)(linkPtr->addr) = linkPtr->lastValue.i; - break; - case TCL_LINK_DOUBLE: - if (Tcl_GetDouble(interp, value, &linkPtr->lastValue.d) - != TCL_OK) { - Tcl_SetObjResult(interp, objPtr); - Tcl_SetVar(interp, linkPtr->varName, - StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY); - result = "variable must have real value"; - goto end; - } - *(double *)(linkPtr->addr) = linkPtr->lastValue.d; - break; - case TCL_LINK_BOOLEAN: - if (Tcl_GetBoolean(interp, value, &linkPtr->lastValue.i) - != TCL_OK) { - Tcl_SetObjResult(interp, objPtr); - Tcl_SetVar(interp, linkPtr->varName, - StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY); - result = "variable must have boolean value"; - goto end; - } - *(int *)(linkPtr->addr) = linkPtr->lastValue.i; - break; - case TCL_LINK_STRING: - pp = (char **)(linkPtr->addr); - if (*pp != NULL) { - ckfree(*pp); - } - *pp = (char *) ckalloc((unsigned) (strlen(value) + 1)); - strcpy(*pp, value); - break; - default: - return "internal error: bad linked variable type"; - } - end: - Tcl_DecrRefCount(objPtr); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * StringValue -- - * - * Converts the value of a C variable to a string for use in a - * Tcl variable to which it is linked. - * - * Results: - * The return value is a pointer to a string that represents - * the value of the C variable given by linkPtr. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static char * -StringValue(linkPtr, buffer) - Link *linkPtr; /* Structure describing linked variable. */ - char *buffer; /* Small buffer to use for converting - * values. Must have TCL_DOUBLE_SPACE - * bytes or more. */ -{ - char *p; - - switch (linkPtr->type) { - case TCL_LINK_INT: - linkPtr->lastValue.i = *(int *)(linkPtr->addr); - TclFormatInt(buffer, linkPtr->lastValue.i); - return buffer; - case TCL_LINK_DOUBLE: - linkPtr->lastValue.d = *(double *)(linkPtr->addr); - Tcl_PrintDouble((Tcl_Interp *) NULL, linkPtr->lastValue.d, buffer); - return buffer; - case TCL_LINK_BOOLEAN: - linkPtr->lastValue.i = *(int *)(linkPtr->addr); - if (linkPtr->lastValue.i != 0) { - return "1"; - } - return "0"; - case TCL_LINK_STRING: - p = *(char **)(linkPtr->addr); - if (p == NULL) { - return "NULL"; - } - return p; - } - - /* - * This code only gets executed if the link type is unknown - * (shouldn't ever happen). - */ - - return "??"; -} diff --git a/generic/tclListObj.c b/generic/tclListObj.c deleted file mode 100644 index aceaa7a..0000000 --- a/generic/tclListObj.c +++ /dev/null @@ -1,1059 +0,0 @@ -/* - * tclListObj.c -- - * - * This file contains procedures that implement the Tcl list object - * type. - * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclListObj.c,v 1.4 1999/04/16 00:46:50 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * Prototypes for procedures defined later in this file: - */ - -static void DupListInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr, - Tcl_Obj *copyPtr)); -static void FreeListInternalRep _ANSI_ARGS_((Tcl_Obj *listPtr)); -static int SetListFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static void UpdateStringOfList _ANSI_ARGS_((Tcl_Obj *listPtr)); - -/* - * The structure below defines the list Tcl object type by means of - * procedures that can be invoked by generic object code. - */ - -Tcl_ObjType tclListType = { - "list", /* name */ - FreeListInternalRep, /* freeIntRepProc */ - DupListInternalRep, /* dupIntRepProc */ - UpdateStringOfList, /* updateStringProc */ - SetListFromAny /* setFromAnyProc */ -}; - -/* - *---------------------------------------------------------------------- - * - * Tcl_NewListObj -- - * - * This procedure is normally called when not debugging: i.e., when - * TCL_MEM_DEBUG is not defined. It creates a new list object from an - * (objc,objv) array: that is, each of the objc elements of the array - * referenced by objv is inserted as an element into a new Tcl object. - * - * When TCL_MEM_DEBUG is defined, this procedure just returns the - * result of calling the debugging version Tcl_DbNewListObj. - * - * Results: - * A new list object is returned that is initialized from the object - * pointers in objv. If objc is less than or equal to zero, an empty - * object is returned. The new object's string representation - * is left NULL. The resulting new list object has ref count 0. - * - * Side effects: - * The ref counts of the elements in objv are incremented since the - * resulting list now refers to them. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG -#undef Tcl_NewListObj - -Tcl_Obj * -Tcl_NewListObj(objc, objv) - int objc; /* Count of objects referenced by objv. */ - Tcl_Obj *CONST objv[]; /* An array of pointers to Tcl objects. */ -{ - return Tcl_DbNewListObj(objc, objv, "unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewListObj(objc, objv) - int objc; /* Count of objects referenced by objv. */ - Tcl_Obj *CONST objv[]; /* An array of pointers to Tcl objects. */ -{ - register Tcl_Obj *listPtr; - register Tcl_Obj **elemPtrs; - register List *listRepPtr; - int i; - - TclNewObj(listPtr); - - if (objc > 0) { - Tcl_InvalidateStringRep(listPtr); - - elemPtrs = (Tcl_Obj **) - ckalloc((unsigned) (objc * sizeof(Tcl_Obj *))); - for (i = 0; i < objc; i++) { - elemPtrs[i] = objv[i]; - Tcl_IncrRefCount(elemPtrs[i]); - } - - listRepPtr = (List *) ckalloc(sizeof(List)); - listRepPtr->maxElemCount = objc; - listRepPtr->elemCount = objc; - listRepPtr->elements = elemPtrs; - - listPtr->internalRep.otherValuePtr = (VOID *) listRepPtr; - listPtr->typePtr = &tclListType; - } - return listPtr; -} -#endif /* if TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbNewListObj -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. It creates new list objects. It is the - * same as the Tcl_NewListObj procedure above except that it calls - * Tcl_DbCkalloc directly with the file name and line number from its - * caller. This simplifies debugging since then the checkmem command - * will report the correct file name and line number when reporting - * objects that haven't been freed. - * - * When TCL_MEM_DEBUG is not defined, this procedure just returns the - * result of calling Tcl_NewListObj. - * - * Results: - * A new list object is returned that is initialized from the object - * pointers in objv. If objc is less than or equal to zero, an empty - * object is returned. The new object's string representation - * is left NULL. The new list object has ref count 0. - * - * Side effects: - * The ref counts of the elements in objv are incremented since the - * resulting list now refers to them. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_DbNewListObj(objc, objv, file, line) - int objc; /* Count of objects referenced by objv. */ - Tcl_Obj *CONST objv[]; /* An array of pointers to Tcl objects. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - register Tcl_Obj *listPtr; - register Tcl_Obj **elemPtrs; - register List *listRepPtr; - int i; - - TclDbNewObj(listPtr, file, line); - - if (objc > 0) { - Tcl_InvalidateStringRep(listPtr); - - elemPtrs = (Tcl_Obj **) - ckalloc((unsigned) (objc * sizeof(Tcl_Obj *))); - for (i = 0; i < objc; i++) { - elemPtrs[i] = objv[i]; - Tcl_IncrRefCount(elemPtrs[i]); - } - - listRepPtr = (List *) ckalloc(sizeof(List)); - listRepPtr->maxElemCount = objc; - listRepPtr->elemCount = objc; - listRepPtr->elements = elemPtrs; - - listPtr->internalRep.otherValuePtr = (VOID *) listRepPtr; - listPtr->typePtr = &tclListType; - } - return listPtr; -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_DbNewListObj(objc, objv, file, line) - int objc; /* Count of objects referenced by objv. */ - Tcl_Obj *CONST objv[]; /* An array of pointers to Tcl objects. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - return Tcl_NewListObj(objc, objv); -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetListObj -- - * - * Modify an object to be a list containing each of the objc elements - * of the object array referenced by objv. - * - * Results: - * None. - * - * Side effects: - * The object is made a list object and is initialized from the object - * pointers in objv. If objc is less than or equal to zero, an empty - * object is returned. The new object's string representation - * is left NULL. The ref counts of the elements in objv are incremented - * since the list now refers to them. The object's old string and - * internal representations are freed and its type is set NULL. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetListObj(objPtr, objc, objv) - Tcl_Obj *objPtr; /* Object whose internal rep to init. */ - int objc; /* Count of objects referenced by objv. */ - Tcl_Obj *CONST objv[]; /* An array of pointers to Tcl objects. */ -{ - register Tcl_Obj **elemPtrs; - register List *listRepPtr; - Tcl_ObjType *oldTypePtr = objPtr->typePtr; - int i; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetListObj called with shared object"); - } - - /* - * Free any old string rep and any internal rep for the old type. - */ - - Tcl_InvalidateStringRep(objPtr); - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - objPtr->typePtr = NULL; - - /* - * Set the object's type to "list" and initialize the internal rep. - * However, if there are no elements to put in the list, just give - * the object an empty string rep and a NULL type. - */ - - if (objc > 0) { - elemPtrs = (Tcl_Obj **) - ckalloc((unsigned) (objc * sizeof(Tcl_Obj *))); - for (i = 0; i < objc; i++) { - elemPtrs[i] = objv[i]; - Tcl_IncrRefCount(elemPtrs[i]); - } - - listRepPtr = (List *) ckalloc(sizeof(List)); - listRepPtr->maxElemCount = objc; - listRepPtr->elemCount = objc; - listRepPtr->elements = elemPtrs; - - objPtr->internalRep.otherValuePtr = (VOID *) listRepPtr; - objPtr->typePtr = &tclListType; - } else { - objPtr->bytes = tclEmptyStringRep; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ListObjGetElements -- - * - * This procedure returns an (objc,objv) array of the elements in a - * list object. - * - * Results: - * The return value is normally TCL_OK; in this case *objcPtr is set to - * the count of list elements and *objvPtr is set to a pointer to an - * array of (*objcPtr) pointers to each list element. If listPtr does - * not refer to a list object and the object can not be converted to - * one, TCL_ERROR is returned and an error message will be left in - * the interpreter's result if interp is not NULL. - * - * The objects referenced by the returned array should be treated as - * readonly and their ref counts are _not_ incremented; the caller must - * do that if it holds on to a reference. Furthermore, the pointer - * and length returned by this procedure may change as soon as any - * procedure is called on the list object; be careful about retaining - * the pointer in a local data structure. - * - * Side effects: - * The possible conversion of the object referenced by listPtr - * to a list object. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) - Tcl_Interp *interp; /* Used to report errors if not NULL. */ - register Tcl_Obj *listPtr; /* List object for which an element array - * is to be returned. */ - int *objcPtr; /* Where to store the count of objects - * referenced by objv. */ - Tcl_Obj ***objvPtr; /* Where to store the pointer to an array - * of pointers to the list's objects. */ -{ - register List *listRepPtr; - - if (listPtr->typePtr != &tclListType) { - int result = SetListFromAny(interp, listPtr); - if (result != TCL_OK) { - return result; - } - } - listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - *objcPtr = listRepPtr->elemCount; - *objvPtr = listRepPtr->elements; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ListObjAppendList -- - * - * This procedure appends the objects in the list referenced by - * elemListPtr to the list object referenced by listPtr. If listPtr is - * not already a list object, an attempt will be made to convert it to - * one. - * - * Results: - * The return value is normally TCL_OK. If listPtr or elemListPtr do - * not refer to list objects and they can not be converted to one, - * TCL_ERROR is returned and an error message is left in - * the interpreter's result if interp is not NULL. - * - * Side effects: - * The reference counts of the elements in elemListPtr are incremented - * since the list now refers to them. listPtr and elemListPtr are - * converted, if necessary, to list objects. Also, appending the - * new elements may cause listObj's array of element pointers to grow. - * listPtr's old string representation, if any, is invalidated. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ListObjAppendList(interp, listPtr, elemListPtr) - Tcl_Interp *interp; /* Used to report errors if not NULL. */ - register Tcl_Obj *listPtr; /* List object to append elements to. */ - Tcl_Obj *elemListPtr; /* List obj with elements to append. */ -{ - register List *listRepPtr; - int listLen, objc, result; - Tcl_Obj **objv; - - if (Tcl_IsShared(listPtr)) { - panic("Tcl_ListObjAppendList called with shared object"); - } - if (listPtr->typePtr != &tclListType) { - result = SetListFromAny(interp, listPtr); - if (result != TCL_OK) { - return result; - } - } - listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - listLen = listRepPtr->elemCount; - - result = Tcl_ListObjGetElements(interp, elemListPtr, &objc, &objv); - if (result != TCL_OK) { - return result; - } - - /* - * Insert objc new elements starting after the lists's last element. - * Delete zero existing elements. - */ - - return Tcl_ListObjReplace(interp, listPtr, listLen, 0, objc, objv); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ListObjAppendElement -- - * - * This procedure is a special purpose version of - * Tcl_ListObjAppendList: it appends a single object referenced by - * objPtr to the list object referenced by listPtr. If listPtr is not - * already a list object, an attempt will be made to convert it to one. - * - * Results: - * The return value is normally TCL_OK; in this case objPtr is added - * to the end of listPtr's list. If listPtr does not refer to a list - * object and the object can not be converted to one, TCL_ERROR is - * returned and an error message will be left in the interpreter's - * result if interp is not NULL. - * - * Side effects: - * The ref count of objPtr is incremented since the list now refers - * to it. listPtr will be converted, if necessary, to a list object. - * Also, appending the new element may cause listObj's array of element - * pointers to grow. listPtr's old string representation, if any, - * is invalidated. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ListObjAppendElement(interp, listPtr, objPtr) - Tcl_Interp *interp; /* Used to report errors if not NULL. */ - Tcl_Obj *listPtr; /* List object to append objPtr to. */ - Tcl_Obj *objPtr; /* Object to append to listPtr's list. */ -{ - register List *listRepPtr; - register Tcl_Obj **elemPtrs; - int numElems, numRequired; - - if (Tcl_IsShared(listPtr)) { - panic("Tcl_ListObjAppendElement called with shared object"); - } - if (listPtr->typePtr != &tclListType) { - int result = SetListFromAny(interp, listPtr); - if (result != TCL_OK) { - return result; - } - } - - listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - elemPtrs = listRepPtr->elements; - numElems = listRepPtr->elemCount; - numRequired = numElems + 1 ; - - /* - * If there is no room in the current array of element pointers, - * allocate a new, larger array and copy the pointers to it. - */ - - if (numRequired > listRepPtr->maxElemCount) { - int newMax = (2 * numRequired); - Tcl_Obj **newElemPtrs = (Tcl_Obj **) - ckalloc((unsigned) (newMax * sizeof(Tcl_Obj *))); - - memcpy((VOID *) newElemPtrs, (VOID *) elemPtrs, - (size_t) (numElems * sizeof(Tcl_Obj *))); - - listRepPtr->maxElemCount = newMax; - listRepPtr->elements = newElemPtrs; - ckfree((char *) elemPtrs); - elemPtrs = newElemPtrs; - } - - /* - * Add objPtr to the end of listPtr's array of element - * pointers. Increment the ref count for the (now shared) objPtr. - */ - - elemPtrs[numElems] = objPtr; - Tcl_IncrRefCount(objPtr); - listRepPtr->elemCount++; - - /* - * Invalidate any old string representation since the list's internal - * representation has changed. - */ - - Tcl_InvalidateStringRep(listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ListObjIndex -- - * - * This procedure returns a pointer to the index'th object from the - * list referenced by listPtr. The first element has index 0. If index - * is negative or greater than or equal to the number of elements in - * the list, a NULL is returned. If listPtr is not a list object, an - * attempt will be made to convert it to a list. - * - * Results: - * The return value is normally TCL_OK; in this case objPtrPtr is set - * to the Tcl_Obj pointer for the index'th list element or NULL if - * index is out of range. This object should be treated as readonly and - * its ref count is _not_ incremented; the caller must do that if it - * holds on to the reference. If listPtr does not refer to a list and - * can't be converted to one, TCL_ERROR is returned and an error - * message is left in the interpreter's result if interp is not NULL. - * - * Side effects: - * listPtr will be converted, if necessary, to a list object. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ListObjIndex(interp, listPtr, index, objPtrPtr) - Tcl_Interp *interp; /* Used to report errors if not NULL. */ - register Tcl_Obj *listPtr; /* List object to index into. */ - register int index; /* Index of element to return. */ - Tcl_Obj **objPtrPtr; /* The resulting Tcl_Obj* is stored here. */ -{ - register List *listRepPtr; - - if (listPtr->typePtr != &tclListType) { - int result = SetListFromAny(interp, listPtr); - if (result != TCL_OK) { - return result; - } - } - - listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - if ((index < 0) || (index >= listRepPtr->elemCount)) { - *objPtrPtr = NULL; - } else { - *objPtrPtr = listRepPtr->elements[index]; - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ListObjLength -- - * - * This procedure returns the number of elements in a list object. If - * the object is not already a list object, an attempt will be made to - * convert it to one. - * - * Results: - * The return value is normally TCL_OK; in this case *intPtr will be - * set to the integer count of list elements. If listPtr does not refer - * to a list object and the object can not be converted to one, - * TCL_ERROR is returned and an error message will be left in - * the interpreter's result if interp is not NULL. - * - * Side effects: - * The possible conversion of the argument object to a list object. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ListObjLength(interp, listPtr, intPtr) - Tcl_Interp *interp; /* Used to report errors if not NULL. */ - register Tcl_Obj *listPtr; /* List object whose #elements to return. */ - register int *intPtr; /* The resulting int is stored here. */ -{ - register List *listRepPtr; - - if (listPtr->typePtr != &tclListType) { - int result = SetListFromAny(interp, listPtr); - if (result != TCL_OK) { - return result; - } - } - - listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - *intPtr = listRepPtr->elemCount; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ListObjReplace -- - * - * This procedure replaces zero or more elements of the list referenced - * by listPtr with the objects from an (objc,objv) array. - * The objc elements of the array referenced by objv replace the - * count elements in listPtr starting at first. - * - * If the argument first is zero or negative, it refers to the first - * element. If first is greater than or equal to the number of elements - * in the list, then no elements are deleted; the new elements are - * appended to the list. Count gives the number of elements to - * replace. If count is zero or negative then no elements are deleted; - * the new elements are simply inserted before first. - * - * The argument objv refers to an array of objc pointers to the new - * elements to be added to listPtr in place of those that were - * deleted. If objv is NULL, no new elements are added. If listPtr is - * not a list object, an attempt will be made to convert it to one. - * - * Results: - * The return value is normally TCL_OK. If listPtr does - * not refer to a list object and can not be converted to one, - * TCL_ERROR is returned and an error message will be left in - * the interpreter's result if interp is not NULL. - * - * Side effects: - * The ref counts of the objc elements in objv are incremented since - * the resulting list now refers to them. Similarly, the ref counts for - * replaced objects are decremented. listPtr is converted, if - * necessary, to a list object. listPtr's old string representation, if - * any, is freed. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ListObjReplace(interp, listPtr, first, count, objc, objv) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - Tcl_Obj *listPtr; /* List object whose elements to replace. */ - int first; /* Index of first element to replace. */ - int count; /* Number of elements to replace. */ - int objc; /* Number of objects to insert. */ - Tcl_Obj *CONST objv[]; /* An array of objc pointers to Tcl objects - * to insert. */ -{ - List *listRepPtr; - register Tcl_Obj **elemPtrs, **newPtrs; - Tcl_Obj *victimPtr; - int numElems, numRequired, numAfterLast; - int start, shift, newMax, i, j, result; - - if (Tcl_IsShared(listPtr)) { - panic("Tcl_ListObjReplace called with shared object"); - } - if (listPtr->typePtr != &tclListType) { - result = SetListFromAny(interp, listPtr); - if (result != TCL_OK) { - return result; - } - } - listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - elemPtrs = listRepPtr->elements; - numElems = listRepPtr->elemCount; - - if (first < 0) { - first = 0; - } - if (first >= numElems) { - first = numElems; /* so we'll insert after last element */ - } - if (count < 0) { - count = 0; - } - - numRequired = (numElems - count + objc); - if (numRequired <= listRepPtr->maxElemCount) { - /* - * Enough room in the current array. First "delete" count - * elements starting at first. - */ - - for (i = 0, j = first; i < count; i++, j++) { - victimPtr = elemPtrs[j]; - TclDecrRefCount(victimPtr); - } - - /* - * Shift the elements after the last one removed to their - * new locations. - */ - - start = (first + count); - numAfterLast = (numElems - start); - shift = (objc - count); /* numNewElems - numDeleted */ - if ((numAfterLast > 0) && (shift != 0)) { - Tcl_Obj **src, **dst; - - if (shift < 0) { - for (src = elemPtrs + start, dst = src + shift; - numAfterLast > 0; numAfterLast--, src++, dst++) { - *dst = *src; - } - } else { - for (src = elemPtrs + numElems - 1, dst = src + shift; - numAfterLast > 0; numAfterLast--, src--, dst--) { - *dst = *src; - } - } - } - - /* - * Insert the new elements into elemPtrs before "first". - */ - - for (i = 0, j = first; i < objc; i++, j++) { - elemPtrs[j] = objv[i]; - Tcl_IncrRefCount(objv[i]); - } - - /* - * Update the count of elements. - */ - - listRepPtr->elemCount = numRequired; - } else { - /* - * Not enough room in the current array. Allocate a larger array and - * insert elements into it. - */ - - newMax = (2 * numRequired); - newPtrs = (Tcl_Obj **) - ckalloc((unsigned) (newMax * sizeof(Tcl_Obj *))); - - /* - * Copy over the elements before "first". - */ - - if (first > 0) { - memcpy((VOID *) newPtrs, (VOID *) elemPtrs, - (size_t) (first * sizeof(Tcl_Obj *))); - } - - /* - * "Delete" count elements starting at first. - */ - - for (i = 0, j = first; i < count; i++, j++) { - victimPtr = elemPtrs[j]; - TclDecrRefCount(victimPtr); - } - - /* - * Copy the elements after the last one removed, shifted to - * their new locations. - */ - - start = (first + count); - numAfterLast = (numElems - start); - if (numAfterLast > 0) { - memcpy((VOID *) &(newPtrs[first + objc]), - (VOID *) &(elemPtrs[start]), - (size_t) (numAfterLast * sizeof(Tcl_Obj *))); - } - - /* - * Insert the new elements before "first" and update the - * count of elements. - */ - - for (i = 0, j = first; i < objc; i++, j++) { - newPtrs[j] = objv[i]; - Tcl_IncrRefCount(objv[i]); - } - - listRepPtr->elemCount = numRequired; - listRepPtr->maxElemCount = newMax; - listRepPtr->elements = newPtrs; - ckfree((char *) elemPtrs); - } - - /* - * Invalidate and free any old string representation since it no longer - * reflects the list's internal representation. - */ - - Tcl_InvalidateStringRep(listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * FreeListInternalRep -- - * - * Deallocate the storage associated with a list object's internal - * representation. - * - * Results: - * None. - * - * Side effects: - * Frees listPtr's List* internal representation and sets listPtr's - * internalRep.otherValuePtr to NULL. Decrements the ref counts - * of all element objects, which may free them. - * - *---------------------------------------------------------------------- - */ - -static void -FreeListInternalRep(listPtr) - Tcl_Obj *listPtr; /* List object with internal rep to free. */ -{ - register List *listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - register Tcl_Obj **elemPtrs = listRepPtr->elements; - register Tcl_Obj *objPtr; - int numElems = listRepPtr->elemCount; - int i; - - for (i = 0; i < numElems; i++) { - objPtr = elemPtrs[i]; - Tcl_DecrRefCount(objPtr); - } - ckfree((char *) elemPtrs); - ckfree((char *) listRepPtr); -} - -/* - *---------------------------------------------------------------------- - * - * DupListInternalRep -- - * - * Initialize the internal representation of a list Tcl_Obj to a - * copy of the internal representation of an existing list object. - * - * Results: - * None. - * - * Side effects: - * "srcPtr"s list internal rep pointer should not be NULL and we assume - * it is not NULL. We set "copyPtr"s internal rep to a pointer to a - * newly allocated List structure that, in turn, points to "srcPtr"s - * element objects. Those element objects are not actually copied but - * are shared between "srcPtr" and "copyPtr". The ref count of each - * element object is incremented. - * - *---------------------------------------------------------------------- - */ - -static void -DupListInternalRep(srcPtr, copyPtr) - Tcl_Obj *srcPtr; /* Object with internal rep to copy. */ - Tcl_Obj *copyPtr; /* Object with internal rep to set. */ -{ - List *srcListRepPtr = (List *) srcPtr->internalRep.otherValuePtr; - int numElems = srcListRepPtr->elemCount; - int maxElems = srcListRepPtr->maxElemCount; - register Tcl_Obj **srcElemPtrs = srcListRepPtr->elements; - register Tcl_Obj **copyElemPtrs; - register List *copyListRepPtr; - int i; - - /* - * Allocate a new List structure that points to "srcPtr"s element - * objects. Increment the ref counts for those (now shared) element - * objects. - */ - - copyElemPtrs = (Tcl_Obj **) - ckalloc((unsigned) maxElems * sizeof(Tcl_Obj *)); - for (i = 0; i < numElems; i++) { - copyElemPtrs[i] = srcElemPtrs[i]; - Tcl_IncrRefCount(copyElemPtrs[i]); - } - - copyListRepPtr = (List *) ckalloc(sizeof(List)); - copyListRepPtr->maxElemCount = maxElems; - copyListRepPtr->elemCount = numElems; - copyListRepPtr->elements = copyElemPtrs; - - copyPtr->internalRep.otherValuePtr = (VOID *) copyListRepPtr; - copyPtr->typePtr = &tclListType; -} - -/* - *---------------------------------------------------------------------- - * - * SetListFromAny -- - * - * Attempt to generate a list internal form for the Tcl object - * "objPtr". - * - * Results: - * The return value is TCL_OK or TCL_ERROR. If an error occurs during - * conversion, an error message is left in the interpreter's result - * unless "interp" is NULL. - * - * Side effects: - * If no error occurs, a list is stored as "objPtr"s internal - * representation. - * - *---------------------------------------------------------------------- - */ - -static int -SetListFromAny(interp, objPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr; /* The object to convert. */ -{ - Tcl_ObjType *oldTypePtr = objPtr->typePtr; - char *string, *s; - CONST char *elemStart, *nextElem; - int lenRemain, length, estCount, elemSize, hasBrace, i, j, result; - char *limit; /* Points just after string's last byte. */ - register CONST char *p; - register Tcl_Obj **elemPtrs; - register Tcl_Obj *elemPtr; - List *listRepPtr; - - /* - * Get the string representation. Make it up-to-date if necessary. - */ - - string = Tcl_GetStringFromObj(objPtr, &length); - - /* - * Parse the string into separate string objects, and create a List - * structure that points to the element string objects. We use a - * modified version of Tcl_SplitList's implementation to avoid one - * malloc and a string copy for each list element. First, estimate the - * number of elements by counting the number of space characters in the - * list. - */ - - limit = (string + length); - estCount = 1; - for (p = string; p < limit; p++) { - if (isspace(UCHAR(*p))) { /* INTL: ISO space. */ - estCount++; - } - } - - /* - * Allocate a new List structure with enough room for "estCount" - * elements. Each element is a pointer to a Tcl_Obj with the appropriate - * string rep. The initial "estCount" elements are set using the - * corresponding "argv" strings. - */ - - elemPtrs = (Tcl_Obj **) - ckalloc((unsigned) (estCount * sizeof(Tcl_Obj *))); - for (p = string, lenRemain = length, i = 0; - lenRemain > 0; - p = nextElem, lenRemain = (limit - nextElem), i++) { - result = TclFindElement(interp, p, lenRemain, &elemStart, &nextElem, - &elemSize, &hasBrace); - if (result != TCL_OK) { - for (j = 0; j < i; j++) { - elemPtr = elemPtrs[j]; - Tcl_DecrRefCount(elemPtr); - } - ckfree((char *) elemPtrs); - return result; - } - if (elemStart >= limit) { - break; - } - if (i > estCount) { - panic("SetListFromAny: bad size estimate for list"); - } - - /* - * Allocate a Tcl object for the element and initialize it from the - * "elemSize" bytes starting at "elemStart". - */ - - s = ckalloc((unsigned) elemSize + 1); - if (hasBrace) { - memcpy((VOID *) s, (VOID *) elemStart, (size_t) elemSize); - s[elemSize] = 0; - } else { - elemSize = TclCopyAndCollapse(elemSize, elemStart, s); - } - - TclNewObj(elemPtr); - elemPtr->bytes = s; - elemPtr->length = elemSize; - elemPtrs[i] = elemPtr; - Tcl_IncrRefCount(elemPtr); /* since list now holds ref to it */ - } - - listRepPtr = (List *) ckalloc(sizeof(List)); - listRepPtr->maxElemCount = estCount; - listRepPtr->elemCount = i; - listRepPtr->elements = elemPtrs; - - /* - * Free the old internalRep before setting the new one. We do this as - * late as possible to allow the conversion code, in particular - * Tcl_GetStringFromObj, to use that old internalRep. - */ - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.otherValuePtr = (VOID *) listRepPtr; - objPtr->typePtr = &tclListType; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateStringOfList -- - * - * Update the string representation for a list object. - * Note: This procedure does not invalidate 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 list-to-string conversion. This string will be empty if the - * list has no elements. The list internal representation - * should not be NULL and we assume it is not NULL. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateStringOfList(listPtr) - Tcl_Obj *listPtr; /* List object with string rep to update. */ -{ -# define LOCAL_SIZE 20 - int localFlags[LOCAL_SIZE], *flagPtr; - List *listRepPtr = (List *) listPtr->internalRep.otherValuePtr; - int numElems = listRepPtr->elemCount; - register int i; - char *elem, *dst; - int length; - - /* - * Convert each element of the list to string form and then convert it - * to proper list element form, adding it to the result buffer. - */ - - /* - * Pass 1: estimate space, gather flags. - */ - - if (numElems <= LOCAL_SIZE) { - flagPtr = localFlags; - } else { - flagPtr = (int *) ckalloc((unsigned) numElems*sizeof(int)); - } - listPtr->length = 1; - for (i = 0; i < numElems; i++) { - elem = Tcl_GetStringFromObj(listRepPtr->elements[i], &length); - listPtr->length += Tcl_ScanCountedElement(elem, length, - &flagPtr[i]) + 1; - } - - /* - * Pass 2: copy into string rep buffer. - */ - - listPtr->bytes = ckalloc((unsigned) listPtr->length); - dst = listPtr->bytes; - for (i = 0; i < numElems; i++) { - elem = Tcl_GetStringFromObj(listRepPtr->elements[i], &length); - dst += Tcl_ConvertCountedElement(elem, length, dst, flagPtr[i]); - *dst = ' '; - dst++; - } - if (flagPtr != localFlags) { - ckfree((char *) flagPtr); - } - if (dst == listPtr->bytes) { - *dst = 0; - } else { - dst--; - *dst = 0; - } - listPtr->length = dst - listPtr->bytes; -} diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c deleted file mode 100644 index eb199bb..0000000 --- a/generic/tclLiteral.c +++ /dev/null @@ -1,929 +0,0 @@ -/* - * tclLiteral.c -- - * - * Implementation of the global and ByteCode-local literal tables - * used to manage the Tcl objects created for literal values during - * compilation of Tcl scripts. This implementation borrows heavily - * from the more general hashtable implementation of Tcl hash tables - * that appears in tclHash.c. - * - * Copyright (c) 1997-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. - * - * RCS: @(#) $Id: tclLiteral.c,v 1.2 1999/04/16 00:46:50 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclCompile.h" - -/* - * When there are this many entries per bucket, on average, rebuild - * a literal's hash table to make it larger. - */ - -#define REBUILD_MULTIPLIER 3 - -/* - * Procedure prototypes for static procedures in this file: - */ - -static int AddLocalLiteralEntry _ANSI_ARGS_(( - CompileEnv *envPtr, LiteralEntry *globalPtr, - int localHash)); -static void ExpandLocalLiteralArray _ANSI_ARGS_(( - CompileEnv *envPtr)); -static unsigned int HashString _ANSI_ARGS_((CONST char *bytes, - int length)); -static void RebuildLiteralTable _ANSI_ARGS_(( - LiteralTable *tablePtr)); - -/* - *---------------------------------------------------------------------- - * - * TclInitLiteralTable -- - * - * This procedure is called to initialize the fields of a literal table - * structure for either an interpreter or a compilation's CompileEnv - * structure. - * - * Results: - * None. - * - * Side effects: - * The literal table is made ready for use. - * - *---------------------------------------------------------------------- - */ - -void -TclInitLiteralTable(tablePtr) - register LiteralTable *tablePtr; /* Pointer to table structure, which - * is supplied by the caller. */ -{ -#if (TCL_SMALL_HASH_TABLE != 4) - panic("TclInitLiteralTable: TCL_SMALL_HASH_TABLE is %d, not 4\n", - TCL_SMALL_HASH_TABLE); -#endif - - tablePtr->buckets = tablePtr->staticBuckets; - tablePtr->staticBuckets[0] = tablePtr->staticBuckets[1] = 0; - tablePtr->staticBuckets[2] = tablePtr->staticBuckets[3] = 0; - tablePtr->numBuckets = TCL_SMALL_HASH_TABLE; - tablePtr->numEntries = 0; - tablePtr->rebuildSize = TCL_SMALL_HASH_TABLE*REBUILD_MULTIPLIER; - tablePtr->mask = 3; -} - -/* - *---------------------------------------------------------------------- - * - * TclDeleteLiteralTable -- - * - * This procedure frees up everything associated with a literal table - * except for the table's structure itself. - * - * Results: - * None. - * - * Side effects: - * Each literal in the table is released: i.e., its reference count - * in the global literal table is decremented and, if it becomes zero, - * the literal is freed. In addition, the table's bucket array is - * freed. - * - *---------------------------------------------------------------------- - */ - -void -TclDeleteLiteralTable(interp, tablePtr) - Tcl_Interp *interp; /* Interpreter containing shared literals - * referenced by the table to delete. */ - LiteralTable *tablePtr; /* Points to the literal table to delete. */ -{ - LiteralEntry *entryPtr; - int i, start; - - /* - * Release remaining literals in the table. Note that releasing a - * literal might release other literals, modifying the table, so we - * restart the search from the bucket chain we last found an entry. - */ - -#ifdef TCL_COMPILE_DEBUG - TclVerifyGlobalLiteralTable((Interp *) interp); -#endif /*TCL_COMPILE_DEBUG*/ - - start = 0; - while (tablePtr->numEntries > 0) { - for (i = start; i < tablePtr->numBuckets; i++) { - entryPtr = tablePtr->buckets[i]; - if (entryPtr != NULL) { - TclReleaseLiteral(interp, entryPtr->objPtr); - start = i; - break; - } - } - } - - /* - * Free up the table's bucket array if it was dynamically allocated. - */ - - if (tablePtr->buckets != tablePtr->staticBuckets) { - ckfree((char *) tablePtr->buckets); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclRegisterLiteral -- - * - * Find, or if necessary create, an object in a CompileEnv literal - * array that has a string representation matching the argument string. - * - * Results: - * The index in the CompileEnv's literal array that references a - * shared literal matching the string. The object is created if - * necessary. - * - * Side effects: - * To maximize sharing, we look up the string in the interpreter's - * global literal table. If not found, we create a new shared literal - * in the global table. We then add a reference to the shared - * literal in the CompileEnv's literal array. - * - * If onHeap is 1, this procedure is given ownership of the string: if - * an object is created then its string representation is set directly - * from string, otherwise the string is freed. Typically, a caller sets - * onHeap 1 if "string" is an already heap-allocated buffer holding the - * result of backslash substitutions. - * - *---------------------------------------------------------------------- - */ - -int -TclRegisterLiteral(envPtr, bytes, length, onHeap) - CompileEnv *envPtr; /* Points to the CompileEnv in whose object - * array an object is found or created. */ - register char *bytes; /* Points to string for which to find or - * create an object in CompileEnv's object - * array. */ - int length; /* Number of bytes in the string. If < 0, - * the string consists of all bytes up to - * the first null character. */ - int onHeap; /* If 1 then the caller already malloc'd - * bytes and ownership is passed to this - * procedure. */ -{ - Interp *iPtr = envPtr->iPtr; - LiteralTable *globalTablePtr = &(iPtr->literalTable); - LiteralTable *localTablePtr = &(envPtr->localLitTable); - register LiteralEntry *globalPtr, *localPtr; - register Tcl_Obj *objPtr; - unsigned int hash; - int localHash, globalHash, objIndex; - long n; - char buf[TCL_INTEGER_SPACE]; - - if (length < 0) { - length = (bytes? strlen(bytes) : 0); - } - hash = HashString(bytes, length); - - /* - * Is the literal already in the CompileEnv's local literal array? - * If so, just return its index. - */ - - localHash = (hash & localTablePtr->mask); - for (localPtr = localTablePtr->buckets[localHash]; - localPtr != NULL; localPtr = localPtr->nextPtr) { - objPtr = localPtr->objPtr; - if ((objPtr->length == length) && ((length == 0) - || ((objPtr->bytes[0] == bytes[0]) - && (memcmp(objPtr->bytes, bytes, (unsigned) length) - == 0)))) { - if (onHeap) { - ckfree(bytes); - } - objIndex = (localPtr - envPtr->literalArrayPtr); -#ifdef TCL_COMPILE_DEBUG - TclVerifyLocalLiteralTable(envPtr); -#endif /*TCL_COMPILE_DEBUG*/ - return objIndex; - } - } - - /* - * The literal is new to this CompileEnv. Is it in the interpreter's - * global literal table? - */ - - globalHash = (hash & globalTablePtr->mask); - for (globalPtr = globalTablePtr->buckets[globalHash]; - globalPtr != NULL; globalPtr = globalPtr->nextPtr) { - objPtr = globalPtr->objPtr; - if ((objPtr->length == length) && ((length == 0) - || ((objPtr->bytes[0] == bytes[0]) - && (memcmp(objPtr->bytes, bytes, (unsigned) length) - == 0)))) { - /* - * A global literal was found. Add an entry to the CompileEnv's - * local literal array. - */ - - if (onHeap) { - ckfree(bytes); - } - objIndex = AddLocalLiteralEntry(envPtr, globalPtr, localHash); -#ifdef TCL_COMPILE_DEBUG - if (globalPtr->refCount < 1) { - panic("TclRegisterLiteral: global literal \"%.*s\" had bad refCount %d", - (length>60? 60 : length), bytes, - globalPtr->refCount); - } - TclVerifyLocalLiteralTable(envPtr); -#endif /*TCL_COMPILE_DEBUG*/ - return objIndex; - } - } - - /* - * The literal is new to the interpreter. Add it to the global literal - * table then add an entry to the CompileEnv's local literal array. - * Convert the object to an integer object if possible. - */ - - TclNewObj(objPtr); - Tcl_IncrRefCount(objPtr); - if (onHeap) { - objPtr->bytes = bytes; - objPtr->length = length; - } else { - TclInitStringRep(objPtr, bytes, length); - } - if (TclLooksLikeInt(bytes, length)) { - if (TclGetLong((Tcl_Interp *) NULL, bytes, &n) == TCL_OK) { - TclFormatInt(buf, n); - if (strcmp(bytes, buf) == 0) { - objPtr->internalRep.longValue = n; - objPtr->typePtr = &tclIntType; - } - } - } - -#ifdef TCL_COMPILE_DEBUG - if (TclLookupLiteralEntry((Tcl_Interp *) iPtr, objPtr) != NULL) { - panic("TclRegisterLiteral: literal \"%.*s\" found globally but shouldn't be", - (length>60? 60 : length), bytes); - } -#endif - - globalPtr = (LiteralEntry *) ckalloc((unsigned) sizeof(LiteralEntry)); - globalPtr->objPtr = objPtr; - globalPtr->refCount = 0; - globalPtr->nextPtr = globalTablePtr->buckets[globalHash]; - globalTablePtr->buckets[globalHash] = globalPtr; - globalTablePtr->numEntries++; - - /* - * If the global literal table has exceeded a decent size, rebuild it - * with more buckets. - */ - - if (globalTablePtr->numEntries >= globalTablePtr->rebuildSize) { - RebuildLiteralTable(globalTablePtr); - } - - objIndex = AddLocalLiteralEntry(envPtr, globalPtr, localHash); - -#ifdef TCL_COMPILE_DEBUG - TclVerifyGlobalLiteralTable(iPtr); - TclVerifyLocalLiteralTable(envPtr); - { - LiteralEntry *entryPtr; - int found, i; - found = 0; - for (i = 0; i < globalTablePtr->numBuckets; i++) { - for (entryPtr = globalTablePtr->buckets[i]; - entryPtr != NULL; entryPtr = entryPtr->nextPtr) { - if ((entryPtr == globalPtr) - && (entryPtr->objPtr == objPtr)) { - found = 1; - } - } - } - if (!found) { - panic("TclRegisterLiteral: literal \"%.*s\" wasn't global", - (length>60? 60 : length), bytes); - } - } -#endif /*TCL_COMPILE_DEBUG*/ -#ifdef TCL_COMPILE_STATS - iPtr->stats.numLiteralsCreated++; - iPtr->stats.totalLitStringBytes += (double) (length + 1); - iPtr->stats.currentLitStringBytes += (double) (length + 1); - iPtr->stats.literalCount[TclLog2(length)]++; -#endif /*TCL_COMPILE_STATS*/ - return objIndex; -} - -/* - *---------------------------------------------------------------------- - * - * TclLookupLiteralEntry -- - * - * Finds the LiteralEntry that corresponds to a literal Tcl object - * holding a literal. - * - * Results: - * Returns the matching LiteralEntry if found, otherwise NULL. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -LiteralEntry * -TclLookupLiteralEntry(interp, objPtr) - Tcl_Interp *interp; /* Interpreter for which objPtr was created - * to hold a literal. */ - register Tcl_Obj *objPtr; /* Points to a Tcl object holding a - * literal that was previously created by a - * call to TclRegisterLiteral. */ -{ - Interp *iPtr = (Interp *) interp; - LiteralTable *globalTablePtr = &(iPtr->literalTable); - register LiteralEntry *entryPtr; - char *bytes; - int length, globalHash; - - bytes = Tcl_GetStringFromObj(objPtr, &length); - globalHash = (HashString(bytes, length) & globalTablePtr->mask); - for (entryPtr = globalTablePtr->buckets[globalHash]; - entryPtr != NULL; entryPtr = entryPtr->nextPtr) { - if (entryPtr->objPtr == objPtr) { - return entryPtr; - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * AddLocalLiteralEntry -- - * - * Insert a new literal into a CompileEnv's local literal array. - * - * Results: - * The index in the CompileEnv's literal array that references the - * literal. - * - * Side effects: - * Increments the ref count of the global LiteralEntry since the - * CompileEnv now refers to the literal. Expands the literal array - * if necessary. May rebuild the hash bucket array of the CompileEnv's - * literal array if it becomes too large. - * - *---------------------------------------------------------------------- - */ - -static int -AddLocalLiteralEntry(envPtr, globalPtr, localHash) - register CompileEnv *envPtr; /* Points to CompileEnv in whose literal - * array the object is to be inserted. */ - LiteralEntry *globalPtr; /* Points to the global LiteralEntry for - * the literal to add to the CompileEnv. */ - int localHash; /* Hash value for the literal's string. */ -{ - register LiteralTable *localTablePtr = &(envPtr->localLitTable); - register LiteralEntry *localPtr; - int objIndex; - - if (envPtr->literalArrayNext >= envPtr->literalArrayEnd) { - ExpandLocalLiteralArray(envPtr); - } - objIndex = envPtr->literalArrayNext; - envPtr->literalArrayNext++; - - localPtr = &(envPtr->literalArrayPtr[objIndex]); - localPtr->objPtr = globalPtr->objPtr; - localPtr->refCount = -1; /* i.e., unused */ - localPtr->nextPtr = localTablePtr->buckets[localHash]; - localTablePtr->buckets[localHash] = localPtr; - localTablePtr->numEntries++; - - globalPtr->refCount++; - - /* - * If the CompileEnv's local literal table has exceeded a decent size, - * rebuild it with more buckets. - */ - - if (localTablePtr->numEntries >= localTablePtr->rebuildSize) { - RebuildLiteralTable(localTablePtr); - } - -#ifdef TCL_COMPILE_DEBUG - TclVerifyLocalLiteralTable(envPtr); - { - char *bytes; - int length, found, i; - found = 0; - for (i = 0; i < localTablePtr->numBuckets; i++) { - for (localPtr = localTablePtr->buckets[i]; - localPtr != NULL; localPtr = localPtr->nextPtr) { - if (localPtr->objPtr == globalPtr->objPtr) { - found = 1; - } - } - } - if (!found) { - bytes = Tcl_GetStringFromObj(globalPtr->objPtr, &length); - panic("AddLocalLiteralEntry: literal \"%.*s\" wasn't found locally", - (length>60? 60 : length), bytes); - } - } -#endif /*TCL_COMPILE_DEBUG*/ - return objIndex; -} - -/* - *---------------------------------------------------------------------- - * - * ExpandLocalLiteralArray -- - * - * Procedure that uses malloc to allocate more storage for a - * CompileEnv's local literal array. - * - * Results: - * None. - * - * Side effects: - * The literal array in *envPtr is reallocated to a new array of - * double the size, and if envPtr->mallocedLiteralArray is non-zero - * the old array is freed. Entries are copied from the old array - * to the new one. The local literal table is updated to refer to - * the new entries. - * - *---------------------------------------------------------------------- - */ - -static void -ExpandLocalLiteralArray(envPtr) - register CompileEnv *envPtr; /* Points to the CompileEnv whose object - * array must be enlarged. */ -{ - /* - * The current allocated local literal entries are stored between - * elements 0 and (envPtr->literalArrayNext - 1) [inclusive]. - */ - - LiteralTable *localTablePtr = &(envPtr->localLitTable); - int currElems = envPtr->literalArrayNext; - size_t currBytes = (currElems * sizeof(LiteralEntry)); - register LiteralEntry *currArrayPtr = envPtr->literalArrayPtr; - register LiteralEntry *newArrayPtr = - (LiteralEntry *) ckalloc((unsigned) (2 * currBytes)); - int i; - - /* - * Copy from the old literal array to the new, then update the local - * literal table's bucket array. - */ - - memcpy((VOID *) newArrayPtr, (VOID *) currArrayPtr, currBytes); - for (i = 0; i < currElems; i++) { - if (currArrayPtr[i].nextPtr == NULL) { - newArrayPtr[i].nextPtr = NULL; - } else { - newArrayPtr[i].nextPtr = newArrayPtr - + (currArrayPtr[i].nextPtr - currArrayPtr); - } - } - for (i = 0; i < localTablePtr->numBuckets; i++) { - if (localTablePtr->buckets[i] != NULL) { - localTablePtr->buckets[i] = newArrayPtr - + (localTablePtr->buckets[i] - currArrayPtr); - } - } - - /* - * Free the old literal array if needed, and mark the new literal - * array as malloced. - */ - - if (envPtr->mallocedLiteralArray) { - ckfree((char *) currArrayPtr); - } - envPtr->literalArrayPtr = newArrayPtr; - envPtr->literalArrayEnd = (2 * currElems); - envPtr->mallocedLiteralArray = 1; -} - -/* - *---------------------------------------------------------------------- - * - * TclReleaseLiteral -- - * - * This procedure releases a reference to one of the shared Tcl objects - * that hold literals. It is called to release the literals referenced - * by a ByteCode that is being destroyed, and it is also called by - * TclDeleteLiteralTable. - * - * Results: - * None. - * - * Side effects: - * The reference count for the global LiteralTable entry that - * corresponds to the literal is decremented. If no other reference - * to a global literal object remains, it is freed. - * - *---------------------------------------------------------------------- - */ - -void -TclReleaseLiteral(interp, objPtr) - Tcl_Interp *interp; /* Interpreter for which objPtr was created - * to hold a literal. */ - register Tcl_Obj *objPtr; /* Points to a literal object that was - * previously created by a call to - * TclRegisterLiteral. */ -{ - Interp *iPtr = (Interp *) interp; - LiteralTable *globalTablePtr = &(iPtr->literalTable); - register LiteralEntry *entryPtr, *prevPtr; - ByteCode* codePtr; - char *bytes; - int length, index; - - bytes = Tcl_GetStringFromObj(objPtr, &length); - index = (HashString(bytes, length) & globalTablePtr->mask); - for (prevPtr = NULL, entryPtr = globalTablePtr->buckets[index]; - entryPtr != NULL; - prevPtr = entryPtr, entryPtr = entryPtr->nextPtr) { - if (entryPtr->objPtr == objPtr) { - entryPtr->refCount--; - - /* - * We found the matching LiteralEntry. Check if it's only being - * kept alive only by a circular reference from a ByteCode - * stored as its internal rep. - */ - - if ((entryPtr->refCount == 1) - && (objPtr->typePtr == &tclByteCodeType)) { - codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; - if ((codePtr->numLitObjects == 1) - && (codePtr->objArrayPtr[0] == objPtr)) { - entryPtr->refCount = 0; - - /* - * Set the ByteCode object array entry NULL to signal - * to TclCleanupByteCode to not try to release this - * about to be freed literal again. - */ - - codePtr->objArrayPtr[0] = NULL; - } - } - - /* - * If the literal is no longer being used by any ByteCode, - * delete the entry then decrement the ref count of its object. - */ - - if (entryPtr->refCount == 0) { - if (prevPtr == NULL) { - globalTablePtr->buckets[index] = entryPtr->nextPtr; - } else { - prevPtr->nextPtr = entryPtr->nextPtr; - } -#ifdef TCL_COMPILE_STATS - iPtr->stats.currentLitStringBytes -= (double) (length + 1); -#endif /*TCL_COMPILE_STATS*/ - ckfree((char *) entryPtr); - globalTablePtr->numEntries--; - TclDecrRefCount(objPtr); - } - return; - } - } -#ifdef TCL_COMPILE_DEBUG - panic("TclReleaseLiteral: literal \"%.*s\" not found", - (length>60? 60 : length), bytes); -#endif /*TCL_COMPILE_DEBUG*/ -} - -/* - *---------------------------------------------------------------------- - * - * HashString -- - * - * Compute a one-word summary of a text string, which can be - * used to generate a hash index. - * - * Results: - * The return value is a one-word summary of the information in - * string. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static unsigned int -HashString(bytes, length) - register CONST char *bytes; /* String for which to compute hash - * value. */ - int length; /* Number of bytes in the string. */ -{ - register unsigned int result; - register int i; - - /* - * I tried a zillion different hash functions and asked many other - * people for advice. Many people had their own favorite functions, - * all different, but no-one had much idea why they were good ones. - * I chose the one below (multiply by 9 and add new character) - * because of the following reasons: - * - * 1. Multiplying by 10 is perfect for keys that are decimal strings, - * and multiplying by 9 is just about as good. - * 2. Times-9 is (shift-left-3) plus (old). This means that each - * character's bits hang around in the low-order bits of the - * hash value for ever, plus they spread fairly rapidly up to - * the high-order bits to fill out the hash value. This seems - * works well both for decimal and non-decimal strings. - */ - - result = 0; - for (i = 0; i < length; i++) { - result += (result<<3) + *bytes++; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * RebuildLiteralTable -- - * - * This procedure is invoked when the ratio of entries to hash buckets - * becomes too large in a local or global literal table. It allocates - * a larger bucket array and moves the entries into the new buckets. - * - * Results: - * None. - * - * Side effects: - * Memory gets reallocated and entries get rehashed into new buckets. - * - *---------------------------------------------------------------------- - */ - -static void -RebuildLiteralTable(tablePtr) - register LiteralTable *tablePtr; /* Local or global table to enlarge. */ -{ - LiteralEntry **oldBuckets; - register LiteralEntry **oldChainPtr, **newChainPtr; - register LiteralEntry *entryPtr; - LiteralEntry **bucketPtr; - char *bytes; - int oldSize, count, index, length; - - oldSize = tablePtr->numBuckets; - oldBuckets = tablePtr->buckets; - - /* - * Allocate and initialize the new bucket array, and set up - * hashing constants for new array size. - */ - - tablePtr->numBuckets *= 4; - tablePtr->buckets = (LiteralEntry **) ckalloc((unsigned) - (tablePtr->numBuckets * sizeof(LiteralEntry *))); - for (count = tablePtr->numBuckets, newChainPtr = tablePtr->buckets; - count > 0; - count--, newChainPtr++) { - *newChainPtr = NULL; - } - tablePtr->rebuildSize *= 4; - tablePtr->mask = (tablePtr->mask << 2) + 3; - - /* - * Rehash all of the existing entries into the new bucket array. - */ - - for (oldChainPtr = oldBuckets; - oldSize > 0; - oldSize--, oldChainPtr++) { - for (entryPtr = *oldChainPtr; entryPtr != NULL; - entryPtr = *oldChainPtr) { - bytes = Tcl_GetStringFromObj(entryPtr->objPtr, &length); - index = (HashString(bytes, length) & tablePtr->mask); - - *oldChainPtr = entryPtr->nextPtr; - bucketPtr = &(tablePtr->buckets[index]); - entryPtr->nextPtr = *bucketPtr; - *bucketPtr = entryPtr; - } - } - - /* - * Free up the old bucket array, if it was dynamically allocated. - */ - - if (oldBuckets != tablePtr->staticBuckets) { - ckfree((char *) oldBuckets); - } -} - -#ifdef TCL_COMPILE_STATS -/* - *---------------------------------------------------------------------- - * - * TclLiteralStats -- - * - * Return statistics describing the layout of the hash table - * in its hash buckets. - * - * Results: - * The return value is a malloc-ed string containing information - * about tablePtr. It is the caller's responsibility to free - * this string. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -TclLiteralStats(tablePtr) - LiteralTable *tablePtr; /* Table for which to produce stats. */ -{ -#define NUM_COUNTERS 10 - int count[NUM_COUNTERS], overflow, i, j; - double average, tmp; - register LiteralEntry *entryPtr; - char *result, *p; - - /* - * Compute a histogram of bucket usage. For each bucket chain i, - * j is the number of entries in the chain. - */ - - for (i = 0; i < NUM_COUNTERS; i++) { - count[i] = 0; - } - overflow = 0; - average = 0.0; - for (i = 0; i < tablePtr->numBuckets; i++) { - j = 0; - for (entryPtr = tablePtr->buckets[i]; entryPtr != NULL; - entryPtr = entryPtr->nextPtr) { - j++; - } - if (j < NUM_COUNTERS) { - count[j]++; - } else { - overflow++; - } - tmp = j; - average += (tmp+1.0)*(tmp/tablePtr->numEntries)/2.0; - } - - /* - * Print out the histogram and a few other pieces of information. - */ - - result = (char *) ckalloc((unsigned) ((NUM_COUNTERS*60) + 300)); - sprintf(result, "%d entries in table, %d buckets\n", - tablePtr->numEntries, tablePtr->numBuckets); - p = result + strlen(result); - for (i = 0; i < NUM_COUNTERS; i++) { - sprintf(p, "number of buckets with %d entries: %d\n", - i, count[i]); - p += strlen(p); - } - sprintf(p, "number of buckets with %d or more entries: %d\n", - NUM_COUNTERS, overflow); - p += strlen(p); - sprintf(p, "average search distance for entry: %.1f", average); - return result; -} -#endif /*TCL_COMPILE_STATS*/ - -#ifdef TCL_COMPILE_DEBUG -/* - *---------------------------------------------------------------------- - * - * TclVerifyLocalLiteralTable -- - * - * Check a CompileEnv's local literal table for consistency. - * - * Results: - * None. - * - * Side effects: - * Panics if problems are found. - * - *---------------------------------------------------------------------- - */ - -void -TclVerifyLocalLiteralTable(envPtr) - CompileEnv *envPtr; /* Points to CompileEnv whose literal - * table is to be validated. */ -{ - register LiteralTable *localTablePtr = &(envPtr->localLitTable); - register LiteralEntry *localPtr; - char *bytes; - register int i; - int length, count; - - count = 0; - for (i = 0; i < localTablePtr->numBuckets; i++) { - for (localPtr = localTablePtr->buckets[i]; - localPtr != NULL; localPtr = localPtr->nextPtr) { - count++; - if (localPtr->refCount != -1) { - bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length); - panic("TclVerifyLocalLiteralTable: local literal \"%.*s\" had bad refCount %d", - (length>60? 60 : length), bytes, - localPtr->refCount); - } - if (TclLookupLiteralEntry((Tcl_Interp *) envPtr->iPtr, - localPtr->objPtr) == NULL) { - bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length); - panic("TclVerifyLocalLiteralTable: local literal \"%.*s\" is not global", - (length>60? 60 : length), bytes); - } - if (localPtr->objPtr->bytes == NULL) { - panic("TclVerifyLocalLiteralTable: literal has NULL string rep"); - } - } - } - if (count != localTablePtr->numEntries) { - panic("TclVerifyLocalLiteralTable: local literal table had %d entries, should be %d", - count, localTablePtr->numEntries); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclVerifyGlobalLiteralTable -- - * - * Check an interpreter's global literal table literal for consistency. - * - * Results: - * None. - * - * Side effects: - * Panics if problems are found. - * - *---------------------------------------------------------------------- - */ - -void -TclVerifyGlobalLiteralTable(iPtr) - Interp *iPtr; /* Points to interpreter whose global - * literal table is to be validated. */ -{ - register LiteralTable *globalTablePtr = &(iPtr->literalTable); - register LiteralEntry *globalPtr; - char *bytes; - register int i; - int length, count; - - count = 0; - for (i = 0; i < globalTablePtr->numBuckets; i++) { - for (globalPtr = globalTablePtr->buckets[i]; - globalPtr != NULL; globalPtr = globalPtr->nextPtr) { - count++; - if (globalPtr->refCount < 1) { - bytes = Tcl_GetStringFromObj(globalPtr->objPtr, &length); - panic("TclVerifyGlobalLiteralTable: global literal \"%.*s\" had bad refCount %d", - (length>60? 60 : length), bytes, - globalPtr->refCount); - } - if (globalPtr->objPtr->bytes == NULL) { - panic("TclVerifyGlobalLiteralTable: literal has NULL string rep"); - } - } - } - if (count != globalTablePtr->numEntries) { - panic("TclVerifyGlobalLiteralTable: global literal table had %d entries, should be %d", - count, globalTablePtr->numEntries); - } -} -#endif /*TCL_COMPILE_DEBUG*/ diff --git a/generic/tclLoad.c b/generic/tclLoad.c deleted file mode 100644 index 68a0f8c..0000000 --- a/generic/tclLoad.c +++ /dev/null @@ -1,655 +0,0 @@ -/* - * tclLoad.c -- - * - * This file provides the generic portion (those that are the same - * on all platforms) of Tcl's dynamic loading facilities. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclLoad.c,v 1.3 1999/04/16 00:46:50 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * The following structure describes a package that has been loaded - * either dynamically (with the "load" command) or statically (as - * indicated by a call to TclGetLoadedPackages). All such packages - * are linked together into a single list for the process. Packages - * are never unloaded, so these structures are never freed. - */ - -typedef struct LoadedPackage { - char *fileName; /* Name of the file from which the - * package was loaded. An empty string - * means the package is loaded statically. - * Malloc-ed. */ - char *packageName; /* Name of package prefix for the package, - * properly capitalized (first letter UC, - * others LC), no "_", as in "Net". - * Malloc-ed. */ - ClientData clientData; /* Token for the loaded file which should be - * passed to TclpUnloadFile() when the file - * is no longer needed. If fileName is NULL, - * then this field is irrelevant. */ - Tcl_PackageInitProc *initProc; - /* Initialization procedure to call to - * incorporate this package into a trusted - * interpreter. */ - Tcl_PackageInitProc *safeInitProc; - /* Initialization procedure to call to - * incorporate this package into a safe - * interpreter (one that will execute - * untrusted scripts). NULL means the - * package can't be used in unsafe - * interpreters. */ - struct LoadedPackage *nextPtr; - /* Next in list of all packages loaded into - * this application process. NULL means - * end of list. */ -} LoadedPackage; - -/* - * TCL_THREADS - * There is a global list of packages that is anchored at firstPackagePtr. - * Access to this list is governed by a mutex. - */ - -static LoadedPackage *firstPackagePtr = NULL; - /* First in list of all packages loaded into - * this process. */ - -TCL_DECLARE_MUTEX(packageMutex) - -/* - * The following structure represents a particular package that has - * been incorporated into a particular interpreter (by calling its - * initialization procedure). There is a list of these structures for - * each interpreter, with an AssocData value (key "load") for the - * interpreter that points to the first package (if any). - */ - -typedef struct InterpPackage { - LoadedPackage *pkgPtr; /* Points to detailed information about - * package. */ - struct InterpPackage *nextPtr; - /* Next package in this interpreter, or - * NULL for end of list. */ -} InterpPackage; - -/* - * Prototypes for procedures that are private to this file: - */ - -static void LoadCleanupProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_LoadObjCmd -- - * - * This procedure is invoked to process the "load" 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_LoadObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Interp *target; - LoadedPackage *pkgPtr, *defaultPtr; - Tcl_DString pkgName, tmp, initName, safeInitName, fileName; - Tcl_PackageInitProc *initProc, *safeInitProc; - InterpPackage *ipFirstPtr, *ipPtr; - int code, namesMatch, filesMatch; - char *p, *tempString, *fullFileName, *packageName; - ClientData clientData; - Tcl_UniChar ch; - int offset; - - if ((objc < 2) || (objc > 4)) { - Tcl_WrongNumArgs(interp, 1, objv, "fileName ?packageName? ?interp?"); - return TCL_ERROR; - } - tempString = Tcl_GetString(objv[1]); - fullFileName = Tcl_TranslateFileName(interp, tempString, &fileName); - if (fullFileName == NULL) { - return TCL_ERROR; - } - Tcl_DStringInit(&pkgName); - Tcl_DStringInit(&initName); - Tcl_DStringInit(&safeInitName); - Tcl_DStringInit(&tmp); - - packageName = NULL; - if (objc >= 3) { - packageName = Tcl_GetString(objv[2]); - if (packageName[0] == '\0') { - packageName = NULL; - } - } - if ((fullFileName[0] == 0) && (packageName == NULL)) { - Tcl_SetResult(interp, - "must specify either file name or package name", - TCL_STATIC); - code = TCL_ERROR; - goto done; - } - - /* - * Figure out which interpreter we're going to load the package into. - */ - - target = interp; - if (objc == 4) { - char *slaveIntName; - slaveIntName = Tcl_GetString(objv[3]); - target = Tcl_GetSlave(interp, slaveIntName); - if (target == NULL) { - return TCL_ERROR; - } - } - - /* - * Scan through the packages that are currently loaded to see if the - * package we want is already loaded. We'll use a loaded package if - * it meets any of the following conditions: - * - Its name and file match the once we're looking for. - * - Its file matches, and we weren't given a name. - * - Its name matches, the file name was specified as empty, and there - * is only no statically loaded package with the same name. - */ - Tcl_MutexLock(&packageMutex); - - defaultPtr = NULL; - for (pkgPtr = firstPackagePtr; pkgPtr != NULL; pkgPtr = pkgPtr->nextPtr) { - if (packageName == NULL) { - namesMatch = 0; - } else { - Tcl_DStringSetLength(&pkgName, 0); - Tcl_DStringAppend(&pkgName, packageName, -1); - Tcl_DStringSetLength(&tmp, 0); - Tcl_DStringAppend(&tmp, pkgPtr->packageName, -1); - Tcl_UtfToLower(Tcl_DStringValue(&pkgName)); - Tcl_UtfToLower(Tcl_DStringValue(&tmp)); - if (strcmp(Tcl_DStringValue(&tmp), - Tcl_DStringValue(&pkgName)) == 0) { - namesMatch = 1; - } else { - namesMatch = 0; - } - } - Tcl_DStringSetLength(&pkgName, 0); - - filesMatch = (strcmp(pkgPtr->fileName, fullFileName) == 0); - if (filesMatch && (namesMatch || (packageName == NULL))) { - break; - } - if (namesMatch && (fullFileName[0] == 0)) { - defaultPtr = pkgPtr; - } - if (filesMatch && !namesMatch && (fullFileName[0] != 0)) { - /* - * Can't have two different packages loaded from the same - * file. - */ - - Tcl_AppendResult(interp, "file \"", fullFileName, - "\" is already loaded for package \"", - pkgPtr->packageName, "\"", (char *) NULL); - code = TCL_ERROR; - Tcl_MutexUnlock(&packageMutex); - goto done; - } - } - Tcl_MutexUnlock(&packageMutex); - if (pkgPtr == NULL) { - pkgPtr = defaultPtr; - } - - /* - * Scan through the list of packages already loaded in the target - * interpreter. If the package we want is already loaded there, - * then there's nothing for us to to. - */ - - if (pkgPtr != NULL) { - ipFirstPtr = (InterpPackage *) Tcl_GetAssocData(target, "tclLoad", - (Tcl_InterpDeleteProc **) NULL); - for (ipPtr = ipFirstPtr; ipPtr != NULL; ipPtr = ipPtr->nextPtr) { - if (ipPtr->pkgPtr == pkgPtr) { - code = TCL_OK; - goto done; - } - } - } - - if (pkgPtr == NULL) { - /* - * The desired file isn't currently loaded, so load it. It's an - * error if the desired package is a static one. - */ - - if (fullFileName[0] == 0) { - Tcl_AppendResult(interp, "package \"", packageName, - "\" isn't loaded statically", (char *) NULL); - code = TCL_ERROR; - goto done; - } - - /* - * Figure out the module name if it wasn't provided explicitly. - */ - - if (packageName != NULL) { - Tcl_DStringAppend(&pkgName, packageName, -1); - } else { - int retc; - /* - * Threading note - this call used to be protected by a mutex. - */ - retc = TclGuessPackageName(fullFileName, &pkgName); - if (!retc) { - int pargc; - char **pargv, *pkgGuess; - - /* - * The platform-specific code couldn't figure out the - * module name. Make a guess by taking the last element - * of the file name, stripping off any leading "lib", - * and then using all of the alphabetic and underline - * characters that follow that. - */ - - Tcl_SplitPath(fullFileName, &pargc, &pargv); - pkgGuess = pargv[pargc-1]; - if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i') - && (pkgGuess[2] == 'b')) { - pkgGuess += 3; - } - for (p = pkgGuess; *p != 0; p += offset) { - offset = Tcl_UtfToUniChar(p, &ch); - if ((ch > 0x100) - || !(isalpha(UCHAR(ch)) /* INTL: ISO only */ - || (UCHAR(ch) == '_'))) { - break; - } - } - if (p == pkgGuess) { - ckfree((char *)pargv); - Tcl_AppendResult(interp, - "couldn't figure out package name for ", - fullFileName, (char *) NULL); - code = TCL_ERROR; - goto done; - } - Tcl_DStringAppend(&pkgName, pkgGuess, (p - pkgGuess)); - ckfree((char *)pargv); - } - } - - /* - * Fix the capitalization in the package name so that the first - * character is in caps (or title case) but the others are all - * lower-case. - */ - - Tcl_DStringSetLength(&pkgName, - Tcl_UtfToTitle(Tcl_DStringValue(&pkgName))); - - /* - * Compute the names of the two initialization procedures, - * based on the package name. - */ - - Tcl_DStringAppend(&initName, Tcl_DStringValue(&pkgName), -1); - Tcl_DStringAppend(&initName, "_Init", 5); - Tcl_DStringAppend(&safeInitName, Tcl_DStringValue(&pkgName), -1); - Tcl_DStringAppend(&safeInitName, "_SafeInit", 9); - - /* - * Call platform-specific code to load the package and find the - * two initialization procedures. - */ - - Tcl_MutexLock(&packageMutex); - code = TclpLoadFile(interp, fullFileName, Tcl_DStringValue(&initName), - Tcl_DStringValue(&safeInitName), &initProc, &safeInitProc, - &clientData); - Tcl_MutexUnlock(&packageMutex); - if (code != TCL_OK) { - goto done; - } - if (initProc == NULL) { - Tcl_AppendResult(interp, "couldn't find procedure ", - Tcl_DStringValue(&initName), (char *) NULL); - TclpUnloadFile(clientData); - code = TCL_ERROR; - goto done; - } - - /* - * Create a new record to describe this package. - */ - - pkgPtr = (LoadedPackage *) ckalloc(sizeof(LoadedPackage)); - pkgPtr->fileName = (char *) ckalloc((unsigned) - (strlen(fullFileName) + 1)); - strcpy(pkgPtr->fileName, fullFileName); - pkgPtr->packageName = (char *) ckalloc((unsigned) - (Tcl_DStringLength(&pkgName) + 1)); - strcpy(pkgPtr->packageName, Tcl_DStringValue(&pkgName)); - pkgPtr->clientData = clientData; - pkgPtr->initProc = initProc; - pkgPtr->safeInitProc = safeInitProc; - Tcl_MutexLock(&packageMutex); - pkgPtr->nextPtr = firstPackagePtr; - firstPackagePtr = pkgPtr; - Tcl_MutexUnlock(&packageMutex); - } - - /* - * Invoke the package's initialization procedure (either the - * normal one or the safe one, depending on whether or not the - * interpreter is safe). - */ - - if (Tcl_IsSafe(target)) { - if (pkgPtr->safeInitProc != NULL) { - code = (*pkgPtr->safeInitProc)(target); - } else { - Tcl_AppendResult(interp, - "can't use package in a safe interpreter: ", - "no ", pkgPtr->packageName, "_SafeInit procedure", - (char *) NULL); - code = TCL_ERROR; - goto done; - } - } else { - code = (*pkgPtr->initProc)(target); - } - - /* - * Record the fact that the package has been loaded in the - * target interpreter. - */ - - if (code == TCL_OK) { - /* - * Refetch ipFirstPtr: loading the package may have introduced - * additional static packages at the head of the linked list! - */ - - ipFirstPtr = (InterpPackage *) Tcl_GetAssocData(target, "tclLoad", - (Tcl_InterpDeleteProc **) NULL); - ipPtr = (InterpPackage *) ckalloc(sizeof(InterpPackage)); - ipPtr->pkgPtr = pkgPtr; - ipPtr->nextPtr = ipFirstPtr; - Tcl_SetAssocData(target, "tclLoad", LoadCleanupProc, - (ClientData) ipPtr); - } else { - TclTransferResult(target, code, interp); - } - - done: - Tcl_DStringFree(&pkgName); - Tcl_DStringFree(&initName); - Tcl_DStringFree(&safeInitName); - Tcl_DStringFree(&fileName); - Tcl_DStringFree(&tmp); - return code; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_StaticPackage -- - * - * This procedure is invoked to indicate that a particular - * package has been linked statically with an application. - * - * Results: - * None. - * - * Side effects: - * Once this procedure completes, the package becomes loadable - * via the "load" command with an empty file name. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_StaticPackage(interp, pkgName, initProc, safeInitProc) - Tcl_Interp *interp; /* If not NULL, it means that the - * package has already been loaded - * into the given interpreter by - * calling the appropriate init proc. */ - char *pkgName; /* Name of package (must be properly - * capitalized: first letter upper - * case, others lower case). */ - Tcl_PackageInitProc *initProc; /* Procedure to call to incorporate - * this package into a trusted - * interpreter. */ - Tcl_PackageInitProc *safeInitProc; /* Procedure to call to incorporate - * this package into a safe interpreter - * (one that will execute untrusted - * scripts). NULL means the package - * can't be used in safe - * interpreters. */ -{ - LoadedPackage *pkgPtr; - InterpPackage *ipPtr, *ipFirstPtr; - - /* - * Check to see if someone else has already reported this package as - * statically loaded. If this call is redundant then just return. - */ - - Tcl_MutexLock(&packageMutex); - for (pkgPtr = firstPackagePtr; pkgPtr != NULL; pkgPtr = pkgPtr->nextPtr) { - if ((pkgPtr->initProc == initProc) - && (pkgPtr->safeInitProc == safeInitProc) - && (strcmp(pkgPtr->packageName, pkgName) == 0)) { - Tcl_MutexUnlock(&packageMutex); - return; - } - } - - Tcl_MutexUnlock(&packageMutex); - - pkgPtr = (LoadedPackage *) ckalloc(sizeof(LoadedPackage)); - pkgPtr->fileName = (char *) ckalloc((unsigned) 1); - pkgPtr->fileName[0] = 0; - pkgPtr->packageName = (char *) ckalloc((unsigned) - (strlen(pkgName) + 1)); - strcpy(pkgPtr->packageName, pkgName); - pkgPtr->clientData = NULL; - pkgPtr->initProc = initProc; - pkgPtr->safeInitProc = safeInitProc; - Tcl_MutexLock(&packageMutex); - pkgPtr->nextPtr = firstPackagePtr; - firstPackagePtr = pkgPtr; - Tcl_MutexUnlock(&packageMutex); - - if (interp != NULL) { - ipFirstPtr = (InterpPackage *) Tcl_GetAssocData(interp, "tclLoad", - (Tcl_InterpDeleteProc **) NULL); - ipPtr = (InterpPackage *) ckalloc(sizeof(InterpPackage)); - ipPtr->pkgPtr = pkgPtr; - ipPtr->nextPtr = ipFirstPtr; - Tcl_SetAssocData(interp, "tclLoad", LoadCleanupProc, - (ClientData) ipPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclGetLoadedPackages -- - * - * This procedure returns information about all of the files - * that are loaded (either in a particular intepreter, or - * for all interpreters). - * - * Results: - * The return value is a standard Tcl completion code. If - * successful, a list of lists is placed in the interp's result. - * Each sublist corresponds to one loaded file; its first - * element is the name of the file (or an empty string for - * something that's statically loaded) and the second element - * is the name of the package in that file. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclGetLoadedPackages(interp, targetName) - Tcl_Interp *interp; /* Interpreter in which to return - * information or error message. */ - char *targetName; /* Name of target interpreter or NULL. - * If NULL, return info about all interps; - * otherwise, just return info about this - * interpreter. */ -{ - Tcl_Interp *target; - LoadedPackage *pkgPtr; - InterpPackage *ipPtr; - char *prefix; - - if (targetName == NULL) { - /* - * Return information about all of the available packages. - */ - - prefix = "{"; - Tcl_MutexLock(&packageMutex); - for (pkgPtr = firstPackagePtr; pkgPtr != NULL; - pkgPtr = pkgPtr->nextPtr) { - Tcl_AppendResult(interp, prefix, (char *) NULL); - Tcl_AppendElement(interp, pkgPtr->fileName); - Tcl_AppendElement(interp, pkgPtr->packageName); - Tcl_AppendResult(interp, "}", (char *) NULL); - prefix = " {"; - } - Tcl_MutexUnlock(&packageMutex); - return TCL_OK; - } - - /* - * Return information about only the packages that are loaded in - * a given interpreter. - */ - - target = Tcl_GetSlave(interp, targetName); - if (target == NULL) { - return TCL_ERROR; - } - ipPtr = (InterpPackage *) Tcl_GetAssocData(target, "tclLoad", - (Tcl_InterpDeleteProc **) NULL); - prefix = "{"; - for ( ; ipPtr != NULL; ipPtr = ipPtr->nextPtr) { - pkgPtr = ipPtr->pkgPtr; - Tcl_AppendResult(interp, prefix, (char *) NULL); - Tcl_AppendElement(interp, pkgPtr->fileName); - Tcl_AppendElement(interp, pkgPtr->packageName); - Tcl_AppendResult(interp, "}", (char *) NULL); - prefix = " {"; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * LoadCleanupProc -- - * - * This procedure is called to delete all of the InterpPackage - * structures for an interpreter when the interpreter is deleted. - * It gets invoked via the Tcl AssocData mechanism. - * - * Results: - * None. - * - * Side effects: - * Storage for all of the InterpPackage procedures for interp - * get deleted. - * - *---------------------------------------------------------------------- - */ - -static void -LoadCleanupProc(clientData, interp) - ClientData clientData; /* Pointer to first InterpPackage structure - * for interp. */ - Tcl_Interp *interp; /* Interpreter that is being deleted. */ -{ - InterpPackage *ipPtr, *nextPtr; - - ipPtr = (InterpPackage *) clientData; - while (ipPtr != NULL) { - nextPtr = ipPtr->nextPtr; - ckfree((char *) ipPtr); - ipPtr = nextPtr; - } -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeLoad -- - * - * This procedure is invoked just before the application exits. - * It frees all of the LoadedPackage structures. - * - * Results: - * None. - * - * Side effects: - * Memory is freed. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeLoad() -{ - LoadedPackage *pkgPtr; - - /* - * No synchronization here because there should just be - * one thread alive at this point. Logically, - * packageMutex should be grabbed at this point, but - * the Mutexes get finalized before the call to this routine. - * The only subsystem left alive at this point is the - * memory allocator. - */ - - while (firstPackagePtr != NULL) { - pkgPtr = firstPackagePtr; - firstPackagePtr = pkgPtr->nextPtr; - if (pkgPtr->fileName[0] != '\0') { - TclpUnloadFile(pkgPtr->clientData); - } - ckfree(pkgPtr->fileName); - ckfree(pkgPtr->packageName); - ckfree((char *) pkgPtr); - } -} diff --git a/generic/tclLoadNone.c b/generic/tclLoadNone.c deleted file mode 100644 index ca0046e..0000000 --- a/generic/tclLoadNone.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * tclLoadNone.c -- - * - * This procedure provides a version of the TclLoadFile for use - * in systems that don't support dynamic loading; it just returns - * an error. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclLoadNone.c,v 1.3 1999/04/16 00:46:50 stanton Exp $ - */ - -#include "tclInt.h" - -/* - *---------------------------------------------------------------------- - * - * TclLoadFile -- - * - * This procedure is called to carry out dynamic loading of binary - * code; it is intended for use only on systems that don't support - * dynamic loading (it returns an error). - * - * Results: - * The result is TCL_ERROR, and an error message is left in - * the interp's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr) - Tcl_Interp *interp; /* Used for error reporting. */ - char *fileName; /* Name of the file containing the desired - * code. */ - char *sym1, *sym2; /* Names of two procedures to look up in - * the file's symbol table. */ - Tcl_PackageInitProc **proc1Ptr, **proc2Ptr; - /* Where to return the addresses corresponding - * to sym1 and sym2. */ -{ - Tcl_SetResult(interp, - "dynamic loading is not currently available on this system", - TCL_STATIC); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * TclGuessPackageName -- - * - * If the "load" command is invoked without providing a package - * name, this procedure is invoked to try to figure it out. - * - * Results: - * Always returns 0 to indicate that we couldn't figure out a - * package name; generic code will then try to guess the package - * from the file name. A return value of 1 would have meant that - * we figured out the package name and put it in bufPtr. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclGuessPackageName(fileName, bufPtr) - char *fileName; /* Name of file containing package (already - * translated to local form if needed). */ - Tcl_DString *bufPtr; /* Initialized empty dstring. Append - * package name to this if possible. */ -{ - return 0; -} diff --git a/generic/tclMain.c b/generic/tclMain.c deleted file mode 100644 index 089452d..0000000 --- a/generic/tclMain.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * tclMain.c -- - * - * Main program for Tcl shells and other Tcl-based applications. - * - * Copyright (c) 1988-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. - * - * RCS: @(#) $Id: tclMain.c,v 1.5 1999/04/16 00:46:50 stanton Exp $ - */ - -#include "tcl.h" -#include "tclInt.h" - -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT - -/* - * The following code ensures that tclLink.c is linked whenever - * Tcl is linked. Without this code there's no reference to the - * code in that file from anywhere in Tcl, so it may not be - * linked into the application. - */ - -EXTERN int Tcl_LinkVar(); -int (*tclDummyLinkVarPtr)() = Tcl_LinkVar; - -/* - * Declarations for various library procedures and variables (don't want - * to include tclPort.h here, because people might copy this file out of - * the Tcl source directory to make their own modified versions). - * Note: "exit" should really be declared here, but there's no way to - * declare it without causing conflicts with other definitions elsewher - * on some systems, so it's better just to leave it out. - */ - -extern int isatty _ANSI_ARGS_((int fd)); -extern char * strcpy _ANSI_ARGS_((char *dst, CONST char *src)); - - -/* - *---------------------------------------------------------------------- - * - * Tcl_Main -- - * - * Main program for tclsh and most other Tcl-based applications. - * - * Results: - * None. This procedure never returns (it exits the process when - * it's done. - * - * Side effects: - * This procedure initializes the Tk world and then starts - * interpreting commands; almost anything could happen, depending - * on the script being interpreted. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_Main(argc, argv, appInitProc) - int argc; /* Number of arguments. */ - char **argv; /* Array of argument strings. */ - Tcl_AppInitProc *appInitProc; - /* Application-specific initialization - * procedure to call after most - * initialization but before starting to - * execute commands. */ -{ - Tcl_Obj *resultPtr; - Tcl_Obj *commandPtr = NULL; - char buffer[1000], *args, *fileName; - int code, gotPartial, tty, length; - int exitCode = 0; - Tcl_Channel inChannel, outChannel, errChannel; - Tcl_Interp *interp; - Tcl_DString argString; - - Tcl_FindExecutable(argv[0]); - interp = Tcl_CreateInterp(); -#ifdef TCL_MEM_DEBUG - Tcl_InitMemory(interp); -#endif - - /* - * Make command-line arguments available in the Tcl variables "argc" - * and "argv". If the first argument doesn't start with a "-" then - * strip it off and use it as the name of a script file to process. - */ - - fileName = NULL; - if ((argc > 1) && (argv[1][0] != '-')) { - fileName = argv[1]; - argc--; - argv++; - } - args = Tcl_Merge(argc-1, argv+1); - Tcl_ExternalToUtfDString(NULL, args, -1, &argString); - Tcl_SetVar(interp, "argv", Tcl_DStringValue(&argString), TCL_GLOBAL_ONLY); - Tcl_DStringFree(&argString); - ckfree(args); - - if (fileName == NULL) { - Tcl_ExternalToUtfDString(NULL, argv[0], -1, &argString); - } else { - fileName = Tcl_ExternalToUtfDString(NULL, fileName, -1, &argString); - } - - TclFormatInt(buffer, argc-1); - Tcl_SetVar(interp, "argc", buffer, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "argv0", Tcl_DStringValue(&argString), TCL_GLOBAL_ONLY); - - /* - * Set the "tcl_interactive" variable. - */ - - tty = isatty(0); - Tcl_SetVar(interp, "tcl_interactive", - ((fileName == NULL) && tty) ? "1" : "0", TCL_GLOBAL_ONLY); - - /* - * Invoke application-specific initialization. - */ - - if ((*appInitProc)(interp) != TCL_OK) { - errChannel = Tcl_GetStdChannel(TCL_STDERR); - if (errChannel) { - Tcl_WriteChars(errChannel, - "application-specific initialization failed: ", -1); - Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp)); - Tcl_WriteChars(errChannel, "\n", 1); - } - } - - /* - * If a script file was specified then just source that file - * and quit. - */ - - if (fileName != NULL) { - code = Tcl_EvalFile(interp, fileName); - if (code != TCL_OK) { - errChannel = Tcl_GetStdChannel(TCL_STDERR); - if (errChannel) { - /* - * The following statement guarantees that the errorInfo - * variable is set properly. - */ - - Tcl_AddErrorInfo(interp, ""); - Tcl_WriteObj(errChannel, Tcl_GetVar2Ex(interp, "errorInfo", - NULL, TCL_GLOBAL_ONLY)); - Tcl_WriteChars(errChannel, "\n", 1); - } - exitCode = 1; - } - goto done; - } - Tcl_DStringFree(&argString); - - /* - * We're running interactively. Source a user-specific startup - * file if the application specified one and if the file exists. - */ - - Tcl_SourceRCFile(interp); - - /* - * Process commands from stdin until there's an end-of-file. Note - * that we need to fetch the standard channels again after every - * eval, since they may have been changed. - */ - - commandPtr = Tcl_NewObj(); - Tcl_IncrRefCount(commandPtr); - - inChannel = Tcl_GetStdChannel(TCL_STDIN); - outChannel = Tcl_GetStdChannel(TCL_STDOUT); - gotPartial = 0; - while (1) { - if (tty) { - Tcl_Obj *promptCmdPtr; - - promptCmdPtr = Tcl_GetVar2Ex(interp, - (gotPartial ? "tcl_prompt2" : "tcl_prompt1"), - NULL, TCL_GLOBAL_ONLY); - if (promptCmdPtr == NULL) { - defaultPrompt: - if (!gotPartial && outChannel) { - Tcl_WriteChars(outChannel, "% ", 2); - } - } else { - code = Tcl_EvalObjEx(interp, promptCmdPtr, 0); - inChannel = Tcl_GetStdChannel(TCL_STDIN); - outChannel = Tcl_GetStdChannel(TCL_STDOUT); - errChannel = Tcl_GetStdChannel(TCL_STDERR); - if (code != TCL_OK) { - if (errChannel) { - Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp)); - Tcl_WriteChars(errChannel, "\n", 1); - } - Tcl_AddErrorInfo(interp, - "\n (script that generates prompt)"); - goto defaultPrompt; - } - } - if (outChannel) { - Tcl_Flush(outChannel); - } - } - if (!inChannel) { - goto done; - } - length = Tcl_GetsObj(inChannel, commandPtr); - if (length < 0) { - goto done; - } - if ((length == 0) && Tcl_Eof(inChannel) && (!gotPartial)) { - goto done; - } - - /* - * Add the newline removed by Tcl_GetsObj back to the string. - */ - - Tcl_AppendToObj(commandPtr, "\n", 1); - if (!TclObjCommandComplete(commandPtr)) { - gotPartial = 1; - continue; - } - - gotPartial = 0; - code = Tcl_RecordAndEvalObj(interp, commandPtr, 0); - inChannel = Tcl_GetStdChannel(TCL_STDIN); - outChannel = Tcl_GetStdChannel(TCL_STDOUT); - errChannel = Tcl_GetStdChannel(TCL_STDERR); - Tcl_SetObjLength(commandPtr, 0); - if (code != TCL_OK) { - if (errChannel) { - Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp)); - Tcl_WriteChars(errChannel, "\n", 1); - } - } else if (tty) { - resultPtr = Tcl_GetObjResult(interp); - Tcl_GetStringFromObj(resultPtr, &length); - if ((length > 0) && outChannel) { - Tcl_WriteObj(outChannel, resultPtr); - Tcl_WriteChars(outChannel, "\n", 1); - } - } -#ifdef TCL_MEM_DEBUG - if (tclMemDumpFileName != NULL) { - Tcl_DecrRefCount(commandPtr); - Tcl_DeleteInterp(interp); - Tcl_Exit(0); - } -#endif - } - - /* - * Rather than calling exit, invoke the "exit" command so that - * users can replace "exit" with some other command to do additional - * cleanup on exit. The Tcl_Eval call should never return. - */ - - done: - if (commandPtr != NULL) { - Tcl_DecrRefCount(commandPtr); - } - sprintf(buffer, "exit %d", exitCode); - Tcl_Eval(interp, buffer); -} diff --git a/generic/tclMath.h b/generic/tclMath.h deleted file mode 100644 index ee1a02e..0000000 --- a/generic/tclMath.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * tclMath.h -- - * - * This file is necessary because of Metrowerks CodeWarrior Pro 1 - * on the Macintosh. With 8-byte doubles turned on, the definitions of - * sin, cos, acos, etc., are screwed up. They are fine as long as - * they are used as function calls, but if the function pointers - * are passed around and used, they will crash hard on the 68K. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMath.h,v 1.2 1998/09/14 18:40:01 stanton Exp $ - */ - -#ifndef _TCLMATH -#define _TCLMATH - -#if defined(MAC_TCL) -# include "tclMacMath.h" -#else -# include -#endif - -#endif /* _TCLMATH */ diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c deleted file mode 100644 index b01cb84..0000000 --- a/generic/tclNamesp.c +++ /dev/null @@ -1,3869 +0,0 @@ -/* - * tclNamesp.c -- - * - * Contains support for namespaces, which provide a separate context of - * commands and global variables. The global :: namespace is the - * traditional Tcl "global" scope. Other namespaces are created as - * children of the global namespace. These other namespaces contain - * special-purpose commands and variables for packages. - * - * Copyright (c) 1993-1997 Lucent Technologies. - * Copyright (c) 1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. - * - * Originally implemented by - * Michael J. McLennan - * Bell Labs Innovations for Lucent Technologies - * mmclennan@lucent.com - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclNamesp.c,v 1.11 1999/04/16 00:46:50 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * Flag passed to TclGetNamespaceForQualName to indicate that it should - * search for a namespace rather than a command or variable inside a - * namespace. Note that this flag's value must not conflict with the values - * of TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY, or CREATE_NS_IF_UNKNOWN. - */ - -#define FIND_ONLY_NS 0x1000 - -/* - * Initial size of stack allocated space for tail list - used when resetting - * shadowed command references in the functin: TclResetShadowedCmdRefs. - */ - -#define NUM_TRAIL_ELEMS 5 - -/* - * Count of the number of namespaces created. This value is used as a - * unique id for each namespace. - */ - -static long numNsCreated = 0; -TCL_DECLARE_MUTEX(nsMutex) - -/* - * This structure contains a cached pointer to a namespace that is the - * result of resolving the namespace's name in some other namespace. It is - * the internal representation for a nsName object. It contains the - * pointer along with some information that is used to check the cached - * pointer's validity. - */ - -typedef struct ResolvedNsName { - Namespace *nsPtr; /* A cached namespace pointer. */ - long nsId; /* nsPtr's unique namespace id. Used to - * verify that nsPtr is still valid - * (e.g., it's possible that the namespace - * was deleted and a new one created at - * the same address). */ - Namespace *refNsPtr; /* Points to the namespace containing the - * reference (not the namespace that - * contains the referenced namespace). */ - int refCount; /* Reference count: 1 for each nsName - * object that has a pointer to this - * ResolvedNsName structure as its internal - * rep. This structure can be freed when - * refCount becomes zero. */ -} ResolvedNsName; - -/* - * Declarations for procedures local to this file: - */ - -static void DeleteImportedCmd _ANSI_ARGS_(( - ClientData clientData)); -static void DupNsNameInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr, - Tcl_Obj *copyPtr)); -static void FreeNsNameInternalRep _ANSI_ARGS_(( - Tcl_Obj *objPtr)); -static int GetNamespaceFromObj _ANSI_ARGS_(( - Tcl_Interp *interp, Tcl_Obj *objPtr, - Tcl_Namespace **nsPtrPtr)); -static int InvokeImportedCmd _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceChildrenCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceCodeCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceCurrentCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceDeleteCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceEvalCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceExportCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceForgetCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static void NamespaceFree _ANSI_ARGS_((Namespace *nsPtr)); -static int NamespaceImportCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceInscopeCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceOriginCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceParentCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceQualifiersCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceTailCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int NamespaceWhichCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int SetNsNameFromAny _ANSI_ARGS_(( - Tcl_Interp *interp, Tcl_Obj *objPtr)); -static void UpdateStringOfNsName _ANSI_ARGS_((Tcl_Obj *objPtr)); - -/* - * This structure defines a Tcl object type that contains a - * namespace reference. It is used in commands that take the - * name of a namespace as an argument. The namespace reference - * is resolved, and the result in cached in the object. - */ - -Tcl_ObjType tclNsNameType = { - "nsName", /* the type's name */ - FreeNsNameInternalRep, /* freeIntRepProc */ - DupNsNameInternalRep, /* dupIntRepProc */ - UpdateStringOfNsName, /* updateStringProc */ - SetNsNameFromAny /* setFromAnyProc */ -}; - -/* - *---------------------------------------------------------------------- - * - * TclInitNamespaceSubsystem -- - * - * This procedure is called to initialize all the structures that - * are used by namespaces on a per-process basis. - * - * Results: - * None. - * - * Side effects: - * The namespace object type is registered with the Tcl compiler. - * - *---------------------------------------------------------------------- - */ - -void -TclInitNamespaceSubsystem() -{ - Tcl_RegisterObjType(&tclNsNameType); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetCurrentNamespace -- - * - * Returns a pointer to an interpreter's currently active namespace. - * - * Results: - * Returns a pointer to the interpreter's current namespace. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Namespace * -Tcl_GetCurrentNamespace(interp) - register Tcl_Interp *interp; /* Interpreter whose current namespace is - * being queried. */ -{ - register Interp *iPtr = (Interp *) interp; - register Namespace *nsPtr; - - if (iPtr->varFramePtr != NULL) { - nsPtr = iPtr->varFramePtr->nsPtr; - } else { - nsPtr = iPtr->globalNsPtr; - } - return (Tcl_Namespace *) nsPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetGlobalNamespace -- - * - * Returns a pointer to an interpreter's global :: namespace. - * - * Results: - * Returns a pointer to the specified interpreter's global namespace. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Namespace * -Tcl_GetGlobalNamespace(interp) - register Tcl_Interp *interp; /* Interpreter whose global namespace - * should be returned. */ -{ - register Interp *iPtr = (Interp *) interp; - - return (Tcl_Namespace *) iPtr->globalNsPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PushCallFrame -- - * - * Pushes a new call frame onto the interpreter's Tcl call stack. - * Called when executing a Tcl procedure or a "namespace eval" or - * "namespace inscope" command. - * - * Results: - * Returns TCL_OK if successful, or TCL_ERROR (along with an error - * message in the interpreter's result object) if something goes wrong. - * - * Side effects: - * Modifies the interpreter's Tcl call stack. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_PushCallFrame(interp, callFramePtr, namespacePtr, isProcCallFrame) - Tcl_Interp *interp; /* Interpreter in which the new call frame - * is to be pushed. */ - Tcl_CallFrame *callFramePtr; /* Points to a call frame structure to - * push. Storage for this have already been - * allocated by the caller; typically this - * is the address of a CallFrame structure - * allocated on the caller's C stack. The - * call frame will be initialized by this - * procedure. The caller can pop the frame - * later with Tcl_PopCallFrame, and it is - * responsible for freeing the frame's - * storage. */ - Tcl_Namespace *namespacePtr; /* Points to the namespace in which the - * frame will execute. If NULL, the - * interpreter's current namespace will - * be used. */ - int isProcCallFrame; /* If nonzero, the frame represents a - * called Tcl procedure and may have local - * vars. Vars will ordinarily be looked up - * in the frame. If new variables are - * created, they will be created in the - * frame. If 0, the frame is for a - * "namespace eval" or "namespace inscope" - * command and var references are treated - * as references to namespace variables. */ -{ - Interp *iPtr = (Interp *) interp; - register CallFrame *framePtr = (CallFrame *) callFramePtr; - register Namespace *nsPtr; - - if (namespacePtr == NULL) { - nsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - } else { - nsPtr = (Namespace *) namespacePtr; - if (nsPtr->flags & NS_DEAD) { - panic("Trying to push call frame for dead namespace"); - /*NOTREACHED*/ - } - } - - nsPtr->activationCount++; - framePtr->nsPtr = nsPtr; - framePtr->isProcCallFrame = isProcCallFrame; - framePtr->objc = 0; - framePtr->objv = NULL; - framePtr->callerPtr = iPtr->framePtr; - framePtr->callerVarPtr = iPtr->varFramePtr; - if (iPtr->varFramePtr != NULL) { - framePtr->level = (iPtr->varFramePtr->level + 1); - } else { - framePtr->level = 1; - } - framePtr->procPtr = NULL; /* no called procedure */ - framePtr->varTablePtr = NULL; /* and no local variables */ - framePtr->numCompiledLocals = 0; - framePtr->compiledLocals = NULL; - - /* - * Push the new call frame onto the interpreter's stack of procedure - * call frames making it the current frame. - */ - - iPtr->framePtr = framePtr; - iPtr->varFramePtr = framePtr; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PopCallFrame -- - * - * Removes a call frame from the Tcl call stack for the interpreter. - * Called to remove a frame previously pushed by Tcl_PushCallFrame. - * - * Results: - * None. - * - * Side effects: - * Modifies the call stack of the interpreter. Resets various fields of - * the popped call frame. If a namespace has been deleted and - * has no more activations on the call stack, the namespace is - * destroyed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_PopCallFrame(interp) - Tcl_Interp* interp; /* Interpreter with call frame to pop. */ -{ - register Interp *iPtr = (Interp *) interp; - register CallFrame *framePtr = iPtr->framePtr; - int saveErrFlag; - Namespace *nsPtr; - - /* - * It's important to remove the call frame from the interpreter's stack - * of call frames before deleting local variables, so that traces - * invoked by the variable deletion don't see the partially-deleted - * frame. - */ - - iPtr->framePtr = framePtr->callerPtr; - iPtr->varFramePtr = framePtr->callerVarPtr; - - /* - * Delete the local variables. As a hack, we save then restore the - * ERR_IN_PROGRESS flag in the interpreter. The problem is that there - * could be unset traces on the variables, which cause scripts to be - * evaluated. This will clear the ERR_IN_PROGRESS flag, losing stack - * trace information if the procedure was exiting with an error. The - * code below preserves the flag. Unfortunately, that isn't really - * enough: we really should preserve the errorInfo variable too - * (otherwise a nested error in the trace script will trash errorInfo). - * What's really needed is a general-purpose mechanism for saving and - * restoring interpreter state. - */ - - saveErrFlag = (iPtr->flags & ERR_IN_PROGRESS); - - if (framePtr->varTablePtr != NULL) { - TclDeleteVars(iPtr, framePtr->varTablePtr); - ckfree((char *) framePtr->varTablePtr); - framePtr->varTablePtr = NULL; - } - if (framePtr->numCompiledLocals > 0) { - TclDeleteCompiledLocalVars(iPtr, framePtr); - } - - iPtr->flags |= saveErrFlag; - - /* - * Decrement the namespace's count of active call frames. If the - * namespace is "dying" and there are no more active call frames, - * call Tcl_DeleteNamespace to destroy it. - */ - - nsPtr = framePtr->nsPtr; - nsPtr->activationCount--; - if ((nsPtr->flags & NS_DYING) - && (nsPtr->activationCount == 0)) { - Tcl_DeleteNamespace((Tcl_Namespace *) nsPtr); - } - framePtr->nsPtr = NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateNamespace -- - * - * Creates a new namespace with the given name. If there is no - * active namespace (i.e., the interpreter is being initialized), - * the global :: namespace is created and returned. - * - * Results: - * Returns a pointer to the new namespace if successful. If the - * namespace already exists or if another error occurs, this routine - * returns NULL, along with an error message in the interpreter's - * result object. - * - * Side effects: - * If the name contains "::" qualifiers and a parent namespace does - * not already exist, it is automatically created. - * - *---------------------------------------------------------------------- - */ - -Tcl_Namespace * -Tcl_CreateNamespace(interp, name, clientData, deleteProc) - Tcl_Interp *interp; /* Interpreter in which a new namespace - * is being created. Also used for - * error reporting. */ - char *name; /* Name for the new namespace. May be a - * qualified name with names of ancestor - * namespaces separated by "::"s. */ - ClientData clientData; /* One-word value to store with - * namespace. */ - Tcl_NamespaceDeleteProc *deleteProc; - /* Procedure called to delete client - * data when the namespace is deleted. - * NULL if no procedure should be - * called. */ -{ - Interp *iPtr = (Interp *) interp; - register Namespace *nsPtr, *ancestorPtr; - Namespace *parentPtr, *dummy1Ptr, *dummy2Ptr; - Namespace *globalNsPtr = iPtr->globalNsPtr; - char *simpleName; - Tcl_HashEntry *entryPtr; - Tcl_DString buffer1, buffer2; - int newEntry; - - /* - * If there is no active namespace, the interpreter is being - * initialized. - */ - - if ((globalNsPtr == NULL) && (iPtr->varFramePtr == NULL)) { - /* - * Treat this namespace as the global namespace, and avoid - * looking for a parent. - */ - - parentPtr = NULL; - simpleName = ""; - } else if (*name == '\0') { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't create namespace \"\": only global namespace can have empty name", (char *) NULL); - return NULL; - } else { - /* - * Find the parent for the new namespace. - */ - - TclGetNamespaceForQualName(interp, name, (Namespace *) NULL, - /*flags*/ (CREATE_NS_IF_UNKNOWN | TCL_LEAVE_ERR_MSG), - &parentPtr, &dummy1Ptr, &dummy2Ptr, &simpleName); - - /* - * If the unqualified name at the end is empty, there were trailing - * "::"s after the namespace's name which we ignore. The new - * namespace was already (recursively) created and is pointed to - * by parentPtr. - */ - - if (*simpleName == '\0') { - return (Tcl_Namespace *) parentPtr; - } - - /* - * Check for a bad namespace name and make sure that the name - * does not already exist in the parent namespace. - */ - - if (Tcl_FindHashEntry(&parentPtr->childTable, simpleName) != NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't create namespace \"", name, - "\": already exists", (char *) NULL); - return NULL; - } - } - - /* - * Create the new namespace and root it in its parent. Increment the - * count of namespaces created. - */ - - - nsPtr = (Namespace *) ckalloc(sizeof(Namespace)); - nsPtr->name = (char *) ckalloc((unsigned) (strlen(simpleName)+1)); - strcpy(nsPtr->name, simpleName); - nsPtr->fullName = NULL; /* set below */ - nsPtr->clientData = clientData; - nsPtr->deleteProc = deleteProc; - nsPtr->parentPtr = parentPtr; - Tcl_InitHashTable(&nsPtr->childTable, TCL_STRING_KEYS); - Tcl_MutexLock(&nsMutex); - numNsCreated++; - nsPtr->nsId = numNsCreated; - Tcl_MutexUnlock(&nsMutex); - nsPtr->interp = interp; - nsPtr->flags = 0; - nsPtr->activationCount = 0; - nsPtr->refCount = 0; - Tcl_InitHashTable(&nsPtr->cmdTable, TCL_STRING_KEYS); - Tcl_InitHashTable(&nsPtr->varTable, TCL_STRING_KEYS); - nsPtr->exportArrayPtr = NULL; - nsPtr->numExportPatterns = 0; - nsPtr->maxExportPatterns = 0; - nsPtr->cmdRefEpoch = 0; - nsPtr->resolverEpoch = 0; - nsPtr->cmdResProc = NULL; - nsPtr->varResProc = NULL; - nsPtr->compiledVarResProc = NULL; - - if (parentPtr != NULL) { - entryPtr = Tcl_CreateHashEntry(&parentPtr->childTable, simpleName, - &newEntry); - Tcl_SetHashValue(entryPtr, (ClientData) nsPtr); - } - - /* - * Build the fully qualified name for this namespace. - */ - - Tcl_DStringInit(&buffer1); - Tcl_DStringInit(&buffer2); - for (ancestorPtr = nsPtr; ancestorPtr != NULL; - ancestorPtr = ancestorPtr->parentPtr) { - if (ancestorPtr != globalNsPtr) { - Tcl_DStringAppend(&buffer1, "::", 2); - Tcl_DStringAppend(&buffer1, ancestorPtr->name, -1); - } - Tcl_DStringAppend(&buffer1, Tcl_DStringValue(&buffer2), -1); - - Tcl_DStringSetLength(&buffer2, 0); - Tcl_DStringAppend(&buffer2, Tcl_DStringValue(&buffer1), -1); - Tcl_DStringSetLength(&buffer1, 0); - } - - name = Tcl_DStringValue(&buffer2); - nsPtr->fullName = (char *) ckalloc((unsigned) (strlen(name)+1)); - strcpy(nsPtr->fullName, name); - - Tcl_DStringFree(&buffer1); - Tcl_DStringFree(&buffer2); - - /* - * Return a pointer to the new namespace. - */ - - return (Tcl_Namespace *) nsPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteNamespace -- - * - * Deletes a namespace and all of the commands, variables, and other - * namespaces within it. - * - * Results: - * None. - * - * Side effects: - * When a namespace is deleted, it is automatically removed as a - * child of its parent namespace. Also, all its commands, variables - * and child namespaces are deleted. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteNamespace(namespacePtr) - Tcl_Namespace *namespacePtr; /* Points to the namespace to delete. */ -{ - register Namespace *nsPtr = (Namespace *) namespacePtr; - Interp *iPtr = (Interp *) nsPtr->interp; - Namespace *globalNsPtr = - (Namespace *) Tcl_GetGlobalNamespace((Tcl_Interp *) iPtr); - Tcl_HashEntry *entryPtr; - - /* - * If the namespace is on the call frame stack, it is marked as "dying" - * (NS_DYING is OR'd into its flags): the namespace can't be looked up - * by name but its commands and variables are still usable by those - * active call frames. When all active call frames referring to the - * namespace have been popped from the Tcl stack, Tcl_PopCallFrame will - * call this procedure again to delete everything in the namespace. - * If no nsName objects refer to the namespace (i.e., if its refCount - * is zero), its commands and variables are deleted and the storage for - * its namespace structure is freed. Otherwise, if its refCount is - * nonzero, the namespace's commands and variables are deleted but the - * structure isn't freed. Instead, NS_DEAD is OR'd into the structure's - * flags to allow the namespace resolution code to recognize that the - * namespace is "deleted". The structure's storage is freed by - * FreeNsNameInternalRep when its refCount reaches 0. - */ - - if (nsPtr->activationCount > 0) { - nsPtr->flags |= NS_DYING; - if (nsPtr->parentPtr != NULL) { - entryPtr = Tcl_FindHashEntry(&nsPtr->parentPtr->childTable, - nsPtr->name); - if (entryPtr != NULL) { - Tcl_DeleteHashEntry(entryPtr); - } - } - nsPtr->parentPtr = NULL; - } else { - /* - * Delete the namespace and everything in it. If this is the global - * namespace, then clear it but don't free its storage unless the - * interpreter is being torn down. - */ - - TclTeardownNamespace(nsPtr); - - if ((nsPtr != globalNsPtr) || (iPtr->flags & DELETED)) { - /* - * If this is the global namespace, then it may have residual - * "errorInfo" and "errorCode" variables for errors that - * occurred while it was being torn down. Try to clear the - * variable list one last time. - */ - - TclDeleteVars((Interp *) nsPtr->interp, &nsPtr->varTable); - - Tcl_DeleteHashTable(&nsPtr->childTable); - Tcl_DeleteHashTable(&nsPtr->cmdTable); - - /* - * If the reference count is 0, then discard the namespace. - * Otherwise, mark it as "dead" so that it can't be used. - */ - - if (nsPtr->refCount == 0) { - NamespaceFree(nsPtr); - } else { - nsPtr->flags |= NS_DEAD; - } - } - } -} - -/* - *---------------------------------------------------------------------- - * - * TclTeardownNamespace -- - * - * Used internally to dismantle and unlink a namespace when it is - * deleted. Divorces the namespace from its parent, and deletes all - * commands, variables, and child namespaces. - * - * This is kept separate from Tcl_DeleteNamespace so that the global - * namespace can be handled specially. Global variables like - * "errorInfo" and "errorCode" need to remain intact while other - * namespaces and commands are torn down, in case any errors occur. - * - * Results: - * None. - * - * Side effects: - * Removes this namespace from its parent's child namespace hashtable. - * Deletes all commands, variables and namespaces in this namespace. - * If this is the global namespace, the "errorInfo" and "errorCode" - * variables are left alone and deleted later. - * - *---------------------------------------------------------------------- - */ - -void -TclTeardownNamespace(nsPtr) - register Namespace *nsPtr; /* Points to the namespace to be dismantled - * and unlinked from its parent. */ -{ - Interp *iPtr = (Interp *) nsPtr->interp; - register Tcl_HashEntry *entryPtr; - Tcl_HashSearch search; - Tcl_Namespace *childNsPtr; - Tcl_Command cmd; - Namespace *globalNsPtr = - (Namespace *) Tcl_GetGlobalNamespace((Tcl_Interp *) iPtr); - int i; - - /* - * Start by destroying the namespace's variable table, - * since variables might trigger traces. - */ - - if (nsPtr == globalNsPtr) { - /* - * This is the global namespace, so be careful to preserve the - * "errorInfo" and "errorCode" variables. These might be needed - * later on if errors occur while deleting commands. We are careful - * to destroy and recreate the "errorInfo" and "errorCode" - * variables, in case they had any traces on them. - */ - - char *str, *errorInfoStr, *errorCodeStr; - - str = Tcl_GetVar((Tcl_Interp *) iPtr, "errorInfo", TCL_GLOBAL_ONLY); - if (str != NULL) { - errorInfoStr = ckalloc((unsigned) (strlen(str)+1)); - strcpy(errorInfoStr, str); - } else { - errorInfoStr = NULL; - } - - str = Tcl_GetVar((Tcl_Interp *) iPtr, "errorCode", TCL_GLOBAL_ONLY); - if (str != NULL) { - errorCodeStr = ckalloc((unsigned) (strlen(str)+1)); - strcpy(errorCodeStr, str); - } else { - errorCodeStr = NULL; - } - - TclDeleteVars(iPtr, &nsPtr->varTable); - Tcl_InitHashTable(&nsPtr->varTable, TCL_STRING_KEYS); - - if (errorInfoStr != NULL) { - Tcl_SetVar((Tcl_Interp *) iPtr, "errorInfo", errorInfoStr, - TCL_GLOBAL_ONLY); - ckfree(errorInfoStr); - } - if (errorCodeStr != NULL) { - Tcl_SetVar((Tcl_Interp *) iPtr, "errorCode", errorCodeStr, - TCL_GLOBAL_ONLY); - ckfree(errorCodeStr); - } - } else { - /* - * Variable table should be cleared but not freed! TclDeleteVars - * frees it, so we reinitialize it afterwards. - */ - - TclDeleteVars(iPtr, &nsPtr->varTable); - Tcl_InitHashTable(&nsPtr->varTable, TCL_STRING_KEYS); - } - - /* - * Remove the namespace from its parent's child hashtable. - */ - - if (nsPtr->parentPtr != NULL) { - entryPtr = Tcl_FindHashEntry(&nsPtr->parentPtr->childTable, - nsPtr->name); - if (entryPtr != NULL) { - Tcl_DeleteHashEntry(entryPtr); - } - } - nsPtr->parentPtr = NULL; - - /* - * Delete all the child namespaces. - * - * BE CAREFUL: When each child is deleted, it will divorce - * itself from its parent. You can't traverse a hash table - * properly if its elements are being deleted. We use only - * the Tcl_FirstHashEntry function to be safe. - */ - - for (entryPtr = Tcl_FirstHashEntry(&nsPtr->childTable, &search); - entryPtr != NULL; - entryPtr = Tcl_FirstHashEntry(&nsPtr->childTable, &search)) { - childNsPtr = (Tcl_Namespace *) Tcl_GetHashValue(entryPtr); - Tcl_DeleteNamespace(childNsPtr); - } - - /* - * Delete all commands in this namespace. Be careful when traversing the - * hash table: when each command is deleted, it removes itself from the - * command table. - */ - - for (entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search); - entryPtr != NULL; - entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search)) { - cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr); - Tcl_DeleteCommandFromToken((Tcl_Interp *) iPtr, cmd); - } - Tcl_DeleteHashTable(&nsPtr->cmdTable); - Tcl_InitHashTable(&nsPtr->cmdTable, TCL_STRING_KEYS); - - /* - * Free the namespace's export pattern array. - */ - - if (nsPtr->exportArrayPtr != NULL) { - for (i = 0; i < nsPtr->numExportPatterns; i++) { - ckfree(nsPtr->exportArrayPtr[i]); - } - ckfree((char *) nsPtr->exportArrayPtr); - nsPtr->exportArrayPtr = NULL; - nsPtr->numExportPatterns = 0; - nsPtr->maxExportPatterns = 0; - } - - /* - * Free any client data associated with the namespace. - */ - - if (nsPtr->deleteProc != NULL) { - (*nsPtr->deleteProc)(nsPtr->clientData); - } - nsPtr->deleteProc = NULL; - nsPtr->clientData = NULL; - - /* - * Reset the namespace's id field to ensure that this namespace won't - * be interpreted as valid by, e.g., the cache validation code for - * cached command references in Tcl_GetCommandFromObj. - */ - - nsPtr->nsId = 0; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceFree -- - * - * Called after a namespace has been deleted, when its - * reference count reaches 0. Frees the data structure - * representing the namespace. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -NamespaceFree(nsPtr) - register Namespace *nsPtr; /* Points to the namespace to free. */ -{ - /* - * Most of the namespace's contents are freed when the namespace is - * deleted by Tcl_DeleteNamespace. All that remains is to free its names - * (for error messages), and the structure itself. - */ - - ckfree(nsPtr->name); - ckfree(nsPtr->fullName); - - ckfree((char *) nsPtr); -} - - -/* - *---------------------------------------------------------------------- - * - * Tcl_Export -- - * - * Makes all the commands matching a pattern available to later be - * imported from the namespace specified by contextNsPtr (or the - * current namespace if contextNsPtr is NULL). The specified pattern is - * appended onto the namespace's export pattern list, which is - * optionally cleared beforehand. - * - * Results: - * Returns TCL_OK if successful, or TCL_ERROR (along with an error - * message in the interpreter's result) if something goes wrong. - * - * Side effects: - * Appends the export pattern onto the namespace's export list. - * Optionally reset the namespace's export pattern list. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Export(interp, namespacePtr, pattern, resetListFirst) - Tcl_Interp *interp; /* Current interpreter. */ - Tcl_Namespace *namespacePtr; /* Points to the namespace from which - * commands are to be exported. NULL for - * the current namespace. */ - char *pattern; /* String pattern indicating which commands - * to export. This pattern may not include - * any namespace qualifiers; only commands - * in the specified namespace may be - * exported. */ - int resetListFirst; /* If nonzero, resets the namespace's - * export list before appending - * be overwritten by imported commands. - * If 0, return an error if an imported - * cmd conflicts with an existing one. */ -{ -#define INIT_EXPORT_PATTERNS 5 - Namespace *nsPtr, *exportNsPtr, *dummyPtr; - Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - char *simplePattern, *patternCpy; - int neededElems, len, i; - - /* - * If the specified namespace is NULL, use the current namespace. - */ - - if (namespacePtr == NULL) { - nsPtr = (Namespace *) currNsPtr; - } else { - nsPtr = (Namespace *) namespacePtr; - } - - /* - * If resetListFirst is true (nonzero), clear the namespace's export - * pattern list. - */ - - if (resetListFirst) { - if (nsPtr->exportArrayPtr != NULL) { - for (i = 0; i < nsPtr->numExportPatterns; i++) { - ckfree(nsPtr->exportArrayPtr[i]); - } - ckfree((char *) nsPtr->exportArrayPtr); - nsPtr->exportArrayPtr = NULL; - nsPtr->numExportPatterns = 0; - nsPtr->maxExportPatterns = 0; - } - } - - /* - * Check that the pattern doesn't have namespace qualifiers. - */ - - TclGetNamespaceForQualName(interp, pattern, nsPtr, - /*flags*/ TCL_LEAVE_ERR_MSG, &exportNsPtr, &dummyPtr, - &dummyPtr, &simplePattern); - - if ((exportNsPtr != nsPtr) || (strcmp(pattern, simplePattern) != 0)) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "invalid export pattern \"", pattern, - "\": pattern can't specify a namespace", - (char *) NULL); - return TCL_ERROR; - } - - /* - * Make sure there is room in the namespace's pattern array for the - * new pattern. - */ - - neededElems = nsPtr->numExportPatterns + 1; - if (nsPtr->exportArrayPtr == NULL) { - nsPtr->exportArrayPtr = (char **) - ckalloc((unsigned) (INIT_EXPORT_PATTERNS * sizeof(char *))); - nsPtr->numExportPatterns = 0; - nsPtr->maxExportPatterns = INIT_EXPORT_PATTERNS; - } else if (neededElems > nsPtr->maxExportPatterns) { - int numNewElems = 2 * nsPtr->maxExportPatterns; - size_t currBytes = nsPtr->numExportPatterns * sizeof(char *); - size_t newBytes = numNewElems * sizeof(char *); - char **newPtr = (char **) ckalloc((unsigned) newBytes); - - memcpy((VOID *) newPtr, (VOID *) nsPtr->exportArrayPtr, - currBytes); - ckfree((char *) nsPtr->exportArrayPtr); - nsPtr->exportArrayPtr = (char **) newPtr; - nsPtr->maxExportPatterns = numNewElems; - } - - /* - * Add the pattern to the namespace's array of export patterns. - */ - - len = strlen(pattern); - patternCpy = (char *) ckalloc((unsigned) (len + 1)); - strcpy(patternCpy, pattern); - - nsPtr->exportArrayPtr[nsPtr->numExportPatterns] = patternCpy; - nsPtr->numExportPatterns++; - return TCL_OK; -#undef INIT_EXPORT_PATTERNS -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendExportList -- - * - * Appends onto the argument object the list of export patterns for the - * specified namespace. - * - * Results: - * The return value is normally TCL_OK; in this case the object - * referenced by objPtr has each export pattern appended to it. If an - * error occurs, TCL_ERROR is returned and the interpreter's result - * holds an error message. - * - * Side effects: - * If necessary, the object referenced by objPtr is converted into - * a list object. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_AppendExportList(interp, namespacePtr, objPtr) - Tcl_Interp *interp; /* Interpreter used for error reporting. */ - Tcl_Namespace *namespacePtr; /* Points to the namespace whose export - * pattern list is appended onto objPtr. - * NULL for the current namespace. */ - Tcl_Obj *objPtr; /* Points to the Tcl object onto which the - * export pattern list is appended. */ -{ - Namespace *nsPtr; - int i, result; - - /* - * If the specified namespace is NULL, use the current namespace. - */ - - if (namespacePtr == NULL) { - nsPtr = (Namespace *) (Namespace *) Tcl_GetCurrentNamespace(interp); - } else { - nsPtr = (Namespace *) namespacePtr; - } - - /* - * Append the export pattern list onto objPtr. - */ - - for (i = 0; i < nsPtr->numExportPatterns; i++) { - result = Tcl_ListObjAppendElement(interp, objPtr, - Tcl_NewStringObj(nsPtr->exportArrayPtr[i], -1)); - if (result != TCL_OK) { - return result; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Import -- - * - * Imports all of the commands matching a pattern into the namespace - * specified by contextNsPtr (or the current namespace if contextNsPtr - * is NULL). This is done by creating a new command (the "imported - * command") that points to the real command in its original namespace. - * - * If matching commands are on the autoload path but haven't been - * loaded yet, this command forces them to be loaded, then creates - * the links to them. - * - * Results: - * Returns TCL_OK if successful, or TCL_ERROR (along with an error - * message in the interpreter's result) if something goes wrong. - * - * Side effects: - * Creates new commands in the importing namespace. These indirect - * calls back to the real command and are deleted if the real commands - * are deleted. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Import(interp, namespacePtr, pattern, allowOverwrite) - Tcl_Interp *interp; /* Current interpreter. */ - Tcl_Namespace *namespacePtr; /* Points to the namespace into which the - * commands are to be imported. NULL for - * the current namespace. */ - char *pattern; /* String pattern indicating which commands - * to import. This pattern should be - * qualified by the name of the namespace - * from which to import the command(s). */ - int allowOverwrite; /* If nonzero, allow existing commands to - * be overwritten by imported commands. - * If 0, return an error if an imported - * cmd conflicts with an existing one. */ -{ - Interp *iPtr = (Interp *) interp; - Namespace *nsPtr, *importNsPtr, *dummyPtr; - Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - char *simplePattern, *cmdName; - register Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - Command *cmdPtr, *realCmdPtr; - ImportRef *refPtr; - Tcl_Command autoCmd, importedCmd; - ImportedCmdData *dataPtr; - int wasExported, i, result; - - /* - * If the specified namespace is NULL, use the current namespace. - */ - - if (namespacePtr == NULL) { - nsPtr = (Namespace *) currNsPtr; - } else { - nsPtr = (Namespace *) namespacePtr; - } - - /* - * First, invoke the "auto_import" command with the pattern - * being imported. This command is part of the Tcl library. - * It looks for imported commands in autoloaded libraries and - * loads them in. That way, they will be found when we try - * to create links below. - */ - - autoCmd = Tcl_FindCommand(interp, "auto_import", - (Tcl_Namespace *) NULL, /*flags*/ TCL_GLOBAL_ONLY); - - if (autoCmd != NULL) { - Tcl_Obj *objv[2]; - - objv[0] = Tcl_NewStringObj("auto_import", -1); - Tcl_IncrRefCount(objv[0]); - objv[1] = Tcl_NewStringObj(pattern, -1); - Tcl_IncrRefCount(objv[1]); - - cmdPtr = (Command *) autoCmd; - result = (*cmdPtr->objProc)(cmdPtr->objClientData, interp, - 2, objv); - - Tcl_DecrRefCount(objv[0]); - Tcl_DecrRefCount(objv[1]); - - if (result != TCL_OK) { - return TCL_ERROR; - } - Tcl_ResetResult(interp); - } - - /* - * From the pattern, find the namespace from which we are importing - * and get the simple pattern (no namespace qualifiers or ::'s) at - * the end. - */ - - if (strlen(pattern) == 0) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), - "empty import pattern", -1); - return TCL_ERROR; - } - TclGetNamespaceForQualName(interp, pattern, nsPtr, - /*flags*/ TCL_LEAVE_ERR_MSG, &importNsPtr, &dummyPtr, - &dummyPtr, &simplePattern); - - if (importNsPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown namespace in import pattern \"", - pattern, "\"", (char *) NULL); - return TCL_ERROR; - } - if (importNsPtr == nsPtr) { - if (pattern == simplePattern) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "no namespace specified in import pattern \"", pattern, - "\"", (char *) NULL); - } else { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "import pattern \"", pattern, - "\" tries to import from namespace \"", - importNsPtr->name, "\" into itself", (char *) NULL); - } - return TCL_ERROR; - } - - /* - * Scan through the command table in the source namespace and look for - * exported commands that match the string pattern. Create an "imported - * command" in the current namespace for each imported command; these - * commands redirect their invocations to the "real" command. - */ - - for (hPtr = Tcl_FirstHashEntry(&importNsPtr->cmdTable, &search); - (hPtr != NULL); - hPtr = Tcl_NextHashEntry(&search)) { - cmdName = Tcl_GetHashKey(&importNsPtr->cmdTable, hPtr); - if (Tcl_StringMatch(cmdName, simplePattern)) { - /* - * The command cmdName in the source namespace matches the - * pattern. Check whether it was exported. If it wasn't, - * we ignore it. - */ - - wasExported = 0; - for (i = 0; i < importNsPtr->numExportPatterns; i++) { - if (Tcl_StringMatch(cmdName, - importNsPtr->exportArrayPtr[i])) { - wasExported = 1; - break; - } - } - if (!wasExported) { - continue; - } - - /* - * Unless there is a name clash, create an imported command - * in the current namespace that refers to cmdPtr. - */ - - if ((Tcl_FindHashEntry(&nsPtr->cmdTable, cmdName) == NULL) - || allowOverwrite) { - /* - * Create the imported command and its client data. - * To create the new command in the current namespace, - * generate a fully qualified name for it. - */ - - Tcl_DString ds; - - Tcl_DStringInit(&ds); - Tcl_DStringAppend(&ds, nsPtr->fullName, -1); - if (nsPtr != iPtr->globalNsPtr) { - Tcl_DStringAppend(&ds, "::", 2); - } - Tcl_DStringAppend(&ds, cmdName, -1); - - /* - * Check whether creating the new imported command in the - * current namespace would create a cycle of imported->real - * command references that also would destroy an existing - * "real" command already in the current namespace. - */ - - cmdPtr = (Command *) Tcl_GetHashValue(hPtr); - if (cmdPtr->deleteProc == DeleteImportedCmd) { - realCmdPtr = (Command *) TclGetOriginalCommand( - (Tcl_Command) cmdPtr); - if ((realCmdPtr != NULL) - && (realCmdPtr->nsPtr == currNsPtr) - && (Tcl_FindHashEntry(&currNsPtr->cmdTable, - cmdName) != NULL)) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "import pattern \"", pattern, - "\" would create a loop containing command \"", - Tcl_DStringValue(&ds), "\"", (char *) NULL); - return TCL_ERROR; - } - } - - dataPtr = (ImportedCmdData *) - ckalloc(sizeof(ImportedCmdData)); - importedCmd = Tcl_CreateObjCommand(interp, - Tcl_DStringValue(&ds), InvokeImportedCmd, - (ClientData) dataPtr, DeleteImportedCmd); - dataPtr->realCmdPtr = cmdPtr; - dataPtr->selfPtr = (Command *) importedCmd; - - /* - * Create an ImportRef structure describing this new import - * command and add it to the import ref list in the "real" - * command. - */ - - refPtr = (ImportRef *) ckalloc(sizeof(ImportRef)); - refPtr->importedCmdPtr = (Command *) importedCmd; - refPtr->nextPtr = cmdPtr->importRefPtr; - cmdPtr->importRefPtr = refPtr; - } else { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't import command \"", cmdName, - "\": already exists", (char *) NULL); - return TCL_ERROR; - } - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ForgetImport -- - * - * Deletes previously imported commands. Given a pattern that may - * include the name of an exporting namespace, this procedure first - * finds all matching exported commands. It then looks in the namespace - * specified by namespacePtr for any corresponding previously imported - * commands, which it deletes. If namespacePtr is NULL, commands are - * deleted from the current namespace. - * - * Results: - * Returns TCL_OK if successful. If there is an error, returns - * TCL_ERROR and puts an error message in the interpreter's result - * object. - * - * Side effects: - * May delete commands. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ForgetImport(interp, namespacePtr, pattern) - Tcl_Interp *interp; /* Current interpreter. */ - Tcl_Namespace *namespacePtr; /* Points to the namespace from which - * previously imported commands should be - * removed. NULL for current namespace. */ - char *pattern; /* String pattern indicating which imported - * commands to remove. This pattern should - * be qualified by the name of the - * namespace from which the command(s) were - * imported. */ -{ - Namespace *nsPtr, *importNsPtr, *dummyPtr, *actualCtxPtr; - char *simplePattern, *cmdName; - register Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - Command *cmdPtr; - - /* - * If the specified namespace is NULL, use the current namespace. - */ - - if (namespacePtr == NULL) { - nsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - } else { - nsPtr = (Namespace *) namespacePtr; - } - - /* - * From the pattern, find the namespace from which we are importing - * and get the simple pattern (no namespace qualifiers or ::'s) at - * the end. - */ - - TclGetNamespaceForQualName(interp, pattern, nsPtr, - /*flags*/ TCL_LEAVE_ERR_MSG, &importNsPtr, &dummyPtr, - &actualCtxPtr, &simplePattern); - - if (importNsPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown namespace in namespace forget pattern \"", - pattern, "\"", (char *) NULL); - return TCL_ERROR; - } - - /* - * Scan through the command table in the source namespace and look for - * exported commands that match the string pattern. If the current - * namespace has an imported command that refers to one of those real - * commands, delete it. - */ - - for (hPtr = Tcl_FirstHashEntry(&importNsPtr->cmdTable, &search); - (hPtr != NULL); - hPtr = Tcl_NextHashEntry(&search)) { - cmdName = Tcl_GetHashKey(&importNsPtr->cmdTable, hPtr); - if (Tcl_StringMatch(cmdName, simplePattern)) { - hPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, cmdName); - if (hPtr != NULL) { /* cmd of same name in current namespace */ - cmdPtr = (Command *) Tcl_GetHashValue(hPtr); - if (cmdPtr->deleteProc == DeleteImportedCmd) { - Tcl_DeleteCommandFromToken(interp, (Tcl_Command) cmdPtr); - } - } - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclGetOriginalCommand -- - * - * An imported command is created in an namespace when it imports a - * "real" command from another namespace. If the specified command is a - * imported command, this procedure returns the original command it - * refers to. - * - * Results: - * If the command was imported into a sequence of namespaces a, b,...,n - * where each successive namespace just imports the command from the - * previous namespace, this procedure returns the Tcl_Command token in - * the first namespace, a. Otherwise, if the specified command is not - * an imported command, the procedure returns NULL. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Command -TclGetOriginalCommand(command) - Tcl_Command command; /* The command for which the original - * command should be returned. */ -{ - register Command *cmdPtr = (Command *) command; - ImportedCmdData *dataPtr; - - if (cmdPtr->deleteProc != DeleteImportedCmd) { - return (Tcl_Command) NULL; - } - - while (cmdPtr->deleteProc == DeleteImportedCmd) { - dataPtr = (ImportedCmdData *) cmdPtr->objClientData; - cmdPtr = dataPtr->realCmdPtr; - } - return (Tcl_Command) cmdPtr; -} - -/* - *---------------------------------------------------------------------- - * - * InvokeImportedCmd -- - * - * Invoked by Tcl whenever the user calls an imported command that - * was created by Tcl_Import. Finds the "real" command (in another - * namespace), and passes control to it. - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns a result in the interpreter's result object. If anything - * goes wrong, the result object is set to an error message. - * - *---------------------------------------------------------------------- - */ - -static int -InvokeImportedCmd(clientData, interp, objc, objv) - ClientData clientData; /* Points to the imported command's - * ImportedCmdData structure. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - register ImportedCmdData *dataPtr = (ImportedCmdData *) clientData; - register Command *realCmdPtr = dataPtr->realCmdPtr; - - return (*realCmdPtr->objProc)(realCmdPtr->objClientData, interp, - objc, objv); -} - -/* - *---------------------------------------------------------------------- - * - * DeleteImportedCmd -- - * - * Invoked by Tcl whenever an imported command is deleted. The "real" - * command keeps a list of all the imported commands that refer to it, - * so those imported commands can be deleted when the real command is - * deleted. This procedure removes the imported command reference from - * the real command's list, and frees up the memory associated with - * the imported command. - * - * Results: - * None. - * - * Side effects: - * Removes the imported command from the real command's import list. - * - *---------------------------------------------------------------------- - */ - -static void -DeleteImportedCmd(clientData) - ClientData clientData; /* Points to the imported command's - * ImportedCmdData structure. */ -{ - ImportedCmdData *dataPtr = (ImportedCmdData *) clientData; - Command *realCmdPtr = dataPtr->realCmdPtr; - Command *selfPtr = dataPtr->selfPtr; - register ImportRef *refPtr, *prevPtr; - - prevPtr = NULL; - for (refPtr = realCmdPtr->importRefPtr; refPtr != NULL; - refPtr = refPtr->nextPtr) { - if (refPtr->importedCmdPtr == selfPtr) { - /* - * Remove *refPtr from real command's list of imported commands - * that refer to it. - */ - - if (prevPtr == NULL) { /* refPtr is first in list */ - realCmdPtr->importRefPtr = refPtr->nextPtr; - } else { - prevPtr->nextPtr = refPtr->nextPtr; - } - ckfree((char *) refPtr); - ckfree((char *) dataPtr); - return; - } - prevPtr = refPtr; - } - - panic("DeleteImportedCmd: did not find cmd in real cmd's list of import references"); -} - -/* - *---------------------------------------------------------------------- - * - * TclGetNamespaceForQualName -- - * - * Given a qualified name specifying a command, variable, or namespace, - * and a namespace in which to resolve the name, this procedure returns - * a pointer to the namespace that contains the item. A qualified name - * consists of the "simple" name of an item qualified by the names of - * an arbitrary number of containing namespace separated by "::"s. If - * the qualified name starts with "::", it is interpreted absolutely - * from the global namespace. Otherwise, it is interpreted relative to - * the namespace specified by cxtNsPtr if it is non-NULL. If cxtNsPtr - * is NULL, the name is interpreted relative to the current namespace. - * - * A relative name like "foo::bar::x" can be found starting in either - * the current namespace or in the global namespace. So each search - * usually follows two tracks, and two possible namespaces are - * returned. If the procedure sets either *nsPtrPtr or *altNsPtrPtr to - * NULL, then that path failed. - * - * If "flags" contains TCL_GLOBAL_ONLY, the relative qualified name is - * sought only in the global :: namespace. The alternate search - * (also) starting from the global namespace is ignored and - * *altNsPtrPtr is set NULL. - * - * If "flags" contains TCL_NAMESPACE_ONLY, the relative qualified - * name is sought only in the namespace specified by cxtNsPtr. The - * alternate search starting from the global namespace is ignored and - * *altNsPtrPtr is set NULL. If both TCL_GLOBAL_ONLY and - * TCL_NAMESPACE_ONLY are specified, TCL_GLOBAL_ONLY is ignored and - * the search starts from the namespace specified by cxtNsPtr. - * - * If "flags" contains CREATE_NS_IF_UNKNOWN, all namespace - * components of the qualified name that cannot be found are - * automatically created within their specified parent. This makes sure - * that functions like Tcl_CreateCommand always succeed. There is no - * alternate search path, so *altNsPtrPtr is set NULL. - * - * If "flags" contains FIND_ONLY_NS, the qualified name is treated as a - * reference to a namespace, and the entire qualified name is - * followed. If the name is relative, the namespace is looked up only - * in the current namespace. A pointer to the namespace is stored in - * *nsPtrPtr and NULL is stored in *simpleNamePtr. Otherwise, if - * FIND_ONLY_NS is not specified, only the leading components are - * treated as namespace names, and a pointer to the simple name of the - * final component is stored in *simpleNamePtr. - * - * Results: - * It sets *nsPtrPtr and *altNsPtrPtr to point to the two possible - * namespaces which represent the last (containing) namespace in the - * qualified name. If the procedure sets either *nsPtrPtr or *altNsPtrPtr - * to NULL, then the search along that path failed. The procedure also - * stores a pointer to the simple name of the final component in - * *simpleNamePtr. If the qualified name is "::" or was treated as a - * namespace reference (FIND_ONLY_NS), the procedure stores a pointer - * to the namespace in *nsPtrPtr, NULL in *altNsPtrPtr, and sets - * *simpleNamePtr to point to an empty string. - * - * If there is an error, this procedure returns TCL_ERROR. If "flags" - * contains TCL_LEAVE_ERR_MSG, an error message is returned in the - * interpreter's result object. Otherwise, the interpreter's result - * object is left unchanged. - * - * *actualCxtPtrPtr is set to the actual context namespace. It is - * set to the input context namespace pointer in cxtNsPtr. If cxtNsPtr - * is NULL, it is set to the current namespace context. - * - * For backwards compatibility with the TclPro byte code loader, - * this function always returns TCL_OK. - * - * Side effects: - * If "flags" contains CREATE_NS_IF_UNKNOWN, new namespaces may be - * created. - * - *---------------------------------------------------------------------- - */ - -int -TclGetNamespaceForQualName(interp, qualName, cxtNsPtr, flags, - nsPtrPtr, altNsPtrPtr, actualCxtPtrPtr, simpleNamePtr) - Tcl_Interp *interp; /* Interpreter in which to find the - * namespace containing qualName. */ - register char *qualName; /* A namespace-qualified name of an - * command, variable, or namespace. */ - Namespace *cxtNsPtr; /* The namespace in which to start the - * search for qualName's namespace. If NULL - * start from the current namespace. - * Ignored if TCL_GLOBAL_ONLY or - * TCL_NAMESPACE_ONLY are set. */ - int flags; /* Flags controlling the search: an OR'd - * combination of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, - * CREATE_NS_IF_UNKNOWN, and - * FIND_ONLY_NS. */ - Namespace **nsPtrPtr; /* Address where procedure stores a pointer - * to containing namespace if qualName is - * found starting from *cxtNsPtr or, if - * TCL_GLOBAL_ONLY is set, if qualName is - * found in the global :: namespace. NULL - * is stored otherwise. */ - Namespace **altNsPtrPtr; /* Address where procedure stores a pointer - * to containing namespace if qualName is - * found starting from the global :: - * namespace. NULL is stored if qualName - * isn't found starting from :: or if the - * TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY, - * CREATE_NS_IF_UNKNOWN, FIND_ONLY_NS flag - * is set. */ - Namespace **actualCxtPtrPtr; /* Address where procedure stores a pointer - * to the actual namespace from which the - * search started. This is either cxtNsPtr, - * the :: namespace if TCL_GLOBAL_ONLY was - * specified, or the current namespace if - * cxtNsPtr was NULL. */ - char **simpleNamePtr; /* Address where procedure stores the - * simple name at end of the qualName, or - * NULL if qualName is "::" or the flag - * FIND_ONLY_NS was specified. */ -{ - Interp *iPtr = (Interp *) interp; - Namespace *nsPtr = cxtNsPtr; - Namespace *altNsPtr; - Namespace *globalNsPtr = iPtr->globalNsPtr; - register char *start, *end; - char *nsName; - Tcl_HashEntry *entryPtr; - Tcl_DString buffer; - int len; - - /* - * Determine the context namespace nsPtr in which to start the primary - * search. If TCL_NAMESPACE_ONLY or FIND_ONLY_NS was specified, search - * from the current namespace. If the qualName name starts with a "::" - * or TCL_GLOBAL_ONLY was specified, search from the global - * namespace. Otherwise, use the given namespace given in cxtNsPtr, or - * if that is NULL, use the current namespace context. Note that we - * always treat two or more adjacent ":"s as a namespace separator. - */ - - if (flags & (TCL_NAMESPACE_ONLY | FIND_ONLY_NS)) { - nsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - } else if (flags & TCL_GLOBAL_ONLY) { - nsPtr = globalNsPtr; - } else if (nsPtr == NULL) { - if (iPtr->varFramePtr != NULL) { - nsPtr = iPtr->varFramePtr->nsPtr; - } else { - nsPtr = iPtr->globalNsPtr; - } - } - - start = qualName; /* pts to start of qualifying namespace */ - if ((*qualName == ':') && (*(qualName+1) == ':')) { - start = qualName+2; /* skip over the initial :: */ - while (*start == ':') { - start++; /* skip over a subsequent : */ - } - nsPtr = globalNsPtr; - if (*start == '\0') { /* qualName is just two or more ":"s */ - *nsPtrPtr = globalNsPtr; - *altNsPtrPtr = NULL; - *actualCxtPtrPtr = globalNsPtr; - *simpleNamePtr = start; /* points to empty string */ - return TCL_OK; - } - } - *actualCxtPtrPtr = nsPtr; - - /* - * Start an alternate search path starting with the global namespace. - * However, if the starting context is the global namespace, or if the - * flag is set to search only the namespace *cxtNsPtr, ignore the - * alternate search path. - */ - - altNsPtr = globalNsPtr; - if ((nsPtr == globalNsPtr) - || (flags & (TCL_NAMESPACE_ONLY | FIND_ONLY_NS))) { - altNsPtr = NULL; - } - - /* - * Loop to resolve each namespace qualifier in qualName. - */ - - Tcl_DStringInit(&buffer); - end = start; - while (*start != '\0') { - /* - * Find the next namespace qualifier (i.e., a name ending in "::") - * or the end of the qualified name (i.e., a name ending in "\0"). - * Set len to the number of characters, starting from start, - * in the name; set end to point after the "::"s or at the "\0". - */ - - len = 0; - for (end = start; *end != '\0'; end++) { - if ((*end == ':') && (*(end+1) == ':')) { - end += 2; /* skip over the initial :: */ - while (*end == ':') { - end++; /* skip over the subsequent : */ - } - break; /* exit for loop; end is after ::'s */ - } - len++; - } - - if ((*end == '\0') - && !((end-start >= 2) && (*(end-1) == ':') && (*(end-2) == ':'))) { - /* - * qualName ended with a simple name at start. If FIND_ONLY_NS - * was specified, look this up as a namespace. Otherwise, - * start is the name of a cmd or var and we are done. - */ - - if (flags & FIND_ONLY_NS) { - nsName = start; - } else { - *nsPtrPtr = nsPtr; - *altNsPtrPtr = altNsPtr; - *simpleNamePtr = start; - Tcl_DStringFree(&buffer); - return TCL_OK; - } - } else { - /* - * start points to the beginning of a namespace qualifier ending - * in "::". end points to the start of a name in that namespace - * that might be empty. Copy the namespace qualifier to a - * buffer so it can be null terminated. We can't modify the - * incoming qualName since it may be a string constant. - */ - - Tcl_DStringSetLength(&buffer, 0); - Tcl_DStringAppend(&buffer, start, len); - nsName = Tcl_DStringValue(&buffer); - } - - /* - * Look up the namespace qualifier nsName in the current namespace - * context. If it isn't found but CREATE_NS_IF_UNKNOWN is set, - * create that qualifying namespace. This is needed for procedures - * like Tcl_CreateCommand that cannot fail. - */ - - if (nsPtr != NULL) { - entryPtr = Tcl_FindHashEntry(&nsPtr->childTable, nsName); - if (entryPtr != NULL) { - nsPtr = (Namespace *) Tcl_GetHashValue(entryPtr); - } else if (flags & CREATE_NS_IF_UNKNOWN) { - Tcl_CallFrame frame; - - (void) Tcl_PushCallFrame(interp, &frame, - (Tcl_Namespace *) nsPtr, /*isProcCallFrame*/ 0); - - nsPtr = (Namespace *) Tcl_CreateNamespace(interp, nsName, - (ClientData) NULL, (Tcl_NamespaceDeleteProc *) NULL); - Tcl_PopCallFrame(interp); - - if (nsPtr == NULL) { - panic("Could not create namespace '%s'", nsName); - } - } else { /* namespace not found and wasn't created */ - nsPtr = NULL; - } - } - - /* - * Look up the namespace qualifier in the alternate search path too. - */ - - if (altNsPtr != NULL) { - entryPtr = Tcl_FindHashEntry(&altNsPtr->childTable, nsName); - if (entryPtr != NULL) { - altNsPtr = (Namespace *) Tcl_GetHashValue(entryPtr); - } else { - altNsPtr = NULL; - } - } - - /* - * If both search paths have failed, return NULL results. - */ - - if ((nsPtr == NULL) && (altNsPtr == NULL)) { - *nsPtrPtr = NULL; - *altNsPtrPtr = NULL; - *simpleNamePtr = NULL; - Tcl_DStringFree(&buffer); - return TCL_OK; - } - - start = end; - } - - /* - * We ignore trailing "::"s in a namespace name, but in a command or - * variable name, trailing "::"s refer to the cmd or var named {}. - */ - - if ((flags & FIND_ONLY_NS) - || ((end > start ) && (*(end-1) != ':'))) { - *simpleNamePtr = NULL; /* found namespace name */ - } else { - *simpleNamePtr = end; /* found cmd/var: points to empty string */ - } - - /* - * As a special case, if we are looking for a namespace and qualName - * is "" and the current active namespace (nsPtr) is not the global - * namespace, return NULL (no namespace was found). This is because - * namespaces can not have empty names except for the global namespace. - */ - - if ((flags & FIND_ONLY_NS) && (*qualName == '\0') - && (nsPtr != globalNsPtr)) { - nsPtr = NULL; - } - - *nsPtrPtr = nsPtr; - *altNsPtrPtr = altNsPtr; - Tcl_DStringFree(&buffer); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FindNamespace -- - * - * Searches for a namespace. - * - * Results: - * Returns a pointer to the namespace if it is found. Otherwise, - * returns NULL and leaves an error message in the interpreter's - * result object if "flags" contains TCL_LEAVE_ERR_MSG. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Namespace * -Tcl_FindNamespace(interp, name, contextNsPtr, flags) - Tcl_Interp *interp; /* The interpreter in which to find the - * namespace. */ - char *name; /* Namespace name. If it starts with "::", - * will be looked up in global namespace. - * Else, looked up first in contextNsPtr - * (current namespace if contextNsPtr is - * NULL), then in global namespace. */ - Tcl_Namespace *contextNsPtr; /* Ignored if TCL_GLOBAL_ONLY flag is set - * or if the name starts with "::". - * Otherwise, points to namespace in which - * to resolve name; if NULL, look up name - * in the current namespace. */ - register int flags; /* Flags controlling namespace lookup: an - * OR'd combination of TCL_GLOBAL_ONLY and - * TCL_LEAVE_ERR_MSG flags. */ -{ - Namespace *nsPtr, *dummy1Ptr, *dummy2Ptr; - char *dummy; - - /* - * Find the namespace(s) that contain the specified namespace name. - * Add the FIND_ONLY_NS flag to resolve the name all the way down - * to its last component, a namespace. - */ - - TclGetNamespaceForQualName(interp, name, (Namespace *) contextNsPtr, - (flags | FIND_ONLY_NS), &nsPtr, &dummy1Ptr, &dummy2Ptr, &dummy); - - if (nsPtr != NULL) { - return (Tcl_Namespace *) nsPtr; - } else if (flags & TCL_LEAVE_ERR_MSG) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown namespace \"", name, "\"", (char *) NULL); - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FindCommand -- - * - * Searches for a command. - * - * Results: - * Returns a token for the command if it is found. Otherwise, if it - * can't be found or there is an error, returns NULL and leaves an - * error message in the interpreter's result object if "flags" - * contains TCL_LEAVE_ERR_MSG. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Command -Tcl_FindCommand(interp, name, contextNsPtr, flags) - Tcl_Interp *interp; /* The interpreter in which to find the - * command and to report errors. */ - char *name; /* Command's name. If it starts with "::", - * will be looked up in global namespace. - * Else, looked up first in contextNsPtr - * (current namespace if contextNsPtr is - * NULL), then in global namespace. */ - Tcl_Namespace *contextNsPtr; /* Ignored if TCL_GLOBAL_ONLY flag set. - * Otherwise, points to namespace in which - * to resolve name. If NULL, look up name - * in the current namespace. */ - int flags; /* An OR'd combination of flags: - * TCL_GLOBAL_ONLY (look up name only in - * global namespace), TCL_NAMESPACE_ONLY - * (look up only in contextNsPtr, or the - * current namespace if contextNsPtr is - * NULL), and TCL_LEAVE_ERR_MSG. If both - * TCL_GLOBAL_ONLY and TCL_NAMESPACE_ONLY - * are given, TCL_GLOBAL_ONLY is - * ignored. */ -{ - Interp *iPtr = (Interp*)interp; - - ResolverScheme *resPtr; - Namespace *nsPtr[2], *cxtNsPtr; - char *simpleName; - register Tcl_HashEntry *entryPtr; - register Command *cmdPtr; - register int search; - int result; - Tcl_Command cmd; - - /* - * If this namespace has a command resolver, then give it first - * crack at the command resolution. If the interpreter has any - * command resolvers, consult them next. The command resolver - * procedures may return a Tcl_Command value, they may signal - * to continue onward, or they may signal an error. - */ - if ((flags & TCL_GLOBAL_ONLY) != 0) { - cxtNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); - } - else if (contextNsPtr != NULL) { - cxtNsPtr = (Namespace *) contextNsPtr; - } - else { - cxtNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - } - - if (cxtNsPtr->cmdResProc != NULL || iPtr->resolverPtr != NULL) { - resPtr = iPtr->resolverPtr; - - if (cxtNsPtr->cmdResProc) { - result = (*cxtNsPtr->cmdResProc)(interp, name, - (Tcl_Namespace *) cxtNsPtr, flags, &cmd); - } else { - result = TCL_CONTINUE; - } - - while (result == TCL_CONTINUE && resPtr) { - if (resPtr->cmdResProc) { - result = (*resPtr->cmdResProc)(interp, name, - (Tcl_Namespace *) cxtNsPtr, flags, &cmd); - } - resPtr = resPtr->nextPtr; - } - - if (result == TCL_OK) { - return cmd; - } - else if (result != TCL_CONTINUE) { - return (Tcl_Command) NULL; - } - } - - /* - * Find the namespace(s) that contain the command. - */ - - TclGetNamespaceForQualName(interp, name, (Namespace *) contextNsPtr, - flags, &nsPtr[0], &nsPtr[1], &cxtNsPtr, &simpleName); - - /* - * Look for the command in the command table of its namespace. - * Be sure to check both possible search paths: from the specified - * namespace context and from the global namespace. - */ - - cmdPtr = NULL; - for (search = 0; (search < 2) && (cmdPtr == NULL); search++) { - if ((nsPtr[search] != NULL) && (simpleName != NULL)) { - entryPtr = Tcl_FindHashEntry(&nsPtr[search]->cmdTable, - simpleName); - if (entryPtr != NULL) { - cmdPtr = (Command *) Tcl_GetHashValue(entryPtr); - } - } - } - if (cmdPtr != NULL) { - return (Tcl_Command) cmdPtr; - } else if (flags & TCL_LEAVE_ERR_MSG) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown command \"", name, "\"", (char *) NULL); - } - - return (Tcl_Command) NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FindNamespaceVar -- - * - * Searches for a namespace variable, a variable not local to a - * procedure. The variable can be either a scalar or an array, but - * may not be an element of an array. - * - * Results: - * Returns a token for the variable if it is found. Otherwise, if it - * can't be found or there is an error, returns NULL and leaves an - * error message in the interpreter's result object if "flags" - * contains TCL_LEAVE_ERR_MSG. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Var -Tcl_FindNamespaceVar(interp, name, contextNsPtr, flags) - Tcl_Interp *interp; /* The interpreter in which to find the - * variable. */ - char *name; /* Variable's name. If it starts with "::", - * will be looked up in global namespace. - * Else, looked up first in contextNsPtr - * (current namespace if contextNsPtr is - * NULL), then in global namespace. */ - Tcl_Namespace *contextNsPtr; /* Ignored if TCL_GLOBAL_ONLY flag set. - * Otherwise, points to namespace in which - * to resolve name. If NULL, look up name - * in the current namespace. */ - int flags; /* An OR'd combination of flags: - * TCL_GLOBAL_ONLY (look up name only in - * global namespace), TCL_NAMESPACE_ONLY - * (look up only in contextNsPtr, or the - * current namespace if contextNsPtr is - * NULL), and TCL_LEAVE_ERR_MSG. If both - * TCL_GLOBAL_ONLY and TCL_NAMESPACE_ONLY - * are given, TCL_GLOBAL_ONLY is - * ignored. */ -{ - Interp *iPtr = (Interp*)interp; - ResolverScheme *resPtr; - Namespace *nsPtr[2], *cxtNsPtr; - char *simpleName; - Tcl_HashEntry *entryPtr; - Var *varPtr; - register int search; - int result; - Tcl_Var var; - - /* - * If this namespace has a variable resolver, then give it first - * crack at the variable resolution. It may return a Tcl_Var - * value, it may signal to continue onward, or it may signal - * an error. - */ - if ((flags & TCL_GLOBAL_ONLY) != 0) { - cxtNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); - } - else if (contextNsPtr != NULL) { - cxtNsPtr = (Namespace *) contextNsPtr; - } - else { - cxtNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - } - - if (cxtNsPtr->varResProc != NULL || iPtr->resolverPtr != NULL) { - resPtr = iPtr->resolverPtr; - - if (cxtNsPtr->varResProc) { - result = (*cxtNsPtr->varResProc)(interp, name, - (Tcl_Namespace *) cxtNsPtr, flags, &var); - } else { - result = TCL_CONTINUE; - } - - while (result == TCL_CONTINUE && resPtr) { - if (resPtr->varResProc) { - result = (*resPtr->varResProc)(interp, name, - (Tcl_Namespace *) cxtNsPtr, flags, &var); - } - resPtr = resPtr->nextPtr; - } - - if (result == TCL_OK) { - return var; - } - else if (result != TCL_CONTINUE) { - return (Tcl_Var) NULL; - } - } - - /* - * Find the namespace(s) that contain the variable. - */ - - TclGetNamespaceForQualName(interp, name, (Namespace *) contextNsPtr, - flags, &nsPtr[0], &nsPtr[1], &cxtNsPtr, &simpleName); - - /* - * Look for the variable in the variable table of its namespace. - * Be sure to check both possible search paths: from the specified - * namespace context and from the global namespace. - */ - - varPtr = NULL; - for (search = 0; (search < 2) && (varPtr == NULL); search++) { - if ((nsPtr[search] != NULL) && (simpleName != NULL)) { - entryPtr = Tcl_FindHashEntry(&nsPtr[search]->varTable, - simpleName); - if (entryPtr != NULL) { - varPtr = (Var *) Tcl_GetHashValue(entryPtr); - } - } - } - if (varPtr != NULL) { - return (Tcl_Var) varPtr; - } else if (flags & TCL_LEAVE_ERR_MSG) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown variable \"", name, "\"", (char *) NULL); - } - return (Tcl_Var) NULL; -} - -/* - *---------------------------------------------------------------------- - * - * TclResetShadowedCmdRefs -- - * - * Called when a command is added to a namespace to check for existing - * command references that the new command may invalidate. Consider the - * following cases that could happen when you add a command "foo" to a - * namespace "b": - * 1. It could shadow a command named "foo" at the global scope. - * If it does, all command references in the namespace "b" are - * suspect. - * 2. Suppose the namespace "b" resides in a namespace "a". - * Then to "a" the new command "b::foo" could shadow another - * command "b::foo" in the global namespace. If so, then all - * command references in "a" are suspect. - * The same checks are applied to all parent namespaces, until we - * reach the global :: namespace. - * - * Results: - * None. - * - * Side effects: - * If the new command shadows an existing command, the cmdRefEpoch - * counter is incremented in each namespace that sees the shadow. - * This invalidates all command references that were previously cached - * in that namespace. The next time the commands are used, they are - * resolved from scratch. - * - *---------------------------------------------------------------------- - */ - -void -TclResetShadowedCmdRefs(interp, newCmdPtr) - Tcl_Interp *interp; /* Interpreter containing the new command. */ - Command *newCmdPtr; /* Points to the new command. */ -{ - char *cmdName; - Tcl_HashEntry *hPtr; - register Namespace *nsPtr; - Namespace *trailNsPtr, *shadowNsPtr; - Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); - int found, i; - - /* - * This procedure generates an array used to hold the trail list. This - * starts out with stack-allocated space but uses dynamically-allocated - * storage if needed. - */ - - Namespace *(trailStorage[NUM_TRAIL_ELEMS]); - Namespace **trailPtr = trailStorage; - int trailFront = -1; - int trailSize = NUM_TRAIL_ELEMS; - - /* - * Start at the namespace containing the new command, and work up - * through the list of parents. Stop just before the global namespace, - * since the global namespace can't "shadow" its own entries. - * - * The namespace "trail" list we build consists of the names of each - * namespace that encloses the new command, in order from outermost to - * innermost: for example, "a" then "b". Each iteration of this loop - * eventually extends the trail upwards by one namespace, nsPtr. We use - * this trail list to see if nsPtr (e.g. "a" in 2. above) could have - * now-invalid cached command references. This will happen if nsPtr - * (e.g. "a") contains a sequence of child namespaces (e.g. "b") - * such that there is a identically-named sequence of child namespaces - * starting from :: (e.g. "::b") whose tail namespace contains a command - * also named cmdName. - */ - - cmdName = Tcl_GetHashKey(newCmdPtr->hPtr->tablePtr, newCmdPtr->hPtr); - for (nsPtr = newCmdPtr->nsPtr; - (nsPtr != NULL) && (nsPtr != globalNsPtr); - nsPtr = nsPtr->parentPtr) { - /* - * Find the maximal sequence of child namespaces contained in nsPtr - * such that there is a identically-named sequence of child - * namespaces starting from ::. shadowNsPtr will be the tail of this - * sequence, or the deepest namespace under :: that might contain a - * command now shadowed by cmdName. We check below if shadowNsPtr - * actually contains a command cmdName. - */ - - found = 1; - shadowNsPtr = globalNsPtr; - - for (i = trailFront; i >= 0; i--) { - trailNsPtr = trailPtr[i]; - hPtr = Tcl_FindHashEntry(&shadowNsPtr->childTable, - trailNsPtr->name); - if (hPtr != NULL) { - shadowNsPtr = (Namespace *) Tcl_GetHashValue(hPtr); - } else { - found = 0; - break; - } - } - - /* - * If shadowNsPtr contains a command named cmdName, we invalidate - * all of the command refs cached in nsPtr. As a boundary case, - * shadowNsPtr is initially :: and we check for case 1. above. - */ - - if (found) { - hPtr = Tcl_FindHashEntry(&shadowNsPtr->cmdTable, cmdName); - if (hPtr != NULL) { - nsPtr->cmdRefEpoch++; - } - } - - /* - * Insert nsPtr at the front of the trail list: i.e., at the end - * of the trailPtr array. - */ - - trailFront++; - if (trailFront == trailSize) { - size_t currBytes = trailSize * sizeof(Namespace *); - int newSize = 2*trailSize; - size_t newBytes = newSize * sizeof(Namespace *); - Namespace **newPtr = - (Namespace **) ckalloc((unsigned) newBytes); - - memcpy((VOID *) newPtr, (VOID *) trailPtr, currBytes); - if (trailPtr != trailStorage) { - ckfree((char *) trailPtr); - } - trailPtr = newPtr; - trailSize = newSize; - } - trailPtr[trailFront] = nsPtr; - } - - /* - * Free any allocated storage. - */ - - if (trailPtr != trailStorage) { - ckfree((char *) trailPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * GetNamespaceFromObj -- - * - * Returns the namespace specified by the name in a Tcl_Obj. - * - * Results: - * Returns TCL_OK if the namespace was resolved successfully, and - * stores a pointer to the namespace in the location specified by - * nsPtrPtr. If the namespace can't be found, the procedure stores - * NULL in *nsPtrPtr and returns TCL_OK. If anything else goes wrong, - * this procedure returns TCL_ERROR. - * - * Side effects: - * May update the internal representation for the object, caching the - * namespace reference. The next time this procedure is called, the - * namespace value can be found quickly. - * - * If anything goes wrong, an error message is left in the - * interpreter's result object. - * - *---------------------------------------------------------------------- - */ - -static int -GetNamespaceFromObj(interp, objPtr, nsPtrPtr) - Tcl_Interp *interp; /* The current interpreter. */ - Tcl_Obj *objPtr; /* The object to be resolved as the name - * of a namespace. */ - Tcl_Namespace **nsPtrPtr; /* Result namespace pointer goes here. */ -{ - register ResolvedNsName *resNamePtr; - register Namespace *nsPtr; - Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - int result; - - /* - * Get the internal representation, converting to a namespace type if - * needed. The internal representation is a ResolvedNsName that points - * to the actual namespace. - */ - - if (objPtr->typePtr != &tclNsNameType) { - result = tclNsNameType.setFromAnyProc(interp, objPtr); - if (result != TCL_OK) { - return TCL_ERROR; - } - } - resNamePtr = (ResolvedNsName *) objPtr->internalRep.otherValuePtr; - - /* - * Check the context namespace of the resolved symbol to make sure that - * it is fresh. If not, then force another conversion to the namespace - * type, to discard the old rep and create a new one. Note that we - * verify that the namespace id of the cached namespace is the same as - * the id when we cached it; this insures that the namespace wasn't - * deleted and a new one created at the same address. - */ - - nsPtr = NULL; - if ((resNamePtr != NULL) - && (resNamePtr->refNsPtr == currNsPtr) - && (resNamePtr->nsId == resNamePtr->nsPtr->nsId)) { - nsPtr = resNamePtr->nsPtr; - if (nsPtr->flags & NS_DEAD) { - nsPtr = NULL; - } - } - if (nsPtr == NULL) { /* try again */ - result = tclNsNameType.setFromAnyProc(interp, objPtr); - if (result != TCL_OK) { - return TCL_ERROR; - } - resNamePtr = (ResolvedNsName *) objPtr->internalRep.otherValuePtr; - if (resNamePtr != NULL) { - nsPtr = resNamePtr->nsPtr; - if (nsPtr->flags & NS_DEAD) { - nsPtr = NULL; - } - } - } - *nsPtrPtr = (Tcl_Namespace *) nsPtr; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_NamespaceObjCmd -- - * - * Invoked to implement the "namespace" command that creates, deletes, - * or manipulates Tcl namespaces. Handles the following syntax: - * - * namespace children ?name? ?pattern? - * namespace code arg - * namespace current - * namespace delete ?name name...? - * namespace eval name arg ?arg...? - * namespace export ?-clear? ?pattern pattern...? - * namespace forget ?pattern pattern...? - * namespace import ?-force? ?pattern pattern...? - * namespace inscope name arg ?arg...? - * namespace origin name - * namespace parent ?name? - * namespace qualifiers string - * namespace tail string - * namespace which ?-command? ?-variable? name - * - * Results: - * Returns TCL_OK if the command is successful. Returns TCL_ERROR if - * anything goes wrong. - * - * Side effects: - * Based on the subcommand name (e.g., "import"), this procedure - * dispatches to a corresponding procedure NamespaceXXXCmd defined - * statically in this file. This procedure's side effects depend on - * whatever that subcommand procedure does. If there is an error, this - * procedure returns an error message in the interpreter's result - * object. Otherwise it may return a result in the interpreter's result - * object. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_NamespaceObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Arbitrary value passed to cmd. */ - Tcl_Interp *interp; /* Current interpreter. */ - register int objc; /* Number of arguments. */ - register Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - static char *subCmds[] = { - "children", "code", "current", "delete", - "eval", "export", "forget", "import", - "inscope", "origin", "parent", "qualifiers", - "tail", "which", (char *) NULL}; - enum NSSubCmdIdx { - NSChildrenIdx, NSCodeIdx, NSCurrentIdx, NSDeleteIdx, - NSEvalIdx, NSExportIdx, NSForgetIdx, NSImportIdx, - NSInscopeIdx, NSOriginIdx, NSParentIdx, NSQualifiersIdx, - NSTailIdx, NSWhichIdx - }; - int index, result; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg ...?"); - return TCL_ERROR; - } - - /* - * Return an index reflecting the particular subcommand. - */ - - result = Tcl_GetIndexFromObj((Tcl_Interp *) interp, objv[1], subCmds, - "option", /*flags*/ 0, (int *) &index); - if (result != TCL_OK) { - return result; - } - - switch (index) { - case NSChildrenIdx: - result = NamespaceChildrenCmd(clientData, interp, objc, objv); - break; - case NSCodeIdx: - result = NamespaceCodeCmd(clientData, interp, objc, objv); - break; - case NSCurrentIdx: - result = NamespaceCurrentCmd(clientData, interp, objc, objv); - break; - case NSDeleteIdx: - result = NamespaceDeleteCmd(clientData, interp, objc, objv); - break; - case NSEvalIdx: - result = NamespaceEvalCmd(clientData, interp, objc, objv); - break; - case NSExportIdx: - result = NamespaceExportCmd(clientData, interp, objc, objv); - break; - case NSForgetIdx: - result = NamespaceForgetCmd(clientData, interp, objc, objv); - break; - case NSImportIdx: - result = NamespaceImportCmd(clientData, interp, objc, objv); - break; - case NSInscopeIdx: - result = NamespaceInscopeCmd(clientData, interp, objc, objv); - break; - case NSOriginIdx: - result = NamespaceOriginCmd(clientData, interp, objc, objv); - break; - case NSParentIdx: - result = NamespaceParentCmd(clientData, interp, objc, objv); - break; - case NSQualifiersIdx: - result = NamespaceQualifiersCmd(clientData, interp, objc, objv); - break; - case NSTailIdx: - result = NamespaceTailCmd(clientData, interp, objc, objv); - break; - case NSWhichIdx: - result = NamespaceWhichCmd(clientData, interp, objc, objv); - break; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceChildrenCmd -- - * - * Invoked to implement the "namespace children" command that returns a - * list containing the fully-qualified names of the child namespaces of - * a given namespace. Handles the following syntax: - * - * namespace children ?name? ?pattern? - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns a result in the interpreter's result object. If anything - * goes wrong, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceChildrenCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Namespace *namespacePtr; - Namespace *nsPtr, *childNsPtr; - Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); - char *pattern = NULL; - Tcl_DString buffer; - register Tcl_HashEntry *entryPtr; - Tcl_HashSearch search; - Tcl_Obj *listPtr, *elemPtr; - - /* - * Get a pointer to the specified namespace, or the current namespace. - */ - - if (objc == 2) { - nsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - } else if ((objc == 3) || (objc == 4)) { - if (GetNamespaceFromObj(interp, objv[2], &namespacePtr) != TCL_OK) { - return TCL_ERROR; - } - if (namespacePtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown namespace \"", Tcl_GetString(objv[2]), - "\" in namespace children command", (char *) NULL); - return TCL_ERROR; - } - nsPtr = (Namespace *) namespacePtr; - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?name? ?pattern?"); - return TCL_ERROR; - } - - /* - * Get the glob-style pattern, if any, used to narrow the search. - */ - - Tcl_DStringInit(&buffer); - if (objc == 4) { - char *name = Tcl_GetString(objv[3]); - - if ((*name == ':') && (*(name+1) == ':')) { - pattern = name; - } else { - Tcl_DStringAppend(&buffer, nsPtr->fullName, -1); - if (nsPtr != globalNsPtr) { - Tcl_DStringAppend(&buffer, "::", 2); - } - Tcl_DStringAppend(&buffer, name, -1); - pattern = Tcl_DStringValue(&buffer); - } - } - - /* - * Create a list containing the full names of all child namespaces - * whose names match the specified pattern, if any. - */ - - listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - entryPtr = Tcl_FirstHashEntry(&nsPtr->childTable, &search); - while (entryPtr != NULL) { - childNsPtr = (Namespace *) Tcl_GetHashValue(entryPtr); - if ((pattern == NULL) - || Tcl_StringMatch(childNsPtr->fullName, pattern)) { - elemPtr = Tcl_NewStringObj(childNsPtr->fullName, -1); - Tcl_ListObjAppendElement(interp, listPtr, elemPtr); - } - entryPtr = Tcl_NextHashEntry(&search); - } - - Tcl_SetObjResult(interp, listPtr); - Tcl_DStringFree(&buffer); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceCodeCmd -- - * - * Invoked to implement the "namespace code" command to capture the - * namespace context of a command. Handles the following syntax: - * - * namespace code arg - * - * Here "arg" can be a list. "namespace code arg" produces a result - * equivalent to that produced by the command - * - * list namespace inscope [namespace current] $arg - * - * However, if "arg" is itself a scoped value starting with - * "namespace inscope", then the result is just "arg". - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * If anything goes wrong, this procedure returns an error - * message as the result in the interpreter's result object. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceCodeCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Namespace *currNsPtr; - Tcl_Obj *listPtr, *objPtr; - register char *arg, *p; - int length; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "arg"); - return TCL_ERROR; - } - - /* - * If "arg" is already a scoped value, then return it directly. - */ - - arg = Tcl_GetStringFromObj(objv[2], &length); - if ((*arg == 'n') && (length > 17) - && (strncmp(arg, "namespace", 9) == 0)) { - for (p = (arg + 9); (*p == ' '); p++) { - /* empty body: skip over spaces */ - } - if ((*p == 'i') && ((p + 7) <= (arg + length)) - && (strncmp(p, "inscope", 7) == 0)) { - Tcl_SetObjResult(interp, objv[2]); - return TCL_OK; - } - } - - /* - * Otherwise, construct a scoped command by building a list with - * "namespace inscope", the full name of the current namespace, and - * the argument "arg". By constructing a list, we ensure that scoped - * commands are interpreted properly when they are executed later, - * by the "namespace inscope" command. - */ - - listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj("namespace", -1)); - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj("inscope", -1)); - - currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - if (currNsPtr == (Namespace *) Tcl_GetGlobalNamespace(interp)) { - objPtr = Tcl_NewStringObj("::", -1); - } else { - objPtr = Tcl_NewStringObj(currNsPtr->fullName, -1); - } - Tcl_ListObjAppendElement(interp, listPtr, objPtr); - - Tcl_ListObjAppendElement(interp, listPtr, objv[2]); - - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceCurrentCmd -- - * - * Invoked to implement the "namespace current" command which returns - * the fully-qualified name of the current namespace. Handles the - * following syntax: - * - * namespace current - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns a result in the interpreter's result object. If anything - * goes wrong, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceCurrentCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Namespace *currNsPtr; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - - /* - * The "real" name of the global namespace ("::") is the null string, - * but we return "::" for it as a convenience to programmers. Note that - * "" and "::" are treated as synonyms by the namespace code so that it - * is still easy to do things like: - * - * namespace [namespace current]::bar { ... } - */ - - currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - if (currNsPtr == (Namespace *) Tcl_GetGlobalNamespace(interp)) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), "::", -1); - } else { - Tcl_AppendToObj(Tcl_GetObjResult(interp), currNsPtr->fullName, -1); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceDeleteCmd -- - * - * Invoked to implement the "namespace delete" command to delete - * namespace(s). Handles the following syntax: - * - * namespace delete ?name name...? - * - * Each name identifies a namespace. It may include a sequence of - * namespace qualifiers separated by "::"s. If a namespace is found, it - * is deleted: all variables and procedures contained in that namespace - * are deleted. If that namespace is being used on the call stack, it - * is kept alive (but logically deleted) until it is removed from the - * call stack: that is, it can no longer be referenced by name but any - * currently executing procedure that refers to it is allowed to do so - * until the procedure returns. If the namespace can't be found, this - * procedure returns an error. If no namespaces are specified, this - * command does nothing. - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Deletes the specified namespaces. If anything goes wrong, this - * procedure returns an error message in the interpreter's - * result object. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceDeleteCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Namespace *namespacePtr; - char *name; - register int i; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 2, objv, "?name name...?"); - return TCL_ERROR; - } - - /* - * Destroying one namespace may cause another to be destroyed. Break - * this into two passes: first check to make sure that all namespaces on - * the command line are valid, and report any errors. - */ - - for (i = 2; i < objc; i++) { - name = Tcl_GetString(objv[i]); - namespacePtr = Tcl_FindNamespace(interp, name, - (Tcl_Namespace *) NULL, /*flags*/ 0); - if (namespacePtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown namespace \"", Tcl_GetString(objv[i]), - "\" in namespace delete command", (char *) NULL); - return TCL_ERROR; - } - } - - /* - * Okay, now delete each namespace. - */ - - for (i = 2; i < objc; i++) { - name = Tcl_GetString(objv[i]); - namespacePtr = Tcl_FindNamespace(interp, name, - (Tcl_Namespace *) NULL, /* flags */ 0); - if (namespacePtr) { - Tcl_DeleteNamespace(namespacePtr); - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceEvalCmd -- - * - * Invoked to implement the "namespace eval" command. Executes - * commands in a namespace. If the namespace does not already exist, - * it is created. Handles the following syntax: - * - * namespace eval name arg ?arg...? - * - * If more than one arg argument is specified, the command that is - * executed is the result of concatenating the arguments together with - * a space between each argument. - * - * Results: - * Returns TCL_OK if the namespace is found and the commands are - * executed successfully. Returns TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns the result of the command in the interpreter's result - * object. If anything goes wrong, this procedure returns an error - * message as the result. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceEvalCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Namespace *namespacePtr; - Tcl_CallFrame frame; - Tcl_Obj *objPtr; - char *name; - int length, result; - - if (objc < 4) { - Tcl_WrongNumArgs(interp, 2, objv, "name arg ?arg...?"); - return TCL_ERROR; - } - - /* - * Try to resolve the namespace reference, caching the result in the - * namespace object along the way. - */ - - result = GetNamespaceFromObj(interp, objv[2], &namespacePtr); - if (result != TCL_OK) { - return result; - } - - /* - * If the namespace wasn't found, try to create it. - */ - - if (namespacePtr == NULL) { - name = Tcl_GetStringFromObj(objv[2], &length); - namespacePtr = Tcl_CreateNamespace(interp, name, (ClientData) NULL, - (Tcl_NamespaceDeleteProc *) NULL); - if (namespacePtr == NULL) { - return TCL_ERROR; - } - } - - /* - * Make the specified namespace the current namespace and evaluate - * the command(s). - */ - - result = Tcl_PushCallFrame(interp, &frame, namespacePtr, - /*isProcCallFrame*/ 0); - if (result != TCL_OK) { - return TCL_ERROR; - } - - if (objc == 4) { - result = Tcl_EvalObjEx(interp, objv[3], 0); - } else { - objPtr = Tcl_ConcatObj(objc-3, objv+3); - - /* - * Tcl_EvalObj will delete the object when it decrements its - * refcount after eval'ing it. - */ - - result = Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_DIRECT); - } - if (result == TCL_ERROR) { - char msg[256 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (in namespace eval \"%.200s\" script line %d)", - namespacePtr->fullName, interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); - } - - /* - * Restore the previous "current" namespace. - */ - - Tcl_PopCallFrame(interp); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceExportCmd -- - * - * Invoked to implement the "namespace export" command that specifies - * which commands are exported from a namespace. The exported commands - * are those that can be imported into another namespace using - * "namespace import". Both commands defined in a namespace and - * commands the namespace has imported can be exported by a - * namespace. This command has the following syntax: - * - * namespace export ?-clear? ?pattern pattern...? - * - * Each pattern may contain "string match"-style pattern matching - * special characters, but the pattern may not include any namespace - * qualifiers: that is, the pattern must specify commands in the - * current (exporting) namespace. The specified patterns are appended - * onto the namespace's list of export patterns. - * - * To reset the namespace's export pattern list, specify the "-clear" - * flag. - * - * If there are no export patterns and the "-clear" flag isn't given, - * this command returns the namespace's current export list. - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns a result in the interpreter's result object. If anything - * goes wrong, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceExportCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Namespace *currNsPtr = (Namespace*) Tcl_GetCurrentNamespace(interp); - char *pattern, *string; - int resetListFirst = 0; - int firstArg, patternCt, i, result; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 2, objv, - "?-clear? ?pattern pattern...?"); - return TCL_ERROR; - } - - /* - * Process the optional "-clear" argument. - */ - - firstArg = 2; - if (firstArg < objc) { - string = Tcl_GetString(objv[firstArg]); - if (strcmp(string, "-clear") == 0) { - resetListFirst = 1; - firstArg++; - } - } - - /* - * If no pattern arguments are given, and "-clear" isn't specified, - * return the namespace's current export pattern list. - */ - - patternCt = (objc - firstArg); - if (patternCt == 0) { - if (firstArg > 2) { - return TCL_OK; - } else { /* create list with export patterns */ - Tcl_Obj *listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - result = Tcl_AppendExportList(interp, - (Tcl_Namespace *) currNsPtr, listPtr); - if (result != TCL_OK) { - return result; - } - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; - } - } - - /* - * Add each pattern to the namespace's export pattern list. - */ - - for (i = firstArg; i < objc; i++) { - pattern = Tcl_GetString(objv[i]); - result = Tcl_Export(interp, (Tcl_Namespace *) currNsPtr, pattern, - ((i == firstArg)? resetListFirst : 0)); - if (result != TCL_OK) { - return result; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceForgetCmd -- - * - * Invoked to implement the "namespace forget" command to remove - * imported commands from a namespace. Handles the following syntax: - * - * namespace forget ?pattern pattern...? - * - * Each pattern is a name like "foo::*" or "a::b::x*". That is, the - * pattern may include the special pattern matching characters - * recognized by the "string match" command, but only in the command - * name at the end of the qualified name; the special pattern - * characters may not appear in a namespace name. All of the commands - * that match that pattern are checked to see if they have an imported - * command in the current namespace that refers to the matched - * command. If there is an alias, it is removed. - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Imported commands are removed from the current namespace. If - * anything goes wrong, this procedure returns an error message in the - * interpreter's result object. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceForgetCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *pattern; - register int i, result; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 2, objv, "?pattern pattern...?"); - return TCL_ERROR; - } - - for (i = 2; i < objc; i++) { - pattern = Tcl_GetString(objv[i]); - result = Tcl_ForgetImport(interp, (Tcl_Namespace *) NULL, pattern); - if (result != TCL_OK) { - return result; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceImportCmd -- - * - * Invoked to implement the "namespace import" command that imports - * commands into a namespace. Handles the following syntax: - * - * namespace import ?-force? ?pattern pattern...? - * - * Each pattern is a namespace-qualified name like "foo::*", - * "a::b::x*", or "bar::p". That is, the pattern may include the - * special pattern matching characters recognized by the "string match" - * command, but only in the command name at the end of the qualified - * name; the special pattern characters may not appear in a namespace - * name. All of the commands that match the pattern and which are - * exported from their namespace are made accessible from the current - * namespace context. This is done by creating a new "imported command" - * in the current namespace that points to the real command in its - * original namespace; when the imported command is called, it invokes - * the real command. - * - * If an imported command conflicts with an existing command, it is - * treated as an error. But if the "-force" option is included, then - * existing commands are overwritten by the imported commands. - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Adds imported commands to the current namespace. If anything goes - * wrong, this procedure returns an error message in the interpreter's - * result object. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceImportCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int allowOverwrite = 0; - char *string, *pattern; - register int i, result; - int firstArg; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 2, objv, - "?-force? ?pattern pattern...?"); - return TCL_ERROR; - } - - /* - * Skip over the optional "-force" as the first argument. - */ - - firstArg = 2; - if (firstArg < objc) { - string = Tcl_GetString(objv[firstArg]); - if ((*string == '-') && (strcmp(string, "-force") == 0)) { - allowOverwrite = 1; - firstArg++; - } - } - - /* - * Handle the imports for each of the patterns. - */ - - for (i = firstArg; i < objc; i++) { - pattern = Tcl_GetString(objv[i]); - result = Tcl_Import(interp, (Tcl_Namespace *) NULL, pattern, - allowOverwrite); - if (result != TCL_OK) { - return result; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceInscopeCmd -- - * - * Invoked to implement the "namespace inscope" command that executes a - * script in the context of a particular namespace. This command is not - * expected to be used directly by programmers; calls to it are - * generated implicitly when programs use "namespace code" commands - * to register callback scripts. Handles the following syntax: - * - * namespace inscope name arg ?arg...? - * - * The "namespace inscope" command is much like the "namespace eval" - * command except that it has lappend semantics and the namespace must - * already exist. It treats the first argument as a list, and appends - * any arguments after the first onto the end as proper list elements. - * For example, - * - * namespace inscope ::foo a b c d - * - * is equivalent to - * - * namespace eval ::foo [concat a [list b c d]] - * - * This lappend semantics is important because many callback scripts - * are actually prefixes. - * - * Results: - * Returns TCL_OK to indicate success, or TCL_ERROR to indicate - * failure. - * - * Side effects: - * Returns a result in the Tcl interpreter's result object. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceInscopeCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Namespace *namespacePtr; - Tcl_CallFrame frame; - int i, result; - - if (objc < 4) { - Tcl_WrongNumArgs(interp, 2, objv, "name arg ?arg...?"); - return TCL_ERROR; - } - - /* - * Resolve the namespace reference. - */ - - result = GetNamespaceFromObj(interp, objv[2], &namespacePtr); - if (result != TCL_OK) { - return result; - } - if (namespacePtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown namespace \"", Tcl_GetString(objv[2]), - "\" in inscope namespace command", (char *) NULL); - return TCL_ERROR; - } - - /* - * Make the specified namespace the current namespace. - */ - - result = Tcl_PushCallFrame(interp, &frame, namespacePtr, - /*isProcCallFrame*/ 0); - if (result != TCL_OK) { - return result; - } - - /* - * Execute the command. If there is just one argument, just treat it as - * a script and evaluate it. Otherwise, create a list from the arguments - * after the first one, then concatenate the first argument and the list - * of extra arguments to form the command to evaluate. - */ - - if (objc == 4) { - result = Tcl_EvalObjEx(interp, objv[3], 0); - } else { - Tcl_Obj *concatObjv[2]; - register Tcl_Obj *listPtr, *cmdObjPtr; - - listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); - for (i = 4; i < objc; i++) { - result = Tcl_ListObjAppendElement(interp, listPtr, objv[i]); - if (result != TCL_OK) { - Tcl_DecrRefCount(listPtr); /* free unneeded obj */ - return result; - } - } - - concatObjv[0] = objv[3]; - concatObjv[1] = listPtr; - cmdObjPtr = Tcl_ConcatObj(2, concatObjv); - result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_DIRECT); - Tcl_DecrRefCount(listPtr); /* we're done with the list object */ - } - if (result == TCL_ERROR) { - char msg[256 + TCL_INTEGER_SPACE]; - - sprintf(msg, - "\n (in namespace inscope \"%.200s\" script line %d)", - namespacePtr->fullName, interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); - } - - /* - * Restore the previous "current" namespace. - */ - - Tcl_PopCallFrame(interp); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceOriginCmd -- - * - * Invoked to implement the "namespace origin" command to return the - * fully-qualified name of the "real" command to which the specified - * "imported command" refers. Handles the following syntax: - * - * namespace origin name - * - * Results: - * An imported command is created in an namespace when that namespace - * imports a command from another namespace. If a command is imported - * into a sequence of namespaces a, b,...,n where each successive - * namespace just imports the command from the previous namespace, this - * command returns the fully-qualified name of the original command in - * the first namespace, a. If "name" does not refer to an alias, its - * fully-qualified name is returned. The returned name is stored in the - * interpreter's result object. This procedure returns TCL_OK if - * successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * If anything goes wrong, this procedure returns an error message in - * the interpreter's result object. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceOriginCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Command command, origCommand; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "name"); - return TCL_ERROR; - } - - command = Tcl_GetCommandFromObj(interp, objv[2]); - if (command == (Tcl_Command) NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "invalid command name \"", Tcl_GetString(objv[2]), - "\"", (char *) NULL); - return TCL_ERROR; - } - origCommand = TclGetOriginalCommand(command); - if (origCommand == (Tcl_Command) NULL) { - /* - * The specified command isn't an imported command. Return the - * command's name qualified by the full name of the namespace it - * was defined in. - */ - - Tcl_GetCommandFullName(interp, command, Tcl_GetObjResult(interp)); - } else { - Tcl_GetCommandFullName(interp, origCommand, Tcl_GetObjResult(interp)); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceParentCmd -- - * - * Invoked to implement the "namespace parent" command that returns the - * fully-qualified name of the parent namespace for a specified - * namespace. Handles the following syntax: - * - * namespace parent ?name? - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns a result in the interpreter's result object. If anything - * goes wrong, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceParentCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Namespace *nsPtr; - int result; - - if (objc == 2) { - nsPtr = Tcl_GetCurrentNamespace(interp); - } else if (objc == 3) { - result = GetNamespaceFromObj(interp, objv[2], &nsPtr); - if (result != TCL_OK) { - return result; - } - if (nsPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "unknown namespace \"", Tcl_GetString(objv[2]), - "\" in namespace parent command", (char *) NULL); - return TCL_ERROR; - } - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?name?"); - return TCL_ERROR; - } - - /* - * Report the parent of the specified namespace. - */ - - if (nsPtr->parentPtr != NULL) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), - nsPtr->parentPtr->fullName, -1); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceQualifiersCmd -- - * - * Invoked to implement the "namespace qualifiers" command that returns - * any leading namespace qualifiers in a string. These qualifiers are - * namespace names separated by "::"s. For example, for "::foo::p" this - * command returns "::foo", and for "::" it returns "". This command - * is the complement of the "namespace tail" command. Note that this - * command does not check whether the "namespace" names are, in fact, - * the names of currently defined namespaces. Handles the following - * syntax: - * - * namespace qualifiers string - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns a result in the interpreter's result object. If anything - * goes wrong, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceQualifiersCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register char *name, *p; - int length; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "string"); - return TCL_ERROR; - } - - /* - * Find the end of the string, then work backward and find - * the start of the last "::" qualifier. - */ - - name = Tcl_GetString(objv[2]); - for (p = name; *p != '\0'; p++) { - /* empty body */ - } - while (--p >= name) { - if ((*p == ':') && (p > name) && (*(p-1) == ':')) { - p -= 2; /* back up over the :: */ - while ((p >= name) && (*p == ':')) { - p--; /* back up over the preceeding : */ - } - break; - } - } - - if (p >= name) { - length = p-name+1; - Tcl_AppendToObj(Tcl_GetObjResult(interp), name, length); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceTailCmd -- - * - * Invoked to implement the "namespace tail" command that returns the - * trailing name at the end of a string with "::" namespace - * qualifiers. These qualifiers are namespace names separated by - * "::"s. For example, for "::foo::p" this command returns "p", and for - * "::" it returns "". This command is the complement of the "namespace - * qualifiers" command. Note that this command does not check whether - * the "namespace" names are, in fact, the names of currently defined - * namespaces. Handles the following syntax: - * - * namespace tail string - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns a result in the interpreter's result object. If anything - * goes wrong, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceTailCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register char *name, *p; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "string"); - return TCL_ERROR; - } - - /* - * Find the end of the string, then work backward and find the - * last "::" qualifier. - */ - - name = Tcl_GetString(objv[2]); - for (p = name; *p != '\0'; p++) { - /* empty body */ - } - while (--p > name) { - if ((*p == ':') && (*(p-1) == ':')) { - p++; /* just after the last "::" */ - break; - } - } - - if (p >= name) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), p, -1); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NamespaceWhichCmd -- - * - * Invoked to implement the "namespace which" command that returns the - * fully-qualified name of a command or variable. If the specified - * command or variable does not exist, it returns "". Handles the - * following syntax: - * - * namespace which ?-command? ?-variable? name - * - * Results: - * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. - * - * Side effects: - * Returns a result in the interpreter's result object. If anything - * goes wrong, the result is an error message. - * - *---------------------------------------------------------------------- - */ - -static int -NamespaceWhichCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register char *arg; - Tcl_Command cmd; - Tcl_Var variable; - int argIndex, lookup; - - if (objc < 3) { - badArgs: - Tcl_WrongNumArgs(interp, 2, objv, - "?-command? ?-variable? name"); - return TCL_ERROR; - } - - /* - * Look for a flag controlling the lookup. - */ - - argIndex = 2; - lookup = 0; /* assume command lookup by default */ - arg = Tcl_GetString(objv[2]); - if (*arg == '-') { - if (strncmp(arg, "-command", 8) == 0) { - lookup = 0; - } else if (strncmp(arg, "-variable", 9) == 0) { - lookup = 1; - } else { - goto badArgs; - } - argIndex = 3; - } - if (objc != (argIndex + 1)) { - goto badArgs; - } - - switch (lookup) { - case 0: /* -command */ - cmd = Tcl_GetCommandFromObj(interp, objv[argIndex]); - if (cmd == (Tcl_Command) NULL) { - return TCL_OK; /* cmd not found, just return (no error) */ - } - Tcl_GetCommandFullName(interp, cmd, Tcl_GetObjResult(interp)); - break; - - case 1: /* -variable */ - arg = Tcl_GetString(objv[argIndex]); - variable = Tcl_FindNamespaceVar(interp, arg, (Tcl_Namespace *) NULL, - /*flags*/ 0); - if (variable != (Tcl_Var) NULL) { - Tcl_GetVariableFullName(interp, variable, Tcl_GetObjResult(interp)); - } - break; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * FreeNsNameInternalRep -- - * - * Frees the resources associated with a nsName object's internal - * representation. - * - * Results: - * None. - * - * Side effects: - * Decrements the ref count of any Namespace structure pointed - * to by the nsName's internal representation. If there are no more - * references to the namespace, it's structure will be freed. - * - *---------------------------------------------------------------------- - */ - -static void -FreeNsNameInternalRep(objPtr) - register Tcl_Obj *objPtr; /* nsName object with internal - * representation to free */ -{ - register ResolvedNsName *resNamePtr = - (ResolvedNsName *) objPtr->internalRep.otherValuePtr; - Namespace *nsPtr; - - /* - * Decrement the reference count of the namespace. If there are no - * more references, free it up. - */ - - if (resNamePtr != NULL) { - resNamePtr->refCount--; - if (resNamePtr->refCount == 0) { - - /* - * Decrement the reference count for the cached namespace. If - * the namespace is dead, and there are no more references to - * it, free it. - */ - - nsPtr = resNamePtr->nsPtr; - nsPtr->refCount--; - if ((nsPtr->refCount == 0) && (nsPtr->flags & NS_DEAD)) { - NamespaceFree(nsPtr); - } - ckfree((char *) resNamePtr); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * DupNsNameInternalRep -- - * - * Initializes the internal representation of a nsName object to a copy - * of the internal representation of another nsName object. - * - * Results: - * None. - * - * Side effects: - * copyPtr's internal rep is set to refer to the same namespace - * referenced by srcPtr's internal rep. Increments the ref count of - * the ResolvedNsName structure used to hold the namespace reference. - * - *---------------------------------------------------------------------- - */ - -static void -DupNsNameInternalRep(srcPtr, copyPtr) - Tcl_Obj *srcPtr; /* Object with internal rep to copy. */ - register Tcl_Obj *copyPtr; /* Object with internal rep to set. */ -{ - register ResolvedNsName *resNamePtr = - (ResolvedNsName *) srcPtr->internalRep.otherValuePtr; - - copyPtr->internalRep.otherValuePtr = (VOID *) resNamePtr; - if (resNamePtr != NULL) { - resNamePtr->refCount++; - } - copyPtr->typePtr = &tclNsNameType; -} - -/* - *---------------------------------------------------------------------- - * - * SetNsNameFromAny -- - * - * Attempt to generate a nsName internal representation for a - * Tcl object. - * - * Results: - * Returns TCL_OK if the value could be converted to a proper - * namespace reference. Otherwise, it returns TCL_ERROR, along - * with an error message in the interpreter's result object. - * - * Side effects: - * If successful, the object is made a nsName object. Its internal rep - * is set to point to a ResolvedNsName, which contains a cached pointer - * to the Namespace. Reference counts are kept on both the - * ResolvedNsName and the Namespace, so we can keep track of their - * usage and free them when appropriate. - * - *---------------------------------------------------------------------- - */ - -static int -SetNsNameFromAny(interp, objPtr) - Tcl_Interp *interp; /* Points to the namespace in which to - * resolve name. Also used for error - * reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object to convert. */ -{ - register Tcl_ObjType *oldTypePtr = objPtr->typePtr; - char *name, *dummy; - Namespace *nsPtr, *dummy1Ptr, *dummy2Ptr; - register ResolvedNsName *resNamePtr; - - /* - * Get the string representation. Make it up-to-date if necessary. - */ - - name = objPtr->bytes; - if (name == NULL) { - name = Tcl_GetString(objPtr); - } - - /* - * Look for the namespace "name" in the current namespace. If there is - * an error parsing the (possibly qualified) name, return an error. - * If the namespace isn't found, we convert the object to an nsName - * object with a NULL ResolvedNsName* internal rep. - */ - - TclGetNamespaceForQualName(interp, name, (Namespace *) NULL, - FIND_ONLY_NS, &nsPtr, &dummy1Ptr, &dummy2Ptr, &dummy); - - /* - * If we found a namespace, then create a new ResolvedNsName structure - * that holds a reference to it. - */ - - if (nsPtr != NULL) { - Namespace *currNsPtr = - (Namespace *) Tcl_GetCurrentNamespace(interp); - - nsPtr->refCount++; - resNamePtr = (ResolvedNsName *) ckalloc(sizeof(ResolvedNsName)); - resNamePtr->nsPtr = nsPtr; - resNamePtr->nsId = nsPtr->nsId; - resNamePtr->refNsPtr = currNsPtr; - resNamePtr->refCount = 1; - } else { - resNamePtr = NULL; - } - - /* - * Free the old internalRep before setting the new one. - * We do this as late as possible to allow the conversion code - * (in particular, Tcl_GetStringFromObj) to use that old internalRep. - */ - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.otherValuePtr = (VOID *) resNamePtr; - objPtr->typePtr = &tclNsNameType; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateStringOfNsName -- - * - * Updates the string representation for a nsName object. - * Note: This procedure 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 copy of the fully qualified - * namespace name. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateStringOfNsName(objPtr) - register Tcl_Obj *objPtr; /* nsName object with string rep to update. */ -{ - ResolvedNsName *resNamePtr = - (ResolvedNsName *) objPtr->internalRep.otherValuePtr; - register Namespace *nsPtr; - char *name = ""; - int length; - - if ((resNamePtr != NULL) - && (resNamePtr->nsId == resNamePtr->nsPtr->nsId)) { - nsPtr = resNamePtr->nsPtr; - if (nsPtr->flags & NS_DEAD) { - nsPtr = NULL; - } - if (nsPtr != NULL) { - name = nsPtr->fullName; - } - } - - /* - * The following sets the string rep to an empty string on the heap - * if the internal rep is NULL. - */ - - length = strlen(name); - if (length == 0) { - objPtr->bytes = tclEmptyStringRep; - } else { - objPtr->bytes = (char *) ckalloc((unsigned) (length + 1)); - memcpy((VOID *) objPtr->bytes, (VOID *) name, (unsigned) length); - objPtr->bytes[length] = '\0'; - } - objPtr->length = length; -} diff --git a/generic/tclNotify.c b/generic/tclNotify.c deleted file mode 100644 index 15553b9..0000000 --- a/generic/tclNotify.c +++ /dev/null @@ -1,1046 +0,0 @@ -/* - * tclNotify.c -- - * - * This file implements the generic portion of the Tcl notifier. - * The notifier is lowest-level part of the event system. It - * manages an event queue that holds Tcl_Event structures. The - * platform specific portion of the notifier is defined in the - * tcl*Notify.c files in each platform directory. - * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclNotify.c,v 1.4 1999/04/16 00:46:50 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * For each event source (created with Tcl_CreateEventSource) there - * is a structure of the following type: - */ - -typedef struct EventSource { - Tcl_EventSetupProc *setupProc; - Tcl_EventCheckProc *checkProc; - ClientData clientData; - struct EventSource *nextPtr; -} EventSource; - -/* - * The following structure keeps track of the state of the notifier on a - * per-thread basis. The first three elements keep track of the event queue. - * In addition to the first (next to be serviced) and last events in the queue, - * we keep track of a "marker" event. This provides a simple priority - * mechanism whereby events can be inserted at the front of the queue but - * behind all other high-priority events already in the queue (this is used for - * things like a sequence of Enter and Leave events generated during a grab in - * Tk). These elements are protected by the queueMutex so that any thread - * can queue an event on any notifier. Note that all of the values in this - * structure will be initialized to 0. - */ - -typedef struct ThreadSpecificData { - Tcl_Event *firstEventPtr; /* First pending event, or NULL if none. */ - Tcl_Event *lastEventPtr; /* Last pending event, or NULL if none. */ - Tcl_Event *markerEventPtr; /* Last high-priority event in queue, or - * NULL if none. */ - Tcl_Mutex queueMutex; /* Mutex to protect access to the previous - * three fields. */ - int serviceMode; /* One of TCL_SERVICE_NONE or - * TCL_SERVICE_ALL. */ - int blockTimeSet; /* 0 means there is no maximum block - * time: block forever. */ - Tcl_Time blockTime; /* If blockTimeSet is 1, gives the - * maximum elapsed time for the next block. */ - int inTraversal; /* 1 if Tcl_SetMaxBlockTime is being - * called during an event source traversal. */ - EventSource *firstEventSourcePtr; - /* Pointer to first event source in - * list of event sources for this thread. */ - Tcl_ThreadId threadId; /* Thread that owns this notifier instance. */ - ClientData clientData; /* Opaque handle for platform specific - * notifier. */ - struct ThreadSpecificData *nextPtr; - /* Next notifier in global list of notifiers. - * Access is controlled by the listLock global - * mutex. */ -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - -/* - * Global list of notifiers. Access to this list is controlled by the - * listLock mutex. If this becomes a performance bottleneck, this could - * be replaced with a hashtable. - */ - -static ThreadSpecificData *firstNotifierPtr; -TCL_DECLARE_MUTEX(listLock) - -/* - * Declarations for routines used only in this file. - */ - -static void QueueEvent _ANSI_ARGS_((ThreadSpecificData *tsdPtr, - Tcl_Event* evPtr, Tcl_QueuePosition position)); - -/* - *---------------------------------------------------------------------- - * - * TclInitNotifier -- - * - * Initialize the thread local data structures for the notifier - * subsystem. - * - * Results: - * None. - * - * Side effects: - * Adds the current thread to the global list of notifiers. - * - *---------------------------------------------------------------------- - */ - -void -TclInitNotifier() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - Tcl_MutexLock(&listLock); - - tsdPtr->threadId = Tcl_GetCurrentThread(); - tsdPtr->clientData = Tcl_InitNotifier(); - tsdPtr->nextPtr = firstNotifierPtr; - firstNotifierPtr = tsdPtr; - - Tcl_MutexUnlock(&listLock); -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeNotifier -- - * - * Finalize the thread local data structures for the notifier - * subsystem. - * - * Results: - * None. - * - * Side effects: - * Removes the notifier associated with the current thread from - * the global notifier list. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeNotifier() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - ThreadSpecificData **prevPtrPtr; - - Tcl_MutexLock(&listLock); - - Tcl_FinalizeNotifier(tsdPtr->clientData); - TclFinalizeMutex(&(tsdPtr->queueMutex)); - for (prevPtrPtr = &firstNotifierPtr; *prevPtrPtr != NULL; - prevPtrPtr = &((*prevPtrPtr)->nextPtr)) { - if (*prevPtrPtr == tsdPtr) { - *prevPtrPtr = tsdPtr->nextPtr; - break; - } - } - - Tcl_MutexUnlock(&listLock); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CreateEventSource -- - * - * This procedure is invoked to create a new source of events. - * The source is identified by a procedure that gets invoked - * during Tcl_DoOneEvent to check for events on that source - * and queue them. - * - * - * Results: - * None. - * - * Side effects: - * SetupProc and checkProc will be invoked each time that Tcl_DoOneEvent - * runs out of things to do. SetupProc will be invoked before - * Tcl_DoOneEvent calls select or whatever else it uses to wait - * for events. SetupProc typically calls functions like - * Tcl_SetMaxBlockTime to indicate what to wait for. - * - * CheckProc is called after select or whatever operation was actually - * used to wait. It figures out whether anything interesting actually - * happened (e.g. by calling Tcl_AsyncReady), and then calls - * Tcl_QueueEvent to queue any events that are ready. - * - * Each of these procedures is passed two arguments, e.g. - * (*checkProc)(ClientData clientData, int flags)); - * ClientData is the same as the clientData argument here, and flags - * is a combination of things like TCL_FILE_EVENTS that indicates - * what events are of interest: setupProc and checkProc use flags - * to figure out whether their events are relevant or not. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_CreateEventSource(setupProc, checkProc, clientData) - Tcl_EventSetupProc *setupProc; /* Procedure to invoke to figure out - * what to wait for. */ - Tcl_EventCheckProc *checkProc; /* Procedure to call after waiting - * to see what happened. */ - ClientData clientData; /* One-word argument to pass to - * setupProc and checkProc. */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - EventSource *sourcePtr = (EventSource *) ckalloc(sizeof(EventSource)); - - sourcePtr->setupProc = setupProc; - sourcePtr->checkProc = checkProc; - sourcePtr->clientData = clientData; - sourcePtr->nextPtr = tsdPtr->firstEventSourcePtr; - tsdPtr->firstEventSourcePtr = sourcePtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteEventSource -- - * - * This procedure is invoked to delete the source of events - * given by proc and clientData. - * - * Results: - * None. - * - * Side effects: - * The given event source is cancelled, so its procedure will - * never again be called. If no such source exists, nothing - * happens. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteEventSource(setupProc, checkProc, clientData) - Tcl_EventSetupProc *setupProc; /* Procedure to invoke to figure out - * what to wait for. */ - Tcl_EventCheckProc *checkProc; /* Procedure to call after waiting - * to see what happened. */ - ClientData clientData; /* One-word argument to pass to - * setupProc and checkProc. */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - EventSource *sourcePtr, *prevPtr; - - for (sourcePtr = tsdPtr->firstEventSourcePtr, prevPtr = NULL; - sourcePtr != NULL; - prevPtr = sourcePtr, sourcePtr = sourcePtr->nextPtr) { - if ((sourcePtr->setupProc != setupProc) - || (sourcePtr->checkProc != checkProc) - || (sourcePtr->clientData != clientData)) { - continue; - } - if (prevPtr == NULL) { - tsdPtr->firstEventSourcePtr = sourcePtr->nextPtr; - } else { - prevPtr->nextPtr = sourcePtr->nextPtr; - } - ckfree((char *) sourcePtr); - return; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_QueueEvent -- - * - * Queue an event on the event queue associated with the - * current thread. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_QueueEvent(evPtr, position) - Tcl_Event* evPtr; /* Event to add to queue. The storage - * space must have been allocated the caller - * with malloc (ckalloc), and it becomes - * the property of the event queue. It - * will be freed after the event has been - * handled. */ - Tcl_QueuePosition position; /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, - * TCL_QUEUE_MARK. */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - QueueEvent(tsdPtr, evPtr, position); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ThreadQueueEvent -- - * - * Queue an event on the specified thread's event queue. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_ThreadQueueEvent(threadId, evPtr, position) - Tcl_ThreadId threadId; /* Identifier for thread to use. */ - Tcl_Event* evPtr; /* Event to add to queue. The storage - * space must have been allocated the caller - * with malloc (ckalloc), and it becomes - * the property of the event queue. It - * will be freed after the event has been - * handled. */ - Tcl_QueuePosition position; /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, - * TCL_QUEUE_MARK. */ -{ - ThreadSpecificData *tsdPtr; - - /* - * Find the notifier associated with the specified thread. - */ - - Tcl_MutexLock(&listLock); - for (tsdPtr = firstNotifierPtr; tsdPtr && tsdPtr->threadId != threadId; - tsdPtr = tsdPtr->nextPtr) { - /* Empty loop body. */ - } - - /* - * Queue the event if there was a notifier associated with the thread. - */ - - if (tsdPtr) { - QueueEvent(tsdPtr, evPtr, position); - } - Tcl_MutexUnlock(&listLock); -} - -/* - *---------------------------------------------------------------------- - * - * QueueEvent -- - * - * Insert an event into the specified thread's event queue at one - * of three positions: the head, the tail, or before a floating - * marker. Events inserted before the marker will be processed in - * first-in-first-out order, but before any events inserted at - * the tail of the queue. Events inserted at the head of the - * queue will be processed in last-in-first-out order. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -QueueEvent(tsdPtr, evPtr, position) - ThreadSpecificData *tsdPtr; /* Handle to thread local data that indicates - * which event queue to use. */ - Tcl_Event* evPtr; /* Event to add to queue. The storage - * space must have been allocated the caller - * with malloc (ckalloc), and it becomes - * the property of the event queue. It - * will be freed after the event has been - * handled. */ - Tcl_QueuePosition position; /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, - * TCL_QUEUE_MARK. */ -{ - Tcl_MutexLock(&(tsdPtr->queueMutex)); - if (position == TCL_QUEUE_TAIL) { - /* - * Append the event on the end of the queue. - */ - - evPtr->nextPtr = NULL; - if (tsdPtr->firstEventPtr == NULL) { - tsdPtr->firstEventPtr = evPtr; - } else { - tsdPtr->lastEventPtr->nextPtr = evPtr; - } - tsdPtr->lastEventPtr = evPtr; - } else if (position == TCL_QUEUE_HEAD) { - /* - * Push the event on the head of the queue. - */ - - evPtr->nextPtr = tsdPtr->firstEventPtr; - if (tsdPtr->firstEventPtr == NULL) { - tsdPtr->lastEventPtr = evPtr; - } - tsdPtr->firstEventPtr = evPtr; - } else if (position == TCL_QUEUE_MARK) { - /* - * Insert the event after the current marker event and advance - * the marker to the new event. - */ - - if (tsdPtr->markerEventPtr == NULL) { - evPtr->nextPtr = tsdPtr->firstEventPtr; - tsdPtr->firstEventPtr = evPtr; - } else { - evPtr->nextPtr = tsdPtr->markerEventPtr->nextPtr; - tsdPtr->markerEventPtr->nextPtr = evPtr; - } - tsdPtr->markerEventPtr = evPtr; - if (evPtr->nextPtr == NULL) { - tsdPtr->lastEventPtr = evPtr; - } - } - Tcl_MutexUnlock(&(tsdPtr->queueMutex)); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DeleteEvents -- - * - * Calls a procedure for each event in the queue and deletes those - * for which the procedure returns 1. Events for which the - * procedure returns 0 are left in the queue. Operates on the - * queue associated with the current thread. - * - * Results: - * None. - * - * Side effects: - * Potentially removes one or more events from the event queue. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DeleteEvents(proc, clientData) - Tcl_EventDeleteProc *proc; /* The procedure to call. */ - ClientData clientData; /* type-specific data. */ -{ - Tcl_Event *evPtr, *prevPtr, *hold; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - Tcl_MutexLock(&(tsdPtr->queueMutex)); - for (prevPtr = (Tcl_Event *) NULL, evPtr = tsdPtr->firstEventPtr; - evPtr != (Tcl_Event *) NULL; - ) { - if ((*proc) (evPtr, clientData) == 1) { - if (tsdPtr->firstEventPtr == evPtr) { - tsdPtr->firstEventPtr = evPtr->nextPtr; - if (evPtr->nextPtr == (Tcl_Event *) NULL) { - tsdPtr->lastEventPtr = prevPtr; - } - if (tsdPtr->markerEventPtr == evPtr) { - tsdPtr->markerEventPtr = prevPtr; - } - } else { - prevPtr->nextPtr = evPtr->nextPtr; - } - hold = evPtr; - evPtr = evPtr->nextPtr; - ckfree((char *) hold); - } else { - prevPtr = evPtr; - evPtr = evPtr->nextPtr; - } - } - Tcl_MutexUnlock(&(tsdPtr->queueMutex)); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ServiceEvent -- - * - * Process one event from the event queue, or invoke an - * asynchronous event handler. Operates on event queue for - * current thread. - * - * Results: - * The return value is 1 if the procedure actually found an event - * to process. If no processing occurred, then 0 is returned. - * - * Side effects: - * Invokes all of the event handlers for the highest priority - * event in the event queue. May collapse some events into a - * single event or discard stale events. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ServiceEvent(flags) - int flags; /* Indicates what events should be processed. - * May be any combination of TCL_WINDOW_EVENTS - * TCL_FILE_EVENTS, TCL_TIMER_EVENTS, or other - * flags defined elsewhere. Events not - * matching this will be skipped for processing - * later. */ -{ - Tcl_Event *evPtr, *prevPtr; - Tcl_EventProc *proc; - int result; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * Asynchronous event handlers are considered to be the highest - * priority events, and so must be invoked before we process events - * on the event queue. - */ - - if (Tcl_AsyncReady()) { - (void) Tcl_AsyncInvoke((Tcl_Interp *) NULL, 0); - return 1; - } - - /* - * No event flags is equivalent to TCL_ALL_EVENTS. - */ - - if ((flags & TCL_ALL_EVENTS) == 0) { - flags |= TCL_ALL_EVENTS; - } - - /* - * Loop through all the events in the queue until we find one - * that can actually be handled. - */ - - Tcl_MutexLock(&(tsdPtr->queueMutex)); - for (evPtr = tsdPtr->firstEventPtr; evPtr != NULL; - evPtr = evPtr->nextPtr) { - /* - * Call the handler for the event. If it actually handles the - * event then free the storage for the event. There are two - * tricky things here, both stemming from the fact that the event - * code may be re-entered while servicing the event: - * - * 1. Set the "proc" field to NULL. This is a signal to ourselves - * that we shouldn't reexecute the handler if the event loop - * is re-entered. - * 2. When freeing the event, must search the queue again from the - * front to find it. This is because the event queue could - * change almost arbitrarily while handling the event, so we - * can't depend on pointers found now still being valid when - * the handler returns. - */ - - proc = evPtr->proc; - if (proc == NULL) { - continue; - } - evPtr->proc = NULL; - - /* - * Release the lock before calling the event procedure. This - * allows other threads to post events if we enter a recursive - * event loop in this thread. Note that we are making the assumption - * that if the proc returns 0, the event is still in the list. - */ - - Tcl_MutexUnlock(&(tsdPtr->queueMutex)); - result = (*proc)(evPtr, flags); - Tcl_MutexLock(&(tsdPtr->queueMutex)); - - if (result) { - /* - * The event was processed, so remove it from the queue. - */ - - if (tsdPtr->firstEventPtr == evPtr) { - tsdPtr->firstEventPtr = evPtr->nextPtr; - if (evPtr->nextPtr == NULL) { - tsdPtr->lastEventPtr = NULL; - } - if (tsdPtr->markerEventPtr == evPtr) { - tsdPtr->markerEventPtr = NULL; - } - } else { - for (prevPtr = tsdPtr->firstEventPtr; - prevPtr && prevPtr->nextPtr != evPtr; - prevPtr = prevPtr->nextPtr) { - /* Empty loop body. */ - } - if (prevPtr) { - prevPtr->nextPtr = evPtr->nextPtr; - if (evPtr->nextPtr == NULL) { - tsdPtr->lastEventPtr = prevPtr; - } - if (tsdPtr->markerEventPtr == evPtr) { - tsdPtr->markerEventPtr = prevPtr; - } - } else { - evPtr = NULL; - } - } - if (evPtr) { - ckfree((char *) evPtr); - } - Tcl_MutexUnlock(&(tsdPtr->queueMutex)); - return 1; - } else { - /* - * The event wasn't actually handled, so we have to restore - * the proc field to allow the event to be attempted again. - */ - - evPtr->proc = proc; - } - } - Tcl_MutexUnlock(&(tsdPtr->queueMutex)); - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetServiceMode -- - * - * This routine returns the current service mode of the notifier. - * - * Results: - * Returns either TCL_SERVICE_ALL or TCL_SERVICE_NONE. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetServiceMode() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - return tsdPtr->serviceMode; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetServiceMode -- - * - * This routine sets the current service mode of the tsdPtr-> - * - * Results: - * Returns the previous service mode. - * - * Side effects: - * Invokes the notifier service mode hook procedure. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_SetServiceMode(mode) - int mode; /* New service mode: TCL_SERVICE_ALL or - * TCL_SERVICE_NONE */ -{ - int oldMode; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - oldMode = tsdPtr->serviceMode; - tsdPtr->serviceMode = mode; - Tcl_ServiceModeHook(mode); - return oldMode; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetMaxBlockTime -- - * - * This procedure is invoked by event sources to tell the notifier - * how long it may block the next time it blocks. The timePtr - * argument gives a maximum time; the actual time may be less if - * some other event source requested a smaller time. - * - * Results: - * None. - * - * Side effects: - * May reduce the length of the next sleep in the tsdPtr-> - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetMaxBlockTime(timePtr) - Tcl_Time *timePtr; /* Specifies a maximum elapsed time for - * the next blocking operation in the - * event tsdPtr-> */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (!tsdPtr->blockTimeSet || (timePtr->sec < tsdPtr->blockTime.sec) - || ((timePtr->sec == tsdPtr->blockTime.sec) - && (timePtr->usec < tsdPtr->blockTime.usec))) { - tsdPtr->blockTime = *timePtr; - tsdPtr->blockTimeSet = 1; - } - - /* - * If we are called outside an event source traversal, set the - * timeout immediately. - */ - - if (!tsdPtr->inTraversal) { - if (tsdPtr->blockTimeSet) { - Tcl_SetTimer(&tsdPtr->blockTime); - } else { - Tcl_SetTimer(NULL); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DoOneEvent -- - * - * Process a single event of some sort. If there's no work to - * do, wait for an event to occur, then process it. - * - * Results: - * The return value is 1 if the procedure actually found an event - * to process. If no processing occurred, then 0 is returned (this - * can happen if the TCL_DONT_WAIT flag is set or if there are no - * event handlers to wait for in the set specified by flags). - * - * Side effects: - * May delay execution of process while waiting for an event, - * unless TCL_DONT_WAIT is set in the flags argument. Event - * sources are invoked to check for and queue events. Event - * handlers may produce arbitrary side effects. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_DoOneEvent(flags) - int flags; /* Miscellaneous flag values: may be any - * combination of TCL_DONT_WAIT, - * TCL_WINDOW_EVENTS, TCL_FILE_EVENTS, - * TCL_TIMER_EVENTS, TCL_IDLE_EVENTS, or - * others defined by event sources. */ -{ - int result = 0, oldMode; - EventSource *sourcePtr; - Tcl_Time *timePtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * The first thing we do is to service any asynchronous event - * handlers. - */ - - if (Tcl_AsyncReady()) { - (void) Tcl_AsyncInvoke((Tcl_Interp *) NULL, 0); - return 1; - } - - /* - * No event flags is equivalent to TCL_ALL_EVENTS. - */ - - if ((flags & TCL_ALL_EVENTS) == 0) { - flags |= TCL_ALL_EVENTS; - } - - /* - * Set the service mode to none so notifier event routines won't - * try to service events recursively. - */ - - oldMode = tsdPtr->serviceMode; - tsdPtr->serviceMode = TCL_SERVICE_NONE; - - /* - * The core of this procedure is an infinite loop, even though - * we only service one event. The reason for this is that we - * may be processing events that don't do anything inside of Tcl. - */ - - while (1) { - - /* - * If idle events are the only things to service, skip the - * main part of the loop and go directly to handle idle - * events (i.e. don't wait even if TCL_DONT_WAIT isn't set). - */ - - if ((flags & TCL_ALL_EVENTS) == TCL_IDLE_EVENTS) { - flags = TCL_IDLE_EVENTS|TCL_DONT_WAIT; - goto idleEvents; - } - - /* - * Ask Tcl to service a queued event, if there are any. - */ - - if (Tcl_ServiceEvent(flags)) { - result = 1; - break; - } - - /* - * If TCL_DONT_WAIT is set, be sure to poll rather than - * blocking, otherwise reset the block time to infinity. - */ - - if (flags & TCL_DONT_WAIT) { - tsdPtr->blockTime.sec = 0; - tsdPtr->blockTime.usec = 0; - tsdPtr->blockTimeSet = 1; - } else { - tsdPtr->blockTimeSet = 0; - } - - /* - * Set up all the event sources for new events. This will - * cause the block time to be updated if necessary. - */ - - tsdPtr->inTraversal = 1; - for (sourcePtr = tsdPtr->firstEventSourcePtr; sourcePtr != NULL; - sourcePtr = sourcePtr->nextPtr) { - if (sourcePtr->setupProc) { - (sourcePtr->setupProc)(sourcePtr->clientData, flags); - } - } - tsdPtr->inTraversal = 0; - - if ((flags & TCL_DONT_WAIT) || tsdPtr->blockTimeSet) { - timePtr = &tsdPtr->blockTime; - } else { - timePtr = NULL; - } - - /* - * Wait for a new event or a timeout. If Tcl_WaitForEvent - * returns -1, we should abort Tcl_DoOneEvent. - */ - - result = Tcl_WaitForEvent(timePtr); - if (result < 0) { - result = 0; - break; - } - - /* - * Check all the event sources for new events. - */ - - for (sourcePtr = tsdPtr->firstEventSourcePtr; sourcePtr != NULL; - sourcePtr = sourcePtr->nextPtr) { - if (sourcePtr->checkProc) { - (sourcePtr->checkProc)(sourcePtr->clientData, flags); - } - } - - /* - * Check for events queued by the notifier or event sources. - */ - - if (Tcl_ServiceEvent(flags)) { - result = 1; - break; - } - - /* - * We've tried everything at this point, but nobody we know - * about had anything to do. Check for idle events. If none, - * either quit or go back to the top and try again. - */ - - idleEvents: - if (flags & TCL_IDLE_EVENTS) { - if (TclServiceIdle()) { - result = 1; - break; - } - } - if (flags & TCL_DONT_WAIT) { - break; - } - - /* - * If Tcl_WaitForEvent has returned 1, - * indicating that one system event has been dispatched - * (and thus that some Tcl code might have been indirectly executed), - * we break out of the loop. - * We do this to give VwaitCmd for instance a chance to check - * if that system event had the side effect of changing the - * variable (so the vwait can return and unwind properly). - * - * NB: We will process idle events if any first, because - * otherwise we might never do the idle events if the notifier - * always gets system events. - */ - - if (result) { - break; - } - - } - - tsdPtr->serviceMode = oldMode; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ServiceAll -- - * - * This routine checks all of the event sources, processes - * events that are on the Tcl event queue, and then calls the - * any idle handlers. Platform specific notifier callbacks that - * generate events should call this routine before returning to - * the system in order to ensure that Tcl gets a chance to - * process the new events. - * - * Results: - * Returns 1 if an event or idle handler was invoked, else 0. - * - * Side effects: - * Anything that an event or idle handler may do. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ServiceAll() -{ - int result = 0; - EventSource *sourcePtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (tsdPtr->serviceMode == TCL_SERVICE_NONE) { - return result; - } - - /* - * We need to turn off event servicing like we to in Tcl_DoOneEvent, - * to avoid recursive calls. - */ - - tsdPtr->serviceMode = TCL_SERVICE_NONE; - - /* - * Check async handlers first. - */ - - if (Tcl_AsyncReady()) { - (void) Tcl_AsyncInvoke((Tcl_Interp *) NULL, 0); - } - - /* - * Make a single pass through all event sources, queued events, - * and idle handlers. Note that we wait to update the notifier - * timer until the end so we can avoid multiple changes. - */ - - tsdPtr->inTraversal = 1; - tsdPtr->blockTimeSet = 0; - - for (sourcePtr = tsdPtr->firstEventSourcePtr; sourcePtr != NULL; - sourcePtr = sourcePtr->nextPtr) { - if (sourcePtr->setupProc) { - (sourcePtr->setupProc)(sourcePtr->clientData, TCL_ALL_EVENTS); - } - } - for (sourcePtr = tsdPtr->firstEventSourcePtr; sourcePtr != NULL; - sourcePtr = sourcePtr->nextPtr) { - if (sourcePtr->checkProc) { - (sourcePtr->checkProc)(sourcePtr->clientData, TCL_ALL_EVENTS); - } - } - - while (Tcl_ServiceEvent(0)) { - result = 1; - } - if (TclServiceIdle()) { - result = 1; - } - - if (!tsdPtr->blockTimeSet) { - Tcl_SetTimer(NULL); - } else { - Tcl_SetTimer(&tsdPtr->blockTime); - } - tsdPtr->inTraversal = 0; - tsdPtr->serviceMode = TCL_SERVICE_ALL; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ThreadAlert -- - * - * This function wakes up the notifier associated with the - * specified thread (if there is one). - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_ThreadAlert(threadId) - Tcl_ThreadId threadId; /* Identifier for thread to use. */ -{ - ThreadSpecificData *tsdPtr; - - /* - * Find the notifier associated with the specified thread. - * Note that we need to hold the listLock while calling - * Tcl_AlertNotifier to avoid a race condition where - * the specified thread might destroy its notifier. - */ - - Tcl_MutexLock(&listLock); - for (tsdPtr = firstNotifierPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) { - if (tsdPtr->threadId == threadId) { - Tcl_AlertNotifier(tsdPtr->clientData); - break; - } - } - Tcl_MutexUnlock(&listLock); -} diff --git a/generic/tclObj.c b/generic/tclObj.c deleted file mode 100644 index c4895ee..0000000 --- a/generic/tclObj.c +++ /dev/null @@ -1,2088 +0,0 @@ -/* - * tclObj.c -- - * - * This file contains Tcl object-related procedures that are used by - * many Tcl commands. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclObj.c,v 1.5 1999/04/16 00:46:50 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * Table of all object types. - */ - -static Tcl_HashTable typeTable; -static int typeTableInitialized = 0; /* 0 means not yet initialized. */ -TCL_DECLARE_MUTEX(tableMutex) - -/* - * Head of the list of free Tcl_Obj structs we maintain. - */ - -Tcl_Obj *tclFreeObjList = NULL; - -/* - * The object allocator is single threaded. This mutex is referenced - * by the TclNewObj macro, however, so must be visible. - */ - -#ifdef TCL_THREADS -Tcl_Mutex tclObjMutex; -#endif - -/* - * Pointer to a heap-allocated string of length zero that the Tcl core uses - * as the value of an empty string representation for an object. This value - * is shared by all new objects allocated by Tcl_NewObj. - */ - -static char emptyString; -char *tclEmptyStringRep = &emptyString; - -/* - * The number of Tcl objects ever allocated (by Tcl_NewObj) and freed - * (by TclFreeObj). - */ - -#ifdef TCL_COMPILE_STATS -long tclObjsAlloced = 0; -long tclObjsFreed = 0; -#endif /* TCL_COMPILE_STATS */ - -/* - * Prototypes for procedures defined later in this file: - */ - -static int SetBooleanFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static int SetDoubleFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static int SetIntFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static void UpdateStringOfBoolean _ANSI_ARGS_((Tcl_Obj *objPtr)); -static void UpdateStringOfDouble _ANSI_ARGS_((Tcl_Obj *objPtr)); -static void UpdateStringOfInt _ANSI_ARGS_((Tcl_Obj *objPtr)); - -/* - * The structures below defines the Tcl object types defined in this file by - * means of procedures that can be invoked by generic object code. See also - * tclStringObj.c, tclListObj.c, tclByteCode.c for other type manager - * implementations. - */ - -Tcl_ObjType tclBooleanType = { - "boolean", /* name */ - (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */ - (Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */ - UpdateStringOfBoolean, /* updateStringProc */ - SetBooleanFromAny /* setFromAnyProc */ -}; - -Tcl_ObjType tclDoubleType = { - "double", /* name */ - (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */ - (Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */ - UpdateStringOfDouble, /* updateStringProc */ - SetDoubleFromAny /* setFromAnyProc */ -}; - -Tcl_ObjType tclIntType = { - "int", /* name */ - (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */ - (Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */ - UpdateStringOfInt, /* updateStringProc */ - SetIntFromAny /* setFromAnyProc */ -}; - -/* - *------------------------------------------------------------------------- - * - * TclInitObjectSubsystem -- - * - * This procedure is invoked to perform once-only initialization of - * the type table. It also registers the object types defined in - * this file. - * - * Results: - * None. - * - * Side effects: - * Initializes the table of defined object types "typeTable" with - * builtin object types defined in this file. - * - *------------------------------------------------------------------------- - */ - -void -TclInitObjSubsystem() -{ - Tcl_MutexLock(&tableMutex); - typeTableInitialized = 1; - Tcl_InitHashTable(&typeTable, TCL_STRING_KEYS); - Tcl_MutexUnlock(&tableMutex); - - Tcl_RegisterObjType(&tclBooleanType); - Tcl_RegisterObjType(&tclByteArrayType); - Tcl_RegisterObjType(&tclDoubleType); - Tcl_RegisterObjType(&tclIntType); - Tcl_RegisterObjType(&tclStringType); - Tcl_RegisterObjType(&tclListType); - Tcl_RegisterObjType(&tclByteCodeType); - Tcl_RegisterObjType(&tclProcBodyType); - -#ifdef TCL_COMPILE_STATS - Tcl_MutexLock(&tclObjMutex); - tclObjsAlloced = 0; - tclObjsFreed = 0; - Tcl_MutexUnlock(&tclObjMutex); -#endif -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeCompExecEnv -- - * - * This procedure is called by Tcl_Finalize to clean up the Tcl - * compilation and execution environment so it can later be properly - * reinitialized. - * - * Results: - * None. - * - * Side effects: - * Cleans up the compilation and execution environment - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeCompExecEnv() -{ - Tcl_MutexLock(&tableMutex); - if (typeTableInitialized) { - Tcl_DeleteHashTable(&typeTable); - typeTableInitialized = 0; - } - Tcl_MutexUnlock(&tableMutex); - Tcl_MutexLock(&tclObjMutex); - tclFreeObjList = NULL; - Tcl_MutexUnlock(&tclObjMutex); - - TclFinalizeCompilation(); - TclFinalizeExecution(); -} - -/* - *-------------------------------------------------------------- - * - * Tcl_RegisterObjType -- - * - * This procedure is called to register a new Tcl object type - * in the table of all object types supported by Tcl. - * - * Results: - * None. - * - * Side effects: - * The type is registered in the Tcl type table. If there was already - * a type with the same name as in typePtr, it is replaced with the - * new type. - * - *-------------------------------------------------------------- - */ - -void -Tcl_RegisterObjType(typePtr) - Tcl_ObjType *typePtr; /* Information about object type; - * storage must be statically - * allocated (must live forever). */ -{ - register Tcl_HashEntry *hPtr; - int new; - - /* - * If there's already an object type with the given name, remove it. - */ - Tcl_MutexLock(&tableMutex); - hPtr = Tcl_FindHashEntry(&typeTable, typePtr->name); - if (hPtr != (Tcl_HashEntry *) NULL) { - Tcl_DeleteHashEntry(hPtr); - } - - /* - * Now insert the new object type. - */ - - hPtr = Tcl_CreateHashEntry(&typeTable, typePtr->name, &new); - if (new) { - Tcl_SetHashValue(hPtr, typePtr); - } - Tcl_MutexUnlock(&tableMutex); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendAllObjTypes -- - * - * This procedure appends onto the argument object the name of each - * object type as a list element. This includes the builtin object - * types (e.g. int, list) as well as those added using - * Tcl_NewObj. These names can be used, for example, with - * Tcl_GetObjType to get pointers to the corresponding Tcl_ObjType - * structures. - * - * Results: - * The return value is normally TCL_OK; in this case the object - * referenced by objPtr has each type name appended to it. If an - * error occurs, TCL_ERROR is returned and the interpreter's result - * holds an error message. - * - * Side effects: - * If necessary, the object referenced by objPtr is converted into - * a list object. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_AppendAllObjTypes(interp, objPtr) - Tcl_Interp *interp; /* Interpreter used for error reporting. */ - Tcl_Obj *objPtr; /* Points to the Tcl object onto which the - * name of each registered type is appended - * as a list element. */ -{ - register Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - Tcl_ObjType *typePtr; - int result; - - /* - * This code assumes that types names do not contain embedded NULLs. - */ - - Tcl_MutexLock(&tableMutex); - for (hPtr = Tcl_FirstHashEntry(&typeTable, &search); - hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - typePtr = (Tcl_ObjType *) Tcl_GetHashValue(hPtr); - result = Tcl_ListObjAppendElement(interp, objPtr, - Tcl_NewStringObj(typePtr->name, -1)); - if (result == TCL_ERROR) { - Tcl_MutexUnlock(&tableMutex); - return result; - } - } - Tcl_MutexUnlock(&tableMutex); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetObjType -- - * - * This procedure looks up an object type by name. - * - * Results: - * If an object type with name matching "typeName" is found, a pointer - * to its Tcl_ObjType structure is returned; otherwise, NULL is - * returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_ObjType * -Tcl_GetObjType(typeName) - char *typeName; /* Name of Tcl object type to look up. */ -{ - register Tcl_HashEntry *hPtr; - Tcl_ObjType *typePtr; - - Tcl_MutexLock(&tableMutex); - hPtr = Tcl_FindHashEntry(&typeTable, typeName); - if (hPtr != (Tcl_HashEntry *) NULL) { - typePtr = (Tcl_ObjType *) Tcl_GetHashValue(hPtr); - Tcl_MutexUnlock(&tableMutex); - return typePtr; - } - Tcl_MutexUnlock(&tableMutex); - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ConvertToType -- - * - * Convert the Tcl object "objPtr" to have type "typePtr" if possible. - * - * Results: - * The return value is TCL_OK on success and TCL_ERROR on failure. If - * TCL_ERROR is returned, then the interpreter's result contains an - * error message unless "interp" is NULL. Passing a NULL "interp" - * allows this procedure to be used as a test whether the conversion - * could be done (and in fact was done). - * - * Side effects: - * Any internal representation for the old type is freed. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ConvertToType(interp, objPtr, typePtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr; /* The object to convert. */ - Tcl_ObjType *typePtr; /* The target type. */ -{ - if (objPtr->typePtr == typePtr) { - return TCL_OK; - } - - /* - * Use the target type's Tcl_SetFromAnyProc to set "objPtr"s internal - * form as appropriate for the target type. This frees the old internal - * representation. - */ - - return typePtr->setFromAnyProc(interp, objPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_NewObj -- - * - * This procedure is normally called when not debugging: i.e., when - * TCL_MEM_DEBUG is not defined. It creates new Tcl objects that denote - * the empty string. These objects have a NULL object type and NULL - * string representation byte pointer. Type managers call this routine - * to allocate new objects that they further initialize. - * - * When TCL_MEM_DEBUG is defined, this procedure just returns the - * result of calling the debugging version Tcl_DbNewObj. - * - * Results: - * The result is a newly allocated object that represents the empty - * string. The new object's typePtr is set NULL and its ref count - * is set to 0. - * - * Side effects: - * If compiling with TCL_COMPILE_STATS, this procedure increments - * the global count of allocated objects (tclObjsAlloced). - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG -#undef Tcl_NewObj - -Tcl_Obj * -Tcl_NewObj() -{ - return Tcl_DbNewObj("unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewObj() -{ - register Tcl_Obj *objPtr; - - /* - * Allocate the object using the list of free Tcl_Obj structs - * we maintain. - */ - - Tcl_MutexLock(&tclObjMutex); - if (tclFreeObjList == NULL) { - TclAllocateFreeObjects(); - } - objPtr = tclFreeObjList; - tclFreeObjList = (Tcl_Obj *) tclFreeObjList->internalRep.otherValuePtr; - - objPtr->refCount = 0; - objPtr->bytes = tclEmptyStringRep; - objPtr->length = 0; - objPtr->typePtr = NULL; -#ifdef TCL_COMPILE_STATS - tclObjsAlloced++; -#endif /* TCL_COMPILE_STATS */ - Tcl_MutexUnlock(&tclObjMutex); - return objPtr; -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbNewObj -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. It creates new Tcl objects that denote the - * empty string. It is the same as the Tcl_NewObj procedure above - * except that it calls Tcl_DbCkalloc directly with the file name and - * line number from its caller. This simplifies debugging since then - * the checkmem command will report the correct file name and line - * number when reporting objects that haven't been freed. - * - * When TCL_MEM_DEBUG is not defined, this procedure just returns the - * result of calling Tcl_NewObj. - * - * Results: - * The result is a newly allocated that represents the empty string. - * The new object's typePtr is set NULL and its ref count is set to 0. - * - * Side effects: - * If compiling with TCL_COMPILE_STATS, this procedure increments - * the global count of allocated objects (tclObjsAlloced). - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_DbNewObj(file, line) - register char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - register int line; /* Line number in the source file; used - * for debugging. */ -{ - register Tcl_Obj *objPtr; - - /* - * If debugging Tcl's memory usage, allocate the object using ckalloc. - * Otherwise, allocate it using the list of free Tcl_Obj structs we - * maintain. - */ - - objPtr = (Tcl_Obj *) Tcl_DbCkalloc(sizeof(Tcl_Obj), file, line); - objPtr->refCount = 0; - objPtr->bytes = tclEmptyStringRep; - objPtr->length = 0; - objPtr->typePtr = NULL; -#ifdef TCL_COMPILE_STATS - Tcl_MutexLock(&tclObjMutex); - tclObjsAlloced++; - Tcl_MutexUnlock(&tclObjMutex); -#endif /* TCL_COMPILE_STATS */ - return objPtr; -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_DbNewObj(file, line) - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - return Tcl_NewObj(); -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * TclAllocateFreeObjects -- - * - * Procedure to allocate a number of free Tcl_Objs. This is done using - * a single ckalloc to reduce the overhead for Tcl_Obj allocation. - * - * Assumes mutex is held. - * - * Results: - * None. - * - * Side effects: - * tclFreeObjList, the head of the list of free Tcl_Objs, is set to the - * first of a number of free Tcl_Obj's linked together by their - * internalRep.otherValuePtrs. - * - *---------------------------------------------------------------------- - */ - -#define OBJS_TO_ALLOC_EACH_TIME 100 - -void -TclAllocateFreeObjects() -{ - Tcl_Obj tmp[2]; - size_t objSizePlusPadding = /* NB: this assumes byte addressing. */ - ((int)(&(tmp[1])) - (int)(&(tmp[0]))); - size_t bytesToAlloc = (OBJS_TO_ALLOC_EACH_TIME * objSizePlusPadding); - char *basePtr; - register Tcl_Obj *prevPtr, *objPtr; - register int i; - - basePtr = (char *) ckalloc(bytesToAlloc); - memset(basePtr, 0, bytesToAlloc); - - prevPtr = NULL; - objPtr = (Tcl_Obj *) basePtr; - for (i = 0; i < OBJS_TO_ALLOC_EACH_TIME; i++) { - objPtr->internalRep.otherValuePtr = (VOID *) prevPtr; - prevPtr = objPtr; - objPtr = (Tcl_Obj *) (((char *)objPtr) + objSizePlusPadding); - } - tclFreeObjList = prevPtr; -} -#undef OBJS_TO_ALLOC_EACH_TIME - -/* - *---------------------------------------------------------------------- - * - * TclFreeObj -- - * - * This procedure frees the memory associated with the argument - * object. It is called by the tcl.h macro Tcl_DecrRefCount when an - * object's ref count is zero. It is only "public" since it must - * be callable by that macro wherever the macro is used. It should not - * be directly called by clients. - * - * Results: - * None. - * - * Side effects: - * Deallocates the storage for the object's Tcl_Obj structure - * after deallocating the string representation and calling the - * type-specific Tcl_FreeInternalRepProc to deallocate the object's - * internal representation. If compiling with TCL_COMPILE_STATS, - * this procedure increments the global count of freed objects - * (tclObjsFreed). - * - *---------------------------------------------------------------------- - */ - -void -TclFreeObj(objPtr) - register Tcl_Obj *objPtr; /* The object to be freed. */ -{ - register Tcl_ObjType *typePtr = objPtr->typePtr; - -#ifdef TCL_MEM_DEBUG - if ((objPtr)->refCount < -1) { - panic("Reference count for %lx was negative", objPtr); - } -#endif /* TCL_MEM_DEBUG */ - - if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) { - typePtr->freeIntRepProc(objPtr); - } - Tcl_InvalidateStringRep(objPtr); - - /* - * If debugging Tcl's memory usage, deallocate the object using ckfree. - * Otherwise, deallocate it by adding it onto the list of free - * Tcl_Obj structs we maintain. - */ - - Tcl_MutexLock(&tclObjMutex); -#ifdef TCL_MEM_DEBUG - ckfree((char *) objPtr); -#else - objPtr->internalRep.otherValuePtr = (VOID *) tclFreeObjList; - tclFreeObjList = objPtr; -#endif /* TCL_MEM_DEBUG */ - -#ifdef TCL_COMPILE_STATS - tclObjsFreed++; -#endif /* TCL_COMPILE_STATS */ - Tcl_MutexUnlock(&tclObjMutex); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DuplicateObj -- - * - * Create and return a new object that is a duplicate of the argument - * object. - * - * Results: - * The return value is a pointer to a newly created Tcl_Obj. This - * object has reference count 0 and the same type, if any, as the - * source object objPtr. Also: - * 1) If the source object has a valid string rep, we copy it; - * otherwise, the duplicate's string rep is set NULL to mark - * it invalid. - * 2) If the source object has an internal representation (i.e. its - * typePtr is non-NULL), the new object's internal rep is set to - * a copy; otherwise the new internal rep is marked invalid. - * - * Side effects: - * What constitutes "copying" the internal representation depends on - * the type. For example, if the argument object is a list, - * the element objects it points to will not actually be copied but - * will be shared with the duplicate list. That is, the ref counts of - * the element objects will be incremented. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_DuplicateObj(objPtr) - register Tcl_Obj *objPtr; /* The object to duplicate. */ -{ - register Tcl_ObjType *typePtr = objPtr->typePtr; - register Tcl_Obj *dupPtr; - - TclNewObj(dupPtr); - - if (objPtr->bytes == NULL) { - dupPtr->bytes = NULL; - } else if (objPtr->bytes != tclEmptyStringRep) { - int len = objPtr->length; - - dupPtr->bytes = (char *) ckalloc((unsigned) len+1); - if (len > 0) { - memcpy((VOID *) dupPtr->bytes, (VOID *) objPtr->bytes, - (unsigned) len); - } - dupPtr->bytes[len] = '\0'; - dupPtr->length = len; - } - - if (typePtr != NULL) { - if (typePtr->dupIntRepProc == NULL) { - dupPtr->internalRep = objPtr->internalRep; - dupPtr->typePtr = typePtr; - } else { - (*typePtr->dupIntRepProc)(objPtr, dupPtr); - } - } - return dupPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetString -- - * - * Returns the string representation byte array pointer for an object. - * - * Results: - * Returns a pointer to the string representation of objPtr. The byte - * array referenced by the returned pointer must not be modified by the - * caller. Furthermore, the caller must copy the bytes if they need to - * retain them since the object's string rep can change as a result of - * other operations. - * - * Side effects: - * May call the object's updateStringProc to update the string - * representation from the internal representation. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetString(objPtr) - register Tcl_Obj *objPtr; /* Object whose string rep byte pointer - * should be returned. */ -{ - if (objPtr->bytes != NULL) { - return objPtr->bytes; - } - - if (objPtr->typePtr->updateStringProc == NULL) { - panic("UpdateStringProc should not be invoked for type %s", - objPtr->typePtr->name); - } - (*objPtr->typePtr->updateStringProc)(objPtr); - return objPtr->bytes; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetStringFromObj -- - * - * Returns the string representation's byte array pointer and length - * for an object. - * - * Results: - * Returns a pointer to the string representation of objPtr. If - * lengthPtr isn't NULL, the length of the string representation is - * stored at *lengthPtr. The byte array referenced by the returned - * pointer must not be modified by the caller. Furthermore, the - * caller must copy the bytes if they need to retain them since the - * object's string rep can change as a result of other operations. - * - * Side effects: - * May call the object's updateStringProc to update the string - * representation from the internal representation. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetStringFromObj(objPtr, lengthPtr) - register Tcl_Obj *objPtr; /* Object whose string rep byte pointer - * should be returned. */ - register int *lengthPtr; /* If non-NULL, the location where the - * string rep's byte array length should be - * stored. If NULL, no length is stored. */ -{ - if (objPtr->bytes != NULL) { - if (lengthPtr != NULL) { - *lengthPtr = objPtr->length; - } - return objPtr->bytes; - } - - if (objPtr->typePtr->updateStringProc == NULL) { - panic("UpdateStringProc should not be invoked for type %s", - objPtr->typePtr->name); - } - (*objPtr->typePtr->updateStringProc)(objPtr); - if (lengthPtr != NULL) { - *lengthPtr = objPtr->length; - } - return objPtr->bytes; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InvalidateStringRep -- - * - * This procedure is called to invalidate an object's string - * representation. - * - * Results: - * None. - * - * Side effects: - * Deallocates the storage for any old string representation, then - * sets the string representation NULL to mark it invalid. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_InvalidateStringRep(objPtr) - register Tcl_Obj *objPtr; /* Object whose string rep byte pointer - * should be freed. */ -{ - if (objPtr->bytes != NULL) { - if (objPtr->bytes != tclEmptyStringRep) { - ckfree((char *) objPtr->bytes); - } - objPtr->bytes = NULL; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_NewBooleanObj -- - * - * This procedure is normally called when not debugging: i.e., when - * TCL_MEM_DEBUG is not defined. It creates a new boolean object and - * initializes it from the argument boolean value. A nonzero - * "boolValue" is coerced to 1. - * - * When TCL_MEM_DEBUG is defined, this procedure just returns the - * result of calling the debugging version Tcl_DbNewBooleanObj. - * - * Results: - * The newly created object is returned. This object will have an - * invalid string representation. The returned object has ref count 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG -#undef Tcl_NewBooleanObj - -Tcl_Obj * -Tcl_NewBooleanObj(boolValue) - register int boolValue; /* Boolean used to initialize new object. */ -{ - return Tcl_DbNewBooleanObj(boolValue, "unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewBooleanObj(boolValue) - register int boolValue; /* Boolean used to initialize new object. */ -{ - register Tcl_Obj *objPtr; - - TclNewObj(objPtr); - objPtr->bytes = NULL; - - objPtr->internalRep.longValue = (boolValue? 1 : 0); - objPtr->typePtr = &tclBooleanType; - return objPtr; -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbNewBooleanObj -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. It creates new boolean objects. It is the - * same as the Tcl_NewBooleanObj procedure above except that it calls - * Tcl_DbCkalloc directly with the file name and line number from its - * caller. This simplifies debugging since then the checkmem command - * will report the correct file name and line number when reporting - * objects that haven't been freed. - * - * When TCL_MEM_DEBUG is not defined, this procedure just returns the - * result of calling Tcl_NewBooleanObj. - * - * Results: - * The newly created object is returned. This object will have an - * invalid string representation. The returned object has ref count 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_DbNewBooleanObj(boolValue, file, line) - register int boolValue; /* Boolean used to initialize new object. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - register Tcl_Obj *objPtr; - - TclDbNewObj(objPtr, file, line); - objPtr->bytes = NULL; - - objPtr->internalRep.longValue = (boolValue? 1 : 0); - objPtr->typePtr = &tclBooleanType; - return objPtr; -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_DbNewBooleanObj(boolValue, file, line) - register int boolValue; /* Boolean used to initialize new object. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - return Tcl_NewBooleanObj(boolValue); -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetBooleanObj -- - * - * Modify an object to be a boolean object and to have the specified - * boolean value. A nonzero "boolValue" is coerced to 1. - * - * Results: - * None. - * - * Side effects: - * The object's old string rep, if any, is freed. Also, any old - * internal rep is freed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetBooleanObj(objPtr, boolValue) - register Tcl_Obj *objPtr; /* Object whose internal rep to init. */ - register int boolValue; /* Boolean used to set object's value. */ -{ - register Tcl_ObjType *oldTypePtr = objPtr->typePtr; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetBooleanObj called with shared object"); - } - - Tcl_InvalidateStringRep(objPtr); - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.longValue = (boolValue? 1 : 0); - objPtr->typePtr = &tclBooleanType; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetBooleanFromObj -- - * - * Attempt to return a boolean from the Tcl object "objPtr". If the - * object is not already a boolean, an attempt will be made to convert - * it to one. - * - * Results: - * The return value is a standard Tcl object result. If an error occurs - * during conversion, an error message is left in the interpreter's - * result unless "interp" is NULL. - * - * Side effects: - * If the object is not already a boolean, the conversion will free - * any old internal representation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetBooleanFromObj(interp, objPtr, boolPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object from which to get boolean. */ - register int *boolPtr; /* Place to store resulting boolean. */ -{ - register int result; - - result = SetBooleanFromAny(interp, objPtr); - if (result == TCL_OK) { - *boolPtr = (int) objPtr->internalRep.longValue; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * SetBooleanFromAny -- - * - * Attempt to generate a boolean internal form for the Tcl object - * "objPtr". - * - * Results: - * The return value is a standard Tcl result. If an error occurs during - * conversion, an error message is left in the interpreter's result - * unless "interp" is NULL. - * - * Side effects: - * If no error occurs, an integer 1 or 0 is stored as "objPtr"s - * internal representation and the type of "objPtr" is set to boolean. - * - *---------------------------------------------------------------------- - */ - -static int -SetBooleanFromAny(interp, objPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object to convert. */ -{ - Tcl_ObjType *oldTypePtr = objPtr->typePtr; - char *string, *end; - register char c; - char lowerCase[10]; - int newBool, length; - register int i; - double dbl; - - /* - * Get the string representation. Make it up-to-date if necessary. - */ - - string = Tcl_GetStringFromObj(objPtr, &length); - - /* - * Copy the string converting its characters to lower case. - */ - - for (i = 0; (i < 9) && (i < length); i++) { - c = string[i]; - /* - * Weed out international characters so we can safely operate - * on single bytes. - */ - - if (c & 0x80) { - goto badBoolean; - } - if (isupper(UCHAR(c))) { /* INTL: ISO only. */ - c = (char) UCHAR(tolower(UCHAR(c))); /* INTL: ISO only. */ - } - lowerCase[i] = c; - } - lowerCase[i] = 0; - - /* - * Parse the string as a boolean. We use an implementation here that - * doesn't report errors in interp if interp is NULL. - */ - - c = lowerCase[0]; - if ((c == '0') && (lowerCase[1] == '\0')) { - newBool = 0; - } else if ((c == '1') && (lowerCase[1] == '\0')) { - newBool = 1; - } else if ((c == 'y') && (strncmp(lowerCase, "yes", (size_t) length) == 0)) { - newBool = 1; - } else if ((c == 'n') && (strncmp(lowerCase, "no", (size_t) length) == 0)) { - newBool = 0; - } else if ((c == 't') && (strncmp(lowerCase, "true", (size_t) length) == 0)) { - newBool = 1; - } else if ((c == 'f') && (strncmp(lowerCase, "false", (size_t) length) == 0)) { - newBool = 0; - } else if ((c == 'o') && (length >= 2)) { - if (strncmp(lowerCase, "on", (size_t) length) == 0) { - newBool = 1; - } else if (strncmp(lowerCase, "off", (size_t) length) == 0) { - newBool = 0; - } else { - goto badBoolean; - } - } else { - /* - * Still might be a string containing the characters representing an - * int or double that wasn't handled above. This would be a string - * like "27" or "1.0" that is non-zero and not "1". Such a string - * whould result in the boolean value true. We try converting to - * double. If that succeeds and the resulting double is non-zero, we - * have a "true". Note that numbers can't have embedded NULLs. - */ - - dbl = strtod(string, &end); - if (end == string) { - goto badBoolean; - } - - /* - * Make sure the string has no garbage after the end of the double. - */ - - while ((end < (string+length)) - && isspace(UCHAR(*end))) { /* INTL: ISO only */ - end++; - } - if (end != (string+length)) { - goto badBoolean; - } - newBool = (dbl != 0.0); - } - - /* - * Free the old internalRep before setting the new one. We do this as - * late as possible to allow the conversion code, in particular - * Tcl_GetStringFromObj, to use that old internalRep. - */ - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.longValue = newBool; - objPtr->typePtr = &tclBooleanType; - return TCL_OK; - - badBoolean: - if (interp != NULL) { - /* - * Must copy string before resetting the result in case a caller - * is trying to convert the interpreter's result to a boolean. - */ - - char buf[100]; - sprintf(buf, "expected boolean value but got \"%.50s\"", string); - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), buf, -1); - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateStringOfBoolean -- - * - * Update the string representation for a boolean object. - * Note: This procedure 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 boolean-to-string conversion. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateStringOfBoolean(objPtr) - register Tcl_Obj *objPtr; /* Int object whose string rep to update. */ -{ - char *s = ckalloc((unsigned) 2); - - s[0] = (char) (objPtr->internalRep.longValue? '1' : '0'); - s[1] = '\0'; - objPtr->bytes = s; - objPtr->length = 1; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_NewDoubleObj -- - * - * This procedure is normally called when not debugging: i.e., when - * TCL_MEM_DEBUG is not defined. It creates a new double object and - * initializes it from the argument double value. - * - * When TCL_MEM_DEBUG is defined, this procedure just returns the - * result of calling the debugging version Tcl_DbNewDoubleObj. - * - * Results: - * The newly created object is returned. This object will have an - * invalid string representation. The returned object has ref count 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG -#undef Tcl_NewDoubleObj - -Tcl_Obj * -Tcl_NewDoubleObj(dblValue) - register double dblValue; /* Double used to initialize the object. */ -{ - return Tcl_DbNewDoubleObj(dblValue, "unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewDoubleObj(dblValue) - register double dblValue; /* Double used to initialize the object. */ -{ - register Tcl_Obj *objPtr; - - TclNewObj(objPtr); - objPtr->bytes = NULL; - - objPtr->internalRep.doubleValue = dblValue; - objPtr->typePtr = &tclDoubleType; - return objPtr; -} -#endif /* if TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbNewDoubleObj -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. It creates new double objects. It is the - * same as the Tcl_NewDoubleObj procedure above except that it calls - * Tcl_DbCkalloc directly with the file name and line number from its - * caller. This simplifies debugging since then the checkmem command - * will report the correct file name and line number when reporting - * objects that haven't been freed. - * - * When TCL_MEM_DEBUG is not defined, this procedure just returns the - * result of calling Tcl_NewDoubleObj. - * - * Results: - * The newly created object is returned. This object will have an - * invalid string representation. The returned object has ref count 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_DbNewDoubleObj(dblValue, file, line) - register double dblValue; /* Double used to initialize the object. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - register Tcl_Obj *objPtr; - - TclDbNewObj(objPtr, file, line); - objPtr->bytes = NULL; - - objPtr->internalRep.doubleValue = dblValue; - objPtr->typePtr = &tclDoubleType; - return objPtr; -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_DbNewDoubleObj(dblValue, file, line) - register double dblValue; /* Double used to initialize the object. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - return Tcl_NewDoubleObj(dblValue); -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetDoubleObj -- - * - * Modify an object to be a double object and to have the specified - * double value. - * - * Results: - * None. - * - * Side effects: - * The object's old string rep, if any, is freed. Also, any old - * internal rep is freed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetDoubleObj(objPtr, dblValue) - register Tcl_Obj *objPtr; /* Object whose internal rep to init. */ - register double dblValue; /* Double used to set the object's value. */ -{ - register Tcl_ObjType *oldTypePtr = objPtr->typePtr; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetDoubleObj called with shared object"); - } - - Tcl_InvalidateStringRep(objPtr); - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.doubleValue = dblValue; - objPtr->typePtr = &tclDoubleType; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetDoubleFromObj -- - * - * Attempt to return a double from the Tcl object "objPtr". If the - * object is not already a double, an attempt will be made to convert - * it to one. - * - * Results: - * The return value is a standard Tcl object result. If an error occurs - * during conversion, an error message is left in the interpreter's - * result unless "interp" is NULL. - * - * Side effects: - * If the object is not already a double, the conversion will free - * any old internal representation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetDoubleFromObj(interp, objPtr, dblPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object from which to get a double. */ - register double *dblPtr; /* Place to store resulting double. */ -{ - register int result; - - if (objPtr->typePtr == &tclDoubleType) { - *dblPtr = objPtr->internalRep.doubleValue; - return TCL_OK; - } - - result = SetDoubleFromAny(interp, objPtr); - if (result == TCL_OK) { - *dblPtr = objPtr->internalRep.doubleValue; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * SetDoubleFromAny -- - * - * Attempt to generate an double-precision floating point internal form - * for the Tcl object "objPtr". - * - * Results: - * The return value is a standard Tcl object result. If an error occurs - * during conversion, an error message is left in the interpreter's - * result unless "interp" is NULL. - * - * Side effects: - * If no error occurs, a double is stored as "objPtr"s internal - * representation. - * - *---------------------------------------------------------------------- - */ - -static int -SetDoubleFromAny(interp, objPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object to convert. */ -{ - Tcl_ObjType *oldTypePtr = objPtr->typePtr; - char *string, *end; - double newDouble; - int length; - - /* - * Get the string representation. Make it up-to-date if necessary. - */ - - string = Tcl_GetStringFromObj(objPtr, &length); - - /* - * Now parse "objPtr"s string as an double. Numbers can't have embedded - * NULLs. We use an implementation here that doesn't report errors in - * interp if interp is NULL. - */ - - errno = 0; - newDouble = strtod(string, &end); - if (end == string) { - badDouble: - if (interp != NULL) { - /* - * Must copy string before resetting the result in case a caller - * is trying to convert the interpreter's result to an int. - */ - - char buf[100]; - sprintf(buf, "expected floating-point number but got \"%.50s\"", - string); - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), buf, -1); - } - return TCL_ERROR; - } - if (errno != 0) { - if (interp != NULL) { - TclExprFloatError(interp, newDouble); - } - return TCL_ERROR; - } - - /* - * Make sure that the string has no garbage after the end of the double. - */ - - while ((end < (string+length)) - && isspace(UCHAR(*end))) { /* INTL: ISO space. */ - end++; - } - if (end != (string+length)) { - goto badDouble; - } - - /* - * The conversion to double succeeded. Free the old internalRep before - * setting the new one. We do this as late as possible to allow the - * conversion code, in particular Tcl_GetStringFromObj, to use that old - * internalRep. - */ - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.doubleValue = newDouble; - objPtr->typePtr = &tclDoubleType; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateStringOfDouble -- - * - * Update the string representation for a double-precision floating - * point object. This must obey the current tcl_precision value for - * double-to-string conversions. Note: This procedure 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 double-to-string conversion. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateStringOfDouble(objPtr) - register Tcl_Obj *objPtr; /* Double obj with string rep to update. */ -{ - char buffer[TCL_DOUBLE_SPACE]; - register int len; - - Tcl_PrintDouble((Tcl_Interp *) NULL, objPtr->internalRep.doubleValue, - buffer); - len = strlen(buffer); - - objPtr->bytes = (char *) ckalloc((unsigned) len + 1); - strcpy(objPtr->bytes, buffer); - objPtr->length = len; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_NewIntObj -- - * - * If a client is compiled with TCL_MEM_DEBUG defined, calls to - * Tcl_NewIntObj to create a new integer object end up calling the - * debugging procedure Tcl_DbNewLongObj instead. - * - * Otherwise, if the client is compiled without TCL_MEM_DEBUG defined, - * calls to Tcl_NewIntObj result in a call to one of the two - * Tcl_NewIntObj implementations below. We provide two implementations - * so that the Tcl core can be compiled to do memory debugging of the - * core even if a client does not request it for itself. - * - * Integer and long integer objects share the same "integer" type - * implementation. We store all integers as longs and Tcl_GetIntFromObj - * checks whether the current value of the long can be represented by - * an int. - * - * Results: - * The newly created object is returned. This object will have an - * invalid string representation. The returned object has ref count 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG -#undef Tcl_NewIntObj - -Tcl_Obj * -Tcl_NewIntObj(intValue) - register int intValue; /* Int used to initialize the new object. */ -{ - return Tcl_DbNewLongObj((long)intValue, "unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewIntObj(intValue) - register int intValue; /* Int used to initialize the new object. */ -{ - register Tcl_Obj *objPtr; - - TclNewObj(objPtr); - objPtr->bytes = NULL; - - objPtr->internalRep.longValue = (long)intValue; - objPtr->typePtr = &tclIntType; - return objPtr; -} -#endif /* if TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetIntObj -- - * - * Modify an object to be an integer and to have the specified integer - * value. - * - * Results: - * None. - * - * Side effects: - * The object's old string rep, if any, is freed. Also, any old - * internal rep is freed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetIntObj(objPtr, intValue) - register Tcl_Obj *objPtr; /* Object whose internal rep to init. */ - register int intValue; /* Integer used to set object's value. */ -{ - register Tcl_ObjType *oldTypePtr = objPtr->typePtr; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetIntObj called with shared object"); - } - - Tcl_InvalidateStringRep(objPtr); - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.longValue = (long) intValue; - objPtr->typePtr = &tclIntType; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetIntFromObj -- - * - * Attempt to return an int from the Tcl object "objPtr". If the object - * is not already an int, an attempt will be made to convert it to one. - * - * Integer and long integer objects share the same "integer" type - * implementation. We store all integers as longs and Tcl_GetIntFromObj - * checks whether the current value of the long can be represented by - * an int. - * - * Results: - * The return value is a standard Tcl object result. If an error occurs - * during conversion or if the long integer held by the object - * can not be represented by an int, an error message is left in - * the interpreter's result unless "interp" is NULL. - * - * Side effects: - * If the object is not already an int, the conversion will free - * any old internal representation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetIntFromObj(interp, objPtr, intPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object from which to get a int. */ - register int *intPtr; /* Place to store resulting int. */ -{ - register long l; - int result; - - if (objPtr->typePtr != &tclIntType) { - result = SetIntFromAny(interp, objPtr); - if (result != TCL_OK) { - return result; - } - } - l = objPtr->internalRep.longValue; - if (((long)((int)l)) == l) { - *intPtr = (int)objPtr->internalRep.longValue; - return TCL_OK; - } - if (interp != NULL) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "integer value too large to represent as non-long integer", -1); - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * SetIntFromAny -- - * - * Attempt to generate an integer internal form for the Tcl object - * "objPtr". - * - * 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. - * - * Side effects: - * If no error occurs, an int is stored as "objPtr"s internal - * representation. - * - *---------------------------------------------------------------------- - */ - -static int -SetIntFromAny(interp, objPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object to convert. */ -{ - Tcl_ObjType *oldTypePtr = objPtr->typePtr; - char *string, *end; - int length; - register char *p; - long newLong; - - /* - * Get the string representation. Make it up-to-date if necessary. - */ - - string = Tcl_GetStringFromObj(objPtr, &length); - - /* - * Now parse "objPtr"s string as an int. We use an implementation here - * that doesn't report errors in interp if interp is NULL. Note: use - * strtoul instead of strtol for integer conversions to allow full-size - * unsigned numbers, but don't depend on strtoul to handle sign - * characters; it won't in some implementations. - */ - - errno = 0; - for (p = string; isspace(UCHAR(*p)); p++) { /* INTL: ISO space. */ - /* Empty loop body. */ - } - if (*p == '-') { - p++; - newLong = -((long)strtoul(p, &end, 0)); - } else if (*p == '+') { - p++; - newLong = strtoul(p, &end, 0); - } else { - newLong = strtoul(p, &end, 0); - } - if (end == p) { - badInteger: - if (interp != NULL) { - /* - * Must copy string before resetting the result in case a caller - * is trying to convert the interpreter's result to an int. - */ - - char buf[100]; - sprintf(buf, "expected integer but got \"%.50s\"", string); - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), buf, -1); - } - return TCL_ERROR; - } - if (errno == ERANGE) { - if (interp != NULL) { - char *s = "integer value too large to represent"; - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), s, -1); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (char *) NULL); - } - return TCL_ERROR; - } - - /* - * Make sure that the string has no garbage after the end of the int. - */ - - while ((end < (string+length)) - && isspace(UCHAR(*end))) { /* INTL: ISO space. */ - end++; - } - if (end != (string+length)) { - goto badInteger; - } - - /* - * The conversion to int succeeded. Free the old internalRep before - * setting the new one. We do this as late as possible to allow the - * conversion code, in particular Tcl_GetStringFromObj, to use that old - * internalRep. - */ - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.longValue = newLong; - objPtr->typePtr = &tclIntType; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateStringOfInt -- - * - * Update the string representation for an integer object. - * Note: This procedure 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 int-to-string conversion. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateStringOfInt(objPtr) - register Tcl_Obj *objPtr; /* Int object whose string rep to update. */ -{ - char buffer[TCL_INTEGER_SPACE]; - register int len; - - len = TclFormatInt(buffer, objPtr->internalRep.longValue); - - objPtr->bytes = ckalloc((unsigned) len + 1); - strcpy(objPtr->bytes, buffer); - objPtr->length = len; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_NewLongObj -- - * - * If a client is compiled with TCL_MEM_DEBUG defined, calls to - * Tcl_NewLongObj to create a new long integer object end up calling - * the debugging procedure Tcl_DbNewLongObj instead. - * - * Otherwise, if the client is compiled without TCL_MEM_DEBUG defined, - * calls to Tcl_NewLongObj result in a call to one of the two - * Tcl_NewLongObj implementations below. We provide two implementations - * so that the Tcl core can be compiled to do memory debugging of the - * core even if a client does not request it for itself. - * - * Integer and long integer objects share the same "integer" type - * implementation. We store all integers as longs and Tcl_GetIntFromObj - * checks whether the current value of the long can be represented by - * an int. - * - * Results: - * The newly created object is returned. This object will have an - * invalid string representation. The returned object has ref count 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG -#undef Tcl_NewLongObj - -Tcl_Obj * -Tcl_NewLongObj(longValue) - register long longValue; /* Long integer used to initialize the - * new object. */ -{ - return Tcl_DbNewLongObj(longValue, "unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewLongObj(longValue) - register long longValue; /* Long integer used to initialize the - * new object. */ -{ - register Tcl_Obj *objPtr; - - TclNewObj(objPtr); - objPtr->bytes = NULL; - - objPtr->internalRep.longValue = longValue; - objPtr->typePtr = &tclIntType; - return objPtr; -} -#endif /* if TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbNewLongObj -- - * - * If a client is compiled with TCL_MEM_DEBUG defined, calls to - * Tcl_NewIntObj and Tcl_NewLongObj to create new integer or - * long integer objects end up calling the debugging procedure - * Tcl_DbNewLongObj instead. We provide two implementations of - * Tcl_DbNewLongObj so that whether the Tcl core is compiled to do - * memory debugging of the core is independent of whether a client - * requests debugging for itself. - * - * When the core is compiled with TCL_MEM_DEBUG defined, - * Tcl_DbNewLongObj calls Tcl_DbCkalloc directly with the file name and - * line number from its caller. This simplifies debugging since then - * the checkmem command will report the caller's file name and line - * number when reporting objects that haven't been freed. - * - * Otherwise, when the core is compiled without TCL_MEM_DEBUG defined, - * this procedure just returns the result of calling Tcl_NewLongObj. - * - * Results: - * The newly created long integer object is returned. This object - * will have an invalid string representation. The returned object has - * ref count 0. - * - * Side effects: - * Allocates memory. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_DbNewLongObj(longValue, file, line) - register long longValue; /* Long integer used to initialize the - * new object. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - register Tcl_Obj *objPtr; - - TclDbNewObj(objPtr, file, line); - objPtr->bytes = NULL; - - objPtr->internalRep.longValue = longValue; - objPtr->typePtr = &tclIntType; - return objPtr; -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_DbNewLongObj(longValue, file, line) - register long longValue; /* Long integer used to initialize the - * new object. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - return Tcl_NewLongObj(longValue); -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetLongObj -- - * - * Modify an object to be an integer object and to have the specified - * long integer value. - * - * Results: - * None. - * - * Side effects: - * The object's old string rep, if any, is freed. Also, any old - * internal rep is freed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetLongObj(objPtr, longValue) - register Tcl_Obj *objPtr; /* Object whose internal rep to init. */ - register long longValue; /* Long integer used to initialize the - * object's value. */ -{ - register Tcl_ObjType *oldTypePtr = objPtr->typePtr; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetLongObj called with shared object"); - } - - Tcl_InvalidateStringRep(objPtr); - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.longValue = longValue; - objPtr->typePtr = &tclIntType; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetLongFromObj -- - * - * Attempt to return an long integer from the Tcl object "objPtr". If - * the object is not already an int object, an attempt will be made to - * convert it to one. - * - * Results: - * The return value is a standard Tcl object result. If an error occurs - * during conversion, an error message is left in the interpreter's - * result unless "interp" is NULL. - * - * Side effects: - * If the object is not already an int object, the conversion will free - * any old internal representation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetLongFromObj(interp, objPtr, longPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr; /* The object from which to get a long. */ - register long *longPtr; /* Place to store resulting long. */ -{ - register int result; - - if (objPtr->typePtr == &tclIntType) { - *longPtr = objPtr->internalRep.longValue; - return TCL_OK; - } - result = SetIntFromAny(interp, objPtr); - if (result == TCL_OK) { - *longPtr = objPtr->internalRep.longValue; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbIncrRefCount -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. This checks to see whether or not - * the memory has been freed before incrementing the ref count. - * - * When TCL_MEM_DEBUG is not defined, this procedure just increments - * the reference count of the object. - * - * Results: - * None. - * - * Side effects: - * The object's ref count is incremented. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DbIncrRefCount(objPtr, file, line) - register Tcl_Obj *objPtr; /* The object we are registering a - * reference to. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ -#ifdef TCL_MEM_DEBUG - if (objPtr->refCount == 0x61616161) { - fprintf(stderr, "file = %s, line = %d\n", file, line); - fflush(stderr); - panic("Trying to increment refCount of previously disposed object."); - } -#endif - ++(objPtr)->refCount; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbDecrRefCount -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. This checks to see whether or not - * the memory has been freed before decrementing the ref count. - * - * When TCL_MEM_DEBUG is not defined, this procedure just decrements - * the reference count of the object. - * - * Results: - * None. - * - * Side effects: - * The object's ref count is incremented. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DbDecrRefCount(objPtr, file, line) - register Tcl_Obj *objPtr; /* The object we are releasing a reference - * to. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ -#ifdef TCL_MEM_DEBUG - if (objPtr->refCount == 0x61616161) { - fprintf(stderr, "file = %s, line = %d\n", file, line); - fflush(stderr); - panic("Trying to decrement refCount of previously disposed object."); - } -#endif - if (--(objPtr)->refCount <= 0) { - TclFreeObj(objPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbIsShared -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. It tests whether the object has a ref - * count greater than one. - * - * When TCL_MEM_DEBUG is not defined, this procedure just tests - * if the object has a ref count greater than one. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_DbIsShared(objPtr, file, line) - register Tcl_Obj *objPtr; /* The object to test for being shared. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ -#ifdef TCL_MEM_DEBUG - if (objPtr->refCount == 0x61616161) { - fprintf(stderr, "file = %s, line = %d\n", file, line); - fflush(stderr); - panic("Trying to check whether previously disposed object is shared."); - } -#endif - return ((objPtr)->refCount > 1); -} diff --git a/generic/tclPanic.c b/generic/tclPanic.c deleted file mode 100644 index 87bc177..0000000 --- a/generic/tclPanic.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * tclPanic.c -- - * - * Source code for the "Tcl_Panic" library procedure for Tcl; - * individual applications will probably override this with - * an application-specific panic procedure. - * - * Copyright (c) 1988-1993 The Regents of the University of California. - * Copyright (c) 1994 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. - * - * RCS: @(#) $Id: tclPanic.c,v 1.2 1999/03/04 01:01:59 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * The panicProc variable contains a pointer to an application - * specific panic procedure. - */ - -void (*panicProc) _ANSI_ARGS_(TCL_VARARGS(char *,format)) = NULL; - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetPanicProc -- - * - * Replace the default panic behavior with the specified functiion. - * - * Results: - * None. - * - * Side effects: - * Sets the panicProc variable. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetPanicProc(proc) - void (*proc) _ANSI_ARGS_(TCL_VARARGS(char *,format)); -{ - panicProc = proc; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PanicVA -- - * - * Print an error message and kill the process. - * - * Results: - * None. - * - * Side effects: - * The process dies, entering the debugger if possible. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_PanicVA (format, argList) - char *format; /* Format string, suitable for passing to - * fprintf. */ - va_list argList; /* Variable argument list. */ -{ - char *arg1, *arg2, *arg3, *arg4; /* Additional arguments (variable in - * number) to pass to fprintf. */ - char *arg5, *arg6, *arg7, *arg8; - - arg1 = va_arg(argList, char *); - arg2 = va_arg(argList, char *); - arg3 = va_arg(argList, char *); - arg4 = va_arg(argList, char *); - arg5 = va_arg(argList, char *); - arg6 = va_arg(argList, char *); - arg7 = va_arg(argList, char *); - arg8 = va_arg(argList, char *); - - if (panicProc != NULL) { - (void) (*panicProc)(format, arg1, arg2, arg3, arg4, - arg5, arg6, arg7, arg8); - } else { - (void) fprintf(stderr, format, arg1, arg2, arg3, arg4, arg5, arg6, - arg7, arg8); - (void) fprintf(stderr, "\n"); - (void) fflush(stderr); - abort(); - } -} - -/* - *---------------------------------------------------------------------- - * - * panic -- - * - * Print an error message and kill the process. - * - * Results: - * None. - * - * Side effects: - * The process dies, entering the debugger if possible. - * - *---------------------------------------------------------------------- - */ - - /* VARARGS ARGSUSED */ -void -panic TCL_VARARGS_DEF(char *,arg1) -{ - va_list argList; - char *format; - - format = TCL_VARARGS_START(char *,arg1,argList); - Tcl_PanicVA(format, argList); - va_end (argList); -} diff --git a/generic/tclParse.c b/generic/tclParse.c deleted file mode 100644 index 679b039..0000000 --- a/generic/tclParse.c +++ /dev/null @@ -1,2224 +0,0 @@ -/* - * tclParse.c -- - * - * This file contains procedures that parse Tcl scripts. They - * do so in a general-purpose fashion that can be used for many - * different purposes, including compilation, direct execution, - * code analysis, etc. This file also includes a few additional - * procedures such as Tcl_EvalObjv, Tcl_Eval, and Tcl_EvalEx, which - * allow scripts to be evaluated directly, without compiling. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclParse.c,v 1.3 1999/04/16 00:46:51 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * The following table provides parsing information about each possible - * 8-bit character. The table is designed to be referenced with either - * signed or unsigned characters, so it has 384 entries. The first 128 - * entries correspond to negative character values, the next 256 correspond - * to positive character values. The last 128 entries are identical to the - * first 128. The table is always indexed with a 128-byte offset (the 128th - * entry corresponds to a character value of 0). - * - * The macro CHAR_TYPE is used to index into the table and return - * information about its character argument. The following return - * values are defined. - * - * TYPE_NORMAL - All characters that don't have special significance - * to the Tcl parser. - * TYPE_SPACE - The character is a whitespace character other - * than newline. - * TYPE_COMMAND_END - Character is newline or semicolon. - * TYPE_SUBS - Character begins a substitution or has other - * special meaning in ParseTokens: backslash, dollar - * sign, open bracket, or null. - * TYPE_QUOTE - Character is a double quote. - * TYPE_CLOSE_PAREN - Character is a right parenthesis. - * TYPE_CLOSE_BRACK - Character is a right square bracket. - * TYPE_BRACE - Character is a curly brace (either left or right). - */ - -#define TYPE_NORMAL 0 -#define TYPE_SPACE 0x1 -#define TYPE_COMMAND_END 0x2 -#define TYPE_SUBS 0x4 -#define TYPE_QUOTE 0x8 -#define TYPE_CLOSE_PAREN 0x10 -#define TYPE_CLOSE_BRACK 0x20 -#define TYPE_BRACE 0x40 - -#define CHAR_TYPE(c) (typeTable+128)[(int)(c)] - -char typeTable[] = { - /* - * Negative character values, from -128 to -1: - */ - - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - - /* - * Positive character values, from 0-127: - */ - - TYPE_SUBS, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_SPACE, TYPE_COMMAND_END, TYPE_SPACE, - TYPE_SPACE, TYPE_SPACE, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_SPACE, TYPE_NORMAL, TYPE_QUOTE, TYPE_NORMAL, - TYPE_SUBS, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_CLOSE_PAREN, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_COMMAND_END, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_SUBS, - TYPE_SUBS, TYPE_CLOSE_BRACK, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_BRACE, - TYPE_NORMAL, TYPE_BRACE, TYPE_NORMAL, TYPE_NORMAL, - - /* - * Large unsigned character values, from 128-255: - */ - - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, - TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, TYPE_NORMAL, -}; - -/* - * Prototypes for local procedures defined in this file: - */ - -static int CommandComplete _ANSI_ARGS_((char *script, - int length)); -static int ParseTokens _ANSI_ARGS_((char *src, int mask, - Tcl_Parse *parsePtr)); -static int EvalObjv _ANSI_ARGS_((Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], char *command, int length, - int flags)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_ParseCommand -- - * - * Given a string, this procedure parses the first Tcl command - * in the string and returns information about the structure of - * the command. - * - * Results: - * The return value is TCL_OK if the command was parsed - * successfully and TCL_ERROR otherwise. If an error occurs - * and interp isn't NULL then an error message is left in - * its result. On a successful return, parsePtr is filled in - * with information about the command that was parsed. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the command, then additional space is - * malloc-ed. If the procedure returns TCL_OK then the caller must - * eventually invoke Tcl_FreeParse to release any additional space - * that was allocated. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ParseCommand(interp, string, numBytes, nested, parsePtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting; - * if NULL, then no error message is - * provided. */ - char *string; /* First character of string containing - * one or more Tcl commands. The string - * must be in writable memory and must - * have one additional byte of space at - * string[length] where we can - * temporarily store a 0 sentinel - * character. */ - int numBytes; /* Total number of bytes in string. If < 0, - * the script consists of all bytes up to - * the first null character. */ - int nested; /* Non-zero means this is a nested command: - * close bracket should be considered - * a command terminator. If zero, then close - * bracket has no special meaning. */ - register Tcl_Parse *parsePtr; - /* Structure to fill in with information - * about the parsed command; any previous - * information in the structure is - * ignored. */ -{ - register char *src; /* Points to current character - * in the command. */ - int type; /* Result returned by CHAR_TYPE(*src). */ - Tcl_Token *tokenPtr; /* Pointer to token being filled in. */ - int wordIndex; /* Index of word token for current word. */ - char utfBytes[TCL_UTF_MAX]; /* Holds result of backslash substitution. */ - int terminators; /* CHAR_TYPE bits that indicate the end - * of a command. */ - char *termPtr; /* Set by Tcl_ParseBraces/QuotedString to - * point to char after terminating one. */ - int length, savedChar; - - - if (numBytes < 0) { - numBytes = (string? strlen(string) : 0); - } - parsePtr->commentStart = NULL; - parsePtr->commentSize = 0; - parsePtr->commandStart = NULL; - parsePtr->commandSize = 0; - parsePtr->numWords = 0; - parsePtr->tokenPtr = parsePtr->staticTokens; - parsePtr->numTokens = 0; - parsePtr->tokensAvailable = NUM_STATIC_TOKENS; - parsePtr->string = string; - parsePtr->end = string + numBytes; - parsePtr->interp = interp; - parsePtr->incomplete = 0; - if (nested != 0) { - terminators = TYPE_COMMAND_END | TYPE_CLOSE_BRACK; - } else { - terminators = TYPE_COMMAND_END; - } - - /* - * Temporarily overwrite the character just after the end of the - * string with a 0 byte. This acts as a sentinel and reduces the - * number of places where we have to check for the end of the - * input string. The original value of the byte is restored at - * the end of the parse. - */ - - savedChar = string[numBytes]; - string[numBytes] = 0; - - /* - * Parse any leading space and comments before the first word of the - * command. - */ - - src = string; - while (1) { - while ((CHAR_TYPE(*src) == TYPE_SPACE) || (*src == '\n')) { - src++; - } - if ((*src == '\\') && (src[1] == '\n')) { - /* - * Skip backslash-newline sequence: it should be treated - * just like white space. - */ - - if ((src + 2) == parsePtr->end) { - parsePtr->incomplete = 1; - } - src += 2; - continue; - } - if (*src != '#') { - break; - } - if (parsePtr->commentStart == NULL) { - parsePtr->commentStart = src; - } - while (1) { - if (src == parsePtr->end) { - if (nested) { - parsePtr->incomplete = nested; - } - parsePtr->commentSize = src - parsePtr->commentStart; - break; - } else if (*src == '\\') { - if ((src[1] == '\n') && ((src + 2) == parsePtr->end)) { - parsePtr->incomplete = 1; - } - Tcl_UtfBackslash(src, &length, utfBytes); - src += length; - } else if (*src == '\n') { - src++; - parsePtr->commentSize = src - parsePtr->commentStart; - break; - } else { - src++; - } - } - } - - /* - * The following loop parses the words of the command, one word - * in each iteration through the loop. - */ - - parsePtr->commandStart = src; - while (1) { - /* - * Create the token for the word. - */ - - if (parsePtr->numTokens == parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - wordIndex = parsePtr->numTokens; - tokenPtr = &parsePtr->tokenPtr[wordIndex]; - tokenPtr->type = TCL_TOKEN_WORD; - - /* - * Skip white space before the word. Also skip a backslash-newline - * sequence: it should be treated just like white space. - */ - - while (1) { - type = CHAR_TYPE(*src); - if (type == TYPE_SPACE) { - src++; - continue; - } else if ((*src == '\\') && (src[1] == '\n')) { - if ((src + 2) == parsePtr->end) { - parsePtr->incomplete = 1; - } - Tcl_UtfBackslash(src, &length, utfBytes); - src += length; - continue; - } - break; - } - if ((type & terminators) != 0) { - src++; - break; - } - if (src == parsePtr->end) { - break; - } - tokenPtr->start = src; - parsePtr->numTokens++; - parsePtr->numWords++; - - /* - * At this point the word can have one of three forms: something - * enclosed in quotes, something enclosed in braces, or an - * unquoted word (anything else). - */ - - if (*src == '"') { - if (Tcl_ParseQuotedString(interp, src, (parsePtr->end - src), - parsePtr, 1, &termPtr) != TCL_OK) { - goto error; - } - src = termPtr; - } else if (*src == '{') { - if (Tcl_ParseBraces(interp, src, (parsePtr->end - src), - parsePtr, 1, &termPtr) != TCL_OK) { - goto error; - } - src = termPtr; - } else { - /* - * This is an unquoted word. Call ParseTokens and let it do - * all of the work. - */ - - if (ParseTokens(src, TYPE_SPACE|terminators, - parsePtr) != TCL_OK) { - goto error; - } - src = parsePtr->term; - } - - /* - * Finish filling in the token for the word and check for the - * special case of a word consisting of a single range of - * literal text. - */ - - tokenPtr = &parsePtr->tokenPtr[wordIndex]; - tokenPtr->size = src - tokenPtr->start; - tokenPtr->numComponents = parsePtr->numTokens - (wordIndex + 1); - if ((tokenPtr->numComponents == 1) - && (tokenPtr[1].type == TCL_TOKEN_TEXT)) { - tokenPtr->type = TCL_TOKEN_SIMPLE_WORD; - } - - /* - * Do two additional checks: (a) make sure we're really at the - * end of a word (there might have been garbage left after a - * quoted or braced word), and (b) check for the end of the - * command. - */ - - type = CHAR_TYPE(*src); - if (type == TYPE_SPACE) { - src++; - continue; - } else { - /* - * Backslash-newline (and any following white space) must be - * treated as if it were a space character. - */ - - if ((*src == '\\') && (src[1] == '\n')) { - if ((src + 2) == parsePtr->end) { - parsePtr->incomplete = 1; - } - Tcl_UtfBackslash(src, &length, utfBytes); - src += length; - continue; - } - } - - if ((type & terminators) != 0) { - src++; - break; - } - if (src == parsePtr->end) { - break; - } - if (interp != NULL) { - if (src[-1] == '"') { - Tcl_SetResult(interp, "extra characters after close-quote", - TCL_STATIC); - } else { - Tcl_SetResult(interp, "extra characters after close-brace", - TCL_STATIC); - } - } - parsePtr->term = src; - goto error; - } - - - parsePtr->commandSize = src - parsePtr->commandStart; - string[numBytes] = (char) savedChar; - return TCL_OK; - - error: - string[numBytes] = (char) savedChar; - if (parsePtr->tokenPtr != parsePtr->staticTokens) { - ckfree((char *) parsePtr->tokenPtr); - parsePtr->tokenPtr = parsePtr->staticTokens; - } - if (parsePtr->commandStart == NULL) { - parsePtr->commandStart = string; - } - parsePtr->commandSize = parsePtr->term - parsePtr->commandStart; - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * ParseTokens -- - * - * This procedure forms the heart of the Tcl parser. It parses one - * or more tokens from a string, up to a termination point - * specified by the caller. This procedure is used to parse - * unquoted command words (those not in quotes or braces), words in - * quotes, and array indices for variables. - * - * Results: - * Tokens are added to parsePtr and parsePtr->term is filled in - * with the address of the character that terminated the parse (the - * first one whose CHAR_TYPE matched mask or the character at - * parsePtr->end). The return value is TCL_OK if the parse - * completed successfully and TCL_ERROR otherwise. If a parse - * error occurs and parsePtr->interp isn't NULL, then an error - * message is left in the interpreter's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -ParseTokens(src, mask, parsePtr) - register char *src; /* First character to parse. */ - int mask; /* Specifies when to stop parsing. The - * parse stops at the first unquoted - * character whose CHAR_TYPE contains - * any of the bits in mask. */ - Tcl_Parse *parsePtr; /* Information about parse in progress. - * Updated with additional tokens and - * termination information. */ -{ - int type, originalTokens, varToken; - char utfBytes[TCL_UTF_MAX]; - Tcl_Token *tokenPtr; - Tcl_Parse nested; - - /* - * Each iteration through the following loop adds one token of - * type TCL_TOKEN_TEXT, TCL_TOKEN_BS, TCL_TOKEN_COMMAND, or - * TCL_TOKEN_VARIABLE to parsePtr. For TCL_TOKEN_VARIABLE tokens, - * additional tokens are added for the parsed variable name. - */ - - originalTokens = parsePtr->numTokens; - while (1) { - if (parsePtr->numTokens == parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[parsePtr->numTokens]; - tokenPtr->start = src; - tokenPtr->numComponents = 0; - - type = CHAR_TYPE(*src); - if (type & mask) { - break; - } - - if ((type & TYPE_SUBS) == 0) { - /* - * This is a simple range of characters. Scan to find the end - * of the range. - */ - - while (1) { - src++; - if (CHAR_TYPE(*src) & (mask | TYPE_SUBS)) { - break; - } - } - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->size = src - tokenPtr->start; - parsePtr->numTokens++; - } else if (*src == '$') { - /* - * This is a variable reference. Call Tcl_ParseVarName to do - * all the dirty work of parsing the name. - */ - - varToken = parsePtr->numTokens; - if (Tcl_ParseVarName(parsePtr->interp, src, parsePtr->end - src, - parsePtr, 1) != TCL_OK) { - return TCL_ERROR; - } - src += parsePtr->tokenPtr[varToken].size; - } else if (*src == '[') { - /* - * Command substitution. Call Tcl_ParseCommand recursively - * (and repeatedly) to parse the nested command(s), then - * throw away the parse information. - */ - - src++; - while (1) { - if (Tcl_ParseCommand(parsePtr->interp, src, - parsePtr->end - src, 1, &nested) != TCL_OK) { - parsePtr->term = nested.term; - parsePtr->incomplete = nested.incomplete; - return TCL_ERROR; - } - src = nested.commandStart + nested.commandSize; - if (nested.tokenPtr != nested.staticTokens) { - ckfree((char *) nested.tokenPtr); - } - if ((src[-1] == ']') && !nested.incomplete) { - break; - } - if (src == parsePtr->end) { - if (parsePtr->interp != NULL) { - Tcl_SetResult(parsePtr->interp, - "missing close-bracket", TCL_STATIC); - } - parsePtr->term = tokenPtr->start; - parsePtr->incomplete = 1; - return TCL_ERROR; - } - } - tokenPtr->type = TCL_TOKEN_COMMAND; - tokenPtr->size = src - tokenPtr->start; - parsePtr->numTokens++; - } else if (*src == '\\') { - /* - * Backslash substitution. - */ - - if (src[1] == '\n') { - if ((src + 2) == parsePtr->end) { - parsePtr->incomplete = 1; - } - - /* - * Note: backslash-newline is special in that it is - * treated the same as a space character would be. This - * means that it could terminate the token. - */ - - if (mask & TYPE_SPACE) { - break; - } - } - tokenPtr->type = TCL_TOKEN_BS; - Tcl_UtfBackslash(src, &tokenPtr->size, utfBytes); - parsePtr->numTokens++; - src += tokenPtr->size; - } else if (*src == 0) { - /* - * We encountered a null character. If it is the null - * character at the end of the string, then return. - * Otherwise generate a text token for the single - * character. - */ - - if (src == parsePtr->end) { - break; - } - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->size = 1; - parsePtr->numTokens++; - src++; - } else { - panic("ParseTokens encountered unknown character"); - } - } - if (parsePtr->numTokens == originalTokens) { - /* - * There was nothing in this range of text. Add an empty token - * for the empty range, so that there is always at least one - * token added. - */ - - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->size = 0; - parsePtr->numTokens++; - } - parsePtr->term = src; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FreeParse -- - * - * This procedure is invoked to free any dynamic storage that may - * have been allocated by a previous call to Tcl_ParseCommand. - * - * Results: - * None. - * - * Side effects: - * If there is any dynamically allocated memory in *parsePtr, - * it is freed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_FreeParse(parsePtr) - Tcl_Parse *parsePtr; /* Structure that was filled in by a - * previous call to Tcl_ParseCommand. */ -{ - if (parsePtr->tokenPtr != parsePtr->staticTokens) { - ckfree((char *) parsePtr->tokenPtr); - parsePtr->tokenPtr = parsePtr->staticTokens; - } -} - -/* - *---------------------------------------------------------------------- - * - * TclExpandTokenArray -- - * - * This procedure is invoked when the current space for tokens in - * a Tcl_Parse structure fills up; it allocates memory to grow the - * token array - * - * Results: - * None. - * - * Side effects: - * Memory is allocated for a new larger token array; the memory - * for the old array is freed, if it had been dynamically allocated. - * - *---------------------------------------------------------------------- - */ - -void -TclExpandTokenArray(parsePtr) - Tcl_Parse *parsePtr; /* Parse structure whose token space - * has overflowed. */ -{ - int newCount; - Tcl_Token *newPtr; - - newCount = parsePtr->tokensAvailable*2; - newPtr = (Tcl_Token *) ckalloc((unsigned) (newCount * sizeof(Tcl_Token))); - memcpy((VOID *) newPtr, (VOID *) parsePtr->tokenPtr, - (size_t) (parsePtr->tokensAvailable * sizeof(Tcl_Token))); - if (parsePtr->tokenPtr != parsePtr->staticTokens) { - ckfree((char *) parsePtr->tokenPtr); - parsePtr->tokenPtr = parsePtr->staticTokens; - } - parsePtr->tokenPtr = newPtr; - parsePtr->tokensAvailable = newCount; -} - -/* - *---------------------------------------------------------------------- - * - * EvalObjv -- - * - * This procedure evaluates a Tcl command that has already been - * parsed into words, with one Tcl_Obj holding each word. - * - * Results: - * The return value is a standard Tcl completion code such as - * TCL_OK or TCL_ERROR. A result or error message is left in - * interp's result. If an error occurs, this procedure does - * NOT add any information to the errorInfo variable. - * - * Side effects: - * Depends on the command. - * - *---------------------------------------------------------------------- - */ - -static int -EvalObjv(interp, objc, objv, command, length, flags) - Tcl_Interp *interp; /* Interpreter in which to evaluate the - * command. Also used for error - * reporting. */ - int objc; /* Number of words in command. */ - Tcl_Obj *CONST objv[]; /* An array of pointers to objects that are - * the words that make up the command. */ - char *command; /* Points to the beginning of the string - * representation of the command; this - * is used for traces. If the string - * representation of the command is - * unknown, an empty string should be - * supplied. */ - int length; /* Number of bytes in command; if -1, all - * characters up to the first null byte are - * used. */ - int flags; /* Collection of OR-ed bits that control - * the evaluation of the script. Only - * TCL_EVAL_GLOBAL is currently - * supported. */ - -{ - Command *cmdPtr; - Interp *iPtr = (Interp *) interp; - Tcl_Obj **newObjv; - int i, code; - Trace *tracePtr, *nextPtr; - char **argv, *commandCopy; - CallFrame *savedVarFramePtr; /* Saves old copy of iPtr->varFramePtr - * in case TCL_EVAL_GLOBAL was set. */ - - Tcl_ResetResult(interp); - if (objc == 0) { - return TCL_OK; - } - - /* - * If the interpreter was deleted, return an error. - */ - - if (iPtr->flags & DELETED) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "attempt to call eval in deleted interpreter", -1); - Tcl_SetErrorCode(interp, "CORE", "IDELETE", - "attempt to call eval in deleted interpreter", - (char *) NULL); - return TCL_ERROR; - } - - /* - * Check depth of nested calls to Tcl_Eval: if this gets too large, - * it's probably because of an infinite loop somewhere. - */ - - if (iPtr->numLevels >= iPtr->maxNestingDepth) { - iPtr->result = "too many nested calls to Tcl_Eval (infinite loop?)"; - return TCL_ERROR; - } - iPtr->numLevels++; - - /* - * On the Mac, we will never reach the default recursion limit before - * blowing the stack. So we need to do a check here. - */ - - if (TclpCheckStackSpace() == 0) { - /*NOTREACHED*/ - iPtr->numLevels--; - iPtr->result = "too many nested calls to Tcl_Eval (infinite loop?)"; - return TCL_ERROR; - } - - /* - * Find the procedure to execute this command. If there isn't one, - * then see if there is a command "unknown". If so, create a new - * word array with "unknown" as the first word and the original - * command words as arguments. Then call ourselves recursively - * to execute it. - */ - - cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objv[0]); - if (cmdPtr == NULL) { - newObjv = (Tcl_Obj **) ckalloc((unsigned) - ((objc + 1) * sizeof (Tcl_Obj *))); - for (i = objc-1; i >= 0; i--) { - newObjv[i+1] = objv[i]; - } - newObjv[0] = Tcl_NewStringObj("unknown", -1); - Tcl_IncrRefCount(newObjv[0]); - cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, newObjv[0]); - if (cmdPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "invalid command name \"", Tcl_GetString(objv[0]), "\"", - (char *) NULL); - code = TCL_ERROR; - } else { - code = EvalObjv(interp, objc+1, newObjv, command, length, 0); - } - Tcl_DecrRefCount(newObjv[0]); - ckfree((char *) newObjv); - goto done; - } - - /* - * Call trace procedures if needed. - */ - - argv = NULL; - commandCopy = command; - - for (tracePtr = iPtr->tracePtr; tracePtr != NULL; tracePtr = nextPtr) { - nextPtr = tracePtr->nextPtr; - if (iPtr->numLevels > tracePtr->level) { - continue; - } - - /* - * This is a bit messy because we have to emulate the old trace - * interface, which uses strings for everything. - */ - - if (argv == NULL) { - argv = (char **) ckalloc((unsigned) (objc + 1) * sizeof(char *)); - for (i = 0; i < objc; i++) { - argv[i] = Tcl_GetString(objv[i]); - } - argv[objc] = 0; - - if (length < 0) { - length = strlen(command); - } else if ((size_t)length < strlen(command)) { - commandCopy = (char *) ckalloc((unsigned) (length + 1)); - strncpy(commandCopy, command, (size_t) length); - commandCopy[length] = 0; - } - } - (*tracePtr->proc)(tracePtr->clientData, interp, iPtr->numLevels, - commandCopy, cmdPtr->proc, cmdPtr->clientData, - objc, argv); - } - if (argv != NULL) { - ckfree((char *) argv); - } - if (commandCopy != command) { - ckfree((char *) commandCopy); - } - - /* - * Finally, invoke the command's Tcl_ObjCmdProc. - */ - - iPtr->cmdCount++; - savedVarFramePtr = iPtr->varFramePtr; - if (flags & TCL_EVAL_GLOBAL) { - iPtr->varFramePtr = NULL; - } - code = (*cmdPtr->objProc)(cmdPtr->objClientData, interp, objc, objv); - iPtr->varFramePtr = savedVarFramePtr; - if (Tcl_AsyncReady()) { - code = Tcl_AsyncInvoke(interp, code); - } - - /* - * If the interpreter has a non-empty string result, the result - * object is either empty or stale because some procedure set - * interp->result directly. If so, move the string result to the - * result object, then reset the string result. - */ - - if (*(iPtr->result) != 0) { - (void) Tcl_GetObjResult(interp); - } - - done: - iPtr->numLevels--; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EvalObjv -- - * - * This procedure evaluates a Tcl command that has already been - * parsed into words, with one Tcl_Obj holding each word. - * - * Results: - * The return value is a standard Tcl completion code such as - * TCL_OK or TCL_ERROR. A result or error message is left in - * interp's result. - * - * Side effects: - * Depends on the command. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_EvalObjv(interp, objc, objv, flags) - Tcl_Interp *interp; /* Interpreter in which to evaluate the - * command. Also used for error - * reporting. */ - int objc; /* Number of words in command. */ - Tcl_Obj *CONST objv[]; /* An array of pointers to objects that are - * the words that make up the command. */ - int flags; /* Collection of OR-ed bits that control - * the evaluation of the script. Only - * TCL_EVAL_GLOBAL is currently - * supported. */ -{ - Interp *iPtr = (Interp *)interp; - Trace *tracePtr; - Tcl_DString cmdBuf; - char *cmdString = ""; - int cmdLen = 0; - int code = TCL_OK; - - for (tracePtr = iPtr->tracePtr; tracePtr; tracePtr = tracePtr->nextPtr) { - /* - * EvalObjv will increment numLevels so use "<" rather than "<=" - */ - if (iPtr->numLevels < tracePtr->level) { - int i; - /* - * The command will be needed for an execution trace or stack trace - * generate a command string. - */ - cmdtraced: - Tcl_DStringInit(&cmdBuf); - for (i = 0; i < objc; i++) { - Tcl_DStringAppendElement(&cmdBuf, Tcl_GetString(objv[i])); - } - cmdString = Tcl_DStringValue(&cmdBuf); - cmdLen = Tcl_DStringLength(&cmdBuf); - break; - } - } - - /* - * Execute the command if we have not done so already - */ - switch (code) { - case TCL_OK: - code = EvalObjv(interp, objc, objv, cmdString, cmdLen, flags); - if (code == TCL_ERROR && cmdLen == 0) - goto cmdtraced; - break; - case TCL_ERROR: - Tcl_LogCommandInfo(interp, cmdString, cmdString, cmdLen); - break; - default: - /*NOTREACHED*/ - break; - } - - if (cmdLen != 0) { - Tcl_DStringFree(&cmdBuf); - } - return code; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LogCommandInfo -- - * - * This procedure is invoked after an error occurs in an interpreter. - * It adds information to the "errorInfo" variable to describe the - * command that was being executed when the error occurred. - * - * Results: - * None. - * - * Side effects: - * Information about the command is added to errorInfo and the - * line number stored internally in the interpreter is set. If this - * is the first call to this procedure or Tcl_AddObjErrorInfo since - * an error occurred, then old information in errorInfo is - * deleted. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_LogCommandInfo(interp, script, command, length) - Tcl_Interp *interp; /* Interpreter in which to log information. */ - char *script; /* First character in script containing - * command (must be <= command). */ - char *command; /* First character in command that - * generated the error. */ - int length; /* Number of bytes in command (-1 means - * use all bytes up to first null byte). */ -{ - char buffer[200]; - register char *p; - char *ellipsis = ""; - Interp *iPtr = (Interp *) interp; - - if (iPtr->flags & ERR_ALREADY_LOGGED) { - /* - * Someone else has already logged error information for this - * command; we shouldn't add anything more. - */ - - return; - } - - /* - * Compute the line number where the error occurred. - */ - - iPtr->errorLine = 1; - for (p = script; p != command; p++) { - if (*p == '\n') { - iPtr->errorLine++; - } - } - - /* - * Create an error message to add to errorInfo, including up to a - * maximum number of characters of the command. - */ - - if (length < 0) { - length = strlen(command); - } - if (length > 150) { - length = 150; - ellipsis = "..."; - } - if (!(iPtr->flags & ERR_IN_PROGRESS)) { - sprintf(buffer, "\n while executing\n\"%.*s%s\"", - length, command, ellipsis); - } else { - sprintf(buffer, "\n invoked from within\n\"%.*s%s\"", - length, command, ellipsis); - } - Tcl_AddObjErrorInfo(interp, buffer, -1); - iPtr->flags &= ~ERR_ALREADY_LOGGED; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EvalTokens -- - * - * Given an array of tokens parsed from a Tcl command (e.g., the - * tokens that make up a word or the index for an array variable) - * this procedure evaluates the tokens and concatenates their - * values to form a single result value. - * - * Results: - * The return value is a pointer to a newly allocated Tcl_Obj - * containing the value of the array of tokens. The reference - * count of the returned object has been incremented. If an error - * occurs in evaluating the tokens then a NULL value is returned - * and an error message is left in interp's result. - * - * Side effects: - * A new object is allocated to hold the result. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_EvalTokens(interp, tokenPtr, count) - Tcl_Interp *interp; /* Interpreter in which to lookup - * variables, execute nested commands, - * and report errors. */ - Tcl_Token *tokenPtr; /* Pointer to first in an array of tokens - * to evaluate and concatenate. */ - int count; /* Number of tokens to consider at tokenPtr. - * Must be at least 1. */ -{ - Tcl_Obj *resultPtr, *indexPtr, *valuePtr, *newPtr; - char buffer[TCL_UTF_MAX]; -#ifdef TCL_MEM_DEBUG -# define MAX_VAR_CHARS 5 -#else -# define MAX_VAR_CHARS 30 -#endif - char nameBuffer[MAX_VAR_CHARS+1]; - char *varName, *index; - char *p = NULL; /* Initialized to avoid compiler warning. */ - int length, code; - - /* - * The only tricky thing about this procedure is that it attempts to - * avoid object creation and string copying whenever possible. For - * example, if the value is just a nested command, then use the - * command's result object directly. - */ - - resultPtr = NULL; - for ( ; count > 0; count--, tokenPtr++) { - valuePtr = NULL; - - /* - * The switch statement below computes the next value to be - * concat to the result, as either a range of text or an - * object. - */ - - switch (tokenPtr->type) { - case TCL_TOKEN_TEXT: - p = tokenPtr->start; - length = tokenPtr->size; - break; - - case TCL_TOKEN_BS: - length = Tcl_UtfBackslash(tokenPtr->start, (int *) NULL, - buffer); - p = buffer; - break; - - case TCL_TOKEN_COMMAND: - code = Tcl_EvalEx(interp, tokenPtr->start+1, tokenPtr->size-2, - 0); - if (code != TCL_OK) { - goto error; - } - valuePtr = Tcl_GetObjResult(interp); - break; - - case TCL_TOKEN_VARIABLE: - if (tokenPtr->numComponents == 1) { - indexPtr = NULL; - } else { - indexPtr = Tcl_EvalTokens(interp, tokenPtr+2, - tokenPtr->numComponents - 1); - if (indexPtr == NULL) { - goto error; - } - } - - /* - * We have to make a copy of the variable name in order - * to have a null-terminated string. We can't make a - * temporary modification to the script to null-terminate - * the name, because a trace callback might potentially - * reuse the script and be affected by the null character. - */ - - if (tokenPtr[1].size <= MAX_VAR_CHARS) { - varName = nameBuffer; - } else { - varName = ckalloc((unsigned) (tokenPtr[1].size + 1)); - } - strncpy(varName, tokenPtr[1].start, (size_t) tokenPtr[1].size); - varName[tokenPtr[1].size] = 0; - if (indexPtr != NULL) { - index = TclGetString(indexPtr); - } else { - index = NULL; - } - valuePtr = Tcl_GetVar2Ex(interp, varName, index, - TCL_LEAVE_ERR_MSG); - if (varName != nameBuffer) { - ckfree(varName); - } - if (indexPtr != NULL) { - Tcl_DecrRefCount(indexPtr); - } - if (valuePtr == NULL) { - goto error; - } - count -= tokenPtr->numComponents; - tokenPtr += tokenPtr->numComponents; - break; - - default: - panic("unexpected token type in Tcl_EvalTokens"); - } - - /* - * If valuePtr isn't NULL, the next piece of text comes from that - * object; otherwise, take length bytes starting at p. - */ - - if (resultPtr == NULL) { - if (valuePtr != NULL) { - resultPtr = valuePtr; - } else { - resultPtr = Tcl_NewStringObj(p, length); - } - Tcl_IncrRefCount(resultPtr); - } else { - if (Tcl_IsShared(resultPtr)) { - newPtr = Tcl_DuplicateObj(resultPtr); - Tcl_DecrRefCount(resultPtr); - resultPtr = newPtr; - Tcl_IncrRefCount(resultPtr); - } - if (valuePtr != NULL) { - p = Tcl_GetStringFromObj(valuePtr, &length); - } - Tcl_AppendToObj(resultPtr, p, length); - } - } - return resultPtr; - - error: - if (resultPtr != NULL) { - Tcl_DecrRefCount(resultPtr); - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EvalEx -- - * - * This procedure evaluates a Tcl script without using the compiler - * or byte-code interpreter. It just parses the script, creates - * values for each word of each command, then calls EvalObjv - * to execute each command. - * - * Results: - * The return value is a standard Tcl completion code such as - * TCL_OK or TCL_ERROR. A result or error message is left in - * interp's result. - * - * Side effects: - * Depends on the script. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_EvalEx(interp, script, numBytes, flags) - Tcl_Interp *interp; /* Interpreter in which to evaluate the - * script. Also used for error reporting. */ - char *script; /* First character of script to evaluate. */ - int numBytes; /* Number of bytes in script. If < 0, the - * script consists of all bytes up to the - * first null character. */ - int flags; /* Collection of OR-ed bits that control - * the evaluation of the script. Only - * TCL_EVAL_GLOBAL is currently - * supported. */ -{ - Interp *iPtr = (Interp *) interp; - char *p, *next; - Tcl_Parse parse; -#define NUM_STATIC_OBJS 20 - Tcl_Obj *staticObjArray[NUM_STATIC_OBJS], **objv; - Tcl_Token *tokenPtr; - int i, code, commandLength, bytesLeft, nested; - CallFrame *savedVarFramePtr; /* Saves old copy of iPtr->varFramePtr - * in case TCL_EVAL_GLOBAL was set. */ - - /* - * The variables below keep track of how much state has been - * allocated while evaluating the script, so that it can be freed - * properly if an error occurs. - */ - - int gotParse = 0, objectsUsed = 0; - - if (numBytes < 0) { - numBytes = strlen(script); - } - Tcl_ResetResult(interp); - - savedVarFramePtr = iPtr->varFramePtr; - if (flags & TCL_EVAL_GLOBAL) { - iPtr->varFramePtr = NULL; - } - - /* - * Each iteration through the following loop parses the next - * command from the script and then executes it. - */ - - objv = staticObjArray; - p = script; - bytesLeft = numBytes; - if (iPtr->evalFlags & TCL_BRACKET_TERM) { - nested = 1; - } else { - nested = 0; - } - iPtr->evalFlags = 0; - do { - if (Tcl_ParseCommand(interp, p, bytesLeft, nested, &parse) - != TCL_OK) { - code = TCL_ERROR; - goto error; - } - gotParse = 1; - if (parse.numWords > 0) { - /* - * Generate an array of objects for the words of the command. - */ - - if (parse.numWords <= NUM_STATIC_OBJS) { - objv = staticObjArray; - } else { - objv = (Tcl_Obj **) ckalloc((unsigned) - (parse.numWords * sizeof (Tcl_Obj *))); - } - for (objectsUsed = 0, tokenPtr = parse.tokenPtr; - objectsUsed < parse.numWords; - objectsUsed++, tokenPtr += (tokenPtr->numComponents + 1)) { - objv[objectsUsed] = Tcl_EvalTokens(interp, tokenPtr+1, - tokenPtr->numComponents); - if (objv[objectsUsed] == NULL) { - code = TCL_ERROR; - goto error; - } - } - - /* - * Execute the command and free the objects for its words. - */ - - code = EvalObjv(interp, objectsUsed, objv, p, bytesLeft, 0); - if (code != TCL_OK) { - goto error; - } - for (i = 0; i < objectsUsed; i++) { - Tcl_DecrRefCount(objv[i]); - } - objectsUsed = 0; - if (objv != staticObjArray) { - ckfree((char *) objv); - objv = staticObjArray; - } - } - - /* - * Advance to the next command in the script. - */ - - next = parse.commandStart + parse.commandSize; - bytesLeft -= next - p; - p = next; - Tcl_FreeParse(&parse); - gotParse = 0; - if ((nested != 0) && (p > script) && (p[-1] == ']')) { - /* - * We get here in the special case where the TCL_BRACKET_TERM - * flag was set in the interpreter and we reached a close - * bracket in the script. Return immediately. - */ - - iPtr->termOffset = (p - 1) - script; - iPtr->varFramePtr = savedVarFramePtr; - return TCL_OK; - } - } while (bytesLeft > 0); - iPtr->termOffset = p - script; - iPtr->varFramePtr = savedVarFramePtr; - return TCL_OK; - - error: - /* - * Generate various pieces of error information, such as the line - * number where the error occurred and information to add to the - * errorInfo variable. Then free resources that had been allocated - * to the command. - */ - - if ((code == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) { - commandLength = parse.commandSize; - if ((parse.commandStart + commandLength) != (script + numBytes)) { - /* - * The command where the error occurred didn't end at the end - * of the script (i.e. it ended at a terminator character such - * as ";". Reduce the length by one so that the error message - * doesn't include the terminator character. - */ - - commandLength -= 1; - } - Tcl_LogCommandInfo(interp, script, parse.commandStart, commandLength); - } - - for (i = 0; i < objectsUsed; i++) { - Tcl_DecrRefCount(objv[i]); - } - if (gotParse) { - Tcl_FreeParse(&parse); - } - if (objv != staticObjArray) { - ckfree((char *) objv); - } - iPtr->varFramePtr = savedVarFramePtr; - return code; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Eval -- - * - * Execute a Tcl command in a string. This procedure executes the - * script directly, rather than compiling it to bytecodes. Before - * the arrival of the bytecode compiler in Tcl 8.0 Tcl_Eval was - * the main procedure used for executing Tcl commands, but nowadays - * it isn't used much. - * - * Results: - * The return value is one of the return codes defined in tcl.h - * (such as TCL_OK), and interp's result contains a value - * to supplement the return code. The value of the result - * will persist only until the next call to Tcl_Eval or Tcl_EvalObj: - * you must copy it or lose it! - * - * Side effects: - * Can be almost arbitrary, depending on the commands in the script. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Eval(interp, string) - Tcl_Interp *interp; /* Token for command interpreter (returned - * by previous call to Tcl_CreateInterp). */ - char *string; /* Pointer to TCL command to execute. */ -{ - int code; - - code = Tcl_EvalEx(interp, string, -1, 0); - - /* - * For backwards compatibility with old C code that predates the - * object system in Tcl 8.0, we have to mirror the object result - * back into the string result (some callers may expect it there). - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - return code; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EvalObj, Tcl_GlobalEvalObj -- - * - * These functions are deprecated but we keep them around for backwards - * compatibility reasons. - * - * Results: - * See the functions they call. - * - * Side effects: - * See the functions they call. - * - *---------------------------------------------------------------------- - */ - -#undef Tcl_EvalObj -int -Tcl_EvalObj(interp, objPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; -{ - return Tcl_EvalObjEx(interp, objPtr, 0); -} - -#undef Tcl_GlobalEvalObj -int -Tcl_GlobalEvalObj(interp, objPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; -{ - return Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_GLOBAL); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ParseVarName -- - * - * Given a string starting with a $ sign, parse off a variable - * name and return information about the parse. - * - * Results: - * The return value is TCL_OK if the command was parsed - * successfully and TCL_ERROR otherwise. If an error occurs and - * interp isn't NULL then an error message is left in its result. - * On a successful return, tokenPtr and numTokens fields of - * parsePtr are filled in with information about the variable name - * that was parsed. The "size" field of the first new token gives - * the total number of bytes in the variable name. Other fields in - * parsePtr are undefined. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the command, then additional space is - * malloc-ed. If the procedure returns TCL_OK then the caller must - * eventually invoke Tcl_FreeParse to release any additional space - * that was allocated. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ParseVarName(interp, string, numBytes, parsePtr, append) - Tcl_Interp *interp; /* Interpreter to use for error reporting; - * if NULL, then no error message is - * provided. */ - char *string; /* String containing variable name. First - * character must be "$". */ - int numBytes; /* Total number of bytes in string. If < 0, - * the string consists of all bytes up to the - * first null character. */ - Tcl_Parse *parsePtr; /* Structure to fill in with information - * about the variable name. */ - int append; /* Non-zero means append tokens to existing - * information in parsePtr; zero means ignore - * existing tokens in parsePtr and reinitialize - * it. */ -{ - Tcl_Token *tokenPtr; - char *end, *src; - unsigned char c; - int varIndex, offset; - Tcl_UniChar ch; - - if (numBytes >= 0) { - end = string + numBytes; - } else { - end = string + strlen(string); - } - - if (!append) { - parsePtr->numWords = 0; - parsePtr->tokenPtr = parsePtr->staticTokens; - parsePtr->numTokens = 0; - parsePtr->tokensAvailable = NUM_STATIC_TOKENS; - parsePtr->string = string; - parsePtr->end = end; - parsePtr->interp = interp; - parsePtr->incomplete = 0; - } - - /* - * Generate one token for the variable, an additional token for the - * name, plus any number of additional tokens for the index, if - * there is one. - */ - - src = string; - if ((parsePtr->numTokens + 2) > parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[parsePtr->numTokens]; - tokenPtr->type = TCL_TOKEN_VARIABLE; - tokenPtr->start = src; - varIndex = parsePtr->numTokens; - parsePtr->numTokens++; - tokenPtr++; - src++; - if (src >= end) { - goto justADollarSign; - } - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->start = src; - tokenPtr->numComponents = 0; - - /* - * The name of the variable can have three forms: - * 1. The $ sign is followed by an open curly brace. Then - * the variable name is everything up to the next close - * curly brace, and the variable is a scalar variable. - * 2. The $ sign is not followed by an open curly brace. Then - * the variable name is everything up to the next - * character that isn't a letter, digit, or underscore. - * :: sequences are also considered part of the variable - * name, in order to support namespaces. If the following - * character is an open parenthesis, then the information - * between parentheses is the array element name. - * 3. The $ sign is followed by something that isn't a letter, - * digit, or underscore: in this case, there is no variable - * name and the token is just "$". - */ - - if (*src == '{') { - src++; - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->start = src; - tokenPtr->numComponents = 0; - while (1) { - if (src == end) { - if (interp != NULL) { - Tcl_SetResult(interp, - "missing close-brace for variable name", - TCL_STATIC); - } - parsePtr->term = tokenPtr->start-1; - parsePtr->incomplete = 1; - goto error; - } - if (*src == '}') { - break; - } - src++; - } - tokenPtr->size = src - tokenPtr->start; - tokenPtr[-1].size = src - tokenPtr[-1].start; - parsePtr->numTokens++; - src++; - } else { - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->start = src; - tokenPtr->numComponents = 0; - while (src != end) { - offset = Tcl_UtfToUniChar(src, &ch); - c = UCHAR(ch); - if (isalnum(c) || (c == '_')) { /* INTL: ISO only, UCHAR. */ - src += offset; - continue; - } - if ((c == ':') && (((src+1) != end) && (src[1] == ':'))) { - src += 2; - while ((src != end) && (*src == ':')) { - src += 1; - } - continue; - } - break; - } - tokenPtr->size = src - tokenPtr->start; - if (tokenPtr->size == 0) { - goto justADollarSign; - } - parsePtr->numTokens++; - if ((src != end) && (*src == '(')) { - /* - * This is a reference to an array element. Call - * ParseTokens recursively to parse the element name, - * since it could contain any number of substitutions. - */ - - if (ParseTokens(src+1, TYPE_CLOSE_PAREN, parsePtr) - != TCL_OK) { - goto error; - } - if ((parsePtr->term == end) || (*parsePtr->term != ')')) { - if (parsePtr->interp != NULL) { - Tcl_SetResult(parsePtr->interp, "missing )", - TCL_STATIC); - } - parsePtr->term = src; - parsePtr->incomplete = 1; - goto error; - } - src = parsePtr->term + 1; - } - } - tokenPtr = &parsePtr->tokenPtr[varIndex]; - tokenPtr->size = src - tokenPtr->start; - tokenPtr->numComponents = parsePtr->numTokens - (varIndex + 1); - return TCL_OK; - - /* - * The dollar sign isn't followed by a variable name. - * replace the TCL_TOKEN_VARIABLE token with a - * TCL_TOKEN_TEXT token for the dollar sign. - */ - - justADollarSign: - tokenPtr = &parsePtr->tokenPtr[varIndex]; - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->size = 1; - tokenPtr->numComponents = 0; - return TCL_OK; - - error: - if (parsePtr->tokenPtr != parsePtr->staticTokens) { - ckfree((char *) parsePtr->tokenPtr); - parsePtr->tokenPtr = parsePtr->staticTokens; - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ParseVar -- - * - * Given a string starting with a $ sign, parse off a variable - * name and return its value. - * - * Results: - * The return value is the contents of the variable given by - * the leading characters of string. If termPtr isn't NULL, - * *termPtr gets filled in with the address of the character - * just after the last one in the variable specifier. If the - * variable doesn't exist, then the return value is NULL and - * an error message will be left in interp's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_ParseVar(interp, string, termPtr) - Tcl_Interp *interp; /* Context for looking up variable. */ - register char *string; /* String containing variable name. - * First character must be "$". */ - char **termPtr; /* If non-NULL, points to word to fill - * in with character just after last - * one in the variable specifier. */ - -{ - Tcl_Parse parse; - register Tcl_Obj *objPtr; - - if (Tcl_ParseVarName(interp, string, -1, &parse, 0) != TCL_OK) { - return NULL; - } - - if (termPtr != NULL) { - *termPtr = string + parse.tokenPtr->size; - } - if (parse.numTokens == 1) { - /* - * There isn't a variable name after all: the $ is just a $. - */ - - return "$"; - } - - objPtr = Tcl_EvalTokens(interp, parse.tokenPtr, parse.numTokens); - if (objPtr == NULL) { - return NULL; - } - - /* - * At this point we should have an object containing the value of - * a variable. Just return the string from that object. - */ - -#ifdef TCL_COMPILE_DEBUG - if (objPtr->refCount < 2) { - panic("Tcl_ParseVar got temporary object from Tcl_EvalTokens"); - } -#endif /*TCL_COMPILE_DEBUG*/ - TclDecrRefCount(objPtr); - return TclGetString(objPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ParseBraces -- - * - * Given a string in braces such as a Tcl command argument or a string - * value in a Tcl expression, this procedure parses the string and - * returns information about the parse. - * - * Results: - * The return value is TCL_OK if the string was parsed successfully and - * TCL_ERROR otherwise. If an error occurs and interp isn't NULL then - * an error message is left in its result. On a successful return, - * tokenPtr and numTokens fields of parsePtr are filled in with - * information about the string that was parsed. Other fields in - * parsePtr are undefined. termPtr is set to point to the character - * just after the last one in the braced string. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the command, then additional space is - * malloc-ed. If the procedure returns TCL_OK then the caller must - * eventually invoke Tcl_FreeParse to release any additional space - * that was allocated. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ParseBraces(interp, string, numBytes, parsePtr, append, termPtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting; - * if NULL, then no error message is - * provided. */ - char *string; /* String containing the string in braces. - * The first character must be '{'. */ - int numBytes; /* Total number of bytes in string. If < 0, - * the string consists of all bytes up to - * the first null character. */ - register Tcl_Parse *parsePtr; - /* Structure to fill in with information - * about the string. */ - int append; /* Non-zero means append tokens to existing - * information in parsePtr; zero means - * ignore existing tokens in parsePtr and - * reinitialize it. */ - char **termPtr; /* If non-NULL, points to word in which to - * store a pointer to the character just - * after the terminating '}' if the parse - * was successful. */ - -{ - char utfBytes[TCL_UTF_MAX]; /* For result of backslash substitution. */ - Tcl_Token *tokenPtr; - register char *src, *end; - int startIndex, level, length; - - if ((numBytes >= 0) || (string == NULL)) { - end = string + numBytes; - } else { - end = string + strlen(string); - } - - if (!append) { - parsePtr->numWords = 0; - parsePtr->tokenPtr = parsePtr->staticTokens; - parsePtr->numTokens = 0; - parsePtr->tokensAvailable = NUM_STATIC_TOKENS; - parsePtr->string = string; - parsePtr->end = end; - parsePtr->interp = interp; - } - - src = string+1; - startIndex = parsePtr->numTokens; - - if (parsePtr->numTokens == parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[startIndex]; - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->start = src; - tokenPtr->numComponents = 0; - level = 1; - while (1) { - while (CHAR_TYPE(*src) == TYPE_NORMAL) { - src++; - } - if (*src == '}') { - level--; - if (level == 0) { - break; - } - src++; - } else if (*src == '{') { - level++; - src++; - } else if (*src == '\\') { - Tcl_UtfBackslash(src, &length, utfBytes); - if (src[1] == '\n') { - /* - * A backslash-newline sequence must be collapsed, even - * inside braces, so we have to split the word into - * multiple tokens so that the backslash-newline can be - * represented explicitly. - */ - - if ((src + 2) == end) { - parsePtr->incomplete = 1; - } - tokenPtr->size = (src - tokenPtr->start); - if (tokenPtr->size != 0) { - parsePtr->numTokens++; - } - if ((parsePtr->numTokens+1) >= parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[parsePtr->numTokens]; - tokenPtr->type = TCL_TOKEN_BS; - tokenPtr->start = src; - tokenPtr->size = length; - tokenPtr->numComponents = 0; - parsePtr->numTokens++; - - src += length; - tokenPtr++; - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->start = src; - tokenPtr->numComponents = 0; - } else { - src += length; - } - } else if (src == end) { - if (interp != NULL) { - Tcl_SetResult(interp, "missing close-brace", TCL_STATIC); - } - parsePtr->term = string; - parsePtr->incomplete = 1; - goto error; - } else { - src++; - } - } - - /* - * Decide if we need to finish emitting a partially-finished token. - * There are 3 cases: - * {abc \newline xyz} or {xyz} - finish emitting "xyz" token - * {abc \newline} - don't emit token after \newline - * {} - finish emitting zero-sized token - * The last case ensures that there is a token (even if empty) that - * describes the braced string. - */ - - if ((src != tokenPtr->start) - || (parsePtr->numTokens == startIndex)) { - tokenPtr->size = (src - tokenPtr->start); - parsePtr->numTokens++; - } - if (termPtr != NULL) { - *termPtr = src+1; - } - return TCL_OK; - - error: - if (parsePtr->tokenPtr != parsePtr->staticTokens) { - ckfree((char *) parsePtr->tokenPtr); - parsePtr->tokenPtr = parsePtr->staticTokens; - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ParseQuotedString -- - * - * Given a double-quoted string such as a quoted Tcl command argument - * or a quoted value in a Tcl expression, this procedure parses the - * string and returns information about the parse. - * - * Results: - * The return value is TCL_OK if the string was parsed successfully and - * TCL_ERROR otherwise. If an error occurs and interp isn't NULL then - * an error message is left in its result. On a successful return, - * tokenPtr and numTokens fields of parsePtr are filled in with - * information about the string that was parsed. Other fields in - * parsePtr are undefined. termPtr is set to point to the character - * just after the quoted string's terminating close-quote. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the command, then additional space is - * malloc-ed. If the procedure returns TCL_OK then the caller must - * eventually invoke Tcl_FreeParse to release any additional space - * that was allocated. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ParseQuotedString(interp, string, numBytes, parsePtr, append, termPtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting; - * if NULL, then no error message is - * provided. */ - char *string; /* String containing the quoted string. - * The first character must be '"'. */ - int numBytes; /* Total number of bytes in string. If < 0, - * the string consists of all bytes up to - * the first null character. */ - register Tcl_Parse *parsePtr; - /* Structure to fill in with information - * about the string. */ - int append; /* Non-zero means append tokens to existing - * information in parsePtr; zero means - * ignore existing tokens in parsePtr and - * reinitialize it. */ - char **termPtr; /* If non-NULL, points to word in which to - * store a pointer to the character just - * after the quoted string's terminating - * close-quote if the parse succeeds. */ -{ - char *end; - - if ((numBytes >= 0) || (string == NULL)) { - end = string + numBytes; - } else { - end = string + strlen(string); - } - - if (!append) { - parsePtr->numWords = 0; - parsePtr->tokenPtr = parsePtr->staticTokens; - parsePtr->numTokens = 0; - parsePtr->tokensAvailable = NUM_STATIC_TOKENS; - parsePtr->string = string; - parsePtr->end = end; - parsePtr->interp = interp; - } - - if (ParseTokens(string+1, TYPE_QUOTE, parsePtr) != TCL_OK) { - goto error; - } - if (*parsePtr->term != '"') { - if (interp != NULL) { - Tcl_SetResult(parsePtr->interp, "missing \"", TCL_STATIC); - } - parsePtr->term = string; - parsePtr->incomplete = 1; - goto error; - } - if (termPtr != NULL) { - *termPtr = (parsePtr->term + 1); - } - return TCL_OK; - - error: - if (parsePtr->tokenPtr != parsePtr->staticTokens) { - ckfree((char *) parsePtr->tokenPtr); - parsePtr->tokenPtr = parsePtr->staticTokens; - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * CommandComplete -- - * - * This procedure is shared by TclCommandComplete and - * Tcl_ObjCommandcoComplete; it does all the real work of seeing - * whether a script is complete - * - * Results: - * 1 is returned if the script is complete, 0 if there are open - * delimiters such as " or (. 1 is also returned if there is a - * parse error in the script other than unmatched delimiters. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -CommandComplete(script, length) - char *script; /* Script to check. */ - int length; /* Number of bytes in script. */ -{ - Tcl_Parse parse; - char *p, *end; - - p = script; - end = p + length; - while (Tcl_ParseCommand((Tcl_Interp *) NULL, p, end - p, 0, &parse) - == TCL_OK) { - p = parse.commandStart + parse.commandSize; - if (*p == 0) { - break; - } - } - if (parse.incomplete) { - return 0; - } - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CommandComplete -- - * - * Given a partial or complete Tcl script, this procedure - * determines whether the script is complete in the sense - * of having matched braces and quotes and brackets. - * - * Results: - * 1 is returned if the script is complete, 0 otherwise. - * 1 is also returned if there is a parse error in the script - * other than unmatched delimiters. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_CommandComplete(script) - char *script; /* Script to check. */ -{ - return CommandComplete(script, (int) strlen(script)); -} - -/* - *---------------------------------------------------------------------- - * - * TclObjCommandComplete -- - * - * Given a partial or complete Tcl command in a Tcl object, this - * procedure determines whether the command is complete in the sense of - * having matched braces and quotes and brackets. - * - * Results: - * 1 is returned if the command is complete, 0 otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclObjCommandComplete(objPtr) - Tcl_Obj *objPtr; /* Points to object holding script - * to check. */ -{ - char *script; - int length; - - script = Tcl_GetStringFromObj(objPtr, &length); - return CommandComplete(script, length); -} - -/* - *---------------------------------------------------------------------- - * - * TclIsLocalScalar -- - * - * Check to see if a given string is a legal scalar variable - * name with no namespace qualifiers or substitutions. - * - * Results: - * Returns 1 if the variable is a local scalar. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclIsLocalScalar(src, len) - CONST char *src; - int len; -{ - CONST char *p; - CONST char *lastChar = src + (len - 1); - - for (p = src; p <= lastChar; p++) { - if ((CHAR_TYPE(*p) != TYPE_NORMAL) && - (CHAR_TYPE(*p) != TYPE_COMMAND_END)) { - /* - * TCL_COMMAND_END is returned for the last character - * of the string. By this point we know it isn't - * an array or namespace reference. - */ - - return 0; - } - if (*p == '(') { - if (*lastChar == ')') { /* we have an array element */ - return 0; - } - } else if (*p == ':') { - if ((p != lastChar) && *(p+1) == ':') { /* qualified name */ - return 0; - } - } - } - - return 1; -} diff --git a/generic/tclParseExpr.c b/generic/tclParseExpr.c deleted file mode 100644 index 306d5de..0000000 --- a/generic/tclParseExpr.c +++ /dev/null @@ -1,1826 +0,0 @@ -/* - * tclParseExpr.c -- - * - * This file contains procedures that parse Tcl expressions. They - * do so in a general-purpose fashion that can be used for many - * different purposes, including compilation, direct execution, - * code analysis, etc. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclParseExpr.c,v 1.2 1999/04/16 00:46:51 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclCompile.h" - -/* - * The stuff below is a bit of a hack so that this file can be used in - * environments that include no UNIX, i.e. no errno: just arrange to use - * the errno from tclExecute.c here. - */ - -#ifndef TCL_GENERIC_ONLY -#include "tclPort.h" -#else -#define NO_ERRNO_H -#endif - -#ifdef NO_ERRNO_H -extern int errno; /* Use errno from tclExecute.c. */ -#define ERANGE 34 -#endif - -/* - * Boolean variable that controls whether expression parse tracing - * is enabled. - */ - -#ifdef TCL_COMPILE_DEBUG -static int traceParseExpr = 0; -#endif /* TCL_COMPILE_DEBUG */ - -/* - * The ParseInfo structure holds state while parsing an expression. - * A pointer to an ParseInfo record is passed among the routines in - * this module. - */ - -typedef struct ParseInfo { - Tcl_Parse *parsePtr; /* Points to structure to fill in with - * information about the expression. */ - int lexeme; /* Type of last lexeme scanned in expr. - * See below for definitions. Corresponds to - * size characters beginning at start. */ - char *start; /* First character in lexeme. */ - int size; /* Number of bytes in lexeme. */ - char *next; /* Position of the next character to be - * scanned in the expression string. */ - char *prevEnd; /* Points to the character just after the - * last one in the previous lexeme. Used to - * compute size of subexpression tokens. */ - char *originalExpr; /* Points to the start of the expression - * originally passed to Tcl_ParseExpr. */ - char *lastChar; /* Points just after last byte of expr. */ -} ParseInfo; - -/* - * Definitions of the different lexemes that appear in expressions. The - * order of these must match the corresponding entries in the - * operatorStrings array below. - */ - -#define LITERAL 0 -#define FUNC_NAME 1 -#define OPEN_BRACKET 2 -#define OPEN_BRACE 3 -#define OPEN_PAREN 4 -#define CLOSE_PAREN 5 -#define DOLLAR 6 -#define QUOTE 7 -#define COMMA 8 -#define END 9 -#define UNKNOWN 10 - -/* - * Binary operators: - */ - -#define MULT 11 -#define DIVIDE 12 -#define MOD 13 -#define PLUS 14 -#define MINUS 15 -#define LEFT_SHIFT 16 -#define RIGHT_SHIFT 17 -#define LESS 18 -#define GREATER 19 -#define LEQ 20 -#define GEQ 21 -#define EQUAL 22 -#define NEQ 23 -#define BIT_AND 24 -#define BIT_XOR 25 -#define BIT_OR 26 -#define AND 27 -#define OR 28 -#define QUESTY 29 -#define COLON 30 - -/* - * Unary operators. Unary minus and plus are represented by the (binary) - * lexemes MINUS and PLUS. - */ - -#define NOT 31 -#define BIT_NOT 32 - -/* - * Mapping from lexemes to strings; used for debugging messages. These - * entries must match the order and number of the lexeme definitions above. - */ - -#ifdef TCL_COMPILE_DEBUG -static char *lexemeStrings[] = { - "LITERAL", "FUNCNAME", - "[", "{", "(", ")", "$", "\"", ",", "END", "UNKNOWN", - "*", "/", "%", "+", "-", - "<<", ">>", "<", ">", "<=", ">=", "==", "!=", - "&", "^", "|", "&&", "||", "?", ":", - "!", "~" -}; -#endif /* TCL_COMPILE_DEBUG */ - -/* - * Declarations for local procedures to this file: - */ - -static int GetLexeme _ANSI_ARGS_((ParseInfo *infoPtr)); -static void LogSyntaxError _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseAddExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseBitAndExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseBitOrExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseBitXorExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseCondExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseEqualityExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseLandExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseLorExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseMultiplyExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParsePrimaryExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseRelationalExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseShiftExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static int ParseUnaryExpr _ANSI_ARGS_((ParseInfo *infoPtr)); -static void PrependSubExprTokens _ANSI_ARGS_((char *op, - int opBytes, char *src, int srcBytes, - int firstIndex, ParseInfo *infoPtr)); - -/* - * Macro used to debug the execution of the recursive descent parser used - * to parse expressions. - */ - -#ifdef TCL_COMPILE_DEBUG -#define HERE(production, level) \ - if (traceParseExpr) { \ - fprintf(stderr, "%*s%s: lexeme=%s, next=\"%.20s\"\n", \ - (level), " ", (production), \ - lexemeStrings[infoPtr->lexeme], infoPtr->next); \ - } -#else -#define HERE(production, level) -#endif /* TCL_COMPILE_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_ParseExpr -- - * - * Given a string, this procedure parses the first Tcl expression - * in the string and returns information about the structure of - * the expression. This procedure is the top-level interface to the - * the expression parsing module. - * - * Results: - * The return value is TCL_OK if the command was parsed successfully - * and TCL_ERROR otherwise. If an error occurs and interp isn't NULL - * then an error message is left in its result. On a successful return, - * parsePtr is filled in with information about the expression that - * was parsed. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the expression, then additional space is - * malloc-ed. If the procedure returns TCL_OK then the caller must - * eventually invoke Tcl_FreeParse to release any additional space - * that was allocated. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ParseExpr(interp, string, numBytes, parsePtr) - Tcl_Interp *interp; /* Used for error reporting. */ - char *string; /* The source string to parse. */ - int numBytes; /* Number of bytes in string. If < 0, the - * string consists of all bytes up to the - * first null character. */ - Tcl_Parse *parsePtr; /* Structure to fill with information about - * the parsed expression; any previous - * information in the structure is - * ignored. */ -{ - ParseInfo info; - int code; - char savedChar; - - if (numBytes < 0) { - numBytes = (string? strlen(string) : 0); - } -#ifdef TCL_COMPILE_DEBUG - if (traceParseExpr) { - fprintf(stderr, "Tcl_ParseExpr: string=\"%.*s\"\n", - numBytes, string); - } -#endif /* TCL_COMPILE_DEBUG */ - - parsePtr->commentStart = NULL; - parsePtr->commentSize = 0; - parsePtr->commandStart = NULL; - parsePtr->commandSize = 0; - parsePtr->numWords = 0; - parsePtr->tokenPtr = parsePtr->staticTokens; - parsePtr->numTokens = 0; - parsePtr->tokensAvailable = NUM_STATIC_TOKENS; - parsePtr->string = string; - parsePtr->end = (string + numBytes); - parsePtr->interp = interp; - parsePtr->term = string; - parsePtr->incomplete = 0; - - /* - * Temporarily overwrite the character just after the end of the - * string with a 0 byte. This acts as a sentinel and reduces the - * number of places where we have to check for the end of the - * input string. The original value of the byte is restored at - * the end of the parse. - */ - - savedChar = string[numBytes]; - string[numBytes] = 0; - - /* - * Initialize the ParseInfo structure that holds state while parsing - * the expression. - */ - - info.parsePtr = parsePtr; - info.lexeme = UNKNOWN; - info.start = NULL; - info.size = 0; - info.next = string; - info.prevEnd = string; - info.originalExpr = string; - info.lastChar = (string + numBytes); /* just after last char of expr */ - - /* - * Get the first lexeme then parse the expression. - */ - - code = GetLexeme(&info); - if (code != TCL_OK) { - goto error; - } - code = ParseCondExpr(&info); - if (code != TCL_OK) { - goto error; - } - if (info.lexeme != END) { - LogSyntaxError(&info); - goto error; - } - string[numBytes] = (char) savedChar; - return TCL_OK; - - error: - string[numBytes] = (char) savedChar; - if (parsePtr->tokenPtr != parsePtr->staticTokens) { - ckfree((char *) parsePtr->tokenPtr); - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * ParseCondExpr -- - * - * This procedure parses a Tcl conditional expression: - * condExpr ::= lorExpr ['?' condExpr ':' condExpr] - * - * Note that this is the topmost recursive-descent parsing routine used - * by TclParseExpr to parse expressions. This avoids an extra procedure - * call since such a procedure would only return the result of calling - * ParseCondExpr. Other recursive-descent procedures that need to parse - * complete expressions also call ParseCondExpr. - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseCondExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - Tcl_Token *tokenPtr, *firstTokenPtr, *condTokenPtr; - int firstIndex, numToMove, code; - char *srcStart; - - HERE("condExpr", 1); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseLorExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - if (infoPtr->lexeme == QUESTY) { - /* - * Emit two tokens: one TCL_TOKEN_SUB_EXPR token for the entire - * conditional expression, and a TCL_TOKEN_OPERATOR token for - * the "?" operator. Note that these two tokens must be inserted - * before the LOR operand tokens generated above. - */ - - if ((parsePtr->numTokens + 1) >= parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - firstTokenPtr = &parsePtr->tokenPtr[firstIndex]; - tokenPtr = (firstTokenPtr + 2); - numToMove = (parsePtr->numTokens - firstIndex); - memmove((VOID *) tokenPtr, (VOID *) firstTokenPtr, - (size_t) (numToMove * sizeof(Tcl_Token))); - parsePtr->numTokens += 2; - - tokenPtr = firstTokenPtr; - tokenPtr->type = TCL_TOKEN_SUB_EXPR; - tokenPtr->start = srcStart; - - tokenPtr++; - tokenPtr->type = TCL_TOKEN_OPERATOR; - tokenPtr->start = infoPtr->start; - tokenPtr->size = 1; - tokenPtr->numComponents = 0; - - /* - * Skip over the '?'. - */ - - code = GetLexeme(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Parse the "then" expression. - */ - - code = ParseCondExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - if (infoPtr->lexeme != COLON) { - LogSyntaxError(infoPtr); - return TCL_ERROR; - } - code = GetLexeme(infoPtr); /* skip over the ':' */ - if (code != TCL_OK) { - return code; - } - - /* - * Parse the "else" expression. - */ - - code = ParseCondExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Now set the size-related fields in the '?' subexpression token. - */ - - condTokenPtr = &parsePtr->tokenPtr[firstIndex]; - condTokenPtr->size = (infoPtr->prevEnd - srcStart); - condTokenPtr->numComponents = parsePtr->numTokens - (firstIndex+1); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseLorExpr -- - * - * This procedure parses a Tcl logical or expression: - * lorExpr ::= landExpr {'||' landExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseLorExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, code; - char *srcStart, *operator; - - HERE("lorExpr", 2); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseLandExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - while (infoPtr->lexeme == OR) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over the '||' */ - if (code != TCL_OK) { - return code; - } - code = ParseLandExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the LOR subexpression and the '||' operator. - */ - - PrependSubExprTokens(operator, 2, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseLandExpr -- - * - * This procedure parses a Tcl logical and expression: - * landExpr ::= bitOrExpr {'&&' bitOrExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseLandExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, code; - char *srcStart, *operator; - - HERE("landExpr", 3); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseBitOrExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - while (infoPtr->lexeme == AND) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over the '&&' */ - if (code != TCL_OK) { - return code; - } - code = ParseBitOrExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the LAND subexpression and the '&&' operator. - */ - - PrependSubExprTokens(operator, 2, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseBitOrExpr -- - * - * This procedure parses a Tcl bitwise or expression: - * bitOrExpr ::= bitXorExpr {'|' bitXorExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseBitOrExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, code; - char *srcStart, *operator; - - HERE("bitOrExpr", 4); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseBitXorExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - while (infoPtr->lexeme == BIT_OR) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over the '|' */ - if (code != TCL_OK) { - return code; - } - - code = ParseBitXorExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the BITOR subexpression and the '|' operator. - */ - - PrependSubExprTokens(operator, 1, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseBitXorExpr -- - * - * This procedure parses a Tcl bitwise exclusive or expression: - * bitXorExpr ::= bitAndExpr {'^' bitAndExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseBitXorExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, code; - char *srcStart, *operator; - - HERE("bitXorExpr", 5); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseBitAndExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - while (infoPtr->lexeme == BIT_XOR) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over the '^' */ - if (code != TCL_OK) { - return code; - } - - code = ParseBitAndExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the XOR subexpression and the '^' operator. - */ - - PrependSubExprTokens(operator, 1, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseBitAndExpr -- - * - * This procedure parses a Tcl bitwise and expression: - * bitAndExpr ::= equalityExpr {'&' equalityExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseBitAndExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, code; - char *srcStart, *operator; - - HERE("bitAndExpr", 6); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseEqualityExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - while (infoPtr->lexeme == BIT_AND) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over the '&' */ - if (code != TCL_OK) { - return code; - } - code = ParseEqualityExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the BITAND subexpression and '&' operator. - */ - - PrependSubExprTokens(operator, 1, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseEqualityExpr -- - * - * This procedure parses a Tcl equality (inequality) expression: - * equalityExpr ::= relationalExpr {('==' | '!=') relationalExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseEqualityExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, lexeme, code; - char *srcStart, *operator; - - HERE("equalityExpr", 7); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseRelationalExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - lexeme = infoPtr->lexeme; - while ((lexeme == EQUAL) || (lexeme == NEQ)) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over == or != */ - if (code != TCL_OK) { - return code; - } - code = ParseRelationalExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the subexpression and '==' or '!=' operator. - */ - - PrependSubExprTokens(operator, 2, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - lexeme = infoPtr->lexeme; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseRelationalExpr -- - * - * This procedure parses a Tcl relational expression: - * relationalExpr ::= shiftExpr {('<' | '>' | '<=' | '>=') shiftExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseRelationalExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, lexeme, operatorSize, code; - char *srcStart, *operator; - - HERE("relationalExpr", 8); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseShiftExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - lexeme = infoPtr->lexeme; - while ((lexeme == LESS) || (lexeme == GREATER) || (lexeme == LEQ) - || (lexeme == GEQ)) { - operator = infoPtr->start; - if ((lexeme == LEQ) || (lexeme == GEQ)) { - operatorSize = 2; - } else { - operatorSize = 1; - } - code = GetLexeme(infoPtr); /* skip over the operator */ - if (code != TCL_OK) { - return code; - } - code = ParseShiftExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the subexpression and the operator. - */ - - PrependSubExprTokens(operator, operatorSize, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - lexeme = infoPtr->lexeme; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseShiftExpr -- - * - * This procedure parses a Tcl shift expression: - * shiftExpr ::= addExpr {('<<' | '>>') addExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseShiftExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, lexeme, code; - char *srcStart, *operator; - - HERE("shiftExpr", 9); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseAddExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - lexeme = infoPtr->lexeme; - while ((lexeme == LEFT_SHIFT) || (lexeme == RIGHT_SHIFT)) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over << or >> */ - if (code != TCL_OK) { - return code; - } - code = ParseAddExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the subexpression and '<<' or '>>' operator. - */ - - PrependSubExprTokens(operator, 2, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - lexeme = infoPtr->lexeme; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseAddExpr -- - * - * This procedure parses a Tcl addition expression: - * addExpr ::= multiplyExpr {('+' | '-') multiplyExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseAddExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, lexeme, code; - char *srcStart, *operator; - - HERE("addExpr", 10); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseMultiplyExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - lexeme = infoPtr->lexeme; - while ((lexeme == PLUS) || (lexeme == MINUS)) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over + or - */ - if (code != TCL_OK) { - return code; - } - code = ParseMultiplyExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the subexpression and '+' or '-' operator. - */ - - PrependSubExprTokens(operator, 1, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - lexeme = infoPtr->lexeme; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseMultiplyExpr -- - * - * This procedure parses a Tcl multiply expression: - * multiplyExpr ::= unaryExpr {('*' | '/' | '%') unaryExpr} - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseMultiplyExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, lexeme, code; - char *srcStart, *operator; - - HERE("multiplyExpr", 11); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - code = ParseUnaryExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - lexeme = infoPtr->lexeme; - while ((lexeme == MULT) || (lexeme == DIVIDE) || (lexeme == MOD)) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over * or / or % */ - if (code != TCL_OK) { - return code; - } - code = ParseUnaryExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the subexpression and * or / or % operator. - */ - - PrependSubExprTokens(operator, 1, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - lexeme = infoPtr->lexeme; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParseUnaryExpr -- - * - * This procedure parses a Tcl unary expression: - * unaryExpr ::= ('+' | '-' | '~' | '!') unaryExpr | primaryExpr - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParseUnaryExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - int firstIndex, lexeme, code; - char *srcStart, *operator; - - HERE("unaryExpr", 12); - srcStart = infoPtr->start; - firstIndex = parsePtr->numTokens; - - lexeme = infoPtr->lexeme; - if ((lexeme == PLUS) || (lexeme == MINUS) || (lexeme == BIT_NOT) - || (lexeme == NOT)) { - operator = infoPtr->start; - code = GetLexeme(infoPtr); /* skip over the unary operator */ - if (code != TCL_OK) { - return code; - } - code = ParseUnaryExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - /* - * Generate tokens for the subexpression and the operator. - */ - - PrependSubExprTokens(operator, 1, srcStart, - (infoPtr->prevEnd - srcStart), firstIndex, infoPtr); - } else { /* must be a primaryExpr */ - code = ParsePrimaryExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ParsePrimaryExpr -- - * - * This procedure parses a Tcl primary expression: - * primaryExpr ::= literal | varReference | quotedString | - * '[' command ']' | mathFuncCall | '(' condExpr ')' - * - * Results: - * The return value is TCL_OK on a successful parse and TCL_ERROR - * on failure. If TCL_ERROR is returned, then the interpreter's result - * contains an error message. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static int -ParsePrimaryExpr(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - Tcl_Interp *interp = parsePtr->interp; - Tcl_Token *tokenPtr, *exprTokenPtr; - Tcl_Parse nested; - char *dollarPtr, *stringStart, *termPtr, *src; - int lexeme, exprIndex, firstIndex, numToMove, code; - - /* - * We simply recurse on parenthesized subexpressions. - */ - - HERE("primaryExpr", 13); - lexeme = infoPtr->lexeme; - if (lexeme == OPEN_PAREN) { - code = GetLexeme(infoPtr); /* skip over the '(' */ - if (code != TCL_OK) { - return code; - } - code = ParseCondExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - if (infoPtr->lexeme != CLOSE_PAREN) { - goto syntaxError; - } - code = GetLexeme(infoPtr); /* skip over the ')' */ - if (code != TCL_OK) { - return code; - } - return TCL_OK; - } - - /* - * Start a TCL_TOKEN_SUB_EXPR token for the primary. - */ - - if (parsePtr->numTokens == parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - exprIndex = parsePtr->numTokens; - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->type = TCL_TOKEN_SUB_EXPR; - exprTokenPtr->start = infoPtr->start; - parsePtr->numTokens++; - - /* - * Process the primary then finish setting the fields of the - * TCL_TOKEN_SUB_EXPR token. Note that we can't use the pointer now - * stored in "exprTokenPtr" in the code below since the token array - * might be reallocated. - */ - - firstIndex = parsePtr->numTokens; - switch (lexeme) { - case LITERAL: - /* - * Int or double number. - */ - - if (parsePtr->numTokens == parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[parsePtr->numTokens]; - tokenPtr->type = TCL_TOKEN_TEXT; - tokenPtr->start = infoPtr->start; - tokenPtr->size = infoPtr->size; - tokenPtr->numComponents = 0; - parsePtr->numTokens++; - - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->size = infoPtr->size; - exprTokenPtr->numComponents = 1; - break; - - case DOLLAR: - /* - * $var variable reference. - */ - - dollarPtr = (infoPtr->next - 1); - code = Tcl_ParseVarName(interp, dollarPtr, - (infoPtr->lastChar - dollarPtr), parsePtr, 1); - if (code != TCL_OK) { - return code; - } - infoPtr->next = dollarPtr + parsePtr->tokenPtr[firstIndex].size; - - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->size = parsePtr->tokenPtr[firstIndex].size; - exprTokenPtr->numComponents = - (parsePtr->tokenPtr[firstIndex].numComponents + 1); - break; - - case QUOTE: - /* - * '"' string '"' - */ - - stringStart = infoPtr->next; - code = Tcl_ParseQuotedString(interp, infoPtr->start, - (infoPtr->lastChar - stringStart), parsePtr, 1, &termPtr); - if (code != TCL_OK) { - return code; - } - infoPtr->next = termPtr; - - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->size = (termPtr - exprTokenPtr->start); - exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex; - - /* - * If parsing the quoted string resulted in more than one token, - * insert a TCL_TOKEN_WORD token before them. This indicates that - * the quoted string represents a concatenation of multiple tokens. - */ - - if (exprTokenPtr->numComponents > 1) { - if (parsePtr->numTokens >= parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[firstIndex]; - numToMove = (parsePtr->numTokens - firstIndex); - memmove((VOID *) (tokenPtr + 1), (VOID *) tokenPtr, - (size_t) (numToMove * sizeof(Tcl_Token))); - parsePtr->numTokens++; - - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->numComponents++; - - tokenPtr->type = TCL_TOKEN_WORD; - tokenPtr->start = exprTokenPtr->start; - tokenPtr->size = exprTokenPtr->size; - tokenPtr->numComponents = (exprTokenPtr->numComponents - 1); - } - break; - - case OPEN_BRACKET: - /* - * '[' command {command} ']' - */ - - if (parsePtr->numTokens == parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[parsePtr->numTokens]; - tokenPtr->type = TCL_TOKEN_COMMAND; - tokenPtr->start = infoPtr->start; - tokenPtr->numComponents = 0; - parsePtr->numTokens++; - - /* - * Call Tcl_ParseCommand repeatedly to parse the nested command(s) - * to find their end, then throw away that parse information. - */ - - src = infoPtr->next; - while (1) { - if (Tcl_ParseCommand(interp, src, (parsePtr->end - src), 1, - &nested) != TCL_OK) { - parsePtr->term = nested.term; - parsePtr->incomplete = nested.incomplete; - return TCL_ERROR; - } - src = (nested.commandStart + nested.commandSize); - if (nested.tokenPtr != nested.staticTokens) { - ckfree((char *) nested.tokenPtr); - } - if ((src[-1] == ']') && !nested.incomplete) { - break; - } - if (src == parsePtr->end) { - if (parsePtr->interp != NULL) { - Tcl_SetResult(interp, "missing close-bracket", - TCL_STATIC); - } - parsePtr->term = tokenPtr->start; - parsePtr->incomplete = 1; - return TCL_ERROR; - } - } - tokenPtr->size = (src - tokenPtr->start); - infoPtr->next = src; - - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->size = (src - tokenPtr->start); - exprTokenPtr->numComponents = 1; - break; - - case OPEN_BRACE: - /* - * '{' string '}' - */ - - code = Tcl_ParseBraces(interp, infoPtr->start, - (infoPtr->lastChar - infoPtr->start), parsePtr, 1, - &termPtr); - if (code != TCL_OK) { - return code; - } - infoPtr->next = termPtr; - - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->size = (termPtr - infoPtr->start); - exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex; - - /* - * If parsing the braced string resulted in more than one token, - * insert a TCL_TOKEN_WORD token before them. This indicates that - * the braced string represents a concatenation of multiple tokens. - */ - - if (exprTokenPtr->numComponents > 1) { - if (parsePtr->numTokens >= parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[firstIndex]; - numToMove = (parsePtr->numTokens - firstIndex); - memmove((VOID *) (tokenPtr + 1), (VOID *) tokenPtr, - (size_t) (numToMove * sizeof(Tcl_Token))); - parsePtr->numTokens++; - - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->numComponents++; - - tokenPtr->type = TCL_TOKEN_WORD; - tokenPtr->start = exprTokenPtr->start; - tokenPtr->size = exprTokenPtr->size; - tokenPtr->numComponents = exprTokenPtr->numComponents-1; - } - break; - - case FUNC_NAME: - /* - * math_func '(' expr {',' expr} ')' - */ - - if (parsePtr->numTokens == parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - tokenPtr = &parsePtr->tokenPtr[parsePtr->numTokens]; - tokenPtr->type = TCL_TOKEN_OPERATOR; - tokenPtr->start = infoPtr->start; - tokenPtr->size = infoPtr->size; - tokenPtr->numComponents = 0; - parsePtr->numTokens++; - - code = GetLexeme(infoPtr); /* skip over function name */ - if (code != TCL_OK) { - return code; - } - if (infoPtr->lexeme != OPEN_PAREN) { - goto syntaxError; - } - code = GetLexeme(infoPtr); /* skip over '(' */ - if (code != TCL_OK) { - return code; - } - - while (infoPtr->lexeme != CLOSE_PAREN) { - code = ParseCondExpr(infoPtr); - if (code != TCL_OK) { - return code; - } - - if (infoPtr->lexeme == COMMA) { - code = GetLexeme(infoPtr); /* skip over , */ - if (code != TCL_OK) { - return code; - } - } else if (infoPtr->lexeme != CLOSE_PAREN) { - goto syntaxError; - } - } - - exprTokenPtr = &parsePtr->tokenPtr[exprIndex]; - exprTokenPtr->size = (infoPtr->next - exprTokenPtr->start); - exprTokenPtr->numComponents = parsePtr->numTokens - firstIndex; - break; - - default: - goto syntaxError; - } - - /* - * Advance to the next lexeme before returning. - */ - - code = GetLexeme(infoPtr); - if (code != TCL_OK) { - return code; - } - parsePtr->term = infoPtr->next; - return TCL_OK; - - syntaxError: - LogSyntaxError(infoPtr); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * GetLexeme -- - * - * Lexical scanner for Tcl expressions: scans a single operator or - * other syntactic element from an expression string. - * - * Results: - * TCL_OK is returned unless an error occurred. In that case a standard - * Tcl error code is returned and, if infoPtr->parsePtr->interp is - * non-NULL, the interpreter's result is set to hold an error - * message. TCL_ERROR is returned if an integer overflow, or a - * floating-point overflow or underflow occurred while reading in a - * number. If the lexical analysis is successful, infoPtr->lexeme - * refers to the next symbol in the expression string, and - * infoPtr->next is advanced past the lexeme. Also, if the lexeme is a - * LITERAL or FUNC_NAME, then infoPtr->start is set to the first - * character of the lexeme; otherwise it is set NULL. - * - * Side effects: - * If there is insufficient space in parsePtr to hold all the - * information about the subexpression, then additional space is - * malloc-ed.. - * - *---------------------------------------------------------------------- - */ - -static int -GetLexeme(infoPtr) - ParseInfo *infoPtr; /* Holds state needed to parse the expr, - * including the resulting lexeme. */ -{ - register char *src; /* Points to current source char. */ - char *termPtr; /* Points to char terminating a literal. */ - double doubleValue; /* Value of a scanned double literal. */ - char c; - int startsWithDigit, offset; - Tcl_Parse *parsePtr = infoPtr->parsePtr; - Tcl_Interp *interp = parsePtr->interp; - Tcl_UniChar ch; - - /* - * Record where the previous lexeme ended. Since we always read one - * lexeme ahead during parsing, this helps us know the source length of - * subexpression tokens. - */ - - infoPtr->prevEnd = infoPtr->next; - - /* - * Scan over leading white space at the start of a lexeme. Note that a - * backslash-newline is treated as a space. - */ - - src = infoPtr->next; - c = *src; - while (isspace(UCHAR(c)) || (c == '\\')) { /* INTL: ISO space */ - if (c == '\\') { - if (src[1] == '\n') { - src += 2; - } else { - break; /* no longer white space */ - } - } else { - src++; - } - c = *src; - } - parsePtr->term = src; - if (src >= infoPtr->lastChar) { - infoPtr->lexeme = END; - infoPtr->next = src; - return TCL_OK; - } - - /* - * Try to parse the lexeme first as an integer or floating-point - * number. Don't check for a number if the first character c is - * "+" or "-". If we did, we might treat a binary operator as unary - * by mistake, which would eventually cause a syntax error. - */ - - if ((c != '+') && (c != '-')) { - startsWithDigit = isdigit(UCHAR(c)); /* INTL: digit */ - if (startsWithDigit && TclLooksLikeInt(src, -1)) { - errno = 0; - (void) strtoul(src, &termPtr, 0); - if (errno == ERANGE) { - if (interp != NULL) { - char *s = "integer value too large to represent"; - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), s, -1); - Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, - (char *) NULL); - } - return TCL_ERROR; - } - if (termPtr != src) { - /* - * src was the start of a valid integer. - */ - - infoPtr->lexeme = LITERAL; - infoPtr->start = src; - infoPtr->size = (termPtr - src); - infoPtr->next = termPtr; - parsePtr->term = termPtr; - return TCL_OK; - } - } else if (startsWithDigit || (c == '.') - || (c == 'n') || (c == 'N')) { - errno = 0; - doubleValue = strtod(src, &termPtr); - if (termPtr != src) { - if (errno != 0) { - if (interp != NULL) { - TclExprFloatError(interp, doubleValue); - } - return TCL_ERROR; - } - - /* - * src was the start of a valid double. - */ - - infoPtr->lexeme = LITERAL; - infoPtr->start = src; - infoPtr->size = (termPtr - src); - infoPtr->next = termPtr; - parsePtr->term = termPtr; - return TCL_OK; - } - } - } - - /* - * Not an integer or double literal. Initialize the lexeme's fields - * assuming the common case of a single character lexeme. - */ - - infoPtr->start = src; - infoPtr->size = 1; - infoPtr->next = src+1; - parsePtr->term = infoPtr->next; - - switch (*src) { - case '[': - infoPtr->lexeme = OPEN_BRACKET; - return TCL_OK; - - case '{': - infoPtr->lexeme = OPEN_BRACE; - return TCL_OK; - - case '(': - infoPtr->lexeme = OPEN_PAREN; - return TCL_OK; - - case ')': - infoPtr->lexeme = CLOSE_PAREN; - return TCL_OK; - - case '$': - infoPtr->lexeme = DOLLAR; - return TCL_OK; - - case '"': - infoPtr->lexeme = QUOTE; - return TCL_OK; - - case ',': - infoPtr->lexeme = COMMA; - return TCL_OK; - - case '*': - infoPtr->lexeme = MULT; - return TCL_OK; - - case '/': - infoPtr->lexeme = DIVIDE; - return TCL_OK; - - case '%': - infoPtr->lexeme = MOD; - return TCL_OK; - - case '+': - infoPtr->lexeme = PLUS; - return TCL_OK; - - case '-': - infoPtr->lexeme = MINUS; - return TCL_OK; - - case '?': - infoPtr->lexeme = QUESTY; - return TCL_OK; - - case ':': - infoPtr->lexeme = COLON; - return TCL_OK; - - case '<': - switch (src[1]) { - case '<': - infoPtr->lexeme = LEFT_SHIFT; - infoPtr->size = 2; - infoPtr->next = src+2; - break; - case '=': - infoPtr->lexeme = LEQ; - infoPtr->size = 2; - infoPtr->next = src+2; - break; - default: - infoPtr->lexeme = LESS; - break; - } - parsePtr->term = infoPtr->next; - return TCL_OK; - - case '>': - switch (src[1]) { - case '>': - infoPtr->lexeme = RIGHT_SHIFT; - infoPtr->size = 2; - infoPtr->next = src+2; - break; - case '=': - infoPtr->lexeme = GEQ; - infoPtr->size = 2; - infoPtr->next = src+2; - break; - default: - infoPtr->lexeme = GREATER; - break; - } - parsePtr->term = infoPtr->next; - return TCL_OK; - - case '=': - if (src[1] == '=') { - infoPtr->lexeme = EQUAL; - infoPtr->size = 2; - infoPtr->next = src+2; - } else { - infoPtr->lexeme = UNKNOWN; - } - parsePtr->term = infoPtr->next; - return TCL_OK; - - case '!': - if (src[1] == '=') { - infoPtr->lexeme = NEQ; - infoPtr->size = 2; - infoPtr->next = src+2; - } else { - infoPtr->lexeme = NOT; - } - parsePtr->term = infoPtr->next; - return TCL_OK; - - case '&': - if (src[1] == '&') { - infoPtr->lexeme = AND; - infoPtr->size = 2; - infoPtr->next = src+2; - } else { - infoPtr->lexeme = BIT_AND; - } - parsePtr->term = infoPtr->next; - return TCL_OK; - - case '^': - infoPtr->lexeme = BIT_XOR; - return TCL_OK; - - case '|': - if (src[1] == '|') { - infoPtr->lexeme = OR; - infoPtr->size = 2; - infoPtr->next = src+2; - } else { - infoPtr->lexeme = BIT_OR; - } - parsePtr->term = infoPtr->next; - return TCL_OK; - - case '~': - infoPtr->lexeme = BIT_NOT; - return TCL_OK; - - default: - offset = Tcl_UtfToUniChar(src, &ch); - c = UCHAR(ch); - if (isalpha(UCHAR(c))) { /* INTL: ISO only. */ - infoPtr->lexeme = FUNC_NAME; - while (isalnum(UCHAR(c)) || (c == '_')) { /* INTL: ISO only. */ - src += offset; - offset = Tcl_UtfToUniChar(src, &ch); - c = UCHAR(ch); - } - infoPtr->size = (src - infoPtr->start); - infoPtr->next = src; - parsePtr->term = infoPtr->next; - return TCL_OK; - } - infoPtr->lexeme = UNKNOWN; - return TCL_OK; - } -} - -/* - *---------------------------------------------------------------------- - * - * PrependSubExprTokens -- - * - * This procedure is called after the operands of an subexpression have - * been parsed. It generates two tokens: a TCL_TOKEN_SUB_EXPR token for - * the subexpression, and a TCL_TOKEN_OPERATOR token for its operator. - * These two tokens are inserted before the operand tokens. - * - * Results: - * None. - * - * Side effects: - * If there is insufficient space in parsePtr to hold the new tokens, - * additional space is malloc-ed. - * - *---------------------------------------------------------------------- - */ - -static void -PrependSubExprTokens(op, opBytes, src, srcBytes, firstIndex, infoPtr) - char *op; /* Points to first byte of the operator - * in the source script. */ - int opBytes; /* Number of bytes in the operator. */ - char *src; /* Points to first byte of the subexpression - * in the source script. */ - int srcBytes; /* Number of bytes in subexpression's - * source. */ - int firstIndex; /* Index of first token already emitted for - * operator's first (or only) operand. */ - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - Tcl_Parse *parsePtr = infoPtr->parsePtr; - Tcl_Token *tokenPtr, *firstTokenPtr; - int numToMove; - - if ((parsePtr->numTokens + 1) >= parsePtr->tokensAvailable) { - TclExpandTokenArray(parsePtr); - } - firstTokenPtr = &parsePtr->tokenPtr[firstIndex]; - tokenPtr = (firstTokenPtr + 2); - numToMove = (parsePtr->numTokens - firstIndex); - memmove((VOID *) tokenPtr, (VOID *) firstTokenPtr, - (size_t) (numToMove * sizeof(Tcl_Token))); - parsePtr->numTokens += 2; - - tokenPtr = firstTokenPtr; - tokenPtr->type = TCL_TOKEN_SUB_EXPR; - tokenPtr->start = src; - tokenPtr->size = srcBytes; - tokenPtr->numComponents = parsePtr->numTokens - (firstIndex + 1); - - tokenPtr++; - tokenPtr->type = TCL_TOKEN_OPERATOR; - tokenPtr->start = op; - tokenPtr->size = opBytes; - tokenPtr->numComponents = 0; -} - -/* - *---------------------------------------------------------------------- - * - * LogSyntaxError -- - * - * This procedure is invoked after an error occurs when parsing an - * expression. It sets the interpreter result to an error message - * describing the error. - * - * Results: - * None. - * - * Side effects: - * Sets the interpreter result to an error message describing the - * expression that was being parsed when the error occurred. - * - *---------------------------------------------------------------------- - */ - -static void -LogSyntaxError(infoPtr) - ParseInfo *infoPtr; /* Holds the parse state for the - * expression being parsed. */ -{ - int numBytes = (infoPtr->lastChar - infoPtr->originalExpr); - char buffer[100]; - - sprintf(buffer, "syntax error in expression \"%.*s\"", - ((numBytes > 60)? 60 : numBytes), infoPtr->originalExpr); - Tcl_AppendStringsToObj(Tcl_GetObjResult(infoPtr->parsePtr->interp), - buffer, (char *) NULL); -} diff --git a/generic/tclPipe.c b/generic/tclPipe.c deleted file mode 100644 index 4f39c93..0000000 --- a/generic/tclPipe.c +++ /dev/null @@ -1,1061 +0,0 @@ -/* - * tclPipe.c -- - * - * This file contains the generic portion of the command channel - * driver as well as various utility routines used in managing - * subprocesses. - * - * 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. - * - * RCS: @(#) $Id: tclPipe.c,v 1.3 1999/04/16 00:46:51 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * A linked list of the following structures is used to keep track - * of child processes that have been detached but haven't exited - * yet, so we can make sure that they're properly "reaped" (officially - * waited for) and don't lie around as zombies cluttering the - * system. - */ - -typedef struct Detached { - Tcl_Pid pid; /* Id of process that's been detached - * but isn't known to have exited. */ - struct Detached *nextPtr; /* Next in list of all detached - * processes. */ -} Detached; - -static Detached *detList = NULL; /* List of all detached proceses. */ -TCL_DECLARE_MUTEX(pipeMutex) /* Guard access to detList. */ - -/* - * Declarations for local procedures defined in this file: - */ - -static TclFile FileForRedirect _ANSI_ARGS_((Tcl_Interp *interp, - char *spec, int atOk, char *arg, char *nextArg, - int flags, int *skipPtr, int *closePtr, int *releasePtr)); - -/* - *---------------------------------------------------------------------- - * - * FileForRedirect -- - * - * This procedure does much of the work of parsing redirection - * operators. It handles "@" if specified and allowed, and a file - * name, and opens the file if necessary. - * - * Results: - * The return value is the descriptor number for the file. If an - * error occurs then NULL is returned and an error message is left - * in the interp's result. Several arguments are side-effected; see - * the argument list below for details. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static TclFile -FileForRedirect(interp, spec, atOK, arg, nextArg, flags, skipPtr, closePtr, - releasePtr) - Tcl_Interp *interp; /* Intepreter to use for error reporting. */ - char *spec; /* Points to character just after - * redirection character. */ - char *arg; /* Pointer to entire argument containing - * spec: used for error reporting. */ - int atOK; /* Non-zero means that '@' notation can be - * used to specify a channel, zero means that - * it isn't. */ - char *nextArg; /* Next argument in argc/argv array, if needed - * for file name or channel name. May be - * NULL. */ - int flags; /* Flags to use for opening file or to - * specify mode for channel. */ - int *skipPtr; /* Filled with 1 if redirection target was - * in spec, 2 if it was in nextArg. */ - int *closePtr; /* Filled with one if the caller should - * close the file when done with it, zero - * otherwise. */ - int *releasePtr; -{ - int writing = (flags & O_WRONLY); - Tcl_Channel chan; - TclFile file; - - *skipPtr = 1; - if ((atOK != 0) && (*spec == '@')) { - spec++; - if (*spec == '\0') { - spec = nextArg; - if (spec == NULL) { - goto badLastArg; - } - *skipPtr = 2; - } - chan = Tcl_GetChannel(interp, spec, NULL); - if (chan == (Tcl_Channel) NULL) { - return NULL; - } - file = TclpMakeFile(chan, writing ? TCL_WRITABLE : TCL_READABLE); - if (file == NULL) { - Tcl_AppendResult(interp, "channel \"", Tcl_GetChannelName(chan), - "\" wasn't opened for ", - ((writing) ? "writing" : "reading"), (char *) NULL); - return NULL; - } - *releasePtr = 1; - if (writing) { - - /* - * Be sure to flush output to the file, so that anything - * written by the child appears after stuff we've already - * written. - */ - - Tcl_Flush(chan); - } - } else { - char *name; - Tcl_DString nameString; - - if (*spec == '\0') { - spec = nextArg; - if (spec == NULL) { - goto badLastArg; - } - *skipPtr = 2; - } - name = Tcl_TranslateFileName(interp, spec, &nameString); - if (name != NULL) { - file = TclpOpenFile(name, flags); - } else { - file = NULL; - } - Tcl_DStringFree(&nameString); - if (file == NULL) { - Tcl_AppendResult(interp, "couldn't ", - ((writing) ? "write" : "read"), " file \"", spec, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return NULL; - } - *closePtr = 1; - } - return file; - - badLastArg: - Tcl_AppendResult(interp, "can't specify \"", arg, - "\" as last word in command", (char *) NULL); - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DetachPids -- - * - * This procedure is called to indicate that one or more child - * processes have been placed in background and will never be - * waited for; they should eventually be reaped by - * Tcl_ReapDetachedProcs. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DetachPids(numPids, pidPtr) - int numPids; /* Number of pids to detach: gives size - * of array pointed to by pidPtr. */ - Tcl_Pid *pidPtr; /* Array of pids to detach. */ -{ - register Detached *detPtr; - int i; - - Tcl_MutexLock(&pipeMutex); - for (i = 0; i < numPids; i++) { - detPtr = (Detached *) ckalloc(sizeof(Detached)); - detPtr->pid = pidPtr[i]; - detPtr->nextPtr = detList; - detList = detPtr; - } - Tcl_MutexUnlock(&pipeMutex); - -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ReapDetachedProcs -- - * - * This procedure checks to see if any detached processes have - * exited and, if so, it "reaps" them by officially waiting on - * them. It should be called "occasionally" to make sure that - * all detached processes are eventually reaped. - * - * Results: - * None. - * - * Side effects: - * Processes are waited on, so that they can be reaped by the - * system. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_ReapDetachedProcs() -{ - register Detached *detPtr; - Detached *nextPtr, *prevPtr; - int status; - Tcl_Pid pid; - - Tcl_MutexLock(&pipeMutex); - for (detPtr = detList, prevPtr = NULL; detPtr != NULL; ) { - pid = Tcl_WaitPid(detPtr->pid, &status, WNOHANG); - if ((pid == 0) || ((pid == (Tcl_Pid) -1) && (errno != ECHILD))) { - prevPtr = detPtr; - detPtr = detPtr->nextPtr; - continue; - } - nextPtr = detPtr->nextPtr; - if (prevPtr == NULL) { - detList = detPtr->nextPtr; - } else { - prevPtr->nextPtr = detPtr->nextPtr; - } - ckfree((char *) detPtr); - detPtr = nextPtr; - } - Tcl_MutexUnlock(&pipeMutex); -} - -/* - *---------------------------------------------------------------------- - * - * TclCleanupChildren -- - * - * This is a utility procedure used to wait for child processes - * to exit, record information about abnormal exits, and then - * collect any stderr output generated by them. - * - * Results: - * The return value is a standard Tcl result. If anything at - * weird happened with the child processes, TCL_ERROR is returned - * and a message is left in the interp's result. - * - * Side effects: - * If the last character of the interp's result is a newline, then it - * is removed unless keepNewline is non-zero. File errorId gets - * closed, and pidPtr is freed back to the storage allocator. - * - *---------------------------------------------------------------------- - */ - -int -TclCleanupChildren(interp, numPids, pidPtr, errorChan) - Tcl_Interp *interp; /* Used for error messages. */ - int numPids; /* Number of entries in pidPtr array. */ - Tcl_Pid *pidPtr; /* Array of process ids of children. */ - Tcl_Channel errorChan; /* Channel for file containing stderr output - * from pipeline. NULL means there isn't any - * stderr output. */ -{ - int result = TCL_OK; - int i, abnormalExit, anyErrorInfo; - Tcl_Pid pid; - WAIT_STATUS_TYPE waitStatus; - char *msg; - - abnormalExit = 0; - for (i = 0; i < numPids; i++) { - pid = Tcl_WaitPid(pidPtr[i], (int *) &waitStatus, 0); - if (pid == (Tcl_Pid) -1) { - result = TCL_ERROR; - if (interp != (Tcl_Interp *) NULL) { - msg = Tcl_PosixError(interp); - if (errno == ECHILD) { - /* - * This changeup in message suggested by Mark Diekhans - * to remind people that ECHILD errors can occur on - * some systems if SIGCHLD isn't in its default state. - */ - - msg = - "child process lost (is SIGCHLD ignored or trapped?)"; - } - Tcl_AppendResult(interp, "error waiting for process to exit: ", - msg, (char *) NULL); - } - continue; - } - - /* - * Create error messages for unusual process exits. An - * extra newline gets appended to each error message, but - * it gets removed below (in the same fashion that an - * extra newline in the command's output is removed). - */ - - if (!WIFEXITED(waitStatus) || (WEXITSTATUS(waitStatus) != 0)) { - char msg1[TCL_INTEGER_SPACE], msg2[TCL_INTEGER_SPACE]; - - result = TCL_ERROR; - TclFormatInt(msg1, (long) TclpGetPid(pid)); - if (WIFEXITED(waitStatus)) { - if (interp != (Tcl_Interp *) NULL) { - TclFormatInt(msg2, WEXITSTATUS(waitStatus)); - Tcl_SetErrorCode(interp, "CHILDSTATUS", msg1, msg2, - (char *) NULL); - } - abnormalExit = 1; - } else if (WIFSIGNALED(waitStatus)) { - if (interp != (Tcl_Interp *) NULL) { - char *p; - - p = Tcl_SignalMsg((int) (WTERMSIG(waitStatus))); - Tcl_SetErrorCode(interp, "CHILDKILLED", msg1, - Tcl_SignalId((int) (WTERMSIG(waitStatus))), p, - (char *) NULL); - Tcl_AppendResult(interp, "child killed: ", p, "\n", - (char *) NULL); - } - } else if (WIFSTOPPED(waitStatus)) { - if (interp != (Tcl_Interp *) NULL) { - char *p; - - p = Tcl_SignalMsg((int) (WSTOPSIG(waitStatus))); - Tcl_SetErrorCode(interp, "CHILDSUSP", msg1, - Tcl_SignalId((int) (WSTOPSIG(waitStatus))), - p, (char *) NULL); - Tcl_AppendResult(interp, "child suspended: ", p, "\n", - (char *) NULL); - } - } else { - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, - "child wait status didn't make sense\n", - (char *) NULL); - } - } - } - } - - /* - * Read the standard error file. If there's anything there, - * then return an error and add the file's contents to the result - * string. - */ - - anyErrorInfo = 0; - if (errorChan != NULL) { - - /* - * Make sure we start at the beginning of the file. - */ - - if (interp != NULL) { - int count; - Tcl_Obj *objPtr; - - Tcl_Seek(errorChan, 0L, SEEK_SET); - objPtr = Tcl_NewObj(); - count = Tcl_ReadChars(errorChan, objPtr, -1, 0); - if (count < 0) { - result = TCL_ERROR; - Tcl_DecrRefCount(objPtr); - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "error reading stderr output file: ", - Tcl_PosixError(interp), NULL); - } else if (count > 0) { - anyErrorInfo = 1; - Tcl_SetObjResult(interp, objPtr); - result = TCL_ERROR; - } else { - Tcl_DecrRefCount(objPtr); - } - } - Tcl_Close(NULL, errorChan); - } - - /* - * If a child exited abnormally but didn't output any error information - * at all, generate an error message here. - */ - - if ((abnormalExit != 0) && (anyErrorInfo == 0) && (interp != NULL)) { - Tcl_AppendResult(interp, "child process exited abnormally", - (char *) NULL); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclCreatePipeline -- - * - * Given an argc/argv array, instantiate a pipeline of processes - * as described by the argv. - * - * This procedure is unofficially exported for use by BLT. - * - * Results: - * The return value is a count of the number of new processes - * created, or -1 if an error occurred while creating the pipeline. - * *pidArrayPtr is filled in with the address of a dynamically - * allocated array giving the ids of all of the processes. It - * is up to the caller to free this array when it isn't needed - * anymore. If inPipePtr is non-NULL, *inPipePtr is filled in - * with the file id for the input pipe for the pipeline (if any): - * the caller must eventually close this file. If outPipePtr - * isn't NULL, then *outPipePtr is filled in with the file id - * for the output pipe from the pipeline: the caller must close - * this file. If errFilePtr isn't NULL, then *errFilePtr is filled - * with a file id that may be used to read error output after the - * pipeline completes. - * - * Side effects: - * Processes and pipes are created. - * - *---------------------------------------------------------------------- - */ - -int -TclCreatePipeline(interp, argc, argv, pidArrayPtr, inPipePtr, - outPipePtr, errFilePtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting. */ - int argc; /* Number of entries in argv. */ - char **argv; /* Array of strings describing commands in - * pipeline plus I/O redirection with <, - * <<, >, etc. Argv[argc] must be NULL. */ - Tcl_Pid **pidArrayPtr; /* Word at *pidArrayPtr gets filled in with - * address of array of pids for processes - * in pipeline (first pid is first process - * in pipeline). */ - TclFile *inPipePtr; /* If non-NULL, input to the pipeline comes - * from a pipe (unless overridden by - * redirection in the command). The file - * id with which to write to this pipe is - * stored at *inPipePtr. NULL means command - * specified its own input source. */ - TclFile *outPipePtr; /* If non-NULL, output to the pipeline goes - * to a pipe, unless overriden by redirection - * in the command. The file id with which to - * read frome this pipe is stored at - * *outPipePtr. NULL means command specified - * its own output sink. */ - TclFile *errFilePtr; /* If non-NULL, all stderr output from the - * pipeline will go to a temporary file - * created here, and a descriptor to read - * the file will be left at *errFilePtr. - * The file will be removed already, so - * closing this descriptor will be the end - * of the file. If this is NULL, then - * all stderr output goes to our stderr. - * If the pipeline specifies redirection - * then the file will still be created - * but it will never get any data. */ -{ - Tcl_Pid *pidPtr = NULL; /* Points to malloc-ed array holding all - * the pids of child processes. */ - int numPids; /* Actual number of processes that exist - * at *pidPtr right now. */ - int cmdCount; /* Count of number of distinct commands - * found in argc/argv. */ - char *inputLiteral = NULL; /* If non-null, then this points to a - * string containing input data (specified - * via <<) to be piped to the first process - * in the pipeline. */ - TclFile inputFile = NULL; /* If != NULL, gives file to use as input for - * first process in pipeline (specified via < - * or <@). */ - int inputClose = 0; /* If non-zero, then inputFile should be - * closed when cleaning up. */ - int inputRelease = 0; - TclFile outputFile = NULL; /* Writable file for output from last command - * in pipeline (could be file or pipe). NULL - * means use stdout. */ - int outputClose = 0; /* If non-zero, then outputFile should be - * closed when cleaning up. */ - int outputRelease = 0; - TclFile errorFile = NULL; /* Writable file for error output from all - * commands in pipeline. NULL means use - * stderr. */ - int errorClose = 0; /* If non-zero, then errorFile should be - * closed when cleaning up. */ - int errorRelease = 0; - char *p; - int skip, lastBar, lastArg, i, j, atOK, flags, errorToOutput; - Tcl_DString execBuffer; - TclFile pipeIn; - TclFile curInFile, curOutFile, curErrFile; - Tcl_Channel channel; - - if (inPipePtr != NULL) { - *inPipePtr = NULL; - } - if (outPipePtr != NULL) { - *outPipePtr = NULL; - } - if (errFilePtr != NULL) { - *errFilePtr = NULL; - } - - Tcl_DStringInit(&execBuffer); - - pipeIn = NULL; - curInFile = NULL; - curOutFile = NULL; - numPids = 0; - - /* - * First, scan through all the arguments to figure out the structure - * of the pipeline. Process all of the input and output redirection - * arguments and remove them from the argument list in the pipeline. - * Count the number of distinct processes (it's the number of "|" - * arguments plus one) but don't remove the "|" arguments because - * they'll be used in the second pass to seperate the individual - * child processes. Cannot start the child processes in this pass - * because the redirection symbols may appear anywhere in the - * command line -- e.g., the '<' that specifies the input to the - * entire pipe may appear at the very end of the argument list. - */ - - lastBar = -1; - cmdCount = 1; - for (i = 0; i < argc; i++) { - skip = 0; - p = argv[i]; - switch (*p++) { - case '|': - if (*p == '&') { - p++; - } - if (*p == '\0') { - if ((i == (lastBar + 1)) || (i == (argc - 1))) { - Tcl_SetResult(interp, - "illegal use of | or |& in command", - TCL_STATIC); - goto error; - } - } - lastBar = i; - cmdCount++; - break; - - case '<': - if (inputClose != 0) { - inputClose = 0; - TclpCloseFile(inputFile); - } - if (inputRelease != 0) { - inputRelease = 0; - TclpReleaseFile(inputFile); - } - if (*p == '<') { - inputFile = NULL; - inputLiteral = p + 1; - skip = 1; - if (*inputLiteral == '\0') { - inputLiteral = argv[i + 1]; - if (inputLiteral == NULL) { - Tcl_AppendResult(interp, "can't specify \"", argv[i], - "\" as last word in command", (char *) NULL); - goto error; - } - skip = 2; - } - } else { - inputLiteral = NULL; - inputFile = FileForRedirect(interp, p, 1, argv[i], - argv[i + 1], O_RDONLY, &skip, &inputClose, &inputRelease); - if (inputFile == NULL) { - goto error; - } - } - break; - - case '>': - atOK = 1; - flags = O_WRONLY | O_CREAT | O_TRUNC; - errorToOutput = 0; - if (*p == '>') { - p++; - atOK = 0; - flags = O_WRONLY | O_CREAT; - } - if (*p == '&') { - if (errorClose != 0) { - errorClose = 0; - TclpCloseFile(errorFile); - } - errorToOutput = 1; - p++; - } - - /* - * Close the old output file, but only if the error file is - * not also using it. - */ - - if (outputClose != 0) { - outputClose = 0; - if (errorFile == outputFile) { - errorClose = 1; - } else { - TclpCloseFile(outputFile); - } - } - if (outputRelease != 0) { - outputRelease = 0; - if (errorFile == outputFile) { - errorRelease = 1; - } else { - TclpReleaseFile(outputFile); - } - } - outputFile = FileForRedirect(interp, p, atOK, argv[i], - argv[i + 1], flags, &skip, &outputClose, &outputRelease); - if (outputFile == NULL) { - goto error; - } - if (errorToOutput) { - if (errorClose != 0) { - errorClose = 0; - TclpCloseFile(errorFile); - } - if (errorRelease != 0) { - errorRelease = 0; - TclpReleaseFile(errorFile); - } - errorFile = outputFile; - } - break; - - case '2': - if (*p != '>') { - break; - } - p++; - atOK = 1; - flags = O_WRONLY | O_CREAT | O_TRUNC; - if (*p == '>') { - p++; - atOK = 0; - flags = O_WRONLY | O_CREAT; - } - if (errorClose != 0) { - errorClose = 0; - TclpCloseFile(errorFile); - } - if (errorRelease != 0) { - errorRelease = 0; - TclpReleaseFile(errorFile); - } - errorFile = FileForRedirect(interp, p, atOK, argv[i], - argv[i + 1], flags, &skip, &errorClose, &errorRelease); - if (errorFile == NULL) { - goto error; - } - break; - } - - if (skip != 0) { - for (j = i + skip; j < argc; j++) { - argv[j - skip] = argv[j]; - } - argc -= skip; - i -= 1; - } - } - - if (inputFile == NULL) { - if (inputLiteral != NULL) { - /* - * The input for the first process is immediate data coming from - * Tcl. Create a temporary file for it and put the data into the - * file. - */ - inputFile = TclpCreateTempFile(inputLiteral); - if (inputFile == NULL) { - Tcl_AppendResult(interp, - "couldn't create input file for command: ", - Tcl_PosixError(interp), (char *) NULL); - goto error; - } - inputClose = 1; - } else if (inPipePtr != NULL) { - /* - * The input for the first process in the pipeline is to - * come from a pipe that can be written from by the caller. - */ - - if (TclpCreatePipe(&inputFile, inPipePtr) == 0) { - Tcl_AppendResult(interp, - "couldn't create input pipe for command: ", - Tcl_PosixError(interp), (char *) NULL); - goto error; - } - inputClose = 1; - } else { - /* - * The input for the first process comes from stdin. - */ - - channel = Tcl_GetStdChannel(TCL_STDIN); - if (channel != NULL) { - inputFile = TclpMakeFile(channel, TCL_READABLE); - if (inputFile != NULL) { - inputRelease = 1; - } - } - } - } - - if (outputFile == NULL) { - if (outPipePtr != NULL) { - /* - * Output from the last process in the pipeline is to go to a - * pipe that can be read by the caller. - */ - - if (TclpCreatePipe(outPipePtr, &outputFile) == 0) { - Tcl_AppendResult(interp, - "couldn't create output pipe for command: ", - Tcl_PosixError(interp), (char *) NULL); - goto error; - } - outputClose = 1; - } else { - /* - * The output for the last process goes to stdout. - */ - - channel = Tcl_GetStdChannel(TCL_STDOUT); - if (channel) { - outputFile = TclpMakeFile(channel, TCL_WRITABLE); - if (outputFile != NULL) { - outputRelease = 1; - } - } - } - } - - if (errorFile == NULL) { - if (errFilePtr != NULL) { - /* - * Set up the standard error output sink for the pipeline, if - * requested. Use a temporary file which is opened, then deleted. - * Could potentially just use pipe, but if it filled up it could - * cause the pipeline to deadlock: we'd be waiting for processes - * to complete before reading stderr, and processes couldn't - * complete because stderr was backed up. - */ - - errorFile = TclpCreateTempFile(NULL); - if (errorFile == NULL) { - Tcl_AppendResult(interp, - "couldn't create error file for command: ", - Tcl_PosixError(interp), (char *) NULL); - goto error; - } - *errFilePtr = errorFile; - } else { - /* - * Errors from the pipeline go to stderr. - */ - - channel = Tcl_GetStdChannel(TCL_STDERR); - if (channel) { - errorFile = TclpMakeFile(channel, TCL_WRITABLE); - if (errorFile != NULL) { - errorRelease = 1; - } - } - } - } - - /* - * Scan through the argc array, creating a process for each - * group of arguments between the "|" characters. - */ - - Tcl_ReapDetachedProcs(); - pidPtr = (Tcl_Pid *) ckalloc((unsigned) (cmdCount * sizeof(Tcl_Pid))); - - curInFile = inputFile; - - for (i = 0; i < argc; i = lastArg + 1) { - int result, joinThisError; - Tcl_Pid pid; - char *oldName; - - /* - * Convert the program name into native form. - */ - - if (Tcl_TranslateFileName(interp, argv[i], &execBuffer) == NULL) { - goto error; - } - - /* - * Find the end of the current segment of the pipeline. - */ - - joinThisError = 0; - for (lastArg = i; lastArg < argc; lastArg++) { - if (argv[lastArg][0] == '|') { - if (argv[lastArg][1] == '\0') { - break; - } - if ((argv[lastArg][1] == '&') && (argv[lastArg][2] == '\0')) { - joinThisError = 1; - break; - } - } - } - argv[lastArg] = NULL; - - /* - * If this is the last segment, use the specified outputFile. - * Otherwise create an intermediate pipe. pipeIn will become the - * curInFile for the next segment of the pipe. - */ - - if (lastArg == argc) { - curOutFile = outputFile; - } else { - if (TclpCreatePipe(&pipeIn, &curOutFile) == 0) { - Tcl_AppendResult(interp, "couldn't create pipe: ", - Tcl_PosixError(interp), (char *) NULL); - goto error; - } - } - - if (joinThisError != 0) { - curErrFile = curOutFile; - } else { - curErrFile = errorFile; - } - - /* - * Restore argv[i], since a caller wouldn't expect the contents of - * argv to be modified. - */ - - oldName = argv[i]; - argv[i] = Tcl_DStringValue(&execBuffer); - result = TclpCreateProcess(interp, lastArg - i, argv + i, - curInFile, curOutFile, curErrFile, &pid); - argv[i] = oldName; - if (result != TCL_OK) { - goto error; - } - Tcl_DStringFree(&execBuffer); - - pidPtr[numPids] = pid; - numPids++; - - /* - * Close off our copies of file descriptors that were set up for - * this child, then set up the input for the next child. - */ - - if ((curInFile != NULL) && (curInFile != inputFile)) { - TclpCloseFile(curInFile); - } - curInFile = pipeIn; - pipeIn = NULL; - - if ((curOutFile != NULL) && (curOutFile != outputFile)) { - TclpCloseFile(curOutFile); - } - curOutFile = NULL; - } - - *pidArrayPtr = pidPtr; - - /* - * All done. Cleanup open files lying around and then return. - */ - -cleanup: - Tcl_DStringFree(&execBuffer); - - if (inputClose) { - TclpCloseFile(inputFile); - } else if (inputRelease) { - TclpReleaseFile(inputFile); - } - if (outputClose) { - TclpCloseFile(outputFile); - } else if (outputRelease) { - TclpReleaseFile(outputFile); - } - if (errorClose) { - TclpCloseFile(errorFile); - } else if (errorRelease) { - TclpReleaseFile(errorFile); - } - return numPids; - - /* - * An error occurred. There could have been extra files open, such - * as pipes between children. Clean them all up. Detach any child - * processes that have been created. - */ - -error: - if (pipeIn != NULL) { - TclpCloseFile(pipeIn); - } - if ((curOutFile != NULL) && (curOutFile != outputFile)) { - TclpCloseFile(curOutFile); - } - if ((curInFile != NULL) && (curInFile != inputFile)) { - TclpCloseFile(curInFile); - } - if ((inPipePtr != NULL) && (*inPipePtr != NULL)) { - TclpCloseFile(*inPipePtr); - *inPipePtr = NULL; - } - if ((outPipePtr != NULL) && (*outPipePtr != NULL)) { - TclpCloseFile(*outPipePtr); - *outPipePtr = NULL; - } - if ((errFilePtr != NULL) && (*errFilePtr != NULL)) { - TclpCloseFile(*errFilePtr); - *errFilePtr = NULL; - } - if (pidPtr != NULL) { - for (i = 0; i < numPids; i++) { - if (pidPtr[i] != (Tcl_Pid) -1) { - Tcl_DetachPids(1, &pidPtr[i]); - } - } - ckfree((char *) pidPtr); - } - numPids = -1; - goto cleanup; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_OpenCommandChannel -- - * - * Opens an I/O channel to one or more subprocesses specified - * by argc and argv. The flags argument determines the - * disposition of the stdio handles. If the TCL_STDIN flag is - * set then the standard input for the first subprocess will - * be tied to the channel: writing to the channel will provide - * input to the subprocess. If TCL_STDIN is not set, then - * standard input for the first subprocess will be the same as - * this application's standard input. If TCL_STDOUT is set then - * standard output from the last subprocess can be read from the - * channel; otherwise it goes to this application's standard - * output. If TCL_STDERR is set, standard error output for all - * subprocesses is returned to the channel and results in an error - * when the channel is closed; otherwise it goes to this - * application's standard error. If TCL_ENFORCE_MODE is not set, - * then argc and argv can redirect the stdio handles to override - * TCL_STDIN, TCL_STDOUT, and TCL_STDERR; if it is set, then it - * is an error for argc and argv to override stdio channels for - * which TCL_STDIN, TCL_STDOUT, and TCL_STDERR have been set. - * - * Results: - * A new command channel, or NULL on failure with an error - * message left in interp. - * - * Side effects: - * Creates processes, opens pipes. - * - *---------------------------------------------------------------------- - */ - -Tcl_Channel -Tcl_OpenCommandChannel(interp, argc, argv, flags) - Tcl_Interp *interp; /* Interpreter for error reporting. Can - * NOT be NULL. */ - int argc; /* How many arguments. */ - char **argv; /* Array of arguments for command pipe. */ - int flags; /* Or'ed combination of TCL_STDIN, TCL_STDOUT, - * TCL_STDERR, and TCL_ENFORCE_MODE. */ -{ - TclFile *inPipePtr, *outPipePtr, *errFilePtr; - TclFile inPipe, outPipe, errFile; - int numPids; - Tcl_Pid *pidPtr; - Tcl_Channel channel; - - inPipe = outPipe = errFile = NULL; - - inPipePtr = (flags & TCL_STDIN) ? &inPipe : NULL; - outPipePtr = (flags & TCL_STDOUT) ? &outPipe : NULL; - errFilePtr = (flags & TCL_STDERR) ? &errFile : NULL; - - numPids = TclCreatePipeline(interp, argc, argv, &pidPtr, inPipePtr, - outPipePtr, errFilePtr); - - if (numPids < 0) { - goto error; - } - - /* - * Verify that the pipes that were created satisfy the - * readable/writable constraints. - */ - - if (flags & TCL_ENFORCE_MODE) { - if ((flags & TCL_STDOUT) && (outPipe == NULL)) { - Tcl_AppendResult(interp, "can't read output from command:", - " standard output was redirected", (char *) NULL); - goto error; - } - if ((flags & TCL_STDIN) && (inPipe == NULL)) { - Tcl_AppendResult(interp, "can't write input to command:", - " standard input was redirected", (char *) NULL); - goto error; - } - } - - channel = TclpCreateCommandChannel(outPipe, inPipe, errFile, - numPids, pidPtr); - - if (channel == (Tcl_Channel) NULL) { - Tcl_AppendResult(interp, "pipe for command could not be created", - (char *) NULL); - goto error; - } - return channel; - -error: - if (numPids > 0) { - Tcl_DetachPids(numPids, pidPtr); - ckfree((char *) pidPtr); - } - if (inPipe != NULL) { - TclpCloseFile(inPipe); - } - if (outPipe != NULL) { - TclpCloseFile(outPipe); - } - if (errFile != NULL) { - TclpCloseFile(errFile); - } - return NULL; -} diff --git a/generic/tclPkg.c b/generic/tclPkg.c deleted file mode 100644 index 5cb1818..0000000 --- a/generic/tclPkg.c +++ /dev/null @@ -1,976 +0,0 @@ -/* - * tclPkg.c -- - * - * This file implements package and version control for Tcl via - * the "package" command and a few C APIs. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclPkg.c,v 1.4 1999/04/16 00:46:51 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * Each invocation of the "package ifneeded" command creates a structure - * of the following type, which is used to load the package into the - * interpreter if it is requested with a "package require" command. - */ - -typedef struct PkgAvail { - char *version; /* Version string; malloc'ed. */ - char *script; /* Script to invoke to provide this version - * of the package. Malloc'ed and protected - * by Tcl_Preserve and Tcl_Release. */ - struct PkgAvail *nextPtr; /* Next in list of available versions of - * the same package. */ -} PkgAvail; - -/* - * For each package that is known in any way to an interpreter, there - * is one record of the following type. These records are stored in - * the "packageTable" hash table in the interpreter, keyed by - * package name such as "Tk" (no version number). - */ - -typedef struct Package { - char *version; /* Version that has been supplied in this - * interpreter via "package provide" - * (malloc'ed). NULL means the package doesn't - * exist in this interpreter yet. */ - PkgAvail *availPtr; /* First in list of all available versions - * of this package. */ - ClientData clientData; /* Client data. */ -} Package; - -/* - * Prototypes for procedures defined in this file: - */ - -static int CheckVersion _ANSI_ARGS_((Tcl_Interp *interp, - char *string)); -static int ComparePkgVersions _ANSI_ARGS_((char *v1, char *v2, - int *satPtr)); -static Package * FindPackage _ANSI_ARGS_((Tcl_Interp *interp, - char *name)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_PkgProvide / Tcl_PkgProvideEx -- - * - * This procedure is invoked to declare that a particular version - * of a particular package is now present in an interpreter. There - * must not be any other version of this package already - * provided in the interpreter. - * - * Results: - * Normally returns TCL_OK; if there is already another version - * of the package loaded then TCL_ERROR is returned and an error - * message is left in the interp's result. - * - * Side effects: - * The interpreter remembers that this package is available, - * so that no other version of the package may be provided for - * the interpreter. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_PkgProvide(interp, name, version) - Tcl_Interp *interp; /* Interpreter in which package is now - * available. */ - char *name; /* Name of package. */ - char *version; /* Version string for package. */ -{ - return Tcl_PkgProvideEx(interp, name, version, (ClientData) NULL); -} - -int -Tcl_PkgProvideEx(interp, name, version, clientData) - Tcl_Interp *interp; /* Interpreter in which package is now - * available. */ - char *name; /* Name of package. */ - char *version; /* Version string for package. */ - ClientData clientData; /* clientdata for this package (normally - * used for C callback function table) */ -{ - Package *pkgPtr; - - pkgPtr = FindPackage(interp, name); - if (pkgPtr->version == NULL) { - pkgPtr->version = ckalloc((unsigned) (strlen(version) + 1)); - strcpy(pkgPtr->version, version); - pkgPtr->clientData = clientData; - return TCL_OK; - } - if (ComparePkgVersions(pkgPtr->version, version, (int *) NULL) == 0) { - if (clientData != NULL) { - pkgPtr->clientData = clientData; - } - return TCL_OK; - } - Tcl_AppendResult(interp, "conflicting versions provided for package \"", - name, "\": ", pkgPtr->version, ", then ", version, (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PkgRequire / Tcl_PkgRequireEx -- - * - * This procedure is called by code that depends on a particular - * version of a particular package. If the package is not already - * provided in the interpreter, this procedure invokes a Tcl script - * to provide it. If the package is already provided, this - * procedure makes sure that the caller's needs don't conflict with - * the version that is present. - * - * Results: - * If successful, returns the version string for the currently - * provided version of the package, which may be different from - * the "version" argument. If the caller's requirements - * cannot be met (e.g. the version requested conflicts with - * a currently provided version, or the required version cannot - * be found, or the script to provide the required version - * generates an error), NULL is returned and an error - * message is left in the interp's result. - * - * Side effects: - * The script from some previous "package ifneeded" command may - * be invoked to provide the package. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_PkgRequire(interp, name, version, exact) - Tcl_Interp *interp; /* Interpreter in which package is now - * available. */ - char *name; /* Name of desired package. */ - char *version; /* Version string for desired version; - * NULL means use the latest version - * available. */ - int exact; /* Non-zero means that only the particular - * version given is acceptable. Zero means - * use the latest compatible version. */ -{ - return Tcl_PkgRequireEx(interp, name, version, exact, (ClientData *) NULL); -} - -char * -Tcl_PkgRequireEx(interp, name, version, exact, clientDataPtr) - Tcl_Interp *interp; /* Interpreter in which package is now - * available. */ - char *name; /* Name of desired package. */ - char *version; /* Version string for desired version; - * NULL means use the latest version - * available. */ - int exact; /* Non-zero means that only the particular - * version given is acceptable. Zero means - * use the latest compatible version. */ - ClientData *clientDataPtr; /* Used to return the client data for this - * package. If it is NULL then the client - * data is not returned. This is unchanged - * if this call fails for any reason. */ -{ - Package *pkgPtr; - PkgAvail *availPtr, *bestPtr; - char *script; - int code, satisfies, result, pass; - Tcl_DString command; - - /* - * If an attempt is being made to load this into a standalong executable - * on a platform where backlinking is not supported then this must be - * a shared version of Tcl (Otherwise the load would have failed). - * Detect this situation by checking that this library has been correctly - * initialised. If it has not been then return immediately as nothing will - * work. - */ - - if (!tclEmptyStringRep) { - Tcl_AppendResult(interp, "Cannot load package \"", name, - "\" in standalone executable: This package is not ", - "compiled with stub support", NULL); - return NULL; - } - - /* - * It can take up to three passes to find the package: one pass to - * run the "package unknown" script, one to run the "package ifneeded" - * script for a specific version, and a final pass to lookup the - * package loaded by the "package ifneeded" script. - */ - - for (pass = 1; ; pass++) { - pkgPtr = FindPackage(interp, name); - if (pkgPtr->version != NULL) { - break; - } - - /* - * The package isn't yet present. Search the list of available - * versions and invoke the script for the best available version. - */ - - bestPtr = NULL; - for (availPtr = pkgPtr->availPtr; availPtr != NULL; - availPtr = availPtr->nextPtr) { - if ((bestPtr != NULL) && (ComparePkgVersions(availPtr->version, - bestPtr->version, (int *) NULL) <= 0)) { - continue; - } - if (version != NULL) { - result = ComparePkgVersions(availPtr->version, version, - &satisfies); - if ((result != 0) && exact) { - continue; - } - if (!satisfies) { - continue; - } - } - bestPtr = availPtr; - } - if (bestPtr != NULL) { - /* - * We found an ifneeded script for the package. Be careful while - * executing it: this could cause reentrancy, so (a) protect the - * script itself from deletion and (b) don't assume that bestPtr - * will still exist when the script completes. - */ - - script = bestPtr->script; - Tcl_Preserve((ClientData) script); - code = Tcl_GlobalEval(interp, script); - Tcl_Release((ClientData) script); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - Tcl_AddErrorInfo(interp, - "\n (\"package ifneeded\" script)"); - } - return NULL; - } - Tcl_ResetResult(interp); - pkgPtr = FindPackage(interp, name); - break; - } - - /* - * Package not in the database. If there is a "package unknown" - * command, invoke it (but only on the first pass; after that, - * we should not get here in the first place). - */ - - if (pass > 1) { - break; - } - script = ((Interp *) interp)->packageUnknown; - if (script != NULL) { - Tcl_DStringInit(&command); - Tcl_DStringAppend(&command, script, -1); - Tcl_DStringAppendElement(&command, name); - Tcl_DStringAppend(&command, " ", 1); - Tcl_DStringAppend(&command, (version != NULL) ? version : "{}", - -1); - if (exact) { - Tcl_DStringAppend(&command, " -exact", 7); - } - code = Tcl_GlobalEval(interp, Tcl_DStringValue(&command)); - Tcl_DStringFree(&command); - if (code != TCL_OK) { - if (code == TCL_ERROR) { - Tcl_AddErrorInfo(interp, - "\n (\"package unknown\" script)"); - } - return NULL; - } - Tcl_ResetResult(interp); - } - } - - if (pkgPtr->version == NULL) { - Tcl_AppendResult(interp, "can't find package ", name, - (char *) NULL); - if (version != NULL) { - Tcl_AppendResult(interp, " ", version, (char *) NULL); - } - return NULL; - } - - /* - * At this point we know that the package is present. Make sure that the - * provided version meets the current requirement. - */ - - if (version == NULL) { - if (clientDataPtr) { - *clientDataPtr = pkgPtr->clientData; - } - return pkgPtr->version; - } - result = ComparePkgVersions(pkgPtr->version, version, &satisfies); - if ((satisfies && !exact) || (result == 0)) { - if (clientDataPtr) { - *clientDataPtr = pkgPtr->clientData; - } - return pkgPtr->version; - } - Tcl_AppendResult(interp, "version conflict for package \"", - name, "\": have ", pkgPtr->version, ", need ", version, - (char *) NULL); - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PkgPresent / Tcl_PkgPresentEx -- - * - * Checks to see whether the specified package is present. If it - * is not then no additional action is taken. - * - * Results: - * If successful, returns the version string for the currently - * provided version of the package, which may be different from - * the "version" argument. If the caller's requirements - * cannot be met (e.g. the version requested conflicts with - * a currently provided version), NULL is returned and an error - * message is left in interp->result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_PkgPresent(interp, name, version, exact) - Tcl_Interp *interp; /* Interpreter in which package is now - * available. */ - char *name; /* Name of desired package. */ - char *version; /* Version string for desired version; - * NULL means use the latest version - * available. */ - int exact; /* Non-zero means that only the particular - * version given is acceptable. Zero means - * use the latest compatible version. */ -{ - return Tcl_PkgPresentEx(interp, name, version, exact, (ClientData *) NULL); -} - -char * -Tcl_PkgPresentEx(interp, name, version, exact, clientDataPtr) - Tcl_Interp *interp; /* Interpreter in which package is now - * available. */ - char *name; /* Name of desired package. */ - char *version; /* Version string for desired version; - * NULL means use the latest version - * available. */ - int exact; /* Non-zero means that only the particular - * version given is acceptable. Zero means - * use the latest compatible version. */ - ClientData *clientDataPtr; /* Used to return the client data for this - * package. If it is NULL then the client - * data is not returned. This is unchanged - * if this call fails for any reason. */ -{ - Interp *iPtr = (Interp *) interp; - Tcl_HashEntry *hPtr; - Package *pkgPtr; - int satisfies, result; - - /* - * If an attempt is being made to load this into a standalone executable - * on a platform where backlinking is not supported then this must be - * a shared version of Tcl (Otherwise the load would have failed). - * Detect this situation by checking that this library has been correctly - * initialised. If it has not been then return immediately as nothing will - * work. - */ - - if (!tclEmptyStringRep) { - Tcl_AppendResult(interp, "Cannot load package \"", name, - "\" in standalone executable: This package is not ", - "compiled with stub support", NULL); - return NULL; - } - - hPtr = Tcl_FindHashEntry(&iPtr->packageTable, name); - if (hPtr) { - pkgPtr = (Package *) Tcl_GetHashValue(hPtr); - if (pkgPtr->version != NULL) { - - /* - * At this point we know that the package is present. Make sure - * that the provided version meets the current requirement. - */ - - if (version == NULL) { - if (clientDataPtr) { - *clientDataPtr = pkgPtr->clientData; - } - - return pkgPtr->version; - } - result = ComparePkgVersions(pkgPtr->version, version, &satisfies); - if ((satisfies && !exact) || (result == 0)) { - if (clientDataPtr) { - *clientDataPtr = pkgPtr->clientData; - } - - return pkgPtr->version; - } - Tcl_AppendResult(interp, "version conflict for package \"", - name, "\": have ", pkgPtr->version, - ", need ", version, (char *) NULL); - return NULL; - } - } - - if (version != NULL) { - Tcl_AppendResult(interp, "package ", name, " ", version, - " is not present", (char *) NULL); - } else { - Tcl_AppendResult(interp, "package ", name, " is not present", - (char *) NULL); - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PackageObjCmd -- - * - * This procedure is invoked to process the "package" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_PackageObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - static char *pkgOptions[] = { - "forget", "ifneeded", "names", "present", "provide", "require", - "unknown", "vcompare", "versions", "vsatisfies", (char *) NULL - }; - enum pkgOptions { - PKG_FORGET, PKG_IFNEEDED, PKG_NAMES, PKG_PRESENT, - PKG_PROVIDE, PKG_REQUIRE, PKG_UNKNOWN, PKG_VCOMPARE, - PKG_VERSIONS, PKG_VSATISFIES - }; - Interp *iPtr = (Interp *) interp; - int optionIndex, exact, i, satisfies; - PkgAvail *availPtr, *prevPtr; - Package *pkgPtr; - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - Tcl_HashTable *tablePtr; - char *version, *argv2, *argv3, *argv4; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], pkgOptions, "option", 0, - &optionIndex) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum pkgOptions) optionIndex) { - case PKG_FORGET: { - char *keyString; - for (i = 2; i < objc; i++) { - keyString = Tcl_GetString(objv[i]); - hPtr = Tcl_FindHashEntry(&iPtr->packageTable, keyString); - if (hPtr == NULL) { - return TCL_OK; - } - pkgPtr = (Package *) Tcl_GetHashValue(hPtr); - Tcl_DeleteHashEntry(hPtr); - if (pkgPtr->version != NULL) { - ckfree(pkgPtr->version); - } - while (pkgPtr->availPtr != NULL) { - availPtr = pkgPtr->availPtr; - pkgPtr->availPtr = availPtr->nextPtr; - ckfree(availPtr->version); - Tcl_EventuallyFree((ClientData)availPtr->script, TCL_DYNAMIC); - ckfree((char *) availPtr); - } - ckfree((char *) pkgPtr); - } - break; - } - case PKG_IFNEEDED: { - int length; - if ((objc != 4) && (objc != 5)) { - Tcl_WrongNumArgs(interp, 2, objv, "package version ?script?"); - return TCL_ERROR; - } - argv3 = Tcl_GetString(objv[3]); - if (CheckVersion(interp, argv3) != TCL_OK) { - return TCL_ERROR; - } - argv2 = Tcl_GetString(objv[2]); - if (objc == 4) { - hPtr = Tcl_FindHashEntry(&iPtr->packageTable, argv2); - if (hPtr == NULL) { - return TCL_OK; - } - pkgPtr = (Package *) Tcl_GetHashValue(hPtr); - } else { - pkgPtr = FindPackage(interp, argv2); - } - argv3 = Tcl_GetStringFromObj(objv[3], &length); - for (availPtr = pkgPtr->availPtr, prevPtr = NULL; availPtr != NULL; - prevPtr = availPtr, availPtr = availPtr->nextPtr) { - if (ComparePkgVersions(availPtr->version, argv3, (int *) NULL) - == 0) { - if (objc == 4) { - Tcl_SetResult(interp, availPtr->script, TCL_VOLATILE); - return TCL_OK; - } - Tcl_EventuallyFree((ClientData)availPtr->script, TCL_DYNAMIC); - break; - } - } - if (objc == 4) { - return TCL_OK; - } - if (availPtr == NULL) { - availPtr = (PkgAvail *) ckalloc(sizeof(PkgAvail)); - availPtr->version = ckalloc((unsigned) (length + 1)); - strcpy(availPtr->version, argv3); - if (prevPtr == NULL) { - availPtr->nextPtr = pkgPtr->availPtr; - pkgPtr->availPtr = availPtr; - } else { - availPtr->nextPtr = prevPtr->nextPtr; - prevPtr->nextPtr = availPtr; - } - } - argv4 = Tcl_GetStringFromObj(objv[4], &length); - availPtr->script = ckalloc((unsigned) (length + 1)); - strcpy(availPtr->script, argv4); - break; - } - case PKG_NAMES: { - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - tablePtr = &iPtr->packageTable; - for (hPtr = Tcl_FirstHashEntry(tablePtr, &search); hPtr != NULL; - hPtr = Tcl_NextHashEntry(&search)) { - pkgPtr = (Package *) Tcl_GetHashValue(hPtr); - if ((pkgPtr->version != NULL) || (pkgPtr->availPtr != NULL)) { - Tcl_AppendElement(interp, Tcl_GetHashKey(tablePtr, hPtr)); - } - } - break; - } - case PKG_PRESENT: { - if (objc < 3) { - presentSyntax: - Tcl_WrongNumArgs(interp, 2, objv, "?-exact? package ?version?"); - return TCL_ERROR; - } - argv2 = Tcl_GetString(objv[2]); - if ((argv2[0] == '-') && (strcmp(argv2, "-exact") == 0)) { - exact = 1; - } else { - exact = 0; - } - version = NULL; - if (objc == (4 + exact)) { - version = Tcl_GetString(objv[3 + exact]); - if (CheckVersion(interp, version) != TCL_OK) { - return TCL_ERROR; - } - } else if ((objc != 3) || exact) { - goto presentSyntax; - } - if (exact) { - argv3 = Tcl_GetString(objv[3]); - version = Tcl_PkgPresent(interp, argv3, version, exact); - } else { - version = Tcl_PkgPresent(interp, argv2, version, exact); - } - if (version == NULL) { - return TCL_ERROR; - } - Tcl_SetResult(interp, version, TCL_VOLATILE); - break; - } - case PKG_PROVIDE: { - if ((objc != 3) && (objc != 4)) { - Tcl_WrongNumArgs(interp, 2, objv, "package ?version?"); - return TCL_ERROR; - } - argv2 = Tcl_GetString(objv[2]); - if (objc == 3) { - hPtr = Tcl_FindHashEntry(&iPtr->packageTable, argv2); - if (hPtr != NULL) { - pkgPtr = (Package *) Tcl_GetHashValue(hPtr); - if (pkgPtr->version != NULL) { - Tcl_SetResult(interp, pkgPtr->version, TCL_VOLATILE); - } - } - return TCL_OK; - } - argv3 = Tcl_GetString(objv[3]); - if (CheckVersion(interp, argv3) != TCL_OK) { - return TCL_ERROR; - } - return Tcl_PkgProvide(interp, argv2, argv3); - } - case PKG_REQUIRE: { - if (objc < 3) { - requireSyntax: - Tcl_WrongNumArgs(interp, 2, objv, "?-exact? package ?version?"); - return TCL_ERROR; - } - argv2 = Tcl_GetString(objv[2]); - if ((argv2[0] == '-') && (strcmp(argv2, "-exact") == 0)) { - exact = 1; - } else { - exact = 0; - } - version = NULL; - if (objc == (4 + exact)) { - version = Tcl_GetString(objv[3 + exact]); - if (CheckVersion(interp, version) != TCL_OK) { - return TCL_ERROR; - } - } else if ((objc != 3) || exact) { - goto requireSyntax; - } - if (exact) { - argv3 = Tcl_GetString(objv[3]); - version = Tcl_PkgRequire(interp, argv3, version, exact); - } else { - version = Tcl_PkgRequire(interp, argv2, version, exact); - } - if (version == NULL) { - return TCL_ERROR; - } - Tcl_SetResult(interp, version, TCL_VOLATILE); - break; - } - case PKG_UNKNOWN: { - int length; - if (objc == 2) { - if (iPtr->packageUnknown != NULL) { - Tcl_SetResult(interp, iPtr->packageUnknown, TCL_VOLATILE); - } - } else if (objc == 3) { - if (iPtr->packageUnknown != NULL) { - ckfree(iPtr->packageUnknown); - } - argv2 = Tcl_GetStringFromObj(objv[2], &length); - if (argv2[0] == 0) { - iPtr->packageUnknown = NULL; - } else { - iPtr->packageUnknown = (char *) ckalloc((unsigned) - (length + 1)); - strcpy(iPtr->packageUnknown, argv2); - } - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?command?"); - return TCL_ERROR; - } - break; - } - case PKG_VCOMPARE: { - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "version1 version2"); - return TCL_ERROR; - } - argv3 = Tcl_GetString(objv[3]); - argv2 = Tcl_GetString(objv[2]); - if ((CheckVersion(interp, argv2) != TCL_OK) - || (CheckVersion(interp, argv3) != TCL_OK)) { - return TCL_ERROR; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), - ComparePkgVersions(argv2, argv3, (int *) NULL)); - break; - } - case PKG_VERSIONS: { - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "package"); - return TCL_ERROR; - } - argv2 = Tcl_GetString(objv[2]); - hPtr = Tcl_FindHashEntry(&iPtr->packageTable, argv2); - if (hPtr != NULL) { - pkgPtr = (Package *) Tcl_GetHashValue(hPtr); - for (availPtr = pkgPtr->availPtr; availPtr != NULL; - availPtr = availPtr->nextPtr) { - Tcl_AppendElement(interp, availPtr->version); - } - } - break; - } - case PKG_VSATISFIES: { - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "version1 version2"); - return TCL_ERROR; - } - argv3 = Tcl_GetString(objv[3]); - argv2 = Tcl_GetString(objv[2]); - if ((CheckVersion(interp, argv2) != TCL_OK) - || (CheckVersion(interp, argv3) != TCL_OK)) { - return TCL_ERROR; - } - ComparePkgVersions(argv2, argv3, &satisfies); - Tcl_SetIntObj(Tcl_GetObjResult(interp), satisfies); - break; - } - default: { - panic("Tcl_PackageObjCmd: bad option index to pkgOptions"); - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * FindPackage -- - * - * This procedure finds the Package record for a particular package - * in a particular interpreter, creating a record if one doesn't - * already exist. - * - * Results: - * The return value is a pointer to the Package record for the - * package. - * - * Side effects: - * A new Package record may be created. - * - *---------------------------------------------------------------------- - */ - -static Package * -FindPackage(interp, name) - Tcl_Interp *interp; /* Interpreter to use for package lookup. */ - char *name; /* Name of package to fine. */ -{ - Interp *iPtr = (Interp *) interp; - Tcl_HashEntry *hPtr; - int new; - Package *pkgPtr; - - hPtr = Tcl_CreateHashEntry(&iPtr->packageTable, name, &new); - if (new) { - pkgPtr = (Package *) ckalloc(sizeof(Package)); - pkgPtr->version = NULL; - pkgPtr->availPtr = NULL; - pkgPtr->clientData = NULL; - Tcl_SetHashValue(hPtr, pkgPtr); - } else { - pkgPtr = (Package *) Tcl_GetHashValue(hPtr); - } - return pkgPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclFreePackageInfo -- - * - * This procedure is called during interpreter deletion to - * free all of the package-related information for the - * interpreter. - * - * Results: - * None. - * - * Side effects: - * Memory is freed. - * - *---------------------------------------------------------------------- - */ - -void -TclFreePackageInfo(iPtr) - Interp *iPtr; /* Interpereter that is being deleted. */ -{ - Package *pkgPtr; - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - PkgAvail *availPtr; - - for (hPtr = Tcl_FirstHashEntry(&iPtr->packageTable, &search); - hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - pkgPtr = (Package *) Tcl_GetHashValue(hPtr); - if (pkgPtr->version != NULL) { - ckfree(pkgPtr->version); - } - while (pkgPtr->availPtr != NULL) { - availPtr = pkgPtr->availPtr; - pkgPtr->availPtr = availPtr->nextPtr; - ckfree(availPtr->version); - Tcl_EventuallyFree((ClientData)availPtr->script, TCL_DYNAMIC); - ckfree((char *) availPtr); - } - ckfree((char *) pkgPtr); - } - Tcl_DeleteHashTable(&iPtr->packageTable); - if (iPtr->packageUnknown != NULL) { - ckfree(iPtr->packageUnknown); - } -} - -/* - *---------------------------------------------------------------------- - * - * CheckVersion -- - * - * This procedure checks to see whether a version number has - * valid syntax. - * - * Results: - * If string is a properly formed version number the TCL_OK - * is returned. Otherwise TCL_ERROR is returned and an error - * message is left in the interp's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -CheckVersion(interp, string) - Tcl_Interp *interp; /* Used for error reporting. */ - char *string; /* Supposedly a version number, which is - * groups of decimal digits separated - * by dots. */ -{ - char *p = string; - - if (!isdigit(UCHAR(*p))) { /* INTL: digit */ - goto error; - } - for (p++; *p != 0; p++) { - if (!isdigit(UCHAR(*p)) && (*p != '.')) { /* INTL: digit */ - goto error; - } - } - if (p[-1] != '.') { - return TCL_OK; - } - - error: - Tcl_AppendResult(interp, "expected version number but got \"", - string, "\"", (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * ComparePkgVersions -- - * - * This procedure compares two version numbers. - * - * Results: - * The return value is -1 if v1 is less than v2, 0 if the two - * version numbers are the same, and 1 if v1 is greater than v2. - * If *satPtr is non-NULL, the word it points to is filled in - * with 1 if v2 >= v1 and both numbers have the same major number - * or 0 otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -ComparePkgVersions(v1, v2, satPtr) - char *v1, *v2; /* Versions strings, of form 2.1.3 (any - * number of version numbers). */ - int *satPtr; /* If non-null, the word pointed to is - * filled in with a 0/1 value. 1 means - * v1 "satisfies" v2: v1 is greater than - * or equal to v2 and both version numbers - * have the same major number. */ -{ - int thisIsMajor, n1, n2; - - /* - * Each iteration of the following loop processes one number from - * each string, terminated by a ".". If those numbers don't match - * then the comparison is over; otherwise, we loop back for the - * next number. - */ - - thisIsMajor = 1; - while (1) { - /* - * Parse one decimal number from the front of each string. - */ - - n1 = n2 = 0; - while ((*v1 != 0) && (*v1 != '.')) { - n1 = 10*n1 + (*v1 - '0'); - v1++; - } - while ((*v2 != 0) && (*v2 != '.')) { - n2 = 10*n2 + (*v2 - '0'); - v2++; - } - - /* - * Compare and go on to the next version number if the - * current numbers match. - */ - - if (n1 != n2) { - break; - } - if (*v1 != 0) { - v1++; - } else if (*v2 == 0) { - break; - } - if (*v2 != 0) { - v2++; - } - thisIsMajor = 0; - } - if (satPtr != NULL) { - *satPtr = (n1 == n2) || ((n1 > n2) && !thisIsMajor); - } - if (n1 > n2) { - return 1; - } else if (n1 == n2) { - return 0; - } else { - return -1; - } -} diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h deleted file mode 100644 index 214020d..0000000 --- a/generic/tclPlatDecls.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * tclPlatDecls.h -- - * - * Declarations of platform specific Tcl APIs. - * - * Copyright (c) 1998-1999 by Scriptics Corporation. - * All rights reserved. - * - * RCS: @(#) $Id: tclPlatDecls.h,v 1.4 1999/04/16 00:46:51 stanton Exp $ - */ - -#ifndef _TCLPLATDECLS -#define _TCLPLATDECLS - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported function declarations: - */ - -#ifdef __WIN32__ -/* 0 */ -EXTERN TCHAR * Tcl_WinUtfToTChar _ANSI_ARGS_((CONST char * str, - int len, Tcl_DString * dsPtr)); -/* 1 */ -EXTERN char * Tcl_WinTCharToUtf _ANSI_ARGS_((CONST TCHAR * str, - int len, Tcl_DString * dsPtr)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 0 */ -EXTERN void Tcl_MacSetEventProc _ANSI_ARGS_(( - Tcl_MacConvertEventPtr procPtr)); -/* 1 */ -EXTERN char * Tcl_MacConvertTextResource _ANSI_ARGS_(( - Handle resource)); -/* 2 */ -EXTERN int Tcl_MacEvalResource _ANSI_ARGS_((Tcl_Interp * interp, - char * resourceName, int resourceNumber, - char * fileName)); -/* 3 */ -EXTERN Handle Tcl_MacFindResource _ANSI_ARGS_((Tcl_Interp * interp, - long resourceType, char * resourceName, - int resourceNumber, char * resFileRef, - int * releaseIt)); -/* 4 */ -EXTERN int Tcl_GetOSTypeFromObj _ANSI_ARGS_(( - Tcl_Interp * interp, Tcl_Obj * objPtr, - OSType * osTypePtr)); -/* 5 */ -EXTERN void Tcl_SetOSTypeObj _ANSI_ARGS_((Tcl_Obj * objPtr, - OSType osType)); -/* 6 */ -EXTERN Tcl_Obj * Tcl_NewOSTypeObj _ANSI_ARGS_((OSType osType)); -/* 7 */ -EXTERN int strncasecmp _ANSI_ARGS_((CONST char * s1, - CONST char * s2, size_t n)); -/* 8 */ -EXTERN int strcasecmp _ANSI_ARGS_((CONST char * s1, - CONST char * s2)); -#endif /* MAC_TCL */ - -typedef struct TclPlatStubs { - int magic; - struct TclPlatStubHooks *hooks; - -#ifdef __WIN32__ - TCHAR * (*tcl_WinUtfToTChar) _ANSI_ARGS_((CONST char * str, int len, Tcl_DString * dsPtr)); /* 0 */ - char * (*tcl_WinTCharToUtf) _ANSI_ARGS_((CONST TCHAR * str, int len, Tcl_DString * dsPtr)); /* 1 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void (*tcl_MacSetEventProc) _ANSI_ARGS_((Tcl_MacConvertEventPtr procPtr)); /* 0 */ - char * (*tcl_MacConvertTextResource) _ANSI_ARGS_((Handle resource)); /* 1 */ - int (*tcl_MacEvalResource) _ANSI_ARGS_((Tcl_Interp * interp, char * resourceName, int resourceNumber, char * fileName)); /* 2 */ - Handle (*tcl_MacFindResource) _ANSI_ARGS_((Tcl_Interp * interp, long resourceType, char * resourceName, int resourceNumber, char * resFileRef, int * releaseIt)); /* 3 */ - int (*tcl_GetOSTypeFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, OSType * osTypePtr)); /* 4 */ - void (*tcl_SetOSTypeObj) _ANSI_ARGS_((Tcl_Obj * objPtr, OSType osType)); /* 5 */ - Tcl_Obj * (*tcl_NewOSTypeObj) _ANSI_ARGS_((OSType osType)); /* 6 */ - int (*strncasecmp) _ANSI_ARGS_((CONST char * s1, CONST char * s2, size_t n)); /* 7 */ - int (*strcasecmp) _ANSI_ARGS_((CONST char * s1, CONST char * s2)); /* 8 */ -#endif /* MAC_TCL */ -} TclPlatStubs; - -extern TclPlatStubs *tclPlatStubsPtr; - -#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) - -/* - * Inline function declarations: - */ - -#ifdef __WIN32__ -#ifndef Tcl_WinUtfToTChar -#define Tcl_WinUtfToTChar \ - (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */ -#endif -#ifndef Tcl_WinTCharToUtf -#define Tcl_WinTCharToUtf \ - (tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef Tcl_MacSetEventProc -#define Tcl_MacSetEventProc \ - (tclPlatStubsPtr->tcl_MacSetEventProc) /* 0 */ -#endif -#ifndef Tcl_MacConvertTextResource -#define Tcl_MacConvertTextResource \ - (tclPlatStubsPtr->tcl_MacConvertTextResource) /* 1 */ -#endif -#ifndef Tcl_MacEvalResource -#define Tcl_MacEvalResource \ - (tclPlatStubsPtr->tcl_MacEvalResource) /* 2 */ -#endif -#ifndef Tcl_MacFindResource -#define Tcl_MacFindResource \ - (tclPlatStubsPtr->tcl_MacFindResource) /* 3 */ -#endif -#ifndef Tcl_GetOSTypeFromObj -#define Tcl_GetOSTypeFromObj \ - (tclPlatStubsPtr->tcl_GetOSTypeFromObj) /* 4 */ -#endif -#ifndef Tcl_SetOSTypeObj -#define Tcl_SetOSTypeObj \ - (tclPlatStubsPtr->tcl_SetOSTypeObj) /* 5 */ -#endif -#ifndef Tcl_NewOSTypeObj -#define Tcl_NewOSTypeObj \ - (tclPlatStubsPtr->tcl_NewOSTypeObj) /* 6 */ -#endif -#ifndef strncasecmp -#define strncasecmp \ - (tclPlatStubsPtr->strncasecmp) /* 7 */ -#endif -#ifndef strcasecmp -#define strcasecmp \ - (tclPlatStubsPtr->strcasecmp) /* 8 */ -#endif -#endif /* MAC_TCL */ - -#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#endif /* _TCLPLATDECLS */ - - diff --git a/generic/tclPort.h b/generic/tclPort.h deleted file mode 100644 index 5c7c486..0000000 --- a/generic/tclPort.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * tclPort.h -- - * - * This header file handles porting issues that occur because - * of differences between systems. It reads in platform specific - * portability files. - * - * Copyright (c) 1994-1995 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclPort.h,v 1.3 1999/04/16 00:46:52 stanton Exp $ - */ - -#ifndef _TCLPORT -#define _TCLPORT - -#if defined(__WIN32__) -# include "../win/tclWinPort.h" -#else -# if defined(MAC_TCL) -# include "tclMacPort.h" -# else -# include "../unix/tclUnixPort.h" -# endif -#endif - -#endif /* _TCLPORT */ diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c deleted file mode 100644 index 7e61d20..0000000 --- a/generic/tclPosixStr.c +++ /dev/null @@ -1,1174 +0,0 @@ -/* - * tclPosixStr.c -- - * - * This file contains procedures that generate strings - * corresponding to various POSIX-related codes, such - * as errno and signals. - * - * Copyright (c) 1991-1994 The Regents of the University of California. - * 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. - * - * RCS: @(#) $Id: tclPosixStr.c,v 1.4 1999/04/16 00:46:52 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - *---------------------------------------------------------------------- - * - * Tcl_ErrnoId -- - * - * Return a textual identifier for the current errno value. - * - * Results: - * This procedure returns a machine-readable textual identifier - * that corresponds to the current errno value (e.g. "EPERM"). - * The identifier is the same as the #define name in errno.h. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_ErrnoId() -{ - switch (errno) { -#ifdef E2BIG - case E2BIG: return "E2BIG"; -#endif -#ifdef EACCES - case EACCES: return "EACCES"; -#endif -#ifdef EADDRINUSE - case EADDRINUSE: return "EADDRINUSE"; -#endif -#ifdef EADDRNOTAVAIL - case EADDRNOTAVAIL: return "EADDRNOTAVAIL"; -#endif -#ifdef EADV - case EADV: return "EADV"; -#endif -#ifdef EAFNOSUPPORT - case EAFNOSUPPORT: return "EAFNOSUPPORT"; -#endif -#ifdef EAGAIN - case EAGAIN: return "EAGAIN"; -#endif -#ifdef EALIGN - case EALIGN: return "EALIGN"; -#endif -#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY )) - case EALREADY: return "EALREADY"; -#endif -#ifdef EBADE - case EBADE: return "EBADE"; -#endif -#ifdef EBADF - case EBADF: return "EBADF"; -#endif -#ifdef EBADFD - case EBADFD: return "EBADFD"; -#endif -#ifdef EBADMSG - case EBADMSG: return "EBADMSG"; -#endif -#ifdef EBADR - case EBADR: return "EBADR"; -#endif -#ifdef EBADRPC - case EBADRPC: return "EBADRPC"; -#endif -#ifdef EBADRQC - case EBADRQC: return "EBADRQC"; -#endif -#ifdef EBADSLT - case EBADSLT: return "EBADSLT"; -#endif -#ifdef EBFONT - case EBFONT: return "EBFONT"; -#endif -#ifdef EBUSY - case EBUSY: return "EBUSY"; -#endif -#ifdef ECHILD - case ECHILD: return "ECHILD"; -#endif -#ifdef ECHRNG - case ECHRNG: return "ECHRNG"; -#endif -#ifdef ECOMM - case ECOMM: return "ECOMM"; -#endif -#ifdef ECONNABORTED - case ECONNABORTED: return "ECONNABORTED"; -#endif -#ifdef ECONNREFUSED - case ECONNREFUSED: return "ECONNREFUSED"; -#endif -#ifdef ECONNRESET - case ECONNRESET: return "ECONNRESET"; -#endif -#if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK)) - case EDEADLK: return "EDEADLK"; -#endif -#if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK)) - case EDEADLOCK: return "EDEADLOCK"; -#endif -#ifdef EDESTADDRREQ - case EDESTADDRREQ: return "EDESTADDRREQ"; -#endif -#ifdef EDIRTY - case EDIRTY: return "EDIRTY"; -#endif -#ifdef EDOM - case EDOM: return "EDOM"; -#endif -#ifdef EDOTDOT - case EDOTDOT: return "EDOTDOT"; -#endif -#ifdef EDQUOT - case EDQUOT: return "EDQUOT"; -#endif -#ifdef EDUPPKG - case EDUPPKG: return "EDUPPKG"; -#endif -#ifdef EEXIST - case EEXIST: return "EEXIST"; -#endif -#ifdef EFAULT - case EFAULT: return "EFAULT"; -#endif -#ifdef EFBIG - case EFBIG: return "EFBIG"; -#endif -#ifdef EHOSTDOWN - case EHOSTDOWN: return "EHOSTDOWN"; -#endif -#ifdef EHOSTUNREACH - case EHOSTUNREACH: return "EHOSTUNREACH"; -#endif -#if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS)) - case EIDRM: return "EIDRM"; -#endif -#ifdef EINIT - case EINIT: return "EINIT"; -#endif -#ifdef EINPROGRESS - case EINPROGRESS: return "EINPROGRESS"; -#endif -#ifdef EINTR - case EINTR: return "EINTR"; -#endif -#ifdef EINVAL - case EINVAL: return "EINVAL"; -#endif -#ifdef EIO - case EIO: return "EIO"; -#endif -#ifdef EISCONN - case EISCONN: return "EISCONN"; -#endif -#ifdef EISDIR - case EISDIR: return "EISDIR"; -#endif -#ifdef EISNAME - case EISNAM: return "EISNAM"; -#endif -#ifdef ELBIN - case ELBIN: return "ELBIN"; -#endif -#ifdef EL2HLT - case EL2HLT: return "EL2HLT"; -#endif -#ifdef EL2NSYNC - case EL2NSYNC: return "EL2NSYNC"; -#endif -#ifdef EL3HLT - case EL3HLT: return "EL3HLT"; -#endif -#ifdef EL3RST - case EL3RST: return "EL3RST"; -#endif -#ifdef ELIBACC - case ELIBACC: return "ELIBACC"; -#endif -#ifdef ELIBBAD - case ELIBBAD: return "ELIBBAD"; -#endif -#ifdef ELIBEXEC - case ELIBEXEC: return "ELIBEXEC"; -#endif -#ifdef ELIBMAX - case ELIBMAX: return "ELIBMAX"; -#endif -#ifdef ELIBSCN - case ELIBSCN: return "ELIBSCN"; -#endif -#ifdef ELNRNG - case ELNRNG: return "ELNRNG"; -#endif -#if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT)) - case ELOOP: return "ELOOP"; -#endif -#ifdef EMFILE - case EMFILE: return "EMFILE"; -#endif -#ifdef EMLINK - case EMLINK: return "EMLINK"; -#endif -#ifdef EMSGSIZE - case EMSGSIZE: return "EMSGSIZE"; -#endif -#ifdef EMULTIHOP - case EMULTIHOP: return "EMULTIHOP"; -#endif -#ifdef ENAMETOOLONG - case ENAMETOOLONG: return "ENAMETOOLONG"; -#endif -#ifdef ENAVAIL - case ENAVAIL: return "ENAVAIL"; -#endif -#ifdef ENET - case ENET: return "ENET"; -#endif -#ifdef ENETDOWN - case ENETDOWN: return "ENETDOWN"; -#endif -#ifdef ENETRESET - case ENETRESET: return "ENETRESET"; -#endif -#ifdef ENETUNREACH - case ENETUNREACH: return "ENETUNREACH"; -#endif -#ifdef ENFILE - case ENFILE: return "ENFILE"; -#endif -#ifdef ENOANO - case ENOANO: return "ENOANO"; -#endif -#if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR)) - case ENOBUFS: return "ENOBUFS"; -#endif -#ifdef ENOCSI - case ENOCSI: return "ENOCSI"; -#endif -#if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED)) - case ENODATA: return "ENODATA"; -#endif -#ifdef ENODEV - case ENODEV: return "ENODEV"; -#endif -#ifdef ENOENT - case ENOENT: return "ENOENT"; -#endif -#ifdef ENOEXEC - case ENOEXEC: return "ENOEXEC"; -#endif -#ifdef ENOLCK - case ENOLCK: return "ENOLCK"; -#endif -#ifdef ENOLINK - case ENOLINK: return "ENOLINK"; -#endif -#ifdef ENOMEM - case ENOMEM: return "ENOMEM"; -#endif -#ifdef ENOMSG - case ENOMSG: return "ENOMSG"; -#endif -#ifdef ENONET - case ENONET: return "ENONET"; -#endif -#ifdef ENOPKG - case ENOPKG: return "ENOPKG"; -#endif -#ifdef ENOPROTOOPT - case ENOPROTOOPT: return "ENOPROTOOPT"; -#endif -#ifdef ENOSPC - case ENOSPC: return "ENOSPC"; -#endif -#if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR)) - case ENOSR: return "ENOSR"; -#endif -#if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR)) - case ENOSTR: return "ENOSTR"; -#endif -#ifdef ENOSYM - case ENOSYM: return "ENOSYM"; -#endif -#ifdef ENOSYS - case ENOSYS: return "ENOSYS"; -#endif -#ifdef ENOTBLK - case ENOTBLK: return "ENOTBLK"; -#endif -#ifdef ENOTCONN - case ENOTCONN: return "ENOTCONN"; -#endif -#ifdef ENOTDIR - case ENOTDIR: return "ENOTDIR"; -#endif -#if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST)) - case ENOTEMPTY: return "ENOTEMPTY"; -#endif -#ifdef ENOTNAM - case ENOTNAM: return "ENOTNAM"; -#endif -#ifdef ENOTSOCK - case ENOTSOCK: return "ENOTSOCK"; -#endif -#ifdef ENOTSUP - case ENOTSUP: return "ENOTSUP"; -#endif -#ifdef ENOTTY - case ENOTTY: return "ENOTTY"; -#endif -#ifdef ENOTUNIQ - case ENOTUNIQ: return "ENOTUNIQ"; -#endif -#ifdef ENXIO - case ENXIO: return "ENXIO"; -#endif -#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP)) - case EOPNOTSUPP: return "EOPNOTSUPP"; -#endif -#ifdef EPERM - case EPERM: return "EPERM"; -#endif -#if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT)) - case EPFNOSUPPORT: return "EPFNOSUPPORT"; -#endif -#ifdef EPIPE - case EPIPE: return "EPIPE"; -#endif -#ifdef EPROCLIM - case EPROCLIM: return "EPROCLIM"; -#endif -#ifdef EPROCUNAVAIL - case EPROCUNAVAIL: return "EPROCUNAVAIL"; -#endif -#ifdef EPROGMISMATCH - case EPROGMISMATCH: return "EPROGMISMATCH"; -#endif -#ifdef EPROGUNAVAIL - case EPROGUNAVAIL: return "EPROGUNAVAIL"; -#endif -#ifdef EPROTO - case EPROTO: return "EPROTO"; -#endif -#ifdef EPROTONOSUPPORT - case EPROTONOSUPPORT: return "EPROTONOSUPPORT"; -#endif -#ifdef EPROTOTYPE - case EPROTOTYPE: return "EPROTOTYPE"; -#endif -#ifdef ERANGE - case ERANGE: return "ERANGE"; -#endif -#if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED)) - case EREFUSED: return "EREFUSED"; -#endif -#ifdef EREMCHG - case EREMCHG: return "EREMCHG"; -#endif -#ifdef EREMDEV - case EREMDEV: return "EREMDEV"; -#endif -#ifdef EREMOTE - case EREMOTE: return "EREMOTE"; -#endif -#ifdef EREMOTEIO - case EREMOTEIO: return "EREMOTEIO"; -#endif -#ifdef EREMOTERELEASE - case EREMOTERELEASE: return "EREMOTERELEASE"; -#endif -#ifdef EROFS - case EROFS: return "EROFS"; -#endif -#ifdef ERPCMISMATCH - case ERPCMISMATCH: return "ERPCMISMATCH"; -#endif -#ifdef ERREMOTE - case ERREMOTE: return "ERREMOTE"; -#endif -#ifdef ESHUTDOWN - case ESHUTDOWN: return "ESHUTDOWN"; -#endif -#ifdef ESOCKTNOSUPPORT - case ESOCKTNOSUPPORT: return "ESOCKTNOSUPPORT"; -#endif -#ifdef ESPIPE - case ESPIPE: return "ESPIPE"; -#endif -#ifdef ESRCH - case ESRCH: return "ESRCH"; -#endif -#ifdef ESRMNT - case ESRMNT: return "ESRMNT"; -#endif -#ifdef ESTALE - case ESTALE: return "ESTALE"; -#endif -#ifdef ESUCCESS - case ESUCCESS: return "ESUCCESS"; -#endif -#if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP)) - case ETIME: return "ETIME"; -#endif -#if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR)) - case ETIMEDOUT: return "ETIMEDOUT"; -#endif -#ifdef ETOOMANYREFS - case ETOOMANYREFS: return "ETOOMANYREFS"; -#endif -#ifdef ETXTBSY - case ETXTBSY: return "ETXTBSY"; -#endif -#ifdef EUCLEAN - case EUCLEAN: return "EUCLEAN"; -#endif -#ifdef EUNATCH - case EUNATCH: return "EUNATCH"; -#endif -#ifdef EUSERS - case EUSERS: return "EUSERS"; -#endif -#ifdef EVERSION - case EVERSION: return "EVERSION"; -#endif -#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN)) - case EWOULDBLOCK: return "EWOULDBLOCK"; -#endif -#ifdef EXDEV - case EXDEV: return "EXDEV"; -#endif -#ifdef EXFULL - case EXFULL: return "EXFULL"; -#endif - } - return "unknown error"; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ErrnoMsg -- - * - * Return a human-readable message corresponding to a given - * errno value. - * - * Results: - * The return value is the standard POSIX error message for - * errno. This procedure is used instead of strerror because - * strerror returns slightly different values on different - * machines (e.g. different capitalizations), which cause - * problems for things such as regression tests. This procedure - * provides messages for most standard errors, then it calls - * strerror for things it doesn't understand. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_ErrnoMsg(err) - int err; /* Error number (such as in errno variable). */ -{ - switch (err) { -#ifdef E2BIG - case E2BIG: return "argument list too long"; -#endif -#ifdef EACCES - case EACCES: return "permission denied"; -#endif -#ifdef EADDRINUSE - case EADDRINUSE: return "address already in use"; -#endif -#ifdef EADDRNOTAVAIL - case EADDRNOTAVAIL: return "can't assign requested address"; -#endif -#ifdef EADV - case EADV: return "advertise error"; -#endif -#ifdef EAFNOSUPPORT - case EAFNOSUPPORT: return "address family not supported by protocol family"; -#endif -#ifdef EAGAIN - case EAGAIN: return "resource temporarily unavailable"; -#endif -#ifdef EALIGN - case EALIGN: return "EALIGN"; -#endif -#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY )) - case EALREADY: return "operation already in progress"; -#endif -#ifdef EBADE - case EBADE: return "bad exchange descriptor"; -#endif -#ifdef EBADF - case EBADF: return "bad file number"; -#endif -#ifdef EBADFD - case EBADFD: return "file descriptor in bad state"; -#endif -#ifdef EBADMSG - case EBADMSG: return "not a data message"; -#endif -#ifdef EBADR - case EBADR: return "bad request descriptor"; -#endif -#ifdef EBADRPC - case EBADRPC: return "RPC structure is bad"; -#endif -#ifdef EBADRQC - case EBADRQC: return "bad request code"; -#endif -#ifdef EBADSLT - case EBADSLT: return "invalid slot"; -#endif -#ifdef EBFONT - case EBFONT: return "bad font file format"; -#endif -#ifdef EBUSY - case EBUSY: return "file busy"; -#endif -#ifdef ECHILD - case ECHILD: return "no children"; -#endif -#ifdef ECHRNG - case ECHRNG: return "channel number out of range"; -#endif -#ifdef ECOMM - case ECOMM: return "communication error on send"; -#endif -#ifdef ECONNABORTED - case ECONNABORTED: return "software caused connection abort"; -#endif -#ifdef ECONNREFUSED - case ECONNREFUSED: return "connection refused"; -#endif -#ifdef ECONNRESET - case ECONNRESET: return "connection reset by peer"; -#endif -#if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK)) - case EDEADLK: return "resource deadlock avoided"; -#endif -#if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK)) - case EDEADLOCK: return "resource deadlock avoided"; -#endif -#ifdef EDESTADDRREQ - case EDESTADDRREQ: return "destination address required"; -#endif -#ifdef EDIRTY - case EDIRTY: return "mounting a dirty fs w/o force"; -#endif -#ifdef EDOM - case EDOM: return "math argument out of range"; -#endif -#ifdef EDOTDOT - case EDOTDOT: return "cross mount point"; -#endif -#ifdef EDQUOT - case EDQUOT: return "disk quota exceeded"; -#endif -#ifdef EDUPPKG - case EDUPPKG: return "duplicate package name"; -#endif -#ifdef EEXIST - case EEXIST: return "file already exists"; -#endif -#ifdef EFAULT - case EFAULT: return "bad address in system call argument"; -#endif -#ifdef EFBIG - case EFBIG: return "file too large"; -#endif -#ifdef EHOSTDOWN - case EHOSTDOWN: return "host is down"; -#endif -#ifdef EHOSTUNREACH - case EHOSTUNREACH: return "host is unreachable"; -#endif -#if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS)) - case EIDRM: return "identifier removed"; -#endif -#ifdef EINIT - case EINIT: return "initialization error"; -#endif -#ifdef EINPROGRESS - case EINPROGRESS: return "operation now in progress"; -#endif -#ifdef EINTR - case EINTR: return "interrupted system call"; -#endif -#ifdef EINVAL - case EINVAL: return "invalid argument"; -#endif -#ifdef EIO - case EIO: return "I/O error"; -#endif -#ifdef EISCONN - case EISCONN: return "socket is already connected"; -#endif -#ifdef EISDIR - case EISDIR: return "illegal operation on a directory"; -#endif -#ifdef EISNAME - case EISNAM: return "is a name file"; -#endif -#ifdef ELBIN - case ELBIN: return "ELBIN"; -#endif -#ifdef EL2HLT - case EL2HLT: return "level 2 halted"; -#endif -#ifdef EL2NSYNC - case EL2NSYNC: return "level 2 not synchronized"; -#endif -#ifdef EL3HLT - case EL3HLT: return "level 3 halted"; -#endif -#ifdef EL3RST - case EL3RST: return "level 3 reset"; -#endif -#ifdef ELIBACC - case ELIBACC: return "can not access a needed shared library"; -#endif -#ifdef ELIBBAD - case ELIBBAD: return "accessing a corrupted shared library"; -#endif -#ifdef ELIBEXEC - case ELIBEXEC: return "can not exec a shared library directly"; -#endif -#ifdef ELIBMAX - case ELIBMAX: return - "attempting to link in more shared libraries than system limit"; -#endif -#ifdef ELIBSCN - case ELIBSCN: return ".lib section in a.out corrupted"; -#endif -#ifdef ELNRNG - case ELNRNG: return "link number out of range"; -#endif -#if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT)) - case ELOOP: return "too many levels of symbolic links"; -#endif -#ifdef EMFILE - case EMFILE: return "too many open files"; -#endif -#ifdef EMLINK - case EMLINK: return "too many links"; -#endif -#ifdef EMSGSIZE - case EMSGSIZE: return "message too long"; -#endif -#ifdef EMULTIHOP - case EMULTIHOP: return "multihop attempted"; -#endif -#ifdef ENAMETOOLONG - case ENAMETOOLONG: return "file name too long"; -#endif -#ifdef ENAVAIL - case ENAVAIL: return "not available"; -#endif -#ifdef ENET - case ENET: return "ENET"; -#endif -#ifdef ENETDOWN - case ENETDOWN: return "network is down"; -#endif -#ifdef ENETRESET - case ENETRESET: return "network dropped connection on reset"; -#endif -#ifdef ENETUNREACH - case ENETUNREACH: return "network is unreachable"; -#endif -#ifdef ENFILE - case ENFILE: return "file table overflow"; -#endif -#ifdef ENOANO - case ENOANO: return "anode table overflow"; -#endif -#if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR)) - case ENOBUFS: return "no buffer space available"; -#endif -#ifdef ENOCSI - case ENOCSI: return "no CSI structure available"; -#endif -#if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED)) - case ENODATA: return "no data available"; -#endif -#ifdef ENODEV - case ENODEV: return "no such device"; -#endif -#ifdef ENOENT - case ENOENT: return "no such file or directory"; -#endif -#ifdef ENOEXEC - case ENOEXEC: return "exec format error"; -#endif -#ifdef ENOLCK - case ENOLCK: return "no locks available"; -#endif -#ifdef ENOLINK - case ENOLINK: return "link has be severed"; -#endif -#ifdef ENOMEM - case ENOMEM: return "not enough memory"; -#endif -#ifdef ENOMSG - case ENOMSG: return "no message of desired type"; -#endif -#ifdef ENONET - case ENONET: return "machine is not on the network"; -#endif -#ifdef ENOPKG - case ENOPKG: return "package not installed"; -#endif -#ifdef ENOPROTOOPT - case ENOPROTOOPT: return "bad proocol option"; -#endif -#ifdef ENOSPC - case ENOSPC: return "no space left on device"; -#endif -#if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR)) - case ENOSR: return "out of stream resources"; -#endif -#if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR)) - case ENOSTR: return "not a stream device"; -#endif -#ifdef ENOSYM - case ENOSYM: return "unresolved symbol name"; -#endif -#ifdef ENOSYS - case ENOSYS: return "function not implemented"; -#endif -#ifdef ENOTBLK - case ENOTBLK: return "block device required"; -#endif -#ifdef ENOTCONN - case ENOTCONN: return "socket is not connected"; -#endif -#ifdef ENOTDIR - case ENOTDIR: return "not a directory"; -#endif -#if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST)) - case ENOTEMPTY: return "directory not empty"; -#endif -#ifdef ENOTNAM - case ENOTNAM: return "not a name file"; -#endif -#ifdef ENOTSOCK - case ENOTSOCK: return "socket operation on non-socket"; -#endif -#ifdef ENOTSUP - case ENOTSUP: return "operation not supported"; -#endif -#ifdef ENOTTY - case ENOTTY: return "inappropriate device for ioctl"; -#endif -#ifdef ENOTUNIQ - case ENOTUNIQ: return "name not unique on network"; -#endif -#ifdef ENXIO - case ENXIO: return "no such device or address"; -#endif -#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP)) - case EOPNOTSUPP: return "operation not supported on socket"; -#endif -#ifdef EPERM - case EPERM: return "not owner"; -#endif -#if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT)) - case EPFNOSUPPORT: return "protocol family not supported"; -#endif -#ifdef EPIPE - case EPIPE: return "broken pipe"; -#endif -#ifdef EPROCLIM - case EPROCLIM: return "too many processes"; -#endif -#ifdef EPROCUNAVAIL - case EPROCUNAVAIL: return "bad procedure for program"; -#endif -#ifdef EPROGMISMATCH - case EPROGMISMATCH: return "program version wrong"; -#endif -#ifdef EPROGUNAVAIL - case EPROGUNAVAIL: return "RPC program not available"; -#endif -#ifdef EPROTO - case EPROTO: return "protocol error"; -#endif -#ifdef EPROTONOSUPPORT - case EPROTONOSUPPORT: return "protocol not suppored"; -#endif -#ifdef EPROTOTYPE - case EPROTOTYPE: return "protocol wrong type for socket"; -#endif -#ifdef ERANGE - case ERANGE: return "math result unrepresentable"; -#endif -#if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED)) - case EREFUSED: return "EREFUSED"; -#endif -#ifdef EREMCHG - case EREMCHG: return "remote address changed"; -#endif -#ifdef EREMDEV - case EREMDEV: return "remote device"; -#endif -#ifdef EREMOTE - case EREMOTE: return "pathname hit remote file system"; -#endif -#ifdef EREMOTEIO - case EREMOTEIO: return "remote i/o error"; -#endif -#ifdef EREMOTERELEASE - case EREMOTERELEASE: return "EREMOTERELEASE"; -#endif -#ifdef EROFS - case EROFS: return "read-only file system"; -#endif -#ifdef ERPCMISMATCH - case ERPCMISMATCH: return "RPC version is wrong"; -#endif -#ifdef ERREMOTE - case ERREMOTE: return "object is remote"; -#endif -#ifdef ESHUTDOWN - case ESHUTDOWN: return "can't send afer socket shutdown"; -#endif -#ifdef ESOCKTNOSUPPORT - case ESOCKTNOSUPPORT: return "socket type not supported"; -#endif -#ifdef ESPIPE - case ESPIPE: return "invalid seek"; -#endif -#ifdef ESRCH - case ESRCH: return "no such process"; -#endif -#ifdef ESRMNT - case ESRMNT: return "srmount error"; -#endif -#ifdef ESTALE - case ESTALE: return "stale remote file handle"; -#endif -#ifdef ESUCCESS - case ESUCCESS: return "Error 0"; -#endif -#if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP)) - case ETIME: return "timer expired"; -#endif -#if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR)) - case ETIMEDOUT: return "connection timed out"; -#endif -#ifdef ETOOMANYREFS - case ETOOMANYREFS: return "too many references: can't splice"; -#endif -#ifdef ETXTBSY - case ETXTBSY: return "text file or pseudo-device busy"; -#endif -#ifdef EUCLEAN - case EUCLEAN: return "structure needs cleaning"; -#endif -#ifdef EUNATCH - case EUNATCH: return "protocol driver not attached"; -#endif -#ifdef EUSERS - case EUSERS: return "too many users"; -#endif -#ifdef EVERSION - case EVERSION: return "version mismatch"; -#endif -#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN)) - case EWOULDBLOCK: return "operation would block"; -#endif -#ifdef EXDEV - case EXDEV: return "cross-domain link"; -#endif -#ifdef EXFULL - case EXFULL: return "message tables full"; -#endif - default: -#ifdef NO_STRERROR - return "unknown POSIX error"; -#else - return strerror(errno); -#endif - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SignalId -- - * - * Return a textual identifier for a signal number. - * - * Results: - * This procedure returns a machine-readable textual identifier - * that corresponds to sig. The identifier is the same as the - * #define name in signal.h. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_SignalId(sig) - int sig; /* Number of signal. */ -{ - switch (sig) { -#ifdef SIGABRT - case SIGABRT: return "SIGABRT"; -#endif -#ifdef SIGALRM - case SIGALRM: return "SIGALRM"; -#endif -#ifdef SIGBUS - case SIGBUS: return "SIGBUS"; -#endif -#ifdef SIGCHLD - case SIGCHLD: return "SIGCHLD"; -#endif -#if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD)) - case SIGCLD: return "SIGCLD"; -#endif -#ifdef SIGCONT - case SIGCONT: return "SIGCONT"; -#endif -#if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU)) - case SIGEMT: return "SIGEMT"; -#endif -#ifdef SIGFPE - case SIGFPE: return "SIGFPE"; -#endif -#ifdef SIGHUP - case SIGHUP: return "SIGHUP"; -#endif -#ifdef SIGILL - case SIGILL: return "SIGILL"; -#endif -#ifdef SIGINT - case SIGINT: return "SIGINT"; -#endif -#ifdef SIGIO - case SIGIO: return "SIGIO"; -#endif -#if defined(SIGIOT) && (!defined(SIGABRT) || (SIGIOT != SIGABRT)) - case SIGIOT: return "SIGIOT"; -#endif -#ifdef SIGKILL - case SIGKILL: return "SIGKILL"; -#endif -#if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG)) && (!defined(SIGPROF) || (SIGLOST != SIGPROF)) && (!defined(SIGIO) || (SIGLOST != SIGIO)) - case SIGLOST: return "SIGLOST"; -#endif -#ifdef SIGPIPE - case SIGPIPE: return "SIGPIPE"; -#endif -#if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO)) - case SIGPOLL: return "SIGPOLL"; -#endif -#ifdef SIGPROF - case SIGPROF: return "SIGPROF"; -#endif -#if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ)) - case SIGPWR: return "SIGPWR"; -#endif -#ifdef SIGQUIT - case SIGQUIT: return "SIGQUIT"; -#endif -#ifdef SIGSEGV - case SIGSEGV: return "SIGSEGV"; -#endif -#ifdef SIGSTOP - case SIGSTOP: return "SIGSTOP"; -#endif -#ifdef SIGSYS - case SIGSYS: return "SIGSYS"; -#endif -#ifdef SIGTERM - case SIGTERM: return "SIGTERM"; -#endif -#ifdef SIGTRAP - case SIGTRAP: return "SIGTRAP"; -#endif -#ifdef SIGTSTP - case SIGTSTP: return "SIGTSTP"; -#endif -#ifdef SIGTTIN - case SIGTTIN: return "SIGTTIN"; -#endif -#ifdef SIGTTOU - case SIGTTOU: return "SIGTTOU"; -#endif -#if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO)) - case SIGURG: return "SIGURG"; -#endif -#if defined(SIGUSR1) && (!defined(SIGIO) || (SIGUSR1 != SIGIO)) - case SIGUSR1: return "SIGUSR1"; -#endif -#if defined(SIGUSR2) && (!defined(SIGURG) || (SIGUSR2 != SIGURG)) - case SIGUSR2: return "SIGUSR2"; -#endif -#ifdef SIGVTALRM - case SIGVTALRM: return "SIGVTALRM"; -#endif -#ifdef SIGWINCH - case SIGWINCH: return "SIGWINCH"; -#endif -#ifdef SIGXCPU - case SIGXCPU: return "SIGXCPU"; -#endif -#ifdef SIGXFSZ - case SIGXFSZ: return "SIGXFSZ"; -#endif - } - return "unknown signal"; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SignalMsg -- - * - * Return a human-readable message describing a signal. - * - * Results: - * This procedure returns a string describing sig that should - * make sense to a human. It may not be easy for a machine - * to parse. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_SignalMsg(sig) - int sig; /* Number of signal. */ -{ - switch (sig) { -#ifdef SIGABRT - case SIGABRT: return "SIGABRT"; -#endif -#ifdef SIGALRM - case SIGALRM: return "alarm clock"; -#endif -#ifdef SIGBUS - case SIGBUS: return "bus error"; -#endif -#ifdef SIGCHLD - case SIGCHLD: return "child status changed"; -#endif -#if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD)) - case SIGCLD: return "child status changed"; -#endif -#ifdef SIGCONT - case SIGCONT: return "continue after stop"; -#endif -#if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU)) - case SIGEMT: return "EMT instruction"; -#endif -#ifdef SIGFPE - case SIGFPE: return "floating-point exception"; -#endif -#ifdef SIGHUP - case SIGHUP: return "hangup"; -#endif -#ifdef SIGILL - case SIGILL: return "illegal instruction"; -#endif -#ifdef SIGINT - case SIGINT: return "interrupt"; -#endif -#ifdef SIGIO - case SIGIO: return "input/output possible on file"; -#endif -#if defined(SIGIOT) && (!defined(SIGABRT) || (SIGABRT != SIGIOT)) - case SIGIOT: return "IOT instruction"; -#endif -#ifdef SIGKILL - case SIGKILL: return "kill signal"; -#endif -#if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG)) && (!defined(SIGPROF) || (SIGLOST != SIGPROF)) && (!defined(SIGIO) || (SIGLOST != SIGIO)) - case SIGLOST: return "resource lost"; -#endif -#ifdef SIGPIPE - case SIGPIPE: return "write on pipe with no readers"; -#endif -#if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO)) - case SIGPOLL: return "input/output possible on file"; -#endif -#ifdef SIGPROF - case SIGPROF: return "profiling alarm"; -#endif -#if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ)) - case SIGPWR: return "power-fail restart"; -#endif -#ifdef SIGQUIT - case SIGQUIT: return "quit signal"; -#endif -#ifdef SIGSEGV - case SIGSEGV: return "segmentation violation"; -#endif -#ifdef SIGSTOP - case SIGSTOP: return "stop"; -#endif -#ifdef SIGSYS - case SIGSYS: return "bad argument to system call"; -#endif -#ifdef SIGTERM - case SIGTERM: return "software termination signal"; -#endif -#ifdef SIGTRAP - case SIGTRAP: return "trace trap"; -#endif -#ifdef SIGTSTP - case SIGTSTP: return "stop signal from tty"; -#endif -#ifdef SIGTTIN - case SIGTTIN: return "background tty read"; -#endif -#ifdef SIGTTOU - case SIGTTOU: return "background tty write"; -#endif -#if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO)) - case SIGURG: return "urgent I/O condition"; -#endif -#if defined(SIGUSR1) && (!defined(SIGIO) || (SIGUSR1 != SIGIO)) - case SIGUSR1: return "user-defined signal 1"; -#endif -#if defined(SIGUSR2) && (!defined(SIGURG) || (SIGUSR2 != SIGURG)) - case SIGUSR2: return "user-defined signal 2"; -#endif -#ifdef SIGVTALRM - case SIGVTALRM: return "virtual time alarm"; -#endif -#ifdef SIGWINCH - case SIGWINCH: return "window changed"; -#endif -#ifdef SIGXCPU - case SIGXCPU: return "exceeded CPU time limit"; -#endif -#ifdef SIGXFSZ - case SIGXFSZ: return "exceeded file size limit"; -#endif - } - return "unknown signal"; -} diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c deleted file mode 100644 index 50dfb02..0000000 --- a/generic/tclPreserve.c +++ /dev/null @@ -1,490 +0,0 @@ -/* - * tclPreserve.c -- - * - * This file contains a collection of procedures that are used - * to make sure that widget records and other data structures - * aren't reallocated when there are nested procedures that - * depend on their existence. - * - * Copyright (c) 1991-1994 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclPreserve.c,v 1.3 1999/04/16 00:46:52 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * The following data structure is used to keep track of all the - * Tcl_Preserve calls that are still in effect. It grows as needed - * to accommodate any number of calls in effect. - */ - -typedef struct { - ClientData clientData; /* Address of preserved block. */ - int refCount; /* Number of Tcl_Preserve calls in effect - * for block. */ - int mustFree; /* Non-zero means Tcl_EventuallyFree was - * called while a Tcl_Preserve call was in - * effect, so the structure must be freed - * when refCount becomes zero. */ - Tcl_FreeProc *freeProc; /* Procedure to call to free. */ -} Reference; - -static Reference *refArray; /* First in array of references. */ -static int spaceAvl = 0; /* Total number of structures available - * at *firstRefPtr. */ -static int inUse = 0; /* Count of structures currently in use - * in refArray. */ -#define INITIAL_SIZE 2 -TCL_DECLARE_MUTEX(preserveMutex)/* To protect the above statics */ - -/* - * The following data structure is used to keep track of whether an - * arbitrary block of memory has been deleted. This is used by the - * TclHandle code to avoid the more time-expensive algorithm of - * Tcl_Preserve(). This mechanism is mainly used when we have lots of - * references to a few big, expensive objects that we don't want to live - * any longer than necessary. - */ - -typedef struct HandleStruct { - VOID *ptr; /* Pointer to the memory block being - * tracked. This field will become NULL when - * the memory block is deleted. This field - * must be the first in the structure. */ -#ifdef TCL_MEM_DEBUG - VOID *ptr2; /* Backup copy of the abpve pointer used to - * ensure that the contents of the handle are - * not changed by anyone else. */ -#endif - int refCount; /* Number of TclHandlePreserve() calls in - * effect on this handle. */ -} HandleStruct; - - -/* - * Static routines in this file: - */ - -static void PreserveExitProc _ANSI_ARGS_((ClientData clientData)); - - -/* - *---------------------------------------------------------------------- - * - * PreserveExitProc -- - * - * Called during exit processing to clean up the reference array. - * - * Results: - * None. - * - * Side effects: - * Frees the storage of the reference array. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static void -PreserveExitProc(clientData) - ClientData clientData; /* NULL -Unused. */ -{ - Tcl_MutexLock(&preserveMutex); - if (spaceAvl != 0) { - ckfree((char *) refArray); - refArray = (Reference *) NULL; - inUse = 0; - spaceAvl = 0; - } - Tcl_MutexUnlock(&preserveMutex); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Preserve -- - * - * This procedure is used by a procedure to declare its interest - * in a particular block of memory, so that the block will not be - * reallocated until a matching call to Tcl_Release has been made. - * - * Results: - * None. - * - * Side effects: - * Information is retained so that the block of memory will - * not be freed until at least the matching call to Tcl_Release. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_Preserve(clientData) - ClientData clientData; /* Pointer to malloc'ed block of memory. */ -{ - Reference *refPtr; - int i; - - /* - * See if there is already a reference for this pointer. If so, - * just increment its reference count. - */ - - Tcl_MutexLock(&preserveMutex); - for (i = 0, refPtr = refArray; i < inUse; i++, refPtr++) { - if (refPtr->clientData == clientData) { - refPtr->refCount++; - Tcl_MutexUnlock(&preserveMutex); - return; - } - } - - /* - * Make a reference array if it doesn't already exist, or make it - * bigger if it is full. - */ - - if (inUse == spaceAvl) { - if (spaceAvl == 0) { - Tcl_CreateExitHandler((Tcl_ExitProc *) PreserveExitProc, - (ClientData) NULL); - refArray = (Reference *) ckalloc((unsigned) - (INITIAL_SIZE*sizeof(Reference))); - spaceAvl = INITIAL_SIZE; - } else { - Reference *new; - - new = (Reference *) ckalloc((unsigned) - (2*spaceAvl*sizeof(Reference))); - memcpy((VOID *) new, (VOID *) refArray, - spaceAvl*sizeof(Reference)); - ckfree((char *) refArray); - refArray = new; - spaceAvl *= 2; - } - } - - /* - * Make a new entry for the new reference. - */ - - refPtr = &refArray[inUse]; - refPtr->clientData = clientData; - refPtr->refCount = 1; - refPtr->mustFree = 0; - refPtr->freeProc = TCL_STATIC; - inUse += 1; - Tcl_MutexUnlock(&preserveMutex); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Release -- - * - * This procedure is called to cancel a previous call to - * Tcl_Preserve, thereby allowing a block of memory to be - * freed (if no one else cares about it). - * - * Results: - * None. - * - * Side effects: - * If Tcl_EventuallyFree has been called for clientData, and if - * no other call to Tcl_Preserve is still in effect, the block of - * memory is freed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_Release(clientData) - ClientData clientData; /* Pointer to malloc'ed block of memory. */ -{ - Reference *refPtr; - int mustFree; - Tcl_FreeProc *freeProc; - int i; - - Tcl_MutexLock(&preserveMutex); - for (i = 0, refPtr = refArray; i < inUse; i++, refPtr++) { - if (refPtr->clientData != clientData) { - continue; - } - refPtr->refCount--; - if (refPtr->refCount == 0) { - - /* - * Must remove information from the slot before calling freeProc - * to avoid reentrancy problems if the freeProc calls Tcl_Preserve - * on the same clientData. Copy down the last reference in the - * array to overwrite the current slot. - */ - - freeProc = refPtr->freeProc; - mustFree = refPtr->mustFree; - inUse--; - if (i < inUse) { - refArray[i] = refArray[inUse]; - } - if (mustFree) { - if ((freeProc == TCL_DYNAMIC) || - (freeProc == (Tcl_FreeProc *) free)) { - ckfree((char *) clientData); - } else { - Tcl_MutexUnlock(&preserveMutex); - (*freeProc)((char *) clientData); - return; - } - } - } - Tcl_MutexUnlock(&preserveMutex); - return; - } - Tcl_MutexUnlock(&preserveMutex); - - /* - * Reference not found. This is a bug in the caller. - */ - - panic("Tcl_Release couldn't find reference for 0x%x", clientData); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_EventuallyFree -- - * - * Free up a block of memory, unless a call to Tcl_Preserve is in - * effect for that block. In this case, defer the free until all - * calls to Tcl_Preserve have been undone by matching calls to - * Tcl_Release. - * - * Results: - * None. - * - * Side effects: - * Ptr may be released by calling free(). - * - *---------------------------------------------------------------------- - */ - -void -Tcl_EventuallyFree(clientData, freeProc) - ClientData clientData; /* Pointer to malloc'ed block of memory. */ - Tcl_FreeProc *freeProc; /* Procedure to actually do free. */ -{ - Reference *refPtr; - int i; - - /* - * See if there is a reference for this pointer. If so, set its - * "mustFree" flag (the flag had better not be set already!). - */ - - Tcl_MutexLock(&preserveMutex); - for (i = 0, refPtr = refArray; i < inUse; i++, refPtr++) { - if (refPtr->clientData != clientData) { - continue; - } - if (refPtr->mustFree) { - panic("Tcl_EventuallyFree called twice for 0x%x\n", clientData); - } - refPtr->mustFree = 1; - refPtr->freeProc = freeProc; - Tcl_MutexUnlock(&preserveMutex); - return; - } - Tcl_MutexUnlock(&preserveMutex); - - /* - * No reference for this block. Free it now. - */ - - if ((freeProc == TCL_DYNAMIC) - || (freeProc == (Tcl_FreeProc *) free)) { - ckfree((char *) clientData); - } else { - (*freeProc)((char *)clientData); - } -} - -/* - *--------------------------------------------------------------------------- - * - * TclHandleCreate -- - * - * Allocate a handle that contains enough information to determine - * if an arbitrary malloc'd block has been deleted. This is - * used to avoid the more time-expensive algorithm of Tcl_Preserve(). - * - * Results: - * The return value is a TclHandle that refers to the given malloc'd - * block. Doubly dereferencing the returned handle will give - * back the pointer to the block, or will give NULL if the block has - * been deleted. - * - * Side effects: - * The caller must keep track of this handle (generally by storing - * it in a field in the malloc'd block) and call TclHandleFree() - * on this handle when the block is deleted. Everything else that - * wishes to keep track of whether the malloc'd block has been deleted - * should use calls to TclHandlePreserve() and TclHandleRelease() - * on the associated handle. - * - *--------------------------------------------------------------------------- - */ - -TclHandle -TclHandleCreate(ptr) - VOID *ptr; /* Pointer to an arbitrary block of memory - * to be tracked for deletion. Must not be - * NULL. */ -{ - HandleStruct *handlePtr; - - handlePtr = (HandleStruct *) ckalloc(sizeof(HandleStruct)); - handlePtr->ptr = ptr; -#ifdef TCL_MEM_DEBUG - handlePtr->ptr2 = ptr; -#endif - handlePtr->refCount = 0; - return (TclHandle) handlePtr; -} - -/* - *--------------------------------------------------------------------------- - * - * TclHandleFree -- - * - * Called when the arbitrary malloc'd block associated with the - * handle is being deleted. Modifies the handle so that doubly - * dereferencing it will give NULL. This informs any user of the - * handle that the block of memory formerly referenced by the - * handle has been freed. - * - * Results: - * None. - * - * Side effects: - * If nothing is referring to the handle, the handle will be reclaimed. - * - *--------------------------------------------------------------------------- - */ - -void -TclHandleFree(handle) - TclHandle handle; /* Previously created handle associated - * with a malloc'd block that is being - * deleted. The handle is modified so that - * doubly dereferencing it will give NULL. */ -{ - HandleStruct *handlePtr; - - handlePtr = (HandleStruct *) handle; -#ifdef TCL_MEM_DEBUG - if (handlePtr->refCount == 0x61616161) { - panic("using previously disposed TclHandle %x", handlePtr); - } - if (handlePtr->ptr2 != handlePtr->ptr) { - panic("someone has changed the block referenced by the handle %x\nfrom %x to %x", - handlePtr, handlePtr->ptr2, handlePtr->ptr); - } -#endif - handlePtr->ptr = NULL; - if (handlePtr->refCount == 0) { - ckfree((char *) handlePtr); - } -} - -/* - *--------------------------------------------------------------------------- - * - * TclHandlePreserve -- - * - * Declare an interest in the arbitrary malloc'd block associated - * with the handle. - * - * Results: - * The return value is the handle argument, with its ref count - * incremented. - * - * Side effects: - * For each call to TclHandlePreserve(), there should be a matching - * call to TclHandleRelease() when the caller is no longer interested - * in the malloc'd block associated with the handle. - * - *--------------------------------------------------------------------------- - */ - -TclHandle -TclHandlePreserve(handle) - TclHandle handle; /* Declare an interest in the block of - * memory referenced by this handle. */ -{ - HandleStruct *handlePtr; - - handlePtr = (HandleStruct *) handle; -#ifdef TCL_MEM_DEBUG - if (handlePtr->refCount == 0x61616161) { - panic("using previously disposed TclHandle %x", handlePtr); - } - if ((handlePtr->ptr != NULL) - && (handlePtr->ptr != handlePtr->ptr2)) { - panic("someone has changed the block referenced by the handle %x\nfrom %x to %x", - handlePtr, handlePtr->ptr2, handlePtr->ptr); - } -#endif - handlePtr->refCount++; - - return handle; -} - -/* - *--------------------------------------------------------------------------- - * - * TclHandleRelease -- - * - * This procedure is called to release an interest in the malloc'd - * block associated with the handle. - * - * Results: - * None. - * - * Side effects: - * The ref count of the handle is decremented. If the malloc'd block - * has been freed and if no one is using the handle any more, the - * handle will be reclaimed. - * - *--------------------------------------------------------------------------- - */ - -void -TclHandleRelease(handle) - TclHandle handle; /* Unregister interest in the block of - * memory referenced by this handle. */ -{ - HandleStruct *handlePtr; - - handlePtr = (HandleStruct *) handle; -#ifdef TCL_MEM_DEBUG - if (handlePtr->refCount == 0x61616161) { - panic("using previously disposed TclHandle %x", handlePtr); - } - if ((handlePtr->ptr != NULL) - && (handlePtr->ptr != handlePtr->ptr2)) { - panic("someone has changed the block referenced by the handle %x\nfrom %x to %x", - handlePtr, handlePtr->ptr2, handlePtr->ptr); - } -#endif - handlePtr->refCount--; - if ((handlePtr->refCount == 0) && (handlePtr->ptr == NULL)) { - ckfree((char *) handlePtr); - } -} - diff --git a/generic/tclProc.c b/generic/tclProc.c deleted file mode 100644 index 3609d16..0000000 --- a/generic/tclProc.c +++ /dev/null @@ -1,1557 +0,0 @@ -/* - * tclProc.c -- - * - * This file contains routines that implement Tcl procedures, - * including the "proc" and "uplevel" commands. - * - * Copyright (c) 1987-1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclProc.c,v 1.19 1999/04/16 00:46:52 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclCompile.h" - -/* - * Prototypes for static functions in this file - */ - -static void ProcBodyDup _ANSI_ARGS_((Tcl_Obj *srcPtr, Tcl_Obj *dupPtr)); -static void ProcBodyFree _ANSI_ARGS_((Tcl_Obj *objPtr)); -static int ProcBodySetFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static void ProcBodyUpdateString _ANSI_ARGS_((Tcl_Obj *objPtr)); -static int ProcessProcResultCode _ANSI_ARGS_((Tcl_Interp *interp, - char *procName, int nameLen, int returnCode)); - -/* - * The ProcBodyObjType type - */ - -Tcl_ObjType tclProcBodyType = { - "procbody", /* name for this type */ - ProcBodyFree, /* FreeInternalRep procedure */ - ProcBodyDup, /* DupInternalRep procedure */ - ProcBodyUpdateString, /* UpdateString procedure */ - ProcBodySetFromAny /* SetFromAny procedure */ -}; - -/* - *---------------------------------------------------------------------- - * - * Tcl_ProcObjCmd -- - * - * This object-based procedure is invoked to process the "proc" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * A new procedure gets created. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ProcObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Interp *iPtr = (Interp *) interp; - Proc *procPtr; - char *fullName, *procName; - Namespace *nsPtr, *altNsPtr, *cxtNsPtr; - Tcl_Command cmd; - Tcl_DString ds; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 1, objv, "name args body"); - return TCL_ERROR; - } - - /* - * Determine the namespace where the procedure should reside. Unless - * the command name includes namespace qualifiers, this will be the - * current namespace. - */ - - fullName = TclGetString(objv[1]); - TclGetNamespaceForQualName(interp, fullName, (Namespace *) NULL, - 0, &nsPtr, &altNsPtr, &cxtNsPtr, &procName); - - if (nsPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't create procedure \"", fullName, - "\": unknown namespace", (char *) NULL); - return TCL_ERROR; - } - if (procName == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't create procedure \"", fullName, - "\": bad procedure name", (char *) NULL); - return TCL_ERROR; - } - if ((nsPtr != iPtr->globalNsPtr) - && (procName != NULL) && (procName[0] == ':')) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "can't create procedure \"", procName, - "\" in non-global namespace with name starting with \":\"", - (char *) NULL); - return TCL_ERROR; - } - - /* - * Create the data structure to represent the procedure. - */ - if (TclCreateProc(interp, nsPtr, procName, objv[2], objv[3], - &procPtr) != TCL_OK) { - return TCL_ERROR; - } - - /* - * Now create a command for the procedure. This will initially be in - * the current namespace unless the procedure's name included namespace - * qualifiers. To create the new command in the right namespace, we - * generate a fully qualified name for it. - */ - - Tcl_DStringInit(&ds); - if (nsPtr != iPtr->globalNsPtr) { - Tcl_DStringAppend(&ds, nsPtr->fullName, -1); - Tcl_DStringAppend(&ds, "::", 2); - } - Tcl_DStringAppend(&ds, procName, -1); - - Tcl_CreateCommand(interp, Tcl_DStringValue(&ds), TclProcInterpProc, - (ClientData) procPtr, TclProcDeleteProc); - cmd = Tcl_CreateObjCommand(interp, Tcl_DStringValue(&ds), - TclObjInterpProc, (ClientData) procPtr, TclProcDeleteProc); - - /* - * Now initialize the new procedure's cmdPtr field. This will be used - * later when the procedure is called to determine what namespace the - * procedure will run in. This will be different than the current - * namespace if the proc was renamed into a different namespace. - */ - - procPtr->cmdPtr = (Command *) cmd; - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclCreateProc -- - * - * Creates the data associated with a Tcl procedure definition. - * This procedure knows how to handle two types of body objects: - * strings and procbody. Strings are the traditional (and common) value - * for bodies, procbody are values created by extensions that have - * loaded a previously compiled script. - * - * Results: - * Returns TCL_OK on success, along with a pointer to a Tcl - * procedure definition in procPtrPtr. This definition should - * be freed by calling TclCleanupProc() when it is no longer - * needed. Returns TCL_ERROR if anything goes wrong. - * - * Side effects: - * If anything goes wrong, this procedure returns an error - * message in the interpreter. - * - *---------------------------------------------------------------------- - */ -int -TclCreateProc(interp, nsPtr, procName, argsPtr, bodyPtr, procPtrPtr) - Tcl_Interp *interp; /* interpreter containing proc */ - Namespace *nsPtr; /* namespace containing this proc */ - char *procName; /* unqualified name of this proc */ - Tcl_Obj *argsPtr; /* description of arguments */ - Tcl_Obj *bodyPtr; /* command body */ - Proc **procPtrPtr; /* returns: pointer to proc data */ -{ - Interp *iPtr = (Interp*)interp; - char **argArray = NULL; - - register Proc *procPtr; - int i, length, result, numArgs; - char *args, *bytes, *p; - register CompiledLocal *localPtr = NULL; - Tcl_Obj *defPtr; - int precompiled = 0; - - if (bodyPtr->typePtr == &tclProcBodyType) { - /* - * Because the body is a TclProProcBody, the actual body is already - * compiled, and it is not shared with anyone else, so it's OK not to - * unshare it (as a matter of fact, it is bad to unshare it, because - * there may be no source code). - * - * We don't create and initialize a Proc structure for the procedure; - * rather, we use what is in the body object. Note that - * we initialize its cmdPtr field below after we've created the command - * for the procedure. We increment the ref count of the Proc struct - * since the command (soon to be created) will be holding a reference - * to it. - */ - - procPtr = (Proc *) bodyPtr->internalRep.otherValuePtr; - procPtr->iPtr = iPtr; - procPtr->refCount++; - precompiled = 1; - } else { - /* - * If the procedure's body object is shared because its string value is - * identical to, e.g., the body of another procedure, we must create a - * private copy for this procedure to use. Such sharing of procedure - * bodies is rare but can cause problems. A procedure body is compiled - * in a context that includes the number of compiler-allocated "slots" - * for local variables. Each formal parameter is given a local variable - * slot (the "procPtr->numCompiledLocals = numArgs" assignment - * below). This means that the same code can not be shared by two - * procedures that have a different number of arguments, even if their - * bodies are identical. Note that we don't use Tcl_DuplicateObj since - * we would not want any bytecode internal representation. - */ - - if (Tcl_IsShared(bodyPtr)) { - bytes = Tcl_GetStringFromObj(bodyPtr, &length); - bodyPtr = Tcl_NewStringObj(bytes, length); - } - - /* - * Create and initialize a Proc structure for the procedure. Note that - * we initialize its cmdPtr field below after we've created the command - * for the procedure. We increment the ref count of the procedure's - * body object since there will be a reference to it in the Proc - * structure. - */ - - Tcl_IncrRefCount(bodyPtr); - - procPtr = (Proc *) ckalloc(sizeof(Proc)); - procPtr->iPtr = iPtr; - procPtr->refCount = 1; - procPtr->bodyPtr = bodyPtr; - procPtr->numArgs = 0; /* actual argument count is set below. */ - procPtr->numCompiledLocals = 0; - procPtr->firstLocalPtr = NULL; - procPtr->lastLocalPtr = NULL; - } - - /* - * Break up the argument list into argument specifiers, then process - * each argument specifier. - * If the body is precompiled, processing is limited to checking that - * the the parsed argument is consistent with the one stored in the - * Proc. - * THIS FAILS IF THE ARG LIST OBJECT'S STRING REP CONTAINS NULLS. - */ - - args = Tcl_GetStringFromObj(argsPtr, &length); - result = Tcl_SplitList(interp, args, &numArgs, &argArray); - if (result != TCL_OK) { - goto procError; - } - - if (precompiled) { - if (numArgs > procPtr->numArgs) { - char buf[128]; - sprintf(buf, "\": arg list contains %d entries, precompiled header expects %d", - numArgs, procPtr->numArgs); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "procedure \"", procName, - buf, (char *) NULL); - goto procError; - } - localPtr = procPtr->firstLocalPtr; - } else { - procPtr->numArgs = numArgs; - procPtr->numCompiledLocals = numArgs; - } - for (i = 0; i < numArgs; i++) { - int fieldCount, nameLength, valueLength; - char **fieldValues; - - /* - * Now divide the specifier up into name and default. - */ - - result = Tcl_SplitList(interp, argArray[i], &fieldCount, - &fieldValues); - if (result != TCL_OK) { - goto procError; - } - if (fieldCount > 2) { - ckfree((char *) fieldValues); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "too many fields in argument specifier \"", - argArray[i], "\"", (char *) NULL); - goto procError; - } - if ((fieldCount == 0) || (*fieldValues[0] == 0)) { - ckfree((char *) fieldValues); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "procedure \"", procName, - "\" has argument with no name", (char *) NULL); - goto procError; - } - - nameLength = strlen(fieldValues[0]); - if (fieldCount == 2) { - valueLength = strlen(fieldValues[1]); - } else { - valueLength = 0; - } - - /* - * Check that the formal parameter name is a scalar. - */ - - p = fieldValues[0]; - while (*p != '\0') { - if (*p == '(') { - char *q = p; - do { - q++; - } while (*q != '\0'); - q--; - if (*q == ')') { /* we have an array element */ - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "procedure \"", procName, - "\" has formal parameter \"", fieldValues[0], - "\" that is an array element", - (char *) NULL); - ckfree((char *) fieldValues); - goto procError; - } - } - p++; - } - - if (precompiled) { - /* - * compare the parsed argument with the stored one - */ - - if ((localPtr->nameLength != nameLength) - || (strcmp(localPtr->name, fieldValues[0])) - || (localPtr->frameIndex != i) - || (localPtr->flags != (VAR_SCALAR | VAR_ARGUMENT)) - || ((localPtr->defValuePtr == NULL) - && (fieldCount == 2)) - || ((localPtr->defValuePtr != NULL) - && (fieldCount != 2))) { - char buf[128]; - sprintf(buf, "\": formal parameter %d is inconsistent with precompiled body", - i); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "procedure \"", procName, - buf, (char *) NULL); - ckfree((char *) fieldValues); - goto procError; - } - - /* - * compare the default value if any - */ - - if (localPtr->defValuePtr != NULL) { - int tmpLength; - char *tmpPtr = Tcl_GetStringFromObj(localPtr->defValuePtr, - &tmpLength); - if ((valueLength != tmpLength) - || (strncmp(fieldValues[1], tmpPtr, - (size_t) tmpLength))) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "procedure \"", procName, - "\": formal parameter \"", - fieldValues[0], - "\" has default value inconsistent with precompiled body", - (char *) NULL); - ckfree((char *) fieldValues); - goto procError; - } - } - - localPtr = localPtr->nextPtr; - } else { - /* - * Allocate an entry in the runtime procedure frame's array of - * local variables for the argument. - */ - - localPtr = (CompiledLocal *) ckalloc((unsigned) - (sizeof(CompiledLocal) - sizeof(localPtr->name) - + nameLength+1)); - if (procPtr->firstLocalPtr == NULL) { - procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr; - } else { - procPtr->lastLocalPtr->nextPtr = localPtr; - procPtr->lastLocalPtr = localPtr; - } - localPtr->nextPtr = NULL; - localPtr->nameLength = nameLength; - localPtr->frameIndex = i; - localPtr->flags = VAR_SCALAR | VAR_ARGUMENT; - localPtr->resolveInfo = NULL; - - if (fieldCount == 2) { - localPtr->defValuePtr = - Tcl_NewStringObj(fieldValues[1], valueLength); - Tcl_IncrRefCount(localPtr->defValuePtr); - } else { - localPtr->defValuePtr = NULL; - } - strcpy(localPtr->name, fieldValues[0]); - } - - ckfree((char *) fieldValues); - } - - /* - * Now initialize the new procedure's cmdPtr field. This will be used - * later when the procedure is called to determine what namespace the - * procedure will run in. This will be different than the current - * namespace if the proc was renamed into a different namespace. - */ - - *procPtrPtr = procPtr; - ckfree((char *) argArray); - return TCL_OK; - -procError: - if (precompiled) { - procPtr->refCount--; - } else { - Tcl_DecrRefCount(bodyPtr); - while (procPtr->firstLocalPtr != NULL) { - localPtr = procPtr->firstLocalPtr; - procPtr->firstLocalPtr = localPtr->nextPtr; - - defPtr = localPtr->defValuePtr; - if (defPtr != NULL) { - Tcl_DecrRefCount(defPtr); - } - - ckfree((char *) localPtr); - } - ckfree((char *) procPtr); - } - if (argArray != NULL) { - ckfree((char *) argArray); - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * TclGetFrame -- - * - * Given a description of a procedure frame, such as the first - * argument to an "uplevel" or "upvar" command, locate the - * call frame for the appropriate level of procedure. - * - * Results: - * The return value is -1 if an error occurred in finding the frame - * (in this case an error message is left in the interp's result). - * 1 is returned if string was either a number or a number preceded - * by "#" and it specified a valid frame. 0 is returned if string - * isn't one of the two things above (in this case, the lookup - * acts as if string were "1"). The variable pointed to by - * framePtrPtr is filled in with the address of the desired frame - * (unless an error occurs, in which case it isn't modified). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclGetFrame(interp, string, framePtrPtr) - Tcl_Interp *interp; /* Interpreter in which to find frame. */ - char *string; /* String describing frame. */ - CallFrame **framePtrPtr; /* Store pointer to frame here (or NULL - * if global frame indicated). */ -{ - register Interp *iPtr = (Interp *) interp; - int curLevel, level, result; - CallFrame *framePtr; - - /* - * Parse string to figure out which level number to go to. - */ - - result = 1; - curLevel = (iPtr->varFramePtr == NULL) ? 0 : iPtr->varFramePtr->level; - if (*string == '#') { - if (Tcl_GetInt(interp, string+1, &level) != TCL_OK) { - return -1; - } - if (level < 0) { - levelError: - Tcl_AppendResult(interp, "bad level \"", string, "\"", - (char *) NULL); - return -1; - } - } else if (isdigit(UCHAR(*string))) { /* INTL: digit */ - if (Tcl_GetInt(interp, string, &level) != TCL_OK) { - return -1; - } - level = curLevel - level; - } else { - level = curLevel - 1; - result = 0; - } - - /* - * Figure out which frame to use, and modify the interpreter so - * its variables come from that frame. - */ - - if (level == 0) { - framePtr = NULL; - } else { - for (framePtr = iPtr->varFramePtr; framePtr != NULL; - framePtr = framePtr->callerVarPtr) { - if (framePtr->level == level) { - break; - } - } - if (framePtr == NULL) { - goto levelError; - } - } - *framePtrPtr = framePtr; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UplevelObjCmd -- - * - * This object procedure is invoked to process the "uplevel" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_UplevelObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Interp *iPtr = (Interp *) interp; - char *optLevel; - int result; - CallFrame *savedVarFramePtr, *framePtr; - - if (objc < 2) { - uplevelSyntax: - Tcl_WrongNumArgs(interp, 1, objv, "?level? command ?arg ...?"); - return TCL_ERROR; - } - - /* - * Find the level to use for executing the command. - */ - - optLevel = TclGetString(objv[1]); - result = TclGetFrame(interp, optLevel, &framePtr); - if (result == -1) { - return TCL_ERROR; - } - objc -= (result+1); - if (objc == 0) { - goto uplevelSyntax; - } - objv += (result+1); - - /* - * Modify the interpreter state to execute in the given frame. - */ - - savedVarFramePtr = iPtr->varFramePtr; - iPtr->varFramePtr = framePtr; - - /* - * Execute the residual arguments as a command. - */ - - if (objc == 1) { - result = Tcl_EvalObjEx(interp, objv[0], 0); - } else { - Tcl_Obj *objPtr; - - objPtr = Tcl_ConcatObj(objc, objv); - result = Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_DIRECT); - } - if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - sprintf(msg, "\n (\"uplevel\" body line %d)", interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); - } - - /* - * Restore the variable frame, and return. - */ - - iPtr->varFramePtr = savedVarFramePtr; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclFindProc -- - * - * Given the name of a procedure, return a pointer to the - * record describing the procedure. The procedure will be - * looked up using the usual rules: first in the current - * namespace and then in the global namespace. - * - * Results: - * NULL is returned if the name doesn't correspond to any - * procedure. Otherwise, the return value is a pointer to - * the procedure's record. If the name is found but refers - * to an imported command that points to a "real" procedure - * defined in another namespace, a pointer to that "real" - * procedure's structure is returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Proc * -TclFindProc(iPtr, procName) - Interp *iPtr; /* Interpreter in which to look. */ - char *procName; /* Name of desired procedure. */ -{ - Tcl_Command cmd; - Tcl_Command origCmd; - Command *cmdPtr; - - cmd = Tcl_FindCommand((Tcl_Interp *) iPtr, procName, - (Tcl_Namespace *) NULL, /*flags*/ 0); - if (cmd == (Tcl_Command) NULL) { - return NULL; - } - cmdPtr = (Command *) cmd; - - origCmd = TclGetOriginalCommand(cmd); - if (origCmd != NULL) { - cmdPtr = (Command *) origCmd; - } - if (cmdPtr->proc != TclProcInterpProc) { - return NULL; - } - return (Proc *) cmdPtr->clientData; -} - -/* - *---------------------------------------------------------------------- - * - * TclIsProc -- - * - * Tells whether a command is a Tcl procedure or not. - * - * Results: - * If the given command is actually a Tcl procedure, the - * return value is the address of the record describing - * the procedure. Otherwise the return value is 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Proc * -TclIsProc(cmdPtr) - Command *cmdPtr; /* Command to test. */ -{ - Tcl_Command origCmd; - - origCmd = TclGetOriginalCommand((Tcl_Command) cmdPtr); - if (origCmd != NULL) { - cmdPtr = (Command *) origCmd; - } - if (cmdPtr->proc == TclProcInterpProc) { - return (Proc *) cmdPtr->clientData; - } - return (Proc *) 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclProcInterpProc -- - * - * When a Tcl procedure gets invoked with an argc/argv array of - * strings, this routine gets invoked to interpret the procedure. - * - * Results: - * A standard Tcl result value, usually TCL_OK. - * - * Side effects: - * Depends on the commands in the procedure. - * - *---------------------------------------------------------------------- - */ - -int -TclProcInterpProc(clientData, interp, argc, argv) - ClientData clientData; /* Record describing procedure to be - * interpreted. */ - Tcl_Interp *interp; /* Interpreter in which procedure was - * invoked. */ - int argc; /* Count of number of arguments to this - * procedure. */ - register char **argv; /* Argument values. */ -{ - register Tcl_Obj *objPtr; - register int i; - int result; - - /* - * This procedure generates an objv array for object arguments that hold - * the argv strings. It starts out with stack-allocated space but uses - * dynamically-allocated storage if needed. - */ - -#define NUM_ARGS 20 - Tcl_Obj *(objStorage[NUM_ARGS]); - register Tcl_Obj **objv = objStorage; - - /* - * Create the object argument array "objv". Make sure objv is large - * enough to hold the objc arguments plus 1 extra for the zero - * end-of-objv word. - */ - - if ((argc + 1) > NUM_ARGS) { - objv = (Tcl_Obj **) - ckalloc((unsigned)(argc + 1) * sizeof(Tcl_Obj *)); - } - - for (i = 0; i < argc; i++) { - objv[i] = Tcl_NewStringObj(argv[i], -1); - Tcl_IncrRefCount(objv[i]); - } - objv[argc] = 0; - - /* - * Use TclObjInterpProc to actually interpret the procedure. - */ - - result = TclObjInterpProc(clientData, interp, argc, objv); - - /* - * Move the interpreter's object result to the string result, - * then reset the object result. - */ - - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - - /* - * Decrement the ref counts on the objv elements since we are done - * with them. - */ - - for (i = 0; i < argc; i++) { - objPtr = objv[i]; - TclDecrRefCount(objPtr); - } - - /* - * Free the objv array if malloc'ed storage was used. - */ - - if (objv != objStorage) { - ckfree((char *) objv); - } - return result; -#undef NUM_ARGS -} - -/* - *---------------------------------------------------------------------- - * - * TclObjInterpProc -- - * - * When a Tcl procedure gets invoked during bytecode evaluation, this - * object-based routine gets invoked to interpret the procedure. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * Depends on the commands in the procedure. - * - *---------------------------------------------------------------------- - */ - -int -TclObjInterpProc(clientData, interp, objc, objv) - ClientData clientData; /* Record describing procedure to be - * interpreted. */ - register Tcl_Interp *interp; /* Interpreter in which procedure was - * invoked. */ - int objc; /* Count of number of arguments to this - * procedure. */ - Tcl_Obj *CONST objv[]; /* Argument value objects. */ -{ - Interp *iPtr = (Interp *) interp; - register Proc *procPtr = (Proc *) clientData; - Namespace *nsPtr = procPtr->cmdPtr->nsPtr; - CallFrame frame; - register CallFrame *framePtr = &frame; - register Var *varPtr; - register CompiledLocal *localPtr; - char *procName; - int nameLen, localCt, numArgs, argCt, i, result; - - /* - * This procedure generates an array "compiledLocals" that holds the - * storage for local variables. It starts out with stack-allocated space - * but uses dynamically-allocated storage if needed. - */ - -#define NUM_LOCALS 20 - Var localStorage[NUM_LOCALS]; - Var *compiledLocals = localStorage; - - /* - * Get the procedure's name. - */ - - procName = Tcl_GetStringFromObj(objv[0], &nameLen); - - /* - * If necessary, compile the procedure's body. The compiler will - * allocate frame slots for the procedure's non-argument local - * variables. Note that compiling the body might increase - * procPtr->numCompiledLocals if new local variables are found - * while compiling. - */ - - result = TclProcCompileProc(interp, procPtr, procPtr->bodyPtr, nsPtr, - "body of proc", procName); - - if (result != TCL_OK) { - return result; - } - - /* - * Create the "compiledLocals" array. Make sure it is large enough to - * hold all the procedure's compiled local variables, including its - * formal parameters. - */ - - localCt = procPtr->numCompiledLocals; - if (localCt > NUM_LOCALS) { - compiledLocals = (Var *) ckalloc((unsigned) localCt * sizeof(Var)); - } - - /* - * Set up and push a new call frame for the new procedure invocation. - * This call frame will execute in the proc's namespace, which might - * be different than the current namespace. The proc's namespace is - * that of its command, which can change if the command is renamed - * from one namespace to another. - */ - - result = Tcl_PushCallFrame(interp, (Tcl_CallFrame *) framePtr, - (Tcl_Namespace *) nsPtr, /*isProcCallFrame*/ 1); - - if (result != TCL_OK) { - return result; - } - - framePtr->objc = objc; - framePtr->objv = objv; /* ref counts for args are incremented below */ - - /* - * Initialize and resolve compiled variable references. - */ - - framePtr->procPtr = procPtr; - framePtr->numCompiledLocals = localCt; - framePtr->compiledLocals = compiledLocals; - - TclInitCompiledLocals(interp, framePtr, nsPtr); - - /* - * Match and assign the call's actual parameters to the procedure's - * formal arguments. The formal arguments are described by the first - * numArgs entries in both the Proc structure's local variable list and - * the call frame's local variable array. - */ - - numArgs = procPtr->numArgs; - varPtr = framePtr->compiledLocals; - localPtr = procPtr->firstLocalPtr; - argCt = objc; - for (i = 1, argCt -= 1; i <= numArgs; i++, argCt--) { - if (!TclIsVarArgument(localPtr)) { - panic("TclObjInterpProc: local variable %s is not argument but should be", - localPtr->name); - return TCL_ERROR; - } - if (TclIsVarTemporary(localPtr)) { - panic("TclObjInterpProc: local variable %d is temporary but should be an argument", i); - return TCL_ERROR; - } - - /* - * Handle the special case of the last formal being "args". When - * it occurs, assign it a list consisting of all the remaining - * actual arguments. - */ - - if ((i == numArgs) && ((localPtr->name[0] == 'a') - && (strcmp(localPtr->name, "args") == 0))) { - Tcl_Obj *listPtr = Tcl_NewListObj(argCt, &(objv[i])); - varPtr->value.objPtr = listPtr; - Tcl_IncrRefCount(listPtr); /* local var is a reference */ - varPtr->flags &= ~VAR_UNDEFINED; - argCt = 0; - break; /* done processing args */ - } else if (argCt > 0) { - Tcl_Obj *objPtr = objv[i]; - varPtr->value.objPtr = objPtr; - varPtr->flags &= ~VAR_UNDEFINED; - Tcl_IncrRefCount(objPtr); /* since the local variable now has - * another reference to object. */ - } else if (localPtr->defValuePtr != NULL) { - Tcl_Obj *objPtr = localPtr->defValuePtr; - varPtr->value.objPtr = objPtr; - varPtr->flags &= ~VAR_UNDEFINED; - Tcl_IncrRefCount(objPtr); /* since the local variable now has - * another reference to object. */ - } else { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "no value given for parameter \"", localPtr->name, - "\" to \"", Tcl_GetString(objv[0]), "\"", (char *) NULL); - result = TCL_ERROR; - goto procDone; - } - varPtr++; - localPtr = localPtr->nextPtr; - } - if (argCt > 0) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "called \"", Tcl_GetString(objv[0]), - "\" with too many arguments", (char *) NULL); - result = TCL_ERROR; - goto procDone; - } - - /* - * Invoke the commands in the procedure's body. - */ - - if (tclTraceExec >= 1) { -#ifdef TCL_COMPILE_DEBUG - fprintf(stdout, "Calling proc "); - for (i = 0; i < objc; i++) { - TclPrintObject(stdout, objv[i], 15); - fprintf(stdout, " "); - } - fprintf(stdout, "\n"); -#else /* TCL_COMPILE_DEBUG */ - fprintf(stdout, "Calling proc %.*s\n", nameLen, procName); -#endif /*TCL_COMPILE_DEBUG*/ - fflush(stdout); - } - - iPtr->returnCode = TCL_OK; - procPtr->refCount++; - result = Tcl_EvalObjEx(interp, procPtr->bodyPtr, 0); - procPtr->refCount--; - if (procPtr->refCount <= 0) { - TclProcCleanupProc(procPtr); - } - - if (result != TCL_OK) { - result = ProcessProcResultCode(interp, procName, nameLen, result); - } - - /* - * Pop and free the call frame for this procedure invocation, then - * free the compiledLocals array if malloc'ed storage was used. - */ - - procDone: - Tcl_PopCallFrame(interp); - if (compiledLocals != localStorage) { - ckfree((char *) compiledLocals); - } - return result; -#undef NUM_LOCALS -} - -/* - *---------------------------------------------------------------------- - * - * TclProcCompileProc -- - * - * Called just before a procedure is executed to compile the - * body to byte codes. If the type of the body is not - * "byte code" or if the compile conditions have changed - * (namespace context, epoch counters, etc.) then the body - * is recompiled. Otherwise, this procedure does nothing. - * - * Results: - * None. - * - * Side effects: - * May change the internal representation of the body object - * to compiled code. - * - *---------------------------------------------------------------------- - */ - -int -TclProcCompileProc(interp, procPtr, bodyPtr, nsPtr, description, procName) - Tcl_Interp *interp; /* Interpreter containing procedure. */ - Proc *procPtr; /* Data associated with procedure. */ - Tcl_Obj *bodyPtr; /* Body of proc. (Usually procPtr->bodyPtr, - * but could be any code fragment compiled - * in the context of this procedure.) */ - Namespace *nsPtr; /* Namespace containing procedure. */ - CONST char *description; /* string describing this body of code. */ - CONST char *procName; /* Name of this procedure. */ -{ - Interp *iPtr = (Interp*)interp; - int result; - Tcl_CallFrame frame; - Proc *saveProcPtr; - ByteCode *codePtr = (ByteCode *) bodyPtr->internalRep.otherValuePtr; - - /* - * If necessary, compile the procedure's body. The compiler will - * allocate frame slots for the procedure's non-argument local - * variables. If the ByteCode already exists, make sure it hasn't been - * invalidated by someone redefining a core command (this might make the - * compiled code wrong). Also, if the code was compiled in/for a - * different interpreter, we recompile it. Note that compiling the body - * might increase procPtr->numCompiledLocals if new local variables are - * found while compiling. - * - * Precompiled procedure bodies, however, are immutable and therefore - * they are not recompiled, even if things have changed. - */ - - if (bodyPtr->typePtr == &tclByteCodeType) { - if (((Interp *) *codePtr->interpHandle != iPtr) - || (codePtr->compileEpoch != iPtr->compileEpoch) - || (codePtr->nsPtr != nsPtr)) { - if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) { - if ((Interp *) *codePtr->interpHandle != iPtr) { - Tcl_AppendResult(interp, - "a precompiled script jumped interps", NULL); - return TCL_ERROR; - } - codePtr->compileEpoch = iPtr->compileEpoch; - codePtr->nsPtr = nsPtr; - } else { - (*tclByteCodeType.freeIntRepProc)(bodyPtr); - bodyPtr->typePtr = (Tcl_ObjType *) NULL; - } - } - } - if (bodyPtr->typePtr != &tclByteCodeType) { - char buf[100]; - int numChars; - char *ellipsis; - - if (tclTraceCompile >= 1) { - /* - * Display a line summarizing the top level command we - * are about to compile. - */ - - numChars = strlen(procName); - ellipsis = ""; - if (numChars > 50) { - numChars = 50; - ellipsis = "..."; - } - fprintf(stdout, "Compiling %s \"%.*s%s\"\n", - description, numChars, procName, ellipsis); - } - - /* - * Plug the current procPtr into the interpreter and coerce - * the code body to byte codes. The interpreter needs to - * know which proc it's compiling so that it can access its - * list of compiled locals. - * - * TRICKY NOTE: Be careful to push a call frame with the - * proper namespace context, so that the byte codes are - * compiled in the appropriate class context. - */ - - saveProcPtr = iPtr->compiledProcPtr; - iPtr->compiledProcPtr = procPtr; - - result = Tcl_PushCallFrame(interp, &frame, - (Tcl_Namespace*)nsPtr, /* isProcCallFrame */ 0); - - if (result == TCL_OK) { - result = tclByteCodeType.setFromAnyProc(interp, bodyPtr); - Tcl_PopCallFrame(interp); - } - - iPtr->compiledProcPtr = saveProcPtr; - - if (result != TCL_OK) { - if (result == TCL_ERROR) { - numChars = strlen(procName); - ellipsis = ""; - if (numChars > 50) { - numChars = 50; - ellipsis = "..."; - } - sprintf(buf, "\n (compiling %s \"%.*s%s\", line %d)", - description, numChars, procName, ellipsis, - interp->errorLine); - Tcl_AddObjErrorInfo(interp, buf, -1); - } - return result; - } - } else if (codePtr->nsEpoch != nsPtr->resolverEpoch) { - register CompiledLocal *localPtr; - - /* - * The resolver epoch has changed, but we only need to invalidate - * the resolver cache. - */ - - for (localPtr = procPtr->firstLocalPtr; localPtr != NULL; - localPtr = localPtr->nextPtr) { - localPtr->flags &= ~(VAR_RESOLVED); - if (localPtr->resolveInfo) { - if (localPtr->resolveInfo->deleteProc) { - localPtr->resolveInfo->deleteProc(localPtr->resolveInfo); - } else { - ckfree((char*)localPtr->resolveInfo); - } - localPtr->resolveInfo = NULL; - } - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ProcessProcResultCode -- - * - * Procedure called by TclObjInterpProc to process a return code other - * than TCL_OK returned by a Tcl procedure. - * - * Results: - * Depending on the argument return code, the result returned is - * another return code and the interpreter's result is set to a value - * to supplement that return code. - * - * Side effects: - * If the result returned is TCL_ERROR, traceback information about - * the procedure just executed is appended to the interpreter's - * "errorInfo" variable. - * - *---------------------------------------------------------------------- - */ - -static int -ProcessProcResultCode(interp, procName, nameLen, returnCode) - Tcl_Interp *interp; /* The interpreter in which the procedure - * was called and returned returnCode. */ - char *procName; /* Name of the procedure. Used for error - * messages and trace information. */ - int nameLen; /* Number of bytes in procedure's name. */ - int returnCode; /* The unexpected result code. */ -{ - Interp *iPtr = (Interp *) interp; - char msg[100 + TCL_INTEGER_SPACE]; - - if (returnCode == TCL_RETURN) { - returnCode = TclUpdateReturnInfo(iPtr); - } else if (returnCode == TCL_ERROR) { - sprintf(msg, "\n (procedure \"%.*s\" line %d)", - nameLen, procName, iPtr->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); - } else if (returnCode == TCL_BREAK) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "invoked \"break\" outside of a loop", -1); - returnCode = TCL_ERROR; - } else if (returnCode == TCL_CONTINUE) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "invoked \"continue\" outside of a loop", -1); - returnCode = TCL_ERROR; - } - return returnCode; -} - -/* - *---------------------------------------------------------------------- - * - * TclProcDeleteProc -- - * - * This procedure is invoked just before a command procedure is - * removed from an interpreter. Its job is to release all the - * resources allocated to the procedure. - * - * Results: - * None. - * - * Side effects: - * Memory gets freed, unless the procedure is actively being - * executed. In this case the cleanup is delayed until the - * last call to the current procedure completes. - * - *---------------------------------------------------------------------- - */ - -void -TclProcDeleteProc(clientData) - ClientData clientData; /* Procedure to be deleted. */ -{ - Proc *procPtr = (Proc *) clientData; - - procPtr->refCount--; - if (procPtr->refCount <= 0) { - TclProcCleanupProc(procPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclProcCleanupProc -- - * - * This procedure does all the real work of freeing up a Proc - * structure. It's called only when the structure's reference - * count becomes zero. - * - * Results: - * None. - * - * Side effects: - * Memory gets freed. - * - *---------------------------------------------------------------------- - */ - -void -TclProcCleanupProc(procPtr) - register Proc *procPtr; /* Procedure to be deleted. */ -{ - register CompiledLocal *localPtr; - Tcl_Obj *bodyPtr = procPtr->bodyPtr; - Tcl_Obj *defPtr; - Tcl_ResolvedVarInfo *resVarInfo; - - if (bodyPtr != NULL) { - Tcl_DecrRefCount(bodyPtr); - } - for (localPtr = procPtr->firstLocalPtr; localPtr != NULL; ) { - CompiledLocal *nextPtr = localPtr->nextPtr; - - resVarInfo = localPtr->resolveInfo; - if (resVarInfo) { - if (resVarInfo->deleteProc) { - (*resVarInfo->deleteProc)(resVarInfo); - } else { - ckfree((char *) resVarInfo); - } - } - - if (localPtr->defValuePtr != NULL) { - defPtr = localPtr->defValuePtr; - Tcl_DecrRefCount(defPtr); - } - ckfree((char *) localPtr); - localPtr = nextPtr; - } - ckfree((char *) procPtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclUpdateReturnInfo -- - * - * This procedure is called when procedures return, and at other - * points where the TCL_RETURN code is used. It examines fields - * such as iPtr->returnCode and iPtr->errorCode and modifies - * the real return status accordingly. - * - * Results: - * The return value is the true completion code to use for - * the procedure, instead of TCL_RETURN. - * - * Side effects: - * The errorInfo and errorCode variables may get modified. - * - *---------------------------------------------------------------------- - */ - -int -TclUpdateReturnInfo(iPtr) - Interp *iPtr; /* Interpreter for which TCL_RETURN - * exception is being processed. */ -{ - int code; - - code = iPtr->returnCode; - iPtr->returnCode = TCL_OK; - if (code == TCL_ERROR) { - Tcl_SetVar2((Tcl_Interp *) iPtr, "errorCode", (char *) NULL, - (iPtr->errorCode != NULL) ? iPtr->errorCode : "NONE", - TCL_GLOBAL_ONLY); - iPtr->flags |= ERROR_CODE_SET; - if (iPtr->errorInfo != NULL) { - Tcl_SetVar2((Tcl_Interp *) iPtr, "errorInfo", (char *) NULL, - iPtr->errorInfo, TCL_GLOBAL_ONLY); - iPtr->flags |= ERR_IN_PROGRESS; - } - } - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TclGetInterpProc -- - * - * Returns a pointer to the TclProcInterpProc procedure; this is different - * from the value obtained from the TclProcInterpProc reference on systems - * like Windows where import and export versions of a procedure exported - * by a DLL exist. - * - * Results: - * Returns the internal address of the TclProcInterpProc procedure. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -TclCmdProcType -TclGetInterpProc() -{ - return (TclCmdProcType) TclProcInterpProc; -} - -/* - *---------------------------------------------------------------------- - * - * TclGetObjInterpProc -- - * - * Returns a pointer to the TclObjInterpProc procedure; this is different - * from the value obtained from the TclObjInterpProc reference on systems - * like Windows where import and export versions of a procedure exported - * by a DLL exist. - * - * Results: - * Returns the internal address of the TclObjInterpProc procedure. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -TclObjCmdProcType -TclGetObjInterpProc() -{ - return (TclObjCmdProcType) TclObjInterpProc; -} - -/* - *---------------------------------------------------------------------- - * - * TclNewProcBodyObj -- - * - * Creates a new object, of type "procbody", whose internal - * representation is the given Proc struct. - * The newly created object's reference count is 0. - * - * Results: - * Returns a pointer to a newly allocated Tcl_Obj, 0 on error. - * - * Side effects: - * The reference count in the ByteCode attached to the Proc is bumped up - * by one, since the internal rep stores a pointer to it. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -TclNewProcBodyObj(procPtr) - Proc *procPtr; /* the Proc struct to store as the internal - * representation. */ -{ - Tcl_Obj *objPtr; - - if (!procPtr) { - return (Tcl_Obj *) NULL; - } - - objPtr = Tcl_NewStringObj("", 0); - - if (objPtr) { - objPtr->typePtr = &tclProcBodyType; - objPtr->internalRep.otherValuePtr = (VOID *) procPtr; - - procPtr->refCount++; - } - - return objPtr; -} - -/* - *---------------------------------------------------------------------- - * - * ProcBodyDup -- - * - * Tcl_ObjType's Dup function for the proc body object. - * Bumps the reference count on the Proc stored in the internal - * representation. - * - * Results: - * None. - * - * Side effects: - * Sets up the object in dupPtr to be a duplicate of the one in srcPtr. - * - *---------------------------------------------------------------------- - */ - -static void ProcBodyDup(srcPtr, dupPtr) - Tcl_Obj *srcPtr; /* object to copy */ - Tcl_Obj *dupPtr; /* target object for the duplication */ -{ - Proc *procPtr = (Proc *) srcPtr->internalRep.otherValuePtr; - - dupPtr->typePtr = &tclProcBodyType; - dupPtr->internalRep.otherValuePtr = (VOID *) procPtr; - procPtr->refCount++; -} - -/* - *---------------------------------------------------------------------- - * - * ProcBodyFree -- - * - * Tcl_ObjType's Free function for the proc body object. - * The reference count on its Proc struct is decreased by 1; if the count - * reaches 0, the proc is freed. - * - * Results: - * None. - * - * Side effects: - * If the reference count on the Proc struct reaches 0, the struct is freed. - * - *---------------------------------------------------------------------- - */ - -static void -ProcBodyFree(objPtr) - Tcl_Obj *objPtr; /* the object to clean up */ -{ - Proc *procPtr = (Proc *) objPtr->internalRep.otherValuePtr; - procPtr->refCount--; - if (procPtr->refCount <= 0) { - TclProcCleanupProc(procPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * ProcBodySetFromAny -- - * - * Tcl_ObjType's SetFromAny function for the proc body object. - * Calls panic. - * - * Results: - * Theoretically returns a TCL result code. - * - * Side effects: - * Calls panic, since we can't set the value of the object from a string - * representation (or any other internal ones). - * - *---------------------------------------------------------------------- - */ - -static int -ProcBodySetFromAny(interp, objPtr) - Tcl_Interp *interp; /* current interpreter */ - Tcl_Obj *objPtr; /* object pointer */ -{ - panic("called ProcBodySetFromAny"); - - /* - * this to keep compilers happy. - */ - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ProcBodyUpdateString -- - * - * Tcl_ObjType's UpdateString function for the proc body object. - * Calls panic. - * - * Results: - * None. - * - * Side effects: - * Calls panic, since we this type has no string representation. - * - *---------------------------------------------------------------------- - */ - -static void -ProcBodyUpdateString(objPtr) - Tcl_Obj *objPtr; /* the object to update */ -{ - panic("called ProcBodyUpdateString"); -} diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c deleted file mode 100644 index 96d2aea..0000000 --- a/generic/tclRegexp.c +++ /dev/null @@ -1,792 +0,0 @@ -/* - * tclRegexp.c -- - * - * This file contains the public interfaces to the Tcl regular - * expression mechanism. - * - * Copyright (c) 1998 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. - * - * RCS: @(#) $Id: tclRegexp.c,v 1.2 1999/04/16 00:46:52 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclRegexp.h" - -/* - *---------------------------------------------------------------------- - * The routines in this file use Henry Spencer's regular expression - * package contained in the following additional source files: - * - * regc_color.c regc_cvec.c regc_lex.c - * regc_nfa.c regcomp.c regcustom.h - * rege_dfa.c regerror.c regerrs.h - * regex.h regexec.c regfree.c - * regfronts.c regguts.h - * - * Copyright (c) 1998 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``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 - * HENRY SPENCER 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. - * - * *** NOTE: this code has been altered slightly for use in Tcl: *** - * *** 1. Names have been changed, e.g. from re_comp to *** - * *** TclRegComp, to avoid clashes with other *** - * *** regexp implementations used by applications. *** - */ - -/* - * Declarations for functions used only in this file. - */ - -static void DupRegexpInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr, - Tcl_Obj *copyPtr)); -static void FreeRegexpInternalRep _ANSI_ARGS_((Tcl_Obj *regexpPtr)); -static int SetRegexpFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static TclRegexp * CompileRegexp _ANSI_ARGS_((Tcl_Interp *interp, - char *pattern, int length, int flags)); - -/* - * The regular expression Tcl object type. This serves as a cache - * of the compiled form of the regular expression. - */ - -Tcl_ObjType tclRegexpType = { - "regexp", /* name */ - FreeRegexpInternalRep, /* freeIntRepProc */ - DupRegexpInternalRep, /* dupIntRepProc */ - NULL, /* updateStringProc */ - SetRegexpFromAny /* setFromAnyProc */ -}; - - -/* - *---------------------------------------------------------------------- - * - * Tcl_RegExpCompile -- - * - * Compile a regular expression into a form suitable for fast - * matching. This procedure is DEPRECATED in favor of the - * object version of the command. - * - * Results: - * The return value is a pointer to the compiled form of string, - * suitable for passing to Tcl_RegExpExec. This compiled form - * is only valid up until the next call to this procedure, so - * don't keep these around for a long time! If an error occurred - * while compiling the pattern, then NULL is returned and an error - * message is left in the interp's result. - * - * Side effects: - * Updates the cache of compiled regexps. - * - *---------------------------------------------------------------------- - */ - -Tcl_RegExp -Tcl_RegExpCompile(interp, string) - Tcl_Interp *interp; /* For use in error reporting. */ - char *string; /* String for which to produce - * compiled regular expression. */ -{ - Interp *iPtr = (Interp *) interp; - int i, length; - TclRegexp *result; - - length = strlen(string); - for (i = 0; i < NUM_REGEXPS; i++) { - if ((length == iPtr->patLengths[i]) - && (strcmp(string, iPtr->patterns[i]) == 0)) { - /* - * Move the matched pattern to the first slot in the - * cache and shift the other patterns down one position. - */ - - if (i != 0) { - int j; - char *cachedString; - - cachedString = iPtr->patterns[i]; - result = iPtr->regexps[i]; - for (j = i-1; j >= 0; j--) { - iPtr->patterns[j+1] = iPtr->patterns[j]; - iPtr->patLengths[j+1] = iPtr->patLengths[j]; - iPtr->regexps[j+1] = iPtr->regexps[j]; - } - iPtr->patterns[0] = cachedString; - iPtr->patLengths[0] = length; - iPtr->regexps[0] = result; - } - return (Tcl_RegExp) iPtr->regexps[0]; - } - } - - /* - * No match in the cache. Compile the string and add it to the - * cache. - */ - - result = CompileRegexp(interp, string, length, REG_ADVANCED); - if (!result) { - return NULL; - } - - /* - * We successfully compiled the expression, so add it to the cache. - */ - - if (iPtr->patterns[NUM_REGEXPS-1] != NULL) { - ckfree(iPtr->patterns[NUM_REGEXPS-1]); - TclReFree(&(iPtr->regexps[NUM_REGEXPS-1]->re)); - ckfree((char *) iPtr->regexps[NUM_REGEXPS-1]); - } - for (i = NUM_REGEXPS - 2; i >= 0; i--) { - iPtr->patterns[i+1] = iPtr->patterns[i]; - iPtr->patLengths[i+1] = iPtr->patLengths[i]; - iPtr->regexps[i+1] = iPtr->regexps[i]; - } - iPtr->patterns[0] = (char *) ckalloc((unsigned) (length+1)); - strcpy(iPtr->patterns[0], string); - iPtr->patLengths[0] = length; - iPtr->regexps[0] = result; - return (Tcl_RegExp) result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RegExpExec -- - * - * Execute the regular expression matcher using a compiled form - * of a regular expression and save information about any match - * that is found. - * - * Results: - * If an error occurs during the matching operation then -1 - * is returned and the interp's result contains an error message. - * Otherwise the return value is 1 if a matching range is - * found and 0 if there is no matching range. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_RegExpExec(interp, re, string, start) - Tcl_Interp *interp; /* Interpreter to use for error reporting. */ - Tcl_RegExp re; /* Compiled regular expression; must have - * been returned by previous call to - * Tcl_GetRegExpFromObj. */ - CONST char *string; /* String against which to match re. */ - CONST char *start; /* If string is part of a larger string, - * this identifies beginning of larger - * string, so that "^" won't match. */ -{ - int result, numChars; - Tcl_DString stringBuffer; - Tcl_UniChar *uniString; - - TclRegexp *regexpPtr = (TclRegexp *) re; - - /* - * Remember the UTF-8 string so Tcl_RegExpRange() can convert the - * matches from character to byte offsets. - */ - - regexpPtr->string = string; - - Tcl_DStringInit(&stringBuffer); - uniString = Tcl_UtfToUniCharDString(string, -1, &stringBuffer); - numChars = Tcl_DStringLength(&stringBuffer) / sizeof(Tcl_UniChar); - - /* - * Perform the regexp match. - */ - - result = TclRegExpExecUniChar(interp, re, uniString, numChars, -1, - ((string > start) ? REG_NOTBOL : 0)); - - Tcl_DStringFree(&stringBuffer); - - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_RegExpRange -- - * - * Returns pointers describing the range of a regular expression match, - * or one of the subranges within the match. - * - * Results: - * The variables at *startPtr and *endPtr are modified to hold the - * addresses of the endpoints of the range given by index. If the - * specified range doesn't exist then NULLs are returned. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -void -Tcl_RegExpRange(re, index, startPtr, endPtr) - Tcl_RegExp re; /* Compiled regular expression that has - * been passed to Tcl_RegExpExec. */ - int index; /* 0 means give the range of the entire - * match, > 0 means give the range of - * a matching subrange. */ - char **startPtr; /* Store address of first character in - * (sub-) range here. */ - char **endPtr; /* Store address of character just after last - * in (sub-) range here. */ -{ - TclRegexp *regexpPtr = (TclRegexp *) re; - - if ((size_t) index > regexpPtr->re.re_nsub) { - *startPtr = *endPtr = NULL; - } else if (regexpPtr->matches[index].rm_so < 0) { - *startPtr = *endPtr = NULL; - } else { - *startPtr = Tcl_UtfAtIndex(regexpPtr->string, - regexpPtr->matches[index].rm_so); - *endPtr = Tcl_UtfAtIndex(regexpPtr->string, - regexpPtr->matches[index].rm_eo); - } -} - -/* - *--------------------------------------------------------------------------- - * - * TclRegExpExecUniChar -- - * - * Execute the regular expression matcher using a compiled form of a - * regular expression and save information about any match that is - * found. - * - * Results: - * If an error occurs during the matching operation then -1 is - * returned and an error message is left in interp's result. - * Otherwise the return value is 1 if a matching range was found or - * 0 if there was no matching range. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclRegExpExecUniChar(interp, re, wString, numChars, nmatches, flags) - Tcl_Interp *interp; /* Interpreter to use for error reporting. */ - Tcl_RegExp re; /* Compiled regular expression; returned by - * a previous call to Tcl_GetRegExpFromObj */ - CONST Tcl_UniChar *wString; /* String against which to match re. */ - int numChars; /* Length of Tcl_UniChar string (must - * be >= 0). */ - int nmatches; /* How many subexpression matches (counting - * the whole match as subexpression 0) are - * of interest. -1 means "don't know". */ - int flags; /* Regular expression flags. */ -{ - int status; - TclRegexp *regexpPtr = (TclRegexp *) re; - size_t nm = regexpPtr->re.re_nsub + 1; - - if (nmatches >= 0 && (size_t) nmatches < nm) - nm = (size_t) nmatches; - - status = TclReExec(®expPtr->re, wString, (size_t) numChars, - (rm_detail_t *)NULL, nm, regexpPtr->matches, flags); - - /* - * Check for errors. - */ - - if (status != REG_OKAY) { - if (status == REG_NOMATCH) { - return 0; - } - if (interp != NULL) { - TclRegError(interp, "error while matching regular expression: ", - status); - } - return -1; - } - return 1; -} - -/* - *--------------------------------------------------------------------------- - * - * TclRegExpRangeUniChar -- - * - * Returns pointers describing the range of a regular expression match, - * or one of the subranges within the match. - * - * Results: - * The variables at *startPtr and *endPtr are modified to hold the - * addresses of the endpoints of the range given by index. If the - * specified range doesn't exist then NULLs are returned. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -void -TclRegExpRangeUniChar(re, index, startPtr, endPtr) - Tcl_RegExp re; /* Compiled regular expression that has - * been passed to Tcl_RegExpExec. */ - int index; /* 0 means give the range of the entire - * match, > 0 means give the range of - * a matching subrange. */ - int *startPtr; /* Store address of first character in - * (sub-) range here. */ - int *endPtr; /* Store address of character just after last - * in (sub-) range here. */ -{ - TclRegexp *regexpPtr = (TclRegexp *) re; - - if ((size_t) index > regexpPtr->re.re_nsub) { - *startPtr = -1; - *endPtr = -1; - } else { - *startPtr = regexpPtr->matches[index].rm_so; - *endPtr = regexpPtr->matches[index].rm_eo; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RegExpMatch -- - * - * See if a string matches a regular expression. - * - * Results: - * If an error occurs during the matching operation then -1 - * is returned and the interp's result contains an error message. - * Otherwise the return value is 1 if "string" matches "pattern" - * and 0 otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_RegExpMatch(interp, string, pattern) - Tcl_Interp *interp; /* Used for error reporting. */ - char *string; /* String. */ - char *pattern; /* Regular expression to match against - * string. */ -{ - Tcl_RegExp re; - - re = Tcl_RegExpCompile(interp, pattern); - if (re == NULL) { - return -1; - } - return Tcl_RegExpExec(interp, re, string, string); -} - -/* - *---------------------------------------------------------------------- - * - * TclRegExpMatchObj -- - * - * See if a string matches a regular expression pattern object. - * - * Results: - * If an error occurs during the matching operation then -1 - * is returned and the interp's result contains an error message. - * Otherwise the return value is 1 if "string" matches "pattern" - * and 0 otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclRegExpMatchObj(interp, string, patObj) - Tcl_Interp *interp; /* Used for error reporting. */ - char *string; /* String. */ - Tcl_Obj *patObj; /* Regular expression to match against - * string. */ -{ - Tcl_RegExp re; - - re = Tcl_GetRegExpFromObj(interp, patObj, REG_ADVANCED); - if (re == NULL) { - return -1; - } - return Tcl_RegExpExec(interp, re, string, string); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetRegExpFromObj -- - * - * Compile a regular expression into a form suitable for fast - * matching. This procedure caches the result in a Tcl_Obj. - * - * Results: - * The return value is a pointer to the compiled form of string, - * suitable for passing to Tcl_RegExpExec. If an error occurred - * while compiling the pattern, then NULL is returned and an error - * message is left in the interp's result. - * - * Side effects: - * Updates the native rep of the Tcl_Obj. - * - *---------------------------------------------------------------------- - */ - -Tcl_RegExp -Tcl_GetRegExpFromObj(interp, objPtr, flags) - Tcl_Interp *interp; /* For use in error reporting. */ - Tcl_Obj *objPtr; /* Object whose string rep contains regular - * expression pattern. Internal rep will be - * changed to compiled form of this regular - * expression. */ - int flags; /* Regular expression compilation flags. */ -{ - int length; - Tcl_ObjType *typePtr; - TclRegexp *regexpPtr; - char *pattern; - - typePtr = objPtr->typePtr; - regexpPtr = (TclRegexp *) objPtr->internalRep.otherValuePtr; - - if ((typePtr != &tclRegexpType) || (regexpPtr->flags != flags)) { - pattern = Tcl_GetStringFromObj(objPtr, &length); - regexpPtr = CompileRegexp(interp, pattern, length, flags); - if (regexpPtr == NULL) { - return NULL; - } - - /* - * Free the old representation and set our type. - */ - - if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) { - (*typePtr->freeIntRepProc)(objPtr); - } - objPtr->internalRep.otherValuePtr = (VOID *) regexpPtr; - objPtr->typePtr = &tclRegexpType; - } - return (Tcl_RegExp) regexpPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclRegAbout -- - * - * Return information about a compiled regular expression. - * - * Results: - * The return value is -1 for failure, 0 for success, although at - * the moment there's nothing that could fail. On success, a list - * is left in the interp's result: first element is the subexpression - * count, second is a list of re_info bit names. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclRegAbout(interp, re) - Tcl_Interp *interp; /* For use in variable assignment. */ - Tcl_RegExp re; /* The compiled regular expression. */ -{ - TclRegexp *regexpPtr = (TclRegexp *)re; - char buf[TCL_INTEGER_SPACE]; - static struct infoname { - int bit; - char *text; - } infonames[] = { - {REG_UBACKREF, "REG_UBACKREF"}, - {REG_ULOOKAHEAD, "REG_ULOOKAHEAD"}, - {REG_UBOUNDS, "REG_UBOUNDS"}, - {REG_UBRACES, "REG_UBRACES"}, - {REG_UBSALNUM, "REG_UBSALNUM"}, - {REG_UPBOTCH, "REG_UPBOTCH"}, - {REG_UBBS, "REG_UBBS"}, - {REG_UNONPOSIX, "REG_UNONPOSIX"}, - {REG_UUNSPEC, "REG_UUNSPEC"}, - {REG_UUNPORT, "REG_UUNPORT"}, - {REG_ULOCALE, "REG_ULOCALE"}, - {REG_UEMPTYMATCH, "REG_UEMPTYMATCH"}, - {REG_UIMPOSSIBLE, "REG_UIMPOSSIBLE"}, - {0, ""} - }; - struct infoname *inf; - int n; - - Tcl_ResetResult(interp); - - sprintf(buf, "%u", (unsigned)(regexpPtr->re.re_nsub)); - Tcl_AppendElement(interp, buf); - - /* - * Must count bits before generating list, because we must know - * whether {} are needed before we start appending names. - */ - n = 0; - for (inf = infonames; inf->bit != 0; inf++) { - if (regexpPtr->re.re_info&inf->bit) { - n++; - } - } - if (n != 1) { - Tcl_AppendResult(interp, " {", NULL); - } - for (inf = infonames; inf->bit != 0; inf++) { - if (regexpPtr->re.re_info&inf->bit) { - Tcl_AppendElement(interp, inf->text); - } - } - if (n != 1) { - Tcl_AppendResult(interp, "}", NULL); - } - - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclRegError -- - * - * Generate an error message based on the regexp status code. - * - * Results: - * Places an error in the interpreter. - * - * Side effects: - * Sets errorCode as well. - * - *---------------------------------------------------------------------- - */ - -void -TclRegError(interp, msg, status) - Tcl_Interp *interp; /* Interpreter for error reporting. */ - char *msg; /* Message to prepend to error. */ - int status; /* Status code to report. */ -{ - char buf[100]; /* ample in practice */ - char cbuf[100]; /* lots in practice */ - size_t n; - char *p; - - Tcl_ResetResult(interp); - n = TclReError(status, (regex_t *)NULL, buf, sizeof(buf)); - p = (n > sizeof(buf)) ? "..." : ""; - Tcl_AppendResult(interp, msg, buf, p, NULL); - - sprintf(cbuf, "%d", status); - (VOID) TclReError(REG_ITOA, (regex_t *)NULL, cbuf, sizeof(cbuf)); - Tcl_SetErrorCode(interp, "REGEXP", cbuf, buf, NULL); -} - - -/* - *---------------------------------------------------------------------- - * - * FreeRegexpInternalRep -- - * - * Deallocate the storage associated with a regexp object's internal - * representation. - * - * Results: - * None. - * - * Side effects: - * Frees the compiled regular expression. - * - *---------------------------------------------------------------------- - */ - -static void -FreeRegexpInternalRep(objPtr) - Tcl_Obj *objPtr; /* Regexp object with internal rep to free. */ -{ - TclRegexp *regexpRepPtr = (TclRegexp *) objPtr->internalRep.otherValuePtr; - - TclReFree(®expRepPtr->re); - if (regexpRepPtr->matches) { - ckfree((char *) regexpRepPtr->matches); - } - ckfree((char *) regexpRepPtr); -} - -/* - *---------------------------------------------------------------------- - * - * DupRegexpInternalRep -- - * - * It is way too hairy to copy a regular expression, so we punt - * and revert the object back to a vanilla string. - * - * Results: - * None. - * - * Side effects: - * Changes the type back to string. - * - *---------------------------------------------------------------------- - */ - -static void -DupRegexpInternalRep(srcPtr, copyPtr) - Tcl_Obj *srcPtr; /* Object with internal rep to copy. */ - Tcl_Obj *copyPtr; /* Object with internal rep to set. */ -{ - copyPtr->internalRep.longValue = (long)copyPtr->length; - copyPtr->typePtr = &tclStringType; -} - -/* - *---------------------------------------------------------------------- - * - * SetRegexpFromAny -- - * - * Attempt to generate a compiled regular expression for the Tcl object - * "objPtr". - * - * Results: - * The return value is TCL_OK or TCL_ERROR. If an error occurs during - * conversion, an error message is left in the interpreter's result - * unless "interp" is NULL. - * - * Side effects: - * If no error occurs, a regular expression is stored as "objPtr"s internal - * representation. - * - *---------------------------------------------------------------------- - */ - -static int -SetRegexpFromAny(interp, objPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr; /* The object to convert. */ -{ - if (Tcl_GetRegExpFromObj(interp, objPtr, REG_ADVANCED) == NULL) { - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * CompileRegexp -- - * - * Attempt to compile the given regexp pattern - * - * Results: - * The return value is a pointer to a newly allocated TclRegexp - * that represents the compiled pattern, or NULL if the pattern - * could not be compiled. If NULL is returned, an error message is - * left in the interp's result. - * - * Side effects: - * Memory allocated. - * - *---------------------------------------------------------------------- - */ - -static TclRegexp * -CompileRegexp(interp, string, length, flags) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - char *string; /* The regexp to compile (UTF-8). */ - int length; /* The length of the string in bytes. */ - int flags; /* Compilation flags. */ -{ - TclRegexp *regexpPtr; - Tcl_UniChar *uniString; - int numChars; - Tcl_DString stringBuf; - int status; - - regexpPtr = (TclRegexp *) ckalloc(sizeof(TclRegexp)); - - /* - * Get the up-to-date string representation and map to unicode. - */ - - Tcl_DStringInit(&stringBuf); - uniString = Tcl_UtfToUniCharDString(string, length, &stringBuf); - numChars = Tcl_DStringLength(&stringBuf) / sizeof(Tcl_UniChar); - - /* - * Compile the string and check for errors. - */ - - regexpPtr->flags = flags; - status = TclReComp(®expPtr->re, uniString, (size_t) numChars, flags); - Tcl_DStringFree(&stringBuf); - - if (status != REG_OKAY) { - /* - * Clean up and report errors in the interpreter, if possible. - */ - ckfree((char *)regexpPtr); - if (interp) { - TclRegError(interp, - "couldn't compile regular expression pattern: ", - status); - } - return NULL; - } - - /* - * Allocate enough space for all of the subexpressions, plus one - * extra for the entire pattern. - */ - - regexpPtr->matches = (regmatch_t *) ckalloc( - sizeof(regmatch_t) * (regexpPtr->re.re_nsub + 1)); - - return regexpPtr; -} diff --git a/generic/tclRegexp.h b/generic/tclRegexp.h deleted file mode 100644 index 7be13c1..0000000 --- a/generic/tclRegexp.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * tclRegexp.h -- - * - * This file contains definitions used internally by Henry - * Spencer's regular expression code. - * - * Copyright (c) 1998 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and - * Scriptics Corporation, none of whom are responsible for the results. - * The author thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * THIS SOFTWARE IS PROVIDED ``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 - * HENRY SPENCER 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. - * - * Copyright (c) 1998 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. - * - * RCS: @(#) $Id: tclRegexp.h,v 1.5 1999/04/16 00:46:52 stanton Exp $ - */ - -#ifndef _TCLREGEXP -#define _TCLREGEXP - -#include "regex.h" - -#ifdef BUILD_tcl -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT -#endif - -/* - * The TclRegexp structure encapsulates a compiled regex_t, - * the flags that were used to compile it, and an array of pointers - * that are used to indicate subexpressions after a call to Tcl_RegExpExec. - */ - -typedef struct TclRegexp { - int flags; /* Regexp compile flags. */ - regex_t re; /* Compiled re, includes number of - * subexpressions. */ - CONST char *string; /* Last string matched with this regexp - * (UTF-8), so Tcl_RegExpRange() can convert - * the matches from character indices to UTF-8 - * byte offsets. */ - regmatch_t *matches; /* Array of indices into the Tcl_UniChar - * representation of the last string matched - * with this regexp to indicate the location - * of subexpressions. */ -} TclRegexp; - -/* - * Functions exported for use within the rest of Tcl. - */ - -EXTERN int TclRegAbout _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_RegExp re)); -EXTERN VOID TclRegXflags _ANSI_ARGS_((char *string, int length, - int *cflagsPtr, int *eflagsPtr)); -EXTERN int TclRegExpExecUniChar _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_RegExp re, CONST Tcl_UniChar *uniString, - int numChars, int nmatches, int flags)); -EXTERN int TclRegExpMatchObj _ANSI_ARGS_((Tcl_Interp *interp, - char *string, Tcl_Obj *patObj)); -EXTERN void TclRegExpRangeUniChar _ANSI_ARGS_((Tcl_RegExp re, - int index, int *startPtr, int *endPtr)); - -/* - * Functions exported from the regexp package for the test package to use. - */ - -EXTERN void TclRegError _ANSI_ARGS_((Tcl_Interp *interp, char *msg, - int status)); - -#endif /* _TCLREGEXP */ diff --git a/generic/tclResolve.c b/generic/tclResolve.c deleted file mode 100644 index 0a5b7c1..0000000 --- a/generic/tclResolve.c +++ /dev/null @@ -1,418 +0,0 @@ -/* - * tclResolve.c -- - * - * Contains hooks for customized command/variable name resolution - * schemes. These hooks allow extensions like [incr Tcl] to add - * their own name resolution rules to the Tcl language. Rules can - * be applied to a particular namespace, to the interpreter as a - * whole, or both. - * - * Copyright (c) 1998 Lucent Technologies, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclResolve.c,v 1.3 1998/10/06 19:12:06 rjohnson Exp $ - */ - -#include "tclInt.h" - -/* - * Declarations for procedures local to this file: - */ - -static void BumpCmdRefEpochs _ANSI_ARGS_((Namespace *nsPtr)); - - -/* - *---------------------------------------------------------------------- - * - * Tcl_AddInterpResolvers -- - * - * Adds a set of command/variable resolution procedures to an - * interpreter. These procedures are consulted when commands - * are resolved in Tcl_FindCommand, and when variables are - * resolved in TclLookupVar and LookupCompiledLocal. Each - * namespace may also have its own set of resolution procedures - * which take precedence over those for the interpreter. - * - * When a name is resolved, it is handled as follows. First, - * the name is passed to the resolution procedures for the - * namespace. If not resolved, the name is passed to each of - * the resolution procedures added to the interpreter. Finally, - * if still not resolved, the name is handled using the default - * Tcl rules for name resolution. - * - * Results: - * Returns pointers to the current name resolution procedures - * in the cmdProcPtr, varProcPtr and compiledVarProcPtr - * arguments. - * - * Side effects: - * If a compiledVarProc is specified, this procedure bumps the - * compileEpoch for the interpreter, forcing all code to be - * recompiled. If a cmdProc is specified, this procedure bumps - * the cmdRefEpoch in all namespaces, forcing commands to be - * resolved again using the new rules. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AddInterpResolvers(interp, name, cmdProc, varProc, compiledVarProc) - - Tcl_Interp *interp; /* Interpreter whose name resolution - * rules are being modified. */ - char *name; /* Name of this resolution scheme. */ - Tcl_ResolveCmdProc *cmdProc; /* New procedure for command - * resolution */ - Tcl_ResolveVarProc *varProc; /* Procedure for variable resolution - * at runtime */ - Tcl_ResolveCompiledVarProc *compiledVarProc; - /* Procedure for variable resolution - * at compile time. */ -{ - Interp *iPtr = (Interp*)interp; - ResolverScheme *resPtr; - - /* - * Since we're adding a new name resolution scheme, we must force - * all code to be recompiled to use the new scheme. If there - * are new compiled variable resolution rules, bump the compiler - * epoch to invalidate compiled code. If there are new command - * resolution rules, bump the cmdRefEpoch in all namespaces. - */ - if (compiledVarProc) { - iPtr->compileEpoch++; - } - if (cmdProc) { - BumpCmdRefEpochs(iPtr->globalNsPtr); - } - - /* - * Look for an existing scheme with the given name. If found, - * then replace its rules. - */ - for (resPtr = iPtr->resolverPtr; resPtr != NULL; resPtr = resPtr->nextPtr) { - if (*name == *resPtr->name && strcmp(name, resPtr->name) == 0) { - resPtr->cmdResProc = cmdProc; - resPtr->varResProc = varProc; - resPtr->compiledVarResProc = compiledVarProc; - return; - } - } - - /* - * Otherwise, this is a new scheme. Add it to the FRONT - * of the linked list, so that it overrides existing schemes. - */ - resPtr = (ResolverScheme *) ckalloc(sizeof(ResolverScheme)); - resPtr->name = (char*)ckalloc((unsigned)(strlen(name)+1)); - strcpy(resPtr->name, name); - resPtr->cmdResProc = cmdProc; - resPtr->varResProc = varProc; - resPtr->compiledVarResProc = compiledVarProc; - resPtr->nextPtr = iPtr->resolverPtr; - iPtr->resolverPtr = resPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetInterpResolvers -- - * - * Looks for a set of command/variable resolution procedures with - * the given name in an interpreter. These procedures are - * registered by calling Tcl_AddInterpResolvers. - * - * Results: - * If the name is recognized, this procedure returns non-zero, - * along with pointers to the name resolution procedures in - * the Tcl_ResolverInfo structure. If the name is not recognized, - * this procedure returns zero. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetInterpResolvers(interp, name, resInfoPtr) - - Tcl_Interp *interp; /* Interpreter whose name resolution - * rules are being queried. */ - char *name; /* Look for a scheme with this name. */ - Tcl_ResolverInfo *resInfoPtr; /* Returns pointers to the procedures, - * if found */ -{ - Interp *iPtr = (Interp*)interp; - ResolverScheme *resPtr; - - /* - * Look for an existing scheme with the given name. If found, - * then return pointers to its procedures. - */ - for (resPtr = iPtr->resolverPtr; resPtr != NULL; resPtr = resPtr->nextPtr) { - if (*name == *resPtr->name && strcmp(name, resPtr->name) == 0) { - resInfoPtr->cmdResProc = resPtr->cmdResProc; - resInfoPtr->varResProc = resPtr->varResProc; - resInfoPtr->compiledVarResProc = resPtr->compiledVarResProc; - return 1; - } - } - - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RemoveInterpResolvers -- - * - * Removes a set of command/variable resolution procedures - * previously added by Tcl_AddInterpResolvers. The next time - * a command/variable name is resolved, these procedures - * won't be consulted. - * - * Results: - * Returns non-zero if the name was recognized and the - * resolution scheme was deleted. Returns zero otherwise. - * - * Side effects: - * If a scheme with a compiledVarProc was deleted, this procedure - * bumps the compileEpoch for the interpreter, forcing all code - * to be recompiled. If a scheme with a cmdProc was deleted, - * this procedure bumps the cmdRefEpoch in all namespaces, - * forcing commands to be resolved again using the new rules. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_RemoveInterpResolvers(interp, name) - - Tcl_Interp *interp; /* Interpreter whose name resolution - * rules are being modified. */ - char *name; /* Name of the scheme to be removed. */ -{ - Interp *iPtr = (Interp*)interp; - ResolverScheme **prevPtrPtr, *resPtr; - - /* - * Look for an existing scheme with the given name. - */ - prevPtrPtr = &iPtr->resolverPtr; - for (resPtr = iPtr->resolverPtr; resPtr != NULL; resPtr = resPtr->nextPtr) { - if (*name == *resPtr->name && strcmp(name, resPtr->name) == 0) { - break; - } - prevPtrPtr = &resPtr->nextPtr; - } - - /* - * If we found the scheme, delete it. - */ - if (resPtr) { - /* - * If we're deleting a scheme with compiled variable resolution - * rules, bump the compiler epoch to invalidate compiled code. - * If we're deleting a scheme with command resolution rules, - * bump the cmdRefEpoch in all namespaces. - */ - if (resPtr->compiledVarResProc) { - iPtr->compileEpoch++; - } - if (resPtr->cmdResProc) { - BumpCmdRefEpochs(iPtr->globalNsPtr); - } - - *prevPtrPtr = resPtr->nextPtr; - ckfree(resPtr->name); - ckfree((char *) resPtr); - - return 1; - } - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * BumpCmdRefEpochs -- - * - * This procedure is used to bump the cmdRefEpoch counters in - * the specified namespace and all of its child namespaces. - * It is used whenever name resolution schemes are added/removed - * from an interpreter, to invalidate all command references. - * - * Results: - * None. - * - * Side effects: - * Bumps the cmdRefEpoch in the specified namespace and its - * children, recursively. - * - *---------------------------------------------------------------------- - */ - -static void -BumpCmdRefEpochs(nsPtr) - Namespace *nsPtr; /* Namespace being modified. */ -{ - Tcl_HashEntry *entry; - Tcl_HashSearch search; - Namespace *childNsPtr; - - nsPtr->cmdRefEpoch++; - - for (entry = Tcl_FirstHashEntry(&nsPtr->childTable, &search); - entry != NULL; - entry = Tcl_NextHashEntry(&search)) { - - childNsPtr = (Namespace *) Tcl_GetHashValue(entry); - BumpCmdRefEpochs(childNsPtr); - } -} - - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetNamespaceResolvers -- - * - * Sets the command/variable resolution procedures for a namespace, - * thereby changing the way that command/variable names are - * interpreted. This allows extension writers to support different - * name resolution schemes, such as those for object-oriented - * packages. - * - * Command resolution is handled by a procedure of the following - * type: - * - * typedef int (Tcl_ResolveCmdProc) _ANSI_ARGS_(( - * Tcl_Interp* interp, char* name, Tcl_Namespace *context, - * int flags, Tcl_Command *rPtr)); - * - * Whenever a command is executed or Tcl_FindCommand is invoked - * within the namespace, this procedure is called to resolve the - * command name. If this procedure is able to resolve the name, - * it should return the status code TCL_OK, along with the - * corresponding Tcl_Command in the rPtr argument. Otherwise, - * the procedure can return TCL_CONTINUE, and the command will - * be treated under the usual name resolution rules. Or, it can - * return TCL_ERROR, and the command will be considered invalid. - * - * Variable resolution is handled by two procedures. The first - * is called whenever a variable needs to be resolved at compile - * time: - * - * typedef int (Tcl_ResolveCompiledVarProc) _ANSI_ARGS_(( - * Tcl_Interp* interp, char* name, Tcl_Namespace *context, - * Tcl_ResolvedVarInfo *rPtr)); - * - * If this procedure is able to resolve the name, it should return - * the status code TCL_OK, along with variable resolution info in - * the rPtr argument; this info will be used to set up compiled - * locals in the call frame at runtime. The procedure may also - * return TCL_CONTINUE, and the variable will be treated under - * the usual name resolution rules. Or, it can return TCL_ERROR, - * and the variable will be considered invalid. - * - * Another procedure is used whenever a variable needs to be - * resolved at runtime but it is not recognized as a compiled local. - * (For example, the variable may be requested via - * Tcl_FindNamespaceVar.) This procedure has the following type: - * - * typedef int (Tcl_ResolveVarProc) _ANSI_ARGS_(( - * Tcl_Interp* interp, char* name, Tcl_Namespace *context, - * int flags, Tcl_Var *rPtr)); - * - * This procedure is quite similar to the compile-time version. - * It returns the same status codes, but if variable resolution - * succeeds, this procedure returns a Tcl_Var directly via the - * rPtr argument. - * - * Results: - * Nothing. - * - * Side effects: - * Bumps the command epoch counter for the namespace, invalidating - * all command references in that namespace. Also bumps the - * resolver epoch counter for the namespace, forcing all code - * in the namespace to be recompiled. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetNamespaceResolvers(namespacePtr, cmdProc, varProc, compiledVarProc) - Tcl_Namespace *namespacePtr; /* Namespace whose resolution rules - * are being modified. */ - Tcl_ResolveCmdProc *cmdProc; /* Procedure for command resolution */ - Tcl_ResolveVarProc *varProc; /* Procedure for variable resolution - * at runtime */ - Tcl_ResolveCompiledVarProc *compiledVarProc; - /* Procedure for variable resolution - * at compile time. */ -{ - Namespace *nsPtr = (Namespace*)namespacePtr; - - /* - * Plug in the new command resolver, and bump the epoch counters - * so that all code will have to be recompiled and all commands - * will have to be resolved again using the new policy. - */ - nsPtr->cmdResProc = cmdProc; - nsPtr->varResProc = varProc; - nsPtr->compiledVarResProc = compiledVarProc; - - nsPtr->cmdRefEpoch++; - nsPtr->resolverEpoch++; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetNamespaceResolvers -- - * - * Returns the current command/variable resolution procedures - * for a namespace. By default, these procedures are NULL. - * New procedures can be installed by calling - * Tcl_SetNamespaceResolvers, to provide new name resolution - * rules. - * - * Results: - * Returns non-zero if any name resolution procedures have been - * assigned to this namespace; also returns pointers to the - * procedures in the Tcl_ResolverInfo structure. Returns zero - * otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetNamespaceResolvers(namespacePtr, resInfoPtr) - - Tcl_Namespace *namespacePtr; /* Namespace whose resolution rules - * are being modified. */ - Tcl_ResolverInfo *resInfoPtr; /* Returns: pointers for all - * name resolution procedures - * assigned to this namespace. */ -{ - Namespace *nsPtr = (Namespace*)namespacePtr; - - resInfoPtr->cmdResProc = nsPtr->cmdResProc; - resInfoPtr->varResProc = nsPtr->varResProc; - resInfoPtr->compiledVarResProc = nsPtr->compiledVarResProc; - - if (nsPtr->cmdResProc != NULL || - nsPtr->varResProc != NULL || - nsPtr->compiledVarResProc != NULL) { - return 1; - } - return 0; -} diff --git a/generic/tclResult.c b/generic/tclResult.c deleted file mode 100644 index 002437d..0000000 --- a/generic/tclResult.c +++ /dev/null @@ -1,1025 +0,0 @@ -/* - * tclResult.c -- - * - * This file contains code to manage the interpreter result. - * - * 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. - * - * RCS: @(#) $Id: tclResult.c,v 1.2 1999/04/16 00:46:53 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * Function prototypes for local procedures in this file: - */ - -static void ResetObjResult _ANSI_ARGS_((Interp *iPtr)); -static void SetupAppendBuffer _ANSI_ARGS_((Interp *iPtr, - int newSpace)); - - -/* - *---------------------------------------------------------------------- - * - * Tcl_SaveResult -- - * - * Takes a snapshot of the current result state of the interpreter. - * The snapshot can be restored at any point by - * Tcl_RestoreResult. Note that this routine does not - * preserve the errorCode, errorInfo, or flags fields so it - * should not be used if an error is in progress. - * - * Once a snapshot is saved, it must be restored by calling - * Tcl_RestoreResult, or discarded by calling - * Tcl_DiscardResult. - * - * Results: - * None. - * - * Side effects: - * Resets the interpreter result. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SaveResult(interp, statePtr) - Tcl_Interp *interp; /* Interpreter to save. */ - Tcl_SavedResult *statePtr; /* Pointer to state structure. */ -{ - Interp *iPtr = (Interp *) interp; - - /* - * Move the result object into the save state. Note that we don't need - * to change its refcount because we're moving it, not adding a new - * reference. Put an empty object into the interpreter. - */ - - statePtr->objResultPtr = iPtr->objResultPtr; - iPtr->objResultPtr = Tcl_NewObj(); - Tcl_IncrRefCount(iPtr->objResultPtr); - - /* - * Save the string result. - */ - - statePtr->freeProc = iPtr->freeProc; - if (iPtr->result == iPtr->resultSpace) { - /* - * Copy the static string data out of the interp buffer. - */ - - statePtr->result = statePtr->resultSpace; - strcpy(statePtr->result, iPtr->result); - statePtr->appendResult = NULL; - } else if (iPtr->result == iPtr->appendResult) { - /* - * Move the append buffer out of the interp. - */ - - statePtr->appendResult = iPtr->appendResult; - statePtr->appendAvl = iPtr->appendAvl; - statePtr->appendUsed = iPtr->appendUsed; - statePtr->result = statePtr->appendResult; - iPtr->appendResult = NULL; - iPtr->appendAvl = 0; - iPtr->appendUsed = 0; - } else { - /* - * Move the dynamic or static string out of the interpreter. - */ - - statePtr->result = iPtr->result; - statePtr->appendResult = NULL; - } - - iPtr->result = iPtr->resultSpace; - iPtr->resultSpace[0] = 0; - iPtr->freeProc = 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_RestoreResult -- - * - * Restores the state of the interpreter to a snapshot taken - * by Tcl_SaveResult. After this call, the token for - * the interpreter state is no longer valid. - * - * Results: - * None. - * - * Side effects: - * Restores the interpreter result. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_RestoreResult(interp, statePtr) - Tcl_Interp* interp; /* Interpreter being restored. */ - Tcl_SavedResult *statePtr; /* State returned by Tcl_SaveResult. */ -{ - Interp *iPtr = (Interp *) interp; - - Tcl_ResetResult(interp); - - /* - * Restore the string result. - */ - - iPtr->freeProc = statePtr->freeProc; - if (statePtr->result == statePtr->resultSpace) { - /* - * Copy the static string data into the interp buffer. - */ - - iPtr->result = iPtr->resultSpace; - strcpy(iPtr->result, statePtr->result); - } else if (statePtr->result == statePtr->appendResult) { - /* - * Move the append buffer back into the interp. - */ - - if (iPtr->appendResult != NULL) { - ckfree((char *)iPtr->appendResult); - } - - iPtr->appendResult = statePtr->appendResult; - iPtr->appendAvl = statePtr->appendAvl; - iPtr->appendUsed = statePtr->appendUsed; - iPtr->result = iPtr->appendResult; - } else { - /* - * Move the dynamic or static string back into the interpreter. - */ - - iPtr->result = statePtr->result; - } - - /* - * Restore the object result. - */ - - Tcl_DecrRefCount(iPtr->objResultPtr); - iPtr->objResultPtr = statePtr->objResultPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DiscardResult -- - * - * Frees the memory associated with an interpreter snapshot - * taken by Tcl_SaveResult. If the snapshot is not - * restored, this procedure must be called to discard it, - * or the memory will be lost. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DiscardResult(statePtr) - Tcl_SavedResult *statePtr; /* State returned by Tcl_SaveResult. */ -{ - TclDecrRefCount(statePtr->objResultPtr); - - if (statePtr->result == statePtr->appendResult) { - ckfree(statePtr->appendResult); - } else if (statePtr->freeProc) { - if ((statePtr->freeProc == TCL_DYNAMIC) - || (statePtr->freeProc == (Tcl_FreeProc *) free)) { - ckfree(statePtr->result); - } else { - (*statePtr->freeProc)(statePtr->result); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetResult -- - * - * Arrange for "string" to be the Tcl return value. - * - * Results: - * None. - * - * Side effects: - * interp->result is left pointing either to "string" (if "copy" is 0) - * or to a copy of string. Also, the object result is reset. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetResult(interp, string, freeProc) - Tcl_Interp *interp; /* Interpreter with which to associate the - * return value. */ - register char *string; /* Value to be returned. If NULL, the - * result is set to an empty string. */ - Tcl_FreeProc *freeProc; /* Gives information about the string: - * TCL_STATIC, TCL_VOLATILE, or the address - * of a Tcl_FreeProc such as free. */ -{ - Interp *iPtr = (Interp *) interp; - int length; - register Tcl_FreeProc *oldFreeProc = iPtr->freeProc; - char *oldResult = iPtr->result; - - if (string == NULL) { - iPtr->resultSpace[0] = 0; - iPtr->result = iPtr->resultSpace; - iPtr->freeProc = 0; - } else if (freeProc == TCL_VOLATILE) { - length = strlen(string); - if (length > TCL_RESULT_SIZE) { - iPtr->result = (char *) ckalloc((unsigned) length+1); - iPtr->freeProc = TCL_DYNAMIC; - } else { - iPtr->result = iPtr->resultSpace; - iPtr->freeProc = 0; - } - strcpy(iPtr->result, string); - } else { - iPtr->result = string; - iPtr->freeProc = freeProc; - } - - /* - * If the old result was dynamically-allocated, free it up. Do it - * here, rather than at the beginning, in case the new result value - * was part of the old result value. - */ - - if (oldFreeProc != 0) { - if ((oldFreeProc == TCL_DYNAMIC) - || (oldFreeProc == (Tcl_FreeProc *) free)) { - ckfree(oldResult); - } else { - (*oldFreeProc)(oldResult); - } - } - - /* - * Reset the object result since we just set the string result. - */ - - ResetObjResult(iPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetStringResult -- - * - * Returns an interpreter's result value as a string. - * - * Results: - * The interpreter's result as a string. - * - * Side effects: - * If the string result is empty, the object result is moved to the - * string result, then the object result is reset. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetStringResult(interp) - register Tcl_Interp *interp; /* Interpreter whose result to return. */ -{ - /* - * If the string result is empty, move the object result to the - * string result, then reset the object result. - */ - - if (*(interp->result) == 0) { - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - } - return interp->result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetObjResult -- - * - * Arrange for objPtr to be an interpreter's result value. - * - * Results: - * None. - * - * Side effects: - * interp->objResultPtr is left pointing to the object referenced - * by objPtr. The object's reference count is incremented since - * there is now a new reference to it. The reference count for any - * old objResultPtr value is decremented. Also, the string result - * is reset. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetObjResult(interp, objPtr) - Tcl_Interp *interp; /* Interpreter with which to associate the - * return object value. */ - register Tcl_Obj *objPtr; /* Tcl object to be returned. If NULL, the - * obj result is made an empty string - * object. */ -{ - register Interp *iPtr = (Interp *) interp; - register Tcl_Obj *oldObjResult = iPtr->objResultPtr; - - iPtr->objResultPtr = objPtr; - Tcl_IncrRefCount(objPtr); /* since interp result is a reference */ - - /* - * We wait until the end to release the old object result, in case - * we are setting the result to itself. - */ - - TclDecrRefCount(oldObjResult); - - /* - * Reset the string result since we just set the result object. - */ - - if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { - ckfree(iPtr->result); - } else { - (*iPtr->freeProc)(iPtr->result); - } - iPtr->freeProc = 0; - } - iPtr->result = iPtr->resultSpace; - iPtr->resultSpace[0] = 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetObjResult -- - * - * Returns an interpreter's result value as a Tcl object. The object's - * reference count is not modified; the caller must do that if it - * needs to hold on to a long-term reference to it. - * - * Results: - * The interpreter's result as an object. - * - * Side effects: - * If the interpreter has a non-empty string result, the result object - * is either empty or stale because some procedure set interp->result - * directly. If so, the string result is moved to the result object - * then the string result is reset. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_GetObjResult(interp) - Tcl_Interp *interp; /* Interpreter whose result to return. */ -{ - register Interp *iPtr = (Interp *) interp; - Tcl_Obj *objResultPtr; - int length; - - /* - * If the string result is non-empty, move the string result to the - * object result, then reset the string result. - */ - - if (*(iPtr->result) != 0) { - ResetObjResult(iPtr); - - objResultPtr = iPtr->objResultPtr; - length = strlen(iPtr->result); - TclInitStringRep(objResultPtr, iPtr->result, length); - - if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { - ckfree(iPtr->result); - } else { - (*iPtr->freeProc)(iPtr->result); - } - iPtr->freeProc = 0; - } - iPtr->result = iPtr->resultSpace; - iPtr->resultSpace[0] = 0; - } - return iPtr->objResultPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendResultVA -- - * - * Append a variable number of strings onto the interpreter's string - * result. - * - * Results: - * None. - * - * Side effects: - * The result of the interpreter given by the first argument is - * extended by the strings in the va_list (up to a terminating NULL - * argument). - * - * If the string result is empty, the object result is moved to the - * string result, then the object result is reset. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AppendResultVA (interp, argList) - Tcl_Interp *interp; /* Interpreter with which to associate the - * return value. */ - va_list argList; /* Variable argument list. */ -{ - Interp *iPtr = (Interp *) interp; - va_list tmpArgList; - char *string; - int newSpace; - - /* - * If the string result is empty, move the object result to the - * string result, then reset the object result. - */ - - if (*(iPtr->result) == 0) { - Tcl_SetResult((Tcl_Interp *) iPtr, - TclGetString(Tcl_GetObjResult((Tcl_Interp *) iPtr)), - TCL_VOLATILE); - } - - /* - * Scan through all the arguments to see how much space is needed. - */ - - tmpArgList = argList; - newSpace = 0; - while (1) { - string = va_arg(tmpArgList, char *); - if (string == NULL) { - break; - } - newSpace += strlen(string); - } - - /* - * If the append buffer isn't already setup and large enough to hold - * the new data, set it up. - */ - - if ((iPtr->result != iPtr->appendResult) - || (iPtr->appendResult[iPtr->appendUsed] != 0) - || ((newSpace + iPtr->appendUsed) >= iPtr->appendAvl)) { - SetupAppendBuffer(iPtr, newSpace); - } - - /* - * Now go through all the argument strings again, copying them into the - * buffer. - */ - - while (1) { - string = va_arg(argList, char *); - if (string == NULL) { - break; - } - strcpy(iPtr->appendResult + iPtr->appendUsed, string); - iPtr->appendUsed += strlen(string); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendResult -- - * - * Append a variable number of strings onto the interpreter's string - * result. - * - * Results: - * None. - * - * Side effects: - * The result of the interpreter given by the first argument is - * extended by the strings given by the second and following arguments - * (up to a terminating NULL argument). - * - * If the string result is empty, the object result is moved to the - * string result, then the object result is reset. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AppendResult TCL_VARARGS_DEF(Tcl_Interp *,arg1) -{ - Tcl_Interp *interp; - va_list argList; - - interp = TCL_VARARGS_START(Tcl_Interp *,arg1,argList); - Tcl_AppendResultVA(interp, argList); - va_end(argList); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendElement -- - * - * Convert a string to a valid Tcl list element and append it to the - * result (which is ostensibly a list). - * - * Results: - * None. - * - * Side effects: - * The result in the interpreter given by the first argument is - * extended with a list element converted from string. A separator - * space is added before the converted list element unless the current - * result is empty, contains the single character "{", or ends in " {". - * - * If the string result is empty, the object result is moved to the - * string result, then the object result is reset. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AppendElement(interp, string) - Tcl_Interp *interp; /* Interpreter whose result is to be - * extended. */ - CONST char *string; /* String to convert to list element and - * add to result. */ -{ - Interp *iPtr = (Interp *) interp; - char *dst; - int size; - int flags; - - /* - * If the string result is empty, move the object result to the - * string result, then reset the object result. - */ - - if (*(iPtr->result) == 0) { - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - } - - /* - * See how much space is needed, and grow the append buffer if - * needed to accommodate the list element. - */ - - size = Tcl_ScanElement(string, &flags) + 1; - if ((iPtr->result != iPtr->appendResult) - || (iPtr->appendResult[iPtr->appendUsed] != 0) - || ((size + iPtr->appendUsed) >= iPtr->appendAvl)) { - SetupAppendBuffer(iPtr, size+iPtr->appendUsed); - } - - /* - * Convert the string into a list element and copy it to the - * buffer that's forming, with a space separator if needed. - */ - - dst = iPtr->appendResult + iPtr->appendUsed; - if (TclNeedSpace(iPtr->appendResult, dst)) { - iPtr->appendUsed++; - *dst = ' '; - dst++; - } - iPtr->appendUsed += Tcl_ConvertElement(string, dst, flags); -} - -/* - *---------------------------------------------------------------------- - * - * SetupAppendBuffer -- - * - * This procedure makes sure that there is an append buffer properly - * initialized, if necessary, from the interpreter's result, and - * that it has at least enough room to accommodate newSpace new - * bytes of information. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -SetupAppendBuffer(iPtr, newSpace) - Interp *iPtr; /* Interpreter whose result is being set up. */ - int newSpace; /* Make sure that at least this many bytes - * of new information may be added. */ -{ - int totalSpace; - - /* - * Make the append buffer larger, if that's necessary, then copy the - * result into the append buffer and make the append buffer the official - * Tcl result. - */ - - if (iPtr->result != iPtr->appendResult) { - /* - * If an oversized buffer was used recently, then free it up - * so we go back to a smaller buffer. This avoids tying up - * memory forever after a large operation. - */ - - if (iPtr->appendAvl > 500) { - ckfree(iPtr->appendResult); - iPtr->appendResult = NULL; - iPtr->appendAvl = 0; - } - iPtr->appendUsed = strlen(iPtr->result); - } else if (iPtr->result[iPtr->appendUsed] != 0) { - /* - * Most likely someone has modified a result created by - * Tcl_AppendResult et al. so that it has a different size. - * Just recompute the size. - */ - - iPtr->appendUsed = strlen(iPtr->result); - } - - totalSpace = newSpace + iPtr->appendUsed; - if (totalSpace >= iPtr->appendAvl) { - char *new; - - if (totalSpace < 100) { - totalSpace = 200; - } else { - totalSpace *= 2; - } - new = (char *) ckalloc((unsigned) totalSpace); - strcpy(new, iPtr->result); - if (iPtr->appendResult != NULL) { - ckfree(iPtr->appendResult); - } - iPtr->appendResult = new; - iPtr->appendAvl = totalSpace; - } else if (iPtr->result != iPtr->appendResult) { - strcpy(iPtr->appendResult, iPtr->result); - } - - Tcl_FreeResult((Tcl_Interp *) iPtr); - iPtr->result = iPtr->appendResult; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FreeResult -- - * - * This procedure frees up the memory associated with an interpreter's - * string result. It also resets the interpreter's result object. - * Tcl_FreeResult is most commonly used when a procedure is about to - * replace one result value with another. - * - * Results: - * None. - * - * Side effects: - * Frees the memory associated with interp's string result and sets - * interp->freeProc to zero, but does not change interp->result or - * clear error state. Resets interp's result object to an unshared - * empty object. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_FreeResult(interp) - register Tcl_Interp *interp; /* Interpreter for which to free result. */ -{ - register Interp *iPtr = (Interp *) interp; - - if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { - ckfree(iPtr->result); - } else { - (*iPtr->freeProc)(iPtr->result); - } - iPtr->freeProc = 0; - } - - ResetObjResult(iPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ResetResult -- - * - * This procedure resets both the interpreter's string and object - * results. - * - * Results: - * None. - * - * Side effects: - * It resets the result object to an unshared empty object. It - * then restores the interpreter's string result area to its default - * initialized state, freeing up any memory that may have been - * allocated. It also clears any error information for the interpreter. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_ResetResult(interp) - register Tcl_Interp *interp; /* Interpreter for which to clear result. */ -{ - register Interp *iPtr = (Interp *) interp; - - ResetObjResult(iPtr); - if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { - ckfree(iPtr->result); - } else { - (*iPtr->freeProc)(iPtr->result); - } - iPtr->freeProc = 0; - } - iPtr->result = iPtr->resultSpace; - iPtr->resultSpace[0] = 0; - iPtr->flags &= ~(ERR_ALREADY_LOGGED | ERR_IN_PROGRESS | ERROR_CODE_SET); -} - -/* - *---------------------------------------------------------------------- - * - * ResetObjResult -- - * - * Procedure used to reset an interpreter's Tcl result object. - * - * Results: - * None. - * - * Side effects: - * Resets the interpreter's result object to an unshared empty string - * object with ref count one. It does not clear any error information - * in the interpreter. - * - *---------------------------------------------------------------------- - */ - -static void -ResetObjResult(iPtr) - register Interp *iPtr; /* Points to the interpreter whose result - * object should be reset. */ -{ - register Tcl_Obj *objResultPtr = iPtr->objResultPtr; - - if (Tcl_IsShared(objResultPtr)) { - TclDecrRefCount(objResultPtr); - TclNewObj(objResultPtr); - Tcl_IncrRefCount(objResultPtr); - iPtr->objResultPtr = objResultPtr; - } else { - if ((objResultPtr->bytes != NULL) - && (objResultPtr->bytes != tclEmptyStringRep)) { - ckfree((char *) objResultPtr->bytes); - } - objResultPtr->bytes = tclEmptyStringRep; - objResultPtr->length = 0; - if ((objResultPtr->typePtr != NULL) - && (objResultPtr->typePtr->freeIntRepProc != NULL)) { - objResultPtr->typePtr->freeIntRepProc(objResultPtr); - } - objResultPtr->typePtr = (Tcl_ObjType *) NULL; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetErrorCodeVA -- - * - * This procedure is called to record machine-readable information - * about an error that is about to be returned. - * - * Results: - * None. - * - * Side effects: - * The errorCode global variable is modified to hold all of the - * arguments to this procedure, in a list form with each argument - * becoming one element of the list. A flag is set internally - * to remember that errorCode has been set, so the variable doesn't - * get set automatically when the error is returned. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetErrorCodeVA (interp, argList) - Tcl_Interp *interp; /* Interpreter in which to access the errorCode - * variable. */ - va_list argList; /* Variable argument list. */ -{ - char *string; - int flags; - Interp *iPtr = (Interp *) interp; - - /* - * Scan through the arguments one at a time, appending them to - * $errorCode as list elements. - */ - - flags = TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT; - while (1) { - string = va_arg(argList, char *); - if (string == NULL) { - break; - } - (void) Tcl_SetVar2((Tcl_Interp *) iPtr, "errorCode", - (char *) NULL, string, flags); - flags |= TCL_APPEND_VALUE; - } - iPtr->flags |= ERROR_CODE_SET; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetErrorCode -- - * - * This procedure is called to record machine-readable information - * about an error that is about to be returned. - * - * Results: - * None. - * - * Side effects: - * The errorCode global variable is modified to hold all of the - * arguments to this procedure, in a list form with each argument - * becoming one element of the list. A flag is set internally - * to remember that errorCode has been set, so the variable doesn't - * get set automatically when the error is returned. - * - *---------------------------------------------------------------------- - */ - /* VARARGS2 */ -void -Tcl_SetErrorCode TCL_VARARGS_DEF(Tcl_Interp *,arg1) -{ - Tcl_Interp *interp; - va_list argList; - - /* - * Scan through the arguments one at a time, appending them to - * $errorCode as list elements. - */ - - interp = TCL_VARARGS_START(Tcl_Interp *,arg1,argList); - Tcl_SetErrorCodeVA(interp, argList); - va_end(argList); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetObjErrorCode -- - * - * This procedure is called to record machine-readable information - * about an error that is about to be returned. The caller should - * build a list object up and pass it to this routine. - * - * Results: - * None. - * - * Side effects: - * The errorCode global variable is modified to be the new value. - * A flag is set internally to remember that errorCode has been - * set, so the variable doesn't get set automatically when the - * error is returned. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetObjErrorCode(interp, errorObjPtr) - Tcl_Interp *interp; - Tcl_Obj *errorObjPtr; -{ - Interp *iPtr; - - iPtr = (Interp *) interp; - Tcl_SetVar2Ex(interp, "errorCode", NULL, errorObjPtr, TCL_GLOBAL_ONLY); - iPtr->flags |= ERROR_CODE_SET; -} - -/* - *------------------------------------------------------------------------- - * - * TclTransferResult -- - * - * Copy the result (and error information) from one interp to - * another. Used when one interp has caused another interp to - * evaluate a script and then wants to transfer the results back - * to itself. - * - * This routine copies the string reps of the result and error - * information. It does not simply increment the refcounts of the - * result and error information objects themselves. - * It is not legal to exchange objects between interps, because an - * object may be kept alive by one interp, but have an internal rep - * that is only valid while some other interp is alive. - * - * Results: - * The target interp's result is set to a copy of the source interp's - * result. The source's error information "$errorInfo" may be - * appended to the target's error information and the source's error - * code "$errorCode" may be stored in the target's error code. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------- - */ - -void -TclTransferResult(sourceInterp, result, targetInterp) - Tcl_Interp *sourceInterp; /* Interp whose result and error information - * should be moved to the target interp. - * After moving result, this interp's result - * is reset. */ - int result; /* TCL_OK if just the result should be copied, - * TCL_ERROR if both the result and error - * information should be copied. */ - Tcl_Interp *targetInterp; /* Interp where result and error information - * should be stored. If source and target - * are the same, nothing is done. */ -{ - Interp *iPtr; - Tcl_Obj *objPtr; - - if (sourceInterp == targetInterp) { - return; - } - - if (result == TCL_ERROR) { - /* - * An error occurred, so transfer error information from the source - * interpreter to the target interpreter. Setting the flags tells - * the target interp that it has inherited a partial traceback - * chain, not just a simple error message. - */ - - iPtr = (Interp *) sourceInterp; - if ((iPtr->flags & ERR_ALREADY_LOGGED) == 0) { - Tcl_AddErrorInfo(sourceInterp, ""); - } - iPtr->flags &= ~(ERR_ALREADY_LOGGED); - - Tcl_ResetResult(targetInterp); - - objPtr = Tcl_GetVar2Ex(sourceInterp, "errorInfo", NULL, - TCL_GLOBAL_ONLY); - Tcl_SetVar2Ex(targetInterp, "errorInfo", NULL, objPtr, - TCL_GLOBAL_ONLY); - - objPtr = Tcl_GetVar2Ex(sourceInterp, "errorCode", NULL, - TCL_GLOBAL_ONLY); - Tcl_SetVar2Ex(targetInterp, "errorCode", NULL, objPtr, - TCL_GLOBAL_ONLY); - - ((Interp *) targetInterp)->flags |= (ERR_IN_PROGRESS | ERROR_CODE_SET); - } - - ((Interp *) targetInterp)->returnCode = ((Interp *) sourceInterp)->returnCode; - Tcl_SetObjResult(targetInterp, Tcl_GetObjResult(sourceInterp)); - Tcl_ResetResult(sourceInterp); -} diff --git a/generic/tclScan.c b/generic/tclScan.c deleted file mode 100644 index 92b192c..0000000 --- a/generic/tclScan.c +++ /dev/null @@ -1,1032 +0,0 @@ -/* - * tclScan.c -- - * - * This file contains the implementation of the "scan" command. - * - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclScan.c,v 1.2 1999/04/16 00:46:53 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * Flag values used by Tcl_ScanObjCmd. - */ - -#define SCAN_NOSKIP 0x1 /* Don't skip blanks. */ -#define SCAN_SUPPRESS 0x2 /* Suppress assignment. */ -#define SCAN_UNSIGNED 0x4 /* Read an unsigned value. */ -#define SCAN_WIDTH 0x8 /* A width value was supplied. */ - -#define SCAN_SIGNOK 0x10 /* A +/- character is allowed. */ -#define SCAN_NODIGITS 0x20 /* No digits have been scanned. */ -#define SCAN_NOZERO 0x40 /* No zero digits have been scanned. */ -#define SCAN_XOK 0x80 /* An 'x' is allowed. */ -#define SCAN_PTOK 0x100 /* Decimal point is allowed. */ -#define SCAN_EXPOK 0x200 /* An exponent is allowed. */ - - -/* - * The following structure contains the information associated with - * a character set. - */ - -typedef struct CharSet { - int exclude; /* 1 if this is an exclusion set. */ - int nchars; - Tcl_UniChar *chars; - int nranges; - struct Range { - Tcl_UniChar start; - Tcl_UniChar end; - } *ranges; -} CharSet; - -/* - * Declarations for functions used only in this file. - */ - -static char * BuildCharSet _ANSI_ARGS_((CharSet *cset, char *format)); -static int CharInSet _ANSI_ARGS_((CharSet *cset, int ch)); -static void ReleaseCharSet _ANSI_ARGS_((CharSet *cset)); -static int ValidateFormat _ANSI_ARGS_((Tcl_Interp *interp, char *format, - int numVars)); - -/* - *---------------------------------------------------------------------- - * - * BuildCharSet -- - * - * This function examines a character set format specification - * and builds a CharSet containing the individual characters and - * character ranges specified. - * - * Results: - * Returns the next format position. - * - * Side effects: - * Initializes the charset. - * - *---------------------------------------------------------------------- - */ - -static char * -BuildCharSet(cset, format) - CharSet *cset; - char *format; /* Points to first char of set. */ -{ - Tcl_UniChar ch, start; - int offset, nranges; - char *end; - - memset(cset, 0, sizeof(CharSet)); - - offset = Tcl_UtfToUniChar(format, &ch); - if (ch == '^') { - cset->exclude = 1; - format += offset; - offset = Tcl_UtfToUniChar(format, &ch); - } - end = format + offset; - - /* - * Find the close bracket so we can overallocate the set. - */ - - if (ch == ']') { - end += Tcl_UtfToUniChar(end, &ch); - } - nranges = 0; - while (ch != ']') { - if (ch == '-') { - nranges++; - } - end += Tcl_UtfToUniChar(end, &ch); - } - - cset->chars = (Tcl_UniChar *) ckalloc(sizeof(Tcl_UniChar) - * (end - format - 1)); - if (nranges > 0) { - cset->ranges = (struct Range *) ckalloc(sizeof(struct Range)*nranges); - } else { - cset->ranges = NULL; - } - - /* - * Now build the character set. - */ - - cset->nchars = cset->nranges = 0; - format += Tcl_UtfToUniChar(format, &ch); - start = ch; - if (ch == ']' || ch == '-') { - cset->chars[cset->nchars++] = ch; - format += Tcl_UtfToUniChar(format, &ch); - } - while (ch != ']') { - if (*format == '-') { - /* - * This may be the first character of a range, so don't add - * it yet. - */ - - start = ch; - } else if (ch == '-') { - /* - * Check to see if this is the last character in the set, in which - * case it is not a range and we should add the previous character - * as well as the dash. - */ - - if (*format == ']') { - cset->chars[cset->nchars++] = start; - cset->chars[cset->nchars++] = ch; - } else { - format += Tcl_UtfToUniChar(format, &ch); - - /* - * Check to see if the range is in reverse order. - */ - - if (start < ch) { - cset->ranges[cset->nranges].start = start; - cset->ranges[cset->nranges].end = ch; - } else { - cset->ranges[cset->nranges].start = ch; - cset->ranges[cset->nranges].end = start; - } - cset->nranges++; - } - } else { - cset->chars[cset->nchars++] = ch; - } - format += Tcl_UtfToUniChar(format, &ch); - } - return format; -} - -/* - *---------------------------------------------------------------------- - * - * CharInSet -- - * - * Check to see if a character matches the given set. - * - * Results: - * Returns non-zero if the character matches the given set. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -CharInSet(cset, c) - CharSet *cset; - int c; /* Character to test, passed as int because - * of non-ANSI prototypes. */ -{ - Tcl_UniChar ch = (Tcl_UniChar) c; - int i, match = 0; - for (i = 0; i < cset->nchars; i++) { - if (cset->chars[i] == ch) { - match = 1; - break; - } - } - if (!match) { - for (i = 0; i < cset->nranges; i++) { - if ((cset->ranges[i].start <= ch) - && (ch <= cset->ranges[i].end)) { - match = 1; - break; - } - } - } - return (cset->exclude ? !match : match); -} - -/* - *---------------------------------------------------------------------- - * - * ReleaseCharSet -- - * - * Free the storage associated with a character set. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -ReleaseCharSet(cset) - CharSet *cset; -{ - ckfree((char *)cset->chars); - if (cset->ranges) { - ckfree((char *)cset->ranges); - } -} - -/* - *---------------------------------------------------------------------- - * - * ValidateFormat -- - * - * Parse the format string and verify that it is properly formed - * and that there are exactly enough variables on the command line. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * May place an error in the interpreter result. - * - *---------------------------------------------------------------------- - */ - -static int -ValidateFormat(interp, format, numVars) - Tcl_Interp *interp; /* Current interpreter. */ - char *format; /* The format string. */ - int numVars; /* The number of variables passed to the - * scan command. */ -{ - int gotXpg, gotSequential, value, i, flags; - char *end; - Tcl_UniChar ch; - int *nassign = (int*)ckalloc(sizeof(int) * numVars); - int objIndex; - - /* - * Initialize an array that records the number of times a variable - * is assigned to by the format string. We use this to detect if - * a variable is multiply assigned or left unassigned. - */ - - for (i = 0; i < numVars; i++) { - nassign[i] = 0; - } - - objIndex = gotXpg = gotSequential = 0; - - while (*format != '\0') { - format += Tcl_UtfToUniChar(format, &ch); - - flags = 0; - - if (ch != '%') { - continue; - } - format += Tcl_UtfToUniChar(format, &ch); - if (ch == '%') { - continue; - } - if (ch == '*') { - flags |= SCAN_SUPPRESS; - format += Tcl_UtfToUniChar(format, &ch); - goto xpgCheckDone; - } - - if ((ch < 0x80) && isdigit(UCHAR(ch))) { /* INTL: "C" locale. */ - /* - * Check for an XPG3-style %n$ specification. Note: there - * must not be a mixture of XPG3 specs and non-XPG3 specs - * in the same format string. - */ - - value = strtoul(format-1, &end, 10); /* INTL: "C" locale. */ - if (*end != '$') { - goto notXpg; - } - format = end+1; - format += Tcl_UtfToUniChar(format, &ch); - gotXpg = 1; - if (gotSequential) { - goto mixedXPG; - } - objIndex = value - 1; - if ((objIndex < 0) || (objIndex >= numVars)) { - goto badIndex; - } - goto xpgCheckDone; - } - - notXpg: - gotSequential = 1; - if (gotXpg) { - mixedXPG: - Tcl_SetResult(interp, - "cannot mix \"%\" and \"%n$\" conversion specifiers", - TCL_STATIC); - goto error; - } - - xpgCheckDone: - /* - * Parse any width specifier. - */ - - if ((ch < 0x80) && isdigit(UCHAR(ch))) { /* INTL: "C" locale. */ - value = strtoul(format-1, &format, 10); /* INTL: "C" locale. */ - flags |= SCAN_WIDTH; - format += Tcl_UtfToUniChar(format, &ch); - } - - /* - * Ignore size specifier. - */ - - if ((ch == 'l') || (ch == 'L') || (ch == 'h')) { - format += Tcl_UtfToUniChar(format, &ch); - } - - if (!(flags & SCAN_SUPPRESS) && objIndex >= numVars) { - goto badIndex; - } - - /* - * Handle the various field types. - */ - - switch (ch) { - case 'n': - case 'd': - case 'i': - case 'o': - case 'x': - case 'u': - case 'f': - case 'e': - case 'g': - case 's': - break; - case 'c': - if (flags & SCAN_WIDTH) { - Tcl_SetResult(interp, "field width may not be specified in %c conversion", TCL_STATIC); - goto error; - } - break; - case '[': - if (*format == '\0') { - goto badSet; - } - format += Tcl_UtfToUniChar(format, &ch); - if (ch == '^') { - if (*format == '\0') { - goto badSet; - } - format += Tcl_UtfToUniChar(format, &ch); - } - if (ch == ']') { - if (*format == '\0') { - goto badSet; - } - format += Tcl_UtfToUniChar(format, &ch); - } - while (ch != ']') { - if (*format == '\0') { - goto badSet; - } - format += Tcl_UtfToUniChar(format, &ch); - } - break; - badSet: - Tcl_SetResult(interp, "unmatched [ in format string", - TCL_STATIC); - goto error; - default: - { - char buf[TCL_UTF_MAX+1]; - - buf[Tcl_UniCharToUtf(ch, buf)] = '\0'; - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad scan conversion character \"", buf, "\"", NULL); - goto error; - } - } - if (!(flags & SCAN_SUPPRESS)) { - nassign[objIndex]++; - objIndex++; - } - } - - /* - * Verify that all of the variable were assigned exactly once. - */ - - for (i = 0; i < numVars; i++) { - if (nassign[i] > 1) { - Tcl_SetResult(interp, "variable is assigned by multiple \"%n$\" conversion specifiers", TCL_STATIC); - goto error; - } else if (nassign[i] == 0) { - Tcl_SetResult(interp, "variable is not assigend by any conversion specifiers", TCL_STATIC); - goto error; - } - } - - ckfree((char *)nassign); - return TCL_OK; - - badIndex: - if (gotXpg) { - Tcl_SetResult(interp, "\"%n$\" argument index out of range", - TCL_STATIC); - } else { - Tcl_SetResult(interp, - "different numbers of variable names and field specifiers", - TCL_STATIC); - } - - error: - ckfree((char *)nassign); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ScanObjCmd -- - * - * This procedure is invoked to process the "scan" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ScanObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *format; - int numVars, nconversions; - int objIndex, offset, i, value, result, code; - char *string, *end, *baseString; - char op = 0; - int base = 0; - int underflow = 0; - size_t width; - long (*fn)() = NULL; - Tcl_UniChar ch, sch; - Tcl_Obj **objs, *objPtr; - int flags; - char buf[513]; /* Temporary buffer to hold scanned - * number strings before they are - * passed to strtoul. */ - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 1, objv, - "string format ?varName varName ...?"); - return TCL_ERROR; - } - - format = Tcl_GetStringFromObj(objv[2], NULL); - numVars = objc-3; - - /* - * Check for errors in the format string. - */ - - if (ValidateFormat(interp, format, numVars) == TCL_ERROR) { - return TCL_ERROR; - } - - /* - * Allocate space for the result objects. - */ - - objs = (Tcl_Obj **) ckalloc(sizeof(Tcl_Obj*) * numVars); - for (i = 0; i < numVars; i++) { - objs[i] = NULL; - } - - string = Tcl_GetStringFromObj(objv[1], NULL); - baseString = string; - - /* - * Iterate over the format string filling in the result objects until - * we reach the end of input, the end of the format string, or there - * is a mismatch. - */ - - objIndex = 0; - nconversions = 0; - while (*format != '\0') { - format += Tcl_UtfToUniChar(format, &ch); - - flags = 0; - - /* - * If we see whitespace in the format, skip whitespace in the string. - */ - - if (Tcl_UniCharIsSpace(ch)) { - offset = Tcl_UtfToUniChar(string, &sch); - while (Tcl_UniCharIsSpace(sch)) { - if (*string == '\0') { - goto done; - } - string += offset; - offset = Tcl_UtfToUniChar(string, &sch); - } - continue; - } - - if (ch != '%') { - literal: - if (*string == '\0') { - underflow = 1; - goto done; - } - string += Tcl_UtfToUniChar(string, &sch); - if (ch != sch) { - goto done; - } - continue; - } - - format += Tcl_UtfToUniChar(format, &ch); - if (ch == '%') { - goto literal; - } - - /* - * Check for assignment suppression ('*') or an XPG3-style - * assignment ('%n$'). - */ - - if (ch == '*') { - flags |= SCAN_SUPPRESS; - format += Tcl_UtfToUniChar(format, &ch); - } else if ((ch < 0x80) && isdigit(UCHAR(ch))) { /* INTL: "C" locale. */ - value = strtoul(format-1, &end, 10); /* INTL: "C" locale. */ - if (*end == '$') { - format = end+1; - format += Tcl_UtfToUniChar(format, &ch); - objIndex = value - 1; - } - } - - /* - * Parse any width specifier. - */ - - if ((ch < 0x80) && isdigit(UCHAR(ch))) { /* INTL: "C" locale. */ - width = strtoul(format-1, &format, 10); /* INTL: "C" locale. */ - format += Tcl_UtfToUniChar(format, &ch); - } else { - width = 0; - } - - /* - * Ignore size specifier. - */ - - if ((ch == 'l') || (ch == 'L') || (ch == 'h')) { - format += Tcl_UtfToUniChar(format, &ch); - } - - /* - * Handle the various field types. - */ - - switch (ch) { - case 'n': - if (!(flags & SCAN_SUPPRESS)) { - objPtr = Tcl_NewIntObj(string - baseString); - Tcl_IncrRefCount(objPtr); - objs[objIndex++] = objPtr; - } - nconversions++; - continue; - - case 'd': - op = 'i'; - base = 10; - fn = (long (*)())strtol; - break; - case 'i': - op = 'i'; - base = 0; - fn = (long (*)())strtol; - break; - case 'o': - op = 'i'; - base = 8; - fn = (long (*)())strtol; - break; - case 'x': - op = 'i'; - base = 16; - fn = (long (*)())strtol; - break; - case 'u': - op = 'i'; - base = 10; - flags |= SCAN_UNSIGNED; - fn = (long (*)())strtoul; - break; - - case 'f': - case 'e': - case 'g': - op = 'f'; - break; - - case 's': - op = 's'; - break; - - case 'c': - op = 'c'; - flags |= SCAN_NOSKIP; - break; - case '[': - op = '['; - flags |= SCAN_NOSKIP; - break; - } - - /* - * At this point, we will need additional characters from the - * string to proceed. - */ - - if (*string == '\0') { - underflow = 1; - goto done; - } - - /* - * Skip any leading whitespace at the beginning of a field unless - * the format suppresses this behavior. - */ - - if (!(flags & SCAN_NOSKIP)) { - while (*string != '\0') { - offset = Tcl_UtfToUniChar(string, &sch); - if (!Tcl_UniCharIsSpace(sch)) { - break; - } - string += offset; - } - if (*string == '\0') { - underflow = 1; - goto done; - } - } - - /* - * Perform the requested scanning operation. - */ - - switch (op) { - case 's': - /* - * Scan a string up to width characters or whitespace. - */ - - if (width == 0) { - width = (size_t) ~0; - } - end = string; - while (*end != '\0') { - offset = Tcl_UtfToUniChar(end, &sch); - if (Tcl_UniCharIsSpace(sch)) { - break; - } - end += offset; - if (--width == 0) { - break; - } - } - if (!(flags & SCAN_SUPPRESS)) { - objPtr = Tcl_NewStringObj(string, end-string); - Tcl_IncrRefCount(objPtr); - objs[objIndex++] = objPtr; - } - string = end; - break; - - case '[': { - CharSet cset; - - if (width == 0) { - width = (size_t) ~0; - } - end = string; - - format = BuildCharSet(&cset, format); - while (*end != '\0') { - offset = Tcl_UtfToUniChar(end, &sch); - if (!CharInSet(&cset, (int)sch)) { - break; - } - end += offset; - if (--width == 0) { - break; - } - } - ReleaseCharSet(&cset); - - if (!(flags & SCAN_SUPPRESS)) { - objPtr = Tcl_NewStringObj(string, end-string); - Tcl_IncrRefCount(objPtr); - objs[objIndex++] = objPtr; - } - string = end; - - break; - } - case 'c': - /* - * Scan a single Unicode character. - */ - - string += Tcl_UtfToUniChar(string, &sch); - if (!(flags & SCAN_SUPPRESS)) { - objPtr = Tcl_NewIntObj((int)sch); - Tcl_IncrRefCount(objPtr); - objs[objIndex++] = objPtr; - } - break; - - case 'i': - /* - * Scan an unsigned or signed integer. - */ - - if ((width == 0) || (width > sizeof(buf) - 1)) { - width = sizeof(buf) - 1; - } - flags |= SCAN_SIGNOK | SCAN_NODIGITS | SCAN_NOZERO; - for (end = buf; width > 0; width--) { - switch (*string) { - /* - * The 0 digit has special meaning at the beginning of - * a number. If we are unsure of the base, it - * indicates that we are in base 8 or base 16 (if it is - * followed by an 'x'). - */ - case '0': - if (base == 0) { - base = 8; - flags |= SCAN_XOK; - } - if (flags & SCAN_NOZERO) { - flags &= ~(SCAN_SIGNOK | SCAN_NODIGITS - | SCAN_NOZERO); - } else { - flags &= ~(SCAN_SIGNOK | SCAN_XOK - | SCAN_NODIGITS); - } - goto addToInt; - - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': - if (base == 0) { - base = 10; - } - flags &= ~(SCAN_SIGNOK | SCAN_XOK | SCAN_NODIGITS); - goto addToInt; - - case '8': case '9': - if (base == 0) { - base = 10; - } - if (base <= 8) { - break; - } - flags &= ~(SCAN_SIGNOK | SCAN_XOK | SCAN_NODIGITS); - goto addToInt; - - case 'A': case 'B': case 'C': - case 'D': case 'E': case 'F': - case 'a': case 'b': case 'c': - case 'd': case 'e': case 'f': - if (base <= 10) { - break; - } - flags &= ~(SCAN_SIGNOK | SCAN_XOK | SCAN_NODIGITS); - goto addToInt; - - case '+': case '-': - if (flags & SCAN_SIGNOK) { - flags &= ~SCAN_SIGNOK; - goto addToInt; - } - break; - - case 'x': case 'X': - if ((flags & SCAN_XOK) && (end == buf+1)) { - base = 16; - flags &= ~SCAN_XOK; - goto addToInt; - } - break; - } - - /* - * We got an illegal character so we are done accumulating. - */ - - break; - - addToInt: - /* - * Add the character to the temporary buffer. - */ - - *end++ = *string++; - if (*string == '\0') { - break; - } - } - - /* - * Check to see if we need to back up because we only got a - * sign or a trailing x after a 0. - */ - - if (flags & SCAN_NODIGITS) { - if (*string == '\0') { - underflow = 1; - } - goto done; - } else if (end[-1] == 'x' || end[-1] == 'X') { - end--; - string--; - } - - - /* - * Scan the value from the temporary buffer. If we are - * returning a large unsigned value, we have to convert it back - * to a string since Tcl only supports signed values. - */ - - if (!(flags & SCAN_SUPPRESS)) { - *end = '\0'; - value = (int) (*fn)(buf, NULL, base); - if ((flags & SCAN_UNSIGNED) && (value < 0)) { - sprintf(buf, "%u", value); /* INTL: ISO digit */ - objPtr = Tcl_NewStringObj(buf, -1); - } else { - objPtr = Tcl_NewIntObj(value); - } - Tcl_IncrRefCount(objPtr); - objs[objIndex++] = objPtr; - } - - break; - - case 'f': - /* - * Scan a floating point number - */ - - if ((width == 0) || (width > sizeof(buf) - 1)) { - width = sizeof(buf) - 1; - } - flags |= SCAN_SIGNOK | SCAN_NODIGITS | SCAN_PTOK | SCAN_EXPOK; - for (end = buf; width > 0; width--) { - switch (*string) { - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - flags &= ~(SCAN_SIGNOK | SCAN_NODIGITS); - goto addToFloat; - case '+': case '-': - if (flags & SCAN_SIGNOK) { - flags &= ~SCAN_SIGNOK; - goto addToFloat; - } - break; - case '.': - if (flags & SCAN_PTOK) { - flags &= ~(SCAN_SIGNOK | SCAN_PTOK); - goto addToFloat; - } - break; - case 'e': case 'E': - /* - * An exponent is not allowed until there has - * been at least one digit. - */ - - if ((flags & (SCAN_NODIGITS | SCAN_EXPOK)) - == SCAN_EXPOK) { - flags = (flags & ~(SCAN_EXPOK|SCAN_PTOK)) - | SCAN_SIGNOK | SCAN_NODIGITS; - goto addToFloat; - } - break; - } - - /* - * We got an illegal character so we are done accumulating. - */ - - break; - - addToFloat: - /* - * Add the character to the temporary buffer. - */ - - *end++ = *string++; - if (*string == '\0') { - break; - } - } - - /* - * Check to see if we need to back up because we saw a - * trailing 'e' or sign. - */ - - if (flags & SCAN_NODIGITS) { - if (flags & SCAN_EXPOK) { - /* - * There were no digits at all so scanning has - * failed and we are done. - */ - if (*string == '\0') { - underflow = 1; - } - goto done; - } - - /* - * We got a bad exponent ('e' and maybe a sign). - */ - - end--; - string--; - if (*end != 'e' && *end != 'E') { - end--; - string--; - } - } - - /* - * Scan the value from the temporary buffer. - */ - - if (!(flags & SCAN_SUPPRESS)) { - double dvalue; - *end = '\0'; - dvalue = strtod(buf, NULL); - objPtr = Tcl_NewDoubleObj(dvalue); - Tcl_IncrRefCount(objPtr); - objs[objIndex++] = objPtr; - } - break; - } - nconversions++; - } - - done: - result = 0; - code = TCL_OK; - - for (i = 0; i < numVars; i++) { - if (objs[i] != NULL) { - result++; - if (Tcl_ObjSetVar2(interp, objv[i+3], NULL, objs[i], 0) == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "couldn't set variable \"", - Tcl_GetString(objv[i+3]), "\"", (char *) NULL); - code = TCL_ERROR; - } - Tcl_DecrRefCount(objs[i]); - } - } - ckfree((char*) objs); - if (code == TCL_OK) { - if (underflow && (nconversions == 0)) { - result = -1; - } - Tcl_SetObjResult(interp, Tcl_NewIntObj(result)); - } - return code; -} diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c deleted file mode 100644 index c0261c7..0000000 --- a/generic/tclStringObj.c +++ /dev/null @@ -1,655 +0,0 @@ -/* - * tclStringObj.c -- - * - * This file contains procedures that implement string operations - * on Tcl objects. To do this efficiently (i.e. to allow many - * appends to be done to an object without constantly reallocating - * the space for the string representation) we overallocate the - * space for the string and use the internal representation to keep - * track of the extra space. Objects with this internal - * representation are called "expandable string objects". - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclStringObj.c,v 1.4 1999/04/16 00:46:53 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * Prototypes for procedures defined later in this file: - */ - -static void ConvertToStringType _ANSI_ARGS_((Tcl_Obj *objPtr)); -static void DupStringInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr, - Tcl_Obj *copyPtr)); -static int SetStringFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static void UpdateStringOfString _ANSI_ARGS_((Tcl_Obj *objPtr)); - -/* - * The structure below defines the string Tcl object type by means of - * procedures that can be invoked by generic object code. - */ - -Tcl_ObjType tclStringType = { - "string", /* name */ - (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */ - DupStringInternalRep, /* dupIntRepProc */ - UpdateStringOfString, /* updateStringProc */ - SetStringFromAny /* setFromAnyProc */ -}; - -/* - *---------------------------------------------------------------------- - * - * Tcl_NewStringObj -- - * - * This procedure is normally called when not debugging: i.e., when - * TCL_MEM_DEBUG is not defined. It creates a new string object and - * initializes it from the byte pointer and length arguments. - * - * When TCL_MEM_DEBUG is defined, this procedure just returns the - * result of calling the debugging version Tcl_DbNewStringObj. - * - * Results: - * A newly created string object is returned that has ref count zero. - * - * Side effects: - * The new object's internal string representation will be set to a - * copy of the length bytes starting at "bytes". If "length" is - * negative, use bytes up to the first NULL byte; i.e., assume "bytes" - * points to a C-style NULL-terminated string. The object's type is set - * to NULL. An extra NULL is added to the end of the new object's byte - * array. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG -#undef Tcl_NewStringObj - -Tcl_Obj * -Tcl_NewStringObj(bytes, length) - CONST char *bytes; /* Points to the first of the length bytes - * used to initialize the new object. */ - int length; /* The number of bytes to copy from "bytes" - * when initializing the new object. If - * negative, use bytes up to the first - * NULL byte. */ -{ - return Tcl_DbNewStringObj(bytes, length, "unknown", 0); -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_NewStringObj(bytes, length) - CONST char *bytes; /* Points to the first of the length bytes - * used to initialize the new object. */ - int length; /* The number of bytes to copy from "bytes" - * when initializing the new object. If - * negative, use bytes up to the first - * NULL byte. */ -{ - register Tcl_Obj *objPtr; - - if (length < 0) { - length = (bytes? strlen(bytes) : 0); - } - TclNewObj(objPtr); - TclInitStringRep(objPtr, bytes, length); - return objPtr; -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_DbNewStringObj -- - * - * This procedure is normally called when debugging: i.e., when - * TCL_MEM_DEBUG is defined. It creates new string objects. It is the - * same as the Tcl_NewStringObj procedure above except that it calls - * Tcl_DbCkalloc directly with the file name and line number from its - * caller. This simplifies debugging since then the checkmem command - * will report the correct file name and line number when reporting - * objects that haven't been freed. - * - * When TCL_MEM_DEBUG is not defined, this procedure just returns the - * result of calling Tcl_NewStringObj. - * - * Results: - * A newly created string object is returned that has ref count zero. - * - * Side effects: - * The new object's internal string representation will be set to a - * copy of the length bytes starting at "bytes". If "length" is - * negative, use bytes up to the first NULL byte; i.e., assume "bytes" - * points to a C-style NULL-terminated string. The object's type is set - * to NULL. An extra NULL is added to the end of the new object's byte - * array. - * - *---------------------------------------------------------------------- - */ - -#ifdef TCL_MEM_DEBUG - -Tcl_Obj * -Tcl_DbNewStringObj(bytes, length, file, line) - CONST char *bytes; /* Points to the first of the length bytes - * used to initialize the new object. */ - int length; /* The number of bytes to copy from "bytes" - * when initializing the new object. If - * negative, use bytes up to the first - * NULL byte. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - register Tcl_Obj *objPtr; - - if (length < 0) { - length = (bytes? strlen(bytes) : 0); - } - TclDbNewObj(objPtr, file, line); - TclInitStringRep(objPtr, bytes, length); - return objPtr; -} - -#else /* if not TCL_MEM_DEBUG */ - -Tcl_Obj * -Tcl_DbNewStringObj(bytes, length, file, line) - CONST char *bytes; /* Points to the first of the length bytes - * used to initialize the new object. */ - register int length; /* The number of bytes to copy from "bytes" - * when initializing the new object. If - * negative, use bytes up to the first - * NULL byte. */ - char *file; /* The name of the source file calling this - * procedure; used for debugging. */ - int line; /* Line number in the source file; used - * for debugging. */ -{ - return Tcl_NewStringObj(bytes, length); -} -#endif /* TCL_MEM_DEBUG */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetStringObj -- - * - * Modify an object to hold a string that is a copy of the bytes - * indicated by the byte pointer and length arguments. - * - * Results: - * None. - * - * Side effects: - * The object's string representation will be set to a copy of - * the "length" bytes starting at "bytes". If "length" is negative, use - * bytes up to the first NULL byte; i.e., assume "bytes" points to a - * C-style NULL-terminated string. The object's old string and internal - * representations are freed and the object's type is set NULL. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetStringObj(objPtr, bytes, length) - register Tcl_Obj *objPtr; /* Object whose internal rep to init. */ - char *bytes; /* Points to the first of the length bytes - * used to initialize the object. */ - register int length; /* The number of bytes to copy from "bytes" - * when initializing the object. If - * negative, use bytes up to the first - * NULL byte.*/ -{ - register Tcl_ObjType *oldTypePtr = objPtr->typePtr; - - /* - * Free any old string rep, then set the string rep to a copy of - * the length bytes starting at "bytes". - */ - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetStringObj called with shared object"); - } - - Tcl_InvalidateStringRep(objPtr); - if (length < 0) { - length = (bytes? strlen(bytes) : 0); - } - TclInitStringRep(objPtr, bytes, length); - - /* - * Set the type to NULL and free any internal rep for the old type. - */ - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - objPtr->typePtr = NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetObjLength -- - * - * This procedure changes the length of the string representation - * of an object. - * - * Results: - * None. - * - * Side effects: - * If the size of objPtr's string representation is greater than - * length, then it is reduced to length and a new terminating null - * byte is stored in the strength. If the length of the string - * representation is greater than length, the storage space is - * reallocated to the given length; a null byte is stored at the - * end, but other bytes past the end of the original string - * representation are undefined. The object's internal - * representation is changed to "expendable string". - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetObjLength(objPtr, length) - register Tcl_Obj *objPtr; /* Pointer to object. This object must - * not currently be shared. */ - register int length; /* Number of bytes desired for string - * representation of object, not including - * terminating null byte. */ -{ - char *new; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_SetObjLength called with shared object"); - } - if (objPtr->typePtr != &tclStringType) { - ConvertToStringType(objPtr); - } - - if ((long)length > objPtr->internalRep.longValue) { - /* - * Not enough space in current string. Reallocate the string - * space and free the old string. - */ - - new = (char *) ckalloc((unsigned) (length+1)); - if (objPtr->bytes != NULL) { - memcpy((VOID *) new, (VOID *) objPtr->bytes, - (size_t) objPtr->length); - Tcl_InvalidateStringRep(objPtr); - } - objPtr->bytes = new; - objPtr->internalRep.longValue = (long) length; - } - objPtr->length = length; - if ((objPtr->bytes != NULL) && (objPtr->bytes != tclEmptyStringRep)) { - objPtr->bytes[length] = 0; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendToObj -- - * - * This procedure appends a sequence of bytes to an object. - * - * Results: - * None. - * - * Side effects: - * The bytes at *bytes are appended to the string representation - * of objPtr. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AppendToObj(objPtr, bytes, length) - register Tcl_Obj *objPtr; /* Points to the object to append to. */ - char *bytes; /* Points to the bytes to append to the - * object. */ - register int length; /* The number of bytes to append from - * "bytes". If < 0, then append all bytes - * up to NULL byte. */ -{ - int newLength, oldLength; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_AppendToObj called with shared object"); - } - if (objPtr->typePtr != &tclStringType) { - ConvertToStringType(objPtr); - } - if (length < 0) { - length = (bytes? strlen(bytes) : 0); - } - if (length == 0) { - return; - } - oldLength = objPtr->length; - newLength = length + oldLength; - if ((long)newLength > objPtr->internalRep.longValue) { - /* - * There isn't currently enough space in the string - * representation so allocate additional space. In fact, - * overallocate so that there is room for future growth without - * having to reallocate again. - */ - - Tcl_SetObjLength(objPtr, 2*newLength); - } - if (length > 0) { - memcpy((VOID *) (objPtr->bytes + oldLength), (VOID *) bytes, - (size_t) length); - objPtr->length = newLength; - objPtr->bytes[objPtr->length] = 0; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendObjToObj -- - * - * This procedure appends the string rep of one object to another. - * - * Results: - * None. - * - * Side effects: - * The string rep of appendObjPtr is appended to the string - * representation of objPtr. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AppendObjToObj(objPtr, appendObjPtr) - Tcl_Obj *objPtr; /* Points to the object to append to. */ - Tcl_Obj *appendObjPtr; /* Object to append. */ -{ - int length; - char *stringRep; - - stringRep = Tcl_GetStringFromObj(appendObjPtr, &length); - Tcl_AppendToObj(objPtr, stringRep, length); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendStringsToObjVA -- - * - * This procedure appends one or more null-terminated strings - * to an object. - * - * Results: - * None. - * - * Side effects: - * The contents of all the string arguments are appended to the - * string representation of objPtr. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AppendStringsToObjVA (objPtr, argList) - Tcl_Obj *objPtr; /* Points to the object to append to. */ - va_list argList; /* Variable argument list. */ -{ - va_list tmpArgList; - int newLength, oldLength; - register char *string, *dst; - - if (Tcl_IsShared(objPtr)) { - panic("Tcl_AppendStringsToObj called with shared object"); - } - if (objPtr->typePtr != &tclStringType) { - ConvertToStringType(objPtr); - } - - /* - * Figure out how much space is needed for all the strings, and - * expand the string representation if it isn't big enough. If no - * bytes would be appended, just return. - */ - - tmpArgList = argList; - newLength = oldLength = objPtr->length; - while (1) { - string = va_arg(tmpArgList, char *); - if (string == NULL) { - break; - } - newLength += strlen(string); - } - if (newLength == oldLength) { - return; - } - - if ((long)newLength > objPtr->internalRep.longValue) { - /* - * There isn't currently enough space in the string - * representation so allocate additional space. If the current - * string representation isn't empty (i.e. it looks like we're - * doing a series of appends) then overallocate the space so - * that we won't have to do as much reallocation in the future. - */ - - Tcl_SetObjLength(objPtr, - (objPtr->length == 0) ? newLength : 2*newLength); - } - - /* - * Make a second pass through the arguments, appending all the - * strings to the object. - */ - - dst = objPtr->bytes + oldLength; - while (1) { - string = va_arg(argList, char *); - if (string == NULL) { - break; - } - while (*string != 0) { - *dst = *string; - dst++; - string++; - } - } - - /* - * Add a null byte to terminate the string. However, be careful: - * it's possible that the object is totally empty (if it was empty - * originally and there was nothing to append). In this case dst is - * NULL; just leave everything alone. - */ - - if (dst != NULL) { - *dst = 0; - } - objPtr->length = newLength; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendStringsToObj -- - * - * This procedure appends one or more null-terminated strings - * to an object. - * - * Results: - * None. - * - * Side effects: - * The contents of all the string arguments are appended to the - * string representation of objPtr. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AppendStringsToObj TCL_VARARGS_DEF(Tcl_Obj *,arg1) -{ - register Tcl_Obj *objPtr; - va_list argList; - - objPtr = TCL_VARARGS_START(Tcl_Obj *,arg1,argList); - Tcl_AppendStringsToObjVA(objPtr, argList); - va_end(argList); -} - -/* - *---------------------------------------------------------------------- - * - * ConvertToStringType -- - * - * This procedure converts the internal representation of an object - * to "expandable string" type. - * - * Results: - * None. - * - * Side effects: - * Any old internal reputation for objPtr is freed and the - * internal representation is set to that for an expandable string - * (the field internalRep.longValue holds 1 less than the allocated - * length of objPtr's string representation). - * - *---------------------------------------------------------------------- - */ - -static void -ConvertToStringType(objPtr) - register Tcl_Obj *objPtr; /* Pointer to object. Must have a - * typePtr that isn't &tclStringType. */ -{ - if (objPtr->typePtr != NULL) { - if (objPtr->bytes == NULL) { - objPtr->typePtr->updateStringProc(objPtr); - } - if (objPtr->typePtr->freeIntRepProc != NULL) { - objPtr->typePtr->freeIntRepProc(objPtr); - } - } - objPtr->typePtr = &tclStringType; - if (objPtr->bytes != NULL) { - objPtr->internalRep.longValue = (long)objPtr->length; - } else { - objPtr->internalRep.longValue = 0; - objPtr->length = 0; - } -} - -/* - *---------------------------------------------------------------------- - * - * DupStringInternalRep -- - * - * Initialize the internal representation of a new Tcl_Obj to a - * copy of the internal representation of an existing string object. - * - * Results: - * None. - * - * Side effects: - * copyPtr's internal rep is set to a copy of srcPtr's internal - * representation. - * - *---------------------------------------------------------------------- - */ - -static void -DupStringInternalRep(srcPtr, copyPtr) - register Tcl_Obj *srcPtr; /* Object with internal rep to copy. Must - * have an internal representation of type - * "expandable string". */ - register Tcl_Obj *copyPtr; /* Object with internal rep to set. Must - * not currently have an internal rep.*/ -{ - /* - * Tricky point: the string value was copied by generic object - * management code, so it doesn't contain any extra bytes that - * might exist in the source object. - */ - - copyPtr->internalRep.longValue = (long)copyPtr->length; - copyPtr->typePtr = &tclStringType; -} - -/* - *---------------------------------------------------------------------- - * - * SetStringFromAny -- - * - * Create an internal representation of type "expandable string" - * for an object. - * - * Results: - * This operation always succeeds and returns TCL_OK. - * - * Side effects: - * This procedure does nothing; there is no advantage in converting - * the internal representation now, so we just defer it. - * - *---------------------------------------------------------------------- - */ - -static int -SetStringFromAny(interp, objPtr) - Tcl_Interp *interp; /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr; /* The object to convert. */ -{ - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateStringOfString -- - * - * Update the string representation for an object whose internal - * representation is "expandable string". - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateStringOfString(objPtr) - Tcl_Obj *objPtr; /* Object with string rep to update. */ -{ - /* - * The string is almost always valid already, in which case there's - * nothing for us to do. The only case we have to worry about is if - * the object is totally null. In this case, set the string rep to - * an empty string. - */ - - if (objPtr->bytes == NULL) { - objPtr->bytes = tclEmptyStringRep; - objPtr->length = 0; - } - return; -} diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c deleted file mode 100644 index d11b0b3..0000000 --- a/generic/tclStubInit.c +++ /dev/null @@ -1,687 +0,0 @@ -/* - * tclStubInit.c -- - * - * This file contains the initializers for the Tcl stub vectors. - * - * 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. - * - * RCS: @(#) $Id: tclStubInit.c,v 1.7 1999/04/16 00:46:53 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * Remove macros that will interfere with the definitions below. - */ - -#undef Tcl_Alloc -#undef Tcl_Free -#undef Tcl_Realloc -#undef Tcl_NewBooleanObj -#undef Tcl_NewByteArrayObj -#undef Tcl_NewDoubleObj -#undef Tcl_NewIntObj -#undef Tcl_NewListObj -#undef Tcl_NewLongObj -#undef Tcl_NewObj -#undef Tcl_NewStringObj -#undef Tcl_DumpActiveMemory -#undef Tcl_ValidateAllMemory - -/* - * WARNING: The contents of this file is automatically generated by the - * tools/genStubs.tcl script. Any modifications to the function declarations - * below should be made in the generic/tcl.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -static TclStubHooks tclStubHooks; - -TclStubs tclStubs = { - TCL_STUB_MAGIC, - &tclStubHooks, - Tcl_PkgProvideEx, /* 0 */ - Tcl_PkgRequireEx, /* 1 */ - Tcl_Panic, /* 2 */ - Tcl_Alloc, /* 3 */ - Tcl_Free, /* 4 */ - Tcl_Realloc, /* 5 */ - Tcl_DbCkalloc, /* 6 */ - Tcl_DbCkfree, /* 7 */ - Tcl_DbCkrealloc, /* 8 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - Tcl_CreateFileHandler, /* 9 */ -#endif /* UNIX */ -#ifdef __WIN32__ - NULL, /* 9 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - NULL, /* 9 */ -#endif /* MAC_TCL */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - Tcl_DeleteFileHandler, /* 10 */ -#endif /* UNIX */ -#ifdef __WIN32__ - NULL, /* 10 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - NULL, /* 10 */ -#endif /* MAC_TCL */ - Tcl_SetTimer, /* 11 */ - Tcl_Sleep, /* 12 */ - Tcl_WaitForEvent, /* 13 */ - Tcl_AppendAllObjTypes, /* 14 */ - Tcl_AppendStringsToObj, /* 15 */ - Tcl_AppendToObj, /* 16 */ - Tcl_ConcatObj, /* 17 */ - Tcl_ConvertToType, /* 18 */ - Tcl_DbDecrRefCount, /* 19 */ - Tcl_DbIncrRefCount, /* 20 */ - Tcl_DbIsShared, /* 21 */ - Tcl_DbNewBooleanObj, /* 22 */ - Tcl_DbNewByteArrayObj, /* 23 */ - Tcl_DbNewDoubleObj, /* 24 */ - Tcl_DbNewListObj, /* 25 */ - Tcl_DbNewLongObj, /* 26 */ - Tcl_DbNewObj, /* 27 */ - Tcl_DbNewStringObj, /* 28 */ - Tcl_DuplicateObj, /* 29 */ - TclFreeObj, /* 30 */ - Tcl_GetBoolean, /* 31 */ - Tcl_GetBooleanFromObj, /* 32 */ - Tcl_GetByteArrayFromObj, /* 33 */ - Tcl_GetDouble, /* 34 */ - Tcl_GetDoubleFromObj, /* 35 */ - Tcl_GetIndexFromObj, /* 36 */ - Tcl_GetInt, /* 37 */ - Tcl_GetIntFromObj, /* 38 */ - Tcl_GetLongFromObj, /* 39 */ - Tcl_GetObjType, /* 40 */ - Tcl_GetStringFromObj, /* 41 */ - Tcl_InvalidateStringRep, /* 42 */ - Tcl_ListObjAppendList, /* 43 */ - Tcl_ListObjAppendElement, /* 44 */ - Tcl_ListObjGetElements, /* 45 */ - Tcl_ListObjIndex, /* 46 */ - Tcl_ListObjLength, /* 47 */ - Tcl_ListObjReplace, /* 48 */ - Tcl_NewBooleanObj, /* 49 */ - Tcl_NewByteArrayObj, /* 50 */ - Tcl_NewDoubleObj, /* 51 */ - Tcl_NewIntObj, /* 52 */ - Tcl_NewListObj, /* 53 */ - Tcl_NewLongObj, /* 54 */ - Tcl_NewObj, /* 55 */ - Tcl_NewStringObj, /* 56 */ - Tcl_SetBooleanObj, /* 57 */ - Tcl_SetByteArrayLength, /* 58 */ - Tcl_SetByteArrayObj, /* 59 */ - Tcl_SetDoubleObj, /* 60 */ - Tcl_SetIntObj, /* 61 */ - Tcl_SetListObj, /* 62 */ - Tcl_SetLongObj, /* 63 */ - Tcl_SetObjLength, /* 64 */ - Tcl_SetStringObj, /* 65 */ - Tcl_AddErrorInfo, /* 66 */ - Tcl_AddObjErrorInfo, /* 67 */ - Tcl_AllowExceptions, /* 68 */ - Tcl_AppendElement, /* 69 */ - Tcl_AppendResult, /* 70 */ - Tcl_AsyncCreate, /* 71 */ - Tcl_AsyncDelete, /* 72 */ - Tcl_AsyncInvoke, /* 73 */ - Tcl_AsyncMark, /* 74 */ - Tcl_AsyncReady, /* 75 */ - Tcl_BackgroundError, /* 76 */ - Tcl_Backslash, /* 77 */ - Tcl_BadChannelOption, /* 78 */ - Tcl_CallWhenDeleted, /* 79 */ - Tcl_CancelIdleCall, /* 80 */ - Tcl_Close, /* 81 */ - Tcl_CommandComplete, /* 82 */ - Tcl_Concat, /* 83 */ - Tcl_ConvertElement, /* 84 */ - Tcl_ConvertCountedElement, /* 85 */ - Tcl_CreateAlias, /* 86 */ - Tcl_CreateAliasObj, /* 87 */ - Tcl_CreateChannel, /* 88 */ - Tcl_CreateChannelHandler, /* 89 */ - Tcl_CreateCloseHandler, /* 90 */ - Tcl_CreateCommand, /* 91 */ - Tcl_CreateEventSource, /* 92 */ - Tcl_CreateExitHandler, /* 93 */ - Tcl_CreateInterp, /* 94 */ - Tcl_CreateMathFunc, /* 95 */ - Tcl_CreateObjCommand, /* 96 */ - Tcl_CreateSlave, /* 97 */ - Tcl_CreateTimerHandler, /* 98 */ - Tcl_CreateTrace, /* 99 */ - Tcl_DeleteAssocData, /* 100 */ - Tcl_DeleteChannelHandler, /* 101 */ - Tcl_DeleteCloseHandler, /* 102 */ - Tcl_DeleteCommand, /* 103 */ - Tcl_DeleteCommandFromToken, /* 104 */ - Tcl_DeleteEvents, /* 105 */ - Tcl_DeleteEventSource, /* 106 */ - Tcl_DeleteExitHandler, /* 107 */ - Tcl_DeleteHashEntry, /* 108 */ - Tcl_DeleteHashTable, /* 109 */ - Tcl_DeleteInterp, /* 110 */ - Tcl_DetachPids, /* 111 */ - Tcl_DeleteTimerHandler, /* 112 */ - Tcl_DeleteTrace, /* 113 */ - Tcl_DontCallWhenDeleted, /* 114 */ - Tcl_DoOneEvent, /* 115 */ - Tcl_DoWhenIdle, /* 116 */ - Tcl_DStringAppend, /* 117 */ - Tcl_DStringAppendElement, /* 118 */ - Tcl_DStringEndSublist, /* 119 */ - Tcl_DStringFree, /* 120 */ - Tcl_DStringGetResult, /* 121 */ - Tcl_DStringInit, /* 122 */ - Tcl_DStringResult, /* 123 */ - Tcl_DStringSetLength, /* 124 */ - Tcl_DStringStartSublist, /* 125 */ - Tcl_Eof, /* 126 */ - Tcl_ErrnoId, /* 127 */ - Tcl_ErrnoMsg, /* 128 */ - Tcl_Eval, /* 129 */ - Tcl_EvalFile, /* 130 */ - Tcl_EvalObj, /* 131 */ - Tcl_EventuallyFree, /* 132 */ - Tcl_Exit, /* 133 */ - Tcl_ExposeCommand, /* 134 */ - Tcl_ExprBoolean, /* 135 */ - Tcl_ExprBooleanObj, /* 136 */ - Tcl_ExprDouble, /* 137 */ - Tcl_ExprDoubleObj, /* 138 */ - Tcl_ExprLong, /* 139 */ - Tcl_ExprLongObj, /* 140 */ - Tcl_ExprObj, /* 141 */ - Tcl_ExprString, /* 142 */ - Tcl_Finalize, /* 143 */ - Tcl_FindExecutable, /* 144 */ - Tcl_FirstHashEntry, /* 145 */ - Tcl_Flush, /* 146 */ - Tcl_FreeResult, /* 147 */ - Tcl_GetAlias, /* 148 */ - Tcl_GetAliasObj, /* 149 */ - Tcl_GetAssocData, /* 150 */ - Tcl_GetChannel, /* 151 */ - Tcl_GetChannelBufferSize, /* 152 */ - Tcl_GetChannelHandle, /* 153 */ - Tcl_GetChannelInstanceData, /* 154 */ - Tcl_GetChannelMode, /* 155 */ - Tcl_GetChannelName, /* 156 */ - Tcl_GetChannelOption, /* 157 */ - Tcl_GetChannelType, /* 158 */ - Tcl_GetCommandInfo, /* 159 */ - Tcl_GetCommandName, /* 160 */ - Tcl_GetErrno, /* 161 */ - Tcl_GetHostName, /* 162 */ - Tcl_GetInterpPath, /* 163 */ - Tcl_GetMaster, /* 164 */ - Tcl_GetNameOfExecutable, /* 165 */ - Tcl_GetObjResult, /* 166 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - Tcl_GetOpenFile, /* 167 */ -#endif /* UNIX */ -#ifdef __WIN32__ - NULL, /* 167 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - NULL, /* 167 */ -#endif /* MAC_TCL */ - Tcl_GetPathType, /* 168 */ - Tcl_Gets, /* 169 */ - Tcl_GetsObj, /* 170 */ - Tcl_GetServiceMode, /* 171 */ - Tcl_GetSlave, /* 172 */ - Tcl_GetStdChannel, /* 173 */ - Tcl_GetStringResult, /* 174 */ - Tcl_GetVar, /* 175 */ - Tcl_GetVar2, /* 176 */ - Tcl_GlobalEval, /* 177 */ - Tcl_GlobalEvalObj, /* 178 */ - Tcl_HideCommand, /* 179 */ - Tcl_Init, /* 180 */ - Tcl_InitHashTable, /* 181 */ - Tcl_InputBlocked, /* 182 */ - Tcl_InputBuffered, /* 183 */ - Tcl_InterpDeleted, /* 184 */ - Tcl_IsSafe, /* 185 */ - Tcl_JoinPath, /* 186 */ - Tcl_LinkVar, /* 187 */ - NULL, /* 188 */ - Tcl_MakeFileChannel, /* 189 */ - Tcl_MakeSafe, /* 190 */ - Tcl_MakeTcpClientChannel, /* 191 */ - Tcl_Merge, /* 192 */ - Tcl_NextHashEntry, /* 193 */ - Tcl_NotifyChannel, /* 194 */ - Tcl_ObjGetVar2, /* 195 */ - Tcl_ObjSetVar2, /* 196 */ - Tcl_OpenCommandChannel, /* 197 */ - Tcl_OpenFileChannel, /* 198 */ - Tcl_OpenTcpClient, /* 199 */ - Tcl_OpenTcpServer, /* 200 */ - Tcl_Preserve, /* 201 */ - Tcl_PrintDouble, /* 202 */ - Tcl_PutEnv, /* 203 */ - Tcl_PosixError, /* 204 */ - Tcl_QueueEvent, /* 205 */ - Tcl_Read, /* 206 */ - Tcl_ReapDetachedProcs, /* 207 */ - Tcl_RecordAndEval, /* 208 */ - Tcl_RecordAndEvalObj, /* 209 */ - Tcl_RegisterChannel, /* 210 */ - Tcl_RegisterObjType, /* 211 */ - Tcl_RegExpCompile, /* 212 */ - Tcl_RegExpExec, /* 213 */ - Tcl_RegExpMatch, /* 214 */ - Tcl_RegExpRange, /* 215 */ - Tcl_Release, /* 216 */ - Tcl_ResetResult, /* 217 */ - Tcl_ScanElement, /* 218 */ - Tcl_ScanCountedElement, /* 219 */ - Tcl_Seek, /* 220 */ - Tcl_ServiceAll, /* 221 */ - Tcl_ServiceEvent, /* 222 */ - Tcl_SetAssocData, /* 223 */ - Tcl_SetChannelBufferSize, /* 224 */ - Tcl_SetChannelOption, /* 225 */ - Tcl_SetCommandInfo, /* 226 */ - Tcl_SetErrno, /* 227 */ - Tcl_SetErrorCode, /* 228 */ - Tcl_SetMaxBlockTime, /* 229 */ - Tcl_SetPanicProc, /* 230 */ - Tcl_SetRecursionLimit, /* 231 */ - Tcl_SetResult, /* 232 */ - Tcl_SetServiceMode, /* 233 */ - Tcl_SetObjErrorCode, /* 234 */ - Tcl_SetObjResult, /* 235 */ - Tcl_SetStdChannel, /* 236 */ - Tcl_SetVar, /* 237 */ - Tcl_SetVar2, /* 238 */ - Tcl_SignalId, /* 239 */ - Tcl_SignalMsg, /* 240 */ - Tcl_SourceRCFile, /* 241 */ - Tcl_SplitList, /* 242 */ - Tcl_SplitPath, /* 243 */ - Tcl_StaticPackage, /* 244 */ - Tcl_StringMatch, /* 245 */ - Tcl_Tell, /* 246 */ - Tcl_TraceVar, /* 247 */ - Tcl_TraceVar2, /* 248 */ - Tcl_TranslateFileName, /* 249 */ - Tcl_Ungets, /* 250 */ - Tcl_UnlinkVar, /* 251 */ - Tcl_UnregisterChannel, /* 252 */ - Tcl_UnsetVar, /* 253 */ - Tcl_UnsetVar2, /* 254 */ - Tcl_UntraceVar, /* 255 */ - Tcl_UntraceVar2, /* 256 */ - Tcl_UpdateLinkedVar, /* 257 */ - Tcl_UpVar, /* 258 */ - Tcl_UpVar2, /* 259 */ - Tcl_VarEval, /* 260 */ - Tcl_VarTraceInfo, /* 261 */ - Tcl_VarTraceInfo2, /* 262 */ - Tcl_Write, /* 263 */ - Tcl_WrongNumArgs, /* 264 */ - Tcl_DumpActiveMemory, /* 265 */ - Tcl_ValidateAllMemory, /* 266 */ - Tcl_AppendResultVA, /* 267 */ - Tcl_AppendStringsToObjVA, /* 268 */ - Tcl_HashStats, /* 269 */ - Tcl_ParseVar, /* 270 */ - Tcl_PkgPresent, /* 271 */ - Tcl_PkgPresentEx, /* 272 */ - Tcl_PkgProvide, /* 273 */ - Tcl_PkgRequire, /* 274 */ - Tcl_SetErrorCodeVA, /* 275 */ - Tcl_VarEvalVA, /* 276 */ - Tcl_WaitPid, /* 277 */ - Tcl_PanicVA, /* 278 */ - Tcl_GetVersion, /* 279 */ - Tcl_InitMemory, /* 280 */ - NULL, /* 281 */ - NULL, /* 282 */ - NULL, /* 283 */ - NULL, /* 284 */ - NULL, /* 285 */ - Tcl_AppendObjToObj, /* 286 */ - Tcl_CreateEncoding, /* 287 */ - Tcl_CreateThreadExitHandler, /* 288 */ - Tcl_DeleteThreadExitHandler, /* 289 */ - Tcl_DiscardResult, /* 290 */ - Tcl_EvalEx, /* 291 */ - Tcl_EvalObjv, /* 292 */ - Tcl_EvalObjEx, /* 293 */ - Tcl_ExitThread, /* 294 */ - Tcl_ExternalToUtf, /* 295 */ - Tcl_ExternalToUtfDString, /* 296 */ - Tcl_FinalizeThread, /* 297 */ - Tcl_FinalizeNotifier, /* 298 */ - Tcl_FreeEncoding, /* 299 */ - Tcl_GetCurrentThread, /* 300 */ - Tcl_GetEncoding, /* 301 */ - Tcl_GetEncodingName, /* 302 */ - Tcl_GetEncodingNames, /* 303 */ - Tcl_GetIndexFromObjStruct, /* 304 */ - Tcl_GetThreadData, /* 305 */ - Tcl_GetVar2Ex, /* 306 */ - Tcl_InitNotifier, /* 307 */ - Tcl_MutexLock, /* 308 */ - Tcl_MutexUnlock, /* 309 */ - Tcl_ConditionNotify, /* 310 */ - Tcl_ConditionWait, /* 311 */ - Tcl_NumUtfChars, /* 312 */ - Tcl_ReadChars, /* 313 */ - Tcl_RestoreResult, /* 314 */ - Tcl_SaveResult, /* 315 */ - Tcl_SetSystemEncoding, /* 316 */ - Tcl_SetVar2Ex, /* 317 */ - Tcl_ThreadAlert, /* 318 */ - Tcl_ThreadQueueEvent, /* 319 */ - Tcl_UniCharAtIndex, /* 320 */ - Tcl_UniCharToLower, /* 321 */ - Tcl_UniCharToTitle, /* 322 */ - Tcl_UniCharToUpper, /* 323 */ - Tcl_UniCharToUtf, /* 324 */ - Tcl_UtfAtIndex, /* 325 */ - Tcl_UtfCharComplete, /* 326 */ - Tcl_UtfBackslash, /* 327 */ - Tcl_UtfFindFirst, /* 328 */ - Tcl_UtfFindLast, /* 329 */ - Tcl_UtfNext, /* 330 */ - Tcl_UtfPrev, /* 331 */ - Tcl_UtfToExternal, /* 332 */ - Tcl_UtfToExternalDString, /* 333 */ - Tcl_UtfToLower, /* 334 */ - Tcl_UtfToTitle, /* 335 */ - Tcl_UtfToUniChar, /* 336 */ - Tcl_UtfToUpper, /* 337 */ - Tcl_WriteChars, /* 338 */ - Tcl_WriteObj, /* 339 */ - Tcl_GetString, /* 340 */ - Tcl_GetDefaultEncodingDir, /* 341 */ - Tcl_SetDefaultEncodingDir, /* 342 */ - Tcl_AlertNotifier, /* 343 */ - Tcl_ServiceModeHook, /* 344 */ - Tcl_UniCharIsAlnum, /* 345 */ - Tcl_UniCharIsAlpha, /* 346 */ - Tcl_UniCharIsDigit, /* 347 */ - Tcl_UniCharIsLower, /* 348 */ - Tcl_UniCharIsSpace, /* 349 */ - Tcl_UniCharIsUpper, /* 350 */ - Tcl_UniCharIsWordChar, /* 351 */ - Tcl_UniCharLen, /* 352 */ - Tcl_UniCharNcmp, /* 353 */ - Tcl_UniCharToUtfDString, /* 354 */ - Tcl_UtfToUniCharDString, /* 355 */ - Tcl_GetRegExpFromObj, /* 356 */ - Tcl_EvalTokens, /* 357 */ - Tcl_FreeParse, /* 358 */ - Tcl_LogCommandInfo, /* 359 */ - Tcl_ParseBraces, /* 360 */ - Tcl_ParseCommand, /* 361 */ - Tcl_ParseExpr, /* 362 */ - Tcl_ParseQuotedString, /* 363 */ - Tcl_ParseVarName, /* 364 */ - Tcl_GetCwd, /* 365 */ - Tcl_Chdir, /* 366 */ -}; - -TclIntStubs tclIntStubs = { - TCL_STUB_MAGIC, - NULL, - TclAccess, /* 0 */ - TclAccessDeleteProc, /* 1 */ - TclAccessInsertProc, /* 2 */ - TclAllocateFreeObjects, /* 3 */ - NULL, /* 4 */ - TclCleanupChildren, /* 5 */ - TclCleanupCommand, /* 6 */ - TclCopyAndCollapse, /* 7 */ - TclCopyChannel, /* 8 */ - TclCreatePipeline, /* 9 */ - TclCreateProc, /* 10 */ - TclDeleteCompiledLocalVars, /* 11 */ - TclDeleteVars, /* 12 */ - TclDoGlob, /* 13 */ - TclDumpMemoryInfo, /* 14 */ - NULL, /* 15 */ - TclExprFloatError, /* 16 */ - TclFileAttrsCmd, /* 17 */ - TclFileCopyCmd, /* 18 */ - TclFileDeleteCmd, /* 19 */ - TclFileMakeDirsCmd, /* 20 */ - TclFileRenameCmd, /* 21 */ - TclFindElement, /* 22 */ - TclFindProc, /* 23 */ - TclFormatInt, /* 24 */ - TclFreePackageInfo, /* 25 */ - NULL, /* 26 */ - TclGetDate, /* 27 */ - TclpGetDefaultStdChannel, /* 28 */ - TclGetElementOfIndexedArray, /* 29 */ - NULL, /* 30 */ - TclGetExtension, /* 31 */ - TclGetFrame, /* 32 */ - TclGetInterpProc, /* 33 */ - TclGetIntForIndex, /* 34 */ - TclGetIndexedScalar, /* 35 */ - TclGetLong, /* 36 */ - TclGetLoadedPackages, /* 37 */ - TclGetNamespaceForQualName, /* 38 */ - TclGetObjInterpProc, /* 39 */ - TclGetOpenMode, /* 40 */ - TclGetOriginalCommand, /* 41 */ - TclpGetUserHome, /* 42 */ - TclGlobalInvoke, /* 43 */ - TclGuessPackageName, /* 44 */ - TclHideUnsafeCommands, /* 45 */ - TclInExit, /* 46 */ - TclIncrElementOfIndexedArray, /* 47 */ - TclIncrIndexedScalar, /* 48 */ - TclIncrVar2, /* 49 */ - TclInitCompiledLocals, /* 50 */ - TclInterpInit, /* 51 */ - TclInvoke, /* 52 */ - TclInvokeObjectCommand, /* 53 */ - TclInvokeStringCommand, /* 54 */ - TclIsProc, /* 55 */ - NULL, /* 56 */ - NULL, /* 57 */ - TclLookupVar, /* 58 */ - TclpMatchFiles, /* 59 */ - TclNeedSpace, /* 60 */ - TclNewProcBodyObj, /* 61 */ - TclObjCommandComplete, /* 62 */ - TclObjInterpProc, /* 63 */ - TclObjInvoke, /* 64 */ - TclObjInvokeGlobal, /* 65 */ - TclOpenFileChannelDeleteProc, /* 66 */ - TclOpenFileChannelInsertProc, /* 67 */ - TclpAccess, /* 68 */ - TclpAlloc, /* 69 */ - TclpCopyFile, /* 70 */ - TclpCopyDirectory, /* 71 */ - TclpCreateDirectory, /* 72 */ - TclpDeleteFile, /* 73 */ - TclpFree, /* 74 */ - TclpGetClicks, /* 75 */ - TclpGetSeconds, /* 76 */ - TclpGetTime, /* 77 */ - TclpGetTimeZone, /* 78 */ - TclpListVolumes, /* 79 */ - TclpOpenFileChannel, /* 80 */ - TclpRealloc, /* 81 */ - TclpRemoveDirectory, /* 82 */ - TclpRenameFile, /* 83 */ - NULL, /* 84 */ - NULL, /* 85 */ - NULL, /* 86 */ - NULL, /* 87 */ - TclPrecTraceProc, /* 88 */ - TclPreventAliasLoop, /* 89 */ - NULL, /* 90 */ - TclProcCleanupProc, /* 91 */ - TclProcCompileProc, /* 92 */ - TclProcDeleteProc, /* 93 */ - TclProcInterpProc, /* 94 */ - TclpStat, /* 95 */ - TclRenameCommand, /* 96 */ - TclResetShadowedCmdRefs, /* 97 */ - TclServiceIdle, /* 98 */ - TclSetElementOfIndexedArray, /* 99 */ - TclSetIndexedScalar, /* 100 */ - NULL, /* 101 */ - TclSetupEnv, /* 102 */ - TclSockGetPort, /* 103 */ - TclSockMinimumBuffers, /* 104 */ - TclStat, /* 105 */ - TclStatDeleteProc, /* 106 */ - TclStatInsertProc, /* 107 */ - TclTeardownNamespace, /* 108 */ - TclUpdateReturnInfo, /* 109 */ - NULL, /* 110 */ - Tcl_AddInterpResolvers, /* 111 */ - Tcl_AppendExportList, /* 112 */ - Tcl_CreateNamespace, /* 113 */ - Tcl_DeleteNamespace, /* 114 */ - Tcl_Export, /* 115 */ - Tcl_FindCommand, /* 116 */ - Tcl_FindNamespace, /* 117 */ - Tcl_GetInterpResolvers, /* 118 */ - Tcl_GetNamespaceResolvers, /* 119 */ - Tcl_FindNamespaceVar, /* 120 */ - Tcl_ForgetImport, /* 121 */ - Tcl_GetCommandFromObj, /* 122 */ - Tcl_GetCommandFullName, /* 123 */ - Tcl_GetCurrentNamespace, /* 124 */ - Tcl_GetGlobalNamespace, /* 125 */ - Tcl_GetVariableFullName, /* 126 */ - Tcl_Import, /* 127 */ - Tcl_PopCallFrame, /* 128 */ - Tcl_PushCallFrame, /* 129 */ - Tcl_RemoveInterpResolvers, /* 130 */ - Tcl_SetNamespaceResolvers, /* 131 */ - TclpHasSockets, /* 132 */ - TclpGetDate, /* 133 */ - TclpStrftime, /* 134 */ - TclpCheckStackSpace, /* 135 */ - NULL, /* 136 */ - TclpChdir, /* 137 */ - TclGetEnv, /* 138 */ - TclpLoadFile, /* 139 */ - TclLooksLikeInt, /* 140 */ - TclpGetCwd, /* 141 */ -}; - -TclIntPlatStubs tclIntPlatStubs = { - TCL_STUB_MAGIC, - NULL, -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - TclGetAndDetachPids, /* 0 */ - TclpCloseFile, /* 1 */ - TclpCreateCommandChannel, /* 2 */ - TclpCreatePipe, /* 3 */ - TclpCreateProcess, /* 4 */ - NULL, /* 5 */ - TclpMakeFile, /* 6 */ - TclpOpenFile, /* 7 */ - TclUnixWaitForFile, /* 8 */ - TclpCreateTempFile, /* 9 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TclWinConvertError, /* 0 */ - TclWinConvertWSAError, /* 1 */ - TclWinGetServByName, /* 2 */ - TclWinGetSockOpt, /* 3 */ - TclWinGetTclInstance, /* 4 */ - NULL, /* 5 */ - TclWinNToHS, /* 6 */ - TclWinSetSockOpt, /* 7 */ - TclpGetPid, /* 8 */ - TclWinGetPlatformId, /* 9 */ - TclWinSynchSpawn, /* 10 */ - TclGetAndDetachPids, /* 11 */ - TclpCloseFile, /* 12 */ - TclpCreateCommandChannel, /* 13 */ - TclpCreatePipe, /* 14 */ - TclpCreateProcess, /* 15 */ - NULL, /* 16 */ - NULL, /* 17 */ - TclpMakeFile, /* 18 */ - TclpOpenFile, /* 19 */ - TclWinAddProcess, /* 20 */ - TclpAsyncMark, /* 21 */ - TclpCreateTempFile, /* 22 */ - TclpGetTZName, /* 23 */ - TclWinNoBackslash, /* 24 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TclpSysAlloc, /* 0 */ - TclpSysFree, /* 1 */ - TclpSysRealloc, /* 2 */ - TclpExit, /* 3 */ - FSpGetDefaultDir, /* 4 */ - FSpSetDefaultDir, /* 5 */ - FSpFindFolder, /* 6 */ - GetGlobalMouse, /* 7 */ - FSpGetDirectoryID, /* 8 */ - FSpOpenResFileCompat, /* 9 */ - FSpCreateResFileCompat, /* 10 */ - FSpLocationFromPath, /* 11 */ - FSpPathFromLocation, /* 12 */ - TclMacExitHandler, /* 13 */ - TclMacInitExitToShell, /* 14 */ - TclMacInstallExitToShellPatch, /* 15 */ - TclMacOSErrorToPosixError, /* 16 */ - TclMacRemoveTimer, /* 17 */ - TclMacStartTimer, /* 18 */ - TclMacTimerExpired, /* 19 */ - TclMacRegisterResourceFork, /* 20 */ - TclMacUnRegisterResourceFork, /* 21 */ - TclMacCreateEnv, /* 22 */ - TclMacFOpenHack, /* 23 */ - NULL, /* 24 */ - TclMacChmod, /* 25 */ -#endif /* MAC_TCL */ -}; - -TclPlatStubs tclPlatStubs = { - TCL_STUB_MAGIC, - NULL, -#ifdef __WIN32__ - Tcl_WinUtfToTChar, /* 0 */ - Tcl_WinTCharToUtf, /* 1 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - Tcl_MacSetEventProc, /* 0 */ - Tcl_MacConvertTextResource, /* 1 */ - Tcl_MacEvalResource, /* 2 */ - Tcl_MacFindResource, /* 3 */ - Tcl_GetOSTypeFromObj, /* 4 */ - Tcl_SetOSTypeObj, /* 5 */ - Tcl_NewOSTypeObj, /* 6 */ - strncasecmp, /* 7 */ - strcasecmp, /* 8 */ -#endif /* MAC_TCL */ -}; - -static TclStubHooks tclStubHooks = { - &tclPlatStubs, - &tclIntStubs, - &tclIntPlatStubs -}; - - -/* !END!: Do not edit above this line. */ diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c deleted file mode 100644 index 6a3f308..0000000 --- a/generic/tclStubLib.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * tclStubLib.c -- - * - * Stub object that will be statically linked into extensions that wish - * to access Tcl. - * - * Copyright (c) 1998-1999 by Scriptics Corporation. - * Copyright (c) 1998 Paul Duffin. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclStubLib.c,v 1.3 1999/03/10 05:52:50 stanton Exp $ - */ - -/* - * We need to ensure that we use the stub macros so that this file contains - * no references to any of the stub functions. This will make it possible - * to build an extension that references Tcl_InitStubs but doesn't end up - * including the rest of the stub functions. - */ - -#ifndef USE_TCL_STUBS -#define USE_TCL_STUBS -#endif -#undef USE_TCL_STUB_PROCS - -#include "tclInt.h" -#include "tclPort.h" - -/* - * Ensure that Tcl_InitStubs is built as an exported symbol. The other stub - * functions should be built as non-exported symbols. - */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT - -TclStubs *tclStubsPtr; -TclPlatStubs *tclPlatStubsPtr; -TclIntStubs *tclIntStubsPtr; -TclIntPlatStubs *tclIntPlatStubsPtr; - -static TclStubs * HasStubSupport _ANSI_ARGS_((Tcl_Interp *interp)); - -static TclStubs * -HasStubSupport (interp) - Tcl_Interp *interp; -{ - Interp *iPtr = (Interp *) interp; - - if (iPtr->stubTable && (iPtr->stubTable->magic == TCL_STUB_MAGIC)) { - return iPtr->stubTable; - } - interp->result = "This interpreter does not support stubs-enabled extensions."; - interp->freeProc = TCL_STATIC; - - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_InitStubs -- - * - * Tries to initialise the stub table pointers and ensures that - * the correct version of Tcl is loaded. - * - * Results: - * The actual version of Tcl that satisfies the request, or - * NULL to indicate that an error occurred. - * - * Side effects: - * Sets the stub table pointers. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_InitStubs (interp, version, exact) - Tcl_Interp *interp; - char *version; - int exact; -{ - char *actualVersion; - TclStubs *tmp; - - if (!tclStubsPtr) { - tclStubsPtr = HasStubSupport(interp); - if (!tclStubsPtr) { - return NULL; - } - } - - actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, exact, - (ClientData *) &tmp); - if (actualVersion == NULL) { - tclStubsPtr = NULL; - return NULL; - } - - if (tclStubsPtr->hooks) { - tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs; - tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs; - tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs; - } else { - tclPlatStubsPtr = NULL; - tclIntStubsPtr = NULL; - tclIntPlatStubsPtr = NULL; - } - - return actualVersion; -} diff --git a/generic/tclStubs.c b/generic/tclStubs.c deleted file mode 100644 index 21ebe06..0000000 --- a/generic/tclStubs.c +++ /dev/null @@ -1,3267 +0,0 @@ -/* - * tclStubs.c -- - * - * This file contains the wrapper functions for the platform independent - * public Tcl API. - * - * 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. - * - * RCS: @(#) $Id: tclStubs.c,v 1.7 1999/04/16 00:46:53 stanton Exp $ - */ - -#include "tcl.h" - -/* - * Undefine function macros that will interfere with the defintions below. - */ - -#undef Tcl_Alloc -#undef Tcl_Free -#undef Tcl_Realloc -#undef Tcl_NewBooleanObj -#undef Tcl_NewByteArrayObj -#undef Tcl_NewDoubleObj -#undef Tcl_NewIntObj -#undef Tcl_NewListObj -#undef Tcl_NewLongObj -#undef Tcl_NewObj -#undef Tcl_NewStringObj -#undef Tcl_InitMemory -#undef Tcl_DumpActiveMemory -#undef Tcl_ValidateAllMemory -#undef Tcl_EvalObj -#undef Tcl_GlobalEvalObj -#undef Tcl_MutexLock -#undef Tcl_MutexUnlock -#undef Tcl_ConditionNotify -#undef Tcl_ConditionWait - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tcl.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported stub functions: - */ - -/* Slot 0 */ -int -Tcl_PkgProvideEx(interp, name, version, clientData) - Tcl_Interp * interp; - char * name; - char * version; - ClientData clientData; -{ - return (tclStubsPtr->tcl_PkgProvideEx)(interp, name, version, clientData); -} - -/* Slot 1 */ -char * -Tcl_PkgRequireEx(interp, name, version, exact, clientDataPtr) - Tcl_Interp * interp; - char * name; - char * version; - int exact; - ClientData * clientDataPtr; -{ - return (tclStubsPtr->tcl_PkgRequireEx)(interp, name, version, exact, clientDataPtr); -} - -/* Slot 2 */ -void -Tcl_Panic TCL_VARARGS_DEF(char *,format) -{ - char * var; - va_list argList; - - var = (char *) TCL_VARARGS_START(char *,format,argList); - - (tclStubsPtr->tcl_PanicVA)(var, argList); - va_end(argList); -} - -/* Slot 3 */ -char * -Tcl_Alloc(size) - unsigned int size; -{ - return (tclStubsPtr->tcl_Alloc)(size); -} - -/* Slot 4 */ -void -Tcl_Free(ptr) - char * ptr; -{ - (tclStubsPtr->tcl_Free)(ptr); -} - -/* Slot 5 */ -char * -Tcl_Realloc(ptr, size) - char * ptr; - unsigned int size; -{ - return (tclStubsPtr->tcl_Realloc)(ptr, size); -} - -/* Slot 6 */ -char * -Tcl_DbCkalloc(size, file, line) - unsigned int size; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbCkalloc)(size, file, line); -} - -/* Slot 7 */ -int -Tcl_DbCkfree(ptr, file, line) - char * ptr; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbCkfree)(ptr, file, line); -} - -/* Slot 8 */ -char * -Tcl_DbCkrealloc(ptr, size, file, line) - char * ptr; - unsigned int size; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbCkrealloc)(ptr, size, file, line); -} - -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* Slot 9 */ -void -Tcl_CreateFileHandler(fd, mask, proc, clientData) - int fd; - int mask; - Tcl_FileProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CreateFileHandler)(fd, mask, proc, clientData); -} - -#endif /* UNIX */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* Slot 10 */ -void -Tcl_DeleteFileHandler(fd) - int fd; -{ - (tclStubsPtr->tcl_DeleteFileHandler)(fd); -} - -#endif /* UNIX */ -/* Slot 11 */ -void -Tcl_SetTimer(timePtr) - Tcl_Time * timePtr; -{ - (tclStubsPtr->tcl_SetTimer)(timePtr); -} - -/* Slot 12 */ -void -Tcl_Sleep(ms) - int ms; -{ - (tclStubsPtr->tcl_Sleep)(ms); -} - -/* Slot 13 */ -int -Tcl_WaitForEvent(timePtr) - Tcl_Time * timePtr; -{ - return (tclStubsPtr->tcl_WaitForEvent)(timePtr); -} - -/* Slot 14 */ -int -Tcl_AppendAllObjTypes(interp, objPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; -{ - return (tclStubsPtr->tcl_AppendAllObjTypes)(interp, objPtr); -} - -/* Slot 15 */ -void -Tcl_AppendStringsToObj TCL_VARARGS_DEF(Tcl_Obj *,objPtr) -{ - Tcl_Obj * var; - va_list argList; - - var = (Tcl_Obj *) TCL_VARARGS_START(Tcl_Obj *,objPtr,argList); - - (tclStubsPtr->tcl_AppendStringsToObjVA)(var, argList); - va_end(argList); -} - -/* Slot 16 */ -void -Tcl_AppendToObj(objPtr, bytes, length) - Tcl_Obj * objPtr; - char * bytes; - int length; -{ - (tclStubsPtr->tcl_AppendToObj)(objPtr, bytes, length); -} - -/* Slot 17 */ -Tcl_Obj * -Tcl_ConcatObj(objc, objv) - int objc; - Tcl_Obj *CONST objv[]; -{ - return (tclStubsPtr->tcl_ConcatObj)(objc, objv); -} - -/* Slot 18 */ -int -Tcl_ConvertToType(interp, objPtr, typePtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - Tcl_ObjType * typePtr; -{ - return (tclStubsPtr->tcl_ConvertToType)(interp, objPtr, typePtr); -} - -/* Slot 19 */ -void -Tcl_DbDecrRefCount(objPtr, file, line) - Tcl_Obj * objPtr; - char * file; - int line; -{ - (tclStubsPtr->tcl_DbDecrRefCount)(objPtr, file, line); -} - -/* Slot 20 */ -void -Tcl_DbIncrRefCount(objPtr, file, line) - Tcl_Obj * objPtr; - char * file; - int line; -{ - (tclStubsPtr->tcl_DbIncrRefCount)(objPtr, file, line); -} - -/* Slot 21 */ -int -Tcl_DbIsShared(objPtr, file, line) - Tcl_Obj * objPtr; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbIsShared)(objPtr, file, line); -} - -/* Slot 22 */ -Tcl_Obj * -Tcl_DbNewBooleanObj(boolValue, file, line) - int boolValue; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbNewBooleanObj)(boolValue, file, line); -} - -/* Slot 23 */ -Tcl_Obj * -Tcl_DbNewByteArrayObj(bytes, length, file, line) - unsigned char * bytes; - int length; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbNewByteArrayObj)(bytes, length, file, line); -} - -/* Slot 24 */ -Tcl_Obj * -Tcl_DbNewDoubleObj(doubleValue, file, line) - double doubleValue; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbNewDoubleObj)(doubleValue, file, line); -} - -/* Slot 25 */ -Tcl_Obj * -Tcl_DbNewListObj(objc, objv, file, line) - int objc; - Tcl_Obj *CONST objv[]; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbNewListObj)(objc, objv, file, line); -} - -/* Slot 26 */ -Tcl_Obj * -Tcl_DbNewLongObj(longValue, file, line) - long longValue; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbNewLongObj)(longValue, file, line); -} - -/* Slot 27 */ -Tcl_Obj * -Tcl_DbNewObj(file, line) - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbNewObj)(file, line); -} - -/* Slot 28 */ -Tcl_Obj * -Tcl_DbNewStringObj(bytes, length, file, line) - CONST char * bytes; - int length; - char * file; - int line; -{ - return (tclStubsPtr->tcl_DbNewStringObj)(bytes, length, file, line); -} - -/* Slot 29 */ -Tcl_Obj * -Tcl_DuplicateObj(objPtr) - Tcl_Obj * objPtr; -{ - return (tclStubsPtr->tcl_DuplicateObj)(objPtr); -} - -/* Slot 30 */ -void -TclFreeObj(objPtr) - Tcl_Obj * objPtr; -{ - (tclStubsPtr->tclFreeObj)(objPtr); -} - -/* Slot 31 */ -int -Tcl_GetBoolean(interp, str, boolPtr) - Tcl_Interp * interp; - char * str; - int * boolPtr; -{ - return (tclStubsPtr->tcl_GetBoolean)(interp, str, boolPtr); -} - -/* Slot 32 */ -int -Tcl_GetBooleanFromObj(interp, objPtr, boolPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - int * boolPtr; -{ - return (tclStubsPtr->tcl_GetBooleanFromObj)(interp, objPtr, boolPtr); -} - -/* Slot 33 */ -unsigned char * -Tcl_GetByteArrayFromObj(objPtr, lengthPtr) - Tcl_Obj * objPtr; - int * lengthPtr; -{ - return (tclStubsPtr->tcl_GetByteArrayFromObj)(objPtr, lengthPtr); -} - -/* Slot 34 */ -int -Tcl_GetDouble(interp, str, doublePtr) - Tcl_Interp * interp; - char * str; - double * doublePtr; -{ - return (tclStubsPtr->tcl_GetDouble)(interp, str, doublePtr); -} - -/* Slot 35 */ -int -Tcl_GetDoubleFromObj(interp, objPtr, doublePtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - double * doublePtr; -{ - return (tclStubsPtr->tcl_GetDoubleFromObj)(interp, objPtr, doublePtr); -} - -/* Slot 36 */ -int -Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - char ** tablePtr; - char * msg; - int flags; - int * indexPtr; -{ - return (tclStubsPtr->tcl_GetIndexFromObj)(interp, objPtr, tablePtr, msg, flags, indexPtr); -} - -/* Slot 37 */ -int -Tcl_GetInt(interp, str, intPtr) - Tcl_Interp * interp; - char * str; - int * intPtr; -{ - return (tclStubsPtr->tcl_GetInt)(interp, str, intPtr); -} - -/* Slot 38 */ -int -Tcl_GetIntFromObj(interp, objPtr, intPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - int * intPtr; -{ - return (tclStubsPtr->tcl_GetIntFromObj)(interp, objPtr, intPtr); -} - -/* Slot 39 */ -int -Tcl_GetLongFromObj(interp, objPtr, longPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - long * longPtr; -{ - return (tclStubsPtr->tcl_GetLongFromObj)(interp, objPtr, longPtr); -} - -/* Slot 40 */ -Tcl_ObjType * -Tcl_GetObjType(typeName) - char * typeName; -{ - return (tclStubsPtr->tcl_GetObjType)(typeName); -} - -/* Slot 41 */ -char * -Tcl_GetStringFromObj(objPtr, lengthPtr) - Tcl_Obj * objPtr; - int * lengthPtr; -{ - return (tclStubsPtr->tcl_GetStringFromObj)(objPtr, lengthPtr); -} - -/* Slot 42 */ -void -Tcl_InvalidateStringRep(objPtr) - Tcl_Obj * objPtr; -{ - (tclStubsPtr->tcl_InvalidateStringRep)(objPtr); -} - -/* Slot 43 */ -int -Tcl_ListObjAppendList(interp, listPtr, elemListPtr) - Tcl_Interp * interp; - Tcl_Obj * listPtr; - Tcl_Obj * elemListPtr; -{ - return (tclStubsPtr->tcl_ListObjAppendList)(interp, listPtr, elemListPtr); -} - -/* Slot 44 */ -int -Tcl_ListObjAppendElement(interp, listPtr, objPtr) - Tcl_Interp * interp; - Tcl_Obj * listPtr; - Tcl_Obj * objPtr; -{ - return (tclStubsPtr->tcl_ListObjAppendElement)(interp, listPtr, objPtr); -} - -/* Slot 45 */ -int -Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) - Tcl_Interp * interp; - Tcl_Obj * listPtr; - int * objcPtr; - Tcl_Obj *** objvPtr; -{ - return (tclStubsPtr->tcl_ListObjGetElements)(interp, listPtr, objcPtr, objvPtr); -} - -/* Slot 46 */ -int -Tcl_ListObjIndex(interp, listPtr, index, objPtrPtr) - Tcl_Interp * interp; - Tcl_Obj * listPtr; - int index; - Tcl_Obj ** objPtrPtr; -{ - return (tclStubsPtr->tcl_ListObjIndex)(interp, listPtr, index, objPtrPtr); -} - -/* Slot 47 */ -int -Tcl_ListObjLength(interp, listPtr, intPtr) - Tcl_Interp * interp; - Tcl_Obj * listPtr; - int * intPtr; -{ - return (tclStubsPtr->tcl_ListObjLength)(interp, listPtr, intPtr); -} - -/* Slot 48 */ -int -Tcl_ListObjReplace(interp, listPtr, first, count, objc, objv) - Tcl_Interp * interp; - Tcl_Obj * listPtr; - int first; - int count; - int objc; - Tcl_Obj *CONST objv[]; -{ - return (tclStubsPtr->tcl_ListObjReplace)(interp, listPtr, first, count, objc, objv); -} - -/* Slot 49 */ -Tcl_Obj * -Tcl_NewBooleanObj(boolValue) - int boolValue; -{ - return (tclStubsPtr->tcl_NewBooleanObj)(boolValue); -} - -/* Slot 50 */ -Tcl_Obj * -Tcl_NewByteArrayObj(bytes, length) - unsigned char * bytes; - int length; -{ - return (tclStubsPtr->tcl_NewByteArrayObj)(bytes, length); -} - -/* Slot 51 */ -Tcl_Obj * -Tcl_NewDoubleObj(doubleValue) - double doubleValue; -{ - return (tclStubsPtr->tcl_NewDoubleObj)(doubleValue); -} - -/* Slot 52 */ -Tcl_Obj * -Tcl_NewIntObj(intValue) - int intValue; -{ - return (tclStubsPtr->tcl_NewIntObj)(intValue); -} - -/* Slot 53 */ -Tcl_Obj * -Tcl_NewListObj(objc, objv) - int objc; - Tcl_Obj *CONST objv[]; -{ - return (tclStubsPtr->tcl_NewListObj)(objc, objv); -} - -/* Slot 54 */ -Tcl_Obj * -Tcl_NewLongObj(longValue) - long longValue; -{ - return (tclStubsPtr->tcl_NewLongObj)(longValue); -} - -/* Slot 55 */ -Tcl_Obj * -Tcl_NewObj() -{ - return (tclStubsPtr->tcl_NewObj)(); -} - -/* Slot 56 */ -Tcl_Obj * -Tcl_NewStringObj(bytes, length) - CONST char * bytes; - int length; -{ - return (tclStubsPtr->tcl_NewStringObj)(bytes, length); -} - -/* Slot 57 */ -void -Tcl_SetBooleanObj(objPtr, boolValue) - Tcl_Obj * objPtr; - int boolValue; -{ - (tclStubsPtr->tcl_SetBooleanObj)(objPtr, boolValue); -} - -/* Slot 58 */ -unsigned char * -Tcl_SetByteArrayLength(objPtr, length) - Tcl_Obj * objPtr; - int length; -{ - return (tclStubsPtr->tcl_SetByteArrayLength)(objPtr, length); -} - -/* Slot 59 */ -void -Tcl_SetByteArrayObj(objPtr, bytes, length) - Tcl_Obj * objPtr; - unsigned char * bytes; - int length; -{ - (tclStubsPtr->tcl_SetByteArrayObj)(objPtr, bytes, length); -} - -/* Slot 60 */ -void -Tcl_SetDoubleObj(objPtr, doubleValue) - Tcl_Obj * objPtr; - double doubleValue; -{ - (tclStubsPtr->tcl_SetDoubleObj)(objPtr, doubleValue); -} - -/* Slot 61 */ -void -Tcl_SetIntObj(objPtr, intValue) - Tcl_Obj * objPtr; - int intValue; -{ - (tclStubsPtr->tcl_SetIntObj)(objPtr, intValue); -} - -/* Slot 62 */ -void -Tcl_SetListObj(objPtr, objc, objv) - Tcl_Obj * objPtr; - int objc; - Tcl_Obj *CONST objv[]; -{ - (tclStubsPtr->tcl_SetListObj)(objPtr, objc, objv); -} - -/* Slot 63 */ -void -Tcl_SetLongObj(objPtr, longValue) - Tcl_Obj * objPtr; - long longValue; -{ - (tclStubsPtr->tcl_SetLongObj)(objPtr, longValue); -} - -/* Slot 64 */ -void -Tcl_SetObjLength(objPtr, length) - Tcl_Obj * objPtr; - int length; -{ - (tclStubsPtr->tcl_SetObjLength)(objPtr, length); -} - -/* Slot 65 */ -void -Tcl_SetStringObj(objPtr, bytes, length) - Tcl_Obj * objPtr; - char * bytes; - int length; -{ - (tclStubsPtr->tcl_SetStringObj)(objPtr, bytes, length); -} - -/* Slot 66 */ -void -Tcl_AddErrorInfo(interp, message) - Tcl_Interp * interp; - CONST char * message; -{ - (tclStubsPtr->tcl_AddErrorInfo)(interp, message); -} - -/* Slot 67 */ -void -Tcl_AddObjErrorInfo(interp, message, length) - Tcl_Interp * interp; - CONST char * message; - int length; -{ - (tclStubsPtr->tcl_AddObjErrorInfo)(interp, message, length); -} - -/* Slot 68 */ -void -Tcl_AllowExceptions(interp) - Tcl_Interp * interp; -{ - (tclStubsPtr->tcl_AllowExceptions)(interp); -} - -/* Slot 69 */ -void -Tcl_AppendElement(interp, string) - Tcl_Interp * interp; - CONST char * string; -{ - (tclStubsPtr->tcl_AppendElement)(interp, string); -} - -/* Slot 70 */ -void -Tcl_AppendResult TCL_VARARGS_DEF(Tcl_Interp *,interp) -{ - Tcl_Interp * var; - va_list argList; - - var = (Tcl_Interp *) TCL_VARARGS_START(Tcl_Interp *,interp,argList); - - (tclStubsPtr->tcl_AppendResultVA)(var, argList); - va_end(argList); -} - -/* Slot 71 */ -Tcl_AsyncHandler -Tcl_AsyncCreate(proc, clientData) - Tcl_AsyncProc * proc; - ClientData clientData; -{ - return (tclStubsPtr->tcl_AsyncCreate)(proc, clientData); -} - -/* Slot 72 */ -void -Tcl_AsyncDelete(async) - Tcl_AsyncHandler async; -{ - (tclStubsPtr->tcl_AsyncDelete)(async); -} - -/* Slot 73 */ -int -Tcl_AsyncInvoke(interp, code) - Tcl_Interp * interp; - int code; -{ - return (tclStubsPtr->tcl_AsyncInvoke)(interp, code); -} - -/* Slot 74 */ -void -Tcl_AsyncMark(async) - Tcl_AsyncHandler async; -{ - (tclStubsPtr->tcl_AsyncMark)(async); -} - -/* Slot 75 */ -int -Tcl_AsyncReady() -{ - return (tclStubsPtr->tcl_AsyncReady)(); -} - -/* Slot 76 */ -void -Tcl_BackgroundError(interp) - Tcl_Interp * interp; -{ - (tclStubsPtr->tcl_BackgroundError)(interp); -} - -/* Slot 77 */ -char -Tcl_Backslash(src, readPtr) - CONST char * src; - int * readPtr; -{ - return (tclStubsPtr->tcl_Backslash)(src, readPtr); -} - -/* Slot 78 */ -int -Tcl_BadChannelOption(interp, optionName, optionList) - Tcl_Interp * interp; - char * optionName; - char * optionList; -{ - return (tclStubsPtr->tcl_BadChannelOption)(interp, optionName, optionList); -} - -/* Slot 79 */ -void -Tcl_CallWhenDeleted(interp, proc, clientData) - Tcl_Interp * interp; - Tcl_InterpDeleteProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CallWhenDeleted)(interp, proc, clientData); -} - -/* Slot 80 */ -void -Tcl_CancelIdleCall(idleProc, clientData) - Tcl_IdleProc * idleProc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CancelIdleCall)(idleProc, clientData); -} - -/* Slot 81 */ -int -Tcl_Close(interp, chan) - Tcl_Interp * interp; - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_Close)(interp, chan); -} - -/* Slot 82 */ -int -Tcl_CommandComplete(cmd) - char * cmd; -{ - return (tclStubsPtr->tcl_CommandComplete)(cmd); -} - -/* Slot 83 */ -char * -Tcl_Concat(argc, argv) - int argc; - char ** argv; -{ - return (tclStubsPtr->tcl_Concat)(argc, argv); -} - -/* Slot 84 */ -int -Tcl_ConvertElement(src, dst, flags) - CONST char * src; - char * dst; - int flags; -{ - return (tclStubsPtr->tcl_ConvertElement)(src, dst, flags); -} - -/* Slot 85 */ -int -Tcl_ConvertCountedElement(src, length, dst, flags) - CONST char * src; - int length; - char * dst; - int flags; -{ - return (tclStubsPtr->tcl_ConvertCountedElement)(src, length, dst, flags); -} - -/* Slot 86 */ -int -Tcl_CreateAlias(slave, slaveCmd, target, targetCmd, argc, argv) - Tcl_Interp * slave; - char * slaveCmd; - Tcl_Interp * target; - char * targetCmd; - int argc; - char ** argv; -{ - return (tclStubsPtr->tcl_CreateAlias)(slave, slaveCmd, target, targetCmd, argc, argv); -} - -/* Slot 87 */ -int -Tcl_CreateAliasObj(slave, slaveCmd, target, targetCmd, objc, objv) - Tcl_Interp * slave; - char * slaveCmd; - Tcl_Interp * target; - char * targetCmd; - int objc; - Tcl_Obj *CONST objv[]; -{ - return (tclStubsPtr->tcl_CreateAliasObj)(slave, slaveCmd, target, targetCmd, objc, objv); -} - -/* Slot 88 */ -Tcl_Channel -Tcl_CreateChannel(typePtr, chanName, instanceData, mask) - Tcl_ChannelType * typePtr; - char * chanName; - ClientData instanceData; - int mask; -{ - return (tclStubsPtr->tcl_CreateChannel)(typePtr, chanName, instanceData, mask); -} - -/* Slot 89 */ -void -Tcl_CreateChannelHandler(chan, mask, proc, clientData) - Tcl_Channel chan; - int mask; - Tcl_ChannelProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CreateChannelHandler)(chan, mask, proc, clientData); -} - -/* Slot 90 */ -void -Tcl_CreateCloseHandler(chan, proc, clientData) - Tcl_Channel chan; - Tcl_CloseProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CreateCloseHandler)(chan, proc, clientData); -} - -/* Slot 91 */ -Tcl_Command -Tcl_CreateCommand(interp, cmdName, proc, clientData, deleteProc) - Tcl_Interp * interp; - char * cmdName; - Tcl_CmdProc * proc; - ClientData clientData; - Tcl_CmdDeleteProc * deleteProc; -{ - return (tclStubsPtr->tcl_CreateCommand)(interp, cmdName, proc, clientData, deleteProc); -} - -/* Slot 92 */ -void -Tcl_CreateEventSource(setupProc, checkProc, clientData) - Tcl_EventSetupProc * setupProc; - Tcl_EventCheckProc * checkProc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CreateEventSource)(setupProc, checkProc, clientData); -} - -/* Slot 93 */ -void -Tcl_CreateExitHandler(proc, clientData) - Tcl_ExitProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CreateExitHandler)(proc, clientData); -} - -/* Slot 94 */ -Tcl_Interp * -Tcl_CreateInterp() -{ - return (tclStubsPtr->tcl_CreateInterp)(); -} - -/* Slot 95 */ -void -Tcl_CreateMathFunc(interp, name, numArgs, argTypes, proc, clientData) - Tcl_Interp * interp; - char * name; - int numArgs; - Tcl_ValueType * argTypes; - Tcl_MathProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CreateMathFunc)(interp, name, numArgs, argTypes, proc, clientData); -} - -/* Slot 96 */ -Tcl_Command -Tcl_CreateObjCommand(interp, cmdName, proc, clientData, deleteProc) - Tcl_Interp * interp; - char * cmdName; - Tcl_ObjCmdProc * proc; - ClientData clientData; - Tcl_CmdDeleteProc * deleteProc; -{ - return (tclStubsPtr->tcl_CreateObjCommand)(interp, cmdName, proc, clientData, deleteProc); -} - -/* Slot 97 */ -Tcl_Interp * -Tcl_CreateSlave(interp, slaveName, isSafe) - Tcl_Interp * interp; - char * slaveName; - int isSafe; -{ - return (tclStubsPtr->tcl_CreateSlave)(interp, slaveName, isSafe); -} - -/* Slot 98 */ -Tcl_TimerToken -Tcl_CreateTimerHandler(milliseconds, proc, clientData) - int milliseconds; - Tcl_TimerProc * proc; - ClientData clientData; -{ - return (tclStubsPtr->tcl_CreateTimerHandler)(milliseconds, proc, clientData); -} - -/* Slot 99 */ -Tcl_Trace -Tcl_CreateTrace(interp, level, proc, clientData) - Tcl_Interp * interp; - int level; - Tcl_CmdTraceProc * proc; - ClientData clientData; -{ - return (tclStubsPtr->tcl_CreateTrace)(interp, level, proc, clientData); -} - -/* Slot 100 */ -void -Tcl_DeleteAssocData(interp, name) - Tcl_Interp * interp; - char * name; -{ - (tclStubsPtr->tcl_DeleteAssocData)(interp, name); -} - -/* Slot 101 */ -void -Tcl_DeleteChannelHandler(chan, proc, clientData) - Tcl_Channel chan; - Tcl_ChannelProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_DeleteChannelHandler)(chan, proc, clientData); -} - -/* Slot 102 */ -void -Tcl_DeleteCloseHandler(chan, proc, clientData) - Tcl_Channel chan; - Tcl_CloseProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_DeleteCloseHandler)(chan, proc, clientData); -} - -/* Slot 103 */ -int -Tcl_DeleteCommand(interp, cmdName) - Tcl_Interp * interp; - char * cmdName; -{ - return (tclStubsPtr->tcl_DeleteCommand)(interp, cmdName); -} - -/* Slot 104 */ -int -Tcl_DeleteCommandFromToken(interp, command) - Tcl_Interp * interp; - Tcl_Command command; -{ - return (tclStubsPtr->tcl_DeleteCommandFromToken)(interp, command); -} - -/* Slot 105 */ -void -Tcl_DeleteEvents(proc, clientData) - Tcl_EventDeleteProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_DeleteEvents)(proc, clientData); -} - -/* Slot 106 */ -void -Tcl_DeleteEventSource(setupProc, checkProc, clientData) - Tcl_EventSetupProc * setupProc; - Tcl_EventCheckProc * checkProc; - ClientData clientData; -{ - (tclStubsPtr->tcl_DeleteEventSource)(setupProc, checkProc, clientData); -} - -/* Slot 107 */ -void -Tcl_DeleteExitHandler(proc, clientData) - Tcl_ExitProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_DeleteExitHandler)(proc, clientData); -} - -/* Slot 108 */ -void -Tcl_DeleteHashEntry(entryPtr) - Tcl_HashEntry * entryPtr; -{ - (tclStubsPtr->tcl_DeleteHashEntry)(entryPtr); -} - -/* Slot 109 */ -void -Tcl_DeleteHashTable(tablePtr) - Tcl_HashTable * tablePtr; -{ - (tclStubsPtr->tcl_DeleteHashTable)(tablePtr); -} - -/* Slot 110 */ -void -Tcl_DeleteInterp(interp) - Tcl_Interp * interp; -{ - (tclStubsPtr->tcl_DeleteInterp)(interp); -} - -/* Slot 111 */ -void -Tcl_DetachPids(numPids, pidPtr) - int numPids; - Tcl_Pid * pidPtr; -{ - (tclStubsPtr->tcl_DetachPids)(numPids, pidPtr); -} - -/* Slot 112 */ -void -Tcl_DeleteTimerHandler(token) - Tcl_TimerToken token; -{ - (tclStubsPtr->tcl_DeleteTimerHandler)(token); -} - -/* Slot 113 */ -void -Tcl_DeleteTrace(interp, trace) - Tcl_Interp * interp; - Tcl_Trace trace; -{ - (tclStubsPtr->tcl_DeleteTrace)(interp, trace); -} - -/* Slot 114 */ -void -Tcl_DontCallWhenDeleted(interp, proc, clientData) - Tcl_Interp * interp; - Tcl_InterpDeleteProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_DontCallWhenDeleted)(interp, proc, clientData); -} - -/* Slot 115 */ -int -Tcl_DoOneEvent(flags) - int flags; -{ - return (tclStubsPtr->tcl_DoOneEvent)(flags); -} - -/* Slot 116 */ -void -Tcl_DoWhenIdle(proc, clientData) - Tcl_IdleProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_DoWhenIdle)(proc, clientData); -} - -/* Slot 117 */ -char * -Tcl_DStringAppend(dsPtr, str, length) - Tcl_DString * dsPtr; - CONST char * str; - int length; -{ - return (tclStubsPtr->tcl_DStringAppend)(dsPtr, str, length); -} - -/* Slot 118 */ -char * -Tcl_DStringAppendElement(dsPtr, string) - Tcl_DString * dsPtr; - CONST char * string; -{ - return (tclStubsPtr->tcl_DStringAppendElement)(dsPtr, string); -} - -/* Slot 119 */ -void -Tcl_DStringEndSublist(dsPtr) - Tcl_DString * dsPtr; -{ - (tclStubsPtr->tcl_DStringEndSublist)(dsPtr); -} - -/* Slot 120 */ -void -Tcl_DStringFree(dsPtr) - Tcl_DString * dsPtr; -{ - (tclStubsPtr->tcl_DStringFree)(dsPtr); -} - -/* Slot 121 */ -void -Tcl_DStringGetResult(interp, dsPtr) - Tcl_Interp * interp; - Tcl_DString * dsPtr; -{ - (tclStubsPtr->tcl_DStringGetResult)(interp, dsPtr); -} - -/* Slot 122 */ -void -Tcl_DStringInit(dsPtr) - Tcl_DString * dsPtr; -{ - (tclStubsPtr->tcl_DStringInit)(dsPtr); -} - -/* Slot 123 */ -void -Tcl_DStringResult(interp, dsPtr) - Tcl_Interp * interp; - Tcl_DString * dsPtr; -{ - (tclStubsPtr->tcl_DStringResult)(interp, dsPtr); -} - -/* Slot 124 */ -void -Tcl_DStringSetLength(dsPtr, length) - Tcl_DString * dsPtr; - int length; -{ - (tclStubsPtr->tcl_DStringSetLength)(dsPtr, length); -} - -/* Slot 125 */ -void -Tcl_DStringStartSublist(dsPtr) - Tcl_DString * dsPtr; -{ - (tclStubsPtr->tcl_DStringStartSublist)(dsPtr); -} - -/* Slot 126 */ -int -Tcl_Eof(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_Eof)(chan); -} - -/* Slot 127 */ -char * -Tcl_ErrnoId() -{ - return (tclStubsPtr->tcl_ErrnoId)(); -} - -/* Slot 128 */ -char * -Tcl_ErrnoMsg(err) - int err; -{ - return (tclStubsPtr->tcl_ErrnoMsg)(err); -} - -/* Slot 129 */ -int -Tcl_Eval(interp, string) - Tcl_Interp * interp; - char * string; -{ - return (tclStubsPtr->tcl_Eval)(interp, string); -} - -/* Slot 130 */ -int -Tcl_EvalFile(interp, fileName) - Tcl_Interp * interp; - char * fileName; -{ - return (tclStubsPtr->tcl_EvalFile)(interp, fileName); -} - -/* Slot 131 */ -int -Tcl_EvalObj(interp, objPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; -{ - return (tclStubsPtr->tcl_EvalObj)(interp, objPtr); -} - -/* Slot 132 */ -void -Tcl_EventuallyFree(clientData, freeProc) - ClientData clientData; - Tcl_FreeProc * freeProc; -{ - (tclStubsPtr->tcl_EventuallyFree)(clientData, freeProc); -} - -/* Slot 133 */ -void -Tcl_Exit(status) - int status; -{ - (tclStubsPtr->tcl_Exit)(status); -} - -/* Slot 134 */ -int -Tcl_ExposeCommand(interp, hiddenCmdToken, cmdName) - Tcl_Interp * interp; - char * hiddenCmdToken; - char * cmdName; -{ - return (tclStubsPtr->tcl_ExposeCommand)(interp, hiddenCmdToken, cmdName); -} - -/* Slot 135 */ -int -Tcl_ExprBoolean(interp, str, ptr) - Tcl_Interp * interp; - char * str; - int * ptr; -{ - return (tclStubsPtr->tcl_ExprBoolean)(interp, str, ptr); -} - -/* Slot 136 */ -int -Tcl_ExprBooleanObj(interp, objPtr, ptr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - int * ptr; -{ - return (tclStubsPtr->tcl_ExprBooleanObj)(interp, objPtr, ptr); -} - -/* Slot 137 */ -int -Tcl_ExprDouble(interp, str, ptr) - Tcl_Interp * interp; - char * str; - double * ptr; -{ - return (tclStubsPtr->tcl_ExprDouble)(interp, str, ptr); -} - -/* Slot 138 */ -int -Tcl_ExprDoubleObj(interp, objPtr, ptr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - double * ptr; -{ - return (tclStubsPtr->tcl_ExprDoubleObj)(interp, objPtr, ptr); -} - -/* Slot 139 */ -int -Tcl_ExprLong(interp, str, ptr) - Tcl_Interp * interp; - char * str; - long * ptr; -{ - return (tclStubsPtr->tcl_ExprLong)(interp, str, ptr); -} - -/* Slot 140 */ -int -Tcl_ExprLongObj(interp, objPtr, ptr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - long * ptr; -{ - return (tclStubsPtr->tcl_ExprLongObj)(interp, objPtr, ptr); -} - -/* Slot 141 */ -int -Tcl_ExprObj(interp, objPtr, resultPtrPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - Tcl_Obj ** resultPtrPtr; -{ - return (tclStubsPtr->tcl_ExprObj)(interp, objPtr, resultPtrPtr); -} - -/* Slot 142 */ -int -Tcl_ExprString(interp, string) - Tcl_Interp * interp; - char * string; -{ - return (tclStubsPtr->tcl_ExprString)(interp, string); -} - -/* Slot 143 */ -void -Tcl_Finalize() -{ - (tclStubsPtr->tcl_Finalize)(); -} - -/* Slot 144 */ -void -Tcl_FindExecutable(argv0) - CONST char * argv0; -{ - (tclStubsPtr->tcl_FindExecutable)(argv0); -} - -/* Slot 145 */ -Tcl_HashEntry * -Tcl_FirstHashEntry(tablePtr, searchPtr) - Tcl_HashTable * tablePtr; - Tcl_HashSearch * searchPtr; -{ - return (tclStubsPtr->tcl_FirstHashEntry)(tablePtr, searchPtr); -} - -/* Slot 146 */ -int -Tcl_Flush(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_Flush)(chan); -} - -/* Slot 147 */ -void -Tcl_FreeResult(interp) - Tcl_Interp * interp; -{ - (tclStubsPtr->tcl_FreeResult)(interp); -} - -/* Slot 148 */ -int -Tcl_GetAlias(interp, slaveCmd, targetInterpPtr, targetCmdPtr, argcPtr, argvPtr) - Tcl_Interp * interp; - char * slaveCmd; - Tcl_Interp ** targetInterpPtr; - char ** targetCmdPtr; - int * argcPtr; - char *** argvPtr; -{ - return (tclStubsPtr->tcl_GetAlias)(interp, slaveCmd, targetInterpPtr, targetCmdPtr, argcPtr, argvPtr); -} - -/* Slot 149 */ -int -Tcl_GetAliasObj(interp, slaveCmd, targetInterpPtr, targetCmdPtr, objcPtr, objv) - Tcl_Interp * interp; - char * slaveCmd; - Tcl_Interp ** targetInterpPtr; - char ** targetCmdPtr; - int * objcPtr; - Tcl_Obj *** objv; -{ - return (tclStubsPtr->tcl_GetAliasObj)(interp, slaveCmd, targetInterpPtr, targetCmdPtr, objcPtr, objv); -} - -/* Slot 150 */ -ClientData -Tcl_GetAssocData(interp, name, procPtr) - Tcl_Interp * interp; - char * name; - Tcl_InterpDeleteProc ** procPtr; -{ - return (tclStubsPtr->tcl_GetAssocData)(interp, name, procPtr); -} - -/* Slot 151 */ -Tcl_Channel -Tcl_GetChannel(interp, chanName, modePtr) - Tcl_Interp * interp; - char * chanName; - int * modePtr; -{ - return (tclStubsPtr->tcl_GetChannel)(interp, chanName, modePtr); -} - -/* Slot 152 */ -int -Tcl_GetChannelBufferSize(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_GetChannelBufferSize)(chan); -} - -/* Slot 153 */ -int -Tcl_GetChannelHandle(chan, direction, handlePtr) - Tcl_Channel chan; - int direction; - ClientData * handlePtr; -{ - return (tclStubsPtr->tcl_GetChannelHandle)(chan, direction, handlePtr); -} - -/* Slot 154 */ -ClientData -Tcl_GetChannelInstanceData(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_GetChannelInstanceData)(chan); -} - -/* Slot 155 */ -int -Tcl_GetChannelMode(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_GetChannelMode)(chan); -} - -/* Slot 156 */ -char * -Tcl_GetChannelName(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_GetChannelName)(chan); -} - -/* Slot 157 */ -int -Tcl_GetChannelOption(interp, chan, optionName, dsPtr) - Tcl_Interp * interp; - Tcl_Channel chan; - char * optionName; - Tcl_DString * dsPtr; -{ - return (tclStubsPtr->tcl_GetChannelOption)(interp, chan, optionName, dsPtr); -} - -/* Slot 158 */ -Tcl_ChannelType * -Tcl_GetChannelType(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_GetChannelType)(chan); -} - -/* Slot 159 */ -int -Tcl_GetCommandInfo(interp, cmdName, infoPtr) - Tcl_Interp * interp; - char * cmdName; - Tcl_CmdInfo * infoPtr; -{ - return (tclStubsPtr->tcl_GetCommandInfo)(interp, cmdName, infoPtr); -} - -/* Slot 160 */ -char * -Tcl_GetCommandName(interp, command) - Tcl_Interp * interp; - Tcl_Command command; -{ - return (tclStubsPtr->tcl_GetCommandName)(interp, command); -} - -/* Slot 161 */ -int -Tcl_GetErrno() -{ - return (tclStubsPtr->tcl_GetErrno)(); -} - -/* Slot 162 */ -char * -Tcl_GetHostName() -{ - return (tclStubsPtr->tcl_GetHostName)(); -} - -/* Slot 163 */ -int -Tcl_GetInterpPath(askInterp, slaveInterp) - Tcl_Interp * askInterp; - Tcl_Interp * slaveInterp; -{ - return (tclStubsPtr->tcl_GetInterpPath)(askInterp, slaveInterp); -} - -/* Slot 164 */ -Tcl_Interp * -Tcl_GetMaster(interp) - Tcl_Interp * interp; -{ - return (tclStubsPtr->tcl_GetMaster)(interp); -} - -/* Slot 165 */ -CONST char * -Tcl_GetNameOfExecutable() -{ - return (tclStubsPtr->tcl_GetNameOfExecutable)(); -} - -/* Slot 166 */ -Tcl_Obj * -Tcl_GetObjResult(interp) - Tcl_Interp * interp; -{ - return (tclStubsPtr->tcl_GetObjResult)(interp); -} - -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -/* Slot 167 */ -int -Tcl_GetOpenFile(interp, str, write, checkUsage, filePtr) - Tcl_Interp * interp; - char * str; - int write; - int checkUsage; - ClientData * filePtr; -{ - return (tclStubsPtr->tcl_GetOpenFile)(interp, str, write, checkUsage, filePtr); -} - -#endif /* UNIX */ -/* Slot 168 */ -Tcl_PathType -Tcl_GetPathType(path) - char * path; -{ - return (tclStubsPtr->tcl_GetPathType)(path); -} - -/* Slot 169 */ -int -Tcl_Gets(chan, dsPtr) - Tcl_Channel chan; - Tcl_DString * dsPtr; -{ - return (tclStubsPtr->tcl_Gets)(chan, dsPtr); -} - -/* Slot 170 */ -int -Tcl_GetsObj(chan, objPtr) - Tcl_Channel chan; - Tcl_Obj * objPtr; -{ - return (tclStubsPtr->tcl_GetsObj)(chan, objPtr); -} - -/* Slot 171 */ -int -Tcl_GetServiceMode() -{ - return (tclStubsPtr->tcl_GetServiceMode)(); -} - -/* Slot 172 */ -Tcl_Interp * -Tcl_GetSlave(interp, slaveName) - Tcl_Interp * interp; - char * slaveName; -{ - return (tclStubsPtr->tcl_GetSlave)(interp, slaveName); -} - -/* Slot 173 */ -Tcl_Channel -Tcl_GetStdChannel(type) - int type; -{ - return (tclStubsPtr->tcl_GetStdChannel)(type); -} - -/* Slot 174 */ -char * -Tcl_GetStringResult(interp) - Tcl_Interp * interp; -{ - return (tclStubsPtr->tcl_GetStringResult)(interp); -} - -/* Slot 175 */ -char * -Tcl_GetVar(interp, varName, flags) - Tcl_Interp * interp; - char * varName; - int flags; -{ - return (tclStubsPtr->tcl_GetVar)(interp, varName, flags); -} - -/* Slot 176 */ -char * -Tcl_GetVar2(interp, part1, part2, flags) - Tcl_Interp * interp; - char * part1; - char * part2; - int flags; -{ - return (tclStubsPtr->tcl_GetVar2)(interp, part1, part2, flags); -} - -/* Slot 177 */ -int -Tcl_GlobalEval(interp, command) - Tcl_Interp * interp; - char * command; -{ - return (tclStubsPtr->tcl_GlobalEval)(interp, command); -} - -/* Slot 178 */ -int -Tcl_GlobalEvalObj(interp, objPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; -{ - return (tclStubsPtr->tcl_GlobalEvalObj)(interp, objPtr); -} - -/* Slot 179 */ -int -Tcl_HideCommand(interp, cmdName, hiddenCmdToken) - Tcl_Interp * interp; - char * cmdName; - char * hiddenCmdToken; -{ - return (tclStubsPtr->tcl_HideCommand)(interp, cmdName, hiddenCmdToken); -} - -/* Slot 180 */ -int -Tcl_Init(interp) - Tcl_Interp * interp; -{ - return (tclStubsPtr->tcl_Init)(interp); -} - -/* Slot 181 */ -void -Tcl_InitHashTable(tablePtr, keyType) - Tcl_HashTable * tablePtr; - int keyType; -{ - (tclStubsPtr->tcl_InitHashTable)(tablePtr, keyType); -} - -/* Slot 182 */ -int -Tcl_InputBlocked(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_InputBlocked)(chan); -} - -/* Slot 183 */ -int -Tcl_InputBuffered(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_InputBuffered)(chan); -} - -/* Slot 184 */ -int -Tcl_InterpDeleted(interp) - Tcl_Interp * interp; -{ - return (tclStubsPtr->tcl_InterpDeleted)(interp); -} - -/* Slot 185 */ -int -Tcl_IsSafe(interp) - Tcl_Interp * interp; -{ - return (tclStubsPtr->tcl_IsSafe)(interp); -} - -/* Slot 186 */ -char * -Tcl_JoinPath(argc, argv, resultPtr) - int argc; - CONST char ** argv; - Tcl_DString * resultPtr; -{ - return (tclStubsPtr->tcl_JoinPath)(argc, argv, resultPtr); -} - -/* Slot 187 */ -int -Tcl_LinkVar(interp, varName, addr, type) - Tcl_Interp * interp; - char * varName; - char * addr; - int type; -{ - return (tclStubsPtr->tcl_LinkVar)(interp, varName, addr, type); -} - -/* Slot 188 is reserved */ -/* Slot 189 */ -Tcl_Channel -Tcl_MakeFileChannel(handle, mode) - ClientData handle; - int mode; -{ - return (tclStubsPtr->tcl_MakeFileChannel)(handle, mode); -} - -/* Slot 190 */ -int -Tcl_MakeSafe(interp) - Tcl_Interp * interp; -{ - return (tclStubsPtr->tcl_MakeSafe)(interp); -} - -/* Slot 191 */ -Tcl_Channel -Tcl_MakeTcpClientChannel(tcpSocket) - ClientData tcpSocket; -{ - return (tclStubsPtr->tcl_MakeTcpClientChannel)(tcpSocket); -} - -/* Slot 192 */ -char * -Tcl_Merge(argc, argv) - int argc; - char ** argv; -{ - return (tclStubsPtr->tcl_Merge)(argc, argv); -} - -/* Slot 193 */ -Tcl_HashEntry * -Tcl_NextHashEntry(searchPtr) - Tcl_HashSearch * searchPtr; -{ - return (tclStubsPtr->tcl_NextHashEntry)(searchPtr); -} - -/* Slot 194 */ -void -Tcl_NotifyChannel(channel, mask) - Tcl_Channel channel; - int mask; -{ - (tclStubsPtr->tcl_NotifyChannel)(channel, mask); -} - -/* Slot 195 */ -Tcl_Obj * -Tcl_ObjGetVar2(interp, part1Ptr, part2Ptr, flags) - Tcl_Interp * interp; - Tcl_Obj * part1Ptr; - Tcl_Obj * part2Ptr; - int flags; -{ - return (tclStubsPtr->tcl_ObjGetVar2)(interp, part1Ptr, part2Ptr, flags); -} - -/* Slot 196 */ -Tcl_Obj * -Tcl_ObjSetVar2(interp, part1Ptr, part2Ptr, newValuePtr, flags) - Tcl_Interp * interp; - Tcl_Obj * part1Ptr; - Tcl_Obj * part2Ptr; - Tcl_Obj * newValuePtr; - int flags; -{ - return (tclStubsPtr->tcl_ObjSetVar2)(interp, part1Ptr, part2Ptr, newValuePtr, flags); -} - -/* Slot 197 */ -Tcl_Channel -Tcl_OpenCommandChannel(interp, argc, argv, flags) - Tcl_Interp * interp; - int argc; - char ** argv; - int flags; -{ - return (tclStubsPtr->tcl_OpenCommandChannel)(interp, argc, argv, flags); -} - -/* Slot 198 */ -Tcl_Channel -Tcl_OpenFileChannel(interp, fileName, modeString, permissions) - Tcl_Interp * interp; - char * fileName; - char * modeString; - int permissions; -{ - return (tclStubsPtr->tcl_OpenFileChannel)(interp, fileName, modeString, permissions); -} - -/* Slot 199 */ -Tcl_Channel -Tcl_OpenTcpClient(interp, port, address, myaddr, myport, async) - Tcl_Interp * interp; - int port; - char * address; - char * myaddr; - int myport; - int async; -{ - return (tclStubsPtr->tcl_OpenTcpClient)(interp, port, address, myaddr, myport, async); -} - -/* Slot 200 */ -Tcl_Channel -Tcl_OpenTcpServer(interp, port, host, acceptProc, callbackData) - Tcl_Interp * interp; - int port; - char * host; - Tcl_TcpAcceptProc * acceptProc; - ClientData callbackData; -{ - return (tclStubsPtr->tcl_OpenTcpServer)(interp, port, host, acceptProc, callbackData); -} - -/* Slot 201 */ -void -Tcl_Preserve(data) - ClientData data; -{ - (tclStubsPtr->tcl_Preserve)(data); -} - -/* Slot 202 */ -void -Tcl_PrintDouble(interp, value, dst) - Tcl_Interp * interp; - double value; - char * dst; -{ - (tclStubsPtr->tcl_PrintDouble)(interp, value, dst); -} - -/* Slot 203 */ -int -Tcl_PutEnv(string) - CONST char * string; -{ - return (tclStubsPtr->tcl_PutEnv)(string); -} - -/* Slot 204 */ -char * -Tcl_PosixError(interp) - Tcl_Interp * interp; -{ - return (tclStubsPtr->tcl_PosixError)(interp); -} - -/* Slot 205 */ -void -Tcl_QueueEvent(evPtr, position) - Tcl_Event * evPtr; - Tcl_QueuePosition position; -{ - (tclStubsPtr->tcl_QueueEvent)(evPtr, position); -} - -/* Slot 206 */ -int -Tcl_Read(chan, bufPtr, toRead) - Tcl_Channel chan; - char * bufPtr; - int toRead; -{ - return (tclStubsPtr->tcl_Read)(chan, bufPtr, toRead); -} - -/* Slot 207 */ -void -Tcl_ReapDetachedProcs() -{ - (tclStubsPtr->tcl_ReapDetachedProcs)(); -} - -/* Slot 208 */ -int -Tcl_RecordAndEval(interp, cmd, flags) - Tcl_Interp * interp; - char * cmd; - int flags; -{ - return (tclStubsPtr->tcl_RecordAndEval)(interp, cmd, flags); -} - -/* Slot 209 */ -int -Tcl_RecordAndEvalObj(interp, cmdPtr, flags) - Tcl_Interp * interp; - Tcl_Obj * cmdPtr; - int flags; -{ - return (tclStubsPtr->tcl_RecordAndEvalObj)(interp, cmdPtr, flags); -} - -/* Slot 210 */ -void -Tcl_RegisterChannel(interp, chan) - Tcl_Interp * interp; - Tcl_Channel chan; -{ - (tclStubsPtr->tcl_RegisterChannel)(interp, chan); -} - -/* Slot 211 */ -void -Tcl_RegisterObjType(typePtr) - Tcl_ObjType * typePtr; -{ - (tclStubsPtr->tcl_RegisterObjType)(typePtr); -} - -/* Slot 212 */ -Tcl_RegExp -Tcl_RegExpCompile(interp, string) - Tcl_Interp * interp; - char * string; -{ - return (tclStubsPtr->tcl_RegExpCompile)(interp, string); -} - -/* Slot 213 */ -int -Tcl_RegExpExec(interp, regexp, str, start) - Tcl_Interp * interp; - Tcl_RegExp regexp; - CONST char * str; - CONST char * start; -{ - return (tclStubsPtr->tcl_RegExpExec)(interp, regexp, str, start); -} - -/* Slot 214 */ -int -Tcl_RegExpMatch(interp, str, pattern) - Tcl_Interp * interp; - char * str; - char * pattern; -{ - return (tclStubsPtr->tcl_RegExpMatch)(interp, str, pattern); -} - -/* Slot 215 */ -void -Tcl_RegExpRange(regexp, index, startPtr, endPtr) - Tcl_RegExp regexp; - int index; - char ** startPtr; - char ** endPtr; -{ - (tclStubsPtr->tcl_RegExpRange)(regexp, index, startPtr, endPtr); -} - -/* Slot 216 */ -void -Tcl_Release(clientData) - ClientData clientData; -{ - (tclStubsPtr->tcl_Release)(clientData); -} - -/* Slot 217 */ -void -Tcl_ResetResult(interp) - Tcl_Interp * interp; -{ - (tclStubsPtr->tcl_ResetResult)(interp); -} - -/* Slot 218 */ -int -Tcl_ScanElement(str, flagPtr) - CONST char * str; - int * flagPtr; -{ - return (tclStubsPtr->tcl_ScanElement)(str, flagPtr); -} - -/* Slot 219 */ -int -Tcl_ScanCountedElement(str, length, flagPtr) - CONST char * str; - int length; - int * flagPtr; -{ - return (tclStubsPtr->tcl_ScanCountedElement)(str, length, flagPtr); -} - -/* Slot 220 */ -int -Tcl_Seek(chan, offset, mode) - Tcl_Channel chan; - int offset; - int mode; -{ - return (tclStubsPtr->tcl_Seek)(chan, offset, mode); -} - -/* Slot 221 */ -int -Tcl_ServiceAll() -{ - return (tclStubsPtr->tcl_ServiceAll)(); -} - -/* Slot 222 */ -int -Tcl_ServiceEvent(flags) - int flags; -{ - return (tclStubsPtr->tcl_ServiceEvent)(flags); -} - -/* Slot 223 */ -void -Tcl_SetAssocData(interp, name, proc, clientData) - Tcl_Interp * interp; - char * name; - Tcl_InterpDeleteProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_SetAssocData)(interp, name, proc, clientData); -} - -/* Slot 224 */ -void -Tcl_SetChannelBufferSize(chan, sz) - Tcl_Channel chan; - int sz; -{ - (tclStubsPtr->tcl_SetChannelBufferSize)(chan, sz); -} - -/* Slot 225 */ -int -Tcl_SetChannelOption(interp, chan, optionName, newValue) - Tcl_Interp * interp; - Tcl_Channel chan; - char * optionName; - char * newValue; -{ - return (tclStubsPtr->tcl_SetChannelOption)(interp, chan, optionName, newValue); -} - -/* Slot 226 */ -int -Tcl_SetCommandInfo(interp, cmdName, infoPtr) - Tcl_Interp * interp; - char * cmdName; - Tcl_CmdInfo * infoPtr; -{ - return (tclStubsPtr->tcl_SetCommandInfo)(interp, cmdName, infoPtr); -} - -/* Slot 227 */ -void -Tcl_SetErrno(err) - int err; -{ - (tclStubsPtr->tcl_SetErrno)(err); -} - -/* Slot 228 */ -void -Tcl_SetErrorCode TCL_VARARGS_DEF(Tcl_Interp *,interp) -{ - Tcl_Interp * var; - va_list argList; - - var = (Tcl_Interp *) TCL_VARARGS_START(Tcl_Interp *,interp,argList); - - (tclStubsPtr->tcl_SetErrorCodeVA)(var, argList); - va_end(argList); -} - -/* Slot 229 */ -void -Tcl_SetMaxBlockTime(timePtr) - Tcl_Time * timePtr; -{ - (tclStubsPtr->tcl_SetMaxBlockTime)(timePtr); -} - -/* Slot 230 */ -void -Tcl_SetPanicProc(panicProc) - Tcl_PanicProc * panicProc; -{ - (tclStubsPtr->tcl_SetPanicProc)(panicProc); -} - -/* Slot 231 */ -int -Tcl_SetRecursionLimit(interp, depth) - Tcl_Interp * interp; - int depth; -{ - return (tclStubsPtr->tcl_SetRecursionLimit)(interp, depth); -} - -/* Slot 232 */ -void -Tcl_SetResult(interp, str, freeProc) - Tcl_Interp * interp; - char * str; - Tcl_FreeProc * freeProc; -{ - (tclStubsPtr->tcl_SetResult)(interp, str, freeProc); -} - -/* Slot 233 */ -int -Tcl_SetServiceMode(mode) - int mode; -{ - return (tclStubsPtr->tcl_SetServiceMode)(mode); -} - -/* Slot 234 */ -void -Tcl_SetObjErrorCode(interp, errorObjPtr) - Tcl_Interp * interp; - Tcl_Obj * errorObjPtr; -{ - (tclStubsPtr->tcl_SetObjErrorCode)(interp, errorObjPtr); -} - -/* Slot 235 */ -void -Tcl_SetObjResult(interp, resultObjPtr) - Tcl_Interp * interp; - Tcl_Obj * resultObjPtr; -{ - (tclStubsPtr->tcl_SetObjResult)(interp, resultObjPtr); -} - -/* Slot 236 */ -void -Tcl_SetStdChannel(channel, type) - Tcl_Channel channel; - int type; -{ - (tclStubsPtr->tcl_SetStdChannel)(channel, type); -} - -/* Slot 237 */ -char * -Tcl_SetVar(interp, varName, newValue, flags) - Tcl_Interp * interp; - char * varName; - char * newValue; - int flags; -{ - return (tclStubsPtr->tcl_SetVar)(interp, varName, newValue, flags); -} - -/* Slot 238 */ -char * -Tcl_SetVar2(interp, part1, part2, newValue, flags) - Tcl_Interp * interp; - char * part1; - char * part2; - char * newValue; - int flags; -{ - return (tclStubsPtr->tcl_SetVar2)(interp, part1, part2, newValue, flags); -} - -/* Slot 239 */ -char * -Tcl_SignalId(sig) - int sig; -{ - return (tclStubsPtr->tcl_SignalId)(sig); -} - -/* Slot 240 */ -char * -Tcl_SignalMsg(sig) - int sig; -{ - return (tclStubsPtr->tcl_SignalMsg)(sig); -} - -/* Slot 241 */ -void -Tcl_SourceRCFile(interp) - Tcl_Interp * interp; -{ - (tclStubsPtr->tcl_SourceRCFile)(interp); -} - -/* Slot 242 */ -int -Tcl_SplitList(interp, listStr, argcPtr, argvPtr) - Tcl_Interp * interp; - CONST char * listStr; - int * argcPtr; - char *** argvPtr; -{ - return (tclStubsPtr->tcl_SplitList)(interp, listStr, argcPtr, argvPtr); -} - -/* Slot 243 */ -void -Tcl_SplitPath(path, argcPtr, argvPtr) - CONST char * path; - int * argcPtr; - char *** argvPtr; -{ - (tclStubsPtr->tcl_SplitPath)(path, argcPtr, argvPtr); -} - -/* Slot 244 */ -void -Tcl_StaticPackage(interp, pkgName, initProc, safeInitProc) - Tcl_Interp * interp; - char * pkgName; - Tcl_PackageInitProc * initProc; - Tcl_PackageInitProc * safeInitProc; -{ - (tclStubsPtr->tcl_StaticPackage)(interp, pkgName, initProc, safeInitProc); -} - -/* Slot 245 */ -int -Tcl_StringMatch(str, pattern) - CONST char * str; - CONST char * pattern; -{ - return (tclStubsPtr->tcl_StringMatch)(str, pattern); -} - -/* Slot 246 */ -int -Tcl_Tell(chan) - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_Tell)(chan); -} - -/* Slot 247 */ -int -Tcl_TraceVar(interp, varName, flags, proc, clientData) - Tcl_Interp * interp; - char * varName; - int flags; - Tcl_VarTraceProc * proc; - ClientData clientData; -{ - return (tclStubsPtr->tcl_TraceVar)(interp, varName, flags, proc, clientData); -} - -/* Slot 248 */ -int -Tcl_TraceVar2(interp, part1, part2, flags, proc, clientData) - Tcl_Interp * interp; - char * part1; - char * part2; - int flags; - Tcl_VarTraceProc * proc; - ClientData clientData; -{ - return (tclStubsPtr->tcl_TraceVar2)(interp, part1, part2, flags, proc, clientData); -} - -/* Slot 249 */ -char * -Tcl_TranslateFileName(interp, name, bufferPtr) - Tcl_Interp * interp; - CONST char * name; - Tcl_DString * bufferPtr; -{ - return (tclStubsPtr->tcl_TranslateFileName)(interp, name, bufferPtr); -} - -/* Slot 250 */ -int -Tcl_Ungets(chan, str, len, atHead) - Tcl_Channel chan; - char * str; - int len; - int atHead; -{ - return (tclStubsPtr->tcl_Ungets)(chan, str, len, atHead); -} - -/* Slot 251 */ -void -Tcl_UnlinkVar(interp, varName) - Tcl_Interp * interp; - char * varName; -{ - (tclStubsPtr->tcl_UnlinkVar)(interp, varName); -} - -/* Slot 252 */ -int -Tcl_UnregisterChannel(interp, chan) - Tcl_Interp * interp; - Tcl_Channel chan; -{ - return (tclStubsPtr->tcl_UnregisterChannel)(interp, chan); -} - -/* Slot 253 */ -int -Tcl_UnsetVar(interp, varName, flags) - Tcl_Interp * interp; - char * varName; - int flags; -{ - return (tclStubsPtr->tcl_UnsetVar)(interp, varName, flags); -} - -/* Slot 254 */ -int -Tcl_UnsetVar2(interp, part1, part2, flags) - Tcl_Interp * interp; - char * part1; - char * part2; - int flags; -{ - return (tclStubsPtr->tcl_UnsetVar2)(interp, part1, part2, flags); -} - -/* Slot 255 */ -void -Tcl_UntraceVar(interp, varName, flags, proc, clientData) - Tcl_Interp * interp; - char * varName; - int flags; - Tcl_VarTraceProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_UntraceVar)(interp, varName, flags, proc, clientData); -} - -/* Slot 256 */ -void -Tcl_UntraceVar2(interp, part1, part2, flags, proc, clientData) - Tcl_Interp * interp; - char * part1; - char * part2; - int flags; - Tcl_VarTraceProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_UntraceVar2)(interp, part1, part2, flags, proc, clientData); -} - -/* Slot 257 */ -void -Tcl_UpdateLinkedVar(interp, varName) - Tcl_Interp * interp; - char * varName; -{ - (tclStubsPtr->tcl_UpdateLinkedVar)(interp, varName); -} - -/* Slot 258 */ -int -Tcl_UpVar(interp, frameName, varName, localName, flags) - Tcl_Interp * interp; - char * frameName; - char * varName; - char * localName; - int flags; -{ - return (tclStubsPtr->tcl_UpVar)(interp, frameName, varName, localName, flags); -} - -/* Slot 259 */ -int -Tcl_UpVar2(interp, frameName, part1, part2, localName, flags) - Tcl_Interp * interp; - char * frameName; - char * part1; - char * part2; - char * localName; - int flags; -{ - return (tclStubsPtr->tcl_UpVar2)(interp, frameName, part1, part2, localName, flags); -} - -/* Slot 260 */ -int -Tcl_VarEval TCL_VARARGS_DEF(Tcl_Interp *,interp) -{ - Tcl_Interp * var; - va_list argList; - int resultValue; - - var = (Tcl_Interp *) TCL_VARARGS_START(Tcl_Interp *,interp,argList); - - resultValue = (tclStubsPtr->tcl_VarEvalVA)(var, argList); - va_end(argList); -return resultValue; -} - -/* Slot 261 */ -ClientData -Tcl_VarTraceInfo(interp, varName, flags, procPtr, prevClientData) - Tcl_Interp * interp; - char * varName; - int flags; - Tcl_VarTraceProc * procPtr; - ClientData prevClientData; -{ - return (tclStubsPtr->tcl_VarTraceInfo)(interp, varName, flags, procPtr, prevClientData); -} - -/* Slot 262 */ -ClientData -Tcl_VarTraceInfo2(interp, part1, part2, flags, procPtr, prevClientData) - Tcl_Interp * interp; - char * part1; - char * part2; - int flags; - Tcl_VarTraceProc * procPtr; - ClientData prevClientData; -{ - return (tclStubsPtr->tcl_VarTraceInfo2)(interp, part1, part2, flags, procPtr, prevClientData); -} - -/* Slot 263 */ -int -Tcl_Write(chan, s, slen) - Tcl_Channel chan; - char * s; - int slen; -{ - return (tclStubsPtr->tcl_Write)(chan, s, slen); -} - -/* Slot 264 */ -void -Tcl_WrongNumArgs(interp, objc, objv, message) - Tcl_Interp * interp; - int objc; - Tcl_Obj *CONST objv[]; - char * message; -{ - (tclStubsPtr->tcl_WrongNumArgs)(interp, objc, objv, message); -} - -/* Slot 265 */ -int -Tcl_DumpActiveMemory(fileName) - char * fileName; -{ - return (tclStubsPtr->tcl_DumpActiveMemory)(fileName); -} - -/* Slot 266 */ -void -Tcl_ValidateAllMemory(file, line) - char * file; - int line; -{ - (tclStubsPtr->tcl_ValidateAllMemory)(file, line); -} - -/* Slot 267 */ -void -Tcl_AppendResultVA(interp, argList) - Tcl_Interp * interp; - va_list argList; -{ - (tclStubsPtr->tcl_AppendResultVA)(interp, argList); -} - -/* Slot 268 */ -void -Tcl_AppendStringsToObjVA(objPtr, argList) - Tcl_Obj * objPtr; - va_list argList; -{ - (tclStubsPtr->tcl_AppendStringsToObjVA)(objPtr, argList); -} - -/* Slot 269 */ -char * -Tcl_HashStats(tablePtr) - Tcl_HashTable * tablePtr; -{ - return (tclStubsPtr->tcl_HashStats)(tablePtr); -} - -/* Slot 270 */ -char * -Tcl_ParseVar(interp, str, termPtr) - Tcl_Interp * interp; - char * str; - char ** termPtr; -{ - return (tclStubsPtr->tcl_ParseVar)(interp, str, termPtr); -} - -/* Slot 271 */ -char * -Tcl_PkgPresent(interp, name, version, exact) - Tcl_Interp * interp; - char * name; - char * version; - int exact; -{ - return (tclStubsPtr->tcl_PkgPresent)(interp, name, version, exact); -} - -/* Slot 272 */ -char * -Tcl_PkgPresentEx(interp, name, version, exact, clientDataPtr) - Tcl_Interp * interp; - char * name; - char * version; - int exact; - ClientData * clientDataPtr; -{ - return (tclStubsPtr->tcl_PkgPresentEx)(interp, name, version, exact, clientDataPtr); -} - -/* Slot 273 */ -int -Tcl_PkgProvide(interp, name, version) - Tcl_Interp * interp; - char * name; - char * version; -{ - return (tclStubsPtr->tcl_PkgProvide)(interp, name, version); -} - -/* Slot 274 */ -char * -Tcl_PkgRequire(interp, name, version, exact) - Tcl_Interp * interp; - char * name; - char * version; - int exact; -{ - return (tclStubsPtr->tcl_PkgRequire)(interp, name, version, exact); -} - -/* Slot 275 */ -void -Tcl_SetErrorCodeVA(interp, argList) - Tcl_Interp * interp; - va_list argList; -{ - (tclStubsPtr->tcl_SetErrorCodeVA)(interp, argList); -} - -/* Slot 276 */ -int -Tcl_VarEvalVA(interp, argList) - Tcl_Interp * interp; - va_list argList; -{ - return (tclStubsPtr->tcl_VarEvalVA)(interp, argList); -} - -/* Slot 277 */ -Tcl_Pid -Tcl_WaitPid(pid, statPtr, options) - Tcl_Pid pid; - int * statPtr; - int options; -{ - return (tclStubsPtr->tcl_WaitPid)(pid, statPtr, options); -} - -/* Slot 278 */ -void -Tcl_PanicVA(format, argList) - char * format; - va_list argList; -{ - (tclStubsPtr->tcl_PanicVA)(format, argList); -} - -/* Slot 279 */ -void -Tcl_GetVersion(major, minor, patchLevel, type) - int * major; - int * minor; - int * patchLevel; - int * type; -{ - (tclStubsPtr->tcl_GetVersion)(major, minor, patchLevel, type); -} - -/* Slot 280 is reserved */ -/* Slot 281 is reserved */ -/* Slot 282 is reserved */ -/* Slot 283 is reserved */ -/* Slot 284 is reserved */ -/* Slot 285 is reserved */ -/* Slot 286 */ -void -Tcl_AppendObjToObj(objPtr, appendObjPtr) - Tcl_Obj * objPtr; - Tcl_Obj * appendObjPtr; -{ - (tclStubsPtr->tcl_AppendObjToObj)(objPtr, appendObjPtr); -} - -/* Slot 287 */ -Tcl_Encoding -Tcl_CreateEncoding(typePtr) - Tcl_EncodingType * typePtr; -{ - return (tclStubsPtr->tcl_CreateEncoding)(typePtr); -} - -/* Slot 288 */ -void -Tcl_CreateThreadExitHandler(proc, clientData) - Tcl_ExitProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_CreateThreadExitHandler)(proc, clientData); -} - -/* Slot 289 */ -void -Tcl_DeleteThreadExitHandler(proc, clientData) - Tcl_ExitProc * proc; - ClientData clientData; -{ - (tclStubsPtr->tcl_DeleteThreadExitHandler)(proc, clientData); -} - -/* Slot 290 */ -void -Tcl_DiscardResult(statePtr) - Tcl_SavedResult * statePtr; -{ - (tclStubsPtr->tcl_DiscardResult)(statePtr); -} - -/* Slot 291 */ -int -Tcl_EvalEx(interp, script, numBytes, flags) - Tcl_Interp * interp; - char * script; - int numBytes; - int flags; -{ - return (tclStubsPtr->tcl_EvalEx)(interp, script, numBytes, flags); -} - -/* Slot 292 */ -int -Tcl_EvalObjv(interp, objc, objv, flags) - Tcl_Interp * interp; - int objc; - Tcl_Obj *CONST objv[]; - int flags; -{ - return (tclStubsPtr->tcl_EvalObjv)(interp, objc, objv, flags); -} - -/* Slot 293 */ -int -Tcl_EvalObjEx(interp, objPtr, flags) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - int flags; -{ - return (tclStubsPtr->tcl_EvalObjEx)(interp, objPtr, flags); -} - -/* Slot 294 */ -void -Tcl_ExitThread(status) - int status; -{ - (tclStubsPtr->tcl_ExitThread)(status); -} - -/* Slot 295 */ -int -Tcl_ExternalToUtf(interp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr) - Tcl_Interp * interp; - Tcl_Encoding encoding; - CONST char * src; - int srcLen; - int flags; - Tcl_EncodingState * statePtr; - char * dst; - int dstLen; - int * srcReadPtr; - int * dstWrotePtr; - int * dstCharsPtr; -{ - return (tclStubsPtr->tcl_ExternalToUtf)(interp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr); -} - -/* Slot 296 */ -char * -Tcl_ExternalToUtfDString(encoding, src, srcLen, dsPtr) - Tcl_Encoding encoding; - CONST char * src; - int srcLen; - Tcl_DString * dsPtr; -{ - return (tclStubsPtr->tcl_ExternalToUtfDString)(encoding, src, srcLen, dsPtr); -} - -/* Slot 297 */ -void -Tcl_FinalizeThread() -{ - (tclStubsPtr->tcl_FinalizeThread)(); -} - -/* Slot 298 */ -void -Tcl_FinalizeNotifier(clientData) - ClientData clientData; -{ - (tclStubsPtr->tcl_FinalizeNotifier)(clientData); -} - -/* Slot 299 */ -void -Tcl_FreeEncoding(encoding) - Tcl_Encoding encoding; -{ - (tclStubsPtr->tcl_FreeEncoding)(encoding); -} - -/* Slot 300 */ -Tcl_ThreadId -Tcl_GetCurrentThread() -{ - return (tclStubsPtr->tcl_GetCurrentThread)(); -} - -/* Slot 301 */ -Tcl_Encoding -Tcl_GetEncoding(interp, name) - Tcl_Interp * interp; - CONST char * name; -{ - return (tclStubsPtr->tcl_GetEncoding)(interp, name); -} - -/* Slot 302 */ -char * -Tcl_GetEncodingName(encoding) - Tcl_Encoding encoding; -{ - return (tclStubsPtr->tcl_GetEncodingName)(encoding); -} - -/* Slot 303 */ -void -Tcl_GetEncodingNames(interp) - Tcl_Interp * interp; -{ - (tclStubsPtr->tcl_GetEncodingNames)(interp); -} - -/* Slot 304 */ -int -Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) - Tcl_Interp * interp; - Tcl_Obj * objPtr; - char ** tablePtr; - int offset; - char * msg; - int flags; - int * indexPtr; -{ - return (tclStubsPtr->tcl_GetIndexFromObjStruct)(interp, objPtr, tablePtr, offset, msg, flags, indexPtr); -} - -/* Slot 305 */ -VOID * -Tcl_GetThreadData(keyPtr, size) - Tcl_ThreadDataKey * keyPtr; - int size; -{ - return (tclStubsPtr->tcl_GetThreadData)(keyPtr, size); -} - -/* Slot 306 */ -Tcl_Obj * -Tcl_GetVar2Ex(interp, part1, part2, flags) - Tcl_Interp * interp; - char * part1; - char * part2; - int flags; -{ - return (tclStubsPtr->tcl_GetVar2Ex)(interp, part1, part2, flags); -} - -/* Slot 307 */ -ClientData -Tcl_InitNotifier() -{ - return (tclStubsPtr->tcl_InitNotifier)(); -} - -/* Slot 308 */ -void -Tcl_MutexLock(mutexPtr) - Tcl_Mutex * mutexPtr; -{ - (tclStubsPtr->tcl_MutexLock)(mutexPtr); -} - -/* Slot 309 */ -void -Tcl_MutexUnlock(mutexPtr) - Tcl_Mutex * mutexPtr; -{ - (tclStubsPtr->tcl_MutexUnlock)(mutexPtr); -} - -/* Slot 310 */ -void -Tcl_ConditionNotify(condPtr) - Tcl_Condition * condPtr; -{ - (tclStubsPtr->tcl_ConditionNotify)(condPtr); -} - -/* Slot 311 */ -void -Tcl_ConditionWait(condPtr, mutexPtr, timePtr) - Tcl_Condition * condPtr; - Tcl_Mutex * mutexPtr; - Tcl_Time * timePtr; -{ - (tclStubsPtr->tcl_ConditionWait)(condPtr, mutexPtr, timePtr); -} - -/* Slot 312 */ -int -Tcl_NumUtfChars(src, len) - CONST char * src; - int len; -{ - return (tclStubsPtr->tcl_NumUtfChars)(src, len); -} - -/* Slot 313 */ -int -Tcl_ReadChars(channel, objPtr, charsToRead, appendFlag) - Tcl_Channel channel; - Tcl_Obj * objPtr; - int charsToRead; - int appendFlag; -{ - return (tclStubsPtr->tcl_ReadChars)(channel, objPtr, charsToRead, appendFlag); -} - -/* Slot 314 */ -void -Tcl_RestoreResult(interp, statePtr) - Tcl_Interp * interp; - Tcl_SavedResult * statePtr; -{ - (tclStubsPtr->tcl_RestoreResult)(interp, statePtr); -} - -/* Slot 315 */ -void -Tcl_SaveResult(interp, statePtr) - Tcl_Interp * interp; - Tcl_SavedResult * statePtr; -{ - (tclStubsPtr->tcl_SaveResult)(interp, statePtr); -} - -/* Slot 316 */ -int -Tcl_SetSystemEncoding(interp, name) - Tcl_Interp * interp; - CONST char * name; -{ - return (tclStubsPtr->tcl_SetSystemEncoding)(interp, name); -} - -/* Slot 317 */ -Tcl_Obj * -Tcl_SetVar2Ex(interp, part1, part2, newValuePtr, flags) - Tcl_Interp * interp; - char * part1; - char * part2; - Tcl_Obj * newValuePtr; - int flags; -{ - return (tclStubsPtr->tcl_SetVar2Ex)(interp, part1, part2, newValuePtr, flags); -} - -/* Slot 318 */ -void -Tcl_ThreadAlert(threadId) - Tcl_ThreadId threadId; -{ - (tclStubsPtr->tcl_ThreadAlert)(threadId); -} - -/* Slot 319 */ -void -Tcl_ThreadQueueEvent(threadId, evPtr, position) - Tcl_ThreadId threadId; - Tcl_Event* evPtr; - Tcl_QueuePosition position; -{ - (tclStubsPtr->tcl_ThreadQueueEvent)(threadId, evPtr, position); -} - -/* Slot 320 */ -Tcl_UniChar -Tcl_UniCharAtIndex(src, index) - CONST char * src; - int index; -{ - return (tclStubsPtr->tcl_UniCharAtIndex)(src, index); -} - -/* Slot 321 */ -Tcl_UniChar -Tcl_UniCharToLower(ch) - int ch; -{ - return (tclStubsPtr->tcl_UniCharToLower)(ch); -} - -/* Slot 322 */ -Tcl_UniChar -Tcl_UniCharToTitle(ch) - int ch; -{ - return (tclStubsPtr->tcl_UniCharToTitle)(ch); -} - -/* Slot 323 */ -Tcl_UniChar -Tcl_UniCharToUpper(ch) - int ch; -{ - return (tclStubsPtr->tcl_UniCharToUpper)(ch); -} - -/* Slot 324 */ -int -Tcl_UniCharToUtf(ch, buf) - int ch; - char * buf; -{ - return (tclStubsPtr->tcl_UniCharToUtf)(ch, buf); -} - -/* Slot 325 */ -char * -Tcl_UtfAtIndex(src, index) - CONST char * src; - int index; -{ - return (tclStubsPtr->tcl_UtfAtIndex)(src, index); -} - -/* Slot 326 */ -int -Tcl_UtfCharComplete(src, len) - CONST char * src; - int len; -{ - return (tclStubsPtr->tcl_UtfCharComplete)(src, len); -} - -/* Slot 327 */ -int -Tcl_UtfBackslash(src, readPtr, dst) - CONST char * src; - int * readPtr; - char * dst; -{ - return (tclStubsPtr->tcl_UtfBackslash)(src, readPtr, dst); -} - -/* Slot 328 */ -char * -Tcl_UtfFindFirst(src, ch) - CONST char * src; - int ch; -{ - return (tclStubsPtr->tcl_UtfFindFirst)(src, ch); -} - -/* Slot 329 */ -char * -Tcl_UtfFindLast(src, ch) - CONST char * src; - int ch; -{ - return (tclStubsPtr->tcl_UtfFindLast)(src, ch); -} - -/* Slot 330 */ -char * -Tcl_UtfNext(src) - CONST char * src; -{ - return (tclStubsPtr->tcl_UtfNext)(src); -} - -/* Slot 331 */ -char * -Tcl_UtfPrev(src, start) - CONST char * src; - CONST char * start; -{ - return (tclStubsPtr->tcl_UtfPrev)(src, start); -} - -/* Slot 332 */ -int -Tcl_UtfToExternal(interp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr) - Tcl_Interp * interp; - Tcl_Encoding encoding; - CONST char * src; - int srcLen; - int flags; - Tcl_EncodingState * statePtr; - char * dst; - int dstLen; - int * srcReadPtr; - int * dstWrotePtr; - int * dstCharsPtr; -{ - return (tclStubsPtr->tcl_UtfToExternal)(interp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr); -} - -/* Slot 333 */ -char * -Tcl_UtfToExternalDString(encoding, src, srcLen, dsPtr) - Tcl_Encoding encoding; - CONST char * src; - int srcLen; - Tcl_DString * dsPtr; -{ - return (tclStubsPtr->tcl_UtfToExternalDString)(encoding, src, srcLen, dsPtr); -} - -/* Slot 334 */ -int -Tcl_UtfToLower(src) - char * src; -{ - return (tclStubsPtr->tcl_UtfToLower)(src); -} - -/* Slot 335 */ -int -Tcl_UtfToTitle(src) - char * src; -{ - return (tclStubsPtr->tcl_UtfToTitle)(src); -} - -/* Slot 336 */ -int -Tcl_UtfToUniChar(src, chPtr) - CONST char * src; - Tcl_UniChar * chPtr; -{ - return (tclStubsPtr->tcl_UtfToUniChar)(src, chPtr); -} - -/* Slot 337 */ -int -Tcl_UtfToUpper(src) - char * src; -{ - return (tclStubsPtr->tcl_UtfToUpper)(src); -} - -/* Slot 338 */ -int -Tcl_WriteChars(chan, src, srcLen) - Tcl_Channel chan; - CONST char * src; - int srcLen; -{ - return (tclStubsPtr->tcl_WriteChars)(chan, src, srcLen); -} - -/* Slot 339 */ -int -Tcl_WriteObj(chan, objPtr) - Tcl_Channel chan; - Tcl_Obj * objPtr; -{ - return (tclStubsPtr->tcl_WriteObj)(chan, objPtr); -} - -/* Slot 340 */ -char * -Tcl_GetString(objPtr) - Tcl_Obj * objPtr; -{ - return (tclStubsPtr->tcl_GetString)(objPtr); -} - -/* Slot 341 */ -char * -Tcl_GetDefaultEncodingDir() -{ - return (tclStubsPtr->tcl_GetDefaultEncodingDir)(); -} - -/* Slot 342 */ -void -Tcl_SetDefaultEncodingDir(path) - char * path; -{ - (tclStubsPtr->tcl_SetDefaultEncodingDir)(path); -} - -/* Slot 343 */ -void -Tcl_AlertNotifier(clientData) - ClientData clientData; -{ - (tclStubsPtr->tcl_AlertNotifier)(clientData); -} - -/* Slot 344 */ -void -Tcl_ServiceModeHook(mode) - int mode; -{ - (tclStubsPtr->tcl_ServiceModeHook)(mode); -} - - -/* !END!: Do not edit above this line. */ diff --git a/generic/tclTest.c b/generic/tclTest.c deleted file mode 100644 index 80b296a..0000000 --- a/generic/tclTest.c +++ /dev/null @@ -1,4226 +0,0 @@ -/* - * tclTest.c -- - * - * This file contains C command procedures for a bunch of additional - * Tcl commands that are used for testing out Tcl's C interfaces. - * These commands are not normally included in Tcl applications; - * they're only used for testing. - * - * Copyright (c) 1993-1994 The Regents of the University of California. - * Copyright (c) 1994-1997 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. - * - * RCS: @(#) $Id: tclTest.c,v 1.10 1999/04/16 00:46:54 stanton Exp $ - */ - -#define TCL_TEST - -#include "tclInt.h" -#include "tclPort.h" -#include "tclRegexp.h" -#include - -/* - * Declare external functions used in Windows tests. - */ - -#if defined(__WIN32__) -extern TclPlatformType *TclWinGetPlatform(void); -EXTERN void TclWinSetInterfaces(int); -#endif - -/* - * Dynamic string shared by TestdcallCmd and DelCallbackProc; used - * to collect the results of the various deletion callbacks. - */ - -static Tcl_DString delString; -static Tcl_Interp *delInterp; - -/* - * One of the following structures exists for each asynchronous - * handler created by the "testasync" command". - */ - -typedef struct TestAsyncHandler { - int id; /* Identifier for this handler. */ - Tcl_AsyncHandler handler; /* Tcl's token for the handler. */ - char *command; /* Command to invoke when the - * handler is invoked. */ - struct TestAsyncHandler *nextPtr; /* Next is list of handlers. */ -} TestAsyncHandler; - -static TestAsyncHandler *firstHandler = NULL; - -/* - * The dynamic string below is used by the "testdstring" command - * to test the dynamic string facilities. - */ - -static Tcl_DString dstring; - -/* - * The command trace below is used by the "testcmdtraceCmd" command - * to test the command tracing facilities. - */ - -static Tcl_Trace cmdTrace; - -/* - * One of the following structures exists for each command created - * by TestdelCmd: - */ - -typedef struct DelCmd { - Tcl_Interp *interp; /* Interpreter in which command exists. */ - char *deleteCmd; /* Script to execute when command is - * deleted. Malloc'ed. */ -} DelCmd; - -/* - * The following is used to keep track of an encoding that invokes a Tcl - * command. - */ - -typedef struct TclEncoding { - Tcl_Interp *interp; - char *toUtfCmd; - char *fromUtfCmd; -} TclEncoding; - -/* - * The counter below is used to determine if the TestsaveresultFree - * routine was called for a result. - */ - -static int freeCount; - -/* - * Forward declarations for procedures defined later in this file: - */ - -int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -static int AsyncHandlerProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int code)); -static void CleanupTestSetassocdataTests _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp)); -static void CmdDelProc1 _ANSI_ARGS_((ClientData clientData)); -static void CmdDelProc2 _ANSI_ARGS_((ClientData clientData)); -static int CmdProc1 _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -static int CmdProc2 _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -static void CmdTraceDeleteProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int level, char *command, Tcl_CmdProc *cmdProc, - ClientData cmdClientData, int argc, - char **argv)); -static void CmdTraceProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int level, char *command, - Tcl_CmdProc *cmdProc, ClientData cmdClientData, - int argc, char **argv)); -static int CreatedCommandProc _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int argc, char **argv)); -static int CreatedCommandProc2 _ANSI_ARGS_(( - ClientData clientData, Tcl_Interp *interp, - int argc, char **argv)); -static void DelCallbackProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp)); -static int DelCmdProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -static void DelDeleteProc _ANSI_ARGS_((ClientData clientData)); -static void EncodingFreeProc _ANSI_ARGS_((ClientData clientData)); -static int EncodingToUtfProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, - int dstLen, int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static int EncodingFromUtfProc _ANSI_ARGS_((ClientData clientData, - CONST char *src, int srcLen, int flags, - Tcl_EncodingState *statePtr, char *dst, - int dstLen, int *srcReadPtr, int *dstWrotePtr, - int *dstCharsPtr)); -static void ExitProcEven _ANSI_ARGS_((ClientData clientData)); -static void ExitProcOdd _ANSI_ARGS_((ClientData clientData)); -static int GetTimesCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -static int NoopCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -static int NoopObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static void PrintParse _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Parse *parsePtr)); -static void SpecialFree _ANSI_ARGS_((char *blockPtr)); -static int StaticInitProc _ANSI_ARGS_((Tcl_Interp *interp)); -static int TestaccessprocCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestAccessProc1 _ANSI_ARGS_((CONST char *path, - int mode)); -static int TestAccessProc2 _ANSI_ARGS_((CONST char *path, - int mode)); -static int TestAccessProc3 _ANSI_ARGS_((CONST char *path, - int mode)); -static int TestasyncCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestcmdinfoCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestcmdtokenCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestcmdtraceCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestchmodCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestcreatecommandCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestdcallCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestdelCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestdelassocdataCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestdstringCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestencodingObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestevalexObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestevalobjvObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestexithandlerCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestexprlongCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestexprparserObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestexprstringCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestfileCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestfeventCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestgetassocdataCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestgetplatformCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestgetvarfullnameCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int TestinterpdeleteCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestlinkCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestlocaleCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestMathFunc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, Tcl_Value *args, - Tcl_Value *resultPtr)); -static int TestMathFunc2 _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, Tcl_Value *args, - Tcl_Value *resultPtr)); -static Tcl_Channel TestOpenFileChannelProc1 _ANSI_ARGS_((Tcl_Interp *interp, - char *filename, char *modeString, int permissions)); -static Tcl_Channel TestOpenFileChannelProc2 _ANSI_ARGS_((Tcl_Interp *interp, - char *filename, char *modeString, int permissions)); -static Tcl_Channel TestOpenFileChannelProc3 _ANSI_ARGS_((Tcl_Interp *interp, - char *filename, char *modeString, int permissions)); -static int TestpanicCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestparserObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestparsevarObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestparsevarnameObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestregexpObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static void TestregexpXflags _ANSI_ARGS_((char *string, - int length, int *cflagsPtr, int *eflagsPtr)); -static int TestsaveresultCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static void TestsaveresultFree _ANSI_ARGS_((char *blockPtr)); -static int TestsetassocdataCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestsetCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestsetobjerrorcodeCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int TestopenfilechannelprocCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestsetplatformCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestsetrecursionlimitCmd _ANSI_ARGS_(( - ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[])); -static int TeststaticpkgCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestStatProc1 _ANSI_ARGS_((CONST char *path, - TclStat_ *buf)); -static int TestStatProc2 _ANSI_ARGS_((CONST char *path, - TclStat_ *buf)); -static int TestStatProc3 _ANSI_ARGS_((CONST char *path, - TclStat_ *buf)); -static int TeststatprocCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TesttranslatefilenameCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int TestupvarCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); - -/* - * External (platform specific) initialization routine, these declarations - * explicitly don't use EXTERN since this code does not get compiled - * into the library: - */ - -extern int TclplatformtestInit _ANSI_ARGS_((Tcl_Interp *interp)); -extern int TclThread_Init _ANSI_ARGS_((Tcl_Interp *interp)); - -/* - *---------------------------------------------------------------------- - * - * Tcltest_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. - * - *---------------------------------------------------------------------- - */ - -int -Tcltest_Init(interp) - Tcl_Interp *interp; /* Interpreter for application. */ -{ - Tcl_ValueType t3ArgTypes[2]; - - if (Tcl_PkgProvide(interp, "Tcltest", TCL_VERSION) == TCL_ERROR) { - return TCL_ERROR; - } - - /* - * Create additional commands and math functions for testing Tcl. - */ - - Tcl_CreateCommand(interp, "gettimes", GetTimesCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "noop", NoopCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "noop", NoopObjCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testaccessproc", TestaccessprocCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testasync", TestasyncCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testchannel", TclTestChannelCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testchannelevent", TclTestChannelEventCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testchmod", TestchmodCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testcmdtoken", TestcmdtokenCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testcmdinfo", TestcmdinfoCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testcmdtrace", TestcmdtraceCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testcreatecommand", TestcreatecommandCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testdcall", TestdcallCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testdel", TestdelCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testdelassocdata", TestdelassocdataCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_DStringInit(&dstring); - Tcl_CreateCommand(interp, "testdstring", TestdstringCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testencoding", TestencodingObjCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testevalex", TestevalexObjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testevalobjv", TestevalobjvObjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testexithandler", TestexithandlerCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testexprlong", TestexprlongCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testexprparser", TestexprparserObjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testexprstring", TestexprstringCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testfevent", TestfeventCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testfile", TestfileCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testgetassocdata", TestgetassocdataCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testgetplatform", TestgetplatformCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testgetvarfullname", - TestgetvarfullnameCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testinterpdelete", TestinterpdeleteCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testlink", TestlinkCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testlocale", TestlocaleCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testopenfilechannelproc", - TestopenfilechannelprocCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testpanic", TestpanicCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testparser", TestparserObjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testparsevar", TestparsevarObjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testparsevarname", TestparsevarnameObjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testregexp", TestregexpObjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testsaveresult", TestsaveresultCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testsetassocdata", TestsetassocdataCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testsetnoerr", TestsetCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testseterr", TestsetCmd, - (ClientData) TCL_LEAVE_ERR_MSG, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testsetobjerrorcode", - TestsetobjerrorcodeCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testsetrecursionlimit", - TestsetrecursionlimitCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "teststaticpkg", TeststaticpkgCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testtranslatefilename", - TesttranslatefilenameCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testupvar", TestupvarCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateMathFunc(interp, "T1", 0, (Tcl_ValueType *) NULL, TestMathFunc, - (ClientData) 123); - Tcl_CreateMathFunc(interp, "T2", 0, (Tcl_ValueType *) NULL, TestMathFunc, - (ClientData) 345); - Tcl_CreateCommand(interp, "teststatproc", TeststatprocCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - t3ArgTypes[0] = TCL_EITHER; - t3ArgTypes[1] = TCL_EITHER; - Tcl_CreateMathFunc(interp, "T3", 2, t3ArgTypes, TestMathFunc2, - (ClientData) 0); - -#ifdef TCL_THREADS - if (TclThread_Init(interp) != TCL_OK) { - return TCL_ERROR; - } -#endif - - /* - * And finally add any platform specific test commands. - */ - - return TclplatformtestInit(interp); -} - -/* - *---------------------------------------------------------------------- - * - * TestasyncCmd -- - * - * This procedure implements the "testasync" command. It is used - * to test the asynchronous handler facilities of Tcl. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates, deletes, and invokes handlers. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestasyncCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - TestAsyncHandler *asyncPtr, *prevPtr; - int id, code; - static int nextId = 1; - char buf[TCL_INTEGER_SPACE]; - - if (argc < 2) { - wrongNumArgs: - Tcl_SetResult(interp, "wrong # args", TCL_STATIC); - return TCL_ERROR; - } - if (strcmp(argv[1], "create") == 0) { - if (argc != 3) { - goto wrongNumArgs; - } - asyncPtr = (TestAsyncHandler *) ckalloc(sizeof(TestAsyncHandler)); - asyncPtr->id = nextId; - nextId++; - asyncPtr->handler = Tcl_AsyncCreate(AsyncHandlerProc, - (ClientData) asyncPtr); - asyncPtr->command = (char *) ckalloc((unsigned) (strlen(argv[2]) + 1)); - strcpy(asyncPtr->command, argv[2]); - asyncPtr->nextPtr = firstHandler; - firstHandler = asyncPtr; - TclFormatInt(buf, asyncPtr->id); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } else if (strcmp(argv[1], "delete") == 0) { - if (argc == 2) { - while (firstHandler != NULL) { - asyncPtr = firstHandler; - firstHandler = asyncPtr->nextPtr; - Tcl_AsyncDelete(asyncPtr->handler); - ckfree(asyncPtr->command); - ckfree((char *) asyncPtr); - } - return TCL_OK; - } - if (argc != 3) { - goto wrongNumArgs; - } - if (Tcl_GetInt(interp, argv[2], &id) != TCL_OK) { - return TCL_ERROR; - } - for (prevPtr = NULL, asyncPtr = firstHandler; asyncPtr != NULL; - prevPtr = asyncPtr, asyncPtr = asyncPtr->nextPtr) { - if (asyncPtr->id != id) { - continue; - } - if (prevPtr == NULL) { - firstHandler = asyncPtr->nextPtr; - } else { - prevPtr->nextPtr = asyncPtr->nextPtr; - } - Tcl_AsyncDelete(asyncPtr->handler); - ckfree(asyncPtr->command); - ckfree((char *) asyncPtr); - break; - } - } else if (strcmp(argv[1], "mark") == 0) { - if (argc != 5) { - goto wrongNumArgs; - } - if ((Tcl_GetInt(interp, argv[2], &id) != TCL_OK) - || (Tcl_GetInt(interp, argv[4], &code) != TCL_OK)) { - return TCL_ERROR; - } - for (asyncPtr = firstHandler; asyncPtr != NULL; - asyncPtr = asyncPtr->nextPtr) { - if (asyncPtr->id == id) { - Tcl_AsyncMark(asyncPtr->handler); - break; - } - } - Tcl_SetResult(interp, argv[3], TCL_VOLATILE); - return code; - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create, delete, int, or mark", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -static int -AsyncHandlerProc(clientData, interp, code) - ClientData clientData; /* Pointer to TestAsyncHandler structure. */ - Tcl_Interp *interp; /* Interpreter in which command was - * executed, or NULL. */ - int code; /* Current return code from command. */ -{ - TestAsyncHandler *asyncPtr = (TestAsyncHandler *) clientData; - char *listArgv[4]; - char string[TCL_INTEGER_SPACE], *cmd; - - TclFormatInt(string, code); - listArgv[0] = asyncPtr->command; - listArgv[1] = Tcl_GetStringResult(interp); - listArgv[2] = string; - listArgv[3] = NULL; - cmd = Tcl_Merge(3, listArgv); - code = Tcl_Eval(interp, cmd); - ckfree(cmd); - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TestcmdinfoCmd -- - * - * This procedure implements the "testcmdinfo" command. It is used - * to test Tcl_GetCommandInfo, Tcl_SetCommandInfo, and command creation - * and deletion. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates and deletes various commands and modifies their data. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestcmdinfoCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_CmdInfo info; - - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option cmdName\"", (char *) NULL); - return TCL_ERROR; - } - if (strcmp(argv[1], "create") == 0) { - Tcl_CreateCommand(interp, argv[2], CmdProc1, (ClientData) "original", - CmdDelProc1); - } else if (strcmp(argv[1], "delete") == 0) { - Tcl_DStringInit(&delString); - Tcl_DeleteCommand(interp, argv[2]); - Tcl_DStringResult(interp, &delString); - } else if (strcmp(argv[1], "get") == 0) { - if (Tcl_GetCommandInfo(interp, argv[2], &info) ==0) { - Tcl_SetResult(interp, "??", TCL_STATIC); - return TCL_OK; - } - if (info.proc == CmdProc1) { - Tcl_AppendResult(interp, "CmdProc1", " ", - (char *) info.clientData, (char *) NULL); - } else if (info.proc == CmdProc2) { - Tcl_AppendResult(interp, "CmdProc2", " ", - (char *) info.clientData, (char *) NULL); - } else { - Tcl_AppendResult(interp, "unknown", (char *) NULL); - } - if (info.deleteProc == CmdDelProc1) { - Tcl_AppendResult(interp, " CmdDelProc1", " ", - (char *) info.deleteData, (char *) NULL); - } else if (info.deleteProc == CmdDelProc2) { - Tcl_AppendResult(interp, " CmdDelProc2", " ", - (char *) info.deleteData, (char *) NULL); - } else { - Tcl_AppendResult(interp, " unknown", (char *) NULL); - } - Tcl_AppendResult(interp, " ", info.namespacePtr->fullName, - (char *) NULL); - if (info.isNativeObjectProc) { - Tcl_AppendResult(interp, " nativeObjectProc", (char *) NULL); - } else { - Tcl_AppendResult(interp, " stringProc", (char *) NULL); - } - } else if (strcmp(argv[1], "modify") == 0) { - info.proc = CmdProc2; - info.clientData = (ClientData) "new_command_data"; - info.objProc = NULL; - info.objClientData = (ClientData) NULL; - info.deleteProc = CmdDelProc2; - info.deleteData = (ClientData) "new_delete_data"; - if (Tcl_SetCommandInfo(interp, argv[2], &info) == 0) { - Tcl_SetResult(interp, "0", TCL_STATIC); - } else { - Tcl_SetResult(interp, "1", TCL_STATIC); - } - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create, delete, get, or modify", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - - /*ARGSUSED*/ -static int -CmdProc1(clientData, interp, argc, argv) - ClientData clientData; /* String to return. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_AppendResult(interp, "CmdProc1 ", (char *) clientData, - (char *) NULL); - return TCL_OK; -} - - /*ARGSUSED*/ -static int -CmdProc2(clientData, interp, argc, argv) - ClientData clientData; /* String to return. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_AppendResult(interp, "CmdProc2 ", (char *) clientData, - (char *) NULL); - return TCL_OK; -} - -static void -CmdDelProc1(clientData) - ClientData clientData; /* String to save. */ -{ - Tcl_DStringInit(&delString); - Tcl_DStringAppend(&delString, "CmdDelProc1 ", -1); - Tcl_DStringAppend(&delString, (char *) clientData, -1); -} - -static void -CmdDelProc2(clientData) - ClientData clientData; /* String to save. */ -{ - Tcl_DStringInit(&delString); - Tcl_DStringAppend(&delString, "CmdDelProc2 ", -1); - Tcl_DStringAppend(&delString, (char *) clientData, -1); -} - -/* - *---------------------------------------------------------------------- - * - * TestcmdtokenCmd -- - * - * This procedure implements the "testcmdtoken" command. It is used - * to test Tcl_Command tokens and procedures such as - * Tcl_GetCommandFullName. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates and deletes various commands and modifies their data. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestcmdtokenCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_Command token; - long int l; - char buf[30]; - - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option arg\"", (char *) NULL); - return TCL_ERROR; - } - if (strcmp(argv[1], "create") == 0) { - token = Tcl_CreateCommand(interp, argv[2], CmdProc1, - (ClientData) "original", (Tcl_CmdDeleteProc *) NULL); - sprintf(buf, "%lx", (long int) token); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } else if (strcmp(argv[1], "name") == 0) { - Tcl_Obj *objPtr; - - if (sscanf(argv[2], "%lx", &l) != 1) { - Tcl_AppendResult(interp, "bad command token \"", argv[2], - "\"", (char *) NULL); - return TCL_ERROR; - } - - objPtr = Tcl_NewObj(); - Tcl_GetCommandFullName(interp, (Tcl_Command) l, objPtr); - - Tcl_AppendElement(interp, - Tcl_GetCommandName(interp, (Tcl_Command) l)); - Tcl_AppendElement(interp, Tcl_GetString(objPtr)); - Tcl_DecrRefCount(objPtr); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create or name", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestcmdtraceCmd -- - * - * This procedure implements the "testcmdtrace" command. It is used - * to test Tcl_CreateTrace and Tcl_DeleteTrace. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates and deletes a command trace, and tests the invocation of - * a procedure by the command trace. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestcmdtraceCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_DString buffer; - int result; - - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option script\"", (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[1], "tracetest") == 0) { - Tcl_DStringInit(&buffer); - cmdTrace = Tcl_CreateTrace(interp, 50000, - (Tcl_CmdTraceProc *) CmdTraceProc, (ClientData) &buffer); - result = Tcl_Eval(interp, argv[2]); - if (result == TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL); - } - Tcl_DeleteTrace(interp, cmdTrace); - Tcl_DStringFree(&buffer); - } else if (strcmp(argv[1], "deletetest") == 0) { - /* - * Create a command trace then eval a script to check whether it is - * called. Note that this trace procedure removes itself as a - * further check of the robustness of the trace proc calling code in - * TclExecuteByteCode. - */ - - cmdTrace = Tcl_CreateTrace(interp, 50000, - (Tcl_CmdTraceProc *) CmdTraceDeleteProc, (ClientData) NULL); - Tcl_Eval(interp, argv[2]); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be tracetest or deletetest", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -static void -CmdTraceProc(clientData, interp, level, command, cmdProc, cmdClientData, - argc, argv) - ClientData clientData; /* Pointer to buffer in which the - * command and arguments are appended. - * Accumulates test result. */ - Tcl_Interp *interp; /* Current interpreter. */ - int level; /* Current trace level. */ - char *command; /* The command being traced (after - * substitutions). */ - Tcl_CmdProc *cmdProc; /* Points to command's command procedure. */ - ClientData cmdClientData; /* Client data associated with command - * procedure. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_DString *bufPtr = (Tcl_DString *) clientData; - int i; - - Tcl_DStringAppendElement(bufPtr, command); - - Tcl_DStringStartSublist(bufPtr); - for (i = 0; i < argc; i++) { - Tcl_DStringAppendElement(bufPtr, argv[i]); - } - Tcl_DStringEndSublist(bufPtr); -} - -static void -CmdTraceDeleteProc(clientData, interp, level, command, cmdProc, - cmdClientData, argc, argv) - ClientData clientData; /* Unused. */ - Tcl_Interp *interp; /* Current interpreter. */ - int level; /* Current trace level. */ - char *command; /* The command being traced (after - * substitutions). */ - Tcl_CmdProc *cmdProc; /* Points to command's command procedure. */ - ClientData cmdClientData; /* Client data associated with command - * procedure. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - /* - * Remove ourselves to test whether calling Tcl_DeleteTrace within - * a trace callback causes the for loop in TclExecuteByteCode that - * calls traces to reference freed memory. - */ - - Tcl_DeleteTrace(interp, cmdTrace); -} - -/* - *---------------------------------------------------------------------- - * - * TestcreatecommandCmd -- - * - * This procedure implements the "testcreatecommand" command. It is - * used to test that the Tcl_CreateCommand creates a new command in - * the namespace specified as part of its name, if any. It also - * checks that the namespace code ignore single ":"s in the middle - * or end of a command name. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates and deletes two commands ("test_ns_basic::createdcommand" - * and "value:at:"). - * - *---------------------------------------------------------------------- - */ - -static int -TestcreatecommandCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option\"", (char *) NULL); - return TCL_ERROR; - } - if (strcmp(argv[1], "create") == 0) { - Tcl_CreateCommand(interp, "test_ns_basic::createdcommand", - CreatedCommandProc, (ClientData) NULL, - (Tcl_CmdDeleteProc *) NULL); - } else if (strcmp(argv[1], "delete") == 0) { - Tcl_DeleteCommand(interp, "test_ns_basic::createdcommand"); - } else if (strcmp(argv[1], "create2") == 0) { - Tcl_CreateCommand(interp, "value:at:", - CreatedCommandProc2, (ClientData) NULL, - (Tcl_CmdDeleteProc *) NULL); - } else if (strcmp(argv[1], "delete2") == 0) { - Tcl_DeleteCommand(interp, "value:at:"); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create, delete, create2, or delete2", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -static int -CreatedCommandProc(clientData, interp, argc, argv) - ClientData clientData; /* String to return. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_CmdInfo info; - int found; - - found = Tcl_GetCommandInfo(interp, "test_ns_basic::createdcommand", - &info); - if (!found) { - Tcl_AppendResult(interp, "CreatedCommandProc could not get command info for test_ns_basic::createdcommand", - (char *) NULL); - return TCL_ERROR; - } - Tcl_AppendResult(interp, "CreatedCommandProc in ", - info.namespacePtr->fullName, (char *) NULL); - return TCL_OK; -} - -static int -CreatedCommandProc2(clientData, interp, argc, argv) - ClientData clientData; /* String to return. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_CmdInfo info; - int found; - - found = Tcl_GetCommandInfo(interp, "value:at:", &info); - if (!found) { - Tcl_AppendResult(interp, "CreatedCommandProc2 could not get command info for test_ns_basic::createdcommand", - (char *) NULL); - return TCL_ERROR; - } - Tcl_AppendResult(interp, "CreatedCommandProc2 in ", - info.namespacePtr->fullName, (char *) NULL); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestdcallCmd -- - * - * This procedure implements the "testdcall" command. It is used - * to test Tcl_CallWhenDeleted. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates and deletes interpreters. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestdcallCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - int i, id; - - delInterp = Tcl_CreateInterp(); - Tcl_DStringInit(&delString); - for (i = 1; i < argc; i++) { - if (Tcl_GetInt(interp, argv[i], &id) != TCL_OK) { - return TCL_ERROR; - } - if (id < 0) { - Tcl_DontCallWhenDeleted(delInterp, DelCallbackProc, - (ClientData) (-id)); - } else { - Tcl_CallWhenDeleted(delInterp, DelCallbackProc, - (ClientData) id); - } - } - Tcl_DeleteInterp(delInterp); - Tcl_DStringResult(interp, &delString); - return TCL_OK; -} - -/* - * The deletion callback used by TestdcallCmd: - */ - -static void -DelCallbackProc(clientData, interp) - ClientData clientData; /* Numerical value to append to - * delString. */ - Tcl_Interp *interp; /* Interpreter being deleted. */ -{ - int id = (int) clientData; - char buffer[TCL_INTEGER_SPACE]; - - TclFormatInt(buffer, id); - Tcl_DStringAppendElement(&delString, buffer); - if (interp != delInterp) { - Tcl_DStringAppendElement(&delString, "bogus interpreter argument!"); - } -} - -/* - *---------------------------------------------------------------------- - * - * TestdelCmd -- - * - * This procedure implements the "testdcall" command. It is used - * to test Tcl_CallWhenDeleted. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates and deletes interpreters. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestdelCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - DelCmd *dPtr; - Tcl_Interp *slave; - - if (argc != 4) { - Tcl_SetResult(interp, "wrong # args", TCL_STATIC); - return TCL_ERROR; - } - - slave = Tcl_GetSlave(interp, argv[1]); - if (slave == NULL) { - return TCL_ERROR; - } - - dPtr = (DelCmd *) ckalloc(sizeof(DelCmd)); - dPtr->interp = interp; - dPtr->deleteCmd = (char *) ckalloc((unsigned) (strlen(argv[3]) + 1)); - strcpy(dPtr->deleteCmd, argv[3]); - - Tcl_CreateCommand(slave, argv[2], DelCmdProc, (ClientData) dPtr, - DelDeleteProc); - return TCL_OK; -} - -static int -DelCmdProc(clientData, interp, argc, argv) - ClientData clientData; /* String result to return. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - DelCmd *dPtr = (DelCmd *) clientData; - - Tcl_AppendResult(interp, dPtr->deleteCmd, (char *) NULL); - ckfree(dPtr->deleteCmd); - ckfree((char *) dPtr); - return TCL_OK; -} - -static void -DelDeleteProc(clientData) - ClientData clientData; /* String command to evaluate. */ -{ - DelCmd *dPtr = (DelCmd *) clientData; - - Tcl_Eval(dPtr->interp, dPtr->deleteCmd); - Tcl_ResetResult(dPtr->interp); - ckfree(dPtr->deleteCmd); - ckfree((char *) dPtr); -} - -/* - *---------------------------------------------------------------------- - * - * TestdelassocdataCmd -- - * - * This procedure implements the "testdelassocdata" command. It is used - * to test Tcl_DeleteAssocData. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Deletes an association between a key and associated data from an - * interpreter. - * - *---------------------------------------------------------------------- - */ - -static int -TestdelassocdataCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " data_key\"", (char *) NULL); - return TCL_ERROR; - } - Tcl_DeleteAssocData(interp, argv[1]); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestdstringCmd -- - * - * This procedure implements the "testdstring" command. It is used - * to test the dynamic string facilities of Tcl. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates, deletes, and invokes handlers. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestdstringCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - int count; - - if (argc < 2) { - wrongNumArgs: - Tcl_SetResult(interp, "wrong # args", TCL_STATIC); - return TCL_ERROR; - } - if (strcmp(argv[1], "append") == 0) { - if (argc != 4) { - goto wrongNumArgs; - } - if (Tcl_GetInt(interp, argv[3], &count) != TCL_OK) { - return TCL_ERROR; - } - Tcl_DStringAppend(&dstring, argv[2], count); - } else if (strcmp(argv[1], "element") == 0) { - if (argc != 3) { - goto wrongNumArgs; - } - Tcl_DStringAppendElement(&dstring, argv[2]); - } else if (strcmp(argv[1], "end") == 0) { - if (argc != 2) { - goto wrongNumArgs; - } - Tcl_DStringEndSublist(&dstring); - } else if (strcmp(argv[1], "free") == 0) { - if (argc != 2) { - goto wrongNumArgs; - } - Tcl_DStringFree(&dstring); - } else if (strcmp(argv[1], "get") == 0) { - if (argc != 2) { - goto wrongNumArgs; - } - Tcl_SetResult(interp, Tcl_DStringValue(&dstring), TCL_VOLATILE); - } else if (strcmp(argv[1], "gresult") == 0) { - if (argc != 3) { - goto wrongNumArgs; - } - if (strcmp(argv[2], "staticsmall") == 0) { - Tcl_SetResult(interp, "short", TCL_STATIC); - } else if (strcmp(argv[2], "staticlarge") == 0) { - Tcl_SetResult(interp, "first0 first1 first2 first3 first4 first5 first6 first7 first8 first9\nsecond0 second1 second2 second3 second4 second5 second6 second7 second8 second9\nthird0 third1 third2 third3 third4 third5 third6 third7 third8 third9\nfourth0 fourth1 fourth2 fourth3 fourth4 fourth5 fourth6 fourth7 fourth8 fourth9\nfifth0 fifth1 fifth2 fifth3 fifth4 fifth5 fifth6 fifth7 fifth8 fifth9\nsixth0 sixth1 sixth2 sixth3 sixth4 sixth5 sixth6 sixth7 sixth8 sixth9\nseventh0 seventh1 seventh2 seventh3 seventh4 seventh5 seventh6 seventh7 seventh8 seventh9\n", TCL_STATIC); - } else if (strcmp(argv[2], "free") == 0) { - Tcl_SetResult(interp, (char *) ckalloc(100), TCL_DYNAMIC); - strcpy(interp->result, "This is a malloc-ed string"); - } else if (strcmp(argv[2], "special") == 0) { - interp->result = (char *) ckalloc(100); - interp->result += 4; - interp->freeProc = SpecialFree; - strcpy(interp->result, "This is a specially-allocated string"); - } else { - Tcl_AppendResult(interp, "bad gresult option \"", argv[2], - "\": must be staticsmall, staticlarge, free, or special", - (char *) NULL); - return TCL_ERROR; - } - Tcl_DStringGetResult(interp, &dstring); - } else if (strcmp(argv[1], "length") == 0) { - char buf[TCL_INTEGER_SPACE]; - - if (argc != 2) { - goto wrongNumArgs; - } - TclFormatInt(buf, Tcl_DStringLength(&dstring)); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } else if (strcmp(argv[1], "result") == 0) { - if (argc != 2) { - goto wrongNumArgs; - } - Tcl_DStringResult(interp, &dstring); - } else if (strcmp(argv[1], "trunc") == 0) { - if (argc != 3) { - goto wrongNumArgs; - } - if (Tcl_GetInt(interp, argv[2], &count) != TCL_OK) { - return TCL_ERROR; - } - Tcl_DStringTrunc(&dstring, count); - } else if (strcmp(argv[1], "start") == 0) { - if (argc != 2) { - goto wrongNumArgs; - } - Tcl_DStringStartSublist(&dstring); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be append, element, end, free, get, length, ", - "result, trunc, or start", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - * The procedure below is used as a special freeProc to test how well - * Tcl_DStringGetResult handles freeProc's other than free. - */ - -static void SpecialFree(blockPtr) - char *blockPtr; /* Block to free. */ -{ - ckfree(blockPtr - 4); -} - -/* - *---------------------------------------------------------------------- - * - * TestencodingCmd -- - * - * This procedure implements the "testencoding" command. It is used - * to test the encoding package. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Load encodings. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestencodingObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Encoding encoding; - int index, length; - char *string; - TclEncoding *encodingPtr; - static char *optionStrings[] = { - "create", "delete", "path", - NULL - }; - enum options { - ENC_CREATE, ENC_DELETE, ENC_PATH - }; - - if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - switch ((enum options) index) { - case ENC_CREATE: { - Tcl_EncodingType type; - - if (objc != 5) { - return TCL_ERROR; - } - encodingPtr = (TclEncoding *) ckalloc(sizeof(TclEncoding)); - encodingPtr->interp = interp; - - string = Tcl_GetStringFromObj(objv[3], &length); - encodingPtr->toUtfCmd = (char *) ckalloc((unsigned) (length + 1)); - memcpy(encodingPtr->toUtfCmd, string, (unsigned) length + 1); - - string = Tcl_GetStringFromObj(objv[4], &length); - encodingPtr->fromUtfCmd = (char *) ckalloc((unsigned) (length + 1)); - memcpy(encodingPtr->fromUtfCmd, string, (unsigned) (length + 1)); - - string = Tcl_GetStringFromObj(objv[2], &length); - - type.encodingName = string; - type.toUtfProc = EncodingToUtfProc; - type.fromUtfProc = EncodingFromUtfProc; - type.freeProc = EncodingFreeProc; - type.clientData = (ClientData) encodingPtr; - type.nullSize = 1; - - Tcl_CreateEncoding(&type); - break; - } - case ENC_DELETE: { - if (objc != 3) { - return TCL_ERROR; - } - encoding = Tcl_GetEncoding(NULL, Tcl_GetString(objv[2])); - Tcl_FreeEncoding(encoding); - Tcl_FreeEncoding(encoding); - break; - } - case ENC_PATH: { - if (objc == 2) { - Tcl_SetObjResult(interp, TclGetLibraryPath()); - } else { - TclSetLibraryPath(objv[2]); - } - break; - } - } - return TCL_OK; -} -static int -EncodingToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* TclEncoding structure. */ - CONST char *src; /* Source string in specified encoding. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Current state. */ - char *dst; /* Output buffer. */ - int dstLen; /* The maximum length of output buffer. */ - int *srcReadPtr; /* Filled with number of bytes read. */ - int *dstWrotePtr; /* Filled with number of bytes stored. */ - int *dstCharsPtr; /* Filled with number of chars stored. */ -{ - int len; - TclEncoding *encodingPtr; - - encodingPtr = (TclEncoding *) clientData; - Tcl_GlobalEval(encodingPtr->interp, encodingPtr->toUtfCmd); - - len = strlen(Tcl_GetStringResult(encodingPtr->interp)); - if (len > dstLen) { - len = dstLen; - } - memcpy(dst, Tcl_GetStringResult(encodingPtr->interp), (unsigned) len); - Tcl_ResetResult(encodingPtr->interp); - - *srcReadPtr = srcLen; - *dstWrotePtr = len; - *dstCharsPtr = len; - return TCL_OK; -} -static int -EncodingFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, - srcReadPtr, dstWrotePtr, dstCharsPtr) - ClientData clientData; /* TclEncoding structure. */ - CONST char *src; /* Source string in specified encoding. */ - int srcLen; /* Source string length in bytes. */ - int flags; /* Conversion control flags. */ - Tcl_EncodingState *statePtr;/* Current state. */ - char *dst; /* Output buffer. */ - int dstLen; /* The maximum length of output buffer. */ - int *srcReadPtr; /* Filled with number of bytes read. */ - int *dstWrotePtr; /* Filled with number of bytes stored. */ - int *dstCharsPtr; /* Filled with number of chars stored. */ -{ - int len; - TclEncoding *encodingPtr; - - encodingPtr = (TclEncoding *) clientData; - Tcl_GlobalEval(encodingPtr->interp, encodingPtr->fromUtfCmd); - - len = strlen(Tcl_GetStringResult(encodingPtr->interp)); - if (len > dstLen) { - len = dstLen; - } - memcpy(dst, Tcl_GetStringResult(encodingPtr->interp), (unsigned) len); - Tcl_ResetResult(encodingPtr->interp); - - *srcReadPtr = srcLen; - *dstWrotePtr = len; - *dstCharsPtr = len; - return TCL_OK; -} -static void -EncodingFreeProc(clientData) - ClientData clientData; /* ClientData associated with type. */ -{ - TclEncoding *encodingPtr; - - encodingPtr = (TclEncoding *) clientData; - ckfree((char *) encodingPtr->toUtfCmd); - ckfree((char *) encodingPtr->fromUtfCmd); - ckfree((char *) encodingPtr); -} - -/* - *---------------------------------------------------------------------- - * - * TestevalexObjCmd -- - * - * This procedure implements the "testevalex" command. It is - * used to test Tcl_EvalEx. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestevalexObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - int code, oldFlags, length, flags; - char *string; - - if (objc == 1) { - /* - * The command was invoked with no arguments, so just toggle - * the flag that determines whether we use Tcl_EvalEx. - */ - - if (iPtr->flags & USE_EVAL_DIRECT) { - iPtr->flags &= ~USE_EVAL_DIRECT; - Tcl_SetResult(interp, "disabling direct evaluation", TCL_STATIC); - } else { - iPtr->flags |= USE_EVAL_DIRECT; - Tcl_SetResult(interp, "enabling direct evaluation", TCL_STATIC); - } - return TCL_OK; - } - - flags = 0; - if (objc == 3) { - string = Tcl_GetStringFromObj(objv[2], &length); - if (strcmp(string, "global") != 0) { - Tcl_AppendResult(interp, "bad value \"", string, - "\": must be global", (char *) NULL); - return TCL_ERROR; - } - flags = TCL_EVAL_GLOBAL; - } else if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "script ?global?"); - return TCL_ERROR; - } - Tcl_SetResult(interp, "xxx", TCL_STATIC); - - /* - * Note, we have to set the USE_EVAL_DIRECT flag in the interpreter - * in addition to calling Tcl_EvalEx. This is needed so that even nested - * commands are evaluated directly. - */ - - oldFlags = iPtr->flags; - iPtr->flags |= USE_EVAL_DIRECT; - string = Tcl_GetStringFromObj(objv[1], &length); - code = Tcl_EvalEx(interp, string, length, flags); - iPtr->flags = (iPtr->flags & ~USE_EVAL_DIRECT) - | (oldFlags & USE_EVAL_DIRECT); - return code; -} - -/* - *---------------------------------------------------------------------- - * - * TestevalobjvObjCmd -- - * - * This procedure implements the "testevalobjv" command. It is - * used to test Tcl_EvalObjv. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestevalobjvObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int evalGlobal; - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 1, objv, "global word ?word ...?"); - return TCL_ERROR; - } - if (Tcl_GetIntFromObj(interp, objv[1], &evalGlobal) != TCL_OK) { - return TCL_ERROR; - } - return Tcl_EvalObjv(interp, objc-2, objv+2, - (evalGlobal) ? TCL_EVAL_GLOBAL : 0); -} - -/* - *---------------------------------------------------------------------- - * - * TestexithandlerCmd -- - * - * This procedure implements the "testexithandler" command. It is - * used to test Tcl_CreateExitHandler and Tcl_DeleteExitHandler. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestexithandlerCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - int value; - - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " create|delete value\"", (char *) NULL); - return TCL_ERROR; - } - if (Tcl_GetInt(interp, argv[2], &value) != TCL_OK) { - return TCL_ERROR; - } - if (strcmp(argv[1], "create") == 0) { - Tcl_CreateExitHandler((value & 1) ? ExitProcOdd : ExitProcEven, - (ClientData) value); - } else if (strcmp(argv[1], "delete") == 0) { - Tcl_DeleteExitHandler((value & 1) ? ExitProcOdd : ExitProcEven, - (ClientData) value); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be create or delete", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -static void -ExitProcOdd(clientData) - ClientData clientData; /* Integer value to print. */ -{ - char buf[16 + TCL_INTEGER_SPACE]; - - sprintf(buf, "odd %d\n", (int) clientData); - write(1, buf, strlen(buf)); -} - -static void -ExitProcEven(clientData) - ClientData clientData; /* Integer value to print. */ -{ - char buf[16 + TCL_INTEGER_SPACE]; - - sprintf(buf, "even %d\n", (int) clientData); - write(1, buf, strlen(buf)); -} - -/* - *---------------------------------------------------------------------- - * - * TestexprlongCmd -- - * - * This procedure verifies that Tcl_ExprLong does not modify the - * interpreter result if there is no error. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestexprlongCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - long exprResult; - char buf[4 + TCL_INTEGER_SPACE]; - int result; - - Tcl_SetResult(interp, "This is a result", TCL_STATIC); - result = Tcl_ExprLong(interp, "4+1", &exprResult); - if (result != TCL_OK) { - return result; - } - sprintf(buf, ": %ld", exprResult); - Tcl_AppendResult(interp, buf, NULL); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestexprstringCmd -- - * - * This procedure tests the basic operation of Tcl_ExprString. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestexprstringCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " expression\"", (char *) NULL); - return TCL_ERROR; - } - return Tcl_ExprString(interp, argv[1]); -} - -/* - *---------------------------------------------------------------------- - * - * TestgetassocdataCmd -- - * - * This procedure implements the "testgetassocdata" command. It is - * used to test Tcl_GetAssocData. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestgetassocdataCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - char *res; - - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " data_key\"", (char *) NULL); - return TCL_ERROR; - } - res = (char *) Tcl_GetAssocData(interp, argv[1], NULL); - if (res != NULL) { - Tcl_AppendResult(interp, res, NULL); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestgetplatformCmd -- - * - * This procedure implements the "testgetplatform" command. It is - * used to retrievel the value of the tclPlatform global variable. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestgetplatformCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - static char *platformStrings[] = { "unix", "mac", "windows" }; - TclPlatformType *platform; - -#ifdef __WIN32__ - platform = TclWinGetPlatform(); -#else - platform = &tclPlatform; -#endif - - if (argc != 1) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - (char *) NULL); - return TCL_ERROR; - } - - Tcl_AppendResult(interp, platformStrings[*platform], NULL); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestinterpdeleteCmd -- - * - * This procedure tests the code in tclInterp.c that deals with - * interpreter deletion. It deletes a user-specified interpreter - * from the hierarchy, and subsequent code checks integrity. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Deletes one or more interpreters. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestinterpdeleteCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_Interp *slaveToDelete; - - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " path\"", (char *) NULL); - return TCL_ERROR; - } - if (argv[1][0] == '\0') { - Tcl_AppendResult(interp, "cannot delete current interpreter", - (char *) NULL); - return TCL_ERROR; - } - slaveToDelete = Tcl_GetSlave(interp, argv[1]); - if (slaveToDelete == (Tcl_Interp *) NULL) { - return TCL_ERROR; - } - Tcl_DeleteInterp(slaveToDelete); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestlinkCmd -- - * - * This procedure implements the "testlink" command. It is used - * to test Tcl_LinkVar and related library procedures. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates and deletes various variable links, plus returns - * values of the linked variables. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestlinkCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - static int intVar = 43; - static int boolVar = 4; - static double realVar = 1.23; - static char *stringVar = NULL; - static int created = 0; - char buffer[TCL_DOUBLE_SPACE]; - int writable, flag; - - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option ?arg arg arg?\"", (char *) NULL); - return TCL_ERROR; - } - if (strcmp(argv[1], "create") == 0) { - if (created) { - Tcl_UnlinkVar(interp, "int"); - Tcl_UnlinkVar(interp, "real"); - Tcl_UnlinkVar(interp, "bool"); - Tcl_UnlinkVar(interp, "string"); - } - created = 1; - if (Tcl_GetBoolean(interp, argv[2], &writable) != TCL_OK) { - return TCL_ERROR; - } - flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY; - if (Tcl_LinkVar(interp, "int", (char *) &intVar, - TCL_LINK_INT | flag) != TCL_OK) { - return TCL_ERROR; - } - if (Tcl_GetBoolean(interp, argv[3], &writable) != TCL_OK) { - return TCL_ERROR; - } - flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY; - if (Tcl_LinkVar(interp, "real", (char *) &realVar, - TCL_LINK_DOUBLE | flag) != TCL_OK) { - return TCL_ERROR; - } - if (Tcl_GetBoolean(interp, argv[4], &writable) != TCL_OK) { - return TCL_ERROR; - } - flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY; - if (Tcl_LinkVar(interp, "bool", (char *) &boolVar, - TCL_LINK_BOOLEAN | flag) != TCL_OK) { - return TCL_ERROR; - } - if (Tcl_GetBoolean(interp, argv[5], &writable) != TCL_OK) { - return TCL_ERROR; - } - flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY; - if (Tcl_LinkVar(interp, "string", (char *) &stringVar, - TCL_LINK_STRING | flag) != TCL_OK) { - return TCL_ERROR; - } - } else if (strcmp(argv[1], "delete") == 0) { - Tcl_UnlinkVar(interp, "int"); - Tcl_UnlinkVar(interp, "real"); - Tcl_UnlinkVar(interp, "bool"); - Tcl_UnlinkVar(interp, "string"); - created = 0; - } else if (strcmp(argv[1], "get") == 0) { - TclFormatInt(buffer, intVar); - Tcl_AppendElement(interp, buffer); - Tcl_PrintDouble((Tcl_Interp *) NULL, realVar, buffer); - Tcl_AppendElement(interp, buffer); - TclFormatInt(buffer, boolVar); - Tcl_AppendElement(interp, buffer); - Tcl_AppendElement(interp, (stringVar == NULL) ? "-" : stringVar); - } else if (strcmp(argv[1], "set") == 0) { - if (argc != 6) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " ", argv[1], - "intValue realValue boolValue stringValue\"", (char *) NULL); - return TCL_ERROR; - } - if (argv[2][0] != 0) { - if (Tcl_GetInt(interp, argv[2], &intVar) != TCL_OK) { - return TCL_ERROR; - } - } - if (argv[3][0] != 0) { - if (Tcl_GetDouble(interp, argv[3], &realVar) != TCL_OK) { - return TCL_ERROR; - } - } - if (argv[4][0] != 0) { - if (Tcl_GetInt(interp, argv[4], &boolVar) != TCL_OK) { - return TCL_ERROR; - } - } - if (argv[5][0] != 0) { - if (stringVar != NULL) { - ckfree(stringVar); - } - if (strcmp(argv[5], "-") == 0) { - stringVar = NULL; - } else { - stringVar = (char *) ckalloc((unsigned) (strlen(argv[5]) + 1)); - strcpy(stringVar, argv[5]); - } - } - } else if (strcmp(argv[1], "update") == 0) { - if (argc != 6) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " ", argv[1], - "intValue realValue boolValue stringValue\"", (char *) NULL); - return TCL_ERROR; - } - if (argv[2][0] != 0) { - if (Tcl_GetInt(interp, argv[2], &intVar) != TCL_OK) { - return TCL_ERROR; - } - Tcl_UpdateLinkedVar(interp, "int"); - } - if (argv[3][0] != 0) { - if (Tcl_GetDouble(interp, argv[3], &realVar) != TCL_OK) { - return TCL_ERROR; - } - Tcl_UpdateLinkedVar(interp, "real"); - } - if (argv[4][0] != 0) { - if (Tcl_GetInt(interp, argv[4], &boolVar) != TCL_OK) { - return TCL_ERROR; - } - Tcl_UpdateLinkedVar(interp, "bool"); - } - if (argv[5][0] != 0) { - if (stringVar != NULL) { - ckfree(stringVar); - } - if (strcmp(argv[5], "-") == 0) { - stringVar = NULL; - } else { - stringVar = (char *) ckalloc((unsigned) (strlen(argv[5]) + 1)); - strcpy(stringVar, argv[5]); - } - Tcl_UpdateLinkedVar(interp, "string"); - } - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": should be create, delete, get, set, or update", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestlocaleCmd -- - * - * This procedure implements the "testlocale" command. It is used - * to test the effects of setting different locales in Tcl. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Modifies the current C locale. - * - *---------------------------------------------------------------------- - */ - -static int -TestlocaleCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - int index; - char *locale; - - static char *optionStrings[] = { - "ctype", "numeric", "time", "collate", "monetary", - "all", NULL - }; - static int lcTypes[] = { - LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, - LC_ALL - }; - - /* - * LC_CTYPE, etc. correspond to the indices for the strings. - */ - - if (objc < 2 || objc > 3) { - Tcl_WrongNumArgs(interp, 1, objv, "category ?locale?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - if (objc == 3) { - locale = Tcl_GetString(objv[2]); - } else { - locale = NULL; - } - locale = setlocale(lcTypes[index], locale); - if (locale) { - Tcl_SetStringObj(Tcl_GetObjResult(interp), locale, -1); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestMathFunc -- - * - * This is a user-defined math procedure to test out math procedures - * with no arguments. - * - * Results: - * A normal Tcl completion code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestMathFunc(clientData, interp, args, resultPtr) - ClientData clientData; /* Integer value to return. */ - Tcl_Interp *interp; /* Not used. */ - Tcl_Value *args; /* Not used. */ - Tcl_Value *resultPtr; /* Where to store result. */ -{ - resultPtr->type = TCL_INT; - resultPtr->intValue = (int) clientData; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestMathFunc2 -- - * - * This is a user-defined math procedure to test out math procedures - * that do have arguments, in this case 2. - * - * Results: - * A normal Tcl completion code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestMathFunc2(clientData, interp, args, resultPtr) - ClientData clientData; /* Integer value to return. */ - Tcl_Interp *interp; /* Used to report errors. */ - Tcl_Value *args; /* Points to an array of two - * Tcl_Value structs for the - * two arguments. */ - Tcl_Value *resultPtr; /* Where to store the result. */ -{ - int result = TCL_OK; - - /* - * Return the maximum of the two arguments with the correct type. - */ - - if (args[0].type == TCL_INT) { - int i0 = args[0].intValue; - - if (args[1].type == TCL_INT) { - int i1 = args[1].intValue; - - resultPtr->type = TCL_INT; - resultPtr->intValue = ((i0 > i1)? i0 : i1); - } else if (args[1].type == TCL_DOUBLE) { - double d0 = i0; - double d1 = args[1].doubleValue; - - resultPtr->type = TCL_DOUBLE; - resultPtr->doubleValue = ((d0 > d1)? d0 : d1); - } else { - Tcl_SetResult(interp, "T2: wrong type for arg 2", TCL_STATIC); - result = TCL_ERROR; - } - } else if (args[0].type == TCL_DOUBLE) { - double d0 = args[0].doubleValue; - - if (args[1].type == TCL_INT) { - double d1 = args[1].intValue; - - resultPtr->type = TCL_DOUBLE; - resultPtr->doubleValue = ((d0 > d1)? d0 : d1); - } else if (args[1].type == TCL_DOUBLE) { - double d1 = args[1].doubleValue; - - resultPtr->type = TCL_DOUBLE; - resultPtr->doubleValue = ((d0 > d1)? d0 : d1); - } else { - Tcl_SetResult(interp, "T2: wrong type for arg 2", TCL_STATIC); - result = TCL_ERROR; - } - } else { - Tcl_SetResult(interp, "T2: wrong type for arg 1", TCL_STATIC); - result = TCL_ERROR; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * CleanupTestSetassocdataTests -- - * - * This function is called when an interpreter is deleted to clean - * up any data left over from running the testsetassocdata command. - * - * Results: - * None. - * - * Side effects: - * Releases storage. - * - *---------------------------------------------------------------------- - */ - /* ARGSUSED */ -static void -CleanupTestSetassocdataTests(clientData, interp) - ClientData clientData; /* Data to be released. */ - Tcl_Interp *interp; /* Interpreter being deleted. */ -{ - ckfree((char *) clientData); -} - -/* - *---------------------------------------------------------------------- - * - * TestparserObjCmd -- - * - * This procedure implements the "testparser" command. It is - * used for testing the new Tcl script parser in Tcl 8.1. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestparserObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - char *script; - int length, dummy; - Tcl_Parse parse; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "script length"); - return TCL_ERROR; - } - script = Tcl_GetStringFromObj(objv[1], &dummy); - if (Tcl_GetIntFromObj(interp, objv[2], &length)) { - return TCL_ERROR; - } - if (length == 0) { - length = dummy; - } - if (Tcl_ParseCommand(interp, script, length, 0, &parse) != TCL_OK) { - Tcl_AddErrorInfo(interp, "\n (remainder of script: \""); - Tcl_AddErrorInfo(interp, parse.term); - Tcl_AddErrorInfo(interp, "\")"); - return TCL_ERROR; - } - - /* - * The parse completed successfully. Just print out the contents - * of the parse structure into the interpreter's result. - */ - - PrintParse(interp, &parse); - Tcl_FreeParse(&parse); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestexprparserObjCmd -- - * - * This procedure implements the "testexprparser" command. It is - * used for testing the new Tcl expression parser in Tcl 8.1. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestexprparserObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - char *script; - int length, dummy; - Tcl_Parse parse; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "expr length"); - return TCL_ERROR; - } - script = Tcl_GetStringFromObj(objv[1], &dummy); - if (Tcl_GetIntFromObj(interp, objv[2], &length)) { - return TCL_ERROR; - } - if (length == 0) { - length = dummy; - } - if (Tcl_ParseExpr(interp, script, length, &parse) != TCL_OK) { - Tcl_AddErrorInfo(interp, "\n (remainder of expr: \""); - Tcl_AddErrorInfo(interp, parse.term); - Tcl_AddErrorInfo(interp, "\")"); - return TCL_ERROR; - } - - /* - * The parse completed successfully. Just print out the contents - * of the parse structure into the interpreter's result. - */ - - PrintParse(interp, &parse); - Tcl_FreeParse(&parse); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * PrintParse -- - * - * This procedure prints out the contents of a Tcl_Parse structure - * in the result of an interpreter. - * - * Results: - * Interp's result is set to a prettily formatted version of the - * contents of parsePtr. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -PrintParse(interp, parsePtr) - Tcl_Interp *interp; /* Interpreter whose result is to be set to - * the contents of a parse structure. */ - Tcl_Parse *parsePtr; /* Parse structure to print out. */ -{ - Tcl_Obj *objPtr; - char *typeString; - Tcl_Token *tokenPtr; - int i; - - objPtr = Tcl_GetObjResult(interp); - if (parsePtr->commentSize > 0) { - Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr, - Tcl_NewStringObj(parsePtr->commentStart, - parsePtr->commentSize)); - } else { - Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr, - Tcl_NewStringObj("-", 1)); - } - Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr, - Tcl_NewStringObj(parsePtr->commandStart, parsePtr->commandSize)); - Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr, - Tcl_NewIntObj(parsePtr->numWords)); - for (i = 0; i < parsePtr->numTokens; i++) { - tokenPtr = &parsePtr->tokenPtr[i]; - switch (tokenPtr->type) { - case TCL_TOKEN_WORD: - typeString = "word"; - break; - case TCL_TOKEN_SIMPLE_WORD: - typeString = "simple"; - break; - case TCL_TOKEN_TEXT: - typeString = "text"; - break; - case TCL_TOKEN_BS: - typeString = "backslash"; - break; - case TCL_TOKEN_COMMAND: - typeString = "command"; - break; - case TCL_TOKEN_VARIABLE: - typeString = "variable"; - break; - case TCL_TOKEN_SUB_EXPR: - typeString = "subexpr"; - break; - case TCL_TOKEN_OPERATOR: - typeString = "operator"; - break; - default: - typeString = "??"; - break; - } - Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr, - Tcl_NewStringObj(typeString, -1)); - Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr, - Tcl_NewStringObj(tokenPtr->start, tokenPtr->size)); - Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr, - Tcl_NewIntObj(tokenPtr->numComponents)); - } - Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr, - Tcl_NewStringObj(parsePtr->commandStart + parsePtr->commandSize, - -1)); -} - -/* - *---------------------------------------------------------------------- - * - * TestparsevarObjCmd -- - * - * This procedure implements the "testparsevar" command. It is - * used for testing Tcl_ParseVar. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestparsevarObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - char *name, *value, *termPtr; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "varName"); - return TCL_ERROR; - } - name = Tcl_GetString(objv[1]); - value = Tcl_ParseVar(interp, name, &termPtr); - if (value == NULL) { - return TCL_ERROR; - } - - Tcl_AppendElement(interp, value); - Tcl_AppendElement(interp, termPtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestparsevarnameObjCmd -- - * - * This procedure implements the "testparsevarname" command. It is - * used for testing the new Tcl script parser in Tcl 8.1. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestparsevarnameObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - char *script; - int append, length, dummy; - Tcl_Parse parse; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 1, objv, "script length append"); - return TCL_ERROR; - } - script = Tcl_GetStringFromObj(objv[1], &dummy); - if (Tcl_GetIntFromObj(interp, objv[2], &length)) { - return TCL_ERROR; - } - if (length == 0) { - length = dummy; - } - if (Tcl_GetIntFromObj(interp, objv[3], &append)) { - return TCL_ERROR; - } - if (Tcl_ParseVarName(interp, script, length, &parse, append) != TCL_OK) { - Tcl_AddErrorInfo(interp, "\n (remainder of script: \""); - Tcl_AddErrorInfo(interp, parse.term); - Tcl_AddErrorInfo(interp, "\")"); - return TCL_ERROR; - } - - /* - * The parse completed successfully. Just print out the contents - * of the parse structure into the interpreter's result. - */ - - parse.commentSize = 0; - parse.commandStart = script + parse.tokenPtr->size; - parse.commandSize = 0; - PrintParse(interp, &parse); - Tcl_FreeParse(&parse); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestregexpObjCmd -- - * - * This procedure implements the "testregexp" command. It is - * used to give a direct interface for regexp flags. It's identical - * to Tcl_RegexpObjCmd except for the REGEXP_TEST define, which - * enables the -xflags option. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -TestregexpObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int i, result, indices, stringLength, wLen, match, about; - int hasxflags, cflags, eflags; - Tcl_RegExp regExpr; - char *string; - Tcl_DString stringBuffer, valueBuffer; - Tcl_UniChar *wStart; -# define REGEXP_TEST /* yes */ - static char *options[] = { - "-indices", "-nocase", "-about", "-expanded", - "-line", "-linestop", "-lineanchor", -#ifdef REGEXP_TEST - "-xflags", -#endif - "--", (char *) NULL - }; - enum options { - REGEXP_INDICES, REGEXP_NOCASE, REGEXP_ABOUT, REGEXP_EXPANDED, - REGEXP_MULTI, REGEXP_NOCROSS, REGEXP_NEWL, -#ifdef REGEXP_TEST - REGEXP_XFLAGS, -#endif - REGEXP_LAST - }; -#ifndef REGEXP_TEST -# define REGEXP_XFLAGS -1 /* impossible value */ -# define TestregexpXflags(a,b,c,d) /* do nothing */ -#endif - - indices = 0; - about = 0; - cflags = REG_ADVANCED; - eflags = 0; - hasxflags = 0; - - for (i = 1; i < objc; i++) { - char *name; - int index; - - name = Tcl_GetString(objv[i]); - if (name[0] != '-') { - break; - } - if (Tcl_GetIndexFromObj(interp, objv[i], options, "switch", TCL_EXACT, - &index) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum options) index) { - case REGEXP_INDICES: { - indices = 1; - break; - } - case REGEXP_NOCASE: { - cflags |= REG_ICASE; - break; - } - case REGEXP_ABOUT: { - about = 1; - break; - } - case REGEXP_EXPANDED: { - cflags |= REG_EXPANDED; - break; - } - case REGEXP_MULTI: { - cflags |= REG_NEWLINE; - break; - } - case REGEXP_NOCROSS: { - cflags |= REG_NLSTOP; - break; - } - case REGEXP_NEWL: { - cflags |= REG_NLANCH; - break; - } - case REGEXP_XFLAGS: { - hasxflags = 1; - break; - } - case REGEXP_LAST: { - i++; - goto endOfForLoop; - } - } - } - - endOfForLoop: - if (objc - i < hasxflags + 2 - about) { - Tcl_WrongNumArgs(interp, 1, objv, - "?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?"); - return TCL_ERROR; - } - objc -= i; - objv += i; - - if (hasxflags) { - string = Tcl_GetStringFromObj(objv[0], &stringLength); - TestregexpXflags(string, stringLength, &cflags, &eflags); - objc--; - objv++; - } - - regExpr = Tcl_GetRegExpFromObj(interp, objv[0], cflags); - if (regExpr == NULL) { - return TCL_ERROR; - } - - if (about) { - if (TclRegAbout(interp, regExpr) < 0) { - return TCL_ERROR; - } - return TCL_OK; - } - - result = TCL_OK; - string = Tcl_GetStringFromObj(objv[1], &stringLength); - - Tcl_DStringInit(&valueBuffer); - - Tcl_DStringInit(&stringBuffer); - wStart = Tcl_UtfToUniCharDString(string, stringLength, &stringBuffer); - wLen = Tcl_DStringLength(&stringBuffer) / sizeof(Tcl_UniChar); - - match = TclRegExpExecUniChar(interp, regExpr, wStart, wLen, objc-2, eflags); - if (match < 0) { - result = TCL_ERROR; - goto done; - } - if (match == 0) { - /* - * Set the interpreter's object result to an integer object w/ value 0. - */ - - Tcl_SetIntObj(Tcl_GetObjResult(interp), 0); - goto done; - } - - /* - * If additional variable names have been specified, return - * index information in those variables. - */ - - objc -= 2; - objv += 2; - - for (i = 0; i < objc; i++) { - char *varName, *value; - int start, end; - - varName = Tcl_GetString(objv[i]); - - TclRegExpRangeUniChar(regExpr, i, &start, &end); - if (start < 0) { - if (indices) { - value = Tcl_SetVar(interp, varName, "-1 -1", 0); - } else { - value = Tcl_SetVar(interp, varName, "", 0); - } - } else { - if (indices) { - char info[TCL_INTEGER_SPACE * 2]; - - sprintf(info, "%d %d", start, end - 1); - value = Tcl_SetVar(interp, varName, info, 0); - } else { - value = Tcl_UniCharToUtfDString(wStart + start, end - start, - &valueBuffer); - value = Tcl_SetVar(interp, varName, value, 0); - Tcl_DStringSetLength(&valueBuffer, 0); - } - } - if (value == NULL) { - Tcl_AppendResult(interp, "couldn't set variable \"", - varName, "\"", (char *) NULL); - result = TCL_ERROR; - goto done; - } - } - - /* - * Set the interpreter's object result to an integer object w/ value 1. - */ - - Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); - - done: - Tcl_DStringFree(&stringBuffer); - Tcl_DStringFree(&valueBuffer); - return result; -} - -/* - *--------------------------------------------------------------------------- - * - * TestregexpXflags -- - * - * Parse a string of extended regexp flag letters, for testing. - * - * Results: - * No return value (you're on your own for errors here). - * - * Side effects: - * Modifies *cflagsPtr, a regcomp flags word, and *eflagsPtr, a - * regexec flags word, as appropriate. - * - *---------------------------------------------------------------------- - */ - -static void -TestregexpXflags(string, length, cflagsPtr, eflagsPtr) - char *string; /* The string of flags. */ - int length; /* The length of the string in bytes. */ - int *cflagsPtr; /* compile flags word */ - int *eflagsPtr; /* exec flags word */ -{ - int i; - int cflags; - int eflags; - - cflags = *cflagsPtr; - eflags = *eflagsPtr; - for (i = 0; i < length; i++) { - switch (string[i]) { - case 'a': { - cflags |= REG_ADVF; - break; - } - case 'b': { - cflags &= ~REG_ADVANCED; - break; - } - case 'e': { - cflags &= ~REG_ADVANCED; - cflags |= REG_EXTENDED; - break; - } - case 'q': { - cflags &= ~REG_ADVANCED; - cflags |= REG_QUOTE; - break; - } - case 'o': { /* o for opaque */ - cflags |= REG_NOSUB; - break; - } - case '+': { - cflags |= REG_FAKEEC; - break; - } - case ',': { - cflags |= REG_PROGRESS; - break; - } - case '.': { - cflags |= REG_DUMP; - break; - } - case ':': { - eflags |= REG_MTRACE; - break; - } - case ';': { - eflags |= REG_FTRACE; - break; - } - case '^': { - eflags |= REG_NOTBOL; - break; - } - case '$': { - eflags |= REG_NOTEOL; - break; - } - case '%': { - eflags |= REG_SMALL; - break; - } - } - } - - *cflagsPtr = cflags; - *eflagsPtr = eflags; -} - -/* - *---------------------------------------------------------------------- - * - * TestsetassocdataCmd -- - * - * This procedure implements the "testsetassocdata" command. It is used - * to test Tcl_SetAssocData. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Modifies or creates an association between a key and associated - * data for this interpreter. - * - *---------------------------------------------------------------------- - */ - -static int -TestsetassocdataCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - char *buf; - char *oldData; - Tcl_InterpDeleteProc *procPtr; - - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " data_key data_item\"", (char *) NULL); - return TCL_ERROR; - } - - buf = ckalloc((unsigned) strlen(argv[2]) + 1); - strcpy(buf, argv[2]); - - /* - * If we previously associated a malloced value with the variable, - * free it before associating a new value. - */ - - oldData = (char *) Tcl_GetAssocData(interp, argv[1], &procPtr); - if ((oldData != NULL) && (procPtr == CleanupTestSetassocdataTests)) { - ckfree(oldData); - } - - Tcl_SetAssocData(interp, argv[1], CleanupTestSetassocdataTests, - (ClientData) buf); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestsetplatformCmd -- - * - * This procedure implements the "testsetplatform" command. It is - * used to change the tclPlatform global variable so all file - * name conversions can be tested on a single platform. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Sets the tclPlatform global variable. - * - *---------------------------------------------------------------------- - */ - -static int -TestsetplatformCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - size_t length; - TclPlatformType *platform; - -#ifdef __WIN32__ - platform = TclWinGetPlatform(); -#else - platform = &tclPlatform; -#endif - - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], - " platform\"", (char *) NULL); - return TCL_ERROR; - } - - length = strlen(argv[1]); - if (strncmp(argv[1], "unix", length) == 0) { - *platform = TCL_PLATFORM_UNIX; - } else if (strncmp(argv[1], "mac", length) == 0) { - *platform = TCL_PLATFORM_MAC; - } else if (strncmp(argv[1], "windows", length) == 0) { - *platform = TCL_PLATFORM_WINDOWS; - } else { - Tcl_AppendResult(interp, "unsupported platform: should be one of ", - "unix, mac, or windows", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestsetrecursionlimitCmd -- - * - * This procedure implements the "testsetrecursionlimit" command. It is - * used to change the interp recursion limit (to test the effects - * of Tcl_SetRecursionLimit). - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Sets the interp's recursion limit. - * - *---------------------------------------------------------------------- - */ - -static int -TestsetrecursionlimitCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - int value; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "integer"); - return TCL_ERROR; - } - if (Tcl_GetIntFromObj(interp, objv[1], &value) != TCL_OK) { - return TCL_ERROR; - } - value = Tcl_SetRecursionLimit(interp, value); - Tcl_SetIntObj(Tcl_GetObjResult(interp), value); - return TCL_OK; -} - - - -/* - *---------------------------------------------------------------------- - * - * TeststaticpkgCmd -- - * - * This procedure implements the "teststaticpkg" command. - * It is used to test the procedure Tcl_StaticPackage. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * When the packge given by argv[1] is loaded into an interpeter, - * variable "x" in that interpreter is set to "loaded". - * - *---------------------------------------------------------------------- - */ - -static int -TeststaticpkgCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - int safe, loaded; - - if (argc != 4) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", - argv[0], " pkgName safe loaded\"", (char *) NULL); - return TCL_ERROR; - } - if (Tcl_GetInt(interp, argv[2], &safe) != TCL_OK) { - return TCL_ERROR; - } - if (Tcl_GetInt(interp, argv[3], &loaded) != TCL_OK) { - return TCL_ERROR; - } - Tcl_StaticPackage((loaded) ? interp : NULL, argv[1], StaticInitProc, - (safe) ? StaticInitProc : NULL); - return TCL_OK; -} - -static int -StaticInitProc(interp) - Tcl_Interp *interp; /* Interpreter in which package - * is supposedly being loaded. */ -{ - Tcl_SetVar(interp, "x", "loaded", TCL_GLOBAL_ONLY); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TesttranslatefilenameCmd -- - * - * This procedure implements the "testtranslatefilename" command. - * It is used to test the Tcl_TranslateFileName command. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TesttranslatefilenameCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tcl_DString buffer; - char *result; - - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", - argv[0], " path\"", (char *) NULL); - return TCL_ERROR; - } - result = Tcl_TranslateFileName(interp, argv[1], &buffer); - if (result == NULL) { - return TCL_ERROR; - } - Tcl_AppendResult(interp, result, NULL); - Tcl_DStringFree(&buffer); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestupvarCmd -- - * - * This procedure implements the "testupvar2" command. It is used - * to test Tcl_UpVar and Tcl_UpVar2. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates or modifies an "upvar" reference. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestupvarCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - int flags = 0; - - if ((argc != 5) && (argc != 6)) { - Tcl_AppendResult(interp, "wrong # arguments: should be \"", - argv[0], " level name ?name2? dest global\"", (char *) NULL); - return TCL_ERROR; - } - - if (argc == 5) { - if (strcmp(argv[4], "global") == 0) { - flags = TCL_GLOBAL_ONLY; - } else if (strcmp(argv[4], "namespace") == 0) { - flags = TCL_NAMESPACE_ONLY; - } - return Tcl_UpVar(interp, argv[1], argv[2], argv[3], flags); - } else { - if (strcmp(argv[5], "global") == 0) { - flags = TCL_GLOBAL_ONLY; - } else if (strcmp(argv[5], "namespace") == 0) { - flags = TCL_NAMESPACE_ONLY; - } - return Tcl_UpVar2(interp, argv[1], argv[2], - (argv[3][0] == 0) ? (char *) NULL : argv[3], argv[4], - flags); - } -} - -/* - *---------------------------------------------------------------------- - * - * TestsetobjerrorcodeCmd -- - * - * This procedure implements the "testsetobjerrorcodeCmd". - * This tests up to five elements passed to the - * Tcl_SetObjErrorCode command. - * - * Results: - * A standard Tcl result. Always returns TCL_ERROR so that - * the error code can be tested. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestsetobjerrorcodeCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - Tcl_Obj *listObjPtr; - - if (objc > 1) { - listObjPtr = Tcl_ConcatObj(objc - 1, objv + 1); - } else { - listObjPtr = Tcl_NewObj(); - } - Tcl_IncrRefCount(listObjPtr); - Tcl_SetObjErrorCode(interp, listObjPtr); - Tcl_DecrRefCount(listObjPtr); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * TestfeventCmd -- - * - * This procedure implements the "testfevent" command. It is - * used for testing the "fileevent" command. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Creates and deletes interpreters. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestfeventCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - static Tcl_Interp *interp2 = NULL; - int code; - Tcl_Channel chan; - - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " option ?arg arg ...?", (char *) NULL); - return TCL_ERROR; - } - if (strcmp(argv[1], "cmd") == 0) { - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " cmd script", (char *) NULL); - return TCL_ERROR; - } - if (interp2 != (Tcl_Interp *) NULL) { - code = Tcl_GlobalEval(interp2, argv[2]); - Tcl_SetObjResult(interp, Tcl_GetObjResult(interp2)); - return code; - } else { - Tcl_AppendResult(interp, - "called \"testfevent code\" before \"testfevent create\"", - (char *) NULL); - return TCL_ERROR; - } - } else if (strcmp(argv[1], "create") == 0) { - if (interp2 != NULL) { - Tcl_DeleteInterp(interp2); - } - interp2 = Tcl_CreateInterp(); - return TCL_OK; - } else if (strcmp(argv[1], "delete") == 0) { - if (interp2 != NULL) { - Tcl_DeleteInterp(interp2); - } - interp2 = NULL; - } else if (strcmp(argv[1], "share") == 0) { - if (interp2 != NULL) { - chan = Tcl_GetChannel(interp, argv[2], NULL); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - Tcl_RegisterChannel(interp2, chan); - } - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestpanicCmd -- - * - * Calls the panic routine. - * - * Results: - * Always returns TCL_OK. - * - * Side effects: - * May exit application. - * - *---------------------------------------------------------------------- - */ - -static int -TestpanicCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - char *argString; - - /* - * Put the arguments into a var args structure - * Append all of the arguments together separated by spaces - */ - - argString = Tcl_Merge(argc-1, argv+1); - panic(argString); - ckfree(argString); - - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * TestchmodCmd -- - * - * Implements the "testchmod" cmd. Used when testing "file" - * command. The only attribute used by the Mac and Windows platforms - * is the user write flag; if this is not set, the file is - * made read-only. Otehrwise, the file is made read-write. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Changes permissions of specified files. - * - *--------------------------------------------------------------------------- - */ - -static int -TestchmodCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - int i, mode; - char *rest; - - if (argc < 2) { - usage: - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " mode file ?file ...?", (char *) NULL); - return TCL_ERROR; - } - - mode = (int) strtol(argv[1], &rest, 8); - if ((rest == argv[1]) || (*rest != '\0')) { - goto usage; - } - - for (i = 2; i < argc; i++) { - Tcl_DString buffer; - - argv[i] = Tcl_TranslateFileName(interp, argv[i], &buffer); - if (argv[i] == NULL) { - return TCL_ERROR; - } - if (chmod(argv[i], (unsigned) mode) != 0) { - Tcl_AppendResult(interp, argv[i], ": ", Tcl_PosixError(interp), - (char *) NULL); - return TCL_ERROR; - } - Tcl_DStringFree(&buffer); - } - return TCL_OK; -} - -static int -TestfileCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - int force, i, j, result; - Tcl_DString error, name[2]; - - if (argc < 3) { - return TCL_ERROR; - } - - force = 0; - i = 2; - if (strcmp(argv[2], "-force") == 0) { - force = 1; - i = 3; - } - - Tcl_DStringInit(&name[0]); - Tcl_DStringInit(&name[1]); - Tcl_DStringInit(&error); - - if (argc - i > 2) { - return TCL_ERROR; - } - - for (j = i; j < argc; j++) { - argv[j] = Tcl_TranslateFileName(interp, argv[j], &name[j - i]); - if (argv[j] == NULL) { - return TCL_ERROR; - } - } - - if (strcmp(argv[1], "mv") == 0) { - result = TclpRenameFile(argv[i], argv[i + 1]); - } else if (strcmp(argv[1], "cp") == 0) { - result = TclpCopyFile(argv[i], argv[i + 1]); - } else if (strcmp(argv[1], "rm") == 0) { - result = TclpDeleteFile(argv[i]); - } else if (strcmp(argv[1], "mkdir") == 0) { - result = TclpCreateDirectory(argv[i]); - } else if (strcmp(argv[1], "cpdir") == 0) { - result = TclpCopyDirectory(argv[i], argv[i + 1], &error); - } else if (strcmp(argv[1], "rmdir") == 0) { - result = TclpRemoveDirectory(argv[i], force, &error); - } else { - result = TCL_ERROR; - goto end; - } - - if (result != TCL_OK) { - if (Tcl_DStringValue(&error)[0] != '\0') { - Tcl_AppendResult(interp, Tcl_DStringValue(&error), " ", NULL); - } - Tcl_AppendResult(interp, Tcl_ErrnoId(), (char *) NULL); - } - - end: - Tcl_DStringFree(&error); - Tcl_DStringFree(&name[0]); - Tcl_DStringFree(&name[1]); - - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TestgetvarfullnameCmd -- - * - * Implements the "testgetvarfullname" cmd that is used when testing - * the Tcl_GetVariableFullName procedure. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestgetvarfullnameCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - char *name, *arg; - int flags = 0; - Tcl_Namespace *namespacePtr; - Tcl_CallFrame frame; - Tcl_Var variable; - int result; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "name scope"); - return TCL_ERROR; - } - - name = Tcl_GetString(objv[1]); - - arg = Tcl_GetString(objv[2]); - if (strcmp(arg, "global") == 0) { - flags = TCL_GLOBAL_ONLY; - } else if (strcmp(arg, "namespace") == 0) { - flags = TCL_NAMESPACE_ONLY; - } - - /* - * This command, like any other created with Tcl_Create[Obj]Command, - * runs in the global namespace. As a "namespace-aware" command that - * needs to run in a particular namespace, it must activate that - * namespace itself. - */ - - if (flags == TCL_NAMESPACE_ONLY) { - namespacePtr = Tcl_FindNamespace(interp, "::test_ns_var", - (Tcl_Namespace *) NULL, TCL_LEAVE_ERR_MSG); - if (namespacePtr == NULL) { - return TCL_ERROR; - } - result = Tcl_PushCallFrame(interp, &frame, namespacePtr, - /*isProcCallFrame*/ 0); - if (result != TCL_OK) { - return result; - } - } - - variable = Tcl_FindNamespaceVar(interp, name, (Tcl_Namespace *) NULL, - (flags | TCL_LEAVE_ERR_MSG)); - - if (flags == TCL_NAMESPACE_ONLY) { - Tcl_PopCallFrame(interp); - } - if (variable == (Tcl_Var) NULL) { - return TCL_ERROR; - } - Tcl_GetVariableFullName(interp, variable, Tcl_GetObjResult(interp)); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * GetTimesCmd -- - * - * This procedure implements the "gettimes" command. It is - * used for computing the time needed for various basic operations - * such as reading variables, allocating memory, sprintf, converting - * variables, etc. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Allocates and frees memory, sets a variable "a" in the interpreter. - * - *---------------------------------------------------------------------- - */ - -static int -GetTimesCmd(unused, interp, argc, argv) - ClientData unused; /* Unused. */ - Tcl_Interp *interp; /* The current interpreter. */ - int argc; /* The number of arguments. */ - char **argv; /* The argument strings. */ -{ - Interp *iPtr = (Interp *) interp; - int i, n; - double timePer; - Tcl_Time start, stop; - Tcl_Obj *objPtr; - Tcl_Obj **objv; - char *s; - char newString[TCL_INTEGER_SPACE]; - - /* alloc & free 100000 times */ - fprintf(stderr, "alloc & free 100000 6 word items\n"); - TclpGetTime(&start); - for (i = 0; i < 100000; i++) { - objPtr = (Tcl_Obj *) ckalloc(sizeof(Tcl_Obj)); - ckfree((char *) objPtr); - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per alloc+free\n", timePer/100000); - - /* alloc 5000 times */ - fprintf(stderr, "alloc 5000 6 word items\n"); - objv = (Tcl_Obj **) ckalloc(5000 * sizeof(Tcl_Obj *)); - TclpGetTime(&start); - for (i = 0; i < 5000; i++) { - objv[i] = (Tcl_Obj *) ckalloc(sizeof(Tcl_Obj)); - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per alloc\n", timePer/5000); - - /* free 5000 times */ - fprintf(stderr, "free 5000 6 word items\n"); - TclpGetTime(&start); - for (i = 0; i < 5000; i++) { - ckfree((char *) objv[i]); - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per free\n", timePer/5000); - - /* Tcl_NewObj 5000 times */ - fprintf(stderr, "Tcl_NewObj 5000 times\n"); - TclpGetTime(&start); - for (i = 0; i < 5000; i++) { - objv[i] = Tcl_NewObj(); - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per Tcl_NewObj\n", timePer/5000); - - /* Tcl_DecrRefCount 5000 times */ - fprintf(stderr, "Tcl_DecrRefCount 5000 times\n"); - TclpGetTime(&start); - for (i = 0; i < 5000; i++) { - objPtr = objv[i]; - Tcl_DecrRefCount(objPtr); - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per Tcl_DecrRefCount\n", timePer/5000); - ckfree((char *) objv); - - /* TclGetString 100000 times */ - fprintf(stderr, "TclGetStringFromObj of \"12345\" 100000 times\n"); - objPtr = Tcl_NewStringObj("12345", -1); - TclpGetTime(&start); - for (i = 0; i < 100000; i++) { - (void) TclGetString(objPtr); - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per TclGetStringFromObj of \"12345\"\n", - timePer/100000); - - /* Tcl_GetIntFromObj 100000 times */ - fprintf(stderr, "Tcl_GetIntFromObj of \"12345\" 100000 times\n"); - TclpGetTime(&start); - for (i = 0; i < 100000; i++) { - if (Tcl_GetIntFromObj(interp, objPtr, &n) != TCL_OK) { - return TCL_ERROR; - } - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per Tcl_GetIntFromObj of \"12345\"\n", - timePer/100000); - Tcl_DecrRefCount(objPtr); - - /* Tcl_GetInt 100000 times */ - fprintf(stderr, "Tcl_GetInt of \"12345\" 100000 times\n"); - TclpGetTime(&start); - for (i = 0; i < 100000; i++) { - if (Tcl_GetInt(interp, "12345", &n) != TCL_OK) { - return TCL_ERROR; - } - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per Tcl_GetInt of \"12345\"\n", - timePer/100000); - - /* sprintf 100000 times */ - fprintf(stderr, "sprintf of 12345 100000 times\n"); - TclpGetTime(&start); - for (i = 0; i < 100000; i++) { - sprintf(newString, "%d", 12345); - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per sprintf of 12345\n", - timePer/100000); - - /* hashtable lookup 100000 times */ - fprintf(stderr, "hashtable lookup of \"gettimes\" 100000 times\n"); - TclpGetTime(&start); - for (i = 0; i < 100000; i++) { - (void) Tcl_FindHashEntry(&iPtr->globalNsPtr->cmdTable, "gettimes"); - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per hashtable lookup of \"gettimes\"\n", - timePer/100000); - - /* Tcl_SetVar 100000 times */ - fprintf(stderr, "Tcl_SetVar of \"12345\" 100000 times\n"); - TclpGetTime(&start); - for (i = 0; i < 100000; i++) { - s = Tcl_SetVar(interp, "a", "12345", TCL_LEAVE_ERR_MSG); - if (s == NULL) { - return TCL_ERROR; - } - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per Tcl_SetVar of a to \"12345\"\n", - timePer/100000); - - /* Tcl_GetVar 100000 times */ - fprintf(stderr, "Tcl_GetVar of a==\"12345\" 100000 times\n"); - TclpGetTime(&start); - for (i = 0; i < 100000; i++) { - s = Tcl_GetVar(interp, "a", TCL_LEAVE_ERR_MSG); - if (s == NULL) { - return TCL_ERROR; - } - } - TclpGetTime(&stop); - timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec); - fprintf(stderr, " %.3f usec per Tcl_GetVar of a==\"12345\"\n", - timePer/100000); - - Tcl_ResetResult(interp); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NoopCmd -- - * - * This procedure is just used to time the overhead involved in - * parsing and invoking a command. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -NoopCmd(unused, interp, argc, argv) - ClientData unused; /* Unused. */ - Tcl_Interp *interp; /* The current interpreter. */ - int argc; /* The number of arguments. */ - char **argv; /* The argument strings. */ -{ - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * NoopObjCmd -- - * - * This object-based procedure is just used to time the overhead - * involved in parsing and invoking a command. - * - * Results: - * Returns the TCL_OK result code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -NoopObjCmd(unused, interp, objc, objv) - ClientData unused; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestsetCmd -- - * - * Implements the "testset{err,noerr}" cmds that are used when testing - * Tcl_Set/GetVar C Api with/without TCL_LEAVE_ERR_MSG flag - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Variables may be set. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestsetCmd(data, interp, argc, argv) - ClientData data; /* Additional flags for Get/SetVar2. */ - register Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - int flags = (int) data; - char *value; - - if (argc == 2) { - Tcl_SetResult(interp, "before get", TCL_STATIC); - value = Tcl_GetVar2(interp, argv[1], (char *) NULL, flags); - if (value == NULL) { - return TCL_ERROR; - } - Tcl_AppendElement(interp, value); - return TCL_OK; - } else if (argc == 3) { - Tcl_SetResult(interp, "before set", TCL_STATIC); - value = Tcl_SetVar2(interp, argv[1], (char *) NULL, argv[2], flags); - if (value == NULL) { - return TCL_ERROR; - } - Tcl_AppendElement(interp, value); - return TCL_OK; - } else { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " varName ?newValue?\"", (char *) NULL); - return TCL_ERROR; - } -} - -/* - *---------------------------------------------------------------------- - * - * TestsaveresultCmd -- - * - * Implements the "testsaveresult" cmd that is used when testing - * the Tcl_SaveResult, Tcl_RestoreResult, and - * Tcl_DiscardResult interfaces. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static int -TestsaveresultCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - register Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* The argument objects. */ -{ - int discard, result, index; - Tcl_SavedResult state; - Tcl_Obj *objPtr; - static char *optionStrings[] = { - "append", "dynamic", "free", "object", "small", NULL - }; - enum options { - RESULT_APPEND, RESULT_DYNAMIC, RESULT_FREE, RESULT_OBJECT, RESULT_SMALL - }; - - /* - * Parse arguments - */ - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 1, objv, "type script discard"); - return TCL_ERROR; - } - if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - if (Tcl_GetBooleanFromObj(interp, objv[3], &discard) != TCL_OK) { - return TCL_ERROR; - } - - objPtr = NULL; /* Lint. */ - switch ((enum options) index) { - case RESULT_SMALL: - Tcl_SetResult(interp, "small result", TCL_VOLATILE); - break; - case RESULT_APPEND: - Tcl_AppendResult(interp, "append result", NULL); - break; - case RESULT_FREE: { - char *buf = ckalloc(200); - strcpy(buf, "free result"); - Tcl_SetResult(interp, buf, TCL_DYNAMIC); - break; - } - case RESULT_DYNAMIC: - Tcl_SetResult(interp, "dynamic result", TestsaveresultFree); - break; - case RESULT_OBJECT: - objPtr = Tcl_NewStringObj("object result", -1); - Tcl_SetObjResult(interp, objPtr); - break; - } - - freeCount = 0; - Tcl_SaveResult(interp, &state); - - if (((enum options) index) == RESULT_OBJECT) { - result = Tcl_EvalObjEx(interp, objv[2], 0); - } else { - result = Tcl_Eval(interp, Tcl_GetString(objv[2])); - } - - if (discard) { - Tcl_DiscardResult(&state); - } else { - Tcl_RestoreResult(interp, &state); - result = TCL_OK; - } - - switch ((enum options) index) { - case RESULT_DYNAMIC: { - int present = interp->freeProc == TestsaveresultFree; - int called = freeCount; - Tcl_AppendElement(interp, called ? "called" : "notCalled"); - Tcl_AppendElement(interp, present ? "present" : "missing"); - break; - } - case RESULT_OBJECT: - Tcl_AppendElement(interp, Tcl_GetObjResult(interp) == objPtr - ? "same" : "different"); - break; - default: - break; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TestsaveresultFree -- - * - * Special purpose freeProc used by TestsaveresultCmd. - * - * Results: - * None. - * - * Side effects: - * Increments the freeCount. - * - *---------------------------------------------------------------------- - */ - -static void -TestsaveresultFree(blockPtr) - char *blockPtr; -{ - freeCount++; -} - -/* - *---------------------------------------------------------------------- - * - * TeststatprocCmd -- - * - * Implements the "testTclStatProc" cmd that is used to test the - * 'TclStatInsertProc' & 'TclStatDeleteProc' C Apis. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TeststatprocCmd (dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - register Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - TclStatProc_ *proc; - int retVal; - - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option arg\"", (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[2], "TclpStat") == 0) { - proc = TclpStat; - } else if (strcmp(argv[2], "TestStatProc1") == 0) { - proc = TestStatProc1; - } else if (strcmp(argv[2], "TestStatProc2") == 0) { - proc = TestStatProc2; - } else if (strcmp(argv[2], "TestStatProc3") == 0) { - proc = TestStatProc3; - } else { - Tcl_AppendResult(interp, "bad arg \"", argv[1], "\": ", - "must be TclpStat, ", - "TestStatProc1, TestStatProc2, or TestStatProc3", - (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[1], "insert") == 0) { - if (proc == TclpStat) { - Tcl_AppendResult(interp, "bad arg \"", argv[1], "\": ", - "must be ", - "TestStatProc1, TestStatProc2, or TestStatProc3", - (char *) NULL); - return TCL_ERROR; - } - retVal = TclStatInsertProc(proc); - } else if (strcmp(argv[1], "delete") == 0) { - retVal = TclStatDeleteProc(proc); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], "\": ", - "must be insert or delete", (char *) NULL); - return TCL_ERROR; - } - - if (retVal == TCL_ERROR) { - Tcl_AppendResult(interp, "\"", argv[2], "\": ", - "could not be ", argv[1], "ed", (char *) NULL); - } - - return retVal; -} - -/* Be careful in the compares in these tests, since the Macintosh puts a - * leading : in the beginning of non-absolute paths before passing them - * into the file command procedures. - */ - -static int -TestStatProc1(path, buf) - CONST char *path; - TclStat_ *buf; -{ - buf->st_size = 1234; - return ((strstr(path, "testStat1%.fil") == NULL) ? -1 : 0); -} - - -static int -TestStatProc2(path, buf) - CONST char *path; - TclStat_ *buf; -{ - buf->st_size = 2345; - return ((strstr(path, "testStat2%.fil") == NULL) ? -1 : 0); -} - - -static int -TestStatProc3(path, buf) - CONST char *path; - TclStat_ *buf; -{ - buf->st_size = 3456; - return ((strstr(path, "testStat3%.fil") == NULL) ? -1 : 0); -} - -/* - *---------------------------------------------------------------------- - * - * TestaccessprocCmd -- - * - * Implements the "testTclAccessProc" cmd that is used to test the - * 'TclAccessInsertProc' & 'TclAccessDeleteProc' C Apis. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestaccessprocCmd (dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - register Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - TclAccessProc_ *proc; - int retVal; - - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option arg\"", (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[2], "TclpAccess") == 0) { - proc = TclpAccess; - } else if (strcmp(argv[2], "TestAccessProc1") == 0) { - proc = TestAccessProc1; - } else if (strcmp(argv[2], "TestAccessProc2") == 0) { - proc = TestAccessProc2; - } else if (strcmp(argv[2], "TestAccessProc3") == 0) { - proc = TestAccessProc3; - } else { - Tcl_AppendResult(interp, "bad arg \"", argv[1], "\": ", - "must be TclpAccess, ", - "TestAccessProc1, TestAccessProc2, or TestAccessProc3", - (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[1], "insert") == 0) { - if (proc == TclpAccess) { - Tcl_AppendResult(interp, "bad arg \"", argv[1], "\": ", - "must be ", - "TestAccessProc1, TestAccessProc2, or TestAccessProc3", - (char *) NULL); - return TCL_ERROR; - } - retVal = TclAccessInsertProc(proc); - } else if (strcmp(argv[1], "delete") == 0) { - retVal = TclAccessDeleteProc(proc); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], "\": ", - "must be insert or delete", (char *) NULL); - return TCL_ERROR; - } - - if (retVal == TCL_ERROR) { - Tcl_AppendResult(interp, "\"", argv[2], "\": ", - "could not be ", argv[1], "ed", (char *) NULL); - } - - return retVal; -} - - -static int -TestAccessProc1(path, mode) - CONST char *path; - int mode; -{ - return ((strstr(path, "testAccess1%.fil") == NULL) ? -1 : 0); -} - - -static int -TestAccessProc2(path, mode) - CONST char *path; - int mode; -{ - return ((strstr(path, "testAccess2%.fil") == NULL) ? -1 : 0); -} - - -static int -TestAccessProc3(path, mode) - CONST char *path; - int mode; -{ - return ((strstr(path, "testAccess3%.fil") == NULL) ? -1 : 0); -} - -/* - *---------------------------------------------------------------------- - * - * TestopenfilechannelprocCmd -- - * - * Implements the "testTclOpenFileChannelProc" cmd that is used to test the - * 'TclOpenFileChannelInsertProc' & 'TclOpenFileChannelDeleteProc' C Apis. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TestopenfilechannelprocCmd (dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - register Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - TclOpenFileChannelProc_ *proc; - int retVal; - - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option arg\"", (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[2], "TclpOpenFileChannel") == 0) { - proc = TclpOpenFileChannel; - } else if (strcmp(argv[2], "TestOpenFileChannelProc1") == 0) { - proc = TestOpenFileChannelProc1; - } else if (strcmp(argv[2], "TestOpenFileChannelProc2") == 0) { - proc = TestOpenFileChannelProc2; - } else if (strcmp(argv[2], "TestOpenFileChannelProc3") == 0) { - proc = TestOpenFileChannelProc3; - } else { - Tcl_AppendResult(interp, "bad arg \"", argv[1], "\": ", - "must be TclpOpenFileChannel, ", - "TestOpenFileChannelProc1, TestOpenFileChannelProc2, or ", - "TestOpenFileChannelProc3", - (char *) NULL); - return TCL_ERROR; - } - - if (strcmp(argv[1], "insert") == 0) { - if (proc == TclpOpenFileChannel) { - Tcl_AppendResult(interp, "bad arg \"", argv[1], "\": ", - "must be ", - "TestOpenFileChannelProc1, TestOpenFileChannelProc2, or ", - "TestOpenFileChannelProc3", - (char *) NULL); - return TCL_ERROR; - } - retVal = TclOpenFileChannelInsertProc(proc); - } else if (strcmp(argv[1], "delete") == 0) { - retVal = TclOpenFileChannelDeleteProc(proc); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], "\": ", - "must be insert or delete", (char *) NULL); - return TCL_ERROR; - } - - if (retVal == TCL_ERROR) { - Tcl_AppendResult(interp, "\"", argv[2], "\": ", - "could not be ", argv[1], "ed", (char *) NULL); - } - - return retVal; -} - - -static Tcl_Channel -TestOpenFileChannelProc1(interp, fileName, modeString, permissions) - Tcl_Interp *interp; /* Interpreter for error reporting; - * can be NULL. */ - char *fileName; /* Name of file to open. */ - char *modeString; /* A list of POSIX open modes or - * a string such as "rw". */ - int permissions; /* If the open involves creating a - * file, with what modes to create - * it? */ -{ - if (!strcmp("testOpenFileChannel1%.fil", fileName)) { - return (TclpOpenFileChannel(interp, "__testOpenFileChannel1%__.fil", - modeString, permissions)); - } else { - return (NULL); - } -} - - -static Tcl_Channel -TestOpenFileChannelProc2(interp, fileName, modeString, permissions) - Tcl_Interp *interp; /* Interpreter for error reporting; - * can be NULL. */ - char *fileName; /* Name of file to open. */ - char *modeString; /* A list of POSIX open modes or - * a string such as "rw". */ - int permissions; /* If the open involves creating a - * file, with what modes to create - * it? */ -{ - if (!strcmp("testOpenFileChannel2%.fil", fileName)) { - return (TclpOpenFileChannel(interp, "__testOpenFileChannel2%__.fil", - modeString, permissions)); - } else { - return (NULL); - } -} - - -static Tcl_Channel -TestOpenFileChannelProc3(interp, fileName, modeString, permissions) - Tcl_Interp *interp; /* Interpreter for error reporting; - * can be NULL. */ - char *fileName; /* Name of file to open. */ - char *modeString; /* A list of POSIX open modes or - * a string such as "rw". */ - int permissions; /* If the open involves creating a - * file, with what modes to create - * it? */ -{ - if (!strcmp("testOpenFileChannel3%.fil", fileName)) { - return (TclpOpenFileChannel(interp, "__testOpenFileChannel3%__.fil", - modeString, permissions)); - } else { - return (NULL); - } -} diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c deleted file mode 100644 index d604c5b..0000000 --- a/generic/tclTestObj.c +++ /dev/null @@ -1,1110 +0,0 @@ -/* - * tclTestObj.c -- - * - * This file contains C command procedures for the additional Tcl - * commands that are used for testing implementations of the Tcl object - * types. These commands are not normally included in Tcl - * applications; they're only used for testing. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclTestObj.c,v 1.3 1999/04/16 00:46:54 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * An array of Tcl_Obj pointers used in the commands that operate on or get - * the values of Tcl object-valued variables. varPtr[i] is the i-th - * variable's Tcl_Obj *. - */ - -#define NUMBER_OF_OBJECT_VARS 20 -static Tcl_Obj *varPtr[NUMBER_OF_OBJECT_VARS]; - -/* - * Forward declarations for procedures defined later in this file: - */ - -static int CheckIfVarUnset _ANSI_ARGS_((Tcl_Interp *interp, - int varIndex)); -static int GetVariableIndex _ANSI_ARGS_((Tcl_Interp *interp, - char *string, int *indexPtr)); -static void SetVarToObj _ANSI_ARGS_((int varIndex, - Tcl_Obj *objPtr)); -int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -static int TestbooleanobjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestconvertobjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestdoubleobjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestindexobjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestintobjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TestobjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -static int TeststringobjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); - -/* - *---------------------------------------------------------------------- - * - * TclObjTest_Init -- - * - * This procedure creates additional commands that are used to test the - * Tcl object support. - * - * Results: - * Returns a standard Tcl completion code, and leaves an error - * message in the interp's result if an error occurs. - * - * Side effects: - * Creates and registers several new testing commands. - * - *---------------------------------------------------------------------- - */ - -int -TclObjTest_Init(interp) - Tcl_Interp *interp; -{ - register int i; - - for (i = 0; i < NUMBER_OF_OBJECT_VARS; i++) { - varPtr[i] = NULL; - } - - Tcl_CreateObjCommand(interp, "testbooleanobj", TestbooleanobjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testconvertobj", TestconvertobjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testdoubleobj", TestdoubleobjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testintobj", TestintobjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testindexobj", TestindexobjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "testobj", TestobjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateObjCommand(interp, "teststringobj", TeststringobjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestbooleanobjCmd -- - * - * This procedure implements the "testbooleanobj" command. It is used - * to test the boolean Tcl object type implementation. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * Creates and frees boolean objects, and also converts objects to - * have boolean type. - * - *---------------------------------------------------------------------- - */ - -static int -TestbooleanobjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int varIndex, boolValue; - char *index, *subCmd; - - if (objc < 3) { - wrongNumArgs: - Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); - return TCL_ERROR; - } - - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - - subCmd = Tcl_GetString(objv[1]); - if (strcmp(subCmd, "set") == 0) { - if (objc != 4) { - goto wrongNumArgs; - } - if (Tcl_GetBooleanFromObj(interp, objv[3], &boolValue) != TCL_OK) { - return TCL_ERROR; - } - - /* - * If the object currently bound to the variable with index varIndex - * has ref count 1 (i.e. the object is unshared) we can modify that - * object directly. Otherwise, if RC>1 (i.e. the object is shared), - * we must create a new object to modify/set and decrement the old - * formerly-shared object's ref count. This is "copy on write". - */ - - if ((varPtr[varIndex] != NULL) && !Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetBooleanObj(varPtr[varIndex], boolValue); - } else { - SetVarToObj(varIndex, Tcl_NewBooleanObj(boolValue)); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "get") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "not") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - if (Tcl_GetBooleanFromObj(interp, varPtr[varIndex], - &boolValue) != TCL_OK) { - return TCL_ERROR; - } - if (!Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetBooleanObj(varPtr[varIndex], !boolValue); - } else { - SetVarToObj(varIndex, Tcl_NewBooleanObj(!boolValue)); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad option \"", Tcl_GetString(objv[1]), - "\": must be set, get, or not", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestconvertobjCmd -- - * - * This procedure implements the "testconvertobj" command. It is used - * to test converting objects to new types. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * Converts objects to new types. - * - *---------------------------------------------------------------------- - */ - -static int -TestconvertobjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - char *subCmd; - char buf[20]; - - if (objc < 3) { - wrongNumArgs: - Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); - return TCL_ERROR; - } - - subCmd = Tcl_GetString(objv[1]); - if (strcmp(subCmd, "double") == 0) { - double d; - - if (objc != 3) { - goto wrongNumArgs; - } - if (Tcl_GetDoubleFromObj(interp, objv[2], &d) != TCL_OK) { - return TCL_ERROR; - } - sprintf(buf, "%f", d); - Tcl_AppendToObj(Tcl_GetObjResult(interp), buf, -1); - } else { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad option \"", Tcl_GetString(objv[1]), - "\": must be double", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestdoubleobjCmd -- - * - * This procedure implements the "testdoubleobj" command. It is used - * to test the double-precision floating point Tcl object type - * implementation. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * Creates and frees double objects, and also converts objects to - * have double type. - * - *---------------------------------------------------------------------- - */ - -static int -TestdoubleobjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int varIndex; - double doubleValue; - char *index, *subCmd, *string; - - if (objc < 3) { - wrongNumArgs: - Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); - return TCL_ERROR; - } - - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - - subCmd = Tcl_GetString(objv[1]); - if (strcmp(subCmd, "set") == 0) { - if (objc != 4) { - goto wrongNumArgs; - } - string = Tcl_GetString(objv[3]); - if (Tcl_GetDouble(interp, string, &doubleValue) != TCL_OK) { - return TCL_ERROR; - } - - /* - * If the object currently bound to the variable with index varIndex - * has ref count 1 (i.e. the object is unshared) we can modify that - * object directly. Otherwise, if RC>1 (i.e. the object is shared), - * we must create a new object to modify/set and decrement the old - * formerly-shared object's ref count. This is "copy on write". - */ - - if ((varPtr[varIndex] != NULL) && !Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetDoubleObj(varPtr[varIndex], doubleValue); - } else { - SetVarToObj(varIndex, Tcl_NewDoubleObj(doubleValue)); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "get") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "mult10") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - if (Tcl_GetDoubleFromObj(interp, varPtr[varIndex], - &doubleValue) != TCL_OK) { - return TCL_ERROR; - } - if (!Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetDoubleObj(varPtr[varIndex], (doubleValue * 10.0)); - } else { - SetVarToObj(varIndex, Tcl_NewDoubleObj( (doubleValue * 10.0) )); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "div10") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - if (Tcl_GetDoubleFromObj(interp, varPtr[varIndex], - &doubleValue) != TCL_OK) { - return TCL_ERROR; - } - if (!Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetDoubleObj(varPtr[varIndex], (doubleValue / 10.0)); - } else { - SetVarToObj(varIndex, Tcl_NewDoubleObj( (doubleValue / 10.0) )); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad option \"", Tcl_GetString(objv[1]), - "\": must be set, get, mult10, or div10", (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestindexobjCmd -- - * - * This procedure implements the "testindexobj" command. It is used to - * test the index Tcl object type implementation. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * Creates and frees int objects, and also converts objects to - * have int type. - * - *---------------------------------------------------------------------- - */ - -static int -TestindexobjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int allowAbbrev, index, index2, setError, i, result; - char **argv; - static char *tablePtr[] = {"a", "b", "check", (char *) NULL}; - - if ((objc == 3) && (strcmp(Tcl_GetString(objv[1]), - "check") == 0)) { - /* - * This code checks to be sure that the results of - * Tcl_GetIndexFromObj are properly cached in the object and - * returned on subsequent lookups. - */ - - Tcl_GetIndexFromObj((Tcl_Interp *) NULL, objv[1], tablePtr, - "token", 0, &index); - if (Tcl_GetIntFromObj(interp, objv[2], &index2) != TCL_OK) { - return TCL_ERROR; - } - objv[1]->internalRep.twoPtrValue.ptr2 = (VOID *) index2; - result = Tcl_GetIndexFromObj((Tcl_Interp *) NULL, objv[1], - tablePtr, "token", 0, &index); - if (result == TCL_OK) { - Tcl_SetIntObj(Tcl_GetObjResult(interp), index); - } - return result; - } - - if (objc < 5) { - Tcl_AppendToObj(Tcl_GetObjResult(interp), "wrong # args", -1); - return TCL_ERROR; - } - - if (Tcl_GetBooleanFromObj(interp, objv[1], &setError) != TCL_OK) { - return TCL_ERROR; - } - if (Tcl_GetBooleanFromObj(interp, objv[2], &allowAbbrev) != TCL_OK) { - return TCL_ERROR; - } - - argv = (char **) ckalloc((unsigned) ((objc-3) * sizeof(char *))); - for (i = 4; i < objc; i++) { - argv[i-4] = Tcl_GetString(objv[i]); - } - argv[objc-4] = NULL; - - /* - * Tcl_GetIndexFromObj assumes that the table is statically-allocated - * so that its address is different for each index object. If we - * accidently allocate a table at the same address as that cached in - * the index object, clear out the object's cached state. - */ - - if ((objv[3]->typePtr == Tcl_GetObjType("index")) - && (objv[3]->internalRep.twoPtrValue.ptr1 == (VOID *) argv)) { - objv[3]->typePtr = NULL; - } - - result = Tcl_GetIndexFromObj((setError? interp : NULL), objv[3], - argv, "token", (allowAbbrev? 0 : TCL_EXACT), &index); - ckfree((char *) argv); - if (result == TCL_OK) { - Tcl_SetIntObj(Tcl_GetObjResult(interp), index); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TestintobjCmd -- - * - * This procedure implements the "testintobj" command. It is used to - * test the int Tcl object type implementation. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * Creates and frees int objects, and also converts objects to - * have int type. - * - *---------------------------------------------------------------------- - */ - -static int -TestintobjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int intValue, varIndex, i; - long longValue; - char *index, *subCmd, *string; - - if (objc < 3) { - wrongNumArgs: - Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); - return TCL_ERROR; - } - - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - - subCmd = Tcl_GetString(objv[1]); - if (strcmp(subCmd, "set") == 0) { - if (objc != 4) { - goto wrongNumArgs; - } - string = Tcl_GetString(objv[3]); - if (Tcl_GetInt(interp, string, &i) != TCL_OK) { - return TCL_ERROR; - } - intValue = i; - - /* - * If the object currently bound to the variable with index varIndex - * has ref count 1 (i.e. the object is unshared) we can modify that - * object directly. Otherwise, if RC>1 (i.e. the object is shared), - * we must create a new object to modify/set and decrement the old - * formerly-shared object's ref count. This is "copy on write". - */ - - if ((varPtr[varIndex] != NULL) && !Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetIntObj(varPtr[varIndex], intValue); - } else { - SetVarToObj(varIndex, Tcl_NewIntObj(intValue)); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "set2") == 0) { /* doesn't set result */ - if (objc != 4) { - goto wrongNumArgs; - } - string = Tcl_GetString(objv[3]); - if (Tcl_GetInt(interp, string, &i) != TCL_OK) { - return TCL_ERROR; - } - intValue = i; - if ((varPtr[varIndex] != NULL) && !Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetIntObj(varPtr[varIndex], intValue); - } else { - SetVarToObj(varIndex, Tcl_NewIntObj(intValue)); - } - } else if (strcmp(subCmd, "setlong") == 0) { - if (objc != 4) { - goto wrongNumArgs; - } - string = Tcl_GetString(objv[3]); - if (Tcl_GetInt(interp, string, &i) != TCL_OK) { - return TCL_ERROR; - } - intValue = i; - if ((varPtr[varIndex] != NULL) && !Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetLongObj(varPtr[varIndex], intValue); - } else { - SetVarToObj(varIndex, Tcl_NewLongObj(intValue)); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "setmaxlong") == 0) { - long maxLong = LONG_MAX; - if (objc != 3) { - goto wrongNumArgs; - } - if ((varPtr[varIndex] != NULL) && !Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetLongObj(varPtr[varIndex], maxLong); - } else { - SetVarToObj(varIndex, Tcl_NewLongObj(maxLong)); - } - } else if (strcmp(subCmd, "ismaxlong") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - if (Tcl_GetLongFromObj(interp, varPtr[varIndex], &longValue) != TCL_OK) { - return TCL_ERROR; - } - Tcl_AppendToObj(Tcl_GetObjResult(interp), - ((longValue == LONG_MAX)? "1" : "0"), -1); - } else if (strcmp(subCmd, "get") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "get2") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - string = Tcl_GetString(varPtr[varIndex]); - Tcl_AppendToObj(Tcl_GetObjResult(interp), string, -1); - } else if (strcmp(subCmd, "inttoobigtest") == 0) { - /* - * If long ints have more bits than ints on this platform, verify - * that Tcl_GetIntFromObj returns an error if the long int held - * in an integer object's internal representation is too large - * to fit in an int. - */ - - if (objc != 3) { - goto wrongNumArgs; - } -#if (INT_MAX == LONG_MAX) /* int is same size as long int */ - Tcl_AppendToObj(Tcl_GetObjResult(interp), "1", -1); -#else - if ((varPtr[varIndex] != NULL) && !Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetLongObj(varPtr[varIndex], LONG_MAX); - } else { - SetVarToObj(varIndex, Tcl_NewLongObj(LONG_MAX)); - } - if (Tcl_GetIntFromObj(interp, varPtr[varIndex], &i) != TCL_OK) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), "1", -1); - return TCL_OK; - } - Tcl_AppendToObj(Tcl_GetObjResult(interp), "0", -1); -#endif - } else if (strcmp(subCmd, "mult10") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - if (Tcl_GetIntFromObj(interp, varPtr[varIndex], - &intValue) != TCL_OK) { - return TCL_ERROR; - } - if (!Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetIntObj(varPtr[varIndex], (intValue * 10)); - } else { - SetVarToObj(varIndex, Tcl_NewIntObj( (intValue * 10) )); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "div10") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - if (Tcl_GetIntFromObj(interp, varPtr[varIndex], - &intValue) != TCL_OK) { - return TCL_ERROR; - } - if (!Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetIntObj(varPtr[varIndex], (intValue / 10)); - } else { - SetVarToObj(varIndex, Tcl_NewIntObj( (intValue / 10) )); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad option \"", Tcl_GetString(objv[1]), - "\": must be set, get, get2, mult10, or div10", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TestobjCmd -- - * - * This procedure implements the "testobj" command. It is used to test - * the type-independent portions of the Tcl object type implementation. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * Creates and frees objects. - * - *---------------------------------------------------------------------- - */ - -static int -TestobjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int varIndex, destIndex, i; - char *index, *subCmd, *string; - Tcl_ObjType *targetType; - - if (objc < 2) { - wrongNumArgs: - Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); - return TCL_ERROR; - } - - subCmd = Tcl_GetString(objv[1]); - if (strcmp(subCmd, "assign") == 0) { - if (objc != 4) { - goto wrongNumArgs; - } - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - string = Tcl_GetString(objv[3]); - if (GetVariableIndex(interp, string, &destIndex) != TCL_OK) { - return TCL_ERROR; - } - SetVarToObj(destIndex, varPtr[varIndex]); - Tcl_SetObjResult(interp, varPtr[destIndex]); - } else if (strcmp(subCmd, "convert") == 0) { - char *typeName; - if (objc != 4) { - goto wrongNumArgs; - } - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - typeName = Tcl_GetString(objv[3]); - if ((targetType = Tcl_GetObjType(typeName)) == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "no type ", typeName, " found", (char *) NULL); - return TCL_ERROR; - } - if (Tcl_ConvertToType(interp, varPtr[varIndex], targetType) - != TCL_OK) { - return TCL_ERROR; - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "duplicate") == 0) { - if (objc != 4) { - goto wrongNumArgs; - } - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - string = Tcl_GetString(objv[3]); - if (GetVariableIndex(interp, string, &destIndex) != TCL_OK) { - return TCL_ERROR; - } - SetVarToObj(destIndex, Tcl_DuplicateObj(varPtr[varIndex])); - Tcl_SetObjResult(interp, varPtr[destIndex]); - } else if (strcmp(subCmd, "freeallvars") == 0) { - if (objc != 2) { - goto wrongNumArgs; - } - for (i = 0; i < NUMBER_OF_OBJECT_VARS; i++) { - if (varPtr[i] != NULL) { - Tcl_DecrRefCount(varPtr[i]); - varPtr[i] = NULL; - } - } - } else if (strcmp(subCmd, "newobj") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - SetVarToObj(varIndex, Tcl_NewObj()); - Tcl_SetObjResult(interp, varPtr[varIndex]); - } else if (strcmp(subCmd, "refcount") == 0) { - char buf[TCL_INTEGER_SPACE]; - - if (objc != 3) { - goto wrongNumArgs; - } - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - TclFormatInt(buf, varPtr[varIndex]->refCount); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } else if (strcmp(subCmd, "type") == 0) { - if (objc != 3) { - goto wrongNumArgs; - } - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - if (varPtr[varIndex]->typePtr == NULL) { /* a string! */ - Tcl_AppendToObj(Tcl_GetObjResult(interp), "string", -1); - } else { - Tcl_AppendToObj(Tcl_GetObjResult(interp), - varPtr[varIndex]->typePtr->name, -1); - } - } else if (strcmp(subCmd, "types") == 0) { - if (objc != 2) { - goto wrongNumArgs; - } - if (Tcl_AppendAllObjTypes(interp, Tcl_GetObjResult(interp)) != TCL_OK) { - return TCL_ERROR; - } - } else { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad option \"", - Tcl_GetString(objv[1]), - "\": must be assign, convert, duplicate, freeallvars, ", - "newobj, objcount, refcount, type, or types", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TeststringobjCmd -- - * - * This procedure implements the "teststringobj" command. It is used to - * test the string Tcl object type implementation. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * Creates and frees string objects, and also converts objects to - * have string type. - * - *---------------------------------------------------------------------- - */ - -static int -TeststringobjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int varIndex, option, i, length; -#define MAX_STRINGS 11 - char *index, *string, *strings[MAX_STRINGS+1]; - static char *options[] = { - "append", "appendstrings", "get", "get2", "length", "length2", - "set", "set2", "setlength", (char *) NULL - }; - - if (objc < 3) { - wrongNumArgs: - Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?"); - return TCL_ERROR; - } - - index = Tcl_GetString(objv[2]); - if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, &option) - != TCL_OK) { - return TCL_ERROR; - } - switch (option) { - case 0: /* append */ - if (objc != 5) { - goto wrongNumArgs; - } - if (Tcl_GetIntFromObj(interp, objv[4], &length) != TCL_OK) { - return TCL_ERROR; - } - if (varPtr[varIndex] == NULL) { - SetVarToObj(varIndex, Tcl_NewObj()); - } - - /* - * If the object bound to variable "varIndex" is shared, we must - * "copy on write" and append to a copy of the object. - */ - - if (Tcl_IsShared(varPtr[varIndex])) { - SetVarToObj(varIndex, Tcl_DuplicateObj(varPtr[varIndex])); - } - string = Tcl_GetString(objv[3]); - Tcl_AppendToObj(varPtr[varIndex], string, length); - Tcl_SetObjResult(interp, varPtr[varIndex]); - break; - case 1: /* appendstrings */ - if (objc > (MAX_STRINGS+3)) { - goto wrongNumArgs; - } - if (varPtr[varIndex] == NULL) { - SetVarToObj(varIndex, Tcl_NewObj()); - } - - /* - * If the object bound to variable "varIndex" is shared, we must - * "copy on write" and append to a copy of the object. - */ - - if (Tcl_IsShared(varPtr[varIndex])) { - SetVarToObj(varIndex, Tcl_DuplicateObj(varPtr[varIndex])); - } - for (i = 3; i < objc; i++) { - strings[i-3] = Tcl_GetString(objv[i]); - } - for ( ; i < 12 + 3; i++) { - strings[i - 3] = NULL; - } - Tcl_AppendStringsToObj(varPtr[varIndex], strings[0], strings[1], - strings[2], strings[3], strings[4], strings[5], - strings[6], strings[7], strings[8], strings[9], - strings[10], strings[11]); - Tcl_SetObjResult(interp, varPtr[varIndex]); - break; - case 2: /* get */ - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - break; - case 3: /* get2 */ - if (objc != 3) { - goto wrongNumArgs; - } - if (CheckIfVarUnset(interp, varIndex)) { - return TCL_ERROR; - } - string = Tcl_GetString(varPtr[varIndex]); - Tcl_AppendToObj(Tcl_GetObjResult(interp), string, -1); - break; - case 4: /* length */ - if (objc != 3) { - goto wrongNumArgs; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), (varPtr[varIndex] != NULL) - ? varPtr[varIndex]->length : -1); - break; - case 5: /* length2 */ - if (objc != 3) { - goto wrongNumArgs; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), (varPtr[varIndex] != NULL) - ? (int) varPtr[varIndex]->internalRep.longValue : -1); - break; - case 6: /* set */ - if (objc != 4) { - goto wrongNumArgs; - } - - /* - * If the object currently bound to the variable with index - * varIndex has ref count 1 (i.e. the object is unshared) we - * can modify that object directly. Otherwise, if RC>1 (i.e. - * the object is shared), we must create a new object to - * modify/set and decrement the old formerly-shared object's - * ref count. This is "copy on write". - */ - - string = Tcl_GetStringFromObj(objv[3], &length); - if ((varPtr[varIndex] != NULL) - && !Tcl_IsShared(varPtr[varIndex])) { - Tcl_SetStringObj(varPtr[varIndex], string, length); - } else { - SetVarToObj(varIndex, Tcl_NewStringObj(string, length)); - } - Tcl_SetObjResult(interp, varPtr[varIndex]); - break; - case 7: /* set2 */ - if (objc != 4) { - goto wrongNumArgs; - } - SetVarToObj(varIndex, objv[3]); - break; - case 8: /* setlength */ - if (objc != 4) { - goto wrongNumArgs; - } - if (Tcl_GetIntFromObj(interp, objv[3], &length) != TCL_OK) { - return TCL_ERROR; - } - if (varPtr[varIndex] != NULL) { - Tcl_SetObjLength(varPtr[varIndex], length); - } - break; - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * SetVarToObj -- - * - * Utility routine to assign a Tcl_Obj* to a test variable. The - * Tcl_Obj* can be NULL. - * - * Results: - * None. - * - * Side effects: - * This routine handles ref counting details for assignment: - * i.e. the old value's ref count must be decremented (if not NULL) and - * the new one incremented (also if not NULL). - * - *---------------------------------------------------------------------- - */ - -static void -SetVarToObj(varIndex, objPtr) - int varIndex; /* Designates the assignment variable. */ - Tcl_Obj *objPtr; /* Points to object to assign to var. */ -{ - if (varPtr[varIndex] != NULL) { - Tcl_DecrRefCount(varPtr[varIndex]); - } - varPtr[varIndex] = objPtr; - if (objPtr != NULL) { - Tcl_IncrRefCount(objPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * GetVariableIndex -- - * - * Utility routine to get a test variable index from the command line. - * - * Results: - * A standard Tcl object result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -GetVariableIndex(interp, string, indexPtr) - Tcl_Interp *interp; /* Interpreter for error reporting. */ - char *string; /* String containing a variable index - * specified as a nonnegative number less - * than NUMBER_OF_OBJECT_VARS. */ - int *indexPtr; /* Place to store converted result. */ -{ - int index; - - if (Tcl_GetInt(interp, string, &index) != TCL_OK) { - return TCL_ERROR; - } - if (index < 0 || index >= NUMBER_OF_OBJECT_VARS) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), "bad variable index", -1); - return TCL_ERROR; - } - - *indexPtr = index; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * CheckIfVarUnset -- - * - * Utility procedure that checks whether a test variable is readable: - * i.e., that varPtr[varIndex] is non-NULL. - * - * Results: - * 1 if the test variable is unset (NULL); 0 otherwise. - * - * Side effects: - * Sets the interpreter result to an error message if the variable is - * unset (NULL). - * - *---------------------------------------------------------------------- - */ - -static int -CheckIfVarUnset(interp, varIndex) - Tcl_Interp *interp; /* Interpreter for error reporting. */ - int varIndex; /* Index of the test variable to check. */ -{ - if (varPtr[varIndex] == NULL) { - char buf[32 + TCL_INTEGER_SPACE]; - - sprintf(buf, "variable %d is unset (NULL)", varIndex); - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), buf, -1); - return 1; - } - return 0; -} diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c deleted file mode 100644 index 7d66e75..0000000 --- a/generic/tclTestProcBodyObj.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - * tclTestProcBodyObj.c -- - * - * Implements the "procbodytest" package, which contains commands - * to test creation of Tcl procedures whose body argument is a - * Tcl_Obj of type "procbody" rather than a string. - * - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclTestProcBodyObj.c,v 1.2 1998/11/10 06:54:44 jingham Exp $ - */ - -#include "tclInt.h" - -/* - * name and version of this package - */ - -static char packageName[] = "procbodytest"; -static char packageVersion[] = "1.0"; - -/* - * Name of the commands exported by this package - */ - -static char procCommand[] = "proc"; - -/* - * this struct describes an entry in the table of command names and command - * procs - */ - -typedef struct CmdTable -{ - char *cmdName; /* command name */ - Tcl_ObjCmdProc *proc; /* command proc */ - int exportIt; /* if 1, export the command */ -} CmdTable; - -/* - * Declarations for functions defined in this file. - */ - -static int ProcBodyTestProcObjCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -static int ProcBodyTestInitInternal _ANSI_ARGS_((Tcl_Interp *interp, - int isSafe)); -static int RegisterCommand _ANSI_ARGS_((Tcl_Interp* interp, - char *namespace, CONST CmdTable *cmdTablePtr)); -int Procbodytest_Init _ANSI_ARGS_((Tcl_Interp * interp)); -int Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp * interp)); - -/* - * List of commands to create when the package is loaded; must go after the - * declarations of the enable command procedure. - */ - -static CONST CmdTable commands[] = -{ - { procCommand, ProcBodyTestProcObjCmd, 1 }, - - { 0, 0, 0 } -}; - -static CONST CmdTable safeCommands[] = -{ - { procCommand, ProcBodyTestProcObjCmd, 1 }, - - { 0, 0, 0 } -}; - -/* - *---------------------------------------------------------------------- - * - * Procbodytest_Init -- - * - * This procedure initializes the "procbodytest" package. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Procbodytest_Init(interp) - Tcl_Interp *interp; /* the Tcl interpreter for which the package - * is initialized */ -{ - return ProcBodyTestInitInternal(interp, 0); -} - -/* - *---------------------------------------------------------------------- - * - * Procbodytest_SafeInit -- - * - * This procedure initializes the "procbodytest" package. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Procbodytest_SafeInit(interp) - Tcl_Interp *interp; /* the Tcl interpreter for which the package - * is initialized */ -{ - return ProcBodyTestInitInternal(interp, 1); -} - -/* - *---------------------------------------------------------------------- - * - * RegisterCommand -- - * - * This procedure registers a command in the context of the given namespace. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int RegisterCommand(interp, namespace, cmdTablePtr) - Tcl_Interp* interp; /* the Tcl interpreter for which the - * operation is performed */ - char *namespace; /* the namespace in which the command - * is registered */ - CONST CmdTable *cmdTablePtr; /* the command to register */ -{ - char buf[128]; - - if (cmdTablePtr->exportIt) { - sprintf(buf, "namespace eval %s { namespace export %s }", - namespace, cmdTablePtr->cmdName); - if (Tcl_Eval(interp, buf) != TCL_OK) - return TCL_ERROR; - } - - sprintf(buf, "%s::%s", namespace, cmdTablePtr->cmdName); - Tcl_CreateObjCommand(interp, buf, cmdTablePtr->proc, 0, 0); - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * ProcBodyTestInitInternal -- - * - * This procedure initializes the Loader package. - * The isSafe flag is 1 if the interpreter is safe, 0 otherwise. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -ProcBodyTestInitInternal(interp, isSafe) - Tcl_Interp *interp; /* the Tcl interpreter for which the package - * is initialized */ - int isSafe; /* 1 if this is a safe interpreter */ -{ - CONST CmdTable *cmdTablePtr; - - cmdTablePtr = (isSafe) ? &safeCommands[0] : &commands[0]; - for ( ; cmdTablePtr->cmdName ; cmdTablePtr++) { - if (RegisterCommand(interp, packageName, cmdTablePtr) != TCL_OK) { - return TCL_ERROR; - } - } - - return Tcl_PkgProvide(interp, packageName, packageVersion); -} - -/* - *---------------------------------------------------------------------- - * - * ProcBodyTestProcObjCmd -- - * - * Implements the "procbodytest::proc" command. Here is the command - * description: - * procbodytest::proc newName argList bodyName - * Looks up a procedure called $bodyName and, if the procedure exists, - * constructs a Tcl_Obj of type "procbody" and calls Tcl_ProcObjCmd. - * Arguments: - * newName the name of the procedure to be created - * argList the argument list for the procedure - * bodyName the name of an existing procedure from which the - * body is to be copied. - * This command can be used to trigger the branches in Tcl_ProcObjCmd that - * construct a proc from a "procbody", for example: - * proc a {x} {return $x} - * a 123 - * procbodytest::proc b {x} a - * Note the call to "a 123", which is necessary so that the Proc pointer - * for "a" is filled in by the internal compiler; this is a hack. - * - * Results: - * Returns a standard Tcl code. - * - * Side effects: - * A new procedure is created. - * Leaves an error message in the interp's result on error. - * - *---------------------------------------------------------------------- - */ - -static int -ProcBodyTestProcObjCmd (dummy, interp, objc, objv) - ClientData dummy; /* context; not used */ - Tcl_Interp *interp; /* the current interpreter */ - int objc; /* argument count */ - Tcl_Obj *CONST objv[]; /* arguments */ -{ - char *fullName; - Tcl_Command procCmd; - Command *cmdPtr; - Proc *procPtr = (Proc *) NULL; - Tcl_Obj *bodyObjPtr; - Tcl_Obj *myobjv[5]; - int result; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 1, objv, "newName argsList bodyName"); - return TCL_ERROR; - } - - /* - * Find the Command pointer to this procedure - */ - - fullName = Tcl_GetStringFromObj(objv[3], (int *) NULL); - procCmd = Tcl_FindCommand(interp, fullName, (Tcl_Namespace *) NULL, - TCL_LEAVE_ERR_MSG); - if (procCmd == NULL) { - return TCL_ERROR; - } - - cmdPtr = (Command *) procCmd; - - /* - * check that this is a procedure and not a builtin command: - * If a procedure, cmdPtr->objProc is either 0 or TclObjInterpProc, - * and cmdPtr->proc is either 0 or TclProcInterpProc. - * Also, the compile proc should be 0, but we don't check for that. - */ - - if (((cmdPtr->objProc != NULL) - && (cmdPtr->objProc != TclGetObjInterpProc())) - || ((cmdPtr->proc != NULL) - && (cmdPtr->proc != TclGetInterpProc()))) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "command \"", fullName, - "\" is not a Tcl procedure", (char *) NULL); - return TCL_ERROR; - } - - /* - * it is a Tcl procedure: the client data is the Proc structure - */ - - if (cmdPtr->objProc != NULL) { - procPtr = (Proc *) cmdPtr->objClientData; - } else if (cmdPtr->proc != NULL) { - procPtr = (Proc *) cmdPtr->clientData; - } - - if (procPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "procedure \"", fullName, - "\" does not have a Proc struct!", (char *) NULL); - return TCL_ERROR; - } - - /* - * create a new object, initialize our argument vector, call into Tcl - */ - - bodyObjPtr = TclNewProcBodyObj(procPtr); - if (bodyObjPtr == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "failed to create a procbody object for procedure \"", - fullName, "\"", (char *) NULL); - return TCL_ERROR; - } - Tcl_IncrRefCount(bodyObjPtr); - - myobjv[0] = objv[0]; - myobjv[1] = objv[1]; - myobjv[2] = objv[2]; - myobjv[3] = bodyObjPtr; - myobjv[4] = (Tcl_Obj *) NULL; - - result = Tcl_ProcObjCmd((ClientData) NULL, interp, objc, myobjv); - Tcl_DecrRefCount(bodyObjPtr); - - return result; -} diff --git a/generic/tclThread.c b/generic/tclThread.c deleted file mode 100644 index 2dcd832..0000000 --- a/generic/tclThread.c +++ /dev/null @@ -1,563 +0,0 @@ -/* - * tclThread.c -- - * - * This file implements Platform independent thread operations. - * Most of the real work is done in the platform dependent files. - * - * Copyright (c) 1998 by Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclThread.c,v 1.2 1999/04/16 00:46:54 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * There are three classes of synchronization objects: - * mutexes, thread data keys, and condition variables. - * The following are used to record the memory used for these - * objects so they can be finalized. - * - * These statics are guarded by the mutex in the caller of - * TclRememberThreadData, e.g., TclpThreadDataKeyInit - */ - -typedef struct { - int num; /* Number of objects remembered */ - int max; /* Max size of the array */ - char **list; /* List of pointers */ -} SyncObjRecord; - -static SyncObjRecord keyRecord; -static SyncObjRecord mutexRecord; -static SyncObjRecord condRecord; - -/* - * Prototypes of functions used only in this file - */ - -static void RememberSyncObject _ANSI_ARGS_((char *objPtr, - SyncObjRecord *recPtr)); -static void ForgetSyncObject _ANSI_ARGS_((char *objPtr, - SyncObjRecord *recPtr)); - - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetThreadData -- - * - * This procedure allocates and initializes a chunk of thread - * local storage. - * - * Results: - * A thread-specific pointer to the data structure. - * - * Side effects: - * Will allocate memory the first time this thread calls for - * this chunk of storage. - * - *---------------------------------------------------------------------- - */ - -VOID * -Tcl_GetThreadData(keyPtr, size) - Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk */ - int size; /* Size of storage block */ -{ - VOID *result; -#ifdef TCL_THREADS - - /* - * See if this is the first thread to init this key. - */ - - if (*keyPtr == NULL) { - TclpThreadDataKeyInit(keyPtr); - } - - /* - * Initialize the key for this thread. - */ - - result = TclpThreadDataKeyGet(keyPtr); - if (result == NULL) { - result = (VOID *)ckalloc((size_t)size); - memset(result, 0, (size_t)size); - TclpThreadDataKeySet(keyPtr, result); - } -#else - if (*keyPtr == NULL) { - result = (VOID *)ckalloc((size_t)size); - memset((char *)result, 0, (size_t)size); - *keyPtr = (Tcl_ThreadDataKey)result; - TclRememberDataKey(keyPtr); - } - result = *(VOID **)keyPtr; -#endif - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclThreadDataKeyGet -- - * - * This procedure returns a pointer to a block of thread local storage. - * - * Results: - * A thread-specific pointer to the data structure, or NULL - * if the memory has not been assigned to this key for this thread. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -VOID * -TclThreadDataKeyGet(keyPtr) - Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, - * really (pthread_key_t **) */ -{ -#ifdef TCL_THREADS - return (VOID *)TclpThreadDataKeyGet(keyPtr); -#else - char *result = *(char **)keyPtr; - return (VOID *)result; -#endif /* TCL_THREADS */ -} - - -/* - *---------------------------------------------------------------------- - * - * TclThreadDataKeySet -- - * - * This procedure sets a thread local storage pointer. - * - * Results: - * None. - * - * Side effects: - * The assigned value will be returned by TclpThreadDataKeyGet. - * - *---------------------------------------------------------------------- - */ - -void -TclThreadDataKeySet(keyPtr, data) - Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, - * really (pthread_key_t **) */ - VOID *data; /* Thread local storage */ -{ -#ifdef TCL_THREADS - if (*keyPtr == NULL) { - TclpThreadDataKeyInit(keyPtr); - } - TclpThreadDataKeySet(keyPtr, data); -#else - *keyPtr = (Tcl_ThreadDataKey)data; -#endif /* TCL_THREADS */ -} - - - -/* - *---------------------------------------------------------------------- - * - * RememberSyncObject - * - * Keep a list of (mutexes/condition variable/data key) - * used during finalization. - * - * Results: - * None. - * - * Side effects: - * Add to the appropriate list. - * - *---------------------------------------------------------------------- - */ - -static void -RememberSyncObject(objPtr, recPtr) - char *objPtr; /* Pointer to sync object */ - SyncObjRecord *recPtr; /* Record of sync objects */ -{ - char **newList; - int i, j; - - /* - * Save the pointer to the allocated object so it can be finalized. - * Grow the list of pointers if necessary, copying only non-NULL - * pointers to the new list. - */ - - if (recPtr->num >= recPtr->max) { - recPtr->max += 8; - newList = (char **)ckalloc(recPtr->max * sizeof(char *)); - for (i=0,j=0 ; inum ; i++) { - if (recPtr->list[i] != NULL) { - newList[j++] = recPtr->list[i]; - } - } - if (recPtr->list != NULL) { - ckfree((char *)recPtr->list); - } - recPtr->list = newList; - recPtr->num = j; - } - recPtr->list[recPtr->num] = objPtr; - recPtr->num++; -} - -/* - *---------------------------------------------------------------------- - * - * ForgetSyncObject - * - * Remove a single object from the list. - * - * Results: - * None. - * - * Side effects: - * Remove from the appropriate list. - * - *---------------------------------------------------------------------- - */ - -static void -ForgetSyncObject(objPtr, recPtr) - char *objPtr; /* Pointer to sync object */ - SyncObjRecord *recPtr; /* Record of sync objects */ -{ - int i; - - for (i=0 ; inum ; i++) { - if (objPtr == recPtr->list[i]) { - recPtr->list[i] = NULL; - return; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * TclRememberMutex - * - * Keep a list of mutexes used during finalization. - * - * Results: - * None. - * - * Side effects: - * Add to the mutex list. - * - *---------------------------------------------------------------------- - */ - -void -TclRememberMutex(mutexPtr) - Tcl_Mutex *mutexPtr; -{ - RememberSyncObject((char *)mutexPtr, &mutexRecord); -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeMutex - * - * Finalize a single mutex and remove it from the - * list of remembered objects. - * - * Results: - * None. - * - * Side effects: - * Remove the mutex from the list. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeMutex(mutexPtr) - Tcl_Mutex *mutexPtr; -{ -#ifdef TCL_THREADS - TclpFinalizeMutex(mutexPtr); -#endif - ForgetSyncObject((char *)mutexPtr, &mutexRecord); -} - -/* - *---------------------------------------------------------------------- - * - * TclRememberDataKey - * - * Keep a list of thread data keys used during finalization. - * - * Results: - * None. - * - * Side effects: - * Add to the key list. - * - *---------------------------------------------------------------------- - */ - -void -TclRememberDataKey(keyPtr) - Tcl_ThreadDataKey *keyPtr; -{ - RememberSyncObject((char *)keyPtr, &keyRecord); -} - -/* - *---------------------------------------------------------------------- - * - * TclRememberCondition - * - * Keep a list of condition variables used during finalization. - * - * Results: - * None. - * - * Side effects: - * Add to the condition variable list. - * - *---------------------------------------------------------------------- - */ - -void -TclRememberCondition(condPtr) - Tcl_Condition *condPtr; -{ - RememberSyncObject((char *)condPtr, &condRecord); -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeCondition - * - * Finalize a single condition variable and remove it from the - * list of remembered objects. - * - * Results: - * None. - * - * Side effects: - * Remove the condition variable from the list. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeCondition(condPtr) - Tcl_Condition *condPtr; -{ -#ifdef TCL_THREADS - TclpFinalizeCondition(condPtr); -#endif - ForgetSyncObject((char *)condPtr, &condRecord); -} - -/* - *---------------------------------------------------------------------- - * - * TclFinalizeThreadData -- - * - * This procedure cleans up the thread-local storage. This is - * called once for each thread. - * - * Results: - * None. - * - * Side effects: - * Frees up all thread local storage. - * - *---------------------------------------------------------------------- - */ - -void -TclFinalizeThreadData() -{ - int i; - Tcl_ThreadDataKey *keyPtr; - - TclpMasterLock(); - for (i=0 ; iinterp == NULL) { - Tcl_MutexLock(&threadMutex); - tsdPtr->interp = interp; - ListUpdateInner(tsdPtr); - Tcl_CreateThreadExitHandler(ThreadExitProc, NULL); - Tcl_MutexUnlock(&threadMutex); - } - - switch ((enum options)option) { - case THREAD_CREATE: { - char *script; - if (objc == 2) { - script = "testthread wait"; /* Just enter the event loop */ - } else if (objc == 3) { - script = Tcl_GetString(objv[2]); - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?script?"); - return TCL_ERROR; - } - return TclCreateThread(interp, script); - } - case THREAD_EXIT: { - if (objc > 2) { - Tcl_WrongNumArgs(interp, 1, objv, NULL); - return TCL_ERROR; - } - ListRemove(NULL); - Tcl_ExitThread(0); - return TCL_OK; - } - case THREAD_ID: - if (objc == 2) { - Tcl_Obj *idObj = Tcl_NewIntObj((int)Tcl_GetCurrentThread()); - Tcl_SetObjResult(interp, idObj); - return TCL_OK; - } else { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - case THREAD_NAMES: { - if (objc > 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - return TCL_ERROR; - } - return TclThreadList(interp); - } - case THREAD_SEND: { - int id; - char *script; - int wait, arg; - - if ((objc != 4) && (objc != 5)) { - Tcl_WrongNumArgs(interp, 1, objv, "send ?-async? id script"); - return TCL_ERROR; - } - if (objc == 5) { - if (strcmp("-async", Tcl_GetString(objv[2])) != 0) { - Tcl_WrongNumArgs(interp, 1, objv, "send ?-async? id script"); - return TCL_ERROR; - } - wait = 0; - arg = 3; - } else { - wait = 1; - arg = 2; - } - if (Tcl_GetIntFromObj(interp, objv[arg], &id) != TCL_OK) { - return TCL_ERROR; - } - arg++; - script = Tcl_GetString(objv[arg]); - return TclThreadSend(interp, (Tcl_ThreadId) id, script, wait); - } - case THREAD_WAIT: { - while (1) { - (void) Tcl_DoOneEvent(TCL_ALL_EVENTS); - } - } - case THREAD_ERRORPROC: { - /* - * Arrange for this proc to handle thread death errors. - */ - - char *proc; - if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "errorproc proc"); - return TCL_ERROR; - } - Tcl_MutexLock(&threadMutex); - errorThreadId = Tcl_GetCurrentThread(); - if (errorProcString) { - ckfree(errorProcString); - } - proc = Tcl_GetString(objv[2]); - errorProcString = ckalloc(strlen(proc)+1); - strcpy(errorProcString, proc); - Tcl_MutexUnlock(&threadMutex); - return TCL_OK; - } - } - return TCL_OK; -} - - -/* - *---------------------------------------------------------------------- - * - * TclCreateThread -- - * - * This procedure is invoked to create a thread containing an interp to - * run a script. This returns after the thread has started executing. - * - * Results: - * A standard Tcl result, which is the thread ID. - * - * Side effects: - * Create a thread. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -TclCreateThread(interp, script) - Tcl_Interp *interp; /* Current interpreter. */ - CONST char *script; /* Script to execute */ -{ - ThreadCtrl ctrl; - Tcl_ThreadId id; - - ctrl.script = (char*)ckalloc( strlen(script) + 1 ); - strcpy(ctrl.script, script); - ctrl.condWait = NULL; - ctrl.flags = 0; - - Tcl_MutexLock(&threadMutex); - if (TclpThreadCreate(&id, NewThread, (ClientData) &ctrl) != TCL_OK) { - Tcl_MutexUnlock(&threadMutex); - Tcl_AppendResult(interp,"can't create a new thread",0); - ckfree((void*)ctrl.script); - return TCL_ERROR; - } - - /* - * Wait for the thread to start because it is using something on our stack! - */ - - Tcl_ConditionWait(&ctrl.condWait, &threadMutex, NULL); - Tcl_MutexUnlock(&threadMutex); - TclFinalizeCondition(&ctrl.condWait); - Tcl_SetObjResult(interp, Tcl_NewIntObj((int)id)); - return TCL_OK; -} - -/* - *------------------------------------------------------------------------ - * - * NewThread -- - * - * This routine is the "main()" for a new thread whose task is to - * execute a single TCL script. The argument to this function is - * a pointer to a structure that contains the text of the TCL script - * to be executed. - * - * Space to hold the script field of the ThreadControl structure passed - * in as the only argument was obtained from malloc() and must be freed - * by this function before it exits. Space to hold the ThreadControl - * structure itself is released by the calling function, and the - * two condition variables in the ThreadControl structure are destroyed - * by the calling function. The calling function will destroy the - * ThreadControl structure and the condition variable as soon as - * ctrlPtr->condWait is signaled, so this routine must make copies of - * any data it might need after that point. - * - * Results: - * none - * - * Side effects: - * A TCL script is executed in a new thread. - * - *------------------------------------------------------------------------ - */ -#ifdef MAC_TCL -static pascal void * -#else -static void -#endif -NewThread(clientData) - ClientData clientData; -{ - ThreadCtrl *ctrlPtr = (ThreadCtrl*)clientData; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - ThreadCtrl ctrl; - int result; - - ctrl = *ctrlPtr; - - /* - * Initialize the interpreter. This should be more general. - */ - - tsdPtr->interp = Tcl_CreateInterp(); - result = Tcl_Init(tsdPtr->interp); - result = TclThread_Init(tsdPtr->interp); - - /* - * Update the list of threads. - */ - - Tcl_MutexLock(&threadMutex); - ListUpdateInner(tsdPtr); - Tcl_CreateThreadExitHandler(ThreadExitProc, NULL); - - /* - * Notify the parent we are alive. - */ - - Tcl_ConditionNotify(&ctrlPtr->condWait); - Tcl_MutexUnlock(&threadMutex); - - /* - * Run the script. - */ - - Tcl_Preserve((ClientData) tsdPtr->interp); - result = Tcl_Eval(tsdPtr->interp, ctrl.script); - if (result != TCL_OK) { - ThreadErrorProc(tsdPtr->interp); - } - - /* - * Clean up. - */ - - ListRemove(tsdPtr); - ckfree((char*)ctrl.script); - Tcl_Release((ClientData) tsdPtr->interp); - Tcl_DeleteInterp(tsdPtr->interp); - Tcl_ExitThread(result); -#ifdef MAC_TCL - return NULL; -#endif -} - -/* - *------------------------------------------------------------------------ - * - * ThreadErrorProc -- - * - * Send a message to the thread willing to hear about errors. - * - * Results: - * none - * - * Side effects: - * Send an event. - * - *------------------------------------------------------------------------ - */ -static void -ThreadErrorProc(interp) - Tcl_Interp *interp; /* Interp that failed */ -{ - Tcl_Channel errChannel; - char *errorInfo, *script; - char *argv[3]; - char buf[10]; - sprintf(buf, "%ld", (long) Tcl_GetCurrentThread()); - - errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - if (errorProcString == NULL) { - errChannel = Tcl_GetStdChannel(TCL_STDERR); - Tcl_WriteChars(errChannel, "Error from thread ", -1); - Tcl_WriteChars(errChannel, buf, -1); - Tcl_WriteChars(errChannel, "\n", 1); - Tcl_WriteChars(errChannel, errorInfo, -1); - Tcl_WriteChars(errChannel, "\n", 1); - } else { - argv[0] = errorProcString; - argv[1] = buf; - argv[2] = errorInfo; - script = Tcl_Merge(3, argv); - TclThreadSend(interp, errorThreadId, script, 0); - ckfree(script); - } -} - - -/* - *------------------------------------------------------------------------ - * - * ListUpdateInner -- - * - * Add the thread local storage to the list. This assumes - * the caller has obtained the mutex. - * - * Results: - * none - * - * Side effects: - * Add the thread local storage to its list. - * - *------------------------------------------------------------------------ - */ -static void -ListUpdateInner(tsdPtr) - ThreadSpecificData *tsdPtr; -{ - if (tsdPtr == NULL) { - tsdPtr = TCL_TSD_INIT(&dataKey); - } - tsdPtr->threadId = Tcl_GetCurrentThread(); - tsdPtr->nextPtr = threadList; - if (threadList) { - threadList->prevPtr = tsdPtr; - } - tsdPtr->prevPtr = NULL; - threadList = tsdPtr; -} - -/* - *------------------------------------------------------------------------ - * - * ListRemove -- - * - * Remove the thread local storage from its list. This grabs the - * mutex to protect the list. - * - * Results: - * none - * - * Side effects: - * Remove the thread local storage from its list. - * - *------------------------------------------------------------------------ - */ -static void -ListRemove(tsdPtr) - ThreadSpecificData *tsdPtr; -{ - if (tsdPtr == NULL) { - tsdPtr = TCL_TSD_INIT(&dataKey); - } - Tcl_MutexLock(&threadMutex); - if (tsdPtr->prevPtr) { - tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr; - } else { - threadList = tsdPtr->nextPtr; - } - if (tsdPtr->nextPtr) { - tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr; - } - tsdPtr->nextPtr = tsdPtr->prevPtr = 0; - Tcl_MutexUnlock(&threadMutex); -} - - -/* - *------------------------------------------------------------------------ - * - * TclThreadList -- - * - * Return a list of threads running Tcl interpreters. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------ - */ -int -TclThreadList(interp) - Tcl_Interp *interp; -{ - ThreadSpecificData *tsdPtr; - Tcl_Obj *listPtr; - - listPtr = Tcl_NewListObj(0, NULL); - Tcl_MutexLock(&threadMutex); - for (tsdPtr = threadList ; tsdPtr ; tsdPtr = tsdPtr->nextPtr) { - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewIntObj((int)tsdPtr->threadId)); - } - Tcl_MutexUnlock(&threadMutex); - Tcl_SetObjResult(interp, listPtr); - return TCL_OK; -} - - -/* - *------------------------------------------------------------------------ - * - * TclThreadSend -- - * - * Send a script to another thread. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *------------------------------------------------------------------------ - */ -int -TclThreadSend(interp, id, script, wait) - Tcl_Interp *interp; /* The current interpreter. */ - Tcl_ThreadId id; /* Thread Id of other interpreter. */ - char *script; /* The script to evaluate. */ - int wait; /* If 1, we block for the result. */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - ThreadEvent *threadEventPtr; - ThreadEventResult *resultPtr; - int found, code; - Tcl_ThreadId threadId = (Tcl_ThreadId) id; - - /* - * Verify the thread exists. - */ - - Tcl_MutexLock(&threadMutex); - found = 0; - for (tsdPtr = threadList ; tsdPtr ; tsdPtr = tsdPtr->nextPtr) { - if (tsdPtr->threadId == threadId) { - found = 1; - break; - } - } - if (!found) { - Tcl_MutexUnlock(&threadMutex); - Tcl_AppendResult(interp, "invalid thread id", NULL); - return TCL_ERROR; - } - - /* - * Short circut sends to ourself. Ought to do something with -async, - * like run in an idle handler. - */ - - if (threadId == Tcl_GetCurrentThread()) { - Tcl_MutexUnlock(&threadMutex); - return Tcl_GlobalEval(interp, script); - } - - /* - * Create the event for its event queue. - */ - - threadEventPtr = (ThreadEvent *) ckalloc(sizeof(ThreadEvent)); - threadEventPtr->script = ckalloc(strlen(script) + 1); - strcpy(threadEventPtr->script, script); - if (!wait) { - threadEventPtr->resultPtr = NULL; - } else { - resultPtr = (ThreadEventResult *) ckalloc(sizeof(ThreadEventResult)); - threadEventPtr->resultPtr = resultPtr; - - /* - * Initialize the result fields. - */ - - resultPtr->done = NULL; - resultPtr->code = 0; - resultPtr->result = NULL; - resultPtr->errorInfo = NULL; - resultPtr->errorCode = NULL; - - /* - * Maintain the cleanup list. - */ - - resultPtr->srcThreadId = Tcl_GetCurrentThread(); - resultPtr->dstThreadId = threadId; - resultPtr->eventPtr = threadEventPtr; - resultPtr->nextPtr = resultList; - if (resultList) { - resultList->prevPtr = resultPtr; - } - resultPtr->prevPtr = NULL; - resultList = resultPtr; - } - - /* - * Queue the event and poke the other thread's notifier. - */ - - threadEventPtr->event.proc = ThreadEventProc; - Tcl_ThreadQueueEvent(threadId, (Tcl_Event *)threadEventPtr, - TCL_QUEUE_TAIL); - Tcl_MutexUnlock(&threadMutex); - Tcl_ThreadAlert(threadId); - - if (!wait) { - return TCL_OK; - } - - /* - * Block on the results and then get them. - */ - - Tcl_ResetResult(interp); - Tcl_MutexLock(&threadMutex); - while (resultPtr->result == NULL) { - Tcl_ConditionWait(&resultPtr->done, &threadMutex, NULL); - } - - /* - * Unlink result from the result list. - */ - - if (resultPtr->prevPtr) { - resultPtr->prevPtr->nextPtr = resultPtr->nextPtr; - } else { - resultList = resultPtr->nextPtr; - } - if (resultPtr->nextPtr) { - resultPtr->nextPtr->prevPtr = resultPtr->prevPtr; - } - resultPtr->eventPtr = NULL; - resultPtr->nextPtr = NULL; - resultPtr->prevPtr = NULL; - - Tcl_MutexUnlock(&threadMutex); - - if (resultPtr->code != TCL_OK) { - if (resultPtr->errorCode) { - Tcl_SetErrorCode(interp, resultPtr->errorCode, NULL); - ckfree(resultPtr->errorCode); - } - if (resultPtr->errorInfo) { - Tcl_AddErrorInfo(interp, resultPtr->errorInfo); - ckfree(resultPtr->errorInfo); - } - } - Tcl_SetResult(interp, resultPtr->result, TCL_DYNAMIC); - TclFinalizeCondition(&resultPtr->done); - code = resultPtr->code; - - ckfree((char *) resultPtr); - - return code; -} - - -/* - *------------------------------------------------------------------------ - * - * ThreadEventProc -- - * - * Handle the event in the target thread. - * - * Results: - * Returns 1 to indicate that the event was processed. - * - * Side effects: - * Fills out the ThreadEventResult struct. - * - *------------------------------------------------------------------------ - */ -int -ThreadEventProc(evPtr, mask) - Tcl_Event *evPtr; /* Really ThreadEvent */ - int mask; -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - ThreadEvent *threadEventPtr = (ThreadEvent *)evPtr; - ThreadEventResult *resultPtr = threadEventPtr->resultPtr; - Tcl_Interp *interp = tsdPtr->interp; - int code; - char *result, *errorCode, *errorInfo; - - if (interp == NULL) { - code = TCL_ERROR; - result = "no target interp!"; - errorCode = "THREAD"; - errorInfo = ""; - } else { - Tcl_Preserve((ClientData) interp); - Tcl_ResetResult(interp); - code = Tcl_GlobalEval(interp, threadEventPtr->script); - result = Tcl_GetStringResult(interp); - if (code != TCL_OK) { - errorCode = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY); - errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - } else { - errorCode = errorInfo = NULL; - } - } - ckfree(threadEventPtr->script); - if (resultPtr) { - Tcl_MutexLock(&threadMutex); - resultPtr->code = code; - resultPtr->result = ckalloc(strlen(result) + 1); - strcpy(resultPtr->result, result); - if (errorCode != NULL) { - resultPtr->errorCode = ckalloc(strlen(errorCode) + 1); - strcpy(resultPtr->errorCode, errorCode); - } - if (errorInfo != NULL) { - resultPtr->errorInfo = ckalloc(strlen(errorInfo) + 1); - strcpy(resultPtr->errorInfo, errorInfo); - } - Tcl_ConditionNotify(&resultPtr->done); - Tcl_MutexUnlock(&threadMutex); - } - if (interp != NULL) { - Tcl_Release((ClientData) interp); - } - return 1; -} - -/* - *------------------------------------------------------------------------ - * - * ThreadExitProc -- - * - * This is called when the thread exits. - * - * Results: - * None. - * - * Side effects: - * It unblocks anyone that is waiting on a send to this thread. - * It cleans up any events in the event queue for this thread. - * - *------------------------------------------------------------------------ - */ - /* ARGSUSED */ -void -ThreadExitProc(dummy) - ClientData dummy; -{ - ThreadEventResult *resultPtr, *nextPtr; - Tcl_ThreadId self = Tcl_GetCurrentThread(); - - Tcl_MutexLock(&threadMutex); - for (resultPtr = resultList ; resultPtr ; resultPtr = nextPtr) { - nextPtr = resultPtr->nextPtr; - if (resultPtr->srcThreadId == self) { - /* - * We are going away. By freeing up the result we signal - * to the other thread we don't care about the result. - */ - if (resultPtr->prevPtr) { - resultPtr->prevPtr->nextPtr = resultPtr->nextPtr; - } else { - resultList = resultPtr->nextPtr; - } - if (resultPtr->nextPtr) { - resultPtr->nextPtr->prevPtr = resultPtr->prevPtr; - } - resultPtr->nextPtr = resultPtr->prevPtr = 0; - resultPtr->eventPtr->resultPtr = NULL; - ckfree((char *)resultPtr); - } else if (resultPtr->dstThreadId == self) { - /* - * Dang. The target is going away. Unblock the caller. - * The result string must be dynamically allocated because - * the main thread is going to call free on it. - */ - - char *msg = "target thread died"; - resultPtr->result = ckalloc(strlen(msg)+1); - strcpy(resultPtr->result, msg); - resultPtr->code = TCL_ERROR; - Tcl_ConditionNotify(&resultPtr->done); - } - } - Tcl_MutexUnlock(&threadMutex); -} - -#endif /* TCL_THREADS */ diff --git a/generic/tclTimer.c b/generic/tclTimer.c deleted file mode 100644 index 3397cb7..0000000 --- a/generic/tclTimer.c +++ /dev/null @@ -1,1128 +0,0 @@ -/* - * tclTimer.c -- - * - * This file provides timer event management facilities for Tcl, - * including the "after" command. - * - * 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. - * - * RCS: @(#) $Id: tclTimer.c,v 1.3 1999/04/16 00:46:54 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * For each timer callback that's pending there is one record of the following - * type. The normal handlers (created by Tcl_CreateTimerHandler) are chained - * together in a list sorted by time (earliest event first). - */ - -typedef struct TimerHandler { - Tcl_Time time; /* When timer is to fire. */ - Tcl_TimerProc *proc; /* Procedure to call. */ - ClientData clientData; /* Argument to pass to proc. */ - Tcl_TimerToken token; /* Identifies handler so it can be - * deleted. */ - struct TimerHandler *nextPtr; /* Next event in queue, or NULL for - * end of queue. */ -} TimerHandler; - -/* - * The data structure below is used by the "after" command to remember - * the command to be executed later. All of the pending "after" commands - * for an interpreter are linked together in a list. - */ - -typedef struct AfterInfo { - struct AfterAssocData *assocPtr; - /* Pointer to the "tclAfter" assocData for - * the interp in which command will be - * executed. */ - Tcl_Obj *commandPtr; /* Command to execute. */ - int id; /* Integer identifier for command; used to - * cancel it. */ - Tcl_TimerToken token; /* Used to cancel the "after" command. NULL - * means that the command is run as an - * idle handler rather than as a timer - * handler. NULL means this is an "after - * idle" handler rather than a - * timer handler. */ - struct AfterInfo *nextPtr; /* Next in list of all "after" commands for - * this interpreter. */ -} AfterInfo; - -/* - * One of the following structures is associated with each interpreter - * for which an "after" command has ever been invoked. A pointer to - * this structure is stored in the AssocData for the "tclAfter" key. - */ - -typedef struct AfterAssocData { - Tcl_Interp *interp; /* The interpreter for which this data is - * registered. */ - AfterInfo *firstAfterPtr; /* First in list of all "after" commands - * still pending for this interpreter, or - * NULL if none. */ -} AfterAssocData; - -/* - * There is one of the following structures for each of the - * handlers declared in a call to Tcl_DoWhenIdle. All of the - * currently-active handlers are linked together into a list. - */ - -typedef struct IdleHandler { - Tcl_IdleProc (*proc); /* Procedure to call. */ - ClientData clientData; /* Value to pass to proc. */ - int generation; /* Used to distinguish older handlers from - * recently-created ones. */ - struct IdleHandler *nextPtr;/* Next in list of active handlers. */ -} IdleHandler; - -/* - * The timer and idle queues are per-thread because they are associated - * with the notifier, which is also per-thread. - * - * All static variables used in this file are collected into a single - * instance of the following structure. For multi-threaded implementations, - * there is one instance of this structure for each thread. - * - * Notice that different structures with the same name appear in other - * files. The structure defined below is used in this file only. - */ - -typedef struct ThreadSpecificData { - TimerHandler *firstTimerHandlerPtr; /* First event in queue. */ - int lastTimerId; /* Timer identifier of most recently - * created timer. */ - int timerPending; /* 1 if a timer event is in the queue. */ - IdleHandler *idleList; /* First in list of all idle handlers. */ - IdleHandler *lastIdlePtr; /* Last in list (or NULL for empty list). */ - int idleGeneration; /* Used to fill in the "generation" fields - * of IdleHandler structures. Increments - * each time Tcl_DoOneEvent starts calling - * idle handlers, so that all old handlers - * can be called without calling any of the - * new ones created by old ones. */ - int afterId; /* For unique identifiers of after events. */ -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - -/* - * Prototypes for procedures referenced only in this file: - */ - -static void AfterCleanupProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp)); -static void AfterProc _ANSI_ARGS_((ClientData clientData)); -static void FreeAfterPtr _ANSI_ARGS_((AfterInfo *afterPtr)); -static AfterInfo * GetAfterEvent _ANSI_ARGS_((AfterAssocData *assocPtr, - Tcl_Obj *commandPtr)); -static ThreadSpecificData *InitTimer _ANSI_ARGS_((void)); -static void TimerExitProc _ANSI_ARGS_((ClientData clientData)); -static int TimerHandlerEventProc _ANSI_ARGS_((Tcl_Event *evPtr, - int flags)); -static void TimerCheckProc _ANSI_ARGS_((ClientData clientData, - int flags)); -static void TimerSetupProc _ANSI_ARGS_((ClientData clientData, - int flags)); - -/* - *---------------------------------------------------------------------- - * - * InitTimer -- - * - * This function initializes the timer module. - * - * Results: - * A pointer to the thread specific data. - * - * Side effects: - * Registers the idle and timer event sources. - * - *---------------------------------------------------------------------- - */ - -static ThreadSpecificData * -InitTimer() -{ - ThreadSpecificData *tsdPtr = - (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); - - if (tsdPtr == NULL) { - tsdPtr = TCL_TSD_INIT(&dataKey); - Tcl_CreateEventSource(TimerSetupProc, TimerCheckProc, NULL); - Tcl_CreateThreadExitHandler(TimerExitProc, NULL); - } - return tsdPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TimerExitProc -- - * - * This function is call at exit or unload time to remove the - * timer and idle event sources. - * - * Results: - * None. - * - * Side effects: - * Removes the timer and idle event sources. - * - *---------------------------------------------------------------------- - */ - -static void -TimerExitProc(clientData) - ClientData clientData; /* Not used. */ -{ - Tcl_DeleteEventSource(TimerSetupProc, TimerCheckProc, NULL); -} - -/* - *-------------------------------------------------------------- - * - * Tcl_CreateTimerHandler -- - * - * Arrange for a given procedure to be invoked at a particular - * time in the future. - * - * Results: - * The return value is a token for the timer event, which - * may be used to delete the event before it fires. - * - * Side effects: - * When milliseconds have elapsed, proc will be invoked - * exactly once. - * - *-------------------------------------------------------------- - */ - -Tcl_TimerToken -Tcl_CreateTimerHandler(milliseconds, proc, clientData) - int milliseconds; /* How many milliseconds to wait - * before invoking proc. */ - Tcl_TimerProc *proc; /* Procedure to invoke. */ - ClientData clientData; /* Arbitrary data to pass to proc. */ -{ - register TimerHandler *timerHandlerPtr, *tPtr2, *prevPtr; - Tcl_Time time; - ThreadSpecificData *tsdPtr; - - tsdPtr = InitTimer(); - - timerHandlerPtr = (TimerHandler *) ckalloc(sizeof(TimerHandler)); - - /* - * Compute when the event should fire. - */ - - TclpGetTime(&time); - timerHandlerPtr->time.sec = time.sec + milliseconds/1000; - timerHandlerPtr->time.usec = time.usec + (milliseconds%1000)*1000; - if (timerHandlerPtr->time.usec >= 1000000) { - timerHandlerPtr->time.usec -= 1000000; - timerHandlerPtr->time.sec += 1; - } - - /* - * Fill in other fields for the event. - */ - - timerHandlerPtr->proc = proc; - timerHandlerPtr->clientData = clientData; - tsdPtr->lastTimerId++; - timerHandlerPtr->token = (Tcl_TimerToken) tsdPtr->lastTimerId; - - /* - * Add the event to the queue in the correct position - * (ordered by event firing time). - */ - - for (tPtr2 = tsdPtr->firstTimerHandlerPtr, prevPtr = NULL; tPtr2 != NULL; - prevPtr = tPtr2, tPtr2 = tPtr2->nextPtr) { - if ((tPtr2->time.sec > timerHandlerPtr->time.sec) - || ((tPtr2->time.sec == timerHandlerPtr->time.sec) - && (tPtr2->time.usec > timerHandlerPtr->time.usec))) { - break; - } - } - timerHandlerPtr->nextPtr = tPtr2; - if (prevPtr == NULL) { - tsdPtr->firstTimerHandlerPtr = timerHandlerPtr; - } else { - prevPtr->nextPtr = timerHandlerPtr; - } - - TimerSetupProc(NULL, TCL_ALL_EVENTS); - - return timerHandlerPtr->token; -} - -/* - *-------------------------------------------------------------- - * - * Tcl_DeleteTimerHandler -- - * - * Delete a previously-registered timer handler. - * - * Results: - * None. - * - * Side effects: - * Destroy the timer callback identified by TimerToken, - * so that its associated procedure will not be called. - * If the callback has already fired, or if the given - * token doesn't exist, then nothing happens. - * - *-------------------------------------------------------------- - */ - -void -Tcl_DeleteTimerHandler(token) - Tcl_TimerToken token; /* Result previously returned by - * Tcl_DeleteTimerHandler. */ -{ - register TimerHandler *timerHandlerPtr, *prevPtr; - ThreadSpecificData *tsdPtr; - - tsdPtr = InitTimer(); - for (timerHandlerPtr = tsdPtr->firstTimerHandlerPtr, prevPtr = NULL; - timerHandlerPtr != NULL; prevPtr = timerHandlerPtr, - timerHandlerPtr = timerHandlerPtr->nextPtr) { - if (timerHandlerPtr->token != token) { - continue; - } - if (prevPtr == NULL) { - tsdPtr->firstTimerHandlerPtr = timerHandlerPtr->nextPtr; - } else { - prevPtr->nextPtr = timerHandlerPtr->nextPtr; - } - ckfree((char *) timerHandlerPtr); - return; - } -} - -/* - *---------------------------------------------------------------------- - * - * TimerSetupProc -- - * - * This function is called by Tcl_DoOneEvent to setup the timer - * event source for before blocking. This routine checks both the - * idle and after timer lists. - * - * Results: - * None. - * - * Side effects: - * May update the maximum notifier block time. - * - *---------------------------------------------------------------------- - */ - -static void -TimerSetupProc(data, flags) - ClientData data; /* Not used. */ - int flags; /* Event flags as passed to Tcl_DoOneEvent. */ -{ - Tcl_Time blockTime; - ThreadSpecificData *tsdPtr = InitTimer(); - - if (((flags & TCL_IDLE_EVENTS) && tsdPtr->idleList) - || ((flags & TCL_TIMER_EVENTS) && tsdPtr->timerPending)) { - /* - * There is an idle handler or a pending timer event, so just poll. - */ - - blockTime.sec = 0; - blockTime.usec = 0; - - } else if ((flags & TCL_TIMER_EVENTS) && tsdPtr->firstTimerHandlerPtr) { - /* - * Compute the timeout for the next timer on the list. - */ - - TclpGetTime(&blockTime); - blockTime.sec = tsdPtr->firstTimerHandlerPtr->time.sec - blockTime.sec; - blockTime.usec = tsdPtr->firstTimerHandlerPtr->time.usec - - blockTime.usec; - if (blockTime.usec < 0) { - blockTime.sec -= 1; - blockTime.usec += 1000000; - } - if (blockTime.sec < 0) { - blockTime.sec = 0; - blockTime.usec = 0; - } - } else { - return; - } - - Tcl_SetMaxBlockTime(&blockTime); -} - -/* - *---------------------------------------------------------------------- - * - * TimerCheckProc -- - * - * This function is called by Tcl_DoOneEvent to check the timer - * event source for events. This routine checks both the - * idle and after timer lists. - * - * Results: - * None. - * - * Side effects: - * May queue an event and update the maximum notifier block time. - * - *---------------------------------------------------------------------- - */ - -static void -TimerCheckProc(data, flags) - ClientData data; /* Not used. */ - int flags; /* Event flags as passed to Tcl_DoOneEvent. */ -{ - Tcl_Event *timerEvPtr; - Tcl_Time blockTime; - ThreadSpecificData *tsdPtr = InitTimer(); - - if ((flags & TCL_TIMER_EVENTS) && tsdPtr->firstTimerHandlerPtr) { - /* - * Compute the timeout for the next timer on the list. - */ - - TclpGetTime(&blockTime); - blockTime.sec = tsdPtr->firstTimerHandlerPtr->time.sec - blockTime.sec; - blockTime.usec = tsdPtr->firstTimerHandlerPtr->time.usec - - blockTime.usec; - if (blockTime.usec < 0) { - blockTime.sec -= 1; - blockTime.usec += 1000000; - } - if (blockTime.sec < 0) { - blockTime.sec = 0; - blockTime.usec = 0; - } - - /* - * If the first timer has expired, stick an event on the queue. - */ - - if (blockTime.sec == 0 && blockTime.usec == 0 && - !tsdPtr->timerPending) { - tsdPtr->timerPending = 1; - timerEvPtr = (Tcl_Event *) ckalloc(sizeof(Tcl_Event)); - timerEvPtr->proc = TimerHandlerEventProc; - Tcl_QueueEvent(timerEvPtr, TCL_QUEUE_TAIL); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * TimerHandlerEventProc -- - * - * This procedure is called by Tcl_ServiceEvent when a timer event - * reaches the front of the event queue. This procedure handles - * the event by invoking the callbacks for all timers that are - * ready. - * - * 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_TIMER_EVENTS flag bit isn't set. - * - * Side effects: - * Whatever the timer handler callback procedures do. - * - *---------------------------------------------------------------------- - */ - -static int -TimerHandlerEventProc(evPtr, flags) - Tcl_Event *evPtr; /* Event to service. */ - int flags; /* Flags that indicate what events to - * handle, such as TCL_FILE_EVENTS. */ -{ - TimerHandler *timerHandlerPtr, **nextPtrPtr; - Tcl_Time time; - int currentTimerId; - ThreadSpecificData *tsdPtr = InitTimer(); - - /* - * Do nothing if timers aren't enabled. This leaves the event on the - * queue, so we will get to it as soon as ServiceEvents() is called - * with timers enabled. - */ - - if (!(flags & TCL_TIMER_EVENTS)) { - return 0; - } - - /* - * The code below is trickier than it may look, for the following - * reasons: - * - * 1. New handlers can get added to the list while the current - * one is being processed. If new ones get added, we don't - * want to process them during this pass through the list to avoid - * starving other event sources. This is implemented using the - * token number in the handler: new handlers will have a - * newer token than any of the ones currently on the list. - * 2. The handler can call Tcl_DoOneEvent, so we have to remove - * the handler from the list before calling it. Otherwise an - * infinite loop could result. - * 3. Tcl_DeleteTimerHandler can be called to remove an element from - * the list while a handler is executing, so the list could - * change structure during the call. - * 4. Because we only fetch the current time before entering the loop, - * the only way a new timer will even be considered runnable is if - * its expiration time is within the same millisecond as the - * current time. This is fairly likely on Windows, since it has - * a course granularity clock. Since timers are placed - * on the queue in time order with the most recently created - * handler appearing after earlier ones with the same expiration - * time, we don't have to worry about newer generation timers - * appearing before later ones. - */ - - tsdPtr->timerPending = 0; - currentTimerId = tsdPtr->lastTimerId; - TclpGetTime(&time); - while (1) { - nextPtrPtr = &tsdPtr->firstTimerHandlerPtr; - timerHandlerPtr = tsdPtr->firstTimerHandlerPtr; - if (timerHandlerPtr == NULL) { - break; - } - - if ((timerHandlerPtr->time.sec > time.sec) - || ((timerHandlerPtr->time.sec == time.sec) - && (timerHandlerPtr->time.usec > time.usec))) { - break; - } - - /* - * Bail out if the next timer is of a newer generation. - */ - - if ((currentTimerId - (int)timerHandlerPtr->token) < 0) { - break; - } - - /* - * Remove the handler from the queue before invoking it, - * to avoid potential reentrancy problems. - */ - - (*nextPtrPtr) = timerHandlerPtr->nextPtr; - (*timerHandlerPtr->proc)(timerHandlerPtr->clientData); - ckfree((char *) timerHandlerPtr); - } - TimerSetupProc(NULL, TCL_TIMER_EVENTS); - return 1; -} - -/* - *-------------------------------------------------------------- - * - * Tcl_DoWhenIdle -- - * - * Arrange for proc to be invoked the next time the system is - * idle (i.e., just before the next time that Tcl_DoOneEvent - * would have to wait for something to happen). - * - * Results: - * None. - * - * Side effects: - * Proc will eventually be called, with clientData as argument. - * See the manual entry for details. - * - *-------------------------------------------------------------- - */ - -void -Tcl_DoWhenIdle(proc, clientData) - Tcl_IdleProc *proc; /* Procedure to invoke. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ -{ - register IdleHandler *idlePtr; - Tcl_Time blockTime; - ThreadSpecificData *tsdPtr = InitTimer(); - - idlePtr = (IdleHandler *) ckalloc(sizeof(IdleHandler)); - idlePtr->proc = proc; - idlePtr->clientData = clientData; - idlePtr->generation = tsdPtr->idleGeneration; - idlePtr->nextPtr = NULL; - if (tsdPtr->lastIdlePtr == NULL) { - tsdPtr->idleList = idlePtr; - } else { - tsdPtr->lastIdlePtr->nextPtr = idlePtr; - } - tsdPtr->lastIdlePtr = idlePtr; - - blockTime.sec = 0; - blockTime.usec = 0; - Tcl_SetMaxBlockTime(&blockTime); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_CancelIdleCall -- - * - * If there are any when-idle calls requested to a given procedure - * with given clientData, cancel all of them. - * - * Results: - * None. - * - * Side effects: - * If the proc/clientData combination were on the when-idle list, - * they are removed so that they will never be called. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_CancelIdleCall(proc, clientData) - Tcl_IdleProc *proc; /* Procedure that was previously registered. */ - ClientData clientData; /* Arbitrary value to pass to proc. */ -{ - register IdleHandler *idlePtr, *prevPtr; - IdleHandler *nextPtr; - ThreadSpecificData *tsdPtr = InitTimer(); - - for (prevPtr = NULL, idlePtr = tsdPtr->idleList; idlePtr != NULL; - prevPtr = idlePtr, idlePtr = idlePtr->nextPtr) { - while ((idlePtr->proc == proc) - && (idlePtr->clientData == clientData)) { - nextPtr = idlePtr->nextPtr; - ckfree((char *) idlePtr); - idlePtr = nextPtr; - if (prevPtr == NULL) { - tsdPtr->idleList = idlePtr; - } else { - prevPtr->nextPtr = idlePtr; - } - if (idlePtr == NULL) { - tsdPtr->lastIdlePtr = prevPtr; - return; - } - } - } -} - -/* - *---------------------------------------------------------------------- - * - * TclServiceIdle -- - * - * This procedure is invoked by the notifier when it becomes - * idle. It will invoke all idle handlers that are present at - * the time the call is invoked, but not those added during idle - * processing. - * - * Results: - * The return value is 1 if TclServiceIdle found something to - * do, otherwise return value is 0. - * - * Side effects: - * Invokes all pending idle handlers. - * - *---------------------------------------------------------------------- - */ - -int -TclServiceIdle() -{ - IdleHandler *idlePtr; - int oldGeneration; - Tcl_Time blockTime; - ThreadSpecificData *tsdPtr = InitTimer(); - - if (tsdPtr->idleList == NULL) { - return 0; - } - - oldGeneration = tsdPtr->idleGeneration; - tsdPtr->idleGeneration++; - - /* - * The code below is trickier than it may look, for the following - * reasons: - * - * 1. New handlers can get added to the list while the current - * one is being processed. If new ones get added, we don't - * want to process them during this pass through the list (want - * to check for other work to do first). This is implemented - * using the generation number in the handler: new handlers - * will have a different generation than any of the ones currently - * on the list. - * 2. The handler can call Tcl_DoOneEvent, so we have to remove - * the handler from the list before calling it. Otherwise an - * infinite loop could result. - * 3. Tcl_CancelIdleCall can be called to remove an element from - * the list while a handler is executing, so the list could - * change structure during the call. - */ - - for (idlePtr = tsdPtr->idleList; - ((idlePtr != NULL) - && ((oldGeneration - idlePtr->generation) >= 0)); - idlePtr = tsdPtr->idleList) { - tsdPtr->idleList = idlePtr->nextPtr; - if (tsdPtr->idleList == NULL) { - tsdPtr->lastIdlePtr = NULL; - } - (*idlePtr->proc)(idlePtr->clientData); - ckfree((char *) idlePtr); - } - if (tsdPtr->idleList) { - blockTime.sec = 0; - blockTime.usec = 0; - Tcl_SetMaxBlockTime(&blockTime); - } - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AfterObjCmd -- - * - * This procedure is invoked to process the "after" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_AfterObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Points to the "tclAfter" assocData for - * this interpreter, or NULL if the assocData - * hasn't been created yet.*/ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - int ms; - AfterInfo *afterPtr; - AfterAssocData *assocPtr = (AfterAssocData *) clientData; - Tcl_CmdInfo cmdInfo; - int length; - char *argString; - int index; - char buf[16 + TCL_INTEGER_SPACE]; - static char *afterSubCmds[] = {"cancel", "idle", "info", (char *) NULL}; - enum afterSubCmds {AFTER_CANCEL, AFTER_IDLE, AFTER_INFO}; - ThreadSpecificData *tsdPtr = InitTimer(); - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); - return TCL_ERROR; - } - - /* - * Create the "after" information associated for this interpreter, - * if it doesn't already exist. Associate it with the command too, - * so that it will be passed in as the ClientData argument in the - * future. - */ - - if (assocPtr == NULL) { - assocPtr = (AfterAssocData *) ckalloc(sizeof(AfterAssocData)); - assocPtr->interp = interp; - assocPtr->firstAfterPtr = NULL; - Tcl_SetAssocData(interp, "tclAfter", AfterCleanupProc, - (ClientData) assocPtr); - cmdInfo.proc = NULL; - cmdInfo.clientData = (ClientData) NULL; - cmdInfo.objProc = Tcl_AfterObjCmd; - cmdInfo.objClientData = (ClientData) assocPtr; - cmdInfo.deleteProc = NULL; - cmdInfo.deleteData = (ClientData) assocPtr; - Tcl_SetCommandInfo(interp, Tcl_GetStringFromObj(objv[0], &length), - &cmdInfo); - } - - /* - * First lets see if the command was passed a number as the first argument. - */ - - if (objv[1]->typePtr == &tclIntType) { - ms = (int) objv[1]->internalRep.longValue; - goto processInteger; - } - argString = Tcl_GetStringFromObj(objv[1], &length); - if (isdigit(UCHAR(argString[0]))) { /* INTL: digit */ - if (Tcl_GetIntFromObj(interp, objv[1], &ms) != TCL_OK) { - return TCL_ERROR; - } -processInteger: - if (ms < 0) { - ms = 0; - } - if (objc == 2) { - Tcl_Sleep(ms); - return TCL_OK; - } - afterPtr = (AfterInfo *) ckalloc((unsigned) (sizeof(AfterInfo))); - afterPtr->assocPtr = assocPtr; - if (objc == 3) { - afterPtr->commandPtr = objv[2]; - } else { - afterPtr->commandPtr = Tcl_ConcatObj(objc-2, objv+2); - } - Tcl_IncrRefCount(afterPtr->commandPtr); - /* - * The variable below is used to generate unique identifiers for - * after commands. This id can wrap around, which can potentially - * cause problems. However, there are not likely to be problems - * in practice, because after commands can only be requested to - * about a month in the future, and wrap-around is unlikely to - * occur in less than about 1-10 years. Thus it's unlikely that - * any old ids will still be around when wrap-around occurs. - */ - afterPtr->id = tsdPtr->afterId; - tsdPtr->afterId += 1; - afterPtr->token = Tcl_CreateTimerHandler(ms, AfterProc, - (ClientData) afterPtr); - afterPtr->nextPtr = assocPtr->firstAfterPtr; - assocPtr->firstAfterPtr = afterPtr; - sprintf(buf, "after#%d", afterPtr->id); - Tcl_AppendResult(interp, buf, (char *) NULL); - return TCL_OK; - } - - /* - * If it's not a number it must be a subcommand. - */ - - if (Tcl_GetIndexFromObj(NULL, objv[1], afterSubCmds, "argument", - 0, &index) != TCL_OK) { - Tcl_AppendResult(interp, "bad argument \"", argString, - "\": must be cancel, idle, info, or a number", - (char *) NULL); - return TCL_ERROR; - } - switch ((enum afterSubCmds) index) { - case AFTER_CANCEL: { - Tcl_Obj *commandPtr; - char *command, *tempCommand; - int tempLength; - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "id|command"); - return TCL_ERROR; - } - if (objc == 3) { - commandPtr = objv[2]; - } else { - commandPtr = Tcl_ConcatObj(objc-2, objv+2);; - } - command = Tcl_GetStringFromObj(commandPtr, &length); - for (afterPtr = assocPtr->firstAfterPtr; afterPtr != NULL; - afterPtr = afterPtr->nextPtr) { - tempCommand = Tcl_GetStringFromObj(afterPtr->commandPtr, - &tempLength); - if ((length == tempLength) - && (memcmp((void*) command, (void*) tempCommand, - (unsigned) length) == 0)) { - break; - } - } - if (afterPtr == NULL) { - afterPtr = GetAfterEvent(assocPtr, commandPtr); - } - if (objc != 3) { - Tcl_DecrRefCount(commandPtr); - } - if (afterPtr != NULL) { - if (afterPtr->token != NULL) { - Tcl_DeleteTimerHandler(afterPtr->token); - } else { - Tcl_CancelIdleCall(AfterProc, (ClientData) afterPtr); - } - FreeAfterPtr(afterPtr); - } - break; - } - case AFTER_IDLE: - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "script script ..."); - return TCL_ERROR; - } - afterPtr = (AfterInfo *) ckalloc((unsigned) (sizeof(AfterInfo))); - afterPtr->assocPtr = assocPtr; - if (objc == 3) { - afterPtr->commandPtr = objv[2]; - } else { - afterPtr->commandPtr = Tcl_ConcatObj(objc-2, objv+2); - } - Tcl_IncrRefCount(afterPtr->commandPtr); - afterPtr->id = tsdPtr->afterId; - tsdPtr->afterId += 1; - afterPtr->token = NULL; - afterPtr->nextPtr = assocPtr->firstAfterPtr; - assocPtr->firstAfterPtr = afterPtr; - Tcl_DoWhenIdle(AfterProc, (ClientData) afterPtr); - sprintf(buf, "after#%d", afterPtr->id); - Tcl_AppendResult(interp, buf, (char *) NULL); - break; - case AFTER_INFO: { - Tcl_Obj *resultListPtr; - - if (objc == 2) { - for (afterPtr = assocPtr->firstAfterPtr; afterPtr != NULL; - afterPtr = afterPtr->nextPtr) { - if (assocPtr->interp == interp) { - sprintf(buf, "after#%d", afterPtr->id); - Tcl_AppendElement(interp, buf); - } - } - return TCL_OK; - } - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "?id?"); - return TCL_ERROR; - } - afterPtr = GetAfterEvent(assocPtr, objv[2]); - if (afterPtr == NULL) { - Tcl_AppendResult(interp, "event \"", Tcl_GetString(objv[2]), - "\" doesn't exist", (char *) NULL); - return TCL_ERROR; - } - resultListPtr = Tcl_GetObjResult(interp); - Tcl_ListObjAppendElement(interp, resultListPtr, afterPtr->commandPtr); - Tcl_ListObjAppendElement(interp, resultListPtr, Tcl_NewStringObj( - (afterPtr->token == NULL) ? "idle" : "timer", -1)); - Tcl_SetObjResult(interp, resultListPtr); - break; - } - default: { - panic("Tcl_AfterObjCmd: bad subcommand index to afterSubCmds"); - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * GetAfterEvent -- - * - * This procedure parses an "after" id such as "after#4" and - * returns a pointer to the AfterInfo structure. - * - * Results: - * The return value is either a pointer to an AfterInfo structure, - * if one is found that corresponds to "cmdString" and is for interp, - * or NULL if no corresponding after event can be found. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static AfterInfo * -GetAfterEvent(assocPtr, commandPtr) - AfterAssocData *assocPtr; /* Points to "after"-related information for - * this interpreter. */ - Tcl_Obj *commandPtr; -{ - char *cmdString; /* Textual identifier for after event, such - * as "after#6". */ - AfterInfo *afterPtr; - int id; - char *end; - - cmdString = Tcl_GetString(commandPtr); - if (strncmp(cmdString, "after#", 6) != 0) { - return NULL; - } - cmdString += 6; - id = strtoul(cmdString, &end, 10); - if ((end == cmdString) || (*end != 0)) { - return NULL; - } - for (afterPtr = assocPtr->firstAfterPtr; afterPtr != NULL; - afterPtr = afterPtr->nextPtr) { - if (afterPtr->id == id) { - return afterPtr; - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * AfterProc -- - * - * Timer callback to execute commands registered with the - * "after" command. - * - * Results: - * None. - * - * Side effects: - * Executes whatever command was specified. If the command - * returns an error, then the command "bgerror" is invoked - * to process the error; if bgerror fails then information - * about the error is output on stderr. - * - *---------------------------------------------------------------------- - */ - -static void -AfterProc(clientData) - ClientData clientData; /* Describes command to execute. */ -{ - AfterInfo *afterPtr = (AfterInfo *) clientData; - AfterAssocData *assocPtr = afterPtr->assocPtr; - AfterInfo *prevPtr; - int result; - Tcl_Interp *interp; - char *script; - int numBytes; - - /* - * First remove the callback from our list of callbacks; otherwise - * someone could delete the callback while it's being executed, which - * could cause a core dump. - */ - - if (assocPtr->firstAfterPtr == afterPtr) { - assocPtr->firstAfterPtr = afterPtr->nextPtr; - } else { - for (prevPtr = assocPtr->firstAfterPtr; prevPtr->nextPtr != afterPtr; - prevPtr = prevPtr->nextPtr) { - /* Empty loop body. */ - } - prevPtr->nextPtr = afterPtr->nextPtr; - } - - /* - * Execute the callback. - */ - - interp = assocPtr->interp; - Tcl_Preserve((ClientData) interp); - script = Tcl_GetStringFromObj(afterPtr->commandPtr, &numBytes); - result = Tcl_EvalEx(interp, script, numBytes, TCL_EVAL_GLOBAL); - if (result != TCL_OK) { - Tcl_AddErrorInfo(interp, "\n (\"after\" script)"); - Tcl_BackgroundError(interp); - } - Tcl_Release((ClientData) interp); - - /* - * Free the memory for the callback. - */ - - Tcl_DecrRefCount(afterPtr->commandPtr); - ckfree((char *) afterPtr); -} - -/* - *---------------------------------------------------------------------- - * - * FreeAfterPtr -- - * - * This procedure removes an "after" command from the list of - * those that are pending and frees its resources. This procedure - * does *not* cancel the timer handler; if that's needed, the - * caller must do it. - * - * Results: - * None. - * - * Side effects: - * The memory associated with afterPtr is released. - * - *---------------------------------------------------------------------- - */ - -static void -FreeAfterPtr(afterPtr) - AfterInfo *afterPtr; /* Command to be deleted. */ -{ - AfterInfo *prevPtr; - AfterAssocData *assocPtr = afterPtr->assocPtr; - - if (assocPtr->firstAfterPtr == afterPtr) { - assocPtr->firstAfterPtr = afterPtr->nextPtr; - } else { - for (prevPtr = assocPtr->firstAfterPtr; prevPtr->nextPtr != afterPtr; - prevPtr = prevPtr->nextPtr) { - /* Empty loop body. */ - } - prevPtr->nextPtr = afterPtr->nextPtr; - } - Tcl_DecrRefCount(afterPtr->commandPtr); - ckfree((char *) afterPtr); -} - -/* - *---------------------------------------------------------------------- - * - * AfterCleanupProc -- - * - * This procedure is invoked whenever an interpreter is deleted - * to cleanup the AssocData for "tclAfter". - * - * Results: - * None. - * - * Side effects: - * After commands are removed. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static void -AfterCleanupProc(clientData, interp) - ClientData clientData; /* Points to AfterAssocData for the - * interpreter. */ - Tcl_Interp *interp; /* Interpreter that is being deleted. */ -{ - AfterAssocData *assocPtr = (AfterAssocData *) clientData; - AfterInfo *afterPtr; - - while (assocPtr->firstAfterPtr != NULL) { - afterPtr = assocPtr->firstAfterPtr; - assocPtr->firstAfterPtr = afterPtr->nextPtr; - if (afterPtr->token != NULL) { - Tcl_DeleteTimerHandler(afterPtr->token); - } else { - Tcl_CancelIdleCall(AfterProc, (ClientData) afterPtr); - } - Tcl_DecrRefCount(afterPtr->commandPtr); - ckfree((char *) afterPtr); - } - ckfree((char *) assocPtr); -} diff --git a/generic/tclUniData.c b/generic/tclUniData.c deleted file mode 100644 index 976a914..0000000 --- a/generic/tclUniData.c +++ /dev/null @@ -1,621 +0,0 @@ -/* - * tclUtfData.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 (c) 1998 by Scriptics Corporation. - * All rights reserved. - * - * RCS: @(#) $Id: tclUniData.c,v 1.2 1999/04/16 00:46:55 stanton Exp $ - */ - -/* - * 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 6 - -/* - * 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 char pageMap[] = { - 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, 28, 28, 28, 28, 28, 28, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 28, 28, 47, 48, 49, 50, 51, 52, 53, 28, 28, 28, 54, 55, 56, 57, 58, - 59, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 60, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 75, - 76, 77, 78, 28, 28, 79, 80, 81, 82, 83, 83, 84, 85, 86, 85, 28, 28, - 87, 88, 89, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 90, 91, 92, 93, 94, 56, 95, 28, 96, 97, 98, 99, 83, 100, 83, - 101, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 102, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 103, 28, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 56, 56, 56, 56, 106, 28, 28, 28, 107, 108, 109, 110, 56, 56, 56, - 56, 111, 112, 113, 114, 115, 116, 56, 117, 118, 119, 120, 121 -}; - -/* - * 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 char groupMap[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 4, 3, 3, 3, 5, 6, 3, 7, 3, 8, - 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 7, 7, 7, 3, 3, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 5, 3, 6, 11, 12, 11, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 5, 7, 6, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 4, 4, - 4, 14, 14, 11, 14, 15, 16, 7, 8, 14, 11, 14, 7, 17, 17, 11, 15, 14, - 3, 11, 17, 15, 18, 17, 17, 17, 3, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 7, 10, 10, - 10, 10, 10, 10, 10, 15, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 7, 13, 13, 13, 13, - 13, 13, 13, 19, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 22, 23, 20, 21, 20, 21, 20, 21, 15, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 15, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 24, 20, 21, 20, 21, 20, 21, 25, 15, 26, 20, 21, - 20, 21, 27, 20, 21, 28, 28, 20, 21, 15, 29, 30, 31, 20, 21, 28, 32, - 15, 33, 34, 20, 21, 15, 15, 33, 35, 15, 36, 20, 21, 20, 21, 20, 21, - 37, 20, 21, 38, 39, 15, 20, 21, 38, 20, 21, 40, 40, 20, 21, 20, 21, - 41, 20, 21, 15, 39, 20, 21, 39, 39, 39, 39, 39, 39, 42, 43, 44, 42, - 43, 44, 42, 43, 44, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 45, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 15, 42, 43, 44, 20, 21, 0, 0, 0, 0, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 15, 15, 46, 47, 15, 48, 48, 15, 49, 15, 50, 15, 15, 15, 15, - 48, 15, 15, 51, 15, 15, 15, 15, 52, 53, 15, 15, 15, 15, 15, 53, 15, - 15, 54, 15, 15, 55, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 56, 15, 15, 15, 15, 56, 15, 57, 57, 15, 15, 15, 15, 15, 15, 58, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 11, 11, 59, 59, 59, 59, 59, 59, 59, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 59, 59, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 0, 59, 59, 59, 59, 59, 11, 11, 11, 11, 11, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 60, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 3, 0, 0, 0, 0, 59, 0, 0, 0, 3, 0, 0, 0, 0, 0, 11, 11, 61, - 3, 62, 62, 62, 0, 63, 0, 64, 64, 15, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 65, 66, 66, 66, 15, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 67, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 68, 69, 69, 0, 70, 71, 37, 37, 37, 72, 73, 0, 0, 0, 37, 0, 37, 0, 37, - 0, 37, 0, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 74, - 75, 45, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 0, 76, 76, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 0, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 0, 75, 75, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 14, 60, 60, 60, 60, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 39, 20, - 21, 20, 21, 0, 0, 20, 21, 0, 0, 20, 21, 0, 0, 0, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 0, 0, 20, 21, 20, 21, 20, 21, 20, 21, 0, 0, - 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 0, 0, 59, 3, 3, - 3, 3, 3, 3, 0, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 15, 0, 3, 0, 0, 0, 0, 0, 0, 0, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 0, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 0, 60, 60, 60, 3, 60, 3, 60, 60, 3, 60, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 0, 0, 0, 0, 0, 39, 39, 39, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 3, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, - 0, 0, 0, 0, 59, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 60, 60, 60, - 60, 60, 60, 60, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 0, 0, 60, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 39, 39, - 39, 39, 39, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 0, 39, 39, 39, 39, 3, 39, 60, 60, 60, 60, 60, 60, 60, 79, 79, - 60, 60, 60, 60, 60, 60, 59, 59, 60, 60, 14, 60, 60, 60, 60, 0, 0, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 60, 80, 0, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 60, 39, - 80, 80, 80, 60, 60, 60, 60, 60, 60, 60, 60, 80, 80, 80, 80, 60, 0, - 0, 14, 60, 60, 60, 60, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 60, 60, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 80, 80, 0, 39, 39, 39, 39, 39, 39, - 39, 39, 0, 0, 39, 39, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 39, 39, 39, 39, - 39, 39, 39, 0, 39, 0, 0, 0, 39, 39, 39, 39, 0, 0, 60, 0, 80, 80, 80, - 60, 60, 60, 60, 0, 0, 80, 80, 0, 0, 80, 80, 60, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 80, 0, 0, 0, 0, 39, 39, 0, 39, 39, 39, 60, 60, 0, 0, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 39, 39, 4, 4, 17, 17, 17, 17, 17, 17, 14, 0, 0, - 0, 0, 0, 0, 0, 60, 0, 0, 39, 39, 39, 39, 39, 39, 0, 0, 0, 0, 39, 39, - 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 0, 39, 39, 39, 39, 39, 39, 39, 0, 39, 39, 0, - 39, 39, 0, 39, 39, 0, 0, 60, 0, 80, 80, 80, 60, 60, 0, 0, 0, 0, 60, - 60, 0, 0, 60, 60, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 39, 39, - 39, 0, 39, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 60, 60, - 39, 39, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 60, 80, 0, 39, - 39, 39, 39, 39, 39, 39, 0, 39, 0, 39, 39, 39, 0, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 0, 39, 39, 39, 39, 39, 39, 39, 0, 39, 39, 0, 39, 39, 39, 39, 39, 0, - 0, 60, 39, 80, 80, 80, 60, 60, 60, 60, 60, 0, 60, 60, 80, 0, 80, 80, - 60, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, - 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 60, 80, 80, 0, 39, 39, 39, 39, 39, 39, 39, 39, - 0, 0, 39, 39, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 39, 39, 39, 39, 39, 39, - 39, 0, 39, 39, 0, 0, 39, 39, 39, 39, 0, 0, 60, 39, 80, 60, 80, 60, - 60, 60, 0, 0, 0, 80, 80, 0, 0, 80, 80, 60, 0, 0, 0, 0, 0, 0, 0, 0, - 60, 80, 0, 0, 0, 0, 39, 39, 0, 39, 39, 39, 0, 0, 0, 0, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 60, 80, 0, 39, 39, 39, 39, 39, 39, 0, 0, 0, 39, 39, 39, 0, 39, - 39, 39, 39, 0, 0, 0, 39, 39, 0, 39, 0, 39, 39, 0, 0, 0, 39, 39, 0, - 0, 0, 39, 39, 39, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 0, 39, 39, - 39, 0, 0, 0, 0, 80, 80, 60, 80, 80, 0, 0, 0, 80, 80, 80, 0, 80, 80, - 80, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 17, 17, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 0, 39, 39, 39, 39, 39, 39, 39, - 39, 0, 39, 39, 39, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 0, 39, 39, 39, 39, 39, 0, 0, 0, 0, 60, 60, 60, - 80, 80, 80, 80, 0, 60, 60, 60, 0, 60, 60, 60, 60, 0, 0, 0, 0, 0, 0, - 0, 60, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 39, 0, 0, 0, 0, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 80, 80, 0, 39, 39, 39, 39, 39, 39, 39, 39, 0, 39, 39, 39, 0, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 0, 39, 39, 39, 39, 39, 0, 0, 0, 0, 80, 60, 80, 80, 80, 80, 80, 0, 60, - 80, 80, 0, 80, 80, 60, 60, 0, 0, 0, 0, 0, 0, 0, 80, 80, 0, 0, 0, 0, - 0, 0, 0, 39, 0, 39, 39, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 0, 39, 39, - 39, 39, 39, 39, 39, 39, 0, 39, 39, 39, 0, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, - 0, 0, 0, 80, 80, 80, 60, 60, 60, 0, 0, 80, 80, 80, 0, 80, 80, 80, 60, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 39, 39, 0, 0, - 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 3, - 39, 60, 39, 39, 60, 60, 60, 60, 60, 60, 60, 0, 0, 0, 0, 4, 39, 39, - 39, 39, 39, 39, 59, 60, 60, 60, 60, 60, 60, 60, 60, 14, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, - 39, 0, 39, 0, 0, 39, 39, 0, 39, 0, 0, 39, 0, 0, 0, 0, 0, 0, 39, 39, - 39, 39, 0, 39, 39, 39, 39, 39, 39, 39, 0, 39, 39, 39, 0, 39, 0, 39, - 0, 0, 39, 39, 0, 39, 39, 3, 39, 60, 39, 39, 60, 60, 60, 60, 60, 60, - 0, 60, 60, 39, 0, 0, 39, 39, 39, 39, 39, 0, 59, 0, 60, 60, 60, 60, - 60, 60, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 39, 39, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 14, 14, 14, 14, 14, 60, 60, 14, 14, 14, 14, 14, 14, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 14, 60, 14, 60, 14, 60, 5, 6, 5, 6, 5, 6, 39, 39, 39, 39, 39, 39, 39, - 39, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 0, 0, 0, 0, 0, 0, 0, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 80, 60, 60, 60, 60, 60, 3, 60, 60, 14, 14, 14, 14, 0, 0, - 0, 0, 60, 60, 60, 60, 60, 60, 0, 60, 0, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 0, 0, 0, 60, - 60, 60, 60, 60, 60, 60, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 0, 0, 0, 0, 3, 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 0, 0, 0, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 0, 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 0, 0, 0, 0, 0, 0, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 15, 15, 15, 15, 15, 81, 0, 0, 0, 0, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, - 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, 21, 20, - 21, 20, 21, 0, 0, 0, 0, 0, 0, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, - 83, 83, 83, 83, 83, 83, 82, 82, 82, 82, 82, 82, 0, 0, 83, 83, 83, 83, - 83, 83, 0, 0, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, - 83, 83, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, 83, - 83, 82, 82, 82, 82, 82, 82, 0, 0, 83, 83, 83, 83, 83, 83, 0, 0, 15, - 82, 15, 82, 15, 82, 15, 82, 0, 83, 0, 83, 0, 83, 0, 83, 82, 82, 82, - 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 85, 85, - 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 0, 0, 82, 82, 82, 82, 82, 82, - 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 82, 82, 82, 82, 82, 82, 82, - 82, 83, 83, 83, 83, 83, 83, 83, 83, 82, 82, 82, 82, 82, 82, 82, 82, - 83, 83, 83, 83, 83, 83, 83, 83, 82, 82, 15, 90, 15, 0, 15, 15, 83, - 83, 91, 91, 92, 11, 37, 11, 11, 11, 15, 90, 15, 0, 15, 15, 93, 93, - 93, 93, 92, 11, 11, 11, 82, 82, 15, 15, 0, 0, 15, 15, 83, 83, 94, 94, - 0, 11, 11, 11, 82, 82, 15, 15, 15, 95, 15, 15, 83, 83, 96, 96, 97, - 11, 11, 11, 0, 0, 15, 90, 15, 0, 15, 15, 98, 98, 99, 99, 92, 11, 11, - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 100, 100, 100, 100, 8, 8, 8, - 8, 8, 8, 3, 3, 16, 18, 5, 16, 16, 18, 5, 16, 3, 3, 3, 3, 3, 3, 3, 3, - 101, 102, 100, 100, 100, 100, 100, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 16, - 18, 3, 3, 3, 3, 12, 12, 3, 3, 3, 7, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 100, 100, 100, 100, 100, 100, 17, 0, 0, 0, 17, 17, 17, 17, - 17, 17, 7, 7, 7, 5, 6, 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 7, 7, 7, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 79, 79, 79, - 79, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 37, 14, 14, 14, 14, 37, 14, 14, - 15, 37, 37, 37, 15, 15, 37, 37, 37, 15, 14, 37, 14, 14, 37, 37, 37, - 37, 37, 37, 14, 14, 14, 14, 14, 14, 37, 14, 37, 14, 37, 14, 37, 37, - 37, 37, 15, 15, 37, 37, 14, 37, 15, 39, 39, 39, 39, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 103, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 105, 105, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, 7, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 14, 14, 14, 14, 14, 14, 7, - 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 7, 7, 14, 14, 14, 14, 14, 14, 14, 5, 6, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 0, 14, 14, 14, 14, 0, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 0, 14, 0, 14, 14, 14, 14, 0, 0, 0, 14, - 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 14, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 2, 3, 3, - 3, 14, 59, 3, 105, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 14, 14, 5, 6, 5, 6, - 5, 6, 5, 6, 8, 5, 6, 6, 14, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 60, 60, 60, 60, 60, 60, 8, 59, 59, 59, 59, 59, 14, 14, 0, 0, 0, - 0, 0, 0, 0, 14, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 0, 0, 0, 0, 60, 60, 59, 59, 59, 59, 0, 0, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 3, 59, 59, 59, 0, 0, 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, - 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 14, - 14, 17, 17, 17, 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 0, 0, 0, 14, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 60, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 7, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 0, 39, 39, 39, 39, 39, 0, 39, 0, 39, 39, 0, 39, - 39, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 60, 60, 60, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 8, - 12, 12, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 0, 0, 0, 0, - 3, 3, 3, 3, 12, 12, 12, 3, 3, 3, 0, 3, 3, 3, 3, 8, 5, 6, 5, 6, 5, 6, - 3, 3, 3, 7, 8, 7, 7, 7, 0, 3, 4, 3, 3, 0, 0, 0, 0, 39, 39, 39, 0, 39, - 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 0, 0, 100, 0, 3, 3, 3, 4, 3, 3, 3, 5, 6, 3, 7, 3, 8, - 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 7, 7, 7, 3, 3, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 5, 3, 6, 11, 12, 11, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 5, 7, 6, 7, 0, 0, 3, 5, 6, 3, 3, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 59, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 59, - 59, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 0, - 39, 39, 39, 39, 39, 39, 0, 0, 39, 39, 39, 39, 39, 39, 0, 0, 39, 39, - 39, 39, 39, 39, 0, 0, 39, 39, 39, 0, 0, 0, 4, 4, 7, 11, 14, 4, 4, 0, - 7, 7, 7, 7, 7, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, - 0, 0 -}; - -/* - * 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 = sutract delta for title/upper - * 101 = sub delta for upper, sub 1 for title - * 110 = sub delta for upper, add delta for lower - * - * Bits 8-21 Reserved for future use. - * - * Bits 22-31 Case delta: delta for case conversions. This should be the - * highest field so we can easily sign extend. - */ - -static int groups[] = { - 0, 15, 12, 25, 27, 21, 22, 26, 20, 9, 134217793, 28, 19, 134217858, - 29, 2, 23, 11, 24, -507510654, 4194369, 4194434, -834666431, 973078658, - -507510719, 1258291330, 880803905, 864026689, 859832385, 331350081, - 847249473, 851443777, 868220993, 884998209, 876609601, 893386817, - 897581121, 1, 914358337, 5, 910164033, 918552641, 8388705, 4194499, - 8388770, 331350146, 880803970, 864026754, 859832450, 847249538, - 851443842, 868221058, 876609666, 884998274, 893386882, 897581186, - 914358402, 910164098, 918552706, 4, 6, 159383617, 155189313, 268435521, - 264241217, 159383682, 155189378, 130023554, 268435586, 264241282, - 260046978, 239075458, 197132418, 226492546, 360710274, 335544450, - 335544385, 201326657, 201326722, 7, 8, 247464066, -33554302, -33554367, - -310378366, -360710014, -419430270, -536870782, -469761918, -528482174, - -37748606, -310378431, -37748671, -360710079, -419430335, -29359998, - -469761983, -29360063, -536870847, -528482239, 16, 13, 14, 67108938, - 67109002, 10, 109051997, 109052061, 18, 17 -}; - -/* - * The following constants are used to determine the category of a - * Unicode character. - */ - -#define UNICODE_CATEGORY_MASK 0X1F - -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(info) ((info) & 0x1F) -#define GetDelta(infO) (((info) > 0) ? ((info) >> 22) : (~(~((info)) >> 22))) - -/* - * This macro extracts the information about a character from the - * Unicode character tables. - */ - -#define GetUniCharInfo(ch) (groups[(int)groupMap[(int)((pageMap[(((int)(ch)) & 0xffff) >> OFFSET_BITS] << OFFSET_BITS) | ((ch) & ((1 << OFFSET_BITS)-1)))]]) - diff --git a/generic/tclUtf.c b/generic/tclUtf.c deleted file mode 100644 index 89c6b60..0000000 --- a/generic/tclUtf.c +++ /dev/null @@ -1,1287 +0,0 @@ -/* - * tclUtf.c -- - * - * Routines for manipulating UTF-8 strings. - * - * Copyright (c) 1997-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. - * - * RCS: @(#) $Id: tclUtf.c,v 1.2 1999/04/16 00:46:55 stanton Exp $ - */ - -#include "tclInt.h" - -/* - * Include the static character classification tables and macros. - */ - -#include "tclUniData.c" - -/* - * The following macros are used for fast character category tests. The - * x_BITS values are shifted right by the category value to determine whether - * the given category is included in the set. - */ - -#define ALPHA_BITS ((1 << UPPERCASE_LETTER) | (1 << LOWERCASE_LETTER) \ - | (1 << TITLECASE_LETTER) | (1 << MODIFIER_LETTER) | (1 << OTHER_LETTER)) - -#define DIGIT_BITS (1 << DECIMAL_DIGIT_NUMBER) - -#define SPACE_BITS ((1 << SPACE_SEPARATOR) | (1 << LINE_SEPARATOR) \ - | (1 << PARAGRAPH_SEPARATOR)) - -#define CONNECTOR_BITS (1 << CONNECTOR_PUNCTUATION) - -/* - * Unicode characters less than this value are represented by themselves - * in UTF-8 strings. - */ - -#define UNICODE_SELF 0x80 - -/* - * The following structures are used when mapping between Unicode (UCS-2) - * and UTF-8. - */ - -CONST unsigned char totalBytes[256] = { - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -#if TCL_UTF_MAX > 3 - 4,4,4,4,4,4,4,4, -#else - 1,1,1,1,1,1,1,1, -#endif -#if TCL_UTF_MAX > 4 - 5,5,5,5, -#else - 1,1,1,1, -#endif -#if TCL_UTF_MAX > 5 - 6,6,6,6 -#else - 1,1,1,1 -#endif -}; - - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UniCharToUtf -- - * - * Store the given Tcl_UniChar as a sequence of UTF-8 bytes in the - * provided buffer. Equivalent to Plan 9 runetochar(). - * - * Results: - * The return values is the number of bytes in the buffer that - * were consumed. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -INLINE int -Tcl_UniCharToUtf(ch, str) - int ch; /* The Tcl_UniChar to be stored in the - * buffer. */ - char *str; /* Buffer in which the UTF-8 representation - * of the Tcl_UniChar is stored. Buffer must - * be large enough to hold the UTF-8 character - * (at most TCL_UTF_MAX bytes). */ -{ - if ((ch > 0) && (ch < UNICODE_SELF)) { - str[0] = (char) ch; - return 1; - } - if (ch <= 0x7FF) { - str[1] = (char) ((ch | 0x80) & 0xBF); - str[0] = (char) ((ch >> 6) | 0xC0); - return 2; - } - if (ch <= 0xFFFF) { - three: - str[2] = (char) ((ch | 0x80) & 0xBF); - str[1] = (char) (((ch >> 6) | 0x80) & 0xBF); - str[0] = (char) ((ch >> 12) | 0xE0); - return 3; - } - -#if TCL_UTF_MAX > 3 - if (ch <= 0x1FFFFF) { - str[3] = (char) ((ch | 0x80) & 0xBF); - str[2] = (char) (((ch >> 6) | 0x80) & 0xBF); - str[1] = (char) (((ch >> 12) | 0x80) & 0xBF); - str[0] = (char) ((ch >> 18) | 0xF0); - return 4; - } - if (ch <= 0x3FFFFFF) { - str[4] = (char) ((ch | 0x80) & 0xBF); - str[3] = (char) (((ch >> 6) | 0x80) & 0xBF); - str[2] = (char) (((ch >> 12) | 0x80) & 0xBF); - str[1] = (char) (((ch >> 18) | 0x80) & 0xBF); - str[0] = (char) ((ch >> 24) | 0xF8); - return 5; - } - if (ch <= 0x7FFFFFFF) { - str[5] = (char) ((ch | 0x80) & 0xBF); - str[4] = (char) (((ch >> 6) | 0x80) & 0xBF); - str[3] = (char) (((ch >> 12) | 0x80) & 0xBF); - str[2] = (char) (((ch >> 18) | 0x80) & 0xBF); - str[1] = (char) (((ch >> 24) | 0x80) & 0xBF); - str[0] = (char) ((ch >> 30) | 0xFC); - return 6; - } -#endif - - ch = 0xFFFD; - goto three; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UniCharToUtfDString -- - * - * Convert the given Unicode string to UTF-8. - * - * Results: - * The return value is a pointer to the UTF-8 representation of the - * Unicode string. Storage for the return value is appended to the - * end of dsPtr. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -char * -Tcl_UniCharToUtfDString(wString, numChars, dsPtr) - CONST Tcl_UniChar *wString; /* Unicode string to convert to UTF-8. */ - int numChars; /* Length of Unicode string in Tcl_UniChars - * (must be >= 0). */ - Tcl_DString *dsPtr; /* UTF-8 representation of string is - * appended to this previously initialized - * DString. */ -{ - CONST Tcl_UniChar *w, *wEnd; - char *p, *string; - int oldLength; - - /* - * UTF-8 string length in bytes will be <= Unicode string length * - * TCL_UTF_MAX. - */ - - oldLength = Tcl_DStringLength(dsPtr); - Tcl_DStringSetLength(dsPtr, (oldLength + numChars + 1) * TCL_UTF_MAX); - string = Tcl_DStringValue(dsPtr) + oldLength; - - p = string; - wEnd = wString + numChars; - for (w = wString; w < wEnd; ) { - p += Tcl_UniCharToUtf(*w, p); - w++; - } - Tcl_DStringSetLength(dsPtr, oldLength + (p - string)); - - return string; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfToUniChar -- - * - * Extract the Tcl_UniChar represented by the UTF-8 string. Bad - * UTF-8 sequences are converted to valid Tcl_UniChars and processing - * continues. Equivalent to Plan 9 chartorune(). - * - * The caller must ensure that the source buffer is long enough that - * this routine does not run off the end and dereference non-existent - * memory looking for trail bytes. If the source buffer is known to - * be '\0' terminated, this cannot happen. Otherwise, the caller - * should call Tcl_UtfCharComplete() before calling this routine to - * ensure that enough bytes remain in the string. - * - * Results: - * *chPtr is filled with the Tcl_UniChar, and the return value is the - * number of bytes from the UTF-8 string that were consumed. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_UtfToUniChar(str, chPtr) - register CONST char *str; /* The UTF-8 string. */ - register Tcl_UniChar *chPtr; /* Filled with the Tcl_UniChar represented - * by the UTF-8 string. */ -{ - register int byte; - - /* - * Unroll 1 to 3 byte UTF-8 sequences, use loop to handle longer ones. - */ - - byte = *((unsigned char *) str); - if (byte < 0xC0) { - /* - * Handles properly formed UTF-8 characters between 0x01 and 0x7F. - * Also treats \0 and naked trail bytes 0x80 to 0xBF as valid - * characters representing themselves. - */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } else if (byte < 0xE0) { - if ((str[1] & 0xC0) == 0x80) { - /* - * Two-byte-character lead-byte followed by a trail-byte. - */ - - *chPtr = (Tcl_UniChar) (((byte & 0x1F) << 6) | (str[1] & 0x3F)); - return 2; - } - /* - * A two-byte-character lead-byte not followed by trail-byte - * represents itself. - */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } else if (byte < 0xF0) { - if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { - /* - * Three-byte-character lead byte followed by two trail bytes. - */ - - *chPtr = (Tcl_UniChar) (((byte & 0x0F) << 12) - | ((str[1] & 0x3F) << 6) | (str[2] & 0x3F)); - return 3; - } - /* - * A three-byte-character lead-byte not followed by two trail-bytes - * represents itself. - */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } -#if TCL_UTF_MAX > 3 - else { - int ch, total, trail; - - total = totalBytes[byte]; - trail = total - 1; - if (trail > 0) { - ch = byte & (0x3F >> trail); - do { - str++; - if ((*str & 0xC0) != 0x80) { - *chPtr = byte; - return 1; - } - ch <<= 6; - ch |= (*str & 0x3F); - trail--; - } while (trail > 0); - *chPtr = ch; - return total; - } - } -#endif - - *chPtr = (Tcl_UniChar) byte; - return 1; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfToUniCharDString -- - * - * Convert the UTF-8 string to Unicode. - * - * Results: - * The return value is a pointer to the Unicode representation of the - * UTF-8 string. Storage for the return value is appended to the - * end of dsPtr. The Unicode string is terminated with a Unicode - * NULL character. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -Tcl_UniChar * -Tcl_UtfToUniCharDString(string, length, dsPtr) - CONST char *string; /* UTF-8 string to convert to Unicode. */ - int length; /* Length of UTF-8 string in bytes, or -1 - * for strlen(). */ - Tcl_DString *dsPtr; /* Unicode representation of string is - * appended to this previously initialized - * DString. */ -{ - Tcl_UniChar *w, *wString; - CONST char *p, *end; - int oldLength; - - if (length < 0) { - length = strlen(string); - } - - /* - * Unicode string length in Tcl_UniChars will be <= UTF-8 string length - * in bytes. - */ - - oldLength = Tcl_DStringLength(dsPtr); - Tcl_DStringSetLength(dsPtr, - (int) ((oldLength + length + 1) * sizeof(Tcl_UniChar))); - wString = (Tcl_UniChar *) (Tcl_DStringValue(dsPtr) + oldLength); - - w = wString; - end = string + length; - for (p = string; p < end; ) { - p += Tcl_UtfToUniChar(p, w); - w++; - } - *w = '\0'; - Tcl_DStringSetLength(dsPtr, - (oldLength + ((char *) w - (char *) wString))); - - return wString; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfCharComplete -- - * - * Determine if the UTF-8 string of the given length is long enough - * to be decoded by Tcl_UtfToUniChar(). This does not ensure that the - * UTF-8 string is properly formed. Equivalent to Plan 9 fullrune(). - * - * Results: - * The return value is 0 if the string is not long enough, non-zero - * otherwise. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_UtfCharComplete(str, len) - CONST char *str; /* String to check if first few bytes - * contain a complete UTF-8 character. */ - int len; /* Length of above string in bytes. */ -{ - int ch; - - ch = *((unsigned char *) str); - return len >= totalBytes[ch]; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_NumUtfChars -- - * - * Returns the number of characters (not bytes) in the UTF-8 string, - * not including the terminating NULL byte. This is equivalent to - * Plan 9 utflen() and utfnlen(). - * - * Results: - * As above. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_NumUtfChars(str, len) - register CONST char *str; /* The UTF-8 string to measure. */ - int len; /* The length of the string in bytes, or -1 - * for strlen(string). */ -{ - Tcl_UniChar ch; - register Tcl_UniChar *chPtr = &ch; - register int n; - int i; - - /* - * The separate implementations are faster. - */ - - i = 0; - if (len < 0) { - while (1) { - str += Tcl_UtfToUniChar(str, chPtr); - if (ch == '\0') { - break; - } - i++; - } - } else { - while (len > 0) { - n = Tcl_UtfToUniChar(str, chPtr); - len -= n; - str += n; - i++; - } - } - return i; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfFindFirst -- - * - * Returns a pointer to the first occurance of the given Tcl_UniChar - * in the NULL-terminated UTF-8 string. The NULL terminator is - * considered part of the UTF-8 string. Equivalent to Plan 9 - * utfrune(). - * - * Results: - * As above. If the Tcl_UniChar does not exist in the given string, - * the return value is NULL. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ -char * -Tcl_UtfFindFirst(string, ch) - CONST char *string; /* The UTF-8 string to be searched. */ - int ch; /* The Tcl_UniChar to search for. */ -{ - int len; - Tcl_UniChar find; - - while (1) { - len = Tcl_UtfToUniChar(string, &find); - if (find == ch) { - return (char *) string; - } - if (*string == '\0') { - return NULL; - } - string += len; - } -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfFindLast -- - * - * Returns a pointer to the last occurance of the given Tcl_UniChar - * in the NULL-terminated UTF-8 string. The NULL terminator is - * considered part of the UTF-8 string. Equivalent to Plan 9 - * utfrrune(). - * - * Results: - * As above. If the Tcl_UniChar does not exist in the given string, - * the return value is NULL. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -char * -Tcl_UtfFindLast(string, ch) - CONST char *string; /* The UTF-8 string to be searched. */ - int ch; /* The Tcl_UniChar to search for. */ -{ - int len; - Tcl_UniChar find; - CONST char *last; - - last = NULL; - while (1) { - len = Tcl_UtfToUniChar(string, &find); - if (find == ch) { - last = string; - } - if (*string == '\0') { - break; - } - string += len; - } - return (char *) last; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfNext -- - * - * Given a pointer to some current location in a UTF-8 string, - * move forward one character. The caller must ensure that they - * are not asking for the next character after the last character - * in the string. - * - * Results: - * The return value is the pointer to the next character in - * the UTF-8 string. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -char * -Tcl_UtfNext(str) - CONST char *str; /* The current location in the string. */ -{ - Tcl_UniChar ch; - - return (char *) str + Tcl_UtfToUniChar(str, &ch); -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfPrev -- - * - * Given a pointer to some current location in a UTF-8 string, - * move backwards one character. - * - * Results: - * The return value is a pointer to the previous character in the - * UTF-8 string. If the current location was already at the - * beginning of the string, the return value will also be a - * pointer to the beginning of the string. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -char * -Tcl_UtfPrev(str, start) - CONST char *str; /* The current location in the string. */ - CONST char *start; /* Pointer to the beginning of the - * string, to avoid going backwards too - * far. */ -{ - CONST char *look; - int i, byte; - - str--; - look = str; - for (i = 0; i < TCL_UTF_MAX; i++) { - if (look < start) { - if (str < start) { - str = start; - } - break; - } - byte = *((unsigned char *) look); - if (byte < 0x80) { - break; - } - if (byte >= 0xC0) { - if (totalBytes[byte] != i + 1) { - break; - } - return (char *) look; - } - look--; - } - return (char *) str; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UniCharAtIndex -- - * - * Returns the Unicode character represented at the specified - * character (not byte) position in the UTF-8 string. - * - * Results: - * As above. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -Tcl_UniChar -Tcl_UniCharAtIndex(src, index) - register CONST char *src; /* The UTF-8 string to dereference. */ - register int index; /* The position of the desired character. */ -{ - Tcl_UniChar ch; - - while (index >= 0) { - index--; - src += Tcl_UtfToUniChar(src, &ch); - } - return ch; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfAtIndex -- - * - * Returns a pointer to the specified character (not byte) position - * in the UTF-8 string. - * - * Results: - * As above. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -char * -Tcl_UtfAtIndex(src, index) - register CONST char *src; /* The UTF-8 string. */ - register int index; /* The position of the desired character. */ -{ - Tcl_UniChar ch; - - while (index > 0) { - index--; - src += Tcl_UtfToUniChar(src, &ch); - } - return (char *) src; -} - -/* - *--------------------------------------------------------------------------- - * - * Tcl_UtfBackslash -- - * - * Figure out how to handle a backslash sequence. - * - * Results: - * Stores the bytes represented by the backslash sequence in dst and - * returns the number of bytes written to dst. At most TCL_UTF_MAX - * bytes are written to dst; dst must have been large enough to accept - * those bytes. If readPtr isn't NULL then it is filled in with a - * count of the number of bytes in the backslash sequence. - * - * Side effects: - * The maximum number of bytes it takes to represent a Unicode - * character in UTF-8 is guaranteed to be less than the number of - * bytes used to express the backslash sequence that represents - * that Unicode character. If the target buffer into which the - * caller is going to store the bytes that represent the Unicode - * character is at least as large as the source buffer from which - * the backslashed sequence was extracted, no buffer overruns should - * occur. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_UtfBackslash(src, readPtr, dst) - CONST char *src; /* Points to the backslash character of - * a backslash sequence. */ - int *readPtr; /* Fill in with number of characters read - * from src, unless NULL. */ - char *dst; /* Filled with the bytes represented by the - * backslash sequence. */ -{ - register CONST char *p = src+1; - int result, count, n; - char buf[TCL_UTF_MAX]; - - if (dst == NULL) { - dst = buf; - } - - count = 2; - switch (*p) { - /* - * Note: in the conversions below, use absolute values (e.g., - * 0xa) rather than symbolic values (e.g. \n) that get converted - * by the compiler. It's possible that compilers on some - * platforms will do the symbolic conversions differently, which - * could result in non-portable Tcl scripts. - */ - - case 'a': - result = 0x7; - break; - case 'b': - result = 0x8; - break; - case 'f': - result = 0xc; - break; - case 'n': - result = 0xa; - break; - case 'r': - result = 0xd; - break; - case 't': - result = 0x9; - break; - case 'v': - result = 0xb; - break; - case 'x': - if (isxdigit(UCHAR(p[1]))) { /* INTL: digit */ - char *end; - - result = (unsigned char) strtoul(p+1, &end, 16); - count = end - src; - } else { - count = 2; - result = 'x'; - } - break; - case 'u': - result = 0; - for (count = 0; count < 4; count++) { - p++; - if (!isxdigit(UCHAR(*p))) { /* INTL: digit */ - break; - } - n = *p - '0'; - if (n > 9) { - n = n + '0' + 10 - 'A'; - } - if (n > 16) { - n = n + 'A' - 'a'; - } - result = (result << 4) + n; - } - if (count == 0) { - result = 'u'; - } - count += 2; - break; - - case '\n': - do { - p++; - } while ((*p == ' ') || (*p == '\t')); - result = ' '; - count = p - src; - break; - case 0: - result = '\\'; - count = 1; - break; - default: - if (isdigit(UCHAR(*p))) { /* INTL: digit */ - result = (unsigned char)(*p - '0'); - p++; - if (!isdigit(UCHAR(*p))) { /* INTL: digit */ - break; - } - count = 3; - result = (unsigned char)((result << 3) + (*p - '0')); - p++; - if (!isdigit(UCHAR(*p))) { /* INTL: digit */ - break; - } - count = 4; - result = (unsigned char)((result << 3) + (*p - '0')); - break; - } - result = *p; - count = 2; - break; - } - - if (readPtr != NULL) { - *readPtr = count; - } - return Tcl_UniCharToUtf(result, dst); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UtfToUpper -- - * - * Convert lowercase characters to uppercase characters in a UTF - * string in place. The conversion may shrink the UTF string. - * - * Results: - * Returns the number of bytes in the resulting string - * excluding the trailing null. - * - * Side effects: - * Writes a terminating null after the last converted character. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UtfToUpper(str) - char *str; /* String to convert in place. */ -{ - Tcl_UniChar ch; - char *src, *dst; - - /* - * Iterate over the string until we hit the terminating null. - */ - - src = dst = str; - while (*src) { - src += Tcl_UtfToUniChar(src, &ch); - dst += Tcl_UniCharToUtf(Tcl_UniCharToUpper(ch), dst); - } - *dst = '\0'; - return (dst - str); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UtfToLower -- - * - * Convert uppercase characters to lowercase characters in a UTF - * string in place. The conversion may shrink the UTF string. - * - * Results: - * Returns the number of bytes in the resulting string - * excluding the trailing null. - * - * Side effects: - * Writes a terminating null after the last converted character. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UtfToLower(str) - char *str; /* String to convert in place. */ -{ - Tcl_UniChar ch; - char *src, *dst; - - /* - * Iterate over the string until we hit the terminating null. - */ - - src = dst = str; - while (*src) { - src += Tcl_UtfToUniChar(src, &ch); - dst += Tcl_UniCharToUtf(Tcl_UniCharToLower(ch), dst); - } - *dst = '\0'; - return (dst - str); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UtfToTitle -- - * - * Changes the first character of a UTF string to title case or - * uppercase and the rest of the string to lowercase. The - * conversion happens in place and may shrink the UTF string. - * - * Results: - * Returns the number of bytes in the resulting string - * excluding the trailing null. - * - * Side effects: - * Writes a terminating null after the last converted character. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UtfToTitle(str) - char *str; /* String to convert in place. */ -{ - Tcl_UniChar ch; - char *src, *dst; - - /* - * Capitalize the first character and then lowercase the rest of the - * characters until we get to a null. - */ - - src = dst = str; - - if (*src) { - src += Tcl_UtfToUniChar(src, &ch); - dst += Tcl_UniCharToUtf(Tcl_UniCharToTitle(ch), dst); - } - while (*src) { - src += Tcl_UtfToUniChar(src, &ch); - dst += Tcl_UniCharToUtf(Tcl_UniCharToLower(ch), dst); - } - *dst = '\0'; - return (dst - str); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharToUpper -- - * - * Compute the uppercase equivalent of the given Unicode character. - * - * Results: - * Returns the uppercase Unicode character. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_UniChar -Tcl_UniCharToUpper(ch) - int ch; /* Unicode character to convert. */ -{ - int info = GetUniCharInfo(ch); - - if (GetCaseType(info) & 0x04) { - return (Tcl_UniChar) (ch - GetDelta(info)); - } else { - return ch; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharToLower -- - * - * Compute the lowercase equivalent of the given Unicode character. - * - * Results: - * Returns the lowercase Unicode character. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_UniChar -Tcl_UniCharToLower(ch) - int ch; /* Unicode character to convert. */ -{ - int info = GetUniCharInfo(ch); - - if (GetCaseType(info) & 0x02) { - return (Tcl_UniChar) (ch + GetDelta(info)); - } else { - return ch; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharToTitle -- - * - * Compute the titlecase equivalent of the given Unicode character. - * - * Results: - * Returns the titlecase Unicode character. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_UniChar -Tcl_UniCharToTitle(ch) - int ch; /* Unicode character to convert. */ -{ - int info = GetUniCharInfo(ch); - int mode = GetCaseType(info); - - if (mode & 0x1) { - /* - * Subtract or add one depending on the original case. - */ - - return (Tcl_UniChar) (ch + ((mode & 0x4) ? -1 : 1)); - } else if (mode == 0x4) { - return (Tcl_UniChar) (ch - GetDelta(info)); - } else { - return ch; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharLen -- - * - * Find the length of a UniChar string. The str input must be null - * terminated. - * - * Results: - * Returns the length of str in UniChars (not bytes). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharLen(str) - Tcl_UniChar *str; /* Unicode string to find length of. */ -{ - int len = 0; - - while (*str != '\0') { - len++; - str++; - } - return len; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharNcmp -- - * - * Compare at most n unichars of string cs to string ct. Both cs - * and ct are assumed to be at least n unichars long. - * - * Results: - * Return <0 if cs < ct, 0 if cs == ct, or >0 if cs > ct. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharNcmp(cs, ct, n) - CONST Tcl_UniChar *cs; /* Unicode string to compare to ct. */ - CONST Tcl_UniChar *ct; /* Unicode string cs is compared to. */ - size_t n; /* Number of unichars to compare. */ -{ - for ( ; n != 0; n--, cs++, ct++) { - if (*cs != *ct) { - return *cs - *ct; - } - if (*cs == '\0') { - break; - } - } - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharIsAlnum -- - * - * Test if a character is an alphanumeric Unicode character. - * - * Results: - * Returns 1 if character is alphanumeric. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharIsAlnum(ch) - int ch; /* Unicode character to test. */ -{ - register int category = (GetUniCharInfo(ch) & UNICODE_CATEGORY_MASK); - - return (((ALPHA_BITS | DIGIT_BITS) >> category) & 1); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharIsAlpha -- - * - * Test if a character is an alphabetic Unicode character. - * - * Results: - * Returns 1 if character is alphabetic. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharIsAlpha(ch) - int ch; /* Unicode character to test. */ -{ - register int category = (GetUniCharInfo(ch) & UNICODE_CATEGORY_MASK); - return ((ALPHA_BITS >> category) & 1); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharIsDigit -- - * - * Test if a character is a numeric Unicode character. - * - * Results: - * Returns non-zero if character is a digit. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharIsDigit(ch) - int ch; /* Unicode character to test. */ -{ - return ((GetUniCharInfo(ch) & UNICODE_CATEGORY_MASK) - == DECIMAL_DIGIT_NUMBER); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharIsLower -- - * - * Test if a character is a lowercase Unicode character. - * - * Results: - * Returns non-zero if character is lowercase. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharIsLower(ch) - int ch; /* Unicode character to test. */ -{ - return ((GetUniCharInfo(ch) & UNICODE_CATEGORY_MASK) == LOWERCASE_LETTER); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharIsSpace -- - * - * Test if a character is a whitespace Unicode character. - * - * Results: - * Returns non-zero if character is a space. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharIsSpace(ch) - int ch; /* Unicode character to test. */ -{ - register int category; - - /* - * If the character is within the first 127 characters, just use the - * standard C function, otherwise consult the Unicode table. - */ - - if (ch < 0x80) { - return isspace(UCHAR(ch)); /* INTL: ISO space */ - } else { - category = (GetUniCharInfo(ch) & UNICODE_CATEGORY_MASK); - return ((SPACE_BITS >> category) & 1); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharIsUpper -- - * - * Test if a character is a uppercase Unicode character. - * - * Results: - * Returns non-zero if character is uppercase. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharIsUpper(ch) - int ch; /* Unicode character to test. */ -{ - return ((GetUniCharInfo(ch) & UNICODE_CATEGORY_MASK) == UPPERCASE_LETTER); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UniCharIsWordChar -- - * - * Test if a character is alphanumeric or a connector punctuation - * mark. - * - * Results: - * Returns 1 if character is a word character. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UniCharIsWordChar(ch) - int ch; /* Unicode character to test. */ -{ - register int category = (GetUniCharInfo(ch) & UNICODE_CATEGORY_MASK); - - return (((ALPHA_BITS | DIGIT_BITS | CONNECTOR_BITS) >> category) & 1); -} diff --git a/generic/tclUtil.c b/generic/tclUtil.c deleted file mode 100644 index 54811df..0000000 --- a/generic/tclUtil.c +++ /dev/null @@ -1,2160 +0,0 @@ -/* - * tclUtil.c -- - * - * This file contains utility procedures that are used by many Tcl - * commands. - * - * Copyright (c) 1987-1993 The Regents of the University of California. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclUtil.c,v 1.5 1999/04/16 00:46:55 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * The following variable holds the full path name of the binary - * from which this application was executed, or NULL if it isn't - * know. The value of the variable is set by the procedure - * Tcl_FindExecutable. The storage space is dynamically allocated. - */ - -char *tclExecutableName = NULL; -char *tclNativeExecutableName = NULL; - -/* - * The following values are used in the flags returned by Tcl_ScanElement - * and used by Tcl_ConvertElement. The value TCL_DONT_USE_BRACES is also - * defined in tcl.h; make sure its value doesn't overlap with any of the - * values below. - * - * TCL_DONT_USE_BRACES - 1 means the string mustn't be enclosed in - * braces (e.g. it contains unmatched braces, - * or ends in a backslash character, or user - * just doesn't want braces); handle all - * special characters by adding backslashes. - * USE_BRACES - 1 means the string contains a special - * character that can be handled simply by - * enclosing the entire argument in braces. - * BRACES_UNMATCHED - 1 means that braces aren't properly matched - * in the argument. - */ - -#define USE_BRACES 2 -#define BRACES_UNMATCHED 4 - -/* - * The following values determine the precision used when converting - * floating-point values to strings. This information is linked to all - * of the tcl_precision variables in all interpreters via the procedure - * TclPrecTraceProc. - */ - -static char precisionString[10] = "12"; - /* The string value of all the tcl_precision - * variables. */ -static char precisionFormat[10] = "%.12g"; - /* The format string actually used in calls - * to sprintf. */ -TCL_DECLARE_MUTEX(precisionMutex) - - -/* - *---------------------------------------------------------------------- - * - * TclFindElement -- - * - * Given a pointer into a Tcl list, locate the first (or next) - * element in the list. - * - * Results: - * The return value is normally TCL_OK, which means that the - * element was successfully located. If TCL_ERROR is returned - * it means that list didn't have proper list structure; - * the interp's result contains a more detailed error message. - * - * If TCL_OK is returned, then *elementPtr will be set to point to the - * first element of list, and *nextPtr will be set to point to the - * character just after any white space following the last character - * that's part of the element. If this is the last argument in the - * list, then *nextPtr will point just after the last character in the - * list (i.e., at the character at list+listLength). If sizePtr is - * non-NULL, *sizePtr is filled in with the number of characters in the - * element. If the element is in braces, then *elementPtr will point - * to the character after the opening brace and *sizePtr will not - * include either of the braces. If there isn't an element in the list, - * *sizePtr will be zero, and both *elementPtr and *termPtr will point - * just after the last character in the list. Note: this procedure does - * NOT collapse backslash sequences. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclFindElement(interp, list, listLength, elementPtr, nextPtr, sizePtr, - bracePtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting. - * If NULL, then no error message is left - * after errors. */ - CONST char *list; /* Points to the first byte of a string - * containing a Tcl list with zero or more - * elements (possibly in braces). */ - int listLength; /* Number of bytes in the list's string. */ - CONST char **elementPtr; /* Where to put address of first significant - * character in first element of list. */ - CONST char **nextPtr; /* Fill in with location of character just - * after all white space following end of - * argument (next arg or end of list). */ - int *sizePtr; /* If non-zero, fill in with size of - * element. */ - int *bracePtr; /* If non-zero, fill in with non-zero/zero - * to indicate that arg was/wasn't - * in braces. */ -{ - CONST char *p = list; - CONST char *elemStart; /* Points to first byte of first element. */ - CONST char *limit; /* Points just after list's last byte. */ - int openBraces = 0; /* Brace nesting level during parse. */ - int inQuotes = 0; - int size = 0; /* lint. */ - int numChars; - CONST char *p2; - - /* - * Skim off leading white space and check for an opening brace or - * quote. We treat embedded NULLs in the list as bytes belonging to - * a list element. - */ - - limit = (list + listLength); - while ((p < limit) && (isspace(UCHAR(*p)))) { /* INTL: ISO space. */ - p++; - } - if (p == limit) { /* no element found */ - elemStart = limit; - goto done; - } - - if (*p == '{') { - openBraces = 1; - p++; - } else if (*p == '"') { - inQuotes = 1; - p++; - } - elemStart = p; - if (bracePtr != 0) { - *bracePtr = openBraces; - } - - /* - * Find element's end (a space, close brace, or the end of the string). - */ - - while (p < limit) { - switch (*p) { - - /* - * Open brace: don't treat specially unless the element is in - * braces. In this case, keep a nesting count. - */ - - case '{': - if (openBraces != 0) { - openBraces++; - } - break; - - /* - * Close brace: if element is in braces, keep nesting count and - * quit when the last close brace is seen. - */ - - case '}': - if (openBraces > 1) { - openBraces--; - } else if (openBraces == 1) { - size = (p - elemStart); - p++; - if ((p >= limit) - || isspace(UCHAR(*p))) { /* INTL: ISO space. */ - goto done; - } - - /* - * Garbage after the closing brace; return an error. - */ - - if (interp != NULL) { - char buf[100]; - - p2 = p; - while ((p2 < limit) - && (!isspace(UCHAR(*p2))) /* INTL: ISO space. */ - && (p2 < p+20)) { - p2++; - } - sprintf(buf, - "list element in braces followed by \"%.*s\" instead of space", - (int) (p2-p), p); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } - return TCL_ERROR; - } - break; - - /* - * Backslash: skip over everything up to the end of the - * backslash sequence. - */ - - case '\\': { - Tcl_UtfBackslash(p, &numChars, NULL); - p += (numChars - 1); - break; - } - - /* - * Space: ignore if element is in braces or quotes; otherwise - * terminate element. - */ - - case ' ': - case '\f': - case '\n': - case '\r': - case '\t': - case '\v': - if ((openBraces == 0) && !inQuotes) { - size = (p - elemStart); - goto done; - } - break; - - /* - * Double-quote: if element is in quotes then terminate it. - */ - - case '"': - if (inQuotes) { - size = (p - elemStart); - p++; - if ((p >= limit) - || isspace(UCHAR(*p))) { /* INTL: ISO space */ - goto done; - } - - /* - * Garbage after the closing quote; return an error. - */ - - if (interp != NULL) { - char buf[100]; - - p2 = p; - while ((p2 < limit) - && (!isspace(UCHAR(*p2))) /* INTL: ISO space */ - && (p2 < p+20)) { - p2++; - } - sprintf(buf, - "list element in quotes followed by \"%.*s\" %s", - (int) (p2-p), p, "instead of space"); - Tcl_SetResult(interp, buf, TCL_VOLATILE); - } - return TCL_ERROR; - } - break; - } - p++; - } - - - /* - * End of list: terminate element. - */ - - if (p == limit) { - if (openBraces != 0) { - if (interp != NULL) { - Tcl_SetResult(interp, "unmatched open brace in list", - TCL_STATIC); - } - return TCL_ERROR; - } else if (inQuotes) { - if (interp != NULL) { - Tcl_SetResult(interp, "unmatched open quote in list", - TCL_STATIC); - } - return TCL_ERROR; - } - size = (p - elemStart); - } - - done: - while ((p < limit) && (isspace(UCHAR(*p)))) { /* INTL: ISO space. */ - p++; - } - *elementPtr = elemStart; - *nextPtr = p; - if (sizePtr != 0) { - *sizePtr = size; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclCopyAndCollapse -- - * - * Copy a string and eliminate any backslashes that aren't in braces. - * - * Results: - * There is no return value. Count characters get copied from src to - * dst. Along the way, if backslash sequences are found outside braces, - * the backslashes are eliminated in the copy. After scanning count - * chars from source, a null character is placed at the end of dst. - * Returns the number of characters that got copied. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclCopyAndCollapse(count, src, dst) - int count; /* Number of characters to copy from src. */ - CONST char *src; /* Copy from here... */ - char *dst; /* ... to here. */ -{ - register char c; - int numRead; - int newCount = 0; - int backslashCount; - - for (c = *src; count > 0; src++, c = *src, count--) { - if (c == '\\') { - backslashCount = Tcl_UtfBackslash(src, &numRead, dst); - dst += backslashCount; - newCount += backslashCount; - src += numRead-1; - count -= numRead-1; - } else { - *dst = c; - dst++; - newCount++; - } - } - *dst = 0; - return newCount; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SplitList -- - * - * Splits a list up into its constituent fields. - * - * Results - * The return value is normally TCL_OK, which means that - * the list was successfully split up. If TCL_ERROR is - * returned, it means that "list" didn't have proper list - * structure; the interp's result will contain a more detailed - * error message. - * - * *argvPtr will be filled in with the address of an array - * whose elements point to the elements of list, in order. - * *argcPtr will get filled in with the number of valid elements - * in the array. A single block of memory is dynamically allocated - * to hold both the argv array and a copy of the list (with - * backslashes and braces removed in the standard way). - * The caller must eventually free this memory by calling free() - * on *argvPtr. Note: *argvPtr and *argcPtr are only modified - * if the procedure returns normally. - * - * Side effects: - * Memory is allocated. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_SplitList(interp, list, argcPtr, argvPtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting. - * If NULL, no error message is left. */ - CONST char *list; /* Pointer to string with list structure. */ - int *argcPtr; /* Pointer to location to fill in with - * the number of elements in the list. */ - char ***argvPtr; /* Pointer to place to store pointer to - * array of pointers to list elements. */ -{ - char **argv; - CONST char *l; - char *p; - int length, size, i, result, elSize, brace; - CONST char *element; - - /* - * Figure out how much space to allocate. There must be enough - * space for both the array of pointers and also for a copy of - * the list. To estimate the number of pointers needed, count - * the number of space characters in the list. - */ - - for (size = 1, l = list; *l != 0; l++) { - if (isspace(UCHAR(*l))) { /* INTL: ISO space. */ - size++; - } - } - size++; /* Leave space for final NULL pointer. */ - argv = (char **) ckalloc((unsigned) - ((size * sizeof(char *)) + (l - list) + 1)); - length = strlen(list); - for (i = 0, p = ((char *) argv) + size*sizeof(char *); - *list != 0; i++) { - CONST char *prevList = list; - - result = TclFindElement(interp, list, length, &element, - &list, &elSize, &brace); - length -= (list - prevList); - if (result != TCL_OK) { - ckfree((char *) argv); - return result; - } - if (*element == 0) { - break; - } - if (i >= size) { - ckfree((char *) argv); - if (interp != NULL) { - Tcl_SetResult(interp, "internal error in Tcl_SplitList", - TCL_STATIC); - } - return TCL_ERROR; - } - argv[i] = p; - if (brace) { - memcpy((VOID *) p, (VOID *) element, (size_t) elSize); - p += elSize; - *p = 0; - p++; - } else { - TclCopyAndCollapse(elSize, element, p); - p += elSize+1; - } - } - - argv[i] = NULL; - *argvPtr = argv; - *argcPtr = i; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ScanElement -- - * - * This procedure is a companion procedure to Tcl_ConvertElement. - * It scans a string to see what needs to be done to it (e.g. add - * backslashes or enclosing braces) to make the string into a - * valid Tcl list element. - * - * Results: - * The return value is an overestimate of the number of characters - * that will be needed by Tcl_ConvertElement to produce a valid - * list element from string. The word at *flagPtr is filled in - * with a value needed by Tcl_ConvertElement when doing the actual - * conversion. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ScanElement(string, flagPtr) - register CONST char *string; /* String to convert to list element. */ - register int *flagPtr; /* Where to store information to guide - * Tcl_ConvertCountedElement. */ -{ - return Tcl_ScanCountedElement(string, -1, flagPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ScanCountedElement -- - * - * This procedure is a companion procedure to - * Tcl_ConvertCountedElement. It scans a string to see what - * needs to be done to it (e.g. add backslashes or enclosing - * braces) to make the string into a valid Tcl list element. - * If length is -1, then the string is scanned up to the first - * null byte. - * - * Results: - * The return value is an overestimate of the number of characters - * that will be needed by Tcl_ConvertCountedElement to produce a - * valid list element from string. The word at *flagPtr is - * filled in with a value needed by Tcl_ConvertCountedElement - * when doing the actual conversion. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ScanCountedElement(string, length, flagPtr) - CONST char *string; /* String to convert to Tcl list element. */ - int length; /* Number of bytes in string, or -1. */ - int *flagPtr; /* Where to store information to guide - * Tcl_ConvertElement. */ -{ - int flags, nestingLevel; - register CONST char *p, *lastChar; - - /* - * This procedure and Tcl_ConvertElement together do two things: - * - * 1. They produce a proper list, one that will yield back the - * argument strings when evaluated or when disassembled with - * Tcl_SplitList. This is the most important thing. - * - * 2. They try to produce legible output, which means minimizing the - * use of backslashes (using braces instead). However, there are - * some situations where backslashes must be used (e.g. an element - * like "{abc": the leading brace will have to be backslashed. - * For each element, one of three things must be done: - * - * (a) Use the element as-is (it doesn't contain any special - * characters). This is the most desirable option. - * - * (b) Enclose the element in braces, but leave the contents alone. - * This happens if the element contains embedded space, or if it - * contains characters with special interpretation ($, [, ;, or \), - * or if it starts with a brace or double-quote, or if there are - * no characters in the element. - * - * (c) Don't enclose the element in braces, but add backslashes to - * prevent special interpretation of special characters. This is a - * last resort used when the argument would normally fall under case - * (b) but contains unmatched braces. It also occurs if the last - * character of the argument is a backslash or if the element contains - * a backslash followed by newline. - * - * The procedure figures out how many bytes will be needed to store - * the result (actually, it overestimates). It also collects information - * about the element in the form of a flags word. - * - * Note: list elements produced by this procedure and - * Tcl_ConvertCountedElement must have the property that they can be - * enclosing in curly braces to make sub-lists. This means, for - * example, that we must not leave unmatched curly braces in the - * resulting list element. This property is necessary in order for - * procedures like Tcl_DStringStartSublist to work. - */ - - nestingLevel = 0; - flags = 0; - if (string == NULL) { - string = ""; - } - if (length == -1) { - length = strlen(string); - } - lastChar = string + length; - p = string; - if ((p == lastChar) || (*p == '{') || (*p == '"')) { - flags |= USE_BRACES; - } - for ( ; p != lastChar; p++) { - switch (*p) { - case '{': - nestingLevel++; - break; - case '}': - nestingLevel--; - if (nestingLevel < 0) { - flags |= TCL_DONT_USE_BRACES|BRACES_UNMATCHED; - } - break; - case '[': - case '$': - case ';': - case ' ': - case '\f': - case '\n': - case '\r': - case '\t': - case '\v': - flags |= USE_BRACES; - break; - case '\\': - if ((p+1 == lastChar) || (p[1] == '\n')) { - flags = TCL_DONT_USE_BRACES | BRACES_UNMATCHED; - } else { - int size; - - Tcl_UtfBackslash(p, &size, NULL); - p += size-1; - flags |= USE_BRACES; - } - break; - } - } - if (nestingLevel != 0) { - flags = TCL_DONT_USE_BRACES | BRACES_UNMATCHED; - } - *flagPtr = flags; - - /* - * Allow enough space to backslash every character plus leave - * two spaces for braces. - */ - - return 2*(p-string) + 2; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ConvertElement -- - * - * This is a companion procedure to Tcl_ScanElement. Given - * the information produced by Tcl_ScanElement, this procedure - * converts a string to a list element equal to that string. - * - * Results: - * Information is copied to *dst in the form of a list element - * identical to src (i.e. if Tcl_SplitList is applied to dst it - * will produce a string identical to src). The return value is - * a count of the number of characters copied (not including the - * terminating NULL character). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ConvertElement(src, dst, flags) - register CONST char *src; /* Source information for list element. */ - register char *dst; /* Place to put list-ified element. */ - register int flags; /* Flags produced by Tcl_ScanElement. */ -{ - return Tcl_ConvertCountedElement(src, -1, dst, flags); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ConvertCountedElement -- - * - * This is a companion procedure to Tcl_ScanCountedElement. Given - * the information produced by Tcl_ScanCountedElement, this - * procedure converts a string to a list element equal to that - * string. - * - * Results: - * Information is copied to *dst in the form of a list element - * identical to src (i.e. if Tcl_SplitList is applied to dst it - * will produce a string identical to src). The return value is - * a count of the number of characters copied (not including the - * terminating NULL character). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_ConvertCountedElement(src, length, dst, flags) - register CONST char *src; /* Source information for list element. */ - int length; /* Number of bytes in src, or -1. */ - char *dst; /* Place to put list-ified element. */ - int flags; /* Flags produced by Tcl_ScanElement. */ -{ - register char *p = dst; - register CONST char *lastChar; - - /* - * See the comment block at the beginning of the Tcl_ScanElement - * code for details of how this works. - */ - - if (src && length == -1) { - length = strlen(src); - } - if ((src == NULL) || (length == 0)) { - p[0] = '{'; - p[1] = '}'; - p[2] = 0; - return 2; - } - lastChar = src + length; - if ((flags & USE_BRACES) && !(flags & TCL_DONT_USE_BRACES)) { - *p = '{'; - p++; - for ( ; src != lastChar; src++, p++) { - *p = *src; - } - *p = '}'; - p++; - } else { - if (*src == '{') { - /* - * Can't have a leading brace unless the whole element is - * enclosed in braces. Add a backslash before the brace. - * Furthermore, this may destroy the balance between open - * and close braces, so set BRACES_UNMATCHED. - */ - - p[0] = '\\'; - p[1] = '{'; - p += 2; - src++; - flags |= BRACES_UNMATCHED; - } - for (; src != lastChar; src++) { - switch (*src) { - case ']': - case '[': - case '$': - case ';': - case ' ': - case '\\': - case '"': - *p = '\\'; - p++; - break; - case '{': - case '}': - /* - * It may not seem necessary to backslash braces, but - * it is. The reason for this is that the resulting - * list element may actually be an element of a sub-list - * enclosed in braces (e.g. if Tcl_DStringStartSublist - * has been invoked), so there may be a brace mismatch - * if the braces aren't backslashed. - */ - - if (flags & BRACES_UNMATCHED) { - *p = '\\'; - p++; - } - break; - case '\f': - *p = '\\'; - p++; - *p = 'f'; - p++; - continue; - case '\n': - *p = '\\'; - p++; - *p = 'n'; - p++; - continue; - case '\r': - *p = '\\'; - p++; - *p = 'r'; - p++; - continue; - case '\t': - *p = '\\'; - p++; - *p = 't'; - p++; - continue; - case '\v': - *p = '\\'; - p++; - *p = 'v'; - p++; - continue; - } - *p = *src; - p++; - } - } - *p = '\0'; - return p-dst; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Merge -- - * - * Given a collection of strings, merge them together into a - * single string that has proper Tcl list structured (i.e. - * Tcl_SplitList may be used to retrieve strings equal to the - * original elements, and Tcl_Eval will parse the string back - * into its original elements). - * - * Results: - * The return value is the address of a dynamically-allocated - * string containing the merged list. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_Merge(argc, argv) - int argc; /* How many strings to merge. */ - char **argv; /* Array of string values. */ -{ -# define LOCAL_SIZE 20 - int localFlags[LOCAL_SIZE], *flagPtr; - int numChars; - char *result; - char *dst; - int i; - - /* - * Pass 1: estimate space, gather flags. - */ - - if (argc <= LOCAL_SIZE) { - flagPtr = localFlags; - } else { - flagPtr = (int *) ckalloc((unsigned) argc*sizeof(int)); - } - numChars = 1; - for (i = 0; i < argc; i++) { - numChars += Tcl_ScanElement(argv[i], &flagPtr[i]) + 1; - } - - /* - * Pass two: copy into the result area. - */ - - result = (char *) ckalloc((unsigned) numChars); - dst = result; - for (i = 0; i < argc; i++) { - numChars = Tcl_ConvertElement(argv[i], dst, flagPtr[i]); - dst += numChars; - *dst = ' '; - dst++; - } - if (dst == result) { - *dst = 0; - } else { - dst[-1] = 0; - } - - if (flagPtr != localFlags) { - ckfree((char *) flagPtr); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Backslash -- - * - * Figure out how to handle a backslash sequence. - * - * Results: - * The return value is the character that should be substituted - * in place of the backslash sequence that starts at src. If - * readPtr isn't NULL then it is filled in with a count of the - * number of characters in the backslash sequence. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char -Tcl_Backslash(src, readPtr) - CONST char *src; /* Points to the backslash character of - * a backslash sequence. */ - int *readPtr; /* Fill in with number of characters read - * from src, unless NULL. */ -{ - char buf[TCL_UTF_MAX]; - Tcl_UniChar ch; - - Tcl_UtfBackslash(src, readPtr, buf); - Tcl_UtfToUniChar(buf, &ch); - return (char) ch; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Concat -- - * - * Concatenate a set of strings into a single large string. - * - * Results: - * The return value is dynamically-allocated string containing - * a concatenation of all the strings in argv, with spaces between - * the original argv elements. - * - * Side effects: - * Memory is allocated for the result; the caller is responsible - * for freeing the memory. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_Concat(argc, argv) - int argc; /* Number of strings to concatenate. */ - char **argv; /* Array of strings to concatenate. */ -{ - int totalSize, i; - char *p; - char *result; - - for (totalSize = 1, i = 0; i < argc; i++) { - totalSize += strlen(argv[i]) + 1; - } - result = (char *) ckalloc((unsigned) totalSize); - if (argc == 0) { - *result = '\0'; - return result; - } - for (p = result, i = 0; i < argc; i++) { - char *element; - int length; - - /* - * Clip white space off the front and back of the string - * to generate a neater result, and ignore any empty - * elements. - */ - - element = argv[i]; - while (isspace(UCHAR(*element))) { /* INTL: ISO space. */ - element++; - } - for (length = strlen(element); - (length > 0) - && (isspace(UCHAR(element[length-1]))) /* INTL: ISO space. */ - && ((length < 2) || (element[length-2] != '\\')); - length--) { - /* Null loop body. */ - } - if (length == 0) { - continue; - } - memcpy((VOID *) p, (VOID *) element, (size_t) length); - p += length; - *p = ' '; - p++; - } - if (p != result) { - p[-1] = 0; - } else { - *p = 0; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ConcatObj -- - * - * Concatenate the strings from a set of objects into a single string - * object with spaces between the original strings. - * - * Results: - * The return value is a new string object containing a concatenation - * of the strings in objv. Its ref count is zero. - * - * Side effects: - * A new object is created. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_ConcatObj(objc, objv) - int objc; /* Number of objects to concatenate. */ - Tcl_Obj *CONST objv[]; /* Array of objects to concatenate. */ -{ - int allocSize, finalSize, length, elemLength, i; - char *p; - char *element; - char *concatStr; - Tcl_Obj *objPtr; - - allocSize = 0; - for (i = 0; i < objc; i++) { - objPtr = objv[i]; - element = Tcl_GetStringFromObj(objPtr, &length); - if ((element != NULL) && (length > 0)) { - allocSize += (length + 1); - } - } - if (allocSize == 0) { - allocSize = 1; /* enough for the NULL byte at end */ - } - - /* - * Allocate storage for the concatenated result. Note that allocSize - * is one more than the total number of characters, and so includes - * room for the terminating NULL byte. - */ - - concatStr = (char *) ckalloc((unsigned) allocSize); - - /* - * Now concatenate the elements. Clip white space off the front and back - * to generate a neater result, and ignore any empty elements. Also put - * a null byte at the end. - */ - - finalSize = 0; - if (objc == 0) { - *concatStr = '\0'; - } else { - p = concatStr; - for (i = 0; i < objc; i++) { - objPtr = objv[i]; - element = Tcl_GetStringFromObj(objPtr, &elemLength); - while ((elemLength > 0) - && (isspace(UCHAR(*element)))) { /* INTL: ISO space. */ - element++; - elemLength--; - } - - /* - * Trim trailing white space. But, be careful not to trim - * a space character if it is preceded by a backslash: in - * this case it could be significant. - */ - - while ((elemLength > 0) - && isspace(UCHAR(element[elemLength-1])) /* INTL: ISO space. */ - && ((elemLength < 2) || (element[elemLength-2] != '\\'))) { - elemLength--; - } - if (elemLength == 0) { - continue; /* nothing left of this element */ - } - memcpy((VOID *) p, (VOID *) element, (size_t) elemLength); - p += elemLength; - *p = ' '; - p++; - finalSize += (elemLength + 1); - } - if (p != concatStr) { - p[-1] = 0; - finalSize -= 1; /* we overwrote the final ' ' */ - } else { - *p = 0; - } - } - - TclNewObj(objPtr); - objPtr->bytes = concatStr; - objPtr->length = finalSize; - return objPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_StringMatch -- - * - * See if a particular string matches a particular pattern. - * - * Results: - * The return value is 1 if string matches pattern, and - * 0 otherwise. The matching operation permits the following - * special characters in the pattern: *?\[] (see the manual - * entry for details on what these mean). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_StringMatch(string, pattern) - CONST char *string; /* String. */ - CONST char *pattern; /* Pattern, which may contain special - * characters. */ -{ - int p, s; - CONST char *pstart = pattern; - - while (1) { - p = *pattern; - s = *string; - - /* - * See if we're at the end of both the pattern and the string. If - * so, we succeeded. If we're at the end of the pattern but not at - * the end of the string, we failed. - */ - - if (p == '\0') { - if (s == '\0') { - return 1; - } else { - return 0; - } - } - if ((s == '\0') && (p != '*')) { - return 0; - } - - /* Check for a "*" as the next pattern character. It matches - * any substring. We handle this by calling ourselves - * recursively for each postfix of string, until either we - * match or we reach the end of the string. - */ - - if (p == '*') { - pattern++; - if (*pattern == '\0') { - return 1; - } - while (1) { - if (Tcl_StringMatch(string, pattern)) { - return 1; - } - if (*string == '\0') { - return 0; - } - string++; - } - } - - /* Check for a "?" as the next pattern character. It matches - * any single character. - */ - - if (p == '?') { - Tcl_UniChar ch; - - pattern++; - string += Tcl_UtfToUniChar(string, &ch); - continue; - } - - /* Check for a "[" as the next pattern character. It is followed - * by a list of characters that are acceptable, or by a range - * (two characters separated by "-"). - */ - - if (p == '[') { - Tcl_UniChar ch, startChar, endChar; - - pattern++; - string += Tcl_UtfToUniChar(string, &ch); - - while (1) { - if ((*pattern == ']') || (*pattern == '\0')) { - return 0; - } - pattern += Tcl_UtfToUniChar(pattern, &startChar); - if (*pattern == '-') { - pattern++; - if (*pattern == '\0') { - return 0; - } - pattern += Tcl_UtfToUniChar(pattern, &endChar); - if (((startChar <= ch) && (ch <= endChar)) - || ((endChar <= ch) && (ch <= startChar))) { - /* - * Matches ranges of form [a-z] or [z-a]. - */ - - break; - } - } else if (startChar == ch) { - break; - } - } - while (*pattern != ']') { - if (*pattern == '\0') { - pattern = Tcl_UtfPrev(pattern, pstart); - break; - } - pattern++; - } - pattern++; - continue; - } - - /* If the next pattern character is '\', just strip off the '\' - * so we do exact matching on the character that follows. - */ - - if (p == '\\') { - pattern++; - p = *pattern; - if (p == '\0') { - return 0; - } - } - - /* There's no special character. Just make sure that the next - * bytes of each string match. - */ - - if (s != p) { - return 0; - } - pattern++; - string++; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringInit -- - * - * Initializes a dynamic string, discarding any previous contents - * of the string (Tcl_DStringFree should have been called already - * if the dynamic string was previously in use). - * - * Results: - * None. - * - * Side effects: - * The dynamic string is initialized to be empty. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DStringInit(dsPtr) - Tcl_DString *dsPtr; /* Pointer to structure for dynamic string. */ -{ - dsPtr->string = dsPtr->staticSpace; - dsPtr->length = 0; - dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE; - dsPtr->staticSpace[0] = '\0'; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringAppend -- - * - * Append more characters to the current value of a dynamic string. - * - * Results: - * The return value is a pointer to the dynamic string's new value. - * - * Side effects: - * Length bytes from string (or all of string if length is less - * than zero) are added to the current value of the string. Memory - * gets reallocated if needed to accomodate the string's new size. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_DStringAppend(dsPtr, string, length) - Tcl_DString *dsPtr; /* Structure describing dynamic string. */ - CONST char *string; /* String to append. If length is -1 then - * this must be null-terminated. */ - int length; /* Number of characters from string to - * append. If < 0, then append all of string, - * up to null at end. */ -{ - int newSize; - char *dst; - CONST char *end; - - if (length < 0) { - length = strlen(string); - } - newSize = length + dsPtr->length; - - /* - * Allocate a larger buffer for the string if the current one isn't - * large enough. Allocate extra space in the new buffer so that there - * will be room to grow before we have to allocate again. - */ - - if (newSize >= dsPtr->spaceAvl) { - dsPtr->spaceAvl = newSize * 2; - if (dsPtr->string == dsPtr->staticSpace) { - char *newString; - - newString = (char *) ckalloc((unsigned) dsPtr->spaceAvl); - memcpy((VOID *) newString, (VOID *) dsPtr->string, - (size_t) dsPtr->length); - dsPtr->string = newString; - } else { - dsPtr->string = (char *) ckrealloc((VOID *) dsPtr->string, - (size_t) dsPtr->spaceAvl); - } - } - - /* - * Copy the new string into the buffer at the end of the old - * one. - */ - - for (dst = dsPtr->string + dsPtr->length, end = string+length; - string < end; string++, dst++) { - *dst = *string; - } - *dst = '\0'; - dsPtr->length += length; - return dsPtr->string; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringAppendElement -- - * - * Append a list element to the current value of a dynamic string. - * - * Results: - * The return value is a pointer to the dynamic string's new value. - * - * Side effects: - * String is reformatted as a list element and added to the current - * value of the string. Memory gets reallocated if needed to - * accomodate the string's new size. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_DStringAppendElement(dsPtr, string) - Tcl_DString *dsPtr; /* Structure describing dynamic string. */ - CONST char *string; /* String to append. Must be - * null-terminated. */ -{ - int newSize, flags; - char *dst; - - newSize = Tcl_ScanElement(string, &flags) + dsPtr->length + 1; - - /* - * Allocate a larger buffer for the string if the current one isn't - * large enough. Allocate extra space in the new buffer so that there - * will be room to grow before we have to allocate again. - * SPECIAL NOTE: must use memcpy, not strcpy, to copy the string - * to a larger buffer, since there may be embedded NULLs in the - * string in some cases. - */ - - if (newSize >= dsPtr->spaceAvl) { - dsPtr->spaceAvl = newSize * 2; - if (dsPtr->string == dsPtr->staticSpace) { - char *newString; - - newString = (char *) ckalloc((unsigned) dsPtr->spaceAvl); - memcpy((VOID *) newString, (VOID *) dsPtr->string, - (size_t) dsPtr->length); - dsPtr->string = newString; - } else { - dsPtr->string = (char *) ckrealloc((VOID *) dsPtr->string, - (size_t) dsPtr->spaceAvl); - } - } - - /* - * Convert the new string to a list element and copy it into the - * buffer at the end, with a space, if needed. - */ - - dst = dsPtr->string + dsPtr->length; - if (TclNeedSpace(dsPtr->string, dst)) { - *dst = ' '; - dst++; - dsPtr->length++; - } - dsPtr->length += Tcl_ConvertElement(string, dst, flags); - return dsPtr->string; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringSetLength -- - * - * Change the length of a dynamic string. This can cause the - * string to either grow or shrink, depending on the value of - * length. - * - * Results: - * None. - * - * Side effects: - * The length of dsPtr is changed to length and a null byte is - * stored at that position in the string. If length is larger - * than the space allocated for dsPtr, then a panic occurs. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DStringSetLength(dsPtr, length) - Tcl_DString *dsPtr; /* Structure describing dynamic string. */ - int length; /* New length for dynamic string. */ -{ - int newsize; - - if (length < 0) { - length = 0; - } - if (length >= dsPtr->spaceAvl) { - /* - * There are two interesting cases here. In the first case, the user - * may be trying to allocate a large buffer of a specific size. It - * would be wasteful to overallocate that buffer, so we just allocate - * enough for the requested size plus the trailing null byte. In the - * second case, we are growing the buffer incrementally, so we need - * behavior similar to Tcl_DStringAppend. The requested length will - * usually be a small delta above the current spaceAvl, so we'll end up - * doubling the old size. This won't grow the buffer quite as quickly, - * but it should be close enough. - */ - - newsize = dsPtr->spaceAvl * 2; - if (length < newsize) { - dsPtr->spaceAvl = newsize; - } else { - dsPtr->spaceAvl = length + 1; - } - if (dsPtr->string == dsPtr->staticSpace) { - char *newString; - - newString = (char *) ckalloc((unsigned) dsPtr->spaceAvl); - memcpy((VOID *) newString, (VOID *) dsPtr->string, - (size_t) dsPtr->length); - dsPtr->string = newString; - } else { - dsPtr->string = (char *) ckrealloc((VOID *) dsPtr->string, - (size_t) dsPtr->spaceAvl); - } - } - dsPtr->length = length; - dsPtr->string[length] = 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringFree -- - * - * Frees up any memory allocated for the dynamic string and - * reinitializes the string to an empty state. - * - * Results: - * None. - * - * Side effects: - * The previous contents of the dynamic string are lost, and - * the new value is an empty string. - * - *---------------------------------------------------------------------- */ - -void -Tcl_DStringFree(dsPtr) - Tcl_DString *dsPtr; /* Structure describing dynamic string. */ -{ - if (dsPtr->string != dsPtr->staticSpace) { - ckfree(dsPtr->string); - } - dsPtr->string = dsPtr->staticSpace; - dsPtr->length = 0; - dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE; - dsPtr->staticSpace[0] = '\0'; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringResult -- - * - * This procedure moves the value of a dynamic string into an - * interpreter as its string result. Afterwards, the dynamic string - * is reset to an empty string. - * - * Results: - * None. - * - * Side effects: - * The string is "moved" to interp's result, and any existing - * string result for interp is freed. dsPtr is reinitialized to - * an empty string. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DStringResult(interp, dsPtr) - Tcl_Interp *interp; /* Interpreter whose result is to be reset. */ - Tcl_DString *dsPtr; /* Dynamic string that is to become the - * result of interp. */ -{ - Tcl_ResetResult(interp); - - if (dsPtr->string != dsPtr->staticSpace) { - interp->result = dsPtr->string; - interp->freeProc = TCL_DYNAMIC; - } else if (dsPtr->length < TCL_RESULT_SIZE) { - interp->result = ((Interp *) interp)->resultSpace; - strcpy(interp->result, dsPtr->string); - } else { - Tcl_SetResult(interp, dsPtr->string, TCL_VOLATILE); - } - - dsPtr->string = dsPtr->staticSpace; - dsPtr->length = 0; - dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE; - dsPtr->staticSpace[0] = '\0'; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringGetResult -- - * - * This procedure moves an interpreter's result into a dynamic string. - * - * Results: - * None. - * - * Side effects: - * The interpreter's string result is cleared, and the previous - * contents of dsPtr are freed. - * - * If the string result is empty, the object result is moved to the - * string result, then the object result is reset. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DStringGetResult(interp, dsPtr) - Tcl_Interp *interp; /* Interpreter whose result is to be reset. */ - Tcl_DString *dsPtr; /* Dynamic string that is to become the - * result of interp. */ -{ - Interp *iPtr = (Interp *) interp; - - if (dsPtr->string != dsPtr->staticSpace) { - ckfree(dsPtr->string); - } - - /* - * If the string result is empty, move the object result to the - * string result, then reset the object result. - */ - - if (*(iPtr->result) == 0) { - Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), - TCL_VOLATILE); - } - - dsPtr->length = strlen(iPtr->result); - if (iPtr->freeProc != NULL) { - if ((iPtr->freeProc == TCL_DYNAMIC) - || (iPtr->freeProc == (Tcl_FreeProc *) free)) { - dsPtr->string = iPtr->result; - dsPtr->spaceAvl = dsPtr->length+1; - } else { - dsPtr->string = (char *) ckalloc((unsigned) (dsPtr->length+1)); - strcpy(dsPtr->string, iPtr->result); - (*iPtr->freeProc)(iPtr->result); - } - dsPtr->spaceAvl = dsPtr->length+1; - iPtr->freeProc = NULL; - } else { - if (dsPtr->length < TCL_DSTRING_STATIC_SIZE) { - dsPtr->string = dsPtr->staticSpace; - dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE; - } else { - dsPtr->string = (char *) ckalloc((unsigned) (dsPtr->length + 1)); - dsPtr->spaceAvl = dsPtr->length + 1; - } - strcpy(dsPtr->string, iPtr->result); - } - - iPtr->result = iPtr->resultSpace; - iPtr->resultSpace[0] = 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringStartSublist -- - * - * This procedure adds the necessary information to a dynamic - * string (e.g. " {" to start a sublist. Future element - * appends will be in the sublist rather than the main list. - * - * Results: - * None. - * - * Side effects: - * Characters get added to the dynamic string. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DStringStartSublist(dsPtr) - Tcl_DString *dsPtr; /* Dynamic string. */ -{ - if (TclNeedSpace(dsPtr->string, dsPtr->string + dsPtr->length)) { - Tcl_DStringAppend(dsPtr, " {", -1); - } else { - Tcl_DStringAppend(dsPtr, "{", -1); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_DStringEndSublist -- - * - * This procedure adds the necessary characters to a dynamic - * string to end a sublist (e.g. "}"). Future element appends - * will be in the enclosing (sub)list rather than the current - * sublist. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_DStringEndSublist(dsPtr) - Tcl_DString *dsPtr; /* Dynamic string. */ -{ - Tcl_DStringAppend(dsPtr, "}", -1); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PrintDouble -- - * - * Given a floating-point value, this procedure converts it to - * an ASCII string using. - * - * Results: - * The ASCII equivalent of "value" is written at "dst". It is - * written using the current precision, and it is guaranteed to - * contain a decimal point or exponent, so that it looks like - * a floating-point value and not an integer. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_PrintDouble(interp, value, dst) - Tcl_Interp *interp; /* Interpreter whose tcl_precision - * variable used to be used to control - * printing. It's ignored now. */ - double value; /* Value to print as string. */ - char *dst; /* Where to store converted value; - * must have at least TCL_DOUBLE_SPACE - * characters. */ -{ - char *p, c; - Tcl_UniChar ch; - - Tcl_MutexLock(&precisionMutex); - sprintf(dst, precisionFormat, value); - Tcl_MutexUnlock(&precisionMutex); - - /* - * If the ASCII result looks like an integer, add ".0" so that it - * doesn't look like an integer anymore. This prevents floating-point - * values from being converted to integers unintentionally. - */ - - for (p = dst; *p != 0; ) { - p += Tcl_UtfToUniChar(p, &ch); - c = UCHAR(ch); - if ((c == '.') || isalpha(UCHAR(c))) { /* INTL: ISO only. */ - return; - } - } - p[0] = '.'; - p[1] = '0'; - p[2] = 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclPrecTraceProc -- - * - * This procedure is invoked whenever the variable "tcl_precision" - * is written. - * - * Results: - * Returns NULL if all went well, or an error message if the - * new value for the variable doesn't make sense. - * - * Side effects: - * If the new value doesn't make sense then this procedure - * undoes the effect of the variable modification. Otherwise - * it modifies the format string that's used by Tcl_PrintDouble. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -char * -TclPrecTraceProc(clientData, interp, name1, name2, flags) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Interpreter containing variable. */ - char *name1; /* Name of variable. */ - char *name2; /* Second part of variable name. */ - int flags; /* Information about what happened. */ -{ - char *value, *end; - int prec; - - /* - * If the variable is unset, then recreate the trace. - */ - - if (flags & TCL_TRACE_UNSETS) { - if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { - Tcl_TraceVar2(interp, name1, name2, - TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES - |TCL_TRACE_UNSETS, TclPrecTraceProc, clientData); - } - return (char *) NULL; - } - - /* - * When the variable is read, reset its value from our shared - * value. This is needed in case the variable was modified in - * some other interpreter so that this interpreter's value is - * out of date. - */ - - Tcl_MutexLock(&precisionMutex); - - if (flags & TCL_TRACE_READS) { - Tcl_SetVar2(interp, name1, name2, precisionString, - flags & TCL_GLOBAL_ONLY); - Tcl_MutexUnlock(&precisionMutex); - return (char *) NULL; - } - - /* - * The variable is being written. Check the new value and disallow - * it if it isn't reasonable or if this is a safe interpreter (we - * don't want safe interpreters messing up the precision of other - * interpreters). - */ - - if (Tcl_IsSafe(interp)) { - Tcl_SetVar2(interp, name1, name2, precisionString, - flags & TCL_GLOBAL_ONLY); - Tcl_MutexUnlock(&precisionMutex); - return "can't modify precision from a safe interpreter"; - } - value = Tcl_GetVar2(interp, name1, name2, flags & TCL_GLOBAL_ONLY); - if (value == NULL) { - value = ""; - } - prec = strtoul(value, &end, 10); - if ((prec <= 0) || (prec > TCL_MAX_PREC) || (prec > 100) || - (end == value) || (*end != 0)) { - Tcl_SetVar2(interp, name1, name2, precisionString, - flags & TCL_GLOBAL_ONLY); - Tcl_MutexUnlock(&precisionMutex); - return "improper value for precision"; - } - TclFormatInt(precisionString, prec); - sprintf(precisionFormat, "%%.%dg", prec); - Tcl_MutexUnlock(&precisionMutex); - return (char *) NULL; -} - -/* - *---------------------------------------------------------------------- - * - * TclNeedSpace -- - * - * This procedure checks to see whether it is appropriate to - * add a space before appending a new list element to an - * existing string. - * - * Results: - * The return value is 1 if a space is appropriate, 0 otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclNeedSpace(start, end) - char *start; /* First character in string. */ - char *end; /* End of string (place where space will - * be added, if appropriate). */ -{ - /* - * A space is needed unless either - * (a) we're at the start of the string, or - * (b) the trailing characters of the string consist of one or more - * open curly braces preceded by a space or extending back to - * the beginning of the string. - * (c) the trailing characters of the string consist of a space - * preceded by a character other than backslash. - */ - - if (end == start) { - return 0; - } - end--; - if (*end != '{') { - if (isspace(UCHAR(*end)) /* INTL: ISO space. */ - && ((end == start) || (end[-1] != '\\'))) { - return 0; - } - return 1; - } - do { - if (end == start) { - return 0; - } - end--; - } while (*end == '{'); - if (isspace(UCHAR(*end))) { /* INTL: ISO space. */ - return 0; - } - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * TclFormatInt -- - * - * This procedure formats an integer into a sequence of decimal digit - * characters in a buffer. If the integer is negative, a minus sign is - * inserted at the start of the buffer. A null character is inserted at - * the end of the formatted characters. It is the caller's - * responsibility to ensure that enough storage is available. This - * procedure has the effect of sprintf(buffer, "%d", n) but is faster. - * - * Results: - * An integer representing the number of characters formatted, not - * including the terminating \0. - * - * Side effects: - * The formatted characters are written into the storage pointer to - * by the "buffer" argument. - * - *---------------------------------------------------------------------- - */ - -int -TclFormatInt(buffer, n) - char *buffer; /* Points to the storage into which the - * formatted characters are written. */ - long n; /* The integer to format. */ -{ - long intVal; - int i; - int numFormatted, j; - char *digits = "0123456789"; - - /* - * Check first whether "n" is zero. - */ - - if (n == 0) { - buffer[0] = '0'; - buffer[1] = 0; - return 1; - } - - /* - * Check whether "n" is the maximum negative value. This is - * -2^(m-1) for an m-bit word, and has no positive equivalent; - * negating it produces the same value. - */ - - if (n == -n) { - sprintf(buffer, "%ld", n); - return strlen(buffer); - } - - /* - * Generate the characters of the result backwards in the buffer. - */ - - intVal = (n < 0? -n : n); - i = 0; - buffer[0] = '\0'; - do { - i++; - buffer[i] = digits[intVal % 10]; - intVal = intVal/10; - } while (intVal > 0); - if (n < 0) { - i++; - buffer[i] = '-'; - } - numFormatted = i; - - /* - * Now reverse the characters. - */ - - for (j = 0; j < i; j++, i--) { - char tmp = buffer[i]; - buffer[i] = buffer[j]; - buffer[j] = tmp; - } - return numFormatted; -} - -/* - *---------------------------------------------------------------------- - * - * TclLooksLikeInt -- - * - * This procedure decides whether the leading characters of a - * string look like an integer or something else (such as a - * floating-point number or string). - * - * Results: - * The return value is 1 if the leading characters of p look - * like a valid Tcl integer. If they look like a floating-point - * number (e.g. "e01" or "2.4"), or if they don't look like a - * number at all, then 0 is returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclLooksLikeInt(bytes, length) - register char *bytes; /* Points to first byte of the string. */ - int length; /* Number of bytes in the string. If < 0 - * bytes up to the first null byte are - * considered (if they may appear in an - * integer). */ -{ - register char *p, *end; - - if (length < 0) { - length = (bytes? strlen(bytes) : 0); - } - end = (bytes + length); - - p = bytes; - while ((p < end) && isspace(UCHAR(*p))) { /* INTL: ISO space. */ - p++; - } - if (p == end) { - return 0; - } - - if ((*p == '+') || (*p == '-')) { - p++; - } - if ((p == end) || !isdigit(UCHAR(*p))) { /* INTL: digit */ - return 0; - } - p++; - while ((p < end) && isdigit(UCHAR(*p))) { /* INTL: digit */ - p++; - } - if (p == end) { - return 1; - } - if ((*p != '.') && (*p != 'e') && (*p != 'E')) { - return 1; - } - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclGetIntForIndex -- - * - * This procedure returns an integer corresponding to the list index - * held in a Tcl object. The Tcl object's value is expected to be - * either an integer or the string "end". - * - * Results: - * The return value is normally TCL_OK, which means that the index was - * successfully stored into the location referenced by "indexPtr". If - * the Tcl object referenced by "objPtr" has the value "end", the - * value stored is "endValue". If "objPtr"s values is not "end" and - * can not be converted to an integer, TCL_ERROR is returned and, if - * "interp" is non-NULL, an error message is left in the interpreter's - * result object. - * - * Side effects: - * The object referenced by "objPtr" might be converted to an - * integer object. - * - *---------------------------------------------------------------------- - */ - -int -TclGetIntForIndex(interp, objPtr, endValue, indexPtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting. - * If NULL, then no error message is left - * after errors. */ - Tcl_Obj *objPtr; /* Points to an object containing either - * "end" or an integer. */ - int endValue; /* The value to be stored at "indexPtr" if - * "objPtr" holds "end". */ - int *indexPtr; /* Location filled in with an integer - * representing an index. */ -{ - Interp *iPtr = (Interp *) interp; - char *bytes; - int index, length, result; - - if (objPtr->typePtr == &tclIntType) { - *indexPtr = (int)objPtr->internalRep.longValue; - return TCL_OK; - } - - bytes = Tcl_GetStringFromObj(objPtr, &length); - if ((*bytes == 'e') - && (strncmp(bytes, "end", (unsigned) length) == 0)) { - index = endValue; - } else { - result = Tcl_GetIntFromObj((Tcl_Interp *) NULL, objPtr, &index); - if (result != TCL_OK) { - if (iPtr != NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad index \"", bytes, - "\": must be integer or \"end\"", (char *) NULL); - } - return result; - } - } - *indexPtr = index; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetNameOfExecutable -- - * - * This procedure simply returns a pointer to the internal full - * path name of the executable file as computed by - * Tcl_FindExecutable. This procedure call is the C API - * equivalent to the "info nameofexecutable" command. - * - * Results: - * A pointer to the internal string or NULL if the internal full - * path name has not been computed or unknown. - * - * Side effects: - * The object referenced by "objPtr" might be converted to an - * integer object. - * - *---------------------------------------------------------------------- - */ - -CONST char * -Tcl_GetNameOfExecutable() -{ - return (tclExecutableName); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetCwd -- - * - * This function replaces the library version of getcwd(). - * - * 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. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetCwd(interp, cwdPtr) - Tcl_Interp *interp; - Tcl_DString *cwdPtr; -{ - return TclpGetCwd(interp, cwdPtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Chdir -- - * - * This function replaces the library version of chdir(). - * - * Results: - * See chdir() documentation. - * - * Side effects: - * See chdir() documentation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Chdir(dirName) - CONST char *dirName; -{ - return TclpChdir(dirName); -} - diff --git a/generic/tclVar.c b/generic/tclVar.c deleted file mode 100644 index 03b7757..0000000 --- a/generic/tclVar.c +++ /dev/null @@ -1,4655 +0,0 @@ -/* - * tclVar.c -- - * - * This file contains routines that implement Tcl variables - * (both scalars and arrays). - * - * The implementation of arrays is modelled after an initial - * implementation by Mark Diekhans and Karl Lehenbauer. - * - * Copyright (c) 1987-1994 The Regents of the University of California. - * Copyright (c) 1994-1997 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. - * - * RCS: @(#) $Id: tclVar.c,v 1.8 1999/04/16 00:46:55 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" - -/* - * The strings below are used to indicate what went wrong when a - * variable access is denied. - */ - -static char *noSuchVar = "no such variable"; -static char *isArray = "variable is array"; -static char *needArray = "variable isn't array"; -static char *noSuchElement = "no such element in array"; -static char *danglingElement = "upvar refers to element in deleted array"; -static char *danglingVar = "upvar refers to variable in deleted namespace"; -static char *badNamespace = "parent namespace doesn't exist"; -static char *missingName = "missing variable name"; - -/* - * Forward references to procedures defined later in this file: - */ - -static char * CallTraces _ANSI_ARGS_((Interp *iPtr, Var *arrayPtr, - Var *varPtr, char *part1, char *part2, - int flags)); -static void CleanupVar _ANSI_ARGS_((Var *varPtr, - Var *arrayPtr)); -static void DeleteSearches _ANSI_ARGS_((Var *arrayVarPtr)); -static void DeleteArray _ANSI_ARGS_((Interp *iPtr, - char *arrayName, Var *varPtr, int flags)); -static int MakeUpvar _ANSI_ARGS_(( - Interp *iPtr, CallFrame *framePtr, - char *otherP1, char *otherP2, int otherFlags, - char *myName, int myFlags)); -static Var * NewVar _ANSI_ARGS_((void)); -static ArraySearch * ParseSearchId _ANSI_ARGS_((Tcl_Interp *interp, - Var *varPtr, char *varName, char *string)); -static void VarErrMsg _ANSI_ARGS_((Tcl_Interp *interp, - char *part1, char *part2, char *operation, - char *reason)); - -/* - *---------------------------------------------------------------------- - * - * TclLookupVar -- - * - * This procedure is used by virtually all of the variable code to - * locate a variable given its name(s). - * - * Results: - * The return value is a pointer to the variable structure indicated by - * part1 and part2, or NULL if the variable couldn't be found. If the - * variable is found, *arrayPtrPtr is filled in with the address of the - * variable structure for the array that contains the variable (or NULL - * if the variable is a scalar). If the variable can't be found and - * either createPart1 or createPart2 are 1, a new as-yet-undefined - * (VAR_UNDEFINED) variable structure is created, entered into a hash - * table, and returned. - * - * If the variable isn't found and creation wasn't specified, or some - * other error occurs, NULL is returned and an error message is left in - * the interp's result if TCL_LEAVE_ERR_MSG is set in flags. - * - * Note: it's possible for the variable returned to be VAR_UNDEFINED - * even if createPart1 or createPart2 are 1 (these only cause the hash - * table entry or array to be created). For example, the variable might - * be a global that has been unset but is still referenced by a - * procedure, or a variable that has been unset but it only being kept - * in existence (if VAR_UNDEFINED) by a trace. - * - * Side effects: - * New hashtable entries may be created if createPart1 or createPart2 - * are 1. - * - *---------------------------------------------------------------------- - */ - -Var * -TclLookupVar(interp, part1, part2, flags, msg, createPart1, createPart2, - arrayPtrPtr) - Tcl_Interp *interp; /* Interpreter to use for lookup. */ - register char *part1; /* If part2 isn't NULL, this is the name of - * an array. Otherwise, this - * is a full variable name that could - * include a parenthesized array element. */ - char *part2; /* Name of element within array, or NULL. */ - int flags; /* Only TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY, - * and TCL_LEAVE_ERR_MSG bits matter. */ - char *msg; /* Verb to use in error messages, e.g. - * "read" or "set". Only needed if - * TCL_LEAVE_ERR_MSG is set in flags. */ - int createPart1; /* If 1, create hash table entry for part 1 - * of name, if it doesn't already exist. If - * 0, return error if it doesn't exist. */ - int createPart2; /* If 1, create hash table entry for part 2 - * of name, if it doesn't already exist. If - * 0, return error if it doesn't exist. */ - Var **arrayPtrPtr; /* If the name refers to an element of an - * array, *arrayPtrPtr gets filled in with - * address of array variable. Otherwise - * this is set to NULL. */ -{ - Interp *iPtr = (Interp *) interp; - CallFrame *varFramePtr = iPtr->varFramePtr; - /* Points to the procedure call frame whose - * variables are currently in use. Same as - * the current procedure's frame, if any, - * unless an "uplevel" is executing. */ - Tcl_HashTable *tablePtr; /* Points to the hashtable, if any, in which - * to look up the variable. */ - Tcl_Var var; /* Used to search for global names. */ - Var *varPtr; /* Points to the Var structure returned for - * the variable. */ - char *elName; /* Name of array element or NULL; may be - * same as part2, or may be openParen+1. */ - char *openParen, *closeParen; - /* If this procedure parses a name into - * array and index, these point to the - * parens around the index. Otherwise they - * are NULL. These are needed to restore - * the parens after parsing the name. */ - Namespace *varNsPtr, *cxtNsPtr, *dummy1Ptr, *dummy2Ptr; - ResolverScheme *resPtr; - Tcl_HashEntry *hPtr; - register char *p; - int new, i, result; - - varPtr = NULL; - *arrayPtrPtr = NULL; - openParen = closeParen = NULL; - varNsPtr = NULL; /* set non-NULL if a nonlocal variable */ - - /* - * Parse part1 into array name and index. - * Always check if part1 is an array element name and allow it only if - * part2 is not given. - * (if one does not care about creating array elements that can't be used - * from tcl, and prefer slightly better performance, one can put - * the following in an if (part2 == NULL) { ... } block and remove - * the part2's test and error reporting or move that code in array set) - */ - - elName = part2; - for (p = part1; *p ; p++) { - if (*p == '(') { - openParen = p; - do { - p++; - } while (*p != '\0'); - p--; - if (*p == ')') { - if (part2 != NULL) { - openParen = NULL; - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, needArray); - } - goto done; - } - closeParen = p; - *openParen = 0; - elName = openParen+1; - } else { - openParen = NULL; - } - break; - } - } - - /* - * If this namespace has a variable resolver, then give it first - * crack at the variable resolution. It may return a Tcl_Var - * value, it may signal to continue onward, or it may signal - * an error. - */ - if ((flags & TCL_GLOBAL_ONLY) != 0 || iPtr->varFramePtr == NULL) { - cxtNsPtr = iPtr->globalNsPtr; - } else { - cxtNsPtr = iPtr->varFramePtr->nsPtr; - } - - if (cxtNsPtr->varResProc != NULL || iPtr->resolverPtr != NULL) { - resPtr = iPtr->resolverPtr; - - if (cxtNsPtr->varResProc) { - result = (*cxtNsPtr->varResProc)(interp, part1, - (Tcl_Namespace *) cxtNsPtr, flags, &var); - } else { - result = TCL_CONTINUE; - } - - while (result == TCL_CONTINUE && resPtr) { - if (resPtr->varResProc) { - result = (*resPtr->varResProc)(interp, part1, - (Tcl_Namespace *) cxtNsPtr, flags, &var); - } - resPtr = resPtr->nextPtr; - } - - if (result == TCL_OK) { - varPtr = (Var *) var; - goto lookupVarPart2; - } else if (result != TCL_CONTINUE) { - return (Var *) NULL; - } - } - - /* - * Look up part1. Look it up as either a namespace variable or as a - * local variable in a procedure call frame (varFramePtr). - * Interpret part1 as a namespace variable if: - * 1) so requested by a TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY flag, - * 2) there is no active frame (we're at the global :: scope), - * 3) the active frame was pushed to define the namespace context - * for a "namespace eval" or "namespace inscope" command, - * 4) the name has namespace qualifiers ("::"s). - * Otherwise, if part1 is a local variable, search first in the - * frame's array of compiler-allocated local variables, then in its - * hashtable for runtime-created local variables. - * - * If createPart1 and the variable isn't found, create the variable and, - * if necessary, create varFramePtr's local var hashtable. - */ - - if (((flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY)) != 0) - || (varFramePtr == NULL) - || !varFramePtr->isProcCallFrame - || (strstr(part1, "::") != NULL)) { - char *tail; - - /* - * Don't pass TCL_LEAVE_ERR_MSG, we may yet create the variable, - * or otherwise generate our own error! - */ - var = Tcl_FindNamespaceVar(interp, part1, (Tcl_Namespace *) NULL, - flags & ~TCL_LEAVE_ERR_MSG); - if (var != (Tcl_Var) NULL) { - varPtr = (Var *) var; - } - if (varPtr == NULL) { - if (createPart1) { /* var wasn't found so create it */ - TclGetNamespaceForQualName(interp, part1, (Namespace *) NULL, - flags, &varNsPtr, &dummy1Ptr, &dummy2Ptr, &tail); - - if (varNsPtr == NULL) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, badNamespace); - } - goto done; - } - if (tail == NULL) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, missingName); - } - goto done; - } - hPtr = Tcl_CreateHashEntry(&varNsPtr->varTable, tail, &new); - varPtr = NewVar(); - Tcl_SetHashValue(hPtr, varPtr); - varPtr->hPtr = hPtr; - varPtr->nsPtr = varNsPtr; - } else { /* var wasn't found and not to create it */ - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, noSuchVar); - } - goto done; - } - } - } else { /* local var: look in frame varFramePtr */ - Proc *procPtr = varFramePtr->procPtr; - int localCt = procPtr->numCompiledLocals; - CompiledLocal *localPtr = procPtr->firstLocalPtr; - Var *localVarPtr = varFramePtr->compiledLocals; - int part1Len = strlen(part1); - - for (i = 0; i < localCt; i++) { - if (!TclIsVarTemporary(localPtr)) { - register char *localName = localVarPtr->name; - if ((part1[0] == localName[0]) - && (part1Len == localPtr->nameLength) - && (strcmp(part1, localName) == 0)) { - varPtr = localVarPtr; - break; - } - } - localVarPtr++; - localPtr = localPtr->nextPtr; - } - if (varPtr == NULL) { /* look in the frame's var hash table */ - tablePtr = varFramePtr->varTablePtr; - if (createPart1) { - if (tablePtr == NULL) { - tablePtr = (Tcl_HashTable *) - ckalloc(sizeof(Tcl_HashTable)); - Tcl_InitHashTable(tablePtr, TCL_STRING_KEYS); - varFramePtr->varTablePtr = tablePtr; - } - hPtr = Tcl_CreateHashEntry(tablePtr, part1, &new); - if (new) { - varPtr = NewVar(); - Tcl_SetHashValue(hPtr, varPtr); - varPtr->hPtr = hPtr; - varPtr->nsPtr = NULL; /* a local variable */ - } else { - varPtr = (Var *) Tcl_GetHashValue(hPtr); - } - } else { - hPtr = NULL; - if (tablePtr != NULL) { - hPtr = Tcl_FindHashEntry(tablePtr, part1); - } - if (hPtr == NULL) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, noSuchVar); - } - goto done; - } - varPtr = (Var *) Tcl_GetHashValue(hPtr); - } - } - } - - lookupVarPart2: - if (openParen != NULL) { - *openParen = '('; - openParen = NULL; - } - - /* - * If varPtr is a link variable, we have a reference to some variable - * that was created through an "upvar" or "global" command. Traverse - * through any links until we find the referenced variable. - */ - - while (TclIsVarLink(varPtr)) { - varPtr = varPtr->value.linkPtr; - } - - /* - * If we're not dealing with an array element, return varPtr. - */ - - if (elName == NULL) { - goto done; - } - - /* - * We're dealing with an array element. Make sure the variable is an - * array and look up the element (create the element if desired). - */ - - if (TclIsVarUndefined(varPtr) && !TclIsVarArrayElement(varPtr)) { - if (!createPart1) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, noSuchVar); - } - varPtr = NULL; - goto done; - } - - /* - * Make sure we are not resurrecting a namespace variable from a - * deleted namespace! - */ - if ((varPtr->flags & VAR_IN_HASHTABLE) && (varPtr->hPtr == NULL)) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, danglingVar); - } - varPtr = NULL; - goto done; - } - - TclSetVarArray(varPtr); - TclClearVarUndefined(varPtr); - varPtr->value.tablePtr = - (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - Tcl_InitHashTable(varPtr->value.tablePtr, TCL_STRING_KEYS); - } else if (!TclIsVarArray(varPtr)) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, needArray); - } - varPtr = NULL; - goto done; - } - *arrayPtrPtr = varPtr; - if (closeParen != NULL) { - *closeParen = 0; - } - if (createPart2) { - hPtr = Tcl_CreateHashEntry(varPtr->value.tablePtr, elName, &new); - if (closeParen != NULL) { - *closeParen = ')'; - } - if (new) { - if (varPtr->searchPtr != NULL) { - DeleteSearches(varPtr); - } - varPtr = NewVar(); - Tcl_SetHashValue(hPtr, varPtr); - varPtr->hPtr = hPtr; - varPtr->nsPtr = varNsPtr; - TclSetVarArrayElement(varPtr); - } - } else { - hPtr = Tcl_FindHashEntry(varPtr->value.tablePtr, elName); - if (closeParen != NULL) { - *closeParen = ')'; - } - if (hPtr == NULL) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, msg, noSuchElement); - } - varPtr = NULL; - goto done; - } - } - varPtr = (Var *) Tcl_GetHashValue(hPtr); - - done: - if (openParen != NULL) { - *openParen = '('; - } - return varPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetVar -- - * - * Return the value of a Tcl variable as a string. - * - * Results: - * The return value points to the current value of varName as a string. - * If the variable is not defined or can't be read because of a clash - * in array usage then a NULL pointer is returned and an error message - * is left in the interp's result if the TCL_LEAVE_ERR_MSG flag is set. - * Note: the return value is only valid up until the next change to the - * variable; if you depend on the value lasting longer than that, then - * make yourself a private copy. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetVar(interp, varName, flags) - Tcl_Interp *interp; /* Command interpreter in which varName is - * to be looked up. */ - char *varName; /* Name of a variable in interp. */ - int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY or TCL_LEAVE_ERR_MSG - * bits. */ -{ - return Tcl_GetVar2(interp, varName, (char *) NULL, flags); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetVar2 -- - * - * Return the value of a Tcl variable as a string, given a two-part - * name consisting of array name and element within array. - * - * Results: - * The return value points to the current value of the variable given - * by part1 and part2 as a string. If the specified variable doesn't - * exist, or if there is a clash in array usage, then NULL is returned - * and a message will be left in the interp's result if the - * TCL_LEAVE_ERR_MSG flag is set. Note: the return value is only valid - * up until the next change to the variable; if you depend on the value - * lasting longer than that, then make yourself a private copy. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetVar2(interp, part1, part2, flags) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be looked up. */ - char *part1; /* Name of an array (if part2 is non-NULL) - * or the name of a variable. */ - char *part2; /* If non-NULL, gives the name of an element - * in the array part1. */ - int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY and TCL_LEAVE_ERR_MSG - * bits. */ -{ - Tcl_Obj *objPtr; - - objPtr = Tcl_GetVar2Ex(interp, part1, part2, flags); - if (objPtr == NULL) { - return NULL; - } - return TclGetString(objPtr); -} -/* - *---------------------------------------------------------------------- - * - * Tcl_ObjGetVar2 -- - * - * Return the value of a Tcl variable as a Tcl object, given a - * two-part name consisting of array name and element within array. - * - * Results: - * The return value points to the current object value of the variable - * given by part1Ptr and part2Ptr. If the specified variable doesn't - * exist, or if there is a clash in array usage, then NULL is returned - * and a message will be left in the interpreter's result if the - * TCL_LEAVE_ERR_MSG flag is set. - * - * Side effects: - * The ref count for the returned object is _not_ incremented to - * reflect the returned reference; if you want to keep a reference to - * the object you must increment its ref count yourself. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_ObjGetVar2(interp, part1Ptr, part2Ptr, flags) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be looked up. */ - register Tcl_Obj *part1Ptr; /* Points to an object holding the name of - * an array (if part2 is non-NULL) or the - * name of a variable. */ - register Tcl_Obj *part2Ptr; /* If non-null, points to an object holding - * the name of an element in the array - * part1Ptr. */ - int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, - * TCL_LEAVE_ERR_MSG, and - * TCL_PARSE_PART1 bits. */ -{ - char *part1, *part2; - - part1 = Tcl_GetString(part1Ptr); - if (part2Ptr != NULL) { - part2 = Tcl_GetString(part2Ptr); - } else { - part2 = NULL; - } - - return Tcl_GetVar2Ex(interp, part1, part2, flags); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetVar2Ex -- - * - * Return the value of a Tcl variable as a Tcl object, given a - * two-part name consisting of array name and element within array. - * - * Results: - * The return value points to the current object value of the variable - * given by part1Ptr and part2Ptr. If the specified variable doesn't - * exist, or if there is a clash in array usage, then NULL is returned - * and a message will be left in the interpreter's result if the - * TCL_LEAVE_ERR_MSG flag is set. - * - * Side effects: - * The ref count for the returned object is _not_ incremented to - * reflect the returned reference; if you want to keep a reference to - * the object you must increment its ref count yourself. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_GetVar2Ex(interp, part1, part2, flags) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be looked up. */ - char *part1; /* Name of an array (if part2 is non-NULL) - * or the name of a variable. */ - char *part2; /* If non-NULL, gives the name of an element - * in the array part1. */ - int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, - * and TCL_LEAVE_ERR_MSG bits. */ -{ - Interp *iPtr = (Interp *) interp; - register Var *varPtr; - Var *arrayPtr; - char *msg; - - varPtr = TclLookupVar(interp, part1, part2, flags, "read", - /*createPart1*/ 0, /*createPart2*/ 1, &arrayPtr); - if (varPtr == NULL) { - return NULL; - } - - /* - * Invoke any traces that have been set for the variable. - */ - - if ((varPtr->tracePtr != NULL) - || ((arrayPtr != NULL) && (arrayPtr->tracePtr != NULL))) { - msg = CallTraces(iPtr, arrayPtr, varPtr, part1, part2, - (flags & (TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY)) | TCL_TRACE_READS); - if (msg != NULL) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, "read", msg); - } - goto errorReturn; - } - } - - /* - * Return the element if it's an existing scalar variable. - */ - - if (TclIsVarScalar(varPtr) && !TclIsVarUndefined(varPtr)) { - return varPtr->value.objPtr; - } - - if (flags & TCL_LEAVE_ERR_MSG) { - if (TclIsVarUndefined(varPtr) && (arrayPtr != NULL) - && !TclIsVarUndefined(arrayPtr)) { - msg = noSuchElement; - } else if (TclIsVarArray(varPtr)) { - msg = isArray; - } else { - msg = noSuchVar; - } - VarErrMsg(interp, part1, part2, "read", msg); - } - - /* - * An error. If the variable doesn't exist anymore and no-one's using - * it, then free up the relevant structures and hash table entries. - */ - - errorReturn: - if (TclIsVarUndefined(varPtr)) { - CleanupVar(varPtr, arrayPtr); - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * TclGetIndexedScalar -- - * - * Return the Tcl object value of a local scalar variable in the active - * procedure, given its index in the procedure's array of compiler - * allocated local variables. - * - * Results: - * The return value points to the current object value of the variable - * given by localIndex. If the specified variable doesn't exist, or - * there is a clash in array usage, or an error occurs while executing - * variable traces, then NULL is returned and a message will be left in - * the interpreter's result if leaveErrorMsg is 1. - * - * Side effects: - * The ref count for the returned object is _not_ incremented to - * reflect the returned reference; if you want to keep a reference to - * the object you must increment its ref count yourself. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -TclGetIndexedScalar(interp, localIndex, leaveErrorMsg) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be looked up. */ - register int localIndex; /* Index of variable in procedure's array - * of local variables. */ - int leaveErrorMsg; /* 1 if to leave an error message in - * interpreter's result on an error. - * Otherwise no error message is left. */ -{ - Interp *iPtr = (Interp *) interp; - CallFrame *varFramePtr = iPtr->varFramePtr; - /* Points to the procedure call frame whose - * variables are currently in use. Same as - * the current procedure's frame, if any, - * unless an "uplevel" is executing. */ - Var *compiledLocals = varFramePtr->compiledLocals; - register Var *varPtr; /* Points to the variable's in-frame Var - * structure. */ - char *varName; /* Name of the local variable. */ - char *msg; - -#ifdef TCL_COMPILE_DEBUG - int localCt = varFramePtr->procPtr->numCompiledLocals; - - if (compiledLocals == NULL) { - fprintf(stderr, "\nTclGetIndexedScalar: can't get local %i in frame 0x%x, no compiled locals\n", - localIndex, (unsigned int) varFramePtr); - panic("TclGetIndexedScalar: no compiled locals in frame 0x%x", - (unsigned int) varFramePtr); - } - if ((localIndex < 0) || (localIndex >= localCt)) { - fprintf(stderr, "\nTclGetIndexedScalar: can't get local %i in frame 0x%x with %i locals\n", - localIndex, (unsigned int) varFramePtr, localCt); - panic("TclGetIndexedScalar: bad local index %i in frame 0x%x", - localIndex, (unsigned int) varFramePtr); - } -#endif /* TCL_COMPILE_DEBUG */ - - varPtr = &(compiledLocals[localIndex]); - varName = varPtr->name; - - /* - * If varPtr is a link variable, we have a reference to some variable - * that was created through an "upvar" or "global" command, or we have a - * reference to a variable in an enclosing namespace. Traverse through - * any links until we find the referenced variable. - */ - - while (TclIsVarLink(varPtr)) { - varPtr = varPtr->value.linkPtr; - } - - /* - * Invoke any traces that have been set for the variable. - */ - - if (varPtr->tracePtr != NULL) { - msg = CallTraces(iPtr, /*arrayPtr*/ NULL, varPtr, varName, NULL, - TCL_TRACE_READS); - if (msg != NULL) { - if (leaveErrorMsg) { - VarErrMsg(interp, varName, NULL, "read", msg); - } - return NULL; - } - } - - /* - * Make sure we're dealing with a scalar variable and not an array, and - * that the variable exists (isn't undefined). - */ - - if (!TclIsVarScalar(varPtr) || TclIsVarUndefined(varPtr)) { - if (leaveErrorMsg) { - if (TclIsVarArray(varPtr)) { - msg = isArray; - } else { - msg = noSuchVar; - } - VarErrMsg(interp, varName, NULL, "read", msg); - - } - return NULL; - } - return varPtr->value.objPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclGetElementOfIndexedArray -- - * - * Return the Tcl object value for an element in a local array - * variable. The element is named by the object elemPtr while the - * array is specified by its index in the active procedure's array - * of compiler allocated local variables. - * - * Results: - * The return value points to the current object value of the - * element. If the specified array or element doesn't exist, or there - * is a clash in array usage, or an error occurs while executing - * variable traces, then NULL is returned and a message will be left in - * the interpreter's result if leaveErrorMsg is 1. - * - * Side effects: - * The ref count for the returned object is _not_ incremented to - * reflect the returned reference; if you want to keep a reference to - * the object you must increment its ref count yourself. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -TclGetElementOfIndexedArray(interp, localIndex, elemPtr, leaveErrorMsg) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be looked up. */ - int localIndex; /* Index of array variable in procedure's - * array of local variables. */ - Tcl_Obj *elemPtr; /* Points to an object holding the name of - * an element to get in the array. */ - int leaveErrorMsg; /* 1 if to leave an error message in - * the interpreter's result on an error. - * Otherwise no error message is left. */ -{ - Interp *iPtr = (Interp *) interp; - CallFrame *varFramePtr = iPtr->varFramePtr; - /* Points to the procedure call frame whose - * variables are currently in use. Same as - * the current procedure's frame, if any, - * unless an "uplevel" is executing. */ - Var *compiledLocals = varFramePtr->compiledLocals; - Var *arrayPtr; /* Points to the array's in-frame Var - * structure. */ - char *arrayName; /* Name of the local array. */ - Tcl_HashEntry *hPtr; - Var *varPtr = NULL; /* Points to the element's Var structure - * that we return. Initialized to avoid - * compiler warning. */ - char *elem, *msg; - int new; - -#ifdef TCL_COMPILE_DEBUG - Proc *procPtr = varFramePtr->procPtr; - int localCt = procPtr->numCompiledLocals; - - if (compiledLocals == NULL) { - fprintf(stderr, "\nTclGetElementOfIndexedArray: can't get element of local %i in frame 0x%x, no compiled locals\n", - localIndex, (unsigned int) varFramePtr); - panic("TclGetIndexedScalar: no compiled locals in frame 0x%x", - (unsigned int) varFramePtr); - } - if ((localIndex < 0) || (localIndex >= localCt)) { - fprintf(stderr, "\nTclGetIndexedScalar: can't get element of local %i in frame 0x%x with %i locals\n", - localIndex, (unsigned int) varFramePtr, localCt); - panic("TclGetElementOfIndexedArray: bad local index %i in frame 0x%x", - localIndex, (unsigned int) varFramePtr); - } -#endif /* TCL_COMPILE_DEBUG */ - - elem = TclGetString(elemPtr); - arrayPtr = &(compiledLocals[localIndex]); - arrayName = arrayPtr->name; - - /* - * If arrayPtr is a link variable, we have a reference to some variable - * that was created through an "upvar" or "global" command, or we have a - * reference to a variable in an enclosing namespace. Traverse through - * any links until we find the referenced variable. - */ - - while (TclIsVarLink(arrayPtr)) { - arrayPtr = arrayPtr->value.linkPtr; - } - - /* - * Make sure we're dealing with an array and that the array variable - * exists (isn't undefined). - */ - - if (!TclIsVarArray(arrayPtr) || TclIsVarUndefined(arrayPtr)) { - if (leaveErrorMsg) { - VarErrMsg(interp, arrayName, elem, "read", noSuchVar); - } - goto errorReturn; - } - - /* - * Look up the element. Note that we must create the element (but leave - * it marked undefined) if it does not already exist. This allows a - * trace to create new array elements "on the fly" that did not exist - * before. A trace is always passed a variable for the array element. If - * the trace does not define the variable, it will be deleted below (at - * errorReturn) and an error returned. - */ - - hPtr = Tcl_CreateHashEntry(arrayPtr->value.tablePtr, elem, &new); - if (new) { - if (arrayPtr->searchPtr != NULL) { - DeleteSearches(arrayPtr); - } - varPtr = NewVar(); - Tcl_SetHashValue(hPtr, varPtr); - varPtr->hPtr = hPtr; - varPtr->nsPtr = varFramePtr->nsPtr; - TclSetVarArrayElement(varPtr); - } else { - varPtr = (Var *) Tcl_GetHashValue(hPtr); - } - - /* - * Invoke any traces that have been set for the element variable. - */ - - if ((varPtr->tracePtr != NULL) - || ((arrayPtr != NULL) && (arrayPtr->tracePtr != NULL))) { - msg = CallTraces(iPtr, arrayPtr, varPtr, arrayName, elem, - TCL_TRACE_READS); - if (msg != NULL) { - if (leaveErrorMsg) { - VarErrMsg(interp, arrayName, elem, "read", msg); - } - goto errorReturn; - } - } - - /* - * Return the element if it's an existing scalar variable. - */ - - if (TclIsVarScalar(varPtr) && !TclIsVarUndefined(varPtr)) { - return varPtr->value.objPtr; - } - - if (leaveErrorMsg) { - if (TclIsVarArray(varPtr)) { - msg = isArray; - } else { - msg = noSuchVar; - } - VarErrMsg(interp, arrayName, elem, "read", msg); - } - - /* - * An error. If the variable doesn't exist anymore and no-one's using - * it, then free up the relevant structures and hash table entries. - */ - - errorReturn: - if ((varPtr != NULL) && TclIsVarUndefined(varPtr)) { - CleanupVar(varPtr, NULL); /* the array is not in a hashtable */ - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetObjCmd -- - * - * This procedure is invoked to process the "set" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result value. - * - * Side effects: - * A variable's value may be changed. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_SetObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - register Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Obj *varValueObj; - - if (objc == 2) { - varValueObj = Tcl_ObjGetVar2(interp, objv[1], NULL, TCL_LEAVE_ERR_MSG); - if (varValueObj == NULL) { - return TCL_ERROR; - } - Tcl_SetObjResult(interp, varValueObj); - return TCL_OK; - } else if (objc == 3) { - - varValueObj = Tcl_ObjSetVar2(interp, objv[1], NULL, objv[2], - TCL_LEAVE_ERR_MSG); - if (varValueObj == NULL) { - return TCL_ERROR; - } - Tcl_SetObjResult(interp, varValueObj); - return TCL_OK; - } else { - Tcl_WrongNumArgs(interp, 1, objv, "varName ?newValue?"); - return TCL_ERROR; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetVar -- - * - * Change the value of a variable. - * - * Results: - * Returns a pointer to the malloc'ed string which is the character - * representation of the variable's new value. The caller must not - * modify this string. If the write operation was disallowed then NULL - * is returned; if the TCL_LEAVE_ERR_MSG flag is set, then an - * explanatory message will be left in the interp's result. Note that the - * returned string may not be the same as newValue; this is because - * variable traces may modify the variable's value. - * - * Side effects: - * If varName is defined as a local or global variable in interp, - * its value is changed to newValue. If varName isn't currently - * defined, then a new global variable by that name is created. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_SetVar(interp, varName, newValue, flags) - Tcl_Interp *interp; /* Command interpreter in which varName is - * to be looked up. */ - char *varName; /* Name of a variable in interp. */ - char *newValue; /* New value for varName. */ - int flags; /* Various flags that tell how to set value: - * any of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, TCL_APPEND_VALUE, - * TCL_LIST_ELEMENT, TCL_LEAVE_ERR_MSG. */ -{ - return Tcl_SetVar2(interp, varName, (char *) NULL, newValue, flags); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetVar2 -- - * - * Given a two-part variable name, which may refer either to a - * scalar variable or an element of an array, change the value - * of the variable. If the named scalar or array or element - * doesn't exist then create one. - * - * Results: - * Returns a pointer to the malloc'ed string which is the character - * representation of the variable's new value. The caller must not - * modify this string. If the write operation was disallowed because an - * array was expected but not found (or vice versa), then NULL is - * returned; if the TCL_LEAVE_ERR_MSG flag is set, then an explanatory - * message will be left in the interp's result. Note that the returned - * string may not be the same as newValue; this is because variable - * traces may modify the variable's value. - * - * Side effects: - * The value of the given variable is set. If either the array - * or the entry didn't exist then a new one is created. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_SetVar2(interp, part1, part2, newValue, flags) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be looked up. */ - char *part1; /* If part2 is NULL, this is name of scalar - * variable. Otherwise it is the name of - * an array. */ - char *part2; /* Name of an element within an array, or - * NULL. */ - char *newValue; /* New value for variable. */ - int flags; /* Various flags that tell how to set value: - * any of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, TCL_APPEND_VALUE, - * TCL_LIST_ELEMENT, or TCL_LEAVE_ERR_MSG */ -{ - register Tcl_Obj *valuePtr; - Tcl_Obj *varValuePtr; - - /* - * Create an object holding the variable's new value and use - * Tcl_SetVar2Ex to actually set the variable. - */ - - valuePtr = Tcl_NewStringObj(newValue, -1); - Tcl_IncrRefCount(valuePtr); - - varValuePtr = Tcl_SetVar2Ex(interp, part1, part2, valuePtr, flags); - Tcl_DecrRefCount(valuePtr); /* done with the object */ - - if (varValuePtr == NULL) { - return NULL; - } - return TclGetString(varValuePtr); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ObjSetVar2 -- - * - * This function is the same as Tcl_SetVar2Ex below, except the - * variable names are passed in Tcl object instead of strings. - * - * Results: - * Returns a pointer to the Tcl_Obj holding the new value of the - * variable. If the write operation was disallowed because an array was - * expected but not found (or vice versa), then NULL is returned; if - * the TCL_LEAVE_ERR_MSG flag is set, then an explanatory message will - * be left in the interpreter's result. Note that the returned object - * may not be the same one referenced by newValuePtr; this is because - * variable traces may modify the variable's value. - * - * Side effects: - * The value of the given variable is set. If either the array or the - * entry didn't exist then a new variable is created. - - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_ObjSetVar2(interp, part1Ptr, part2Ptr, newValuePtr, flags) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be found. */ - register Tcl_Obj *part1Ptr; /* Points to an object holding the name of - * an array (if part2 is non-NULL) or the - * name of a variable. */ - register Tcl_Obj *part2Ptr; /* If non-null, points to an object holding - * the name of an element in the array - * part1Ptr. */ - Tcl_Obj *newValuePtr; /* New value for variable. */ - int flags; /* Various flags that tell how to set value: - * any of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, TCL_APPEND_VALUE, - * TCL_LIST_ELEMENT, TCL_LEAVE_ERR_MSG, or - * TCL_PARSE_PART1. */ -{ - char *part1, *part2; - - part1 = Tcl_GetString(part1Ptr); - if (part2Ptr != NULL) { - part2 = Tcl_GetString(part2Ptr); - } else { - part2 = NULL; - } - - return Tcl_SetVar2Ex(interp, part1, part2, newValuePtr, flags); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetVar2Ex -- - * - * Given a two-part variable name, which may refer either to a scalar - * variable or an element of an array, change the value of the variable - * to a new Tcl object value. If the named scalar or array or element - * doesn't exist then create one. - * - * Results: - * Returns a pointer to the Tcl_Obj holding the new value of the - * variable. If the write operation was disallowed because an array was - * expected but not found (or vice versa), then NULL is returned; if - * the TCL_LEAVE_ERR_MSG flag is set, then an explanatory message will - * be left in the interpreter's result. Note that the returned object - * may not be the same one referenced by newValuePtr; this is because - * variable traces may modify the variable's value. - * - * Side effects: - * The value of the given variable is set. If either the array or the - * entry didn't exist then a new variable is created. - * - * The reference count is decremented for any old value of the variable - * and incremented for its new value. If the new value for the variable - * is not the same one referenced by newValuePtr (perhaps as a result - * of a variable trace), then newValuePtr's ref count is left unchanged - * by Tcl_SetVar2Ex. newValuePtr's ref count is also left unchanged if - * we are appending it as a string value: that is, if "flags" includes - * TCL_APPEND_VALUE but not TCL_LIST_ELEMENT. - * - * The reference count for the returned object is _not_ incremented: if - * you want to keep a reference to the object you must increment its - * ref count yourself. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_SetVar2Ex(interp, part1, part2, newValuePtr, flags) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be found. */ - char *part1; /* Name of an array (if part2 is non-NULL) - * or the name of a variable. */ - char *part2; /* If non-NULL, gives the name of an element - * in the array part1. */ - Tcl_Obj *newValuePtr; /* New value for variable. */ - int flags; /* Various flags that tell how to set value: - * any of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, TCL_APPEND_VALUE, - * TCL_LIST_ELEMENT or TCL_LEAVE_ERR_MSG. */ -{ - Interp *iPtr = (Interp *) interp; - register Var *varPtr; - Var *arrayPtr; - Tcl_Obj *oldValuePtr; - Tcl_Obj *resultPtr = NULL; - char *bytes; - int length, result; - - varPtr = TclLookupVar(interp, part1, part2, flags, "set", - /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); - if (varPtr == NULL) { - return NULL; - } - - /* - * If the variable is in a hashtable and its hPtr field is NULL, then we - * may have an upvar to an array element where the array was deleted - * or an upvar to a namespace variable whose namespace was deleted. - * Generate an error (allowing the variable to be reset would screw up - * our storage allocation and is meaningless anyway). - */ - - if ((varPtr->flags & VAR_IN_HASHTABLE) && (varPtr->hPtr == NULL)) { - if (flags & TCL_LEAVE_ERR_MSG) { - if (TclIsVarArrayElement(varPtr)) { - VarErrMsg(interp, part1, part2, "set", danglingElement); - } else { - VarErrMsg(interp, part1, part2, "set", danglingVar); - } - } - return NULL; - } - - /* - * It's an error to try to set an array variable itself. - */ - - if (TclIsVarArray(varPtr) && !TclIsVarUndefined(varPtr)) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, "set", isArray); - } - return NULL; - } - - /* - * At this point, if we were appending, we used to call read traces: we - * treated append as a read-modify-write. However, it seemed unlikely to - * us that a real program would be interested in such reads being done - * during a set operation. - */ - - /* - * Set the variable's new value. If appending, append the new value to - * the variable, either as a list element or as a string. Also, if - * appending, then if the variable's old value is unshared we can modify - * it directly, otherwise we must create a new copy to modify: this is - * "copy on write". - */ - - oldValuePtr = varPtr->value.objPtr; - if (flags & TCL_APPEND_VALUE) { - if (TclIsVarUndefined(varPtr) && (oldValuePtr != NULL)) { - Tcl_DecrRefCount(oldValuePtr); /* discard old value */ - varPtr->value.objPtr = NULL; - oldValuePtr = NULL; - } - if (flags & TCL_LIST_ELEMENT) { /* append list element */ - if (oldValuePtr == NULL) { - TclNewObj(oldValuePtr); - varPtr->value.objPtr = oldValuePtr; - Tcl_IncrRefCount(oldValuePtr); /* since var is reference */ - } else if (Tcl_IsShared(oldValuePtr)) { - varPtr->value.objPtr = Tcl_DuplicateObj(oldValuePtr); - Tcl_DecrRefCount(oldValuePtr); - oldValuePtr = varPtr->value.objPtr; - Tcl_IncrRefCount(oldValuePtr); /* since var is reference */ - } - result = Tcl_ListObjAppendElement(interp, oldValuePtr, - newValuePtr); - if (result != TCL_OK) { - return NULL; - } - } else { /* append string */ - /* - * We append newValuePtr's bytes but don't change its ref count. - */ - - bytes = Tcl_GetStringFromObj(newValuePtr, &length); - if (oldValuePtr == NULL) { - varPtr->value.objPtr = Tcl_NewStringObj(bytes, length); - Tcl_IncrRefCount(varPtr->value.objPtr); - } else { - if (Tcl_IsShared(oldValuePtr)) { /* append to copy */ - varPtr->value.objPtr = Tcl_DuplicateObj(oldValuePtr); - TclDecrRefCount(oldValuePtr); - oldValuePtr = varPtr->value.objPtr; - Tcl_IncrRefCount(oldValuePtr); /* since var is ref */ - } - Tcl_AppendToObj(oldValuePtr, bytes, length); - } - } - } else { - if (flags & TCL_LIST_ELEMENT) { /* set var to list element */ - int neededBytes, listFlags; - - /* - * We set the variable to the result of converting newValuePtr's - * string rep to a list element. We do not change newValuePtr's - * ref count. - */ - - if (oldValuePtr != NULL) { - Tcl_DecrRefCount(oldValuePtr); /* discard old value */ - } - bytes = Tcl_GetStringFromObj(newValuePtr, &length); - neededBytes = Tcl_ScanElement(bytes, &listFlags); - oldValuePtr = Tcl_NewObj(); - oldValuePtr->bytes = (char *) - ckalloc((unsigned) (neededBytes + 1)); - oldValuePtr->length = Tcl_ConvertElement(bytes, - oldValuePtr->bytes, listFlags); - varPtr->value.objPtr = oldValuePtr; - Tcl_IncrRefCount(varPtr->value.objPtr); - } else if (newValuePtr != oldValuePtr) { - varPtr->value.objPtr = newValuePtr; - Tcl_IncrRefCount(newValuePtr); /* var is another ref */ - if (oldValuePtr != NULL) { - TclDecrRefCount(oldValuePtr); /* discard old value */ - } - } - } - TclSetVarScalar(varPtr); - TclClearVarUndefined(varPtr); - if (arrayPtr != NULL) { - TclClearVarUndefined(arrayPtr); - } - - /* - * Invoke any write traces for the variable. - */ - - if ((varPtr->tracePtr != NULL) - || ((arrayPtr != NULL) && (arrayPtr->tracePtr != NULL))) { - char *msg = CallTraces(iPtr, arrayPtr, varPtr, part1, part2, - (flags & (TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY)) | TCL_TRACE_WRITES); - if (msg != NULL) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, "set", msg); - } - goto cleanup; - } - } - - /* - * Return the variable's value unless the variable was changed in some - * gross way by a trace (e.g. it was unset and then recreated as an - * array). - */ - - if (TclIsVarScalar(varPtr) && !TclIsVarUndefined(varPtr)) { - return varPtr->value.objPtr; - } - - /* - * A trace changed the value in some gross way. Return an empty string - * object. - */ - - resultPtr = iPtr->emptyObjPtr; - - /* - * If the variable doesn't exist anymore and no-one's using it, then - * free up the relevant structures and hash table entries. - */ - - cleanup: - if (TclIsVarUndefined(varPtr)) { - CleanupVar(varPtr, arrayPtr); - } - return resultPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclSetIndexedScalar -- - * - * Change the Tcl object value of a local scalar variable in the active - * procedure, given its compile-time allocated index in the procedure's - * array of local variables. - * - * Results: - * Returns a pointer to the Tcl_Obj holding the new value of the - * variable given by localIndex. If the specified variable doesn't - * exist, or there is a clash in array usage, or an error occurs while - * executing variable traces, then NULL is returned and a message will - * be left in the interpreter's result if leaveErrorMsg is 1. Note - * that the returned object may not be the same one referenced by - * newValuePtr; this is because variable traces may modify the - * variable's value. - * - * Side effects: - * The value of the given variable is set. The reference count is - * decremented for any old value of the variable and incremented for - * its new value. If as a result of a variable trace the new value for - * the variable is not the same one referenced by newValuePtr, then - * newValuePtr's ref count is left unchanged. The ref count for the - * returned object is _not_ incremented to reflect the returned - * reference; if you want to keep a reference to the object you must - * increment its ref count yourself. This procedure does not create - * new variables, but only sets those recognized at compile time. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -TclSetIndexedScalar(interp, localIndex, newValuePtr, leaveErrorMsg) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be found. */ - int localIndex; /* Index of variable in procedure's array - * of local variables. */ - Tcl_Obj *newValuePtr; /* New value for variable. */ - int leaveErrorMsg; /* 1 if to leave an error message in - * the interpreter's result on an error. - * Otherwise no error message is left. */ -{ - Interp *iPtr = (Interp *) interp; - CallFrame *varFramePtr = iPtr->varFramePtr; - /* Points to the procedure call frame whose - * variables are currently in use. Same as - * the current procedure's frame, if any, - * unless an "uplevel" is executing. */ - Var *compiledLocals = varFramePtr->compiledLocals; - register Var *varPtr; /* Points to the variable's in-frame Var - * structure. */ - char *varName; /* Name of the local variable. */ - Tcl_Obj *oldValuePtr; - Tcl_Obj *resultPtr = NULL; - -#ifdef TCL_COMPILE_DEBUG - Proc *procPtr = varFramePtr->procPtr; - int localCt = procPtr->numCompiledLocals; - - if (compiledLocals == NULL) { - fprintf(stderr, "\nTclSetIndexedScalar: can't set local %i in frame 0x%x, no compiled locals\n", - localIndex, (unsigned int) varFramePtr); - panic("TclSetIndexedScalar: no compiled locals in frame 0x%x", - (unsigned int) varFramePtr); - } - if ((localIndex < 0) || (localIndex >= localCt)) { - fprintf(stderr, "\nTclSetIndexedScalar: can't set local %i in frame 0x%x with %i locals\n", - localIndex, (unsigned int) varFramePtr, localCt); - panic("TclSetIndexedScalar: bad local index %i in frame 0x%x", - localIndex, (unsigned int) varFramePtr); - } -#endif /* TCL_COMPILE_DEBUG */ - - varPtr = &(compiledLocals[localIndex]); - varName = varPtr->name; - - /* - * If varPtr is a link variable, we have a reference to some variable - * that was created through an "upvar" or "global" command, or we have a - * reference to a variable in an enclosing namespace. Traverse through - * any links until we find the referenced variable. - */ - - while (TclIsVarLink(varPtr)) { - varPtr = varPtr->value.linkPtr; - } - - /* - * If the variable is in a hashtable and its hPtr field is NULL, then we - * may have an upvar to an array element where the array was deleted - * or an upvar to a namespace variable whose namespace was deleted. - * Generate an error (allowing the variable to be reset would screw up - * our storage allocation and is meaningless anyway). - */ - - if ((varPtr->flags & VAR_IN_HASHTABLE) && (varPtr->hPtr == NULL)) { - if (leaveErrorMsg) { - if (TclIsVarArrayElement(varPtr)) { - VarErrMsg(interp, varName, NULL, "set", danglingElement); - } else { - VarErrMsg(interp, varName, NULL, "set", danglingVar); - } - } - return NULL; - } - - /* - * It's an error to try to set an array variable itself. - */ - - if (TclIsVarArray(varPtr) && !TclIsVarUndefined(varPtr)) { - if (leaveErrorMsg) { - VarErrMsg(interp, varName, NULL, "set", isArray); - } - return NULL; - } - - /* - * Set the variable's new value and discard its old value. We don't - * append with this "set" procedure so the old value isn't needed. - */ - - oldValuePtr = varPtr->value.objPtr; - if (newValuePtr != oldValuePtr) { /* set new value */ - varPtr->value.objPtr = newValuePtr; - Tcl_IncrRefCount(newValuePtr); /* var is another ref to obj */ - if (oldValuePtr != NULL) { - TclDecrRefCount(oldValuePtr); /* discard old value */ - } - } - TclSetVarScalar(varPtr); - TclClearVarUndefined(varPtr); - - /* - * Invoke any write traces for the variable. - */ - - if (varPtr->tracePtr != NULL) { - char *msg = CallTraces(iPtr, /*arrayPtr*/ NULL, varPtr, - varName, (char *) NULL, TCL_TRACE_WRITES); - if (msg != NULL) { - if (leaveErrorMsg) { - VarErrMsg(interp, varName, NULL, "set", msg); - } - goto cleanup; - } - } - - /* - * Return the variable's value unless the variable was changed in some - * gross way by a trace (e.g. it was unset and then recreated as an - * array). If it was changed is a gross way, just return an empty string - * object. - */ - - if (TclIsVarScalar(varPtr) && !TclIsVarUndefined(varPtr)) { - return varPtr->value.objPtr; - } - - resultPtr = Tcl_NewObj(); - - /* - * If the variable doesn't exist anymore and no-one's using it, then - * free up the relevant structures and hash table entries. - */ - - cleanup: - if (TclIsVarUndefined(varPtr)) { - CleanupVar(varPtr, NULL); - } - return resultPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclSetElementOfIndexedArray -- - * - * Change the Tcl object value of an element in a local array - * variable. The element is named by the object elemPtr while the array - * is specified by its index in the active procedure's array of - * compiler allocated local variables. - * - * Results: - * Returns a pointer to the Tcl_Obj holding the new value of the - * element. If the specified array or element doesn't exist, or there - * is a clash in array usage, or an error occurs while executing - * variable traces, then NULL is returned and a message will be left in - * the interpreter's result if leaveErrorMsg is 1. Note that the - * returned object may not be the same one referenced by newValuePtr; - * this is because variable traces may modify the variable's value. - * - * Side effects: - * The value of the given array element is set. The reference count is - * decremented for any old value of the element and incremented for its - * new value. If as a result of a variable trace the new value for the - * element is not the same one referenced by newValuePtr, then - * newValuePtr's ref count is left unchanged. The ref count for the - * returned object is _not_ incremented to reflect the returned - * reference; if you want to keep a reference to the object you must - * increment its ref count yourself. This procedure will not create new - * array variables, but only sets elements of those arrays recognized - * at compile time. However, if the entry doesn't exist then a new - * variable is created. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -TclSetElementOfIndexedArray(interp, localIndex, elemPtr, newValuePtr, - leaveErrorMsg) - Tcl_Interp *interp; /* Command interpreter in which the array is - * to be found. */ - int localIndex; /* Index of array variable in procedure's - * array of local variables. */ - Tcl_Obj *elemPtr; /* Points to an object holding the name of - * an element to set in the array. */ - Tcl_Obj *newValuePtr; /* New value for variable. */ - int leaveErrorMsg; /* 1 if to leave an error message in - * the interpreter's result on an error. - * Otherwise no error message is left. */ -{ - Interp *iPtr = (Interp *) interp; - CallFrame *varFramePtr = iPtr->varFramePtr; - /* Points to the procedure call frame whose - * variables are currently in use. Same as - * the current procedure's frame, if any, - * unless an "uplevel" is executing. */ - Var *compiledLocals = varFramePtr->compiledLocals; - Var *arrayPtr; /* Points to the array's in-frame Var - * structure. */ - char *arrayName; /* Name of the local array. */ - char *elem; - Tcl_HashEntry *hPtr; - Var *varPtr = NULL; /* Points to the element's Var structure - * that we return. */ - Tcl_Obj *resultPtr = NULL; - Tcl_Obj *oldValuePtr; - int new; - -#ifdef TCL_COMPILE_DEBUG - Proc *procPtr = varFramePtr->procPtr; - int localCt = procPtr->numCompiledLocals; - - if (compiledLocals == NULL) { - fprintf(stderr, "\nTclSetElementOfIndexedArray: can't set element of local %i in frame 0x%x, no compiled locals\n", - localIndex, (unsigned int) varFramePtr); - panic("TclSetIndexedScalar: no compiled locals in frame 0x%x", - (unsigned int) varFramePtr); - } - if ((localIndex < 0) || (localIndex >= localCt)) { - fprintf(stderr, "\nTclSetIndexedScalar: can't set elememt of local %i in frame 0x%x with %i locals\n", - localIndex, (unsigned int) varFramePtr, localCt); - panic("TclSetElementOfIndexedArray: bad local index %i in frame 0x%x", - localIndex, (unsigned int) varFramePtr); - } -#endif /* TCL_COMPILE_DEBUG */ - - elem = TclGetString(elemPtr); - arrayPtr = &(compiledLocals[localIndex]); - arrayName = arrayPtr->name; - - /* - * If arrayPtr is a link variable, we have a reference to some variable - * that was created through an "upvar" or "global" command, or we have a - * reference to a variable in an enclosing namespace. Traverse through - * any links until we find the referenced variable. - */ - - while (TclIsVarLink(arrayPtr)) { - arrayPtr = arrayPtr->value.linkPtr; - } - - /* - * If the variable is in a hashtable and its hPtr field is NULL, then we - * may have an upvar to an array element where the array was deleted - * or an upvar to a namespace variable whose namespace was deleted. - * Generate an error (allowing the variable to be reset would screw up - * our storage allocation and is meaningless anyway). - */ - - if ((arrayPtr->flags & VAR_IN_HASHTABLE) && (arrayPtr->hPtr == NULL)) { - if (leaveErrorMsg) { - if (TclIsVarArrayElement(arrayPtr)) { - VarErrMsg(interp, arrayName, elem, "set", danglingElement); - } else { - VarErrMsg(interp, arrayName, elem, "set", danglingVar); - } - } - goto errorReturn; - } - - /* - * Make sure we're dealing with an array. - */ - - if (TclIsVarUndefined(arrayPtr) && !TclIsVarArrayElement(arrayPtr)) { - TclSetVarArray(arrayPtr); - arrayPtr->value.tablePtr = - (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - Tcl_InitHashTable(arrayPtr->value.tablePtr, TCL_STRING_KEYS); - TclClearVarUndefined(arrayPtr); - } else if (!TclIsVarArray(arrayPtr)) { - if (leaveErrorMsg) { - VarErrMsg(interp, arrayName, elem, "set", needArray); - } - goto errorReturn; - } - - /* - * Look up the element. - */ - - hPtr = Tcl_CreateHashEntry(arrayPtr->value.tablePtr, elem, &new); - if (new) { - if (arrayPtr->searchPtr != NULL) { - DeleteSearches(arrayPtr); - } - varPtr = NewVar(); - Tcl_SetHashValue(hPtr, varPtr); - varPtr->hPtr = hPtr; - varPtr->nsPtr = varFramePtr->nsPtr; - TclSetVarArrayElement(varPtr); - } - varPtr = (Var *) Tcl_GetHashValue(hPtr); - - /* - * It's an error to try to set an array variable itself. - */ - - if (TclIsVarArray(varPtr)) { - if (leaveErrorMsg) { - VarErrMsg(interp, arrayName, elem, "set", isArray); - } - goto errorReturn; - } - - /* - * Set the variable's new value and discard the old one. We don't - * append with this "set" procedure so the old value isn't needed. - */ - - oldValuePtr = varPtr->value.objPtr; - if (newValuePtr != oldValuePtr) { /* set new value */ - varPtr->value.objPtr = newValuePtr; - Tcl_IncrRefCount(newValuePtr); /* var is another ref to obj */ - if (oldValuePtr != NULL) { - TclDecrRefCount(oldValuePtr); /* discard old value */ - } - } - TclSetVarScalar(varPtr); - TclClearVarUndefined(varPtr); - - /* - * Invoke any write traces for the element variable. - */ - - if ((varPtr->tracePtr != NULL) - || ((arrayPtr != NULL) && (arrayPtr->tracePtr != NULL))) { - char *msg = CallTraces(iPtr, arrayPtr, varPtr, arrayName, elem, - TCL_TRACE_WRITES); - if (msg != NULL) { - if (leaveErrorMsg) { - VarErrMsg(interp, arrayName, elem, "set", msg); - } - goto errorReturn; - } - } - - /* - * Return the element's value unless it was changed in some gross way by - * a trace (e.g. it was unset and then recreated as an array). If it was - * changed is a gross way, just return an empty string object. - */ - - if (TclIsVarScalar(varPtr) && !TclIsVarUndefined(varPtr)) { - return varPtr->value.objPtr; - } - - resultPtr = Tcl_NewObj(); - - /* - * An error. If the variable doesn't exist anymore and no-one's using - * it, then free up the relevant structures and hash table entries. - */ - - errorReturn: - if (varPtr != NULL) { - if (TclIsVarUndefined(varPtr)) { - CleanupVar(varPtr, NULL); /* note: array isn't in hashtable */ - } - } - return resultPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclIncrVar2 -- - * - * Given a two-part variable name, which may refer either to a scalar - * variable or an element of an array, increment the Tcl object value - * of the variable by a specified amount. - * - * Results: - * Returns a pointer to the Tcl_Obj holding the new value of the - * variable. If the specified variable doesn't exist, or there is a - * clash in array usage, or an error occurs while executing variable - * traces, then NULL is returned and a message will be left in - * the interpreter's result. - * - * Side effects: - * The value of the given variable is incremented by the specified - * amount. If either the array or the entry didn't exist then a new - * variable is created. The ref count for the returned object is _not_ - * incremented to reflect the returned reference; if you want to keep a - * reference to the object you must increment its ref count yourself. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -TclIncrVar2(interp, part1Ptr, part2Ptr, incrAmount, flags) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be found. */ - Tcl_Obj *part1Ptr; /* Points to an object holding the name of - * an array (if part2 is non-NULL) or the - * name of a variable. */ - Tcl_Obj *part2Ptr; /* If non-null, points to an object holding - * the name of an element in the array - * part1Ptr. */ - long incrAmount; /* Amount to be added to variable. */ - int flags; /* Various flags that tell how to incr value: - * any of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, TCL_APPEND_VALUE, - * TCL_LIST_ELEMENT, TCL_LEAVE_ERR_MSG. */ -{ - register Tcl_Obj *varValuePtr; - Tcl_Obj *resultPtr; - int createdNewObj; /* Set 1 if var's value object is shared - * so we must increment a copy (i.e. copy - * on write). */ - long i; - int result; - - varValuePtr = Tcl_ObjGetVar2(interp, part1Ptr, part2Ptr, flags); - if (varValuePtr == NULL) { - Tcl_AddObjErrorInfo(interp, - "\n (reading value of variable to increment)", -1); - return NULL; - } - - /* - * Increment the variable's value. If the object is unshared we can - * modify it directly, otherwise we must create a new copy to modify: - * this is "copy on write". Then free the variable's old string - * representation, if any, since it will no longer be valid. - */ - - createdNewObj = 0; - if (Tcl_IsShared(varValuePtr)) { - varValuePtr = Tcl_DuplicateObj(varValuePtr); - createdNewObj = 1; - } - result = Tcl_GetLongFromObj(interp, varValuePtr, &i); - if (result != TCL_OK) { - if (createdNewObj) { - Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */ - } - return NULL; - } - Tcl_SetLongObj(varValuePtr, (i + incrAmount)); - - /* - * Store the variable's new value and run any write traces. - */ - - resultPtr = Tcl_ObjSetVar2(interp, part1Ptr, part2Ptr, varValuePtr, flags); - if (resultPtr == NULL) { - return NULL; - } - return resultPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclIncrIndexedScalar -- - * - * Increments the Tcl object value of a local scalar variable in the - * active procedure, given its compile-time allocated index in the - * procedure's array of local variables. - * - * Results: - * Returns a pointer to the Tcl_Obj holding the new value of the - * variable given by localIndex. If the specified variable doesn't - * exist, or there is a clash in array usage, or an error occurs while - * executing variable traces, then NULL is returned and a message will - * be left in the interpreter's result. - * - * Side effects: - * The value of the given variable is incremented by the specified - * amount. The ref count for the returned object is _not_ incremented - * to reflect the returned reference; if you want to keep a reference - * to the object you must increment its ref count yourself. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -TclIncrIndexedScalar(interp, localIndex, incrAmount) - Tcl_Interp *interp; /* Command interpreter in which variable is - * to be found. */ - int localIndex; /* Index of variable in procedure's array - * of local variables. */ - long incrAmount; /* Amount to be added to variable. */ -{ - register Tcl_Obj *varValuePtr; - Tcl_Obj *resultPtr; - int createdNewObj; /* Set 1 if var's value object is shared - * so we must increment a copy (i.e. copy - * on write). */ - long i; - int result; - - varValuePtr = TclGetIndexedScalar(interp, localIndex, - /*leaveErrorMsg*/ 1); - if (varValuePtr == NULL) { - Tcl_AddObjErrorInfo(interp, - "\n (reading value of variable to increment)", -1); - return NULL; - } - - /* - * Reach into the object's representation to extract and increment the - * variable's value. If the object is unshared we can modify it - * directly, otherwise we must create a new copy to modify: this is - * "copy on write". Then free the variable's old string representation, - * if any, since it will no longer be valid. - */ - - createdNewObj = 0; - if (Tcl_IsShared(varValuePtr)) { - createdNewObj = 1; - varValuePtr = Tcl_DuplicateObj(varValuePtr); - } - result = Tcl_GetLongFromObj(interp, varValuePtr, &i); - if (result != TCL_OK) { - if (createdNewObj) { - Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */ - } - return NULL; - } - Tcl_SetLongObj(varValuePtr, (i + incrAmount)); - - /* - * Store the variable's new value and run any write traces. - */ - - resultPtr = TclSetIndexedScalar(interp, localIndex, varValuePtr, - /*leaveErrorMsg*/ 1); - if (resultPtr == NULL) { - return NULL; - } - return resultPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclIncrElementOfIndexedArray -- - * - * Increments the Tcl object value of an element in a local array - * variable. The element is named by the object elemPtr while the array - * is specified by its index in the active procedure's array of - * compiler allocated local variables. - * - * Results: - * Returns a pointer to the Tcl_Obj holding the new value of the - * element. If the specified array or element doesn't exist, or there - * is a clash in array usage, or an error occurs while executing - * variable traces, then NULL is returned and a message will be left in - * the interpreter's result. - * - * Side effects: - * The value of the given array element is incremented by the specified - * amount. The ref count for the returned object is _not_ incremented - * to reflect the returned reference; if you want to keep a reference - * to the object you must increment its ref count yourself. If the - * entry doesn't exist then a new variable is created. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -TclIncrElementOfIndexedArray(interp, localIndex, elemPtr, incrAmount) - Tcl_Interp *interp; /* Command interpreter in which the array is - * to be found. */ - int localIndex; /* Index of array variable in procedure's - * array of local variables. */ - Tcl_Obj *elemPtr; /* Points to an object holding the name of - * an element to increment in the array. */ - long incrAmount; /* Amount to be added to variable. */ -{ - register Tcl_Obj *varValuePtr; - Tcl_Obj *resultPtr; - int createdNewObj; /* Set 1 if var's value object is shared - * so we must increment a copy (i.e. copy - * on write). */ - long i; - int result; - - varValuePtr = TclGetElementOfIndexedArray(interp, localIndex, elemPtr, - /*leaveErrorMsg*/ 1); - if (varValuePtr == NULL) { - Tcl_AddObjErrorInfo(interp, - "\n (reading value of variable to increment)", -1); - return NULL; - } - - /* - * Reach into the object's representation to extract and increment the - * variable's value. If the object is unshared we can modify it - * directly, otherwise we must create a new copy to modify: this is - * "copy on write". Then free the variable's old string representation, - * if any, since it will no longer be valid. - */ - - createdNewObj = 0; - if (Tcl_IsShared(varValuePtr)) { - createdNewObj = 1; - varValuePtr = Tcl_DuplicateObj(varValuePtr); - } - result = Tcl_GetLongFromObj(interp, varValuePtr, &i); - if (result != TCL_OK) { - if (createdNewObj) { - Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */ - } - return NULL; - } - Tcl_SetLongObj(varValuePtr, (i + incrAmount)); - - /* - * Store the variable's new value and run any write traces. - */ - - resultPtr = TclSetElementOfIndexedArray(interp, localIndex, elemPtr, - varValuePtr, - /*leaveErrorMsg*/ 1); - if (resultPtr == NULL) { - return NULL; - } - return resultPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UnsetVar -- - * - * Delete a variable, so that it may not be accessed anymore. - * - * Results: - * Returns TCL_OK if the variable was successfully deleted, TCL_ERROR - * if the variable can't be unset. In the event of an error, - * if the TCL_LEAVE_ERR_MSG flag is set then an error message - * is left in the interp's result. - * - * Side effects: - * If varName is defined as a local or global variable in interp, - * it is deleted. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UnsetVar(interp, varName, flags) - Tcl_Interp *interp; /* Command interpreter in which varName is - * to be looked up. */ - char *varName; /* Name of a variable in interp. May be - * either a scalar name or an array name - * or an element in an array. */ - int flags; /* OR-ed combination of any of - * TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY or - * TCL_LEAVE_ERR_MSG. */ -{ - return Tcl_UnsetVar2(interp, varName, (char *) NULL, flags); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UnsetVar2 -- - * - * Delete a variable, given a 2-part name. - * - * Results: - * Returns TCL_OK if the variable was successfully deleted, TCL_ERROR - * if the variable can't be unset. In the event of an error, - * if the TCL_LEAVE_ERR_MSG flag is set then an error message - * is left in the interp's result. - * - * Side effects: - * If part1 and part2 indicate a local or global variable in interp, - * it is deleted. If part1 is an array name and part2 is NULL, then - * the whole array is deleted. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UnsetVar2(interp, part1, part2, flags) - Tcl_Interp *interp; /* Command interpreter in which varName is - * to be looked up. */ - char *part1; /* Name of variable or array. */ - char *part2; /* Name of element within array or NULL. */ - int flags; /* OR-ed combination of any of - * TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY, - * TCL_LEAVE_ERR_MSG. */ -{ - Var dummyVar; - Var *varPtr, *dummyVarPtr; - Interp *iPtr = (Interp *) interp; - Var *arrayPtr; - ActiveVarTrace *activePtr; - Tcl_Obj *objPtr; - int result; - - varPtr = TclLookupVar(interp, part1, part2, flags, "unset", - /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - if (varPtr == NULL) { - return TCL_ERROR; - } - result = (TclIsVarUndefined(varPtr)? TCL_ERROR : TCL_OK); - - if ((arrayPtr != NULL) && (arrayPtr->searchPtr != NULL)) { - DeleteSearches(arrayPtr); - } - - /* - * The code below is tricky, because of the possibility that - * a trace procedure might try to access a variable being - * deleted. To handle this situation gracefully, do things - * in three steps: - * 1. Copy the contents of the variable to a dummy variable - * structure, and mark the original Var structure as undefined. - * 2. Invoke traces and clean up the variable, using the dummy copy. - * 3. If at the end of this the original variable is still - * undefined and has no outstanding references, then delete - * it (but it could have gotten recreated by a trace). - */ - - dummyVar = *varPtr; - TclSetVarUndefined(varPtr); - TclSetVarScalar(varPtr); - varPtr->value.objPtr = NULL; /* dummyVar points to any value object */ - varPtr->tracePtr = NULL; - varPtr->searchPtr = NULL; - - /* - * Call trace procedures for the variable being deleted. Then delete - * its traces. Be sure to abort any other traces for the variable - * that are still pending. Special tricks: - * 1. We need to increment varPtr's refCount around this: CallTraces - * will use dummyVar so it won't increment varPtr's refCount itself. - * 2. Turn off the VAR_TRACE_ACTIVE flag in dummyVar: we want to - * call unset traces even if other traces are pending. - */ - - if ((dummyVar.tracePtr != NULL) - || ((arrayPtr != NULL) && (arrayPtr->tracePtr != NULL))) { - varPtr->refCount++; - dummyVar.flags &= ~VAR_TRACE_ACTIVE; - (void) CallTraces(iPtr, arrayPtr, &dummyVar, part1, part2, - (flags & (TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY)) | TCL_TRACE_UNSETS); - while (dummyVar.tracePtr != NULL) { - VarTrace *tracePtr = dummyVar.tracePtr; - dummyVar.tracePtr = tracePtr->nextPtr; - ckfree((char *) tracePtr); - } - for (activePtr = iPtr->activeTracePtr; activePtr != NULL; - activePtr = activePtr->nextPtr) { - if (activePtr->varPtr == varPtr) { - activePtr->nextTracePtr = NULL; - } - } - varPtr->refCount--; - } - - /* - * If the variable is an array, delete all of its elements. This must be - * done after calling the traces on the array, above (that's the way - * traces are defined). If it is a scalar, "discard" its object - * (decrement the ref count of its object, if any). - */ - - dummyVarPtr = &dummyVar; - if (TclIsVarArray(dummyVarPtr) && !TclIsVarUndefined(dummyVarPtr)) { - DeleteArray(iPtr, part1, dummyVarPtr, - (flags & (TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY)) | TCL_TRACE_UNSETS); - } - if (TclIsVarScalar(dummyVarPtr) - && (dummyVarPtr->value.objPtr != NULL)) { - objPtr = dummyVarPtr->value.objPtr; - TclDecrRefCount(objPtr); - dummyVarPtr->value.objPtr = NULL; - } - - /* - * If the variable was a namespace variable, decrement its reference count. - */ - - if (varPtr->flags & VAR_NAMESPACE_VAR) { - varPtr->flags &= ~VAR_NAMESPACE_VAR; - varPtr->refCount--; - } - - /* - * It's an error to unset an undefined variable. - */ - - if (result != TCL_OK) { - if (flags & TCL_LEAVE_ERR_MSG) { - VarErrMsg(interp, part1, part2, "unset", - ((arrayPtr == NULL) ? noSuchVar : noSuchElement)); - } - } - - /* - * Finally, if the variable is truly not in use then free up its Var - * structure and remove it from its hash table, if any. The ref count of - * its value object, if any, was decremented above. - */ - - CleanupVar(varPtr, arrayPtr); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_TraceVar -- - * - * Arrange for reads and/or writes to a variable to cause a - * procedure to be invoked, which can monitor the operations - * and/or change their actions. - * - * Results: - * A standard Tcl return value. - * - * Side effects: - * A trace is set up on the variable given by varName, such that - * future references to the variable will be intermediated by - * proc. See the manual entry for complete details on the calling - * sequence for proc. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_TraceVar(interp, varName, flags, proc, clientData) - Tcl_Interp *interp; /* Interpreter in which variable is - * to be traced. */ - char *varName; /* Name of variable; may end with "(index)" - * to signify an array reference. */ - int flags; /* OR-ed collection of bits, including any - * of TCL_TRACE_READS, TCL_TRACE_WRITES, - * TCL_TRACE_UNSETS, TCL_GLOBAL_ONLY, and - * TCL_NAMESPACE_ONLY. */ - Tcl_VarTraceProc *proc; /* Procedure to call when specified ops are - * invoked upon varName. */ - ClientData clientData; /* Arbitrary argument to pass to proc. */ -{ - return Tcl_TraceVar2(interp, varName, (char *) NULL, - flags, proc, clientData); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_TraceVar2 -- - * - * Arrange for reads and/or writes to a variable to cause a - * procedure to be invoked, which can monitor the operations - * and/or change their actions. - * - * Results: - * A standard Tcl return value. - * - * Side effects: - * A trace is set up on the variable given by part1 and part2, such - * that future references to the variable will be intermediated by - * proc. See the manual entry for complete details on the calling - * sequence for proc. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_TraceVar2(interp, part1, part2, flags, proc, clientData) - Tcl_Interp *interp; /* Interpreter in which variable is - * to be traced. */ - char *part1; /* Name of scalar variable or array. */ - char *part2; /* Name of element within array; NULL means - * trace applies to scalar variable or array - * as-a-whole. */ - int flags; /* OR-ed collection of bits, including any - * of TCL_TRACE_READS, TCL_TRACE_WRITES, - * TCL_TRACE_UNSETS, TCL_GLOBAL_ONLY, - * and TCL_NAMESPACE_ONLY. */ - Tcl_VarTraceProc *proc; /* Procedure to call when specified ops are - * invoked upon varName. */ - ClientData clientData; /* Arbitrary argument to pass to proc. */ -{ - Var *varPtr, *arrayPtr; - register VarTrace *tracePtr; - - varPtr = TclLookupVar(interp, part1, part2, (flags | TCL_LEAVE_ERR_MSG), - "trace", /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); - if (varPtr == NULL) { - return TCL_ERROR; - } - - /* - * Set up trace information. - */ - - tracePtr = (VarTrace *) ckalloc(sizeof(VarTrace)); - tracePtr->traceProc = proc; - tracePtr->clientData = clientData; - tracePtr->flags = - flags & (TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS | - TCL_TRACE_ARRAY); - tracePtr->nextPtr = varPtr->tracePtr; - varPtr->tracePtr = tracePtr; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UntraceVar -- - * - * Remove a previously-created trace for a variable. - * - * Results: - * None. - * - * Side effects: - * If there exists a trace for the variable given by varName - * with the given flags, proc, and clientData, then that trace - * is removed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_UntraceVar(interp, varName, flags, proc, clientData) - Tcl_Interp *interp; /* Interpreter containing variable. */ - char *varName; /* Name of variable; may end with "(index)" - * to signify an array reference. */ - int flags; /* OR-ed collection of bits describing - * current trace, including any of - * TCL_TRACE_READS, TCL_TRACE_WRITES, - * TCL_TRACE_UNSETS, TCL_GLOBAL_ONLY - * and TCL_NAMESPACE_ONLY. */ - Tcl_VarTraceProc *proc; /* Procedure assocated with trace. */ - ClientData clientData; /* Arbitrary argument to pass to proc. */ -{ - Tcl_UntraceVar2(interp, varName, (char *) NULL, flags, proc, clientData); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UntraceVar2 -- - * - * Remove a previously-created trace for a variable. - * - * Results: - * None. - * - * Side effects: - * If there exists a trace for the variable given by part1 - * and part2 with the given flags, proc, and clientData, then - * that trace is removed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_UntraceVar2(interp, part1, part2, flags, proc, clientData) - Tcl_Interp *interp; /* Interpreter containing variable. */ - char *part1; /* Name of variable or array. */ - char *part2; /* Name of element within array; NULL means - * trace applies to scalar variable or array - * as-a-whole. */ - int flags; /* OR-ed collection of bits describing - * current trace, including any of - * TCL_TRACE_READS, TCL_TRACE_WRITES, - * TCL_TRACE_UNSETS, TCL_GLOBAL_ONLY, - * and TCL_NAMESPACE_ONLY. */ - Tcl_VarTraceProc *proc; /* Procedure assocated with trace. */ - ClientData clientData; /* Arbitrary argument to pass to proc. */ -{ - register VarTrace *tracePtr; - VarTrace *prevPtr; - Var *varPtr, *arrayPtr; - Interp *iPtr = (Interp *) interp; - ActiveVarTrace *activePtr; - - varPtr = TclLookupVar(interp, part1, part2, - flags & (TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY), - /*msg*/ (char *) NULL, - /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - if (varPtr == NULL) { - return; - } - - flags &= (TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS | - TCL_TRACE_ARRAY); - for (tracePtr = varPtr->tracePtr, prevPtr = NULL; ; - prevPtr = tracePtr, tracePtr = tracePtr->nextPtr) { - if (tracePtr == NULL) { - return; - } - if ((tracePtr->traceProc == proc) && (tracePtr->flags == flags) - && (tracePtr->clientData == clientData)) { - break; - } - } - - /* - * The code below makes it possible to delete traces while traces - * are active: it makes sure that the deleted trace won't be - * processed by CallTraces. - */ - - for (activePtr = iPtr->activeTracePtr; activePtr != NULL; - activePtr = activePtr->nextPtr) { - if (activePtr->nextTracePtr == tracePtr) { - activePtr->nextTracePtr = tracePtr->nextPtr; - } - } - if (prevPtr == NULL) { - varPtr->tracePtr = tracePtr->nextPtr; - } else { - prevPtr->nextPtr = tracePtr->nextPtr; - } - ckfree((char *) tracePtr); - - /* - * If this is the last trace on the variable, and the variable is - * unset and unused, then free up the variable. - */ - - if (TclIsVarUndefined(varPtr)) { - CleanupVar(varPtr, (Var *) NULL); - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_VarTraceInfo -- - * - * Return the clientData value associated with a trace on a - * variable. This procedure can also be used to step through - * all of the traces on a particular variable that have the - * same trace procedure. - * - * Results: - * The return value is the clientData value associated with - * a trace on the given variable. Information will only be - * returned for a trace with proc as trace procedure. If - * the clientData argument is NULL then the first such trace is - * returned; otherwise, the next relevant one after the one - * given by clientData will be returned. If the variable - * doesn't exist, or if there are no (more) traces for it, - * then NULL is returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -ClientData -Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData) - Tcl_Interp *interp; /* Interpreter containing variable. */ - char *varName; /* Name of variable; may end with "(index)" - * to signify an array reference. */ - int flags; /* 0, TCL_GLOBAL_ONLY, or - * TCL_NAMESPACE_ONLY. */ - Tcl_VarTraceProc *proc; /* Procedure assocated with trace. */ - ClientData prevClientData; /* If non-NULL, gives last value returned - * by this procedure, so this call will - * return the next trace after that one. - * If NULL, this call will return the - * first trace. */ -{ - return Tcl_VarTraceInfo2(interp, varName, (char *) NULL, - flags, proc, prevClientData); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_VarTraceInfo2 -- - * - * Same as Tcl_VarTraceInfo, except takes name in two pieces - * instead of one. - * - * Results: - * Same as Tcl_VarTraceInfo. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -ClientData -Tcl_VarTraceInfo2(interp, part1, part2, flags, proc, prevClientData) - Tcl_Interp *interp; /* Interpreter containing variable. */ - char *part1; /* Name of variable or array. */ - char *part2; /* Name of element within array; NULL means - * trace applies to scalar variable or array - * as-a-whole. */ - int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY. */ - Tcl_VarTraceProc *proc; /* Procedure assocated with trace. */ - ClientData prevClientData; /* If non-NULL, gives last value returned - * by this procedure, so this call will - * return the next trace after that one. - * If NULL, this call will return the - * first trace. */ -{ - register VarTrace *tracePtr; - Var *varPtr, *arrayPtr; - - varPtr = TclLookupVar(interp, part1, part2, - flags & (TCL_GLOBAL_ONLY|TCL_NAMESPACE_ONLY), - /*msg*/ (char *) NULL, - /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - if (varPtr == NULL) { - return NULL; - } - - /* - * Find the relevant trace, if any, and return its clientData. - */ - - tracePtr = varPtr->tracePtr; - if (prevClientData != NULL) { - for ( ; tracePtr != NULL; tracePtr = tracePtr->nextPtr) { - if ((tracePtr->clientData == prevClientData) - && (tracePtr->traceProc == proc)) { - tracePtr = tracePtr->nextPtr; - break; - } - } - } - for ( ; tracePtr != NULL; tracePtr = tracePtr->nextPtr) { - if (tracePtr->traceProc == proc) { - return tracePtr->clientData; - } - } - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UnsetObjCmd -- - * - * This object-based procedure is invoked to process the "unset" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_UnsetObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register int i; - register char *name; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "varName ?varName ...?"); - return TCL_ERROR; - } - - for (i = 1; i < objc; i++) { - name = TclGetString(objv[i]); - if (Tcl_UnsetVar2(interp, name, (char *) NULL, - TCL_LEAVE_ERR_MSG) != TCL_OK) { - return TCL_ERROR; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AppendObjCmd -- - * - * This object-based procedure is invoked to process the "append" - * Tcl command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * A variable's value may be changed. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_AppendObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Tcl_Obj *varValuePtr = NULL; - /* Initialized to avoid compiler - * warning. */ - int i; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "varName ?value value ...?"); - return TCL_ERROR; - } - if (objc == 2) { - varValuePtr = Tcl_ObjGetVar2(interp, objv[1], NULL, TCL_LEAVE_ERR_MSG); - if (varValuePtr == NULL) { - return TCL_ERROR; - } - } else { - for (i = 2; i < objc; i++) { - varValuePtr = Tcl_ObjSetVar2(interp, objv[1], (Tcl_Obj *) NULL, - objv[i], (TCL_APPEND_VALUE | TCL_LEAVE_ERR_MSG)); - if (varValuePtr == NULL) { - return TCL_ERROR; - } - } - } - Tcl_SetObjResult(interp, varValuePtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LappendObjCmd -- - * - * This object-based procedure is invoked to process the "lappend" - * Tcl command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * A variable's value may be changed. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_LappendObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Tcl_Obj *varValuePtr, *newValuePtr; - register List *listRepPtr; - register Tcl_Obj **elemPtrs; - int numElems, numRequired, createdNewObj, createVar, i, j; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "varName ?value value ...?"); - return TCL_ERROR; - } - if (objc == 2) { - newValuePtr = Tcl_ObjGetVar2(interp, objv[1], (Tcl_Obj *) NULL, - (TCL_LEAVE_ERR_MSG)); - if (newValuePtr == NULL) { - /* - * The variable doesn't exist yet. Just create it with an empty - * initial value. - */ - - Tcl_Obj *nullObjPtr = Tcl_NewObj(); - newValuePtr = Tcl_ObjSetVar2(interp, objv[1], NULL, - nullObjPtr, TCL_LEAVE_ERR_MSG); - if (newValuePtr == NULL) { - Tcl_DecrRefCount(nullObjPtr); /* free unneeded object */ - return TCL_ERROR; - } - } - } else { - /* - * We have arguments to append. We used to call Tcl_SetVar2 to - * append each argument one at a time to ensure that traces were run - * for each append step. We now append the arguments all at once - * because it's faster. Note that a read trace and a write trace for - * the variable will now each only be called once. Also, if the - * variable's old value is unshared we modify it directly, otherwise - * we create a new copy to modify: this is "copy on write". - */ - - createdNewObj = 0; - createVar = 1; - varValuePtr = Tcl_ObjGetVar2(interp, objv[1], NULL, 0); - if (varValuePtr == NULL) { - /* - * We couldn't read the old value: either the var doesn't yet - * exist or it's an array element. If it's new, we will try to - * create it with Tcl_ObjSetVar2 below. - */ - - char *p, *varName; - int nameBytes, i; - - varName = Tcl_GetStringFromObj(objv[1], &nameBytes); - for (i = 0, p = varName; i < nameBytes; i++, p++) { - if (*p == '(') { - p = (varName + nameBytes-1); - if (*p == ')') { /* last char is ')' => array ref */ - createVar = 0; - } - break; - } - } - varValuePtr = Tcl_NewObj(); - createdNewObj = 1; - } else if (Tcl_IsShared(varValuePtr)) { - varValuePtr = Tcl_DuplicateObj(varValuePtr); - createdNewObj = 1; - } - - /* - * Convert the variable's old value to a list object if necessary. - */ - - if (varValuePtr->typePtr != &tclListType) { - int result = tclListType.setFromAnyProc(interp, varValuePtr); - if (result != TCL_OK) { - if (createdNewObj) { - Tcl_DecrRefCount(varValuePtr); /* free unneeded obj. */ - } - return result; - } - } - listRepPtr = (List *) varValuePtr->internalRep.otherValuePtr; - elemPtrs = listRepPtr->elements; - numElems = listRepPtr->elemCount; - - /* - * If there is no room in the current array of element pointers, - * allocate a new, larger array and copy the pointers to it. - */ - - numRequired = numElems + (objc-2); - if (numRequired > listRepPtr->maxElemCount) { - int newMax = (2 * numRequired); - Tcl_Obj **newElemPtrs = (Tcl_Obj **) - ckalloc((unsigned) (newMax * sizeof(Tcl_Obj *))); - - memcpy((VOID *) newElemPtrs, (VOID *) elemPtrs, - (size_t) (numElems * sizeof(Tcl_Obj *))); - listRepPtr->maxElemCount = newMax; - listRepPtr->elements = newElemPtrs; - ckfree((char *) elemPtrs); - elemPtrs = newElemPtrs; - } - - /* - * Insert the new elements at the end of the list. - */ - - for (i = 2, j = numElems; i < objc; i++, j++) { - elemPtrs[j] = objv[i]; - Tcl_IncrRefCount(objv[i]); - } - listRepPtr->elemCount = numRequired; - - /* - * Invalidate and free any old string representation since it no - * longer reflects the list's internal representation. - */ - - Tcl_InvalidateStringRep(varValuePtr); - - /* - * Now store the list object back into the variable. If there is an - * error setting the new value, decrement its ref count if it - * was new and we didn't create the variable. - */ - - newValuePtr = Tcl_ObjSetVar2(interp, objv[1], NULL, varValuePtr, - TCL_LEAVE_ERR_MSG); - if (newValuePtr == NULL) { - if (createdNewObj && !createVar) { - Tcl_DecrRefCount(varValuePtr); /* free unneeded obj */ - } - return TCL_ERROR; - } - } - - /* - * Set the interpreter's object result to refer to the variable's value - * object. - */ - - Tcl_SetObjResult(interp, newValuePtr); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ArrayObjCmd -- - * - * This object-based procedure is invoked to process the "array" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result object. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_ArrayObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - /* - * The list of constants below should match the arrayOptions string array - * below. - */ - - enum {ARRAY_ANYMORE, ARRAY_DONESEARCH, ARRAY_EXISTS, ARRAY_GET, - ARRAY_NAMES, ARRAY_NEXTELEMENT, ARRAY_SET, ARRAY_SIZE, - ARRAY_STARTSEARCH}; - static char *arrayOptions[] = {"anymore", "donesearch", "exists", - "get", "names", "nextelement", "set", - "size", "startsearch", (char *) NULL}; - - Interp *iPtr = (Interp *) interp; - Var *varPtr, *arrayPtr; - Tcl_HashEntry *hPtr; - Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); - int notArray; - char *varName, *msg; - int index, result; - - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 1, objv, "option arrayName ?arg ...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], arrayOptions, "option", - 0, &index) != TCL_OK) { - return TCL_ERROR; - } - - /* - * Locate the array variable (and it better be an array). - */ - - varName = TclGetString(objv[2]); - varPtr = TclLookupVar(interp, varName, (char *) NULL, /*flags*/ 0, - /*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - - notArray = 0; - if ((varPtr == NULL) || !TclIsVarArray(varPtr) - || TclIsVarUndefined(varPtr)) { - notArray = 1; - } - - /* - * Special array trace used to keep the env array in sync for - * array names, array get, etc. - */ - - if (varPtr != NULL && varPtr->tracePtr != NULL) { - msg = CallTraces(iPtr, arrayPtr, varPtr, varName, NULL, - (TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY| - TCL_TRACE_ARRAY)); - if (msg != NULL) { - VarErrMsg(interp, varName, NULL, "trace array", msg); - return TCL_ERROR; - } - } - - switch (index) { - case ARRAY_ANYMORE: { - ArraySearch *searchPtr; - char *searchId; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, - "arrayName searchId"); - return TCL_ERROR; - } - if (notArray) { - goto error; - } - searchId = Tcl_GetString(objv[3]); - searchPtr = ParseSearchId(interp, varPtr, varName, searchId); - if (searchPtr == NULL) { - return TCL_ERROR; - } - while (1) { - Var *varPtr2; - - if (searchPtr->nextEntry != NULL) { - varPtr2 = (Var *) Tcl_GetHashValue(searchPtr->nextEntry); - if (!TclIsVarUndefined(varPtr2)) { - break; - } - } - searchPtr->nextEntry = Tcl_NextHashEntry(&searchPtr->search); - if (searchPtr->nextEntry == NULL) { - Tcl_SetIntObj(resultPtr, 0); - return TCL_OK; - } - } - Tcl_SetIntObj(resultPtr, 1); - break; - } - case ARRAY_DONESEARCH: { - ArraySearch *searchPtr, *prevPtr; - char *searchId; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, - "arrayName searchId"); - return TCL_ERROR; - } - if (notArray) { - goto error; - } - searchId = Tcl_GetString(objv[3]); - searchPtr = ParseSearchId(interp, varPtr, varName, searchId); - if (searchPtr == NULL) { - return TCL_ERROR; - } - if (varPtr->searchPtr == searchPtr) { - varPtr->searchPtr = searchPtr->nextPtr; - } else { - for (prevPtr = varPtr->searchPtr; ; - prevPtr = prevPtr->nextPtr) { - if (prevPtr->nextPtr == searchPtr) { - prevPtr->nextPtr = searchPtr->nextPtr; - break; - } - } - } - ckfree((char *) searchPtr); - break; - } - case ARRAY_EXISTS: { - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "arrayName"); - return TCL_ERROR; - } - Tcl_SetIntObj(resultPtr, !notArray); - break; - } - case ARRAY_GET: { - Tcl_HashSearch search; - Var *varPtr2; - char *pattern = NULL; - char *name; - Tcl_Obj *namePtr, *valuePtr; - - if ((objc != 3) && (objc != 4)) { - Tcl_WrongNumArgs(interp, 2, objv, "arrayName ?pattern?"); - return TCL_ERROR; - } - if (notArray) { - return TCL_OK; - } - if (objc == 4) { - pattern = TclGetString(objv[3]); - } - for (hPtr = Tcl_FirstHashEntry(varPtr->value.tablePtr, &search); - hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - varPtr2 = (Var *) Tcl_GetHashValue(hPtr); - if (TclIsVarUndefined(varPtr2)) { - continue; - } - name = Tcl_GetHashKey(varPtr->value.tablePtr, hPtr); - if ((objc == 4) && !Tcl_StringMatch(name, pattern)) { - continue; /* element name doesn't match pattern */ - } - - namePtr = Tcl_NewStringObj(name, -1); - result = Tcl_ListObjAppendElement(interp, resultPtr, - namePtr); - if (result != TCL_OK) { - Tcl_DecrRefCount(namePtr); /* free unneeded name obj */ - return result; - } - - valuePtr = Tcl_ObjGetVar2(interp, objv[2], namePtr, - TCL_LEAVE_ERR_MSG); - if (valuePtr == NULL) { - Tcl_DecrRefCount(namePtr); /* free unneeded name obj */ - return result; - } - result = Tcl_ListObjAppendElement(interp, resultPtr, - valuePtr); - if (result != TCL_OK) { - Tcl_DecrRefCount(namePtr); /* free unneeded name obj */ - return result; - } - } - break; - } - case ARRAY_NAMES: { - Tcl_HashSearch search; - Var *varPtr2; - char *pattern = NULL; - char *name; - Tcl_Obj *namePtr; - - if ((objc != 3) && (objc != 4)) { - Tcl_WrongNumArgs(interp, 2, objv, "arrayName ?pattern?"); - return TCL_ERROR; - } - if (notArray) { - return TCL_OK; - } - if (objc == 4) { - pattern = Tcl_GetString(objv[3]); - } - for (hPtr = Tcl_FirstHashEntry(varPtr->value.tablePtr, &search); - hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - varPtr2 = (Var *) Tcl_GetHashValue(hPtr); - if (TclIsVarUndefined(varPtr2)) { - continue; - } - name = Tcl_GetHashKey(varPtr->value.tablePtr, hPtr); - if ((objc == 4) && !Tcl_StringMatch(name, pattern)) { - continue; /* element name doesn't match pattern */ - } - - namePtr = Tcl_NewStringObj(name, -1); - result = Tcl_ListObjAppendElement(interp, resultPtr, namePtr); - if (result != TCL_OK) { - Tcl_DecrRefCount(namePtr); /* free unneeded name obj */ - return result; - } - } - break; - } - case ARRAY_NEXTELEMENT: { - ArraySearch *searchPtr; - char *searchId; - Tcl_HashEntry *hPtr; - - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, - "arrayName searchId"); - return TCL_ERROR; - } - if (notArray) { - goto error; - } - searchId = Tcl_GetString(objv[3]); - searchPtr = ParseSearchId(interp, varPtr, varName, searchId); - if (searchPtr == NULL) { - return TCL_ERROR; - } - while (1) { - Var *varPtr2; - - hPtr = searchPtr->nextEntry; - if (hPtr == NULL) { - hPtr = Tcl_NextHashEntry(&searchPtr->search); - if (hPtr == NULL) { - return TCL_OK; - } - } else { - searchPtr->nextEntry = NULL; - } - varPtr2 = (Var *) Tcl_GetHashValue(hPtr); - if (!TclIsVarUndefined(varPtr2)) { - break; - } - } - Tcl_SetStringObj(resultPtr, - Tcl_GetHashKey(varPtr->value.tablePtr, hPtr), -1); - break; - } - case ARRAY_SET: { - if (objc != 4) { - Tcl_WrongNumArgs(interp, 2, objv, "arrayName list"); - return TCL_ERROR; - } - return(TclArraySet(interp, objv[2], objv[3])); - } - case ARRAY_SIZE: { - Tcl_HashSearch search; - Var *varPtr2; - int size; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "arrayName"); - return TCL_ERROR; - } - size = 0; - if (!notArray) { - for (hPtr = Tcl_FirstHashEntry(varPtr->value.tablePtr, - &search); - hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - varPtr2 = (Var *) Tcl_GetHashValue(hPtr); - if (TclIsVarUndefined(varPtr2)) { - continue; - } - size++; - } - } - Tcl_SetIntObj(resultPtr, size); - break; - } - case ARRAY_STARTSEARCH: { - ArraySearch *searchPtr; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "arrayName"); - return TCL_ERROR; - } - if (notArray) { - goto error; - } - searchPtr = (ArraySearch *) ckalloc(sizeof(ArraySearch)); - if (varPtr->searchPtr == NULL) { - searchPtr->id = 1; - Tcl_AppendStringsToObj(resultPtr, "s-1-", varName, - (char *) NULL); - } else { - char string[TCL_INTEGER_SPACE]; - - searchPtr->id = varPtr->searchPtr->id + 1; - TclFormatInt(string, searchPtr->id); - Tcl_AppendStringsToObj(resultPtr, "s-", string, "-", varName, - (char *) NULL); - } - searchPtr->varPtr = varPtr; - searchPtr->nextEntry = Tcl_FirstHashEntry(varPtr->value.tablePtr, - &searchPtr->search); - searchPtr->nextPtr = varPtr->searchPtr; - varPtr->searchPtr = searchPtr; - break; - } - } - return TCL_OK; - - error: - Tcl_AppendStringsToObj(resultPtr, "\"", varName, "\" isn't an array", - (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * TclArraySet -- - * - * Set the elements of an array. If there are no elements to - * set, create an empty array. This routine is used by the - * Tcl_ArrayObjCmd and by the TclSetupEnv routine. - * - * Results: - * A standard Tcl result object. - * - * Side effects: - * A variable will be created if one does not already exist. - * - *---------------------------------------------------------------------- - */ - -int -TclArraySet(interp, arrayNameObj, arrayElemObj) - Tcl_Interp *interp; /* Current interpreter. */ - Tcl_Obj *arrayNameObj; /* The array name. */ - Tcl_Obj *arrayElemObj; /* The array elements list. If this is - * NULL, create an empty array. */ -{ - Var *varPtr, *arrayPtr; - Tcl_Obj **elemPtrs; - int result, elemLen, i; - char *varName; - - varName = TclGetString(arrayNameObj); - varPtr = TclLookupVar(interp, varName, (char *) NULL, /*flags*/ 0, - /*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); - - if (arrayElemObj != NULL) { - result = Tcl_ListObjGetElements(interp, arrayElemObj, - &elemLen, &elemPtrs); - if (result != TCL_OK) { - return result; - } - if (elemLen & 1) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "list must have an even number of elements", -1); - return TCL_ERROR; - } - if (elemLen > 0) { - for (i = 0; i < elemLen; i += 2) { - if (Tcl_ObjSetVar2(interp, arrayNameObj, elemPtrs[i], - elemPtrs[i+1], TCL_LEAVE_ERR_MSG) == NULL) { - result = TCL_ERROR; - break; - } - } - return result; - } - } - - /* - * The list is empty make sure we have an array, or create - * one if necessary. - */ - - if (varPtr != NULL) { - if (!TclIsVarUndefined(varPtr) && TclIsVarArray(varPtr)) { - /* - * Already an array, done. - */ - - return TCL_OK; - } - if (TclIsVarArrayElement(varPtr) || - !TclIsVarUndefined(varPtr)) { - /* - * Either an array element, or a scalar: lose! - */ - - VarErrMsg(interp, varName, (char *)NULL, "array set", needArray); - return TCL_ERROR; - } - } else { - /* - * Create variable for new array. - */ - - varPtr = TclLookupVar(interp, varName, (char *) NULL, 0, 0, - /*createPart1*/ 1, /*createPart2*/ 0, &arrayPtr); - } - TclSetVarArray(varPtr); - TclClearVarUndefined(varPtr); - varPtr->value.tablePtr = - (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - Tcl_InitHashTable(varPtr->value.tablePtr, TCL_STRING_KEYS); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * MakeUpvar -- - * - * This procedure does all of the work of the "global" and "upvar" - * commands. - * - * Results: - * A standard Tcl completion code. If an error occurs then an - * error message is left in iPtr->result. - * - * Side effects: - * The variable given by myName is linked to the variable in framePtr - * given by otherP1 and otherP2, so that references to myName are - * redirected to the other variable like a symbolic link. - * - *---------------------------------------------------------------------- - */ - -static int -MakeUpvar(iPtr, framePtr, otherP1, otherP2, otherFlags, myName, myFlags) - Interp *iPtr; /* Interpreter containing variables. Used - * for error messages, too. */ - CallFrame *framePtr; /* Call frame containing "other" variable. - * NULL means use global :: context. */ - char *otherP1, *otherP2; /* Two-part name of variable in framePtr. */ - int otherFlags; /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY: - * indicates scope of "other" variable. */ - char *myName; /* Name of variable which will refer to - * otherP1/otherP2. Must be a scalar. */ - int myFlags; /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY: - * indicates scope of myName. */ -{ - Tcl_HashEntry *hPtr; - Var *otherPtr, *varPtr, *arrayPtr; - CallFrame *varFramePtr; - CallFrame *savedFramePtr = NULL; /* Init. to avoid compiler warning. */ - Tcl_HashTable *tablePtr; - Namespace *nsPtr, *altNsPtr, *dummyNsPtr; - char *tail; - int new; - - /* - * Find "other" in "framePtr". If not looking up other in just the - * current namespace, temporarily replace the current var frame - * pointer in the interpreter in order to use TclLookupVar. - */ - - if (!(otherFlags & TCL_NAMESPACE_ONLY)) { - savedFramePtr = iPtr->varFramePtr; - iPtr->varFramePtr = framePtr; - } - otherPtr = TclLookupVar((Tcl_Interp *) iPtr, otherP1, otherP2, - (otherFlags | TCL_LEAVE_ERR_MSG), "access", - /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); - if (!(otherFlags & TCL_NAMESPACE_ONLY)) { - iPtr->varFramePtr = savedFramePtr; - } - if (otherPtr == NULL) { - return TCL_ERROR; - } - - /* - * Now create a hashtable entry for "myName". Create it as either a - * namespace variable or as a local variable in a procedure call - * frame. Interpret myName as a namespace variable if: - * 1) so requested by a TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY flag, - * 2) there is no active frame (we're at the global :: scope), - * 3) the active frame was pushed to define the namespace context - * for a "namespace eval" or "namespace inscope" command, - * 4) the name has namespace qualifiers ("::"s). - * If creating myName in the active procedure, look first in the - * frame's array of compiler-allocated local variables, then in its - * hashtable for runtime-created local variables. Create that - * procedure's local variable hashtable if necessary. - */ - - varFramePtr = iPtr->varFramePtr; - if ((myFlags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY)) - || (varFramePtr == NULL) - || !varFramePtr->isProcCallFrame - || (strstr(myName, "::") != NULL)) { - TclGetNamespaceForQualName((Tcl_Interp *) iPtr, myName, - (Namespace *) NULL, myFlags, &nsPtr, &altNsPtr, &dummyNsPtr, &tail); - - if (nsPtr == NULL) { - nsPtr = altNsPtr; - } - if (nsPtr == NULL) { - Tcl_AppendResult((Tcl_Interp *) iPtr, "bad variable name \"", - myName, "\": unknown namespace", (char *) NULL); - return TCL_ERROR; - } - - /* - * Check that we are not trying to create a namespace var linked to - * a local variable in a procedure. If we allowed this, the local - * variable in the shorter-lived procedure frame could go away - * leaving the namespace var's reference invalid. - */ - - if ((otherP2 ? arrayPtr->nsPtr : otherPtr->nsPtr) == NULL) { - Tcl_AppendResult((Tcl_Interp *) iPtr, "bad variable name \"", - myName, "\": upvar won't create namespace variable that refers to procedure variable", - (char *) NULL); - return TCL_ERROR; - } - - hPtr = Tcl_CreateHashEntry(&nsPtr->varTable, tail, &new); - if (new) { - varPtr = NewVar(); - Tcl_SetHashValue(hPtr, varPtr); - varPtr->hPtr = hPtr; - varPtr->nsPtr = nsPtr; - } else { - varPtr = (Var *) Tcl_GetHashValue(hPtr); - } - } else { /* look in the call frame */ - Proc *procPtr = varFramePtr->procPtr; - int localCt = procPtr->numCompiledLocals; - CompiledLocal *localPtr = procPtr->firstLocalPtr; - Var *localVarPtr = varFramePtr->compiledLocals; - int nameLen = strlen(myName); - int i; - - varPtr = NULL; - for (i = 0; i < localCt; i++) { - if (!TclIsVarTemporary(localPtr)) { - char *localName = localVarPtr->name; - if ((myName[0] == localName[0]) - && (nameLen == localPtr->nameLength) - && (strcmp(myName, localName) == 0)) { - varPtr = localVarPtr; - new = 0; - break; - } - } - localVarPtr++; - localPtr = localPtr->nextPtr; - } - if (varPtr == NULL) { /* look in frame's local var hashtable */ - tablePtr = varFramePtr->varTablePtr; - if (tablePtr == NULL) { - tablePtr = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - Tcl_InitHashTable(tablePtr, TCL_STRING_KEYS); - varFramePtr->varTablePtr = tablePtr; - } - hPtr = Tcl_CreateHashEntry(tablePtr, myName, &new); - if (new) { - varPtr = NewVar(); - Tcl_SetHashValue(hPtr, varPtr); - varPtr->hPtr = hPtr; - varPtr->nsPtr = varFramePtr->nsPtr; - } else { - varPtr = (Var *) Tcl_GetHashValue(hPtr); - } - } - } - - if (!new) { - /* - * The variable already exists. Make sure this variable "varPtr" - * isn't the same as "otherPtr" (avoid circular links). Also, if - * it's not an upvar then it's an error. If it is an upvar, then - * just disconnect it from the thing it currently refers to. - */ - - if (varPtr == otherPtr) { - Tcl_SetResult((Tcl_Interp *) iPtr, - "can't upvar from variable to itself", TCL_STATIC); - return TCL_ERROR; - } - if (TclIsVarLink(varPtr)) { - Var *linkPtr = varPtr->value.linkPtr; - if (linkPtr == otherPtr) { - return TCL_OK; - } - linkPtr->refCount--; - if (TclIsVarUndefined(linkPtr)) { - CleanupVar(linkPtr, (Var *) NULL); - } - } else if (!TclIsVarUndefined(varPtr)) { - Tcl_AppendResult((Tcl_Interp *) iPtr, "variable \"", myName, - "\" already exists", (char *) NULL); - return TCL_ERROR; - } else if (varPtr->tracePtr != NULL) { - Tcl_AppendResult((Tcl_Interp *) iPtr, "variable \"", myName, - "\" has traces: can't use for upvar", (char *) NULL); - return TCL_ERROR; - } - } - TclSetVarLink(varPtr); - TclClearVarUndefined(varPtr); - varPtr->value.linkPtr = otherPtr; - otherPtr->refCount++; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UpVar -- - * - * This procedure links one variable to another, just like - * the "upvar" command. - * - * Results: - * A standard Tcl completion code. If an error occurs then - * an error message is left in the interp's result. - * - * Side effects: - * The variable in frameName whose name is given by varName becomes - * accessible under the name localName, so that references to - * localName are redirected to the other variable like a symbolic - * link. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UpVar(interp, frameName, varName, localName, flags) - Tcl_Interp *interp; /* Command interpreter in which varName is - * to be looked up. */ - char *frameName; /* Name of the frame containing the source - * variable, such as "1" or "#0". */ - char *varName; /* Name of a variable in interp to link to. - * May be either a scalar name or an - * element in an array. */ - char *localName; /* Name of link variable. */ - int flags; /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY: - * indicates scope of localName. */ -{ - int result; - CallFrame *framePtr; - register char *p; - - result = TclGetFrame(interp, frameName, &framePtr); - if (result == -1) { - return TCL_ERROR; - } - - /* - * Figure out whether varName is an array reference, then call - * MakeUpvar to do all the real work. - */ - - for (p = varName; *p != '\0'; p++) { - if (*p == '(') { - char *openParen = p; - do { - p++; - } while (*p != '\0'); - p--; - if (*p != ')') { - goto scalar; - } - *openParen = '\0'; - *p = '\0'; - result = MakeUpvar((Interp *) interp, framePtr, varName, - openParen+1, 0, localName, flags); - *openParen = '('; - *p = ')'; - return result; - } - } - - scalar: - return MakeUpvar((Interp *) interp, framePtr, varName, (char *) NULL, - 0, localName, flags); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UpVar2 -- - * - * This procedure links one variable to another, just like - * the "upvar" command. - * - * Results: - * A standard Tcl completion code. If an error occurs then - * an error message is left in the interp's result. - * - * Side effects: - * The variable in frameName whose name is given by part1 and - * part2 becomes accessible under the name localName, so that - * references to localName are redirected to the other variable - * like a symbolic link. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_UpVar2(interp, frameName, part1, part2, localName, flags) - Tcl_Interp *interp; /* Interpreter containing variables. Used - * for error messages too. */ - char *frameName; /* Name of the frame containing the source - * variable, such as "1" or "#0". */ - char *part1, *part2; /* Two parts of source variable name to - * link to. */ - char *localName; /* Name of link variable. */ - int flags; /* 0, TCL_GLOBAL_ONLY or TCL_NAMESPACE_ONLY: - * indicates scope of localName. */ -{ - int result; - CallFrame *framePtr; - - result = TclGetFrame(interp, frameName, &framePtr); - if (result == -1) { - return TCL_ERROR; - } - return MakeUpvar((Interp *) interp, framePtr, part1, part2, 0, - localName, flags); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetVariableFullName -- - * - * Given a Tcl_Var token returned by Tcl_FindNamespaceVar, this - * procedure appends to an object the namespace variable's full - * name, qualified by a sequence of parent namespace names. - * - * Results: - * None. - * - * Side effects: - * The variable's fully-qualified name is appended to the string - * representation of objPtr. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_GetVariableFullName(interp, variable, objPtr) - Tcl_Interp *interp; /* Interpreter containing the variable. */ - Tcl_Var variable; /* Token for the variable returned by a - * previous call to Tcl_FindNamespaceVar. */ - Tcl_Obj *objPtr; /* Points to the object onto which the - * variable's full name is appended. */ -{ - Interp *iPtr = (Interp *) interp; - register Var *varPtr = (Var *) variable; - char *name; - - /* - * Add the full name of the containing namespace (if any), followed by - * the "::" separator, then the variable name. - */ - - if (varPtr != NULL) { - if (!TclIsVarArrayElement(varPtr)) { - if (varPtr->nsPtr != NULL) { - Tcl_AppendToObj(objPtr, varPtr->nsPtr->fullName, -1); - if (varPtr->nsPtr != iPtr->globalNsPtr) { - Tcl_AppendToObj(objPtr, "::", 2); - } - } - if (varPtr->name != NULL) { - Tcl_AppendToObj(objPtr, varPtr->name, -1); - } else if (varPtr->hPtr != NULL) { - name = Tcl_GetHashKey(varPtr->hPtr->tablePtr, varPtr->hPtr); - Tcl_AppendToObj(objPtr, name, -1); - } - } - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GlobalObjCmd -- - * - * This object-based procedure is invoked to process the "global" Tcl - * command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GlobalObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - register Tcl_Obj *objPtr; - char *varName; - register char *tail; - int result, i; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "varName ?varName ...?"); - return TCL_ERROR; - } - - /* - * If we are not executing inside a Tcl procedure, just return. - */ - - if ((iPtr->varFramePtr == NULL) - || !iPtr->varFramePtr->isProcCallFrame) { - return TCL_OK; - } - - for (i = 1; i < objc; i++) { - /* - * Make a local variable linked to its counterpart in the global :: - * namespace. - */ - - objPtr = objv[i]; - varName = TclGetString(objPtr); - - /* - * The variable name might have a scope qualifier, but the name for - * the local "link" variable must be the simple name at the tail. - */ - - for (tail = varName; *tail != '\0'; tail++) { - /* empty body */ - } - while ((tail > varName) && ((*tail != ':') || (*(tail-1) != ':'))) { - tail--; - } - if (*tail == ':') { - tail++; - } - - /* - * Link to the variable "varName" in the global :: namespace. - */ - - result = MakeUpvar(iPtr, (CallFrame *) NULL, - varName, (char *) NULL, /*otherFlags*/ TCL_GLOBAL_ONLY, - /*myName*/ tail, /*myFlags*/ 0); - if (result != TCL_OK) { - return result; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_VariableObjCmd -- - * - * Invoked to implement the "variable" command that creates one or more - * global variables. Handles the following syntax: - * - * variable ?name value...? name ?value? - * - * One or more variables can be created. The variables are initialized - * with the specified values. The value for the last variable is - * optional. - * - * If the variable does not exist, it is created and given the optional - * value. If it already exists, it is simply set to the optional - * value. Normally, "name" is an unqualified name, so it is created in - * the current namespace. If it includes namespace qualifiers, it can - * be created in another namespace. - * - * If the variable command is executed inside a Tcl procedure, it - * creates a local variable linked to the newly-created namespace - * variable. - * - * Results: - * Returns TCL_OK if the variable is found or created. Returns - * TCL_ERROR if anything goes wrong. - * - * Side effects: - * If anything goes wrong, this procedure returns an error message - * as the result in the interpreter's result object. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_VariableObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - Interp *iPtr = (Interp *) interp; - char *varName, *tail, *cp; - Var *varPtr, *arrayPtr; - Tcl_Obj *varValuePtr; - int i, result; - - for (i = 1; i < objc; i = i+2) { - /* - * Look up each variable in the current namespace context, creating - * it if necessary. - */ - - varName = TclGetString(objv[i]); - varPtr = TclLookupVar(interp, varName, (char *) NULL, - (TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG), "define", - /*createPart1*/ 1, /*createPart2*/ 0, &arrayPtr); - if (varPtr == NULL) { - return TCL_ERROR; - } - - /* - * Mark the variable as a namespace variable and increment its - * reference count so that it will persist until its namespace is - * destroyed or until the variable is unset. - */ - - if (!(varPtr->flags & VAR_NAMESPACE_VAR)) { - varPtr->flags |= VAR_NAMESPACE_VAR; - varPtr->refCount++; - } - - /* - * If a value was specified, set the variable to that value. - * Otherwise, if the variable is new, leave it undefined. - * (If the variable already exists and no value was specified, - * leave its value unchanged; just create the local link if - * we're in a Tcl procedure). - */ - - if (i+1 < objc) { /* a value was specified */ - varValuePtr = Tcl_ObjSetVar2(interp, objv[i], NULL, objv[i+1], - (TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG)); - if (varValuePtr == NULL) { - return TCL_ERROR; - } - } - - /* - * If we are executing inside a Tcl procedure, create a local - * variable linked to the new namespace variable "varName". - */ - - if ((iPtr->varFramePtr != NULL) - && iPtr->varFramePtr->isProcCallFrame) { - /* - * varName might have a scope qualifier, but the name for the - * local "link" variable must be the simple name at the tail. - * - * Locate tail in one pass: drop any prefix after two *or more* - * consecutive ":" characters). - */ - - for (tail = cp = varName; *cp != '\0'; ) { - if (*cp++ == ':') { - while (*cp++ == ':') { - tail = cp; - } - } - } - - /* - * Create a local link "tail" to the variable "varName" in the - * current namespace. - */ - - result = MakeUpvar(iPtr, (CallFrame *) NULL, - /*otherP1*/ varName, /*otherP2*/ (char *) NULL, - /*otherFlags*/ TCL_NAMESPACE_ONLY, - /*myName*/ tail, /*myFlags*/ 0); - if (result != TCL_OK) { - return result; - } - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_UpvarObjCmd -- - * - * This object-based procedure is invoked to process the "upvar" - * Tcl command. See the user documentation for details on what it does. - * - * Results: - * A standard Tcl object result value. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_UpvarObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ -{ - register Interp *iPtr = (Interp *) interp; - CallFrame *framePtr; - char *frameSpec, *otherVarName, *myVarName; - register char *p; - int result; - - if (objc < 3) { - upvarSyntax: - Tcl_WrongNumArgs(interp, 1, objv, - "?level? otherVar localVar ?otherVar localVar ...?"); - return TCL_ERROR; - } - - /* - * Find the call frame containing each of the "other variables" to be - * linked to. - */ - - frameSpec = TclGetString(objv[1]); - result = TclGetFrame(interp, frameSpec, &framePtr); - if (result == -1) { - return TCL_ERROR; - } - objc -= result+1; - if ((objc & 1) != 0) { - goto upvarSyntax; - } - objv += result+1; - - /* - * Iterate over each (other variable, local variable) pair. - * Divide the other variable name into two parts, then call - * MakeUpvar to do all the work of linking it to the local variable. - */ - - for ( ; objc > 0; objc -= 2, objv += 2) { - myVarName = TclGetString(objv[1]); - otherVarName = TclGetString(objv[0]); - for (p = otherVarName; *p != 0; p++) { - if (*p == '(') { - char *openParen = p; - - do { - p++; - } while (*p != '\0'); - p--; - if (*p != ')') { - goto scalar; - } - *openParen = '\0'; - *p = '\0'; - result = MakeUpvar(iPtr, framePtr, - otherVarName, openParen+1, /*otherFlags*/ 0, - myVarName, /*flags*/ 0); - *openParen = '('; - *p = ')'; - goto checkResult; - } - } - scalar: - result = MakeUpvar(iPtr, framePtr, otherVarName, (char *) NULL, 0, - myVarName, /*flags*/ 0); - - checkResult: - if (result != TCL_OK) { - return TCL_ERROR; - } - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * CallTraces -- - * - * This procedure is invoked to find and invoke relevant - * trace procedures associated with a particular operation on - * a variable. This procedure invokes traces both on the - * variable and on its containing array (where relevant). - * - * Results: - * The return value is NULL if no trace procedures were invoked, or - * if all the invoked trace procedures returned successfully. - * The return value is non-NULL if a trace procedure returned an - * error (in this case no more trace procedures were invoked after - * the error was returned). In this case the return value is a - * pointer to a static string describing the error. - * - * Side effects: - * Almost anything can happen, depending on trace; this procedure - * itself doesn't have any side effects. - * - *---------------------------------------------------------------------- - */ - -static char * -CallTraces(iPtr, arrayPtr, varPtr, part1, part2, flags) - Interp *iPtr; /* Interpreter containing variable. */ - register Var *arrayPtr; /* Pointer to array variable that contains - * the variable, or NULL if the variable - * isn't an element of an array. */ - Var *varPtr; /* Variable whose traces are to be - * invoked. */ - char *part1, *part2; /* Variable's two-part name. */ - int flags; /* Flags passed to trace procedures: - * indicates what's happening to variable, - * plus other stuff like TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, and - * TCL_INTERP_DESTROYED. */ -{ - register VarTrace *tracePtr; - ActiveVarTrace active; - char *result, *openParen, *p; - Tcl_DString nameCopy; - int copiedName; - - /* - * If there are already similar trace procedures active for the - * variable, don't call them again. - */ - - if (varPtr->flags & VAR_TRACE_ACTIVE) { - return NULL; - } - varPtr->flags |= VAR_TRACE_ACTIVE; - varPtr->refCount++; - - /* - * If the variable name hasn't been parsed into array name and - * element, do it here. If there really is an array element, - * make a copy of the original name so that NULLs can be - * inserted into it to separate the names (can't modify the name - * string in place, because the string might get used by the - * callbacks we invoke). - */ - - copiedName = 0; - if (part2 == NULL) { - for (p = part1; *p ; p++) { - if (*p == '(') { - openParen = p; - do { - p++; - } while (*p != '\0'); - p--; - if (*p == ')') { - Tcl_DStringInit(&nameCopy); - Tcl_DStringAppend(&nameCopy, part1, (p-part1)); - part2 = Tcl_DStringValue(&nameCopy) - + (openParen + 1 - part1); - part2[-1] = 0; - part1 = Tcl_DStringValue(&nameCopy); - copiedName = 1; - } - break; - } - } - } - - /* - * Invoke traces on the array containing the variable, if relevant. - */ - - result = NULL; - active.nextPtr = iPtr->activeTracePtr; - iPtr->activeTracePtr = &active; - if (arrayPtr != NULL) { - arrayPtr->refCount++; - active.varPtr = arrayPtr; - for (tracePtr = arrayPtr->tracePtr; tracePtr != NULL; - tracePtr = active.nextTracePtr) { - active.nextTracePtr = tracePtr->nextPtr; - if (!(tracePtr->flags & flags)) { - continue; - } - result = (*tracePtr->traceProc)(tracePtr->clientData, - (Tcl_Interp *) iPtr, part1, part2, flags); - if (result != NULL) { - if (flags & TCL_TRACE_UNSETS) { - result = NULL; - } else { - goto done; - } - } - } - } - - /* - * Invoke traces on the variable itself. - */ - - if (flags & TCL_TRACE_UNSETS) { - flags |= TCL_TRACE_DESTROYED; - } - active.varPtr = varPtr; - for (tracePtr = varPtr->tracePtr; tracePtr != NULL; - tracePtr = active.nextTracePtr) { - active.nextTracePtr = tracePtr->nextPtr; - if (!(tracePtr->flags & flags)) { - continue; - } - result = (*tracePtr->traceProc)(tracePtr->clientData, - (Tcl_Interp *) iPtr, part1, part2, flags); - if (result != NULL) { - if (flags & TCL_TRACE_UNSETS) { - result = NULL; - } else { - goto done; - } - } - } - - /* - * Restore the variable's flags, remove the record of our active - * traces, and then return. - */ - - done: - if (arrayPtr != NULL) { - arrayPtr->refCount--; - } - if (copiedName) { - Tcl_DStringFree(&nameCopy); - } - varPtr->flags &= ~VAR_TRACE_ACTIVE; - varPtr->refCount--; - iPtr->activeTracePtr = active.nextPtr; - return result; -} - -/* - *---------------------------------------------------------------------- - * - * NewVar -- - * - * Create a new heap-allocated variable that will eventually be - * entered into a hashtable. - * - * Results: - * The return value is a pointer to the new variable structure. It is - * marked as a scalar variable (and not a link or array variable). Its - * value initially is NULL. The variable is not part of any hash table - * yet. Since it will be in a hashtable and not in a call frame, its - * name field is set NULL. It is initially marked as undefined. - * - * Side effects: - * Storage gets allocated. - * - *---------------------------------------------------------------------- - */ - -static Var * -NewVar() -{ - register Var *varPtr; - - varPtr = (Var *) ckalloc(sizeof(Var)); - varPtr->value.objPtr = NULL; - varPtr->name = NULL; - varPtr->nsPtr = NULL; - varPtr->hPtr = NULL; - varPtr->refCount = 0; - varPtr->tracePtr = NULL; - varPtr->searchPtr = NULL; - varPtr->flags = (VAR_SCALAR | VAR_UNDEFINED | VAR_IN_HASHTABLE); - return varPtr; -} - -/* - *---------------------------------------------------------------------- - * - * ParseSearchId -- - * - * This procedure translates from a string to a pointer to an - * active array search (if there is one that matches the string). - * - * Results: - * The return value is a pointer to the array search indicated - * by string, or NULL if there isn't one. If NULL is returned, - * the interp's result contains an error message. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static ArraySearch * -ParseSearchId(interp, varPtr, varName, string) - Tcl_Interp *interp; /* Interpreter containing variable. */ - Var *varPtr; /* Array variable search is for. */ - char *varName; /* Name of array variable that search is - * supposed to be for. */ - char *string; /* String containing id of search. Must have - * form "search-num-var" where "num" is a - * decimal number and "var" is a variable - * name. */ -{ - char *end; - int id; - ArraySearch *searchPtr; - - /* - * Parse the id into the three parts separated by dashes. - */ - - if ((string[0] != 's') || (string[1] != '-')) { - syntax: - Tcl_AppendResult(interp, "illegal search identifier \"", string, - "\"", (char *) NULL); - return NULL; - } - id = strtoul(string+2, &end, 10); - if ((end == (string+2)) || (*end != '-')) { - goto syntax; - } - if (strcmp(end+1, varName) != 0) { - Tcl_AppendResult(interp, "search identifier \"", string, - "\" isn't for variable \"", varName, "\"", (char *) NULL); - return NULL; - } - - /* - * Search through the list of active searches on the interpreter - * to see if the desired one exists. - */ - - for (searchPtr = varPtr->searchPtr; searchPtr != NULL; - searchPtr = searchPtr->nextPtr) { - if (searchPtr->id == id) { - return searchPtr; - } - } - Tcl_AppendResult(interp, "couldn't find search \"", string, "\"", - (char *) NULL); - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * DeleteSearches -- - * - * This procedure is called to free up all of the searches - * associated with an array variable. - * - * Results: - * None. - * - * Side effects: - * Memory is released to the storage allocator. - * - *---------------------------------------------------------------------- - */ - -static void -DeleteSearches(arrayVarPtr) - register Var *arrayVarPtr; /* Variable whose searches are - * to be deleted. */ -{ - ArraySearch *searchPtr; - - while (arrayVarPtr->searchPtr != NULL) { - searchPtr = arrayVarPtr->searchPtr; - arrayVarPtr->searchPtr = searchPtr->nextPtr; - ckfree((char *) searchPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * TclDeleteVars -- - * - * This procedure is called to recycle all the storage space - * associated with a table of variables. For this procedure - * to work correctly, it must not be possible for any of the - * variables in the table to be accessed from Tcl commands - * (e.g. from trace procedures). - * - * Results: - * None. - * - * Side effects: - * Variables are deleted and trace procedures are invoked, if - * any are declared. - * - *---------------------------------------------------------------------- - */ - -void -TclDeleteVars(iPtr, tablePtr) - Interp *iPtr; /* Interpreter to which variables belong. */ - Tcl_HashTable *tablePtr; /* Hash table containing variables to - * delete. */ -{ - Tcl_Interp *interp = (Tcl_Interp *) iPtr; - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - register Var *varPtr; - Var *linkPtr; - int flags; - ActiveVarTrace *activePtr; - Tcl_Obj *objPtr; - Namespace *currNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); - - /* - * Determine what flags to pass to the trace callback procedures. - */ - - flags = TCL_TRACE_UNSETS; - if (tablePtr == &iPtr->globalNsPtr->varTable) { - flags |= (TCL_INTERP_DESTROYED | TCL_GLOBAL_ONLY); - } else if (tablePtr == &currNsPtr->varTable) { - flags |= TCL_NAMESPACE_ONLY; - } - - for (hPtr = Tcl_FirstHashEntry(tablePtr, &search); hPtr != NULL; - hPtr = Tcl_NextHashEntry(&search)) { - varPtr = (Var *) Tcl_GetHashValue(hPtr); - - /* - * For global/upvar variables referenced in procedures, decrement - * the reference count on the variable referred to, and free - * the referenced variable if it's no longer needed. Don't delete - * the hash entry for the other variable if it's in the same table - * as us: this will happen automatically later on. - */ - - if (TclIsVarLink(varPtr)) { - linkPtr = varPtr->value.linkPtr; - linkPtr->refCount--; - if ((linkPtr->refCount == 0) && TclIsVarUndefined(linkPtr) - && (linkPtr->tracePtr == NULL) - && (linkPtr->flags & VAR_IN_HASHTABLE)) { - if (linkPtr->hPtr == NULL) { - ckfree((char *) linkPtr); - } else if (linkPtr->hPtr->tablePtr != tablePtr) { - Tcl_DeleteHashEntry(linkPtr->hPtr); - ckfree((char *) linkPtr); - } - } - } - - /* - * Invoke traces on the variable that is being deleted, then - * free up the variable's space (no need to free the hash entry - * here, unless we're dealing with a global variable: the - * hash entries will be deleted automatically when the whole - * table is deleted). Note that we give CallTraces the variable's - * fully-qualified name so that any called trace procedures can - * refer to these variables being deleted. - */ - - if (varPtr->tracePtr != NULL) { - objPtr = Tcl_NewObj(); - Tcl_IncrRefCount(objPtr); /* until done with traces */ - Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr, objPtr); - (void) CallTraces(iPtr, (Var *) NULL, varPtr, - Tcl_GetString(objPtr), (char *) NULL, flags); - Tcl_DecrRefCount(objPtr); /* free no longer needed obj */ - - while (varPtr->tracePtr != NULL) { - VarTrace *tracePtr = varPtr->tracePtr; - varPtr->tracePtr = tracePtr->nextPtr; - ckfree((char *) tracePtr); - } - for (activePtr = iPtr->activeTracePtr; activePtr != NULL; - activePtr = activePtr->nextPtr) { - if (activePtr->varPtr == varPtr) { - activePtr->nextTracePtr = NULL; - } - } - } - - if (TclIsVarArray(varPtr)) { - DeleteArray(iPtr, Tcl_GetHashKey(tablePtr, hPtr), varPtr, - flags); - varPtr->value.tablePtr = NULL; - } - if (TclIsVarScalar(varPtr) && (varPtr->value.objPtr != NULL)) { - objPtr = varPtr->value.objPtr; - TclDecrRefCount(objPtr); - varPtr->value.objPtr = NULL; - } - varPtr->hPtr = NULL; - varPtr->tracePtr = NULL; - TclSetVarUndefined(varPtr); - TclSetVarScalar(varPtr); - - /* - * If the variable was a namespace variable, decrement its - * reference count. We are in the process of destroying its - * namespace so that namespace will no longer "refer" to the - * variable. - */ - - if (varPtr->flags & VAR_NAMESPACE_VAR) { - varPtr->flags &= ~VAR_NAMESPACE_VAR; - varPtr->refCount--; - } - - /* - * Recycle the variable's memory space if there aren't any upvar's - * pointing to it. If there are upvars to this variable, then the - * variable will get freed when the last upvar goes away. - */ - - if (varPtr->refCount == 0) { - ckfree((char *) varPtr); /* this Var must be VAR_IN_HASHTABLE */ - } - } - Tcl_DeleteHashTable(tablePtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclDeleteCompiledLocalVars -- - * - * This procedure is called to recycle storage space associated with - * the compiler-allocated array of local variables in a procedure call - * frame. This procedure resembles TclDeleteVars above except that each - * variable is stored in a call frame and not a hash table. For this - * procedure to work correctly, it must not be possible for any of the - * variable in the table to be accessed from Tcl commands (e.g. from - * trace procedures). - * - * Results: - * None. - * - * Side effects: - * Variables are deleted and trace procedures are invoked, if - * any are declared. - * - *---------------------------------------------------------------------- - */ - -void -TclDeleteCompiledLocalVars(iPtr, framePtr) - Interp *iPtr; /* Interpreter to which variables belong. */ - CallFrame *framePtr; /* Procedure call frame containing - * compiler-assigned local variables to - * delete. */ -{ - register Var *varPtr; - int flags; /* Flags passed to trace procedures. */ - Var *linkPtr; - ActiveVarTrace *activePtr; - int numLocals, i; - - flags = TCL_TRACE_UNSETS; - numLocals = framePtr->numCompiledLocals; - varPtr = framePtr->compiledLocals; - for (i = 0; i < numLocals; i++) { - /* - * For global/upvar variables referenced in procedures, decrement - * the reference count on the variable referred to, and free - * the referenced variable if it's no longer needed. Don't delete - * the hash entry for the other variable if it's in the same table - * as us: this will happen automatically later on. - */ - - if (TclIsVarLink(varPtr)) { - linkPtr = varPtr->value.linkPtr; - linkPtr->refCount--; - if ((linkPtr->refCount == 0) && TclIsVarUndefined(linkPtr) - && (linkPtr->tracePtr == NULL) - && (linkPtr->flags & VAR_IN_HASHTABLE)) { - if (linkPtr->hPtr == NULL) { - ckfree((char *) linkPtr); - } else { - Tcl_DeleteHashEntry(linkPtr->hPtr); - ckfree((char *) linkPtr); - } - } - } - - /* - * Invoke traces on the variable that is being deleted. Then delete - * the variable's trace records. - */ - - if (varPtr->tracePtr != NULL) { - (void) CallTraces(iPtr, (Var *) NULL, varPtr, - varPtr->name, (char *) NULL, flags); - while (varPtr->tracePtr != NULL) { - VarTrace *tracePtr = varPtr->tracePtr; - varPtr->tracePtr = tracePtr->nextPtr; - ckfree((char *) tracePtr); - } - for (activePtr = iPtr->activeTracePtr; activePtr != NULL; - activePtr = activePtr->nextPtr) { - if (activePtr->varPtr == varPtr) { - activePtr->nextTracePtr = NULL; - } - } - } - - /* - * Now if the variable is an array, delete its element hash table. - * Otherwise, if it's a scalar variable, decrement the ref count - * of its value. - */ - - if (TclIsVarArray(varPtr) && (varPtr->value.tablePtr != NULL)) { - DeleteArray(iPtr, varPtr->name, varPtr, flags); - } - if (TclIsVarScalar(varPtr) && (varPtr->value.objPtr != NULL)) { - TclDecrRefCount(varPtr->value.objPtr); - varPtr->value.objPtr = NULL; - } - varPtr->hPtr = NULL; - varPtr->tracePtr = NULL; - TclSetVarUndefined(varPtr); - TclSetVarScalar(varPtr); - varPtr++; - } -} - -/* - *---------------------------------------------------------------------- - * - * DeleteArray -- - * - * This procedure is called to free up everything in an array - * variable. It's the caller's responsibility to make sure - * that the array is no longer accessible before this procedure - * is called. - * - * Results: - * None. - * - * Side effects: - * All storage associated with varPtr's array elements is deleted - * (including the array's hash table). Deletion trace procedures for - * array elements are invoked, then deleted. Any pending traces for - * array elements are also deleted. - * - *---------------------------------------------------------------------- - */ - -static void -DeleteArray(iPtr, arrayName, varPtr, flags) - Interp *iPtr; /* Interpreter containing array. */ - char *arrayName; /* Name of array (used for trace - * callbacks). */ - Var *varPtr; /* Pointer to variable structure. */ - int flags; /* Flags to pass to CallTraces: - * TCL_TRACE_UNSETS and sometimes - * TCL_INTERP_DESTROYED, - * TCL_NAMESPACE_ONLY, or - * TCL_GLOBAL_ONLY. */ -{ - Tcl_HashSearch search; - register Tcl_HashEntry *hPtr; - register Var *elPtr; - ActiveVarTrace *activePtr; - Tcl_Obj *objPtr; - - DeleteSearches(varPtr); - for (hPtr = Tcl_FirstHashEntry(varPtr->value.tablePtr, &search); - hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - elPtr = (Var *) Tcl_GetHashValue(hPtr); - if (TclIsVarScalar(elPtr) && (elPtr->value.objPtr != NULL)) { - objPtr = elPtr->value.objPtr; - TclDecrRefCount(objPtr); - elPtr->value.objPtr = NULL; - } - elPtr->hPtr = NULL; - if (elPtr->tracePtr != NULL) { - elPtr->flags &= ~VAR_TRACE_ACTIVE; - (void) CallTraces(iPtr, (Var *) NULL, elPtr, arrayName, - Tcl_GetHashKey(varPtr->value.tablePtr, hPtr), flags); - while (elPtr->tracePtr != NULL) { - VarTrace *tracePtr = elPtr->tracePtr; - elPtr->tracePtr = tracePtr->nextPtr; - ckfree((char *) tracePtr); - } - for (activePtr = iPtr->activeTracePtr; activePtr != NULL; - activePtr = activePtr->nextPtr) { - if (activePtr->varPtr == elPtr) { - activePtr->nextTracePtr = NULL; - } - } - } - TclSetVarUndefined(elPtr); - TclSetVarScalar(elPtr); - if (elPtr->refCount == 0) { - ckfree((char *) elPtr); /* element Vars are VAR_IN_HASHTABLE */ - } - } - Tcl_DeleteHashTable(varPtr->value.tablePtr); - ckfree((char *) varPtr->value.tablePtr); -} - -/* - *---------------------------------------------------------------------- - * - * CleanupVar -- - * - * This procedure is called when it looks like it may be OK to free up - * a variable's storage. If the variable is in a hashtable, its Var - * structure and hash table entry will be freed along with those of its - * containing array, if any. This procedure is called, for example, - * when a trace on a variable deletes a variable. - * - * Results: - * None. - * - * Side effects: - * If the variable (or its containing array) really is dead and in a - * hashtable, then its Var structure, and possibly its hash table - * entry, is freed up. - * - *---------------------------------------------------------------------- - */ - -static void -CleanupVar(varPtr, arrayPtr) - Var *varPtr; /* Pointer to variable that may be a - * candidate for being expunged. */ - Var *arrayPtr; /* Array that contains the variable, or - * NULL if this variable isn't an array - * element. */ -{ - if (TclIsVarUndefined(varPtr) && (varPtr->refCount == 0) - && (varPtr->tracePtr == NULL) - && (varPtr->flags & VAR_IN_HASHTABLE)) { - if (varPtr->hPtr != NULL) { - Tcl_DeleteHashEntry(varPtr->hPtr); - } - ckfree((char *) varPtr); - } - if (arrayPtr != NULL) { - if (TclIsVarUndefined(arrayPtr) && (arrayPtr->refCount == 0) - && (arrayPtr->tracePtr == NULL) - && (arrayPtr->flags & VAR_IN_HASHTABLE)) { - if (arrayPtr->hPtr != NULL) { - Tcl_DeleteHashEntry(arrayPtr->hPtr); - } - ckfree((char *) arrayPtr); - } - } -} -/* - *---------------------------------------------------------------------- - * - * VarErrMsg -- - * - * Generate a reasonable error message describing why a variable - * operation failed. - * - * Results: - * None. - * - * Side effects: - * The interp's result is set to hold a message identifying the - * variable given by part1 and part2 and describing why the - * variable operation failed. - * - *---------------------------------------------------------------------- - */ - -static void -VarErrMsg(interp, part1, part2, operation, reason) - Tcl_Interp *interp; /* Interpreter in which to record message. */ - char *part1, *part2; /* Variable's two-part name. */ - char *operation; /* String describing operation that failed, - * e.g. "read", "set", or "unset". */ - char *reason; /* String describing why operation failed. */ -{ - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "can't ", operation, " \"", part1, - (char *) NULL); - if (part2 != NULL) { - Tcl_AppendResult(interp, "(", part2, ")", (char *) NULL); - } - Tcl_AppendResult(interp, "\": ", reason, (char *) NULL); -} diff --git a/library/auto.tcl b/library/auto.tcl deleted file mode 100644 index 7e43aaf..0000000 --- a/library/auto.tcl +++ /dev/null @@ -1,553 +0,0 @@ -# auto.tcl -- -# -# utility procs formerly in init.tcl dealing with auto execution -# of commands and can be auto loaded themselves. -# -# RCS: @(#) $Id: auto.tcl,v 1.2 1999/04/16 00:46:56 stanton Exp $ -# -# Copyright (c) 1991-1993 The Regents of the University of California. -# Copyright (c) 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. -# - -# auto_reset -- -# -# Destroy all cached information for auto-loading and auto-execution, -# so that the information gets recomputed the next time it's needed. -# Also delete any procedures that are listed in the auto-load index -# except those defined in this file. -# -# Arguments: -# None. - -proc auto_reset {} { - global auto_execs auto_index auto_oldpath - foreach p [info procs] { - if {[info exists auto_index($p)] && ![string match auto_* $p] - && ([lsearch -exact {unknown pkg_mkIndex tclPkgSetup - tcl_findLibrary pkg_compareExtension - tclMacPkgSearch tclPkgUnknown} $p] < 0)} { - rename $p {} - } - } - catch {unset auto_execs} - catch {unset auto_index} - catch {unset auto_oldpath} -} - -# tcl_findLibrary -- -# -# This is a utility for extensions that searches for a library directory -# using a canonical searching algorithm. A side effect is to source -# the initialization script and set a global library variable. -# -# Arguments: -# basename Prefix of the directory name, (e.g., "tk") -# version Version number of the package, (e.g., "8.0") -# patch Patchlevel of the package, (e.g., "8.0.3") -# initScript Initialization script to source (e.g., tk.tcl) -# enVarName environment variable to honor (e.g., TK_LIBRARY) -# varName Global variable to set when done (e.g., tk_library) - -proc tcl_findLibrary {basename version patch initScript enVarName varName} { - upvar #0 $varName the_library - global env errorInfo - - set dirs {} - set errors {} - - # The C application may have hardwired a path, which we honor - - if {[info exist the_library] && [string compare $the_library {}]} { - lappend dirs $the_library - } else { - - # Do the canonical search - - # 1. From an environment variable, if it exists - - if {[info exists env($enVarName)]} { - lappend dirs $env($enVarName) - } - - # 2. Relative to the Tcl library - - lappend dirs [file join [file dirname [info library]] \ - $basename$version] - - # 3. Various locations relative to the executable - # ../lib/foo1.0 (From bin directory in install hierarchy) - # ../../lib/foo1.0 (From bin/arch directory in install hierarchy) - # ../library (From unix directory in build hierarchy) - # ../../library (From unix/arch directory in build hierarchy) - # ../../foo1.0b1/library (From unix directory in parallel build hierarchy) - # ../../../foo1.0b1/library (From unix/arch directory in parallel build hierarchy) - - set parentDir [file dirname [file dirname [info nameofexecutable]]] - set grandParentDir [file dirname $parentDir] - lappend dirs [file join $parentDir lib $basename$version] - lappend dirs [file join $grandParentDir lib $basename$version] - lappend dirs [file join $parentDir library] - lappend dirs [file join $grandParentDir library] - if {![regexp {.*[ab][0-9]*} $patch ver]} { - set ver $version - } - lappend dirs [file join $grandParentDir $basename$ver library] - lappend dirs [file join [file dirname $grandParentDir] $basename$ver library] - } - foreach i $dirs { - set the_library $i - set file [file join $i $initScript] - - # source everything when in a safe interpreter because - # we have a source command, but no file exists command - - if {[interp issafe] || [file exists $file]} { - if {![catch {uplevel #0 [list source $file]} msg]} { - return - } else { - append errors "$file: $msg\n$errorInfo\n" - } - } - } - set msg "Can't find a usable $initScript in the following directories: \n" - append msg " $dirs\n\n" - append msg "$errors\n\n" - append msg "This probably means that $basename wasn't installed properly.\n" - error $msg -} - - -# ---------------------------------------------------------------------- -# auto_mkindex -# ---------------------------------------------------------------------- -# The following procedures are used to generate the tclIndex file -# from Tcl source files. They use a special safe interpreter to -# parse Tcl source files, writing out index entries as "proc" -# commands are encountered. This implementation won't work in a -# safe interpreter, since a safe interpreter can't create the -# special parser and mess with its commands. - -if {[interp issafe]} { - return ;# Stop sourcing the file here -} - -# auto_mkindex -- -# Regenerate a tclIndex file from Tcl source files. Takes as argument -# the name of the directory in which the tclIndex file is to be placed, -# followed by any number of glob patterns to use in that directory to -# locate all of the relevant files. -# -# Arguments: -# dir - Name of the directory in which to create an index. -# args - Any number of additional arguments giving the -# names of files within dir. If no additional -# are given auto_mkindex will look for *.tcl. - -proc auto_mkindex {dir args} { - global errorCode errorInfo - - if {[interp issafe]} { - error "can't generate index within safe interpreter" - } - - set oldDir [pwd] - cd $dir - set dir [pwd] - - append index "# Tcl autoload index file, version 2.0\n" - append index "# This file is generated by the \"auto_mkindex\" command\n" - append index "# and sourced to set up indexing information for one or\n" - append index "# more commands. Typically each line is a command that\n" - append index "# sets an element in the auto_index array, where the\n" - append index "# element name is the name of a command and the value is\n" - append index "# a script that loads the command.\n\n" - if {$args == ""} { - set args *.tcl - } - - auto_mkindex_parser::init - foreach file [eval glob $args] { - if {[catch {auto_mkindex_parser::mkindex $file} msg] == 0} { - append index $msg - } else { - set code $errorCode - set info $errorInfo - cd $oldDir - error $msg $info $code - } - } - auto_mkindex_parser::cleanup - - set fid [open "tclIndex" w] - puts $fid $index nonewline - close $fid - cd $oldDir -} - -# Original version of auto_mkindex that just searches the source -# code for "proc" at the beginning of the line. - -proc auto_mkindex_old {dir args} { - global errorCode errorInfo - set oldDir [pwd] - cd $dir - set dir [pwd] - append index "# Tcl autoload index file, version 2.0\n" - append index "# This file is generated by the \"auto_mkindex\" command\n" - append index "# and sourced to set up indexing information for one or\n" - append index "# more commands. Typically each line is a command that\n" - append index "# sets an element in the auto_index array, where the\n" - append index "# element name is the name of a command and the value is\n" - append index "# a script that loads the command.\n\n" - if {$args == ""} { - set args *.tcl - } - foreach file [eval glob $args] { - set f "" - set error [catch { - set f [open $file] - while {[gets $f line] >= 0} { - if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} { - set procName [lindex [auto_qualify $procName "::"] 0] - append index "set [list auto_index($procName)]" - append index " \[list source \[file join \$dir [list $file]\]\]\n" - } - } - close $f - } msg] - if {$error} { - set code $errorCode - set info $errorInfo - catch {close $f} - cd $oldDir - error $msg $info $code - } - } - set f "" - set error [catch { - set f [open tclIndex w] - puts $f $index nonewline - close $f - cd $oldDir - } msg] - if {$error} { - set code $errorCode - set info $errorInfo - catch {close $f} - cd $oldDir - error $msg $info $code - } -} - -# Create a safe interpreter that can be used to parse Tcl source files -# generate a tclIndex file for autoloading. This interp contains -# commands for things that need index entries. Each time a command -# is executed, it writes an entry out to the index file. - -namespace eval auto_mkindex_parser { - variable parser "" ;# parser used to build index - variable index "" ;# maintains index as it is built - variable scriptFile "" ;# name of file being processed - variable contextStack "" ;# stack of namespace scopes - variable imports "" ;# keeps track of all imported cmds - variable initCommands "" ;# list of commands that create aliases - - proc init {} { - variable parser - variable initCommands - - if {![interp issafe]} { - set parser [interp create -safe] - $parser hide info - $parser hide rename - $parser hide proc - $parser hide namespace - $parser hide eval - $parser hide puts - $parser invokehidden namespace delete :: - $parser invokehidden proc unknown {args} {} - - # We'll need access to the "namespace" command within the - # interp. Put it back, but move it out of the way. - - $parser expose namespace - $parser invokehidden rename namespace _%@namespace - $parser expose eval - $parser invokehidden rename eval _%@eval - - # Install all the registered psuedo-command implementations - - foreach cmd $initCommands { - eval $cmd - } - } - } - proc cleanup {} { - variable parser - interp delete $parser - unset parser - } -} - -# auto_mkindex_parser::mkindex -- -# -# Used by the "auto_mkindex" command to create a "tclIndex" file for -# the given Tcl source file. Executes the commands in the file, and -# handles things like the "proc" command by adding an entry for the -# index file. Returns a string that represents the index file. -# -# Arguments: -# file Name of Tcl source file to be indexed. - -proc auto_mkindex_parser::mkindex {file} { - variable parser - variable index - variable scriptFile - variable contextStack - variable imports - - set scriptFile $file - - set fid [open $file] - set contents [read $fid] - close $fid - - # There is one problem with sourcing files into the safe - # interpreter: references like "$x" will fail since code is not - # really being executed and variables do not really exist. - # Be careful to escape all naked "$" before evaluating. - - regsub -all {([^\$])\$([^\$])} $contents {\1\\$\2} contents - - set index "" - set contextStack "" - set imports "" - - $parser eval $contents - - foreach name $imports { - catch {$parser eval [list _%@namespace forget $name]} - } - return $index -} - -# auto_mkindex_parser::hook command -# -# Registers a Tcl command to evaluate when initializing the -# slave interpreter used by the mkindex parser. -# The command is evaluated in the master interpreter, and can -# use the variable auto_mkindex_parser::parser to get to the slave - -proc auto_mkindex_parser::hook {cmd} { - variable initCommands - - lappend initCommands $cmd -} - -# auto_mkindex_parser::slavehook command -# -# Registers a Tcl command to evaluate when initializing the -# slave interpreter used by the mkindex parser. -# The command is evaluated in the slave interpreter. - -proc auto_mkindex_parser::slavehook {cmd} { - variable initCommands - - # The $parser variable is defined to be the name of the - # slave interpreter when this command is used later. - - lappend initCommands "\$parser eval [list $cmd]" -} - -# auto_mkindex_parser::command -- -# -# Registers a new command with the "auto_mkindex_parser" interpreter -# that parses Tcl files. These commands are fake versions of things -# like the "proc" command. When you execute them, they simply write -# out an entry to a "tclIndex" file for auto-loading. -# -# This procedure allows extensions to register their own commands -# with the auto_mkindex facility. For example, a package like -# [incr Tcl] might register a "class" command so that class definitions -# could be added to a "tclIndex" file for auto-loading. -# -# Arguments: -# name Name of command recognized in Tcl files. -# arglist Argument list for command. -# body Implementation of command to handle indexing. - -proc auto_mkindex_parser::command {name arglist body} { - hook [list auto_mkindex_parser::commandInit $name $arglist $body] -} - -# auto_mkindex_parser::commandInit -- -# -# This does the actual work set up by auto_mkindex_parser::command -# This is called when the interpreter used by the parser is created. -# -# Arguments: -# name Name of command recognized in Tcl files. -# arglist Argument list for command. -# body Implementation of command to handle indexing. - -proc auto_mkindex_parser::commandInit {name arglist body} { - variable parser - - set ns [namespace qualifiers $name] - set tail [namespace tail $name] - if {$ns == ""} { - set fakeName "[namespace current]::_%@fake_$tail" - } else { - set fakeName "_%@fake_$name" - regsub -all {::} $fakeName "_" fakeName - set fakeName "[namespace current]::$fakeName" - } - proc $fakeName $arglist $body - - # YUK! Tcl won't let us alias fully qualified command names, - # so we can't handle names like "::itcl::class". Instead, - # we have to build procs with the fully qualified names, and - # have the procs point to the aliases. - - if {[regexp {::} $name]} { - set exportCmd [list _%@namespace export [namespace tail $name]] - $parser eval [list _%@namespace eval $ns $exportCmd] - - # The following proc definition does not work if you - # want to tolerate space or something else diabolical - # in the procedure name, (i.e., space in $alias) - # The following does not work: - # "_%@eval {$alias} \$args" - # because $alias gets concat'ed to $args. - # The following does not work because $cmd is somehow undefined - # "set cmd {$alias} \; _%@eval {\$cmd} \$args" - # A gold star to someone that can make test - # autoMkindex-3.3 work properly - - set alias [namespace tail $fakeName] - $parser invokehidden proc $name {args} "_%@eval {$alias} \$args" - $parser alias $alias $fakeName - } else { - $parser alias $name $fakeName - } - return -} - -# auto_mkindex_parser::fullname -- -# Used by commands like "proc" within the auto_mkindex parser. -# Returns the qualified namespace name for the "name" argument. -# If the "name" does not start with "::", elements are added from -# the current namespace stack to produce a qualified name. Then, -# the name is examined to see whether or not it should really be -# qualified. If the name has more than the leading "::", it is -# returned as a fully qualified name. Otherwise, it is returned -# as a simple name. That way, the Tcl autoloader will recognize -# it properly. -# -# Arguments: -# name - Name that is being added to index. - -proc auto_mkindex_parser::fullname {name} { - variable contextStack - - if {![string match ::* $name]} { - foreach ns $contextStack { - set name "${ns}::$name" - if {[string match ::* $name]} { - break - } - } - } - - if {[namespace qualifiers $name] == ""} { - return [namespace tail $name] - } elseif {![string match ::* $name]} { - return "::$name" - } - return $name -} - -# Register all of the procedures for the auto_mkindex parser that -# will build the "tclIndex" file. - -# AUTO MKINDEX: proc name arglist body -# Adds an entry to the auto index list for the given procedure name. - -auto_mkindex_parser::command proc {name args} { - variable index - variable scriptFile - append index [list set auto_index([fullname $name])] \ - " \[list source \[file join \$dir [list $scriptFile]\]\]\n" -} - -# Conditionally add support for Tcl byte code files. There are some -# tricky details here. First, we need to get the tbcload library -# initialized in the current interpreter. We cannot load tbcload into the -# slave until we have done so because it needs access to the tcl_patchLevel -# variable. Second, because the package index file may defer loading the -# library until we invoke a command, we need to explicitly invoke auto_load -# to force it to be loaded. This should be a noop if the package has -# already been loaded - -auto_mkindex_parser::hook { - if {![catch {package require tbcload}]} { - if {[info commands tbcload::bcproc] == ""} { - auto_load tbcload::bcproc - } - load {} tbcload $auto_mkindex_parser::parser - - # AUTO MKINDEX: tbcload::bcproc name arglist body - # Adds an entry to the auto index list for the given pre-compiled - # procedure name. - - auto_mkindex_parser::commandInit tbcload::bcproc {name args} { - variable index - variable scriptFile - append index [list set auto_index([fullname $name])] \ - " \[list source \[file join \$dir [list $scriptFile]\]\]\n" - } - } -} - -# AUTO MKINDEX: namespace eval name command ?arg arg...? -# Adds the namespace name onto the context stack and evaluates the -# associated body of commands. -# -# AUTO MKINDEX: namespace import ?-force? pattern ?pattern...? -# Performs the "import" action in the parser interpreter. This is -# important for any commands contained in a namespace that affect -# the index. For example, a script may say "itcl::class ...", -# or it may import "itcl::*" and then say "class ...". This -# procedure does the import operation, but keeps track of imported -# patterns so we can remove the imports later. - -auto_mkindex_parser::command namespace {op args} { - switch -- $op { - eval { - variable parser - variable contextStack - - set name [lindex $args 0] - set args [lrange $args 1 end] - - set contextStack [linsert $contextStack 0 $name] - $parser eval [list _%@namespace eval $name] $args - set contextStack [lrange $contextStack 1 end] - } - import { - variable parser - variable imports - foreach pattern $args { - if {$pattern != "-force"} { - lappend imports $pattern - } - } - catch {$parser eval "_%@namespace import $args"} - } - } -} - -return diff --git a/library/encoding/ascii.enc b/library/encoding/ascii.enc deleted file mode 100644 index e0320b8..0000000 --- a/library/encoding/ascii.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: ascii, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/big5.enc b/library/encoding/big5.enc deleted file mode 100644 index 26179f4..0000000 --- a/library/encoding/big5.enc +++ /dev/null @@ -1,1516 +0,0 @@ -# Encoding file: big5, multi-byte -M -003F 0 89 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3000FF0C30013002FF0E2022FF1BFF1AFF1FFF01FE3020262025FE50FF64FE52 -00B7FE54FE55FE56FE57FF5C2013FE312014FE33FFFDFE34FE4FFF08FF09FE35 -FE36FF5BFF5DFE37FE3830143015FE39FE3A30103011FE3BFE3C300A300BFE3D -FE3E30083009FE3FFE40300C300DFE41FE42300E300FFE43FE44FE59FE5A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FE5BFE5CFE5DFE5E20182019201C201D301D301E20352032FF03FF06FF0A -203B00A7300325CB25CF25B325B225CE2606260525C725C625A125A025BD25BC -32A32105203EFFFDFF3FFFFDFE49FE4AFE4DFE4EFE4BFE4CFE5FFE60FE61FF0B -FF0D00D700F700B1221AFF1CFF1EFF1D226622672260221E22522261FE62FE63 -FE64FE65FE66223C2229222A22A52220221F22BF33D233D1222B222E22352234 -26402642264126092191219321902192219621972199219822252223FFFD0000 -A2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FFFDFF0FFF3CFF0400A5301200A200A3FF05FF2021032109FE69FE6AFE6B33D5 -339C339D339E33CE33A1338E338F33C400B05159515B515E515D5161516355E7 -74E97CCE25812582258325842585258625872588258F258E258D258C258B258A -2589253C2534252C2524251C2594250025022595250C251025142518256D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000256E2570256F2550255E256A256125E225E325E525E4257125722573FF10 -FF11FF12FF13FF14FF15FF16FF17FF18FF192160216121622163216421652166 -216721682169302130223023302430253026302730283029FFFD5344FFFDFF21 -FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2FFF30FF31 -FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF41FF42FF43FF44FF45FF46FF47 -FF48FF49FF4AFF4BFF4CFF4DFF4EFF4FFF50FF51FF52FF53FF54FF55FF560000 -A3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FF57FF58FF59FF5A039103920393039403950396039703980399039A039B039C -039D039E039F03A003A103A303A403A503A603A703A803A903B103B203B303B4 -03B503B603B703B803B903BA03BB03BC03BD03BE03BF03C003C103C303C403C5 -03C603C703C803C931053106310731083109310A310B310C310D310E310F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00003110311131123113311431153116311731183119311A311B311C311D311E -311F312031213122312331243125312631273128312902D902C902CA02C702CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E004E594E014E034E434E5D4E864E8C4EBA513F5165516B51E052005201529B -53155341535C53C84E094E0B4E084E0A4E2B4E3851E14E454E484E5F4E5E4E8E -4EA15140520352FA534353C953E3571F58EB5915592759735B505B515B535BF8 -5C0F5C225C385C715DDD5DE55DF15DF25DF35DFE5E725EFE5F0B5F13624D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E114E104E0D4E2D4E304E394E4B5C394E884E914E954E924E944EA24EC1 -4EC04EC34EC64EC74ECD4ECA4ECB4EC4514351415167516D516E516C519751F6 -52065207520852FB52FE52FF53165339534853475345535E538453CB53CA53CD -58EC5929592B592A592D5B545C115C245C3A5C6F5DF45E7B5EFF5F145F155FC3 -62086236624B624E652F6587659765A465B965E566F0670867286B206B626B79 -6BCB6BD46BDB6C0F6C34706B722A7236723B72477259725B72AC738B4E190000 -A5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E164E154E144E184E3B4E4D4E4F4E4E4EE54ED84ED44ED54ED64ED74EE34EE4 -4ED94EDE514551445189518A51AC51F951FA51F8520A52A0529F530553065317 -531D4EDF534A534953615360536F536E53BB53EF53E453F353EC53EE53E953E8 -53FC53F853F553EB53E653EA53F253F153F053E553ED53FB56DB56DA59160000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000592E5931597459765B555B835C3C5DE85DE75DE65E025E035E735E7C5F01 -5F185F175FC5620A625362546252625165A565E6672E672C672A672B672D6B63 -6BCD6C116C106C386C416C406C3E72AF7384738974DC74E67518751F75287529 -7530753175327533758B767D76AE76BF76EE77DB77E277F3793A79BE7A747ACB -4E1E4E1F4E524E534E694E994EA44EA64EA54EFF4F094F194F0A4F154F0D4F10 -4F114F0F4EF24EF64EFB4EF04EF34EFD4F014F0B514951475146514851680000 -A6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5171518D51B0521752115212520E521652A3530853215320537053715409540F -540C540A54105401540B54045411540D54085403540E5406541256E056DE56DD -573357305728572D572C572F57295919591A59375938598459785983597D5979 -598259815B575B585B875B885B855B895BFA5C165C795DDE5E065E765E740000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F0F5F1B5FD95FD6620E620C620D62106263625B6258653665E965E865EC -65ED66F266F36709673D6734673167356B216B646B7B6C166C5D6C576C596C5F -6C606C506C556C616C5B6C4D6C4E7070725F725D767E7AF97C737CF87F367F8A -7FBD80018003800C80128033807F8089808B808C81E381EA81F381FC820C821B -821F826E8272827E866B8840884C8863897F96214E324EA84F4D4F4F4F474F57 -4F5E4F344F5B4F554F304F504F514F3D4F3A4F384F434F544F3C4F464F630000 -A7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4F5C4F604F2F4F4E4F364F594F5D4F484F5A514C514B514D517551B651B75225 -52245229522A522852AB52A952AA52AC532353735375541D542D541E543E5426 -544E542754465443543354485442541B5429544A5439543B5438542E54355436 -5420543C54405431542B541F542C56EA56F056E456EB574A57515740574D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005747574E573E5750574F573B58EF593E599D599259A8599E59A359995996 -598D59A45993598A59A55B5D5B5C5B5A5B5B5B8C5B8B5B8F5C2C5C405C415C3F -5C3E5C905C915C945C8C5DEB5E0C5E8F5E875E8A5EF75F045F1F5F645F625F77 -5F795FD85FCC5FD75FCD5FF15FEB5FF85FEA6212621162846297629662806276 -6289626D628A627C627E627962736292626F6298626E62956293629162866539 -653B653865F166F4675F674E674F67506751675C6756675E6749674667600000 -A8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -675367576B656BCF6C426C5E6C996C816C886C896C856C9B6C6A6C7A6C906C70 -6C8C6C686C966C926C7D6C836C726C7E6C746C866C766C8D6C946C986C827076 -707C707D707872627261726072C472C27396752C752B75377538768276EF77E3 -79C179C079BF7A767CFB7F5580968093809D8098809B809A80B2826F82920000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000828B828D898B89D28A008C378C468C558C9D8D648D708DB38EAB8ECA8F9B -8FB08FC28FC68FC58FC45DE1909190A290AA90A690A3914991C691CC9632962E -9631962A962C4E264E564E734E8B4E9B4E9E4EAB4EAC4F6F4F9D4F8D4F734F7F -4F6C4F9B4F8B4F864F834F704F754F884F694F7B4F964F7E4F8F4F914F7A5154 -51525155516951775176517851BD51FD523B52385237523A5230522E52365241 -52BE52BB5352535453535351536653775378537953D653D453D7547354750000 -A9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5496547854955480547B5477548454925486547C549054715476548C549A5462 -5468548B547D548E56FA57835777576A5769576157665764577C591C59495947 -59485944595459BE59BB59D459B959AE59D159C659D059CD59CB59D359CA59AF -59B359D259C55B5F5B645B635B975B9A5B985B9C5B995B9B5C1A5C485C450000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C465CB75CA15CB85CA95CAB5CB15CB35E185E1A5E165E155E1B5E115E78 -5E9A5E975E9C5E955E965EF65F265F275F295F805F815F7F5F7C5FDD5FE05FFD -5FF55FFF600F6014602F60356016602A6015602160276029602B601B62166215 -623F623E6240627F62C962CC62C462BF62C262B962D262DB62AB62D362D462CB -62C862A862BD62BC62D062D962C762CD62B562DA62B162D862D662D762C662AC -62CE653E65A765BC65FA66146613660C66066602660E6600660F6615660A0000 -AA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6607670D670B676D678B67956771679C677367776787679D6797676F6770677F -6789677E67906775679A6793677C676A67726B236B666B676B7F6C136C1B6CE3 -6CE86CF36CB16CCC6CE56CB36CBD6CBE6CBC6CE26CAB6CD56CD36CB86CC46CB9 -6CC16CAE6CD76CC56CF16CBF6CBB6CE16CDB6CCA6CAC6CEF6CDC6CD66CE00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007095708E7092708A7099722C722D723872487267726972C072CE72D972D7 -72D073A973A8739F73AB73A5753D759D7599759A768476C276F276F477E577FD -793E7940794179C979C87A7A7A797AFA7CFE7F547F8C7F8B800580BA80A580A2 -80B180A180AB80A980B480AA80AF81E581FE820D82B3829D829982AD82BD829F -82B982B182AC82A582AF82B882A382B082BE82B7864E8671521D88688ECB8FCE -8FD48FD190B590B890B190B691C791D195779580961C9640963F963B96440000 -AB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -964296B996E89752975E4E9F4EAD4EAE4FE14FB54FAF4FBF4FE04FD14FCF4FDD -4FC34FB64FD84FDF4FCA4FD74FAE4FD04FC44FC24FDA4FCE4FDE4FB751575192 -519151A0524E5243524A524D524C524B524752C752C952C352C1530D5357537B -539A53DB54AC54C054A854CE54C954B854A654B354C754C254BD54AA54C10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054C454C854AF54AB54B154BB54A954A754BF56FF5782578B57A057A357A2 -57CE57AE579359555951594F594E595059DC59D859FF59E359E85A0359E559EA -59DA59E65A0159FB5B695BA35BA65BA45BA25BA55C015C4E5C4F5C4D5C4B5CD9 -5CD25DF75E1D5E255E1F5E7D5EA05EA65EFA5F085F2D5F655F885F855F8A5F8B -5F875F8C5F896012601D60206025600E6028604D60706068606260466043606C -606B606A6064624162DC6316630962FC62ED630162EE62FD630762F162F70000 -AC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62EF62EC62FE62F463116302653F654565AB65BD65E26625662D66206627662F -661F66286631662466F767FF67D367F167D467D067EC67B667AF67F567E967EF -67C467D167B467DA67E567B867CF67DE67F367B067D967E267DD67D26B6A6B83 -6B866BB56BD26BD76C1F6CC96D0B6D326D2A6D416D256D0C6D316D1E6D170000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D3B6D3D6D3E6D366D1B6CF56D396D276D386D296D2E6D356D0E6D2B70AB -70BA70B370AC70AF70AD70B870AE70A472307272726F727472E972E072E173B7 -73CA73BB73B273CD73C073B3751A752D754F754C754E754B75AB75A475A575A2 -75A3767876867687768876C876C676C376C5770176F976F87709770B76FE76FC -770777DC78027814780C780D794679497948794779B979BA79D179D279CB7A7F -7A817AFF7AFD7C7D7D027D057D007D097D077D047D067F387F8E7FBF80040000 -AD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8010800D8011803680D680E580DA80C380C480CC80E180DB80CE80DE80E480DD -81F4822282E78303830582E382DB82E6830482E58302830982D282D782F18301 -82DC82D482D182DE82D382DF82EF830686508679867B867A884D886B898189D4 -8A088A028A038C9E8CA08D748D738DB48ECD8ECC8FF08FE68FE28FEA8FE50000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008FED8FEB8FE48FE890CA90CE90C190C3914B914A91CD95829650964B964C -964D9762976997CB97ED97F3980198A898DB98DF999699994E584EB3500C500D -50234FEF502650254FF8502950165006503C501F501A501250114FFA50005014 -50284FF15021500B501950184FF34FEE502D502A4FFE502B5009517C51A451A5 -51A251CD51CC51C651CB5256525C5254525B525D532A537F539F539D53DF54E8 -55105501553754FC54E554F2550654FA551454E954ED54E1550954EE54EA0000 -AE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54E65527550754FD550F5703570457C257D457CB57C35809590F59575958595A -5A115A185A1C5A1F5A1B5A1359EC5A205A235A295A255A0C5A095B6B5C585BB0 -5BB35BB65BB45BAE5BB55BB95BB85C045C515C555C505CED5CFD5CFB5CEA5CE8 -5CF05CF65D015CF45DEE5E2D5E2B5EAB5EAD5EA75F315F925F915F9060590000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006063606560506055606D6069606F6084609F609A608D6094608C60856096 -624762F3630862FF634E633E632F635563426346634F6349633A6350633D632A -632B6328634D634C65486549659965C165C566426649664F66436652664C6645 -664166F867146715671768216838684868466853683968426854682968B36817 -684C6851683D67F468506840683C6843682A68456813681868416B8A6B896BB7 -6C236C276C286C266C246CF06D6A6D956D886D876D666D786D776D596D930000 -AF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6D6C6D896D6E6D5A6D746D696D8C6D8A6D796D856D656D9470CA70D870E470D9 -70C870CF7239727972FC72F972FD72F872F7738673ED740973EE73E073EA73DE -7554755D755C755A755975BE75C575C775B275B375BD75BC75B975C275B8768B -76B076CA76CD76CE7729771F7720772877E9783078277838781D783478370000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007825782D7820781F7832795579507960795F7956795E795D7957795A79E4 -79E379E779DF79E679E979D87A847A887AD97B067B117C897D217D177D0B7D0A -7D207D227D147D107D157D1A7D1C7D0D7D197D1B7F3A7F5F7F947FC57FC18006 -8018801580198017803D803F80F1810280F0810580ED80F4810680F880F38108 -80FD810A80FC80EF81ED81EC82008210822A822B8228822C82BB832B83528354 -834A83388350834983358334834F833283398336831783408331832883430000 -B0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8654868A86AA869386A486A9868C86A3869C8870887788818882887D88798A18 -8A108A0E8A0C8A158A0A8A178A138A168A0F8A118C488C7A8C798CA18CA28D77 -8EAC8ED28ED48ECF8FB1900190068FF790008FFA8FF490038FFD90058FF89095 -90E190DD90E29152914D914C91D891DD91D791DC91D995839662966396610000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000965B965D96649658965E96BB98E299AC9AA89AD89B259B329B3C4E7E507A -507D505C50475043504C505A504950655076504E5055507550745077504F500F -506F506D515C519551F0526A526F52D252D952D852D55310530F5319533F5340 -533E53C366FC5546556A55665544555E55615543554A55315556554F5555552F -55645538552E555C552C55635533554155575708570B570957DF5805580A5806 -57E057E457FA5802583557F757F9592059625A365A415A495A665A6A5A400000 -B1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A3C5A625A5A5A465A4A5B705BC75BC55BC45BC25BBF5BC65C095C085C075C60 -5C5C5C5D5D075D065D0E5D1B5D165D225D115D295D145D195D245D275D175DE2 -5E385E365E335E375EB75EB85EB65EB55EBE5F355F375F575F6C5F695F6B5F97 -5F995F9E5F985FA15FA05F9C607F60A3608960A060A860CB60B460E660BD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060C560BB60B560DC60BC60D860D560C660DF60B860DA60C7621A621B6248 -63A063A76372639663A263A563776367639863AA637163A963896383639B636B -63A863846388639963A163AC6392638F6380637B63696368637A655D65566551 -65596557555F654F655865556554659C659B65AC65CF65CB65CC65CE665D665A -666466686666665E66F952D7671B688168AF68A2689368B5687F687668B168A7 -689768B0688368C468AD688668856894689D68A8689F68A168826B326BBA0000 -B2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6BEB6BEC6C2B6D8E6DBC6DF36DD96DB26DE16DCC6DE46DFB6DFA6E056DC76DCB -6DAF6DD16DAE6DDE6DF96DB86DF76DF56DC56DD26E1A6DB56DDA6DEB6DD86DEA -6DF16DEE6DE86DC66DC46DAA6DEC6DBF6DE670F97109710A70FD70EF723D727D -7281731C731B73167313731973877405740A7403740673FE740D74E074F60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000074F7751C75227565756675627570758F75D475D575B575CA75CD768E76D4 -76D276DB7737773E773C77367738773A786B7843784E79657968796D79FB7A92 -7A957B207B287B1B7B2C7B267B197B1E7B2E7C927C977C957D467D437D717D2E -7D397D3C7D407D307D337D447D2F7D427D327D317F3D7F9E7F9A7FCC7FCE7FD2 -801C804A8046812F81168123812B81298130812482028235823782368239838E -839E8398837883A2839683BD83AB8392838A8393838983A08377837B837C0000 -B3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -838683A786555F6A86C786C086B686C486B586C686CB86B186AF86C98853889E -888888AB88928896888D888B8993898F8A2A8A1D8A238A258A318A2D8A1F8A1B -8A228C498C5A8CA98CAC8CAB8CA88CAA8CA78D678D668DBE8DBA8EDB8EDF9019 -900D901A90179023901F901D90109015901E9020900F90229016901B90140000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090E890ED90FD915791CE91F591E691E391E791ED91E99589966A96759673 -96789670967496769677966C96C096EA96E97AE07ADF980298039B5A9CE59E75 -9E7F9EA59EBB50A2508D508550995091508050965098509A670051F152725274 -5275526952DE52DD52DB535A53A5557B558055A7557C558A559D55985582559C -55AA55945587558B558355B355AE559F553E55B2559A55BB55AC55B1557E5589 -55AB5599570D582F582A58345824583058315821581D582058F958FA59600000 -B4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A775A9A5A7F5A925A9B5AA75B735B715BD25BCC5BD35BD05C0A5C0B5C315D4C -5D505D345D475DFD5E455E3D5E405E435E7E5ECA5EC15EC25EC45F3C5F6D5FA9 -5FAA5FA860D160E160B260B660E0611C612360FA611560F060FB60F4616860F1 -610E60F6610961006112621F624963A3638C63CF63C063E963C963C663CD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000063D263E363D063E163D663ED63EE637663F463EA63DB645263DA63F9655E -6566656265636591659065AF666E667066746676666F6691667A667E667766FE -66FF671F671D68FA68D568E068D868D7690568DF68F568EE68E768F968D268F2 -68E368CB68CD690D6912690E68C968DA696E68FB6B3E6B3A6B3D6B986B966BBC -6BEF6C2E6C2F6C2C6E2F6E386E546E216E326E676E4A6E206E256E236E1B6E5B -6E586E246E566E6E6E2D6E266E6F6E346E4D6E3A6E2C6E436E1D6E3E6ECB0000 -B5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6E896E196E4E6E636E446E726E696E5F7119711A7126713071217136716E711C -724C728472807336732573347329743A742A743374227425743574367434742F -741B7426742875257526756B756A75E275DB75E375D975D875DE75E0767B767C -7696769376B476DC774F77ED785D786C786F7A0D7A087A0B7A057A007A980000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A977A967AE57AE37B497B567B467B507B527B547B4D7B4B7B4F7B517C9F -7CA57D5E7D507D687D557D2B7D6E7D727D617D667D627D707D7355847FD47FD5 -800B8052808581558154814B8151814E81398146813E814C815381748212821C -83E9840383F8840D83E083C5840B83C183EF83F183F48457840A83F0840C83CC -83FD83F283CA8438840E840483DC840783D483DF865B86DF86D986ED86D486DB -86E486D086DE885788C188C288B1898389968A3B8A608A558A5E8A3C8A410000 -B6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8A548A5B8A508A468A348A3A8A368A568C618C828CAF8CBC8CB38CBD8CC18CBB -8CC08CB48CB78CB68CBF8CB88D8A8D858D818DCE8DDD8DCB8DDA8DD18DCC8DDB -8DC68EFB8EF88EFC8F9C902E90359031903890329036910290F5910990FE9163 -916591CF9214921592239209921E920D9210920792119594958F958B95910000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000095939592958E968A968E968B967D96859686968D9672968496C196C596C4 -96C696C796EF96F297CC98059806980898E798EA98EF98E998F298ED99AE99AD -9EC39ECD9ED14E8250AD50B550B250B350C550BE50AC50B750BB50AF50C7527F -5277527D52DF52E652E452E252E3532F55DF55E855D355E655CE55DC55C755D1 -55E355E455EF55DA55E155C555C655E555C957125713585E585158585857585A -5854586B584C586D584A58625852584B59675AC15AC95ACC5ABE5ABD5ABC0000 -B7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5AB35AC25AB25D695D6F5E4C5E795EC95EC85F125F595FAC5FAE611A610F6148 -611F60F3611B60F961016108614E614C6144614D613E61346127610D61066137 -622162226413643E641E642A642D643D642C640F641C6414640D643664166417 -6406656C659F65B06697668966876688669666846698668D67036994696D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000695A697769606954697569306982694A6968696B695E695369796986695D -6963695B6B476B726BC06BBF6BD36BFD6EA26EAF6ED36EB66EC26E906E9D6EC7 -6EC56EA56E986EBC6EBA6EAB6ED16E966E9C6EC46ED46EAA6EA76EB4714E7159 -7169716471497167715C716C7166714C7165715E714671687156723A72527337 -7345733F733E746F745A7455745F745E7441743F7459745B745C757675787600 -75F0760175F275F175FA75FF75F475F376DE76DF775B776B7766775E77630000 -B8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7779776A776C775C77657768776277EE788E78B078977898788C7889787C7891 -7893787F797A797F7981842C79BD7A1C7A1A7A207A147A1F7A1E7A9F7AA07B77 -7BC07B607B6E7B677CB17CB37CB57D937D797D917D817D8F7D5B7F6E7F697F6A -7F727FA97FA87FA480568058808680848171817081788165816E8173816B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008179817A81668205824784828477843D843184758466846B8449846C845B -843C8435846184638469846D8446865E865C865F86F9871387088707870086FE -86FB870287038706870A885988DF88D488D988DC88D888DD88E188CA88D588D2 -899C89E38A6B8A728A738A668A698A708A878A7C8A638AA08A718A858A6D8A62 -8A6E8A6C8A798A7B8A3E8A688C628C8A8C898CCA8CC78CC88CC48CB28CC38CC2 -8CC58DE18DDF8DE88DEF8DF38DFA8DEA8DE48DE68EB28F038F098EFE8F0A0000 -B9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8F9F8FB2904B904A905390429054903C905590509047904F904E904D9051903E -904191129117916C916A916991C9923792579238923D9240923E925B924B9264 -925192349249924D92459239923F925A959896989694969596CD96CB96C996CA -96F796FB96F996F6975697749776981098119813980A9812980C98FC98F40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000098FD98FE99B399B199B49AE19CE99E829F0E9F139F2050E750EE50E550D6 -50ED50DA50D550CF50D150F150CE50E9516251F352835282533153AD55FE5600 -561B561755FD561456065609560D560E55F75616561F5608561055F657185716 -5875587E58835893588A58795885587D58FD592559225924596A59695AE15AE6 -5AE95AD75AD65AD85AE35B755BDE5BE75BE15BE55BE65BE85BE25BE45BDF5C0D -5C625D845D875E5B5E635E555E575E545ED35ED65F0A5F465F705FB961470000 -BA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -613F614B617761626163615F615A61586175622A64876458645464A46478645F -647A645164676434646D647B657265A165D765D666A266A8669D699C69A86995 -69C169AE69D369CB699B69B769BB69AB69B469D069CD69AD69CC69A669C369A3 -6B496B4C6C336F336F146EFE6F136EF46F296F3E6F206F2C6F0F6F026F220000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006EFF6EEF6F066F316F386F326F236F156F2B6F2F6F886F2A6EEC6F016EF2 -6ECC6EF771947199717D718A71847192723E729272967344735074647463746A -7470746D750475917627760D760B7609761376E176E37784777D777F776178C1 -789F78A778B378A978A3798E798F798D7A2E7A317AAA7AA97AED7AEF7BA17B95 -7B8B7B757B977B9D7B947B8F7BB87B877B847CB97CBD7CBE7DBB7DB07D9C7DBD -7DBE7DA07DCA7DB47DB27DB17DBA7DA27DBF7DB57DB87DAD7DD27DC77DAC0000 -BB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7F707FE07FE17FDF805E805A808781508180818F8188818A817F818281E781FA -82078214821E824B84C984BF84C684C48499849E84B2849C84CB84B884C084D3 -849084BC84D184CA873F871C873B872287258734871887558737872988F38902 -88F488F988F888FD88E8891A88EF8AA68A8C8A9E8AA38A8D8AA18A938AA40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008AAA8AA58AA88A988A918A9A8AA78C6A8C8D8C8C8CD38CD18CD28D6B8D99 -8D958DFC8F148F128F158F138FA390609058905C90639059905E9062905D905B -91199118911E917591789177917492789280928592989296927B9293929C92A8 -927C929195A195A895A995A395A595A49699969C969B96CC96D29700977C9785 -97F69817981898AF98B199039905990C990999C19AAF9AB09AE69B419B429CF4 -9CF69CF39EBC9F3B9F4A5104510050FB50F550F9510251085109510551DC0000 -BC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -528752885289528D528A52F053B2562E563B56395632563F563456295653564E -565756745636562F56305880589F589E58B3589C58AE58A958A6596D5B095AFB -5B0B5AF55B0C5B085BEE5BEC5BE95BEB5C645C655D9D5D945E625E5F5E615EE2 -5EDA5EDF5EDD5EE35EE05F485F715FB75FB561766167616E615D615561820000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000617C6170616B617E61A7619061AB618E61AC619A61A4619461AE622E6469 -646F6479649E64B26488649064B064A56493649564A9649264AE64AD64AB649A -64AC649964A264B365756577657866AE66AB66B466B16A236A1F69E86A016A1E -6A1969FD6A216A136A0A69F36A026A0569ED6A116B506B4E6BA46BC56BC66F3F -6F7C6F846F516F666F546F866F6D6F5B6F786F6E6F8E6F7A6F706F646F976F58 -6ED56F6F6F606F5F719F71AC71B171A87256729B734E73577469748B74830000 -BD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -747E7480757F76207629761F7624762676217622769A76BA76E4778E7787778C -7791778B78CB78C578BA78CA78BE78D578BC78D07A3F7A3C7A407A3D7A377A3B -7AAF7AAE7BAD7BB17BC47BB47BC67BC77BC17BA07BCC7CCA7DE07DF47DEF7DFB -7DD87DEC7DDD7DE87DE37DDA7DDE7DE97D9E7DD97DF27DF97F757F777FAF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007FE98026819B819C819D81A0819A81988517853D851A84EE852C852D8513 -851185238521851484EC852584FF850687828774877687608766877887688759 -8757874C8753885B885D89108907891289138915890A8ABC8AD28AC78AC48A95 -8ACB8AF88AB28AC98AC28ABF8AB08AD68ACD8AB68AB98ADB8C4C8C4E8C6C8CE0 -8CDE8CE68CE48CEC8CED8CE28CE38CDC8CEA8CE18D6D8D9F8DA38E2B8E108E1D -8E228E0F8E298E1F8E218E1E8EBA8F1D8F1B8F1F8F298F268F2A8F1C8F1E0000 -BE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8F259069906E9068906D90779130912D9127913191879189918B918392C592BB -92B792EA92AC92E492C192B392BC92D292C792F092B295AD95B1970497069707 -97099760978D978B978F9821982B981C98B3990A99139912991899DD99D099DF -99DB99D199D599D299D99AB79AEE9AEF9B279B459B449B779B6F9D069D090000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009D039EA99EBE9ECE58A89F5251125118511451105115518051AA51DD5291 -529352F35659566B5679566956645678566A566856655671566F566C56625676 -58C158BE58C758C5596E5B1D5B345B785BF05C0E5F4A61B2619161A9618A61CD -61B661BE61CA61C8623064C564C164CB64BB64BC64DA64C464C764C264CD64BF -64D264D464BE657466C666C966B966C466C766B86A3D6A386A3A6A596A6B6A58 -6A396A446A626A616A4B6A476A356A5F6A486B596B776C056FC26FB16FA10000 -BF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6FC36FA46FC16FA76FB36FC06FB96FB66FA66FA06FB471BE71C971D071D271C8 -71D571B971CE71D971DC71C371C47368749C74A37498749F749E74E2750C750D -76347638763A76E776E577A0779E779F77A578E878DA78EC78E779A67A4D7A4E -7A467A4C7A4B7ABA7BD97C117BC97BE47BDB7BE17BE97BE67CD57CD67E0A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007E117E087E1B7E237E1E7E1D7E097E107F797FB27FF07FF17FEE802881B3 -81A981A881FB820882588259854A855985488568856985438549856D856A855E -8783879F879E87A2878D8861892A89328925892B892189AA89A68AE68AFA8AEB -8AF18B008ADC8AE78AEE8AFE8B018B028AF78AED8AF38AF68AFC8C6B8C6D8C93 -8CF48E448E318E348E428E398E358F3B8F2F8F388F338FA88FA6907590749078 -9072907C907A913491929320933692F89333932F932292FC932B9304931A0000 -C0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9310932693219315932E931995BB96A796A896AA96D5970E97119716970D9713 -970F975B975C9766979898309838983B9837982D9839982499109928991E991B -9921991A99ED99E299F19AB89ABC9AFB9AED9B289B919D159D239D269D289D12 -9D1B9ED89ED49F8D9F9C512A511F5121513252F5568E56805690568556870000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000568F58D558D358D158CE5B305B2A5B245B7A5C375C685DBC5DBA5DBD5DB8 -5E6B5F4C5FBD61C961C261C761E661CB6232623464CE64CA64D864E064F064E6 -64EC64F164E264ED6582658366D966D66A806A946A846AA26A9C6ADB6AA36A7E -6A976A906AA06B5C6BAE6BDA6C086FD86FF16FDF6FE06FDB6FE46FEB6FEF6F80 -6FEC6FE16FE96FD56FEE6FF071E771DF71EE71E671E571ED71EC71F471E07235 -72467370737274A974B074A674A876467642764C76EA77B377AA77B077AC0000 -C1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -77A777AD77EF78F778FA78F478EF790179A779AA7A577ABF7C077C0D7BFE7BF7 -7C0C7BE07CE07CDC7CDE7CE27CDF7CD97CDD7E2E7E3E7E467E377E327E437E2B -7E3D7E317E457E417E347E397E487E357E3F7E2F7F447FF37FFC807180728070 -806F807381C681C381BA81C281C081BF81BD81C981BE81E88209827185AA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008584857E859C8591859485AF859B858785A8858A866787C087D187B387D2 -87C687AB87BB87BA87C887CB893B893689448938893D89AC8B0E8B178B198B1B -8B0A8B208B1D8B048B108C418C3F8C738CFA8CFD8CFC8CF88CFB8DA88E498E4B -8E488E4A8F448F3E8F428F458F3F907F907D9084908190829080913991A3919E -919C934D938293289375934A9365934B9318937E936C935B9370935A935495CA -95CB95CC95C895C696B196B896D6971C971E97A097D3984698B699359A010000 -C2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -99FF9BAE9BAB9BAA9BAD9D3B9D3F9E8B9ECF9EDE9EDC9EDD9EDB9F3E9F4B53E2 -569556AE58D958D85B385F5D61E3623364F464F264FE650664FA64FB64F765B7 -66DC67266AB36AAC6AC36ABB6AB86AC26AAE6AAF6B5F6B786BAF7009700B6FFE -70066FFA7011700F71FB71FC71FE71F87377737574A774BF7515765676580000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000765277BD77BF77BB77BC790E79AE7A617A627A607AC47AC57C2B7C277C2A -7C1E7C237C217CE77E547E557E5E7E5A7E617E527E597F487FF97FFB80778076 -81CD81CF820A85CF85A985CD85D085C985B085BA85B985A687EF87EC87F287E0 -898689B289F48B288B398B2C8B2B8C508D058E598E638E668E648E5F8E558EC0 -8F498F4D90879083908891AB91AC91D09394938A939693A293B393AE93AC93B0 -9398939A939795D495D695D095D596E296DC96D996DB96DE972497A397A60000 -C3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -97AD97F9984D984F984C984E985398BA993E993F993D992E99A59A0E9AC19B03 -9B069B4F9B4E9B4D9BCA9BC99BFD9BC89BC09D519D5D9D609EE09F159F2C5133 -56A558DE58DF58E25BF59F905EEC61F261F761F661F56500650F66E066DD6AE5 -6ADD6ADA6AD3701B701F7028701A701D701570187206720D725872A273780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000737A74BD74CA74E375877586765F766177C7791979B17A6B7A697C3E7C3F -7C387C3D7C377C407E6B7E6D7E797E697E6A7F857E737FB67FB97FB881D885E9 -85DD85EA85D585E485E585F787FB8805880D87F987FE8960895F8956895E8B41 -8B5C8B588B498B5A8B4E8B4F8B468B598D088D0A8E7C8E728E878E768E6C8E7A -8E748F548F4E8FAD908A908B91B191AE93E193D193DF93C393C893DC93DD93D6 -93E293CD93D893E493D793E895DC96B496E3972A9727976197DC97FB985E0000 -C4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9858985B98BC994599499A169A199B0D9BE89BE79BD69BDB9D899D619D729D6A -9D6C9E929E979E939EB452F856A856B756B656B456BC58E45B405B435B7D5BF6 -5DC961F861FA65186514651966E667276AEC703E703070327210737B74CF7662 -76657926792A792C792B7AC77AF67C4C7C437C4D7CEF7CF08FAE7E7D7E7C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007E827F4C800081DA826685FB85F9861185FA8606860B8607860A88148815 -896489BA89F88B708B6C8B668B6F8B5F8B6B8D0F8D0D8E898E818E858E8291B4 -91CB9418940393FD95E1973098C49952995199A89A2B9A309A379A359C139C0D -9E799EB59EE89F2F9F5F9F639F615137513856C156C056C259145C6C5DCD61FC -61FE651D651C659566E96AFB6B046AFA6BB2704C721B72A774D674D4766977D3 -7C507E8F7E8C7FBC8617862D861A882388228821881F896A896C89BD8B740000 -C5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B778B7D8D138E8A8E8D8E8B8F5F8FAF91BA942E94339435943A94389432942B -95E297389739973297FF9867986599579A459A439A409A3E9ACF9B549B519C2D -9C259DAF9DB49DC29DB89E9D9EEF9F199F5C9F669F67513C513B56C856CA56C9 -5B7F5DD45DD25F4E61FF65246B0A6B6170517058738074E4758A766E766C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000079B37C607C5F807E807D81DF8972896F89FC8B808D168D178E918E938F61 -9148944494519452973D973E97C397C1986B99559A559A4D9AD29B1A9C499C31 -9C3E9C3B9DD39DD79F349F6C9F6A9F9456CC5DD662006523652B652A66EC6B10 -74DA7ACA7C647C637C657E937E967E9481E28638863F88318B8A9090908F9463 -946094649768986F995C9A5A9A5B9A579AD39AD49AD19C549C579C569DE59E9F -9EF456D158E9652C705E7671767277D77F507F888836883988628B938B920000 -C6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B9682778D1B91C0946A97429748974497C698709A5F9B229B589C5F9DF99DFA -9E7C9E7D9F079F779F725EF36B1670637C6C7C6E883B89C08EA191C194729470 -9871995E9AD69B239ECC706477DA8B9A947797C99A629A657E9C8B9C8EAA91C5 -947D947E947C9C779C789EF78C54947F9E1A72289A6A9B319E1B9E1E7C720000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030FE309D309E3005304130423043304430453046304730483049304A304B -304C304D304E304F3050305130523053305430553056305730583059305A305B -305C305D305E305F3060306130623063306430653066306730683069306A306B -306C306D306E306F3070307130723073307430753076307730783079307A307B -307C307D307E307F3080308130823083308430853086308730883089308A308B -308C308D308E308F309030913092309330A130A230A330A430A530A630A70000 -C7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30A830A930AA30AB30AC30AD30AE30AF30B030B130B230B330B430B530B630B7 -30B830B930BA30BB30BC30BD30BE30BF30C030C130C230C330C430C530C630C7 -30C830C930CA30CB30CC30CD30CE30CF30D030D130D230D330D430D530D630D7 -30D830D930DA30DB30DC30DD30DE30DF30E030E130E230E330E430E530E60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030E730E830E930EA30EB30EC30ED30EE30EF30F030F130F230F330F430F5 -30F60414041504010416041704180419041A041B041C04230424042504260427 -04280429042A042B042C042D042E042F04300431043204330434043504510436 -043704380439043A043B043C043D043E043F0440044104420443044404450446 -044704480449044A044B044C044D044E044F2460246124622463246424652466 -246724682469247424752476247724782479247A247B247C247D000000000000 -C9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E424E5C51F5531A53824E074E0C4E474E8D56D7FA0C5C6E5F734E0F51874E0E -4E2E4E934EC24EC94EC8519852FC536C53B957205903592C5C105DFF65E16BB3 -6BCC6C14723F4E314E3C4EE84EDC4EE94EE14EDD4EDA520C531C534C57225723 -5917592F5B815B845C125C3B5C745C735E045E805E825FC9620962506C150000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006C366C436C3F6C3B72AE72B0738A79B8808A961E4F0E4F184F2C4EF54F14 -4EF14F004EF74F084F1D4F024F054F224F134F044EF44F1251B1521352095210 -52A65322531F534D538A540756E156DF572E572A5734593C5980597C5985597B -597E5977597F5B565C155C255C7C5C7A5C7B5C7E5DDF5E755E845F025F1A5F74 -5FD55FD45FCF625C625E626462616266626262596260625A626565EF65EE673E -67396738673B673A673F673C67336C186C466C526C5C6C4F6C4A6C546C4B0000 -CA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6C4C7071725E72B472B5738E752A767F7A757F518278827C8280827D827F864D -897E909990979098909B909496229624962096234F564F3B4F624F494F534F64 -4F3E4F674F524F5F4F414F584F2D4F334F3F4F61518F51B9521C521E522152AD -52AE530953635372538E538F54305437542A545454455419541C542554180000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000543D544F544154285424544756EE56E756E557415745574C5749574B5752 -5906594059A6599859A05997598E59A25990598F59A759A15B8E5B925C285C2A -5C8D5C8F5C885C8B5C895C925C8A5C865C935C955DE05E0A5E0E5E8B5E895E8C -5E885E8D5F055F1D5F785F765FD25FD15FD05FED5FE85FEE5FF35FE15FE45FE3 -5FFA5FEF5FF75FFB60005FF4623A6283628C628E628F629462876271627B627A -6270628162886277627D62726274653765F065F465F365F265F5674567470000 -CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67596755674C6748675D674D675A674B6BD06C196C1A6C786C676C6B6C846C8B -6C8F6C716C6F6C696C9A6C6D6C876C956C9C6C666C736C656C7B6C8E7074707A -726372BF72BD72C372C672C172BA72C573957397739373947392753A75397594 -75957681793D80348095809980908092809C8290828F8285828E829182930000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000828A828382848C788FC98FBF909F90A190A5909E90A790A096309628962F -962D4E334F984F7C4F854F7D4F804F874F764F744F894F844F774F4C4F974F6A -4F9A4F794F814F784F904F9C4F944F9E4F924F824F954F6B4F6E519E51BC51BE -5235523252335246523152BC530A530B533C539253945487547F548154915482 -5488546B547A547E5465546C54745466548D546F546154605498546354675464 -56F756F9576F5772576D576B57715770577657805775577B5773577457620000 -CC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5768577D590C594559B559BA59CF59CE59B259CC59C159B659BC59C359D659B1 -59BD59C059C859B459C75B625B655B935B955C445C475CAE5CA45CA05CB55CAF -5CA85CAC5C9F5CA35CAD5CA25CAA5CA75C9D5CA55CB65CB05CA65E175E145E19 -5F285F225F235F245F545F825F7E5F7D5FDE5FE5602D602660196032600B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006034600A60176033601A601E602C6022600D6010602E60136011600C6009 -601C6214623D62AD62B462D162BE62AA62B662CA62AE62B362AF62BB62A962B0 -62B8653D65A865BB660965FC66046612660865FB6603660B660D660565FD6611 -661066F6670A6785676C678E67926776677B6798678667846774678D678C677A -679F679167996783677D67816778677967946B256B806B7E6BDE6C1D6C936CEC -6CEB6CEE6CD96CB66CD46CAD6CE76CB76CD06CC26CBA6CC36CC66CED6CF20000 -CD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6CD26CDD6CB46C8A6C9D6C806CDE6CC06D306CCD6CC76CB06CF96CCF6CE96CD1 -709470987085709370867084709170967082709A7083726A72D672CB72D872C9 -72DC72D272D472DA72CC72D173A473A173AD73A673A273A073AC739D74DD74E8 -753F7540753E758C759876AF76F376F176F076F577F877FC77F977FB77FA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077F77942793F79C57A787A7B7AFB7C757CFD8035808F80AE80A380B880B5 -80AD822082A082C082AB829A8298829B82B582A782AE82BC829E82BA82B482A8 -82A182A982C282A482C382B682A28670866F866D866E8C568FD28FCB8FD38FCD -8FD68FD58FD790B290B490AF90B390B09639963D963C963A96434FCD4FC54FD3 -4FB24FC94FCB4FC14FD44FDC4FD94FBB4FB34FDB4FC74FD64FBA4FC04FB94FEC -5244524952C052C2533D537C539753965399539854BA54A154AD54A554CF0000 -CE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54C3830D54B754AE54D654B654C554C654A0547054BC54A254BE547254DE54B0 -57B5579E579F57A4578C5797579D579B57945798578F579957A5579A579558F4 -590D595359E159DE59EE5A0059F159DD59FA59FD59FC59F659E459F259F759DB -59E959F359F559E059FE59F459ED5BA85C4C5CD05CD85CCC5CD75CCB5CDB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005CDE5CDA5CC95CC75CCA5CD65CD35CD45CCF5CC85CC65CCE5CDF5CF85DF9 -5E215E225E235E205E245EB05EA45EA25E9B5EA35EA55F075F2E5F565F866037 -603960546072605E6045605360476049605B604C60406042605F602460446058 -6066606E6242624362CF630D630B62F5630E630362EB62F9630F630C62F862F6 -63006313631462FA631562FB62F06541654365AA65BF6636662166326635661C -662666226633662B663A661D66346639662E670F671067C167F267C867BA0000 -CF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67DC67BB67F867D867C067B767C567EB67E467DF67B567CD67B367F767F667EE -67E367C267B967CE67E767F067B267FC67C667ED67CC67AE67E667DB67FA67C9 -67CA67C367EA67CB6B286B826B846BB66BD66BD86BE06C206C216D286D346D2D -6D1F6D3C6D3F6D126D0A6CDA6D336D046D196D3A6D1A6D116D006D1D6D420000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D016D186D376D036D0F6D406D076D206D2C6D086D226D096D1070B7709F -70BE70B170B070A170B470B570A972417249724A726C72707273726E72CA72E4 -72E872EB72DF72EA72E672E3738573CC73C273C873C573B973B673B573B473EB -73BF73C773BE73C373C673B873CB74EC74EE752E7547754875A775AA767976C4 -7708770377047705770A76F776FB76FA77E777E878067811781278057810780F -780E780978037813794A794C794B7945794479D579CD79CF79D679CE7A800000 -D0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7A7E7AD17B007B017C7A7C787C797C7F7C807C817D037D087D017F587F917F8D -7FBE8007800E800F8014803780D880C780E080D180C880C280D080C580E380D9 -80DC80CA80D580C980CF80D780E680CD81FF8221829482D982FE82F9830782E8 -830082D5833A82EB82D682F482EC82E182F282F5830C82FB82F682F082EA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000082E482E082FA82F382ED86778674867C86738841884E8867886A886989D3 -8A048A078D728FE38FE18FEE8FE090F190BD90BF90D590C590BE90C790CB90C8 -91D491D39654964F96519653964A964E501E50055007501350225030501B4FF5 -4FF450335037502C4FF64FF75017501C502050275035502F5031500E515A5194 -519351CA51C451C551C851CE5261525A5252525E525F5255526252CD530E539E -552654E25517551254E754F354E4551A54FF5504550854EB5511550554F10000 -D1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -550A54FB54F754F854E0550E5503550B5701570257CC583257D557D257BA57C6 -57BD57BC57B857B657BF57C757D057B957C1590E594A5A195A165A2D5A2E5A15 -5A0F5A175A0A5A1E5A335B6C5BA75BAD5BAC5C035C565C545CEC5CFF5CEE5CF1 -5CF75D005CF95E295E285EA85EAE5EAA5EAC5F335F305F67605D605A60670000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000604160A26088608060926081609D60836095609B60976087609C608E6219 -624662F263106356632C634463456336634363E46339634B634A633C63296341 -6334635863546359632D63476333635A63516338635763406348654A654665C6 -65C365C465C2664A665F6647665167126713681F681A684968326833683B684B -684F68166831681C6835682B682D682F684E68446834681D6812681468266828 -682E684D683A682568206B2C6B2F6B2D6B316B346B6D80826B886BE66BE40000 -D2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6BE86BE36BE26BE76C256D7A6D636D646D766D0D6D616D926D586D626D6D6D6F -6D916D8D6DEF6D7F6D866D5E6D676D606D976D706D7C6D5F6D826D986D2F6D68 -6D8B6D7E6D806D846D166D836D7B6D7D6D756D9070DC70D370D170DD70CB7F39 -70E270D770D270DE70E070D470CD70C570C670C770DA70CE70E1724272780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000072777276730072FA72F472FE72F672F372FB730173D373D973E573D673BC -73E773E373E973DC73D273DB73D473DD73DA73D773D873E874DE74DF74F474F5 -7521755B755F75B075C175BB75C475C075BF75B675BA768A76C9771D771B7710 -771377127723771177157719771A772277277823782C78227835782F7828782E -782B782178297833782A78317954795B794F795C79537952795179EB79EC79E0 -79EE79ED79EA79DC79DE79DD7A867A897A857A8B7A8C7A8A7A877AD87B100000 -D3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7B047B137B057B0F7B087B0A7B0E7B097B127C847C917C8A7C8C7C887C8D7C85 -7D1E7D1D7D117D0E7D187D167D137D1F7D127D0F7D0C7F5C7F617F5E7F607F5D -7F5B7F967F927FC37FC27FC08016803E803980FA80F280F980F5810180FB8100 -8201822F82258333832D83448319835183258356833F83418326831C83220000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008342834E831B832A8308833C834D8316832483208337832F832983478345 -834C8353831E832C834B832783488653865286A286A88696868D8691869E8687 -86978686868B869A868586A5869986A186A786958698868E869D869086948843 -8844886D88758876887288808871887F886F8883887E8874887C8A128C478C57 -8C7B8CA48CA38D768D788DB58DB78DB68ED18ED38FFE8FF590028FFF8FFB9004 -8FFC8FF690D690E090D990DA90E390DF90E590D890DB90D790DC90E491500000 -D4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -914E914F91D591E291DA965C965F96BC98E39ADF9B2F4E7F5070506A5061505E -50605053504B505D50725048504D5041505B504A506250155045505F5069506B -5063506450465040506E50735057505151D0526B526D526C526E52D652D3532D -539C55755576553C554D55505534552A55515562553655355530555255450000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000550C55325565554E55395548552D553B5540554B570A570757FB581457E2 -57F657DC57F4580057ED57FD580857F8580B57F357CF580757EE57E357F257E5 -57EC57E1580E57FC581057E75801580C57F157E957F0580D5804595C5A605A58 -5A555A675A5E5A385A355A6D5A505A5F5A655A6C5A535A645A575A435A5D5A52 -5A445A5B5A485A8E5A3E5A4D5A395A4C5A705A695A475A515A565A425A5C5B72 -5B6E5BC15BC05C595D1E5D0B5D1D5D1A5D205D0C5D285D0D5D265D255D0F0000 -D5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5D305D125D235D1F5D2E5E3E5E345EB15EB45EB95EB25EB35F365F385F9B5F96 -5F9F608A6090608660BE60B060BA60D360D460CF60E460D960DD60C860B160DB -60B760CA60BF60C360CD60C063326365638A6382637D63BD639E63AD639D6397 -63AB638E636F63876390636E63AF6375639C636D63AE637C63A4633B639F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006378638563816391638D6370655365CD66656661665B6659665C66626718 -687968876890689C686D686E68AE68AB6956686F68A368AC68A96875687468B2 -688F68776892687C686B687268AA68806871687E689B6896688B68A0688968A4 -6878687B6891688C688A687D6B366B336B376B386B916B8F6B8D6B8E6B8C6C2A -6DC06DAB6DB46DB36E746DAC6DE96DE26DB76DF66DD46E006DC86DE06DDF6DD6 -6DBE6DE56DDC6DDD6DDB6DF46DCA6DBD6DED6DF06DBA6DD56DC26DCF6DC90000 -D6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6DD06DF26DD36DFD6DD76DCD6DE36DBB70FA710D70F7711770F4710C70F07104 -70F3711070FC70FF71067113710070F870F6710B7102710E727E727B727C727F -731D7317730773117318730A730872FF730F731E738873F673F873F574047401 -73FD7407740073FA73FC73FF740C740B73F474087564756375CE75D275CF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075CB75CC75D175D0768F768976D37739772F772D7731773277347733773D -7725773B7735784878527849784D784A784C782678457850796479677969796A -7963796B796179BB79FA79F879F679F77A8F7A947A907B357B477B347B257B30 -7B227B247B337B187B2A7B1D7B317B2B7B2D7B2F7B327B387B1A7B237C947C98 -7C967CA37D357D3D7D387D367D3A7D457D2C7D297D417D477D3E7D3F7D4A7D3B -7D287F637F957F9C7F9D7F9B7FCA7FCB7FCD7FD07FD17FC77FCF7FC9801F0000 -D7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -801E801B804780438048811881258119811B812D811F812C811E812181158127 -811D8122821182388233823A823482328274839083A383A8838D837A837383A4 -8374838F8381839583998375839483A9837D8383838C839D839B83AA838B837E -83A583AF8388839783B0837F83A6838783AE8376839A8659865686BF86B70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000086C286C186C586BA86B086C886B986B386B886CC86B486BB86BC86C386BD -86BE88528889889588A888A288AA889A889188A1889F889888A78899889B8897 -88A488AC888C8893888E898289D689D989D58A308A278A2C8A1E8C398C3B8C5C -8C5D8C7D8CA58D7D8D7B8D798DBC8DC28DB98DBF8DC18ED88EDE8EDD8EDC8ED7 -8EE08EE19024900B9011901C900C902190EF90EA90F090F490F290F390D490EB -90EC90E991569158915A9153915591EC91F491F191F391F891E491F991EA0000 -D8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -91EB91F791E891EE957A95869588967C966D966B9671966F96BF976A980498E5 -9997509B50955094509E508B50A35083508C508E509D5068509C509250825087 -515F51D45312531153A453A7559155A855A555AD5577564555A255935588558F -55B5558155A3559255A4557D558C55A6557F559555A1558E570C582958370000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005819581E58275823582857F558485825581C581B5833583F5836582E5839 -5838582D582C583B59615AAF5A945A9F5A7A5AA25A9E5A785AA65A7C5AA55AAC -5A955AAE5A375A845A8A5A975A835A8B5AA95A7B5A7D5A8C5A9C5A8F5A935A9D -5BEA5BCD5BCB5BD45BD15BCA5BCE5C0C5C305D375D435D6B5D415D4B5D3F5D35 -5D515D4E5D555D335D3A5D525D3D5D315D595D425D395D495D385D3C5D325D36 -5D405D455E445E415F585FA65FA55FAB60C960B960CC60E260CE60C461140000 -D9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -60F2610A6116610560F5611360F860FC60FE60C161036118611D611060FF6104 -610B624A639463B163B063CE63E563E863EF63C3649D63F363CA63E063F663D5 -63F263F5646163DF63BE63DD63DC63C463D863D363C263C763CC63CB63C863F0 -63D763D965326567656A6564655C65686565658C659D659E65AE65D065D20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000667C666C667B668066716679666A66726701690C68D3690468DC692A68EC -68EA68F1690F68D668F768EB68E468F66913691068F368E1690768CC69086970 -68B4691168EF68C6691468F868D068FD68FC68E8690B690A691768CE68C868DD -68DE68E668F468D1690668D468E96915692568C76B396B3B6B3F6B3C6B946B97 -6B996B956BBD6BF06BF26BF36C306DFC6E466E476E1F6E496E886E3C6E3D6E45 -6E626E2B6E3F6E416E5D6E736E1C6E336E4B6E406E516E3B6E036E2E6E5E0000 -DA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6E686E5C6E616E316E286E606E716E6B6E396E226E306E536E656E276E786E64 -6E776E556E796E526E666E356E366E5A7120711E712F70FB712E713171237125 -71227132711F7128713A711B724B725A7288728972867285728B7312730B7330 -73227331733373277332732D732673237335730C742E742C7430742B74160000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000741A7421742D743174247423741D74297420743274FB752F756F756C75E7 -75DA75E175E675DD75DF75E475D77695769276DA774677477744774D7745774A -774E774B774C77DE77EC786078647865785C786D7871786A786E787078697868 -785E786279747973797279707A027A0A7A037A0C7A047A997AE67AE47B4A7B3B -7B447B487B4C7B4E7B407B587B457CA27C9E7CA87CA17D587D6F7D637D537D56 -7D677D6A7D4F7D6D7D5C7D6B7D527D547D697D517D5F7D4E7F3E7F3F7F650000 -DB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7F667FA27FA07FA17FD78051804F805080FE80D48143814A8152814F8147813D -814D813A81E681EE81F781F881F98204823C823D823F8275833B83CF83F98423 -83C083E8841283E783E483FC83F6841083C683C883EB83E383BF840183DD83E5 -83D883FF83E183CB83CE83D683F583C98409840F83DE8411840683C283F30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000083D583FA83C783D183EA841383C383EC83EE83C483FB83D783E2841B83DB -83FE86D886E286E686D386E386DA86EA86DD86EB86DC86EC86E986D786E886D1 -88488856885588BA88D788B988B888C088BE88B688BC88B788BD88B2890188C9 -89958998899789DD89DA89DB8A4E8A4D8A398A598A408A578A588A448A458A52 -8A488A518A4A8A4C8A4F8C5F8C818C808CBA8CBE8CB08CB98CB58D848D808D89 -8DD88DD38DCD8DC78DD68DDC8DCF8DD58DD98DC88DD78DC58EEF8EF78EFA0000 -DC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8EF98EE68EEE8EE58EF58EE78EE88EF68EEB8EF18EEC8EF48EE9902D9034902F -9106912C910490FF90FC910890F990FB9101910091079105910391619164915F -916291609201920A92259203921A9226920F920C9200921291FF91FD92069204 -92279202921C92249219921792059216957B958D958C95909687967E96880000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000096899683968096C296C896C396F196F0976C9770976E980798A998EB9CE6 -9EF94E834E844EB650BD50BF50C650AE50C450CA50B450C850C250B050C150BA -50B150CB50C950B650B851D7527A5278527B527C55C355DB55CC55D055CB55CA -55DD55C055D455C455E955BF55D2558D55CF55D555E255D655C855F255CD55D9 -55C25714585358685864584F584D5849586F5855584E585D58595865585B583D -5863587158FC5AC75AC45ACB5ABA5AB85AB15AB55AB05ABF5AC85ABB5AC60000 -DD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5AB75AC05ACA5AB45AB65ACD5AB95A905BD65BD85BD95C1F5C335D715D635D4A -5D655D725D6C5D5E5D685D675D625DF05E4F5E4E5E4A5E4D5E4B5EC55ECC5EC6 -5ECB5EC75F405FAF5FAD60F76149614A612B614561366132612E6146612F614F -612961406220916862236225622463C563F163EB641064126409642064240000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000064336443641F641564186439643764226423640C64266430642864416435 -642F640A641A644064256427640B63E7641B642E6421640E656F659265D36686 -668C66956690668B668A66996694667867206966695F6938694E69626971693F -6945696A6939694269576959697A694869496935696C6933693D696568F06978 -693469696940696F69446976695869416974694C693B694B6937695C694F6951 -69326952692F697B693C6B466B456B436B426B486B416B9BFA0D6BFB6BFC0000 -DE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6BF96BF76BF86E9B6ED66EC86E8F6EC06E9F6E936E946EA06EB16EB96EC66ED2 -6EBD6EC16E9E6EC96EB76EB06ECD6EA66ECF6EB26EBE6EC36EDC6ED86E996E92 -6E8E6E8D6EA46EA16EBF6EB36ED06ECA6E976EAE6EA371477154715271637160 -7141715D716271727178716A7161714271587143714B7170715F715071530000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007144714D715A724F728D728C72917290728E733C7342733B733A7340734A -73497444744A744B7452745174577440744F7450744E74427446744D745474E1 -74FF74FE74FD751D75797577698375EF760F760375F775FE75FC75F975F87610 -75FB75F675ED75F575FD769976B576DD7755775F776077527756775A77697767 -77547759776D77E07887789A7894788F788478957885788678A1788378797899 -78807896787B797C7982797D79797A117A187A197A127A177A157A227A130000 -DF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7A1B7A107AA37AA27A9E7AEB7B667B647B6D7B747B697B727B657B737B717B70 -7B617B787B767B637CB27CB47CAF7D887D867D807D8D7D7F7D857D7A7D8E7D7B -7D837D7C7D8C7D947D847D7D7D927F6D7F6B7F677F687F6C7FA67FA57FA77FDB -7FDC8021816481608177815C8169815B816281726721815E81768167816F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081448161821D8249824482408242824584F1843F845684768479848F848D -846584518440848684678430844D847D845A845984748473845D8507845E8437 -843A8434847A8443847884328445842983D9844B842F8442842D845F84708439 -844E844C8452846F84C5848E843B8447843684338468847E8444842B84608454 -846E8450870B870486F7870C86FA86D686F5874D86F8870E8709870186F6870D -870588D688CB88CD88CE88DE88DB88DA88CC88D08985899B89DF89E589E40000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -89E189E089E289DC89E68A768A868A7F8A618A3F8A778A828A848A758A838A81 -8A748A7A8C3C8C4B8C4A8C658C648C668C868C848C858CCC8D688D698D918D8C -8D8E8D8F8D8D8D938D948D908D928DF08DE08DEC8DF18DEE8DD08DE98DE38DE2 -8DE78DF28DEB8DF48F068EFF8F018F008F058F078F088F028F0B9052903F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090449049903D9110910D910F911191169114910B910E916E916F92489252 -9230923A926692339265925E9283922E924A9246926D926C924F92609267926F -92369261927092319254926392509272924E9253924C92569232959F959C959E -959B969296939691969796CE96FA96FD96F896F59773977797789772980F980D -980E98AC98F698F999AF99B299B099B59AAD9AAB9B5B9CEA9CED9CE79E809EFD -50E650D450D750E850F350DB50EA50DD50E450D350EC50F050EF50E350E00000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -51D85280528152E952EB533053AC56275615560C561255FC560F561C56015613 -560255FA561D560455FF55F95889587C5890589858865881587F5874588B587A -58875891588E587658825888587B5894588F58FE596B5ADC5AEE5AE55AD55AEA -5ADA5AED5AEB5AF35AE25AE05ADB5AEC5ADE5ADD5AD95AE85ADF5B775BE00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005BE35C635D825D805D7D5D865D7A5D815D775D8A5D895D885D7E5D7C5D8D -5D795D7F5E585E595E535ED85ED15ED75ECE5EDC5ED55ED95ED25ED45F445F43 -5F6F5FB6612C61286141615E61716173615261536172616C618061746154617A -615B6165613B616A6161615662296227622B642B644D645B645D647464766472 -6473647D6475646664A6644E6482645E645C644B645364606450647F643F646C -646B645964656477657365A066A166A0669F67056704672269B169B669C90000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -69A069CE699669B069AC69BC69916999698E69A7698D69A969BE69AF69BF69C4 -69BD69A469D469B969CA699A69CF69B3699369AA69A1699E69D96997699069C2 -69B569A569C66B4A6B4D6B4B6B9E6B9F6BA06BC36BC46BFE6ECE6EF56EF16F03 -6F256EF86F376EFB6F2E6F096F4E6F196F1A6F276F186F3B6F126EED6F0A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006F366F736EF96EEE6F2D6F406F306F3C6F356EEB6F076F0E6F436F056EFD -6EF66F396F1C6EFC6F3A6F1F6F0D6F1E6F086F21718771907189718071857182 -718F717B718671817197724472537297729572937343734D7351734C74627473 -7471747574727467746E750075027503757D759076167608760C76157611760A -761476B87781777C77857782776E7780776F777E778378B278AA78B478AD78A8 -787E78AB789E78A578A078AC78A278A47998798A798B79967995799479930000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -79977988799279907A2B7A4A7A307A2F7A287A267AA87AAB7AAC7AEE7B887B9C -7B8A7B917B907B967B8D7B8C7B9B7B8E7B857B9852847B997BA47B827CBB7CBF -7CBC7CBA7DA77DB77DC27DA37DAA7DC17DC07DC57D9D7DCE7DC47DC67DCB7DCC -7DAF7DB97D967DBC7D9F7DA67DAE7DA97DA17DC97F737FE27FE37FE57FDE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008024805D805C8189818681838187818D818C818B8215849784A484A1849F -84BA84CE84C284AC84AE84AB84B984B484C184CD84AA849A84B184D0849D84A7 -84BB84A2849484C784CC849B84A984AF84A884D6849884B684CF84A084D784D4 -84D284DB84B084918661873387238728876B8740872E871E87218719871B8743 -872C8741873E874687208732872A872D873C8712873A87318735874287268727 -87388724871A8730871188F788E788F188F288FA88FE88EE88FC88F688FB0000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -88F088EC88EB899D89A1899F899E89E989EB89E88AAB8A998A8B8A928A8F8A96 -8C3D8C688C698CD58CCF8CD78D968E098E028DFF8E0D8DFD8E0A8E038E078E06 -8E058DFE8E008E048F108F118F0E8F0D9123911C91209122911F911D911A9124 -9121911B917A91729179917392A592A49276929B927A92A0929492AA928D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000092A6929A92AB92799297927F92A392EE928E9282929592A2927D928892A1 -928A9286928C929992A7927E928792A9929D928B922D969E96A196FF9758977D -977A977E978397809782977B97849781977F97CE97CD981698AD98AE99029900 -9907999D999C99C399B999BB99BA99C299BD99C79AB19AE39AE79B3E9B3F9B60 -9B619B5F9CF19CF29CF59EA750FF5103513050F85106510750F650FE510B510C -50FD510A528B528C52F152EF56485642564C56355641564A5649564656580000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -565A56405633563D562C563E5638562A563A571A58AB589D58B158A058A358AF -58AC58A558A158FF5AFF5AF45AFD5AF75AF65B035AF85B025AF95B015B075B05 -5B0F5C675D995D975D9F5D925DA25D935D955DA05D9C5DA15D9A5D9E5E695E5D -5E605E5C7DF35EDB5EDE5EE15F495FB2618B6183617961B161B061A261890000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000619B619361AF61AD619F619261AA61A1618D616661B3622D646E64706496 -64A064856497649C648F648B648A648C64A3649F646864B164986576657A6579 -657B65B265B366B566B066A966B266B766AA66AF6A006A066A1769E569F86A15 -69F169E46A2069FF69EC69E26A1B6A1D69FE6A2769F269EE6A1469F769E76A40 -6A0869E669FB6A0D69FC69EB6A096A046A186A256A0F69F66A266A0769F46A16 -6B516BA56BA36BA26BA66C016C006BFF6C026F416F266F7E6F876FC66F920000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F8D6F896F8C6F626F4F6F856F5A6F966F766F6C6F826F556F726F526F506F57 -6F946F936F5D6F006F616F6B6F7D6F676F906F536F8B6F696F7F6F956F636F77 -6F6A6F7B71B271AF719B71B071A0719A71A971B5719D71A5719E71A471A171AA -719C71A771B37298729A73587352735E735F7360735D735B7361735A73590000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000736274877489748A74867481747D74857488747C747975087507757E7625 -761E7619761D761C7623761A7628761B769C769D769E769B778D778F77897788 -78CD78BB78CF78CC78D178CE78D478C878C378C478C9799A79A179A0799C79A2 -799B6B767A397AB27AB47AB37BB77BCB7BBE7BAC7BCE7BAF7BB97BCA7BB57CC5 -7CC87CCC7CCB7DF77DDB7DEA7DE77DD77DE17E037DFA7DE67DF67DF17DF07DEE -7DDF7F767FAC7FB07FAD7FED7FEB7FEA7FEC7FE67FE88064806781A3819F0000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -819E819581A2819981978216824F825382528250824E82518524853B850F8500 -8529850E8509850D851F850A8527851C84FB852B84FA8508850C84F4852A84F2 -851584F784EB84F384FC851284EA84E9851684FE8528851D852E850284FD851E -84F68531852684E784E884F084EF84F9851885208530850B8519852F86620000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000875687638764877787E1877387588754875B87528761875A8751875E876D -876A8750874E875F875D876F876C877A876E875C8765874F877B877587628767 -8769885A8905890C8914890B891789188919890689168911890E890989A289A4 -89A389ED89F089EC8ACF8AC68AB88AD38AD18AD48AD58ABB8AD78ABE8AC08AC5 -8AD88AC38ABA8ABD8AD98C3E8C4D8C8F8CE58CDF8CD98CE88CDA8CDD8CE78DA0 -8D9C8DA18D9B8E208E238E258E248E2E8E158E1B8E168E118E198E268E270000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E148E128E188E138E1C8E178E1A8F2C8F248F188F1A8F208F238F168F179073 -9070906F9067906B912F912B9129912A91329126912E91859186918A91819182 -9184918092D092C392C492C092D992B692CF92F192DF92D892E992D792DD92CC -92EF92C292E892CA92C892CE92E692CD92D592C992E092DE92E792D192D30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000092B592E192C692B4957C95AC95AB95AE95B096A496A296D3970597089702 -975A978A978E978897D097CF981E981D9826982998289820981B982798B29908 -98FA9911991499169917991599DC99CD99CF99D399D499CE99C999D699D899CB -99D799CC9AB39AEC9AEB9AF39AF29AF19B469B439B679B749B719B669B769B75 -9B709B689B649B6C9CFC9CFA9CFD9CFF9CF79D079D009CF99CFB9D089D059D04 -9E839ED39F0F9F10511C51135117511A511151DE533453E156705660566E0000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -567356665663566D5672565E5677571C571B58C858BD58C958BF58BA58C258BC -58C65B175B195B1B5B215B145B135B105B165B285B1A5B205B1E5BEF5DAC5DB1 -5DA95DA75DB55DB05DAE5DAA5DA85DB25DAD5DAF5DB45E675E685E665E6F5EE9 -5EE75EE65EE85EE55F4B5FBC619D61A8619661C561B461C661C161CC61BA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000061BF61B8618C64D764D664D064CF64C964BD648964C364DB64F364D96533 -657F657C65A266C866BE66C066CA66CB66CF66BD66BB66BA66CC67236A346A66 -6A496A676A326A686A3E6A5D6A6D6A766A5B6A516A286A5A6A3B6A3F6A416A6A -6A646A506A4F6A546A6F6A696A606A3C6A5E6A566A556A4D6A4E6A466B556B54 -6B566BA76BAA6BAB6BC86BC76C046C036C066FAD6FCB6FA36FC76FBC6FCE6FC8 -6F5E6FC46FBD6F9E6FCA6FA870046FA56FAE6FBA6FAC6FAA6FCF6FBF6FB80000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6FA26FC96FAB6FCD6FAF6FB26FB071C571C271BF71B871D671C071C171CB71D4 -71CA71C771CF71BD71D871BC71C671DA71DB729D729E736973667367736C7365 -736B736A747F749A74A074947492749574A1750B7580762F762D7631763D7633 -763C76357632763076BB76E6779A779D77A1779C779B77A277A3779577990000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000779778DD78E978E578EA78DE78E378DB78E178E278ED78DF78E079A47A44 -7A487A477AB67AB87AB57AB17AB77BDE7BE37BE77BDD7BD57BE57BDA7BE87BF9 -7BD47BEA7BE27BDC7BEB7BD87BDF7CD27CD47CD77CD07CD17E127E217E177E0C -7E1F7E207E137E0E7E1C7E157E1A7E227E0B7E0F7E167E0D7E147E257E247F43 -7F7B7F7C7F7A7FB17FEF802A8029806C81B181A681AE81B981B581AB81B081AC -81B481B281B781A781F282558256825785568545856B854D8553856185580000 -EB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -854085468564854185628544855185478563853E855B8571854E856E85758555 -85678560858C8566855D85548565856C866386658664879B878F879787938792 -87888781879687988779878787A3878587908791879D87848794879C879A8789 -891E89268930892D892E89278931892289298923892F892C891F89F18AE00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008AE28AF28AF48AF58ADD8B148AE48ADF8AF08AC88ADE8AE18AE88AFF8AEF -8AFB8C918C928C908CF58CEE8CF18CF08CF38D6C8D6E8DA58DA78E338E3E8E38 -8E408E458E368E3C8E3D8E418E308E3F8EBD8F368F2E8F358F328F398F378F34 -90769079907B908690FA913391359136919391909191918D918F9327931E9308 -931F9306930F937A9338933C931B9323931293019346932D930E930D92CB931D -92FA9325931392F992F793349302932492FF932993399335932A9314930C0000 -EC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -930B92FE9309930092FB931695BC95CD95BE95B995BA95B695BF95B595BD96A9 -96D4970B9712971097999797979497F097F89835982F98329924991F99279929 -999E99EE99EC99E599E499F099E399EA99E999E79AB99ABF9AB49ABB9AF69AFA -9AF99AF79B339B809B859B879B7C9B7E9B7B9B829B939B929B909B7A9B950000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009B7D9B889D259D179D209D1E9D149D299D1D9D189D229D109D199D1F9E88 -9E869E879EAE9EAD9ED59ED69EFA9F129F3D51265125512251245120512952F4 -5693568C568D568656845683567E5682567F568158D658D458CF58D25B2D5B25 -5B325B235B2C5B275B265B2F5B2E5B7B5BF15BF25DB75E6C5E6A5FBE5FBB61C3 -61B561BC61E761E061E561E461E861DE64EF64E964E364EB64E464E865816580 -65B665DA66D26A8D6A966A816AA56A896A9F6A9B6AA16A9E6A876A936A8E0000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A956A836AA86AA46A916A7F6AA66A9A6A856A8C6A926B5B6BAD6C096FCC6FA9 -6FF46FD46FE36FDC6FED6FE76FE66FDE6FF26FDD6FE26FE871E171F171E871F2 -71E471F071E27373736E736F749774B274AB749074AA74AD74B174A574AF7510 -75117512750F7584764376487649764776A476E977B577AB77B277B777B60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077B477B177A877F078F378FD790278FB78FC78F2790578F978FE790479AB -79A87A5C7A5B7A567A587A547A5A7ABE7AC07AC17C057C0F7BF27C007BFF7BFB -7C0E7BF47C0B7BF37C027C097C037C017BF87BFD7C067BF07BF17C107C0A7CE8 -7E2D7E3C7E427E3398487E387E2A7E497E407E477E297E4C7E307E3B7E367E44 -7E3A7F457F7F7F7E7F7D7FF47FF2802C81BB81C481CC81CA81C581C781BC81E9 -825B825A825C85838580858F85A7859585A0858B85A3857B85A4859A859E0000 -EE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8577857C858985A1857A85788557858E85968586858D8599859D858185A28582 -858885858579857685988590859F866887BE87AA87AD87C587B087AC87B987B5 -87BC87AE87C987C387C287CC87B787AF87C487CA87B487B687BF87B887BD87DE -87B289358933893C893E894189528937894289AD89AF89AE89F289F38B1E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008B188B168B118B058B0B8B228B0F8B128B158B078B0D8B088B068B1C8B13 -8B1A8C4F8C708C728C718C6F8C958C948CF98D6F8E4E8E4D8E538E508E4C8E47 -8F438F409085907E9138919A91A2919B9199919F91A1919D91A093A1938393AF -936493569347937C9358935C93769349935093519360936D938F934C936A9379 -935793559352934F93719377937B9361935E936393679380934E935995C795C0 -95C995C395C595B796AE96B096AC9720971F9718971D9719979A97A1979C0000 -EF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -979E979D97D597D497F198419844984A9849984598439925992B992C992A9933 -9932992F992D99319930999899A399A19A0299FA99F499F799F999F899F699FB -99FD99FE99FC9A039ABE9AFE9AFD9B019AFC9B489B9A9BA89B9E9B9B9BA69BA1 -9BA59BA49B869BA29BA09BAF9D339D419D679D369D2E9D2F9D319D389D300000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009D459D429D439D3E9D379D409D3D7FF59D2D9E8A9E899E8D9EB09EC89EDA -9EFB9EFF9F249F239F229F549FA05131512D512E5698569C5697569A569D5699 -59705B3C5C695C6A5DC05E6D5E6E61D861DF61ED61EE61F161EA61F061EB61D6 -61E964FF650464FD64F86501650364FC659465DB66DA66DB66D86AC56AB96ABD -6AE16AC66ABA6AB66AB76AC76AB46AAD6B5E6BC96C0B7007700C700D70017005 -7014700E6FFF70006FFB70266FFC6FF7700A720171FF71F9720371FD73760000 -F0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74B874C074B574C174BE74B674BB74C275147513765C76647659765076537657 -765A76A676BD76EC77C277BA78FF790C79137914790979107912791179AD79AC -7A5F7C1C7C297C197C207C1F7C2D7C1D7C267C287C227C257C307E5C7E507E56 -7E637E587E627E5F7E517E607E577E537FB57FB37FF77FF8807581D181D20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081D0825F825E85B485C685C085C385C285B385B585BD85C785C485BF85CB -85CE85C885C585B185B685D2862485B885B785BE866987E787E687E287DB87EB -87EA87E587DF87F387E487D487DC87D387ED87D887E387A487D787D9880187F4 -87E887DD8953894B894F894C89468950895189498B2A8B278B238B338B308B35 -8B478B2F8B3C8B3E8B318B258B378B268B368B2E8B248B3B8B3D8B3A8C428C75 -8C998C988C978CFE8D048D028D008E5C8E628E608E578E568E5E8E658E670000 -F1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E5B8E5A8E618E5D8E698E548F468F478F488F4B9128913A913B913E91A891A5 -91A791AF91AA93B5938C939293B7939B939D938993A7938E93AA939E93A69395 -93889399939F938D93B1939193B293A493A893B493A393A595D295D395D196B3 -96D796DA5DC296DF96D896DD97239722972597AC97AE97A897AB97A497AA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000097A297A597D797D997D697D897FA98509851985298B89941993C993A9A0F -9A0B9A099A0D9A049A119A0A9A059A079A069AC09ADC9B089B049B059B299B35 -9B4A9B4C9B4B9BC79BC69BC39BBF9BC19BB59BB89BD39BB69BC49BB99BBD9D5C -9D539D4F9D4A9D5B9D4B9D599D569D4C9D579D529D549D5F9D589D5A9E8E9E8C -9EDF9F019F009F169F259F2B9F2A9F299F289F4C9F5551345135529652F753B4 -56AB56AD56A656A756AA56AC58DA58DD58DB59125B3D5B3E5B3F5DC35E700000 -F2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5FBF61FB65076510650D6509650C650E658465DE65DD66DE6AE76AE06ACC6AD1 -6AD96ACB6ADF6ADC6AD06AEB6ACF6ACD6ADE6B606BB06C0C7019702770207016 -702B702170227023702970177024701C702A720C720A72077202720572A572A6 -72A472A372A174CB74C574B774C37516766077C977CA77C477F1791D791B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007921791C7917791E79B07A677A687C337C3C7C397C2C7C3B7CEC7CEA7E76 -7E757E787E707E777E6F7E7A7E727E747E687F4B7F4A7F837F867FB77FFD7FFE -807881D781D582648261826385EB85F185ED85D985E185E885DA85D785EC85F2 -85F885D885DF85E385DC85D185F085E685EF85DE85E2880087FA880387F687F7 -8809880C880B880687FC880887FF880A88028962895A895B89578961895C8958 -895D8959898889B789B689F68B508B488B4A8B408B538B568B548B4B8B550000 -F3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B518B428B528B578C438C778C768C9A8D068D078D098DAC8DAA8DAD8DAB8E6D -8E788E738E6A8E6F8E7B8EC28F528F518F4F8F508F538FB49140913F91B091AD -93DE93C793CF93C293DA93D093F993EC93CC93D993A993E693CA93D493EE93E3 -93D593C493CE93C093D293E7957D95DA95DB96E19729972B972C972897260000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000097B397B797B697DD97DE97DF985C9859985D985798BF98BD98BB98BE9948 -9947994399A699A79A1A9A159A259A1D9A249A1B9A229A209A279A239A1E9A1C -9A149AC29B0B9B0A9B0E9B0C9B379BEA9BEB9BE09BDE9BE49BE69BE29BF09BD4 -9BD79BEC9BDC9BD99BE59BD59BE19BDA9D779D819D8A9D849D889D719D809D78 -9D869D8B9D8C9D7D9D6B9D749D759D709D699D859D739D7B9D829D6F9D799D7F -9D879D689E949E919EC09EFC9F2D9F409F419F4D9F569F579F58533756B20000 -F4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -56B556B358E35B455DC65DC75EEE5EEF5FC05FC161F9651765166515651365DF -66E866E366E46AF36AF06AEA6AE86AF96AF16AEE6AEF703C7035702F70377034 -703170427038703F703A70397040703B703370417213721472A8737D737C74BA -76AB76AA76BE76ED77CC77CE77CF77CD77F27925792379277928792479290000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000079B27A6E7A6C7A6D7AF77C497C487C4A7C477C457CEE7E7B7E7E7E817E80 -7FBA7FFF807981DB81D9820B82688269862285FF860185FE861B860085F68604 -86098605860C85FD8819881088118817881388168963896689B989F78B608B6A -8B5D8B688B638B658B678B6D8DAE8E868E888E848F598F568F578F558F588F5A -908D9143914191B791B591B291B3940B941393FB9420940F941493FE94159410 -94289419940D93F5940093F79407940E9416941293FA940993F8940A93FF0000 -F5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -93FC940C93F69411940695DE95E095DF972E972F97B997BB97FD97FE98609862 -9863985F98C198C29950994E9959994C994B99539A329A349A319A2C9A2A9A36 -9A299A2E9A389A2D9AC79ACA9AC69B109B129B119C0B9C089BF79C059C129BF8 -9C409C079C0E9C069C179C149C099D9F9D999DA49D9D9D929D989D909D9B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009DA09D949D9C9DAA9D979DA19D9A9DA29DA89D9E9DA39DBF9DA99D969DA6 -9DA79E999E9B9E9A9EE59EE49EE79EE69F309F2E9F5B9F609F5E9F5D9F599F91 -513A51395298529756C356BD56BE5B485B475DCB5DCF5EF161FD651B6B026AFC -6B036AF86B0070437044704A7048704970457046721D721A7219737E7517766A -77D0792D7931792F7C547C537CF27E8A7E877E887E8B7E867E8D7F4D7FBB8030 -81DD8618862A8626861F8623861C86198627862E862186208629861E86250000 -F6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8829881D881B88208824881C882B884A896D8969896E896B89FA8B798B788B45 -8B7A8B7B8D108D148DAF8E8E8E8C8F5E8F5B8F5D91469144914591B9943F943B -94369429943D943C94309439942A9437942C9440943195E595E495E39735973A -97BF97E1986498C998C698C0995899569A399A3D9A469A449A429A419A3A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009A3F9ACD9B159B179B189B169B3A9B529C2B9C1D9C1C9C2C9C239C289C29 -9C249C219DB79DB69DBC9DC19DC79DCA9DCF9DBE9DC59DC39DBB9DB59DCE9DB9 -9DBA9DAC9DC89DB19DAD9DCC9DB39DCD9DB29E7A9E9C9EEB9EEE9EED9F1B9F18 -9F1A9F319F4E9F659F649F924EB956C656C556CB59715B4B5B4C5DD55DD15EF2 -65216520652665226B0B6B086B096C0D7055705670577052721E721F72A9737F -74D874D574D974D7766D76AD793579B47A707A717C577C5C7C597C5B7C5A0000 -F7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7CF47CF17E917F4F7F8781DE826B863486358633862C86328636882C88288826 -882A8825897189BF89BE89FB8B7E8B848B828B868B858B7F8D158E958E948E9A -8E928E908E968E978F608F629147944C9450944A944B944F9447944594489449 -9446973F97E3986A986998CB9954995B9A4E9A539A549A4C9A4F9A489A4A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009A499A529A509AD09B199B2B9B3B9B569B559C469C489C3F9C449C399C33 -9C419C3C9C379C349C329C3D9C369DDB9DD29DDE9DDA9DCB9DD09DDC9DD19DDF -9DE99DD99DD89DD69DF59DD59DDD9EB69EF09F359F339F329F429F6B9F959FA2 -513D529958E858E759725B4D5DD8882F5F4F62016203620465296525659666EB -6B116B126B0F6BCA705B705A7222738273817383767077D47C677C667E95826C -863A86408639863C8631863B863E88308832882E883389768974897389FE0000 -F8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B8C8B8E8B8B8B888C458D198E988F648F6391BC94629455945D9457945E97C4 -97C598009A569A599B1E9B1F9B209C529C589C509C4A9C4D9C4B9C559C599C4C -9C4E9DFB9DF79DEF9DE39DEB9DF89DE49DF69DE19DEE9DE69DF29DF09DE29DEC -9DF49DF39DE89DED9EC29ED09EF29EF39F069F1C9F389F379F369F439F4F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009F719F709F6E9F6F56D356CD5B4E5C6D652D66ED66EE6B13705F7061705D -7060722374DB74E577D5793879B779B67C6A7E977F89826D8643883888378835 -884B8B948B958E9E8E9F8EA08E9D91BE91BD91C2946B9468946996E597469743 -974797C797E59A5E9AD59B599C639C679C669C629C5E9C609E029DFE9E079E03 -9E069E059E009E019E099DFF9DFD9E049EA09F1E9F469F749F759F7656D4652E -65B86B186B196B176B1A7062722672AA77D877D979397C697C6B7CF67E9A0000 -F9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7E987E9B7E9981E081E18646864786488979897A897C897B89FF8B988B998EA5 -8EA48EA3946E946D946F9471947397499872995F9C689C6E9C6D9E0B9E0D9E10 -9E0F9E129E119EA19EF59F099F479F789F7B9F7A9F79571E70667C6F883C8DB2 -8EA691C394749478947694759A609C749C739C719C759E149E139EF69F0A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009FA4706870657CF7866A883E883D883F8B9E8C9C8EA98EC9974B98739874 -98CC996199AB9A649A669A679B249E159E179F4862076B1E7227864C8EA89482 -948094819A699A689B2E9E197229864B8B9F94839C799EB776759A6B9C7A9E1D -7069706A9EA49F7E9F499F980000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/cp1250.enc b/library/encoding/cp1250.enc deleted file mode 100644 index 934539a..0000000 --- a/library/encoding/cp1250.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1250, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00800081201A0083201E2026202020210088203001602039015A0164017D0179 -009020182019201C201D202220132014009821220161203A015B0165017E017A -00A002C702D8014100A4010400A600A700A800A9015E00AB000000AD00AE017B -00B000B102DB014200B400B500B600B700B80105015F00BB013D02DD013E017C -015400C100C2010200C40139010600C7010C00C9011800CB011A00CD00CE010E -01100143014700D300D4015000D600D70158016E00DA017000DC00DD016200DF -015500E100E2010300E4013A010700E7010D00E9011900EB011B00ED00EE010F -01110144014800F300F4015100F600F70159016F00FA017100FC00FD016302D9 diff --git a/library/encoding/cp1251.enc b/library/encoding/cp1251.enc deleted file mode 100644 index 7daed16..0000000 --- a/library/encoding/cp1251.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1251, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -04020403201A0453201E2026202020210088203004092039040A040C040B040F -045220182019201C201D202220132014009821220459203A045A045C045B045F -00A0040E045E040800A4049000A600A7040100A9040400AB00AC00AD00AE0407 -00B000B104060456049100B500B600B704512116045400BB0458040504550457 -0410041104120413041404150416041704180419041A041B041C041D041E041F -0420042104220423042404250426042704280429042A042B042C042D042E042F -0430043104320433043404350436043704380439043A043B043C043D043E043F -0440044104420443044404450446044704480449044A044B044C044D044E044F diff --git a/library/encoding/cp1252.enc b/library/encoding/cp1252.enc deleted file mode 100644 index fe55a46..0000000 --- a/library/encoding/cp1252.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1252, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00800081201A0192201E20262020202102C62030016020390152008D008E008F -009020182019201C201D20222013201402DC21220161203A0153009D009E0178 -00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF -00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF -00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF -00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF -00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF -00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF diff --git a/library/encoding/cp1253.enc b/library/encoding/cp1253.enc deleted file mode 100644 index a934bc9..0000000 --- a/library/encoding/cp1253.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1253, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00800081201A0192201E20262020202100882030008A2039008C008D008E008F -009020182019201C201D20222013201400982122009A203A009C009D009E009F -00A00385038600A300A400A500A600A700A800A9000000AB00AC00AD00AE2015 -00B000B100B200B3038400B500B600B703880389038A00BB038C00BD038E038F -0390039103920393039403950396039703980399039A039B039C039D039E039F -03A003A1000003A303A403A503A603A703A803A903AA03AB03AC03AD03AE03AF -03B003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C203C303C403C503C603C703C803C903CA03CB03CC03CD03CE0000 diff --git a/library/encoding/cp1254.enc b/library/encoding/cp1254.enc deleted file mode 100644 index d8553a2..0000000 --- a/library/encoding/cp1254.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1254, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00800081201A0192201E20262020202102C62030016020390152008D008E008F -009020182019201C201D20222013201402DC21220161203A0153009D009E0178 -00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF -00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF -00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF -011E00D100D200D300D400D500D600D700D800D900DA00DB00DC0130015E00DF -00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF -011F00F100F200F300F400F500F600F700F800F900FA00FB00FC0131015F00FF diff --git a/library/encoding/cp1255.enc b/library/encoding/cp1255.enc deleted file mode 100644 index 275c016..0000000 --- a/library/encoding/cp1255.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1255, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00800081201A0192201E20262020202102C62030008A2039008C008D008E008F -009020182019201C201D20222013201402DC2122009A203A009C009D009E009F -00A0000000A200A320AA00A500A600A700A800A9000000AB00AC00AD00AE00AF -00B000B100B200B300B400B500B600B7000000B9000000BB00BC00BD00BE0000 -05B005B105B205B305B405B505B605B705B805B905BA05BB05BC05BD05BE05BF -05C005C105C205C305F005F105F2000000000000000000000000000000000000 -05D005D105D205D305D405D505D605D705D805D905DA05DB05DC05DD05DE05DF -05E005E105E205E305E405E505E605E705E805E905EA00000000200E200F0000 diff --git a/library/encoding/cp1256.enc b/library/encoding/cp1256.enc deleted file mode 100644 index 1a9d8a6..0000000 --- a/library/encoding/cp1256.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1256, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080067E201A0192201E20262020202102C62030008A2039015206860698008F -06AF20182019201C201D20222013201400982122009A203A0153200C200D009F -00A0060C00A200A300A400A500A600A700A800A9000000AB00AC00AD00AE00AF -00B000B100B200B300B400B500B600B700B800B9061B00BB00BC00BD00BE061F -0000062106220623062406250626062706280629062A062B062C062D062E062F -063006310632063306340635063600D7063706380639063A0640064106420643 -00E0064400E2064506460647064800E700E800E900EA00EB0649064A00EE00EF -064B064C064D064E00F4064F065000F7065100F9065200FB00FC200E200F0000 diff --git a/library/encoding/cp1257.enc b/library/encoding/cp1257.enc deleted file mode 100644 index 4aab0c6..0000000 --- a/library/encoding/cp1257.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1257, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00800081201A0083201E20262020202100882030008A2039008C00A802C700B8 -009020182019201C201D20222013201400982122009A203A009C00AF02DB009F -00A0000000A200A300A4000000A600A700D800A9015600AB00AC00AD00AE00C6 -00B000B100B200B300B400B500B600B700F800B9015700BB00BC00BD00BE00E6 -0104012E0100010600C400C501180112010C00C90179011601220136012A013B -01600143014500D3014C00D500D600D701720141015A016A00DC017B017D00DF -0105012F0101010700E400E501190113010D00E9017A011701230137012B013C -01610144014600F3014D00F500F600F701730142015B016B00FC017C017E02D9 diff --git a/library/encoding/cp1258.enc b/library/encoding/cp1258.enc deleted file mode 100644 index 8c1fce8..0000000 --- a/library/encoding/cp1258.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp1258, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00800081201A0192201E20262020202102C62030008A20390152008D008E008F -009020182019201C201D20222013201402DC2122009A203A0153009D009E0178 -00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF -00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF -00C000C100C2010200C400C500C600C700C800C900CA00CB034000CD00CE00CF -011000D1030900D300D401A000D600D700D800D900DA00DB00DC01AF030300DF -00E000E100E2010300E400E500E600E700E800E900EA00EB034100ED00EE00EF -011100F1032300F300F401A100F600F700F800F900FA00FB00FC01B020AB00FF diff --git a/library/encoding/cp437.enc b/library/encoding/cp437.enc deleted file mode 100644 index ecae4e6..0000000 --- a/library/encoding/cp437.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp437, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C700FC00E900E200E400E000E500E700EA00EB00E800EF00EE00EC00C400C5 -00C900E600C600F400F600F200FB00F900FF00D600DC00A200A300A520A70192 -00E100ED00F300FA00F100D100AA00BA00BF231000AC00BD00BC00A100AB00BB -259125922593250225242561256225562555256325512557255D255C255B2510 -25142534252C251C2500253C255E255F255A25542569256625602550256C2567 -2568256425652559255825522553256B256A2518250C25882584258C25902580 -03B100DF039303C003A303C300B503C403A6039803A903B4221E03C603B52229 -226100B1226522642320232100F7224800B0221900B7221A207F00B225A000A0 diff --git a/library/encoding/cp737.enc b/library/encoding/cp737.enc deleted file mode 100644 index 5b59661..0000000 --- a/library/encoding/cp737.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp737, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -039103920393039403950396039703980399039A039B039C039D039E039F03A0 -03A103A303A403A503A603A703A803A903B103B203B303B403B503B603B703B8 -03B903BA03BB03BC03BD03BE03BF03C003C103C303C203C403C503C603C703C8 -259125922593250225242561256225562555256325512557255D255C255B2510 -25142534252C251C2500253C255E255F255A25542569256625602550256C2567 -2568256425652559255825522553256B256A2518250C25882584258C25902580 -03C903AC03AD03AE03CA03AF03CC03CD03CB03CE038603880389038A038C038E -038F00B12265226403AA03AB00F7224800B0221900B7221A207F00B225A000A0 diff --git a/library/encoding/cp775.enc b/library/encoding/cp775.enc deleted file mode 100644 index 71b65c3..0000000 --- a/library/encoding/cp775.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp775, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -010600FC00E9010100E4012300E501070142011301560157012B017900C400C5 -00C900E600C6014D00F6012200A2015A015B00D600DC00F800A300D800D700A4 -0100012A00F3017B017C017A201D00A600A900AE00AC00BD00BC014100AB00BB -259125922593250225240104010C01180116256325512557255D012E01602510 -25142534252C251C2500253C0172016A255A25542569256625602550256C017D -0105010D01190117012F01610173016B017E2518250C25882584258C25902580 -00D300DF014C014300F500D500B5014401360137013B013C0146011201452019 -00AD00B1201C00BE00B600A700F7201E00B0221900B700B900B300B225A000A0 diff --git a/library/encoding/cp850.enc b/library/encoding/cp850.enc deleted file mode 100644 index 4e7a90d..0000000 --- a/library/encoding/cp850.enc +++ /dev/null @@ -1,20 +0,0 @@ -# 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 diff --git a/library/encoding/cp852.enc b/library/encoding/cp852.enc deleted file mode 100644 index f34899e..0000000 --- a/library/encoding/cp852.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp852, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C700FC00E900E200E4016F010700E7014200EB0150015100EE017900C40106 -00C90139013A00F400F6013D013E015A015B00D600DC01640165014100D7010D -00E100ED00F300FA01040105017D017E0118011900AC017A010C015F00AB00BB -2591259225932502252400C100C2011A015E256325512557255D017B017C2510 -25142534252C251C2500253C01020103255A25542569256625602550256C00A4 -01110110010E00CB010F014700CD00CE011B2518250C258825840162016E2580 -00D300DF00D401430144014801600161015400DA0155017000FD00DD016300B4 -00AD02DD02DB02C702D800A700F700B800B000A802D901710158015925A000A0 diff --git a/library/encoding/cp855.enc b/library/encoding/cp855.enc deleted file mode 100644 index 4d58b86..0000000 --- a/library/encoding/cp855.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp855, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0452040204530403045104010454040404550405045604060457040704580408 -04590409045A040A045B040B045C040C045E040E045F040F044E042E044A042A -0430041004310411044604260434041404350415044404240433041300AB00BB -259125922593250225240445042504380418256325512557255D043904192510 -25142534252C251C2500253C043A041A255A25542569256625602550256C00A4 -043B041B043C041C043D041D043E041E043F2518250C25882584041F044F2580 -042F044004200441042104420422044304230436041604320412044C042C2116 -00AD044B042B0437041704480428044D042D044904290447042700A725A000A0 diff --git a/library/encoding/cp857.enc b/library/encoding/cp857.enc deleted file mode 100644 index b42ed55..0000000 --- a/library/encoding/cp857.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp857, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C700FC00E900E200E400E000E500E700EA00EB00E800EF00EE013100C400C5 -00C900E600C600F400F600F200FB00F9013000D600DC00F800A300D8015E015F -00E100ED00F300FA00F100D1011E011F00BF00AE00AC00BD00BC00A100AB00BB -2591259225932502252400C100C200C000A9256325512557255D00A200A52510 -25142534252C251C2500253C00E300C3255A25542569256625602550256C00A4 -00BA00AA00CA00CB00C8000000CD00CE00CF2518250C2588258400A600CC2580 -00D300DF00D400D200F500D500B5000000D700DA00DB00D900EC00FF00AF00B4 -00AD00B1000000BE00B600A700F700B800B000A800B700B900B300B225A000A0 diff --git a/library/encoding/cp860.enc b/library/encoding/cp860.enc deleted file mode 100644 index 871943b..0000000 --- a/library/encoding/cp860.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp860, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C700FC00E900E200E300E000C100E700EA00CA00E800CD00D400EC00C300C2 -00C900C000C800F400F500F200DA00F900CC00D500DC00A200A300D920A700D3 -00E100ED00F300FA00F100D100AA00BA00BF00D200AC00BD00BC00A100AB00BB -259125922593250225242561256225562555256325512557255D255C255B2510 -25142534252C251C2500253C255E255F255A25542569256625602550256C2567 -2568256425652559255825522553256B256A2518250C25882584258C25902580 -03B100DF039303C003A303C300B503C403A6039803A903B4221E03C603B52229 -226100B1226522642320232100F7224800B0221900B7221A207F00B225A000A0 diff --git a/library/encoding/cp861.enc b/library/encoding/cp861.enc deleted file mode 100644 index 3f8f605..0000000 --- a/library/encoding/cp861.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp861, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C700FC00E900E200E400E000E500E700EA00EB00E800D000F000DE00C400C5 -00C900E600C600F400F600FE00FB00DD00FD00D600DC00F800A300D820A70192 -00E100ED00F300FA00C100CD00D300DA00BF231000AC00BD00BC00A100AB00BB -259125922593250225242561256225562555256325512557255D255C255B2510 -25142534252C251C2500253C255E255F255A25542569256625602550256C2567 -2568256425652559255825522553256B256A2518250C25882584258C25902580 -03B100DF039303C003A303C300B503C403A6039803A903B4221E03C603B52229 -226100B1226522642320232100F7224800B0221900B7221A207F00B225A000A0 diff --git a/library/encoding/cp862.enc b/library/encoding/cp862.enc deleted file mode 100644 index 5f9d16c..0000000 --- a/library/encoding/cp862.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp862, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -05D005D105D205D305D405D505D605D705D805D905DA05DB05DC05DD05DE05DF -05E005E105E205E305E405E505E605E705E805E905EA00A200A300A520A70192 -00E100ED00F300FA00F100D100AA00BA00BF231000AC00BD00BC00A100AB00BB -259125922593250225242561256225562555256325512557255D255C255B2510 -25142534252C251C2500253C255E255F255A25542569256625602550256C2567 -2568256425652559255825522553256B256A2518250C25882584258C25902580 -03B100DF039303C003A303C300B503C403A6039803A903B4221E03C603B52229 -226100B1226522642320232100F7224800B0221900B7221A207F00B225A000A0 diff --git a/library/encoding/cp863.enc b/library/encoding/cp863.enc deleted file mode 100644 index c8b8686..0000000 --- a/library/encoding/cp863.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp863, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C700FC00E900E200C200E000B600E700EA00EB00E800EF00EE201700C000A7 -00C900C800CA00F400CB00CF00FB00F900A400D400DC00A200A300D900DB0192 -00A600B400F300FA00A800B800B300AF00CE231000AC00BD00BC00BE00AB00BB -259125922593250225242561256225562555256325512557255D255C255B2510 -25142534252C251C2500253C255E255F255A25542569256625602550256C2567 -2568256425652559255825522553256B256A2518250C25882584258C25902580 -03B100DF039303C003A303C300B503C403A6039803A903B4221E03C603B52229 -226100B1226522642320232100F7224800B0221900B7221A207F00B225A000A0 diff --git a/library/encoding/cp864.enc b/library/encoding/cp864.enc deleted file mode 100644 index 71f9e62..0000000 --- a/library/encoding/cp864.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp864, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -00200021002200230024066A0026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00B000B72219221A259225002502253C2524252C251C25342510250C25142518 -03B2221E03C600B100BD00BC224800AB00BBFEF7FEF8009B009CFEFBFEFC009F -00A000ADFE8200A300A4FE8400000000FE8EFE8FFE95FE99060CFE9DFEA1FEA5 -0660066106620663066406650666066706680669FED1061BFEB1FEB5FEB9061F -00A2FE80FE81FE83FE85FECAFE8BFE8DFE91FE93FE97FE9BFE9FFEA3FEA7FEA9 -FEABFEADFEAFFEB3FEB7FEBBFEBFFEC1FEC5FECBFECF00A600AC00F700D7FEC9 -0640FED3FED7FEDBFEDFFEE3FEE7FEEBFEEDFEEFFEF3FEBDFECCFECEFECDFEE1 -FE7D0651FEE5FEE9FEECFEF0FEF2FED0FED5FEF5FEF6FEDDFED9FEF125A00000 diff --git a/library/encoding/cp865.enc b/library/encoding/cp865.enc deleted file mode 100644 index 543da9c..0000000 --- a/library/encoding/cp865.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp865, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C700FC00E900E200E400E000E500E700EA00EB00E800EF00EE00EC00C400C5 -00C900E600C600F400F600F200FB00F900FF00D600DC00F800A300D820A70192 -00E100ED00F300FA00F100D100AA00BA00BF231000AC00BD00BC00A100AB00A4 -259125922593250225242561256225562555256325512557255D255C255B2510 -25142534252C251C2500253C255E255F255A25542569256625602550256C2567 -2568256425652559255825522553256B256A2518250C25882584258C25902580 -03B100DF039303C003A303C300B503C403A6039803A903B4221E03C603B52229 -226100B1226522642320232100F7224800B0221900B7221A207F00B225A000A0 diff --git a/library/encoding/cp866.enc b/library/encoding/cp866.enc deleted file mode 100644 index b851cf5..0000000 --- a/library/encoding/cp866.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp866, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0410041104120413041404150416041704180419041A041B041C041D041E041F -0420042104220423042404250426042704280429042A042B042C042D042E042F -0430043104320433043404350436043704380439043A043B043C043D043E043F -259125922593250225242561256225562555256325512557255D255C255B2510 -25142534252C251C2500253C255E255F255A25542569256625602550256C2567 -2568256425652559255825522553256B256A2518250C25882584258C25902580 -0440044104420443044404450446044704480449044A044B044C044D044E044F -040104510404045404070457040E045E00B0221900B7221A211600A425A000A0 diff --git a/library/encoding/cp869.enc b/library/encoding/cp869.enc deleted file mode 100644 index 9fd2929..0000000 --- a/library/encoding/cp869.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp869, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850386008700B700AC00A620182019038820150389 -038A03AA038C00930094038E03AB00A9038F00B200B303AC00A303AD03AE03AF -03CA039003CC03CD039103920393039403950396039700BD0398039900AB00BB -25912592259325022524039A039B039C039D256325512557255D039E039F2510 -25142534252C251C2500253C03A003A1255A25542569256625602550256C03A3 -03A403A503A603A703A803A903B103B203B32518250C2588258403B403B52580 -03B603B703B803B903BA03BB03BC03BD03BE03BF03C003C103C303C203C40384 -00AD00B103C503C603C700A703C8038500B000A803C903CB03B003CE25A000A0 diff --git a/library/encoding/cp874.enc b/library/encoding/cp874.enc deleted file mode 100644 index cdcca32..0000000 --- a/library/encoding/cp874.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: cp874, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008420260086008700880089008A008B008C008D008E008F -009020182019201C201D20222013201400980099009A009B009C009D009E009F -00A00E010E020E030E040E050E060E070E080E090E0A0E0B0E0C0E0D0E0E0E0F -0E100E110E120E130E140E150E160E170E180E190E1A0E1B0E1C0E1D0E1E0E1F -0E200E210E220E230E240E250E260E270E280E290E2A0E2B0E2C0E2D0E2E0E2F -0E300E310E320E330E340E350E360E370E380E390E3A00000000000000000E3F -0E400E410E420E430E440E450E460E470E480E490E4A0E4B0E4C0E4D0E4E0E4F -0E500E510E520E530E540E550E560E570E580E590E5A0E5B0000000000000000 diff --git a/library/encoding/cp932.enc b/library/encoding/cp932.enc deleted file mode 100644 index 027f7d8..0000000 --- a/library/encoding/cp932.enc +++ /dev/null @@ -1,785 +0,0 @@ -# Encoding file: cp932, multi-byte -M -003F 0 46 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080000000000000000000850086000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F -FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F -FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F -FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -81 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8FF3E -FFE3FF3F30FD30FE309D309E30034EDD30053006300730FC20152010FF0FFF3C -FF5E2225FF5C2026202520182019201C201DFF08FF0930143015FF3BFF3DFF5B -FF5D30083009300A300B300C300D300E300F30103011FF0BFF0D00B100D70000 -00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5 -FF04FFE0FFE1FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C725C6 -25A125A025B325B225BD25BC203B301221922190219121933013000000000000 -000000000000000000000000000000002208220B2286228722822283222A2229 -0000000000000000000000000000000022272228FFE221D221D4220022030000 -0000000000000000000000000000000000000000222022A52312220222072261 -2252226A226B221A223D221D2235222B222C0000000000000000000000000000 -212B2030266F266D266A2020202100B6000000000000000025EF000000000000 -82 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000FF10 -FF11FF12FF13FF14FF15FF16FF17FF18FF190000000000000000000000000000 -FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2FFF30 -FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3A000000000000000000000000 -0000FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5A00000000000000003041 -30423043304430453046304730483049304A304B304C304D304E304F30503051 -30523053305430553056305730583059305A305B305C305D305E305F30603061 -30623063306430653066306730683069306A306B306C306D306E306F30703071 -30723073307430753076307730783079307A307B307C307D307E307F30803081 -30823083308430853086308730883089308A308B308C308D308E308F30903091 -3092309300000000000000000000000000000000000000000000000000000000 -83 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF30B0 -30B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF30C0 -30C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF30D0 -30D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF0000 -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000391 -03920393039403950396039703980399039A039B039C039D039E039F03A003A1 -03A303A403A503A603A703A803A90000000000000000000000000000000003B1 -03B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF03C003C1 -03C303C403C503C603C703C803C9000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -84 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -04100411041204130414041504010416041704180419041A041B041C041D041E -041F0420042104220423042404250426042704280429042A042B042C042D042E -042F000000000000000000000000000000000000000000000000000000000000 -04300431043204330434043504510436043704380439043A043B043C043D0000 -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000002500 -2502250C251025182514251C252C25242534253C25012503250F2513251B2517 -25232533252B253B254B2520252F25282537253F251D25302525253825420000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -87 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -2460246124622463246424652466246724682469246A246B246C246D246E246F -2470247124722473216021612162216321642165216621672168216900003349 -33143322334D331833273303333633513357330D33263323332B334A333B339C -339D339E338E338F33C433A100000000000000000000000000000000337B0000 -301D301F211633CD212132A432A532A632A732A8323132323239337E337D337C -22522261222B222E2211221A22A52220221F22BF22352229222A000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -88 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000004E9C -55165A03963F54C0611B632859F690228475831C7A5060AA63E16E2565ED8466 -82A69BF56893572765A162715B9B59D0867B98F47D627DBE9B8E62167C9F88B7 -5B895EB563096697684895C7978D674F4EE54F0A4F4D4F9D504956F2593759D4 -5A015C0960DF610F61706613690570BA754F757079FB7DAD7DEF80C3840E8863 -8B029055907A533B4E954EA557DF80B290C178EF4E0058F16EA290387A328328 -828B9C2F5141537054BD54E156E059FB5F1598F26DEB80E4852D000000000000 -89 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9662967096A097FB540B53F35B8770CF7FBD8FC296E8536F9D5C7ABA4E117893 -81FC6E26561855046B1D851A9C3B59E553A96D6674DC958F56424E91904B96F2 -834F990C53E155B65B305F71662066F368046C386CF36D29745B76C87A4E9834 -82F1885B8A6092ED6DB275AB76CA99C560A68B018D8A95B2698E53AD51860000 -5712583059445BB45EF6602863A963F46CBF6F14708E7114715971D5733F7E01 -827682D185979060925B9D1B586965BC6C5A752551F9592E59655F805FDC62BC -65FA6A2A6B276BB4738B7FC189569D2C9D0E9EC45CA16C96837B51045C4B61B6 -81C6687672614E594FFA537860696E297A4F97F34E0B53164EEE4F554F3D4FA1 -4F7352A053EF5609590F5AC15BB65BE179D16687679C67B66B4C6CB3706B73C2 -798D79BE7A3C7B8782B182DB8304837783EF83D387668AB256298CA88FE6904E -971E868A4FC45CE862117259753B81E582BD86FE8CC096C5991399D54ECB4F1A -89E356DE584A58CA5EFB5FEB602A6094606261D0621262D06539000000000000 -8A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9B41666668B06D777070754C76867D7582A587F9958B968E8C9D51F152BE5916 -54B35BB35D16616869826DAF788D84CB88578A7293A79AB86D6C99A886D957A3 -67FF86CE920E5283568754045ED362E164B9683C68386BBB737278BA7A6B899A -89D28D6B8F0390ED95A3969497695B665CB3697D984D984E639B7B206A2B0000 -6A7F68B69C0D6F5F5272559D607062EC6D3B6E076ED1845B89108F444E149C39 -53F6691B6A3A9784682A515C7AC384B291DC938C565B9D286822830584317CA5 -520882C574E64E7E4F8351A05BD2520A52D852E75DFB559A582A59E65B8C5B98 -5BDB5E725E7960A3611F616361BE63DB656267D1685368FA6B3E6B536C576F22 -6F976F4574B0751876E3770B7AFF7BA17C217DE97F367FF0809D8266839E89B3 -8ACC8CAB908494519593959195A2966597D3992882184E38542B5CB85DCC73A9 -764C773C5CA97FEB8D0B96C19811985498584F014F0E5371559C566857FA5947 -5B095BC45C905E0C5E7E5FCC63EE673A65D765E2671F68CB68C4000000000000 -8B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A5F5E306BC56C176C7D757F79485B637A007D005FBD898F8A188CB48D778ECC -8F1D98E29A0E9B3C4E80507D510059935B9C622F628064EC6B3A72A075917947 -7FA987FB8ABC8B7063AC83CA97A05409540355AB68546A588A70782767759ECD -53745BA2811A865090064E184E454EC74F1153CA54385BAE5F13602565510000 -673D6C426C726CE3707874037A767AAE7B087D1A7CFE7D6665E7725B53BB5C45 -5DE862D262E063196E20865A8A318DDD92F86F0179A69B5A4EA84EAB4EAC4F9B -4FA050D151477AF6517151F653545321537F53EB55AC58835CE15F375F4A602F -6050606D631F65596A4B6CC172C272ED77EF80F881058208854E90F793E197FF -99579A5A4EF051DD5C2D6681696D5C4066F26975738968507C8150C552E45747 -5DFE932665A46B236B3D7434798179BD7B4B7DCA82B983CC887F895F8B398FD1 -91D1541F92804E5D503653E5533A72D7739677E982E68EAF99C699C899D25177 -611A865E55B07A7A50765BD3904796854E326ADB91E75C515C48000000000000 -8C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63987A9F6C9397748F617AAA718A96887C8268177E706851936C52F2541B85AB -8A137FA48ECD90E15366888879414FC250BE521151445553572D73EA578B5951 -5F625F8460756176616761A963B2643A656C666F68426E1375667A3D7CFB7D4C -7D997E4B7F6B830E834A86CD8A088A638B668EFD981A9D8F82B88FCE9BE80000 -5287621F64836FC09699684150916B206C7A6F547A747D5088408A2367084EF6 -503950265065517C5238526355A7570F58055ACC5EFA61B261F862F36372691C -6A29727D72AC732E7814786F7D79770C80A9898B8B198CE28ED290639375967A -98559A139E785143539F53B35E7B5F266E1B6E90738473FE7D4382378A008AFA -96504E4E500B53E4547C56FA59D15B645DF15EAB5F276238654567AF6E5672D0 -7CCA88B480A180E183F0864E8A878DE8923796C798679F134E944E924F0D5348 -5449543E5A2F5F8C5FA1609F68A76A8E745A78818A9E8AA48B7791904E5E9BC9 -4EA44F7C4FAF501950165149516C529F52B952FE539A53E35411000000000000 -8D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -540E5589575157A2597D5B545B5D5B8F5DE55DE75DF75E785E835E9A5EB75F18 -6052614C629762D863A7653B6602664366F4676D6821689769CB6C5F6D2A6D69 -6E2F6E9D75327687786C7A3F7CE07D057D187D5E7DB18015800380AF80B18154 -818F822A8352884C88618B1B8CA28CFC90CA91759271783F92FC95A4964D0000 -980599999AD89D3B525B52AB53F7540858D562F76FE08C6A8F5F9EB9514B523B -544A56FD7A4091779D609ED273446F09817075115FFD60DA9AA872DB8FBC6B64 -98034ECA56F0576458BE5A5A606861C7660F6606683968B16DF775D57D3A826E -9B424E9B4F5053C955065D6F5DE65DEE67FB6C99747378028A50939688DF5750 -5EA7632B50B550AC518D670054C9585E59BB5BB05F69624D63A1683D6B736E08 -707D91C7728078157826796D658E7D3083DC88C18F09969B5264572867507F6A -8CA151B45742962A583A698A80B454B25D0E57FC78959DFA4F5C524A548B643E -6628671467F57A847B567D22932F685C9BAD7B395319518A5237000000000000 -8E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5BDF62F664AE64E6672D6BBA85A996D176909BD6634C93069BAB76BF66524E09 -509853C25C7160E864926563685F71E673CA75237B977E8286958B838CDB9178 -991065AC66AB6B8B4ED54ED44F3A4F7F523A53F853F255E356DB58EB59CB59C9 -59FF5B505C4D5E025E2B5FD7601D6307652F5B5C65AF65BD65E8679D6B620000 -6B7B6C0F7345794979C17CF87D197D2B80A2810281F389968A5E8A698A668A8C -8AEE8CC78CDC96CC98FC6B6F4E8B4F3C4F8D51505B575BFA6148630166426B21 -6ECB6CBB723E74BD75D478C1793A800C803381EA84948F9E6C509E7F5F0F8B58 -9D2B7AFA8EF85B8D96EB4E0353F157F759315AC95BA460896E7F6F0675BE8CEA -5B9F85007BE0507267F4829D5C61854A7E1E820E51995C0463688D66659C716E -793E7D1780058B1D8ECA906E86C790AA501F52FA5C3A6753707C7235914C91C8 -932B82E55BC25F3160F94E3B53D65B88624B67316B8A72E973E07A2E816B8DA3 -91529996511253D7546A5BFF63886A397DAC970056DA53CE5468000000000000 -8F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B975C315DDE4FEE610162FE6D3279C079CB7D427E4D7FD281ED821F84908846 -89728B908E748F2F9031914B916C96C6919C4EC04F4F514553415F93620E67D4 -6C416E0B73637E2691CD928353D459195BBF6DD1795D7E2E7C9B587E719F51FA -88538FF04FCA5CFB662577AC7AE3821C99FF51C65FAA65EC696F6B896DF30000 -6E966F6476FE7D145DE190759187980651E6521D6240669166D96E1A5EB67DD2 -7F7266F885AF85F78AF852A953D959735E8F5F90605592E4966450B7511F52DD -5320534753EC54E8554655315617596859BE5A3C5BB55C065C0F5C115C1A5E84 -5E8A5EE05F70627F628462DB638C63776607660C662D6676677E68A26A1F6A35 -6CBC6D886E096E58713C7126716775C77701785D7901796579F07AE07B117CA7 -7D39809683D6848B8549885D88F38A1F8A3C8A548A738C618CDE91A49266937E -9418969C97984E0A4E084E1E4E575197527057CE583458CC5B225E3860C564FE -676167566D4472B675737A6384B88B7291B89320563157F498FE000000000000 -90 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62ED690D6B9671ED7E548077827289E698DF87558FB15C3B4F384FE14FB55507 -5A205BDD5BE95FC3614E632F65B0664B68EE699B6D786DF1753375B9771F795E -79E67D3381E382AF85AA89AA8A3A8EAB8F9B903291DD97074EBA4EC152035875 -58EC5C0B751A5C3D814E8A0A8FC59663976D7B258ACF9808916256F353A80000 -9017543957825E2563A86C34708A77617C8B7FE088709042915493109318968F -745E9AC45D075D69657067A28DA896DB636E6749691983C5981796C088FE6F84 -647A5BF84E16702C755D662F51C4523652E259D35F8160276210653F6574661F -667468F268166B636E057272751F76DB7CBE805658F088FD897F8AA08A938ACB -901D91929752975965897A0E810696BB5E2D60DC621A65A56614679077F37A4D -7C4D7E3E810A8CAC8D648DE18E5F78A9520762D963A5644262988A2D7A837BC0 -8AAC96EA7D76820C87494ED95148534353605BA35C025C165DDD6226624764B0 -681368346CC96D456D1767D36F5C714E717D65CB7A7F7BAD7DDA000000000000 -91 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7E4A7FA8817A821B823985A68A6E8CCE8DF59078907792AD929195839BAE524D -55846F387136516879857E5581B37CCE564C58515CA863AA66FE66FD695A72D9 -758F758E790E795679DF7C977D207D4486078A34963B90619F2050E7527553CC -53E2500955AA58EE594F723D5B8B5C64531D60E360F3635C6383633F63BB0000 -64CD65E966F95DE369CD69FD6F1571E54E8975E976F87A937CDF7DCF7D9C8061 -83498358846C84BC85FB88C58D709001906D9397971C9A1250CF5897618E81D3 -85358D0890204FC3507452475373606F6349675F6E2C8DB3901F4FD75C5E8CCA -65CF7D9A53528896517663C35B585B6B5C0A640D6751905C4ED6591A592A6C70 -8A51553E581559A560F0625367C182356955964099C49A284F5358065BFE8010 -5CB15E2F5F856020614B623466FF6CF06EDE80CE817F82D4888B8CB89000902E -968A9EDB9BDB4EE353F059277B2C918D984C9DF96EDD7027535355445B856258 -629E62D36CA26FEF74228A1794386FC18AFE833851E786F853EA000000000000 -92 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53E94F4690548FB0596A81315DFD7AEA8FBF68DA8C3772F89C486A3D8AB04E39 -53585606576662C563A265E66B4E6DE16E5B70AD77ED7AEF7BAA7DBB803D80C6 -86CB8A95935B56E358C75F3E65AD66966A806BB575378AC7502477E557305F1B -6065667A6C6075F47A1A7F6E81F48718904599B37BC9755C7AF97B5184C40000 -901079E97A9283365AE177404E2D4EF25B995FE062BD663C67F16CE8866B8877 -8A3B914E92F399D06A177026732A82E784578CAF4E01514651CB558B5BF55E16 -5E335E815F145F355F6B5FB461F2631166A2671D6F6E7252753A773A80748139 -817887768ABF8ADC8D858DF3929A957798029CE552C5635776F467156C8873CD -8CC393AE96736D25589C690E69CC8FFD939A75DB901A585A680263B469FB4F43 -6F2C67D88FBB85267DB49354693F6F70576A58F75B2C7D2C722A540A91E39DB4 -4EAD4F4E505C507552438C9E544858245B9A5E1D5E955EAD5EF75F1F608C62B5 -633A63D068AF6C407887798E7A0B7DE082478A028AE68E449013000000000000 -93 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -90B8912D91D89F0E6CE5645864E265756EF476847B1B906993D16EBA54F25FB9 -64A48F4D8FED92445178586B59295C555E976DFB7E8F751C8CBC8EE2985B70B9 -4F1D6BBF6FB1753096FB514E54105835585759AC5C605F926597675C6E21767B -83DF8CED901490FD934D7825783A52AA5EA6571F597460125012515A51AC0000 -51CD520055105854585859575B955CF65D8B60BC6295642D6771684368BC68DF -76D76DD86E6F6D9B706F71C85F5375D879777B497B547B527CD67D7152308463 -856985E48A0E8B048C468E0F9003900F94199676982D9A3095D850CD52D5540C -58025C0E61A7649E6D1E77B37AE580F48404905392855CE09D07533F5F975FB3 -6D9C7279776379BF7BE46BD272EC8AAD68036A6151F87A8169345C4A9CF682EB -5BC59149701E56785C6F60C765666C8C8C5A90419813545166C7920D594890A3 -51854E4D51EA85998B0E7058637A934B696299B47E047577535769608EDF96E3 -6C5D4E8C5C3C5F108FE953028CD1808986795EFF65E54E735165000000000000 -94 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59825C3F97EE4EFB598A5FCD8A8D6FE179B079625BE78471732B71B15E745FF5 -637B649A71C37C984E435EFC4E4B57DC56A260A96FC37D0D80FD813381BF8FB2 -899786A45DF4628A64AD898767776CE26D3E743678345A467F7582AD99AC4FF3 -5EC362DD63926557676F76C3724C80CC80BA8F29914D500D57F95A9268850000 -6973716472FD8CB758F28CE0966A9019877F79E477E784294F2F5265535A62CD -67CF6CCA767D7B947C95823685848FEB66DD6F2072067E1B83AB99C19EA651FD -7BB178727BB880877B486AE85E61808C75517560516B92626E8C767A91979AEA -4F107F70629C7B4F95A59CE9567A585986E496BC4F345224534A53CD53DB5E06 -642C6591677F6C3E6C4E724872AF73ED75547E41822C85E98CA97BC491C67169 -981298EF633D6669756A76E478D0854386EE532A5351542659835E875F7C60B2 -6249627962AB65906BD46CCC75B276AE789179D87DCB7F7780A588AB8AB98CBB -907F975E98DB6A0B7C3850995C3E5FAE67876BD8743577097F8E000000000000 -95 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9F3B67CA7A175339758B9AED5F66819D83F180985F3C5FC575627B46903C6867 -59EB5A9B7D10767E8B2C4FF55F6A6A196C376F0274E2796888688A558C795EDF -63CF75C579D282D7932892F2849C86ED9C2D54C15F6C658C6D5C70158CA78CD3 -983B654F74F64E0D4ED857E0592B5A665BCC51A85E035E9C6016627665770000 -65A7666E6D6E72367B268150819A82998B5C8CA08CE68D74961C96444FAE64AB -6B66821E8461856A90E85C01695398A8847A85574F0F526F5FA95E45670D798F -8179890789866DF55F1762556CB84ECF72699B925206543B567458B361A4626E -711A596E7C897CDE7D1B96F06587805E4E194F75517558405E635E735F0A67C4 -4E26853D9589965B7C73980150FB58C1765678A7522577A585117B86504F5909 -72477BC77DE88FBA8FD4904D4FBF52C95A295F0197AD4FDD821792EA57036355 -6B69752B88DC8F147A4252DF58936155620A66AE6BCD7C3F83E950234FF85305 -5446583159495B9D5CF05CEF5D295E9662B16367653E65B9670B000000000000 -96 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6CD56CE170F978327E2B80DE82B3840C84EC870289128A2A8C4A90A692D298FD -9CF39D6C4E4F4EA1508D5256574A59A85E3D5FD85FD9623F66B4671B67D068D2 -51927D2180AA81A88B008C8C8CBF927E96325420982C531750D5535C58A864B2 -6734726777667A4691E652C36CA16B8658005E4C5954672C7FFB51E176C60000 -646978E89B549EBB57CB59B96627679A6BCE54E969D95E55819C67959BAA67FE -9C52685D4EA64FE353C862B9672B6CAB8FC44FAD7E6D9EBF4E0761626E806F2B -85135473672A9B455DF37B955CAC5BC6871C6E4A84D17A14810859997C8D6C11 -772052D959227121725F77DB97279D61690B5A7F5A1851A5540D547D660E76DF -8FF792989CF459EA725D6EC5514D68C97DBF7DEC97629EBA64786A2183025984 -5B5F6BDB731B76F27DB280178499513267289ED976EE676252FF99055C24623B -7C7E8CB0554F60B67D0B958053014E5F51B6591C723A803691CE5F2577E25384 -5F797D0485AC8A338E8D975667F385AE9453610961086CB97652000000000000 -97 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8AED8F38552F4F51512A52C753CB5BA55E7D60A0618263D6670967DA6E676D8C -733673377531795088D58A98904A909190F596C4878D59154E884F594E0E8A89 -8F3F981050AD5E7C59965BB95EB863DA63FA64C166DC694A69D86D0B6EB67194 -75287AAF7F8A8000844984C989818B218E0A9065967D990A617E62916B320000 -6C836D747FCC7FFC6DC07F8587BA88F8676583B1983C96F76D1B7D61843D916A -4E7153755D506B046FEB85CD862D89A75229540F5C65674E68A87406748375E2 -88CF88E191CC96E296785F8B73877ACB844E63A0756552896D416E9C74097559 -786B7C9296867ADC9F8D4FB6616E65C5865C4E864EAE50DA4E2151CC5BEE6599 -68816DBC731F764277AD7A1C7CE7826F8AD2907C91CF96759818529B7DD1502B -539867976DCB71D0743381E88F2A96A39C579E9F746058416D997D2F985E4EE4 -4F364F8B51B752B15DBA601C73B2793C82D3923496B796F6970A9E979F6266A6 -6B74521752A370C888C25EC9604B61906F2371497C3E7DF4806F000000000000 -98 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -84EE9023932C54429B6F6AD370898CC28DEF973252B45A415ECA5F046717697C -69946D6A6F0F726272FC7BED8001807E874B90CE516D9E937984808B93328AD6 -502D548C8A716B6A8CC4810760D167A09DF24E994E989C108A6B85C185686900 -6E7E789781550000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000005F0C -4E104E154E2A4E314E364E3C4E3F4E424E564E584E824E858C6B4E8A82125F0D -4E8E4E9E4E9F4EA04EA24EB04EB34EB64ECE4ECD4EC44EC64EC24ED74EDE4EED -4EDF4EF74F094F5A4F304F5B4F5D4F574F474F764F884F8F4F984F7B4F694F70 -4F914F6F4F864F9651184FD44FDF4FCE4FD84FDB4FD14FDA4FD04FE44FE5501A -50285014502A502550054F1C4FF650215029502C4FFE4FEF5011500650435047 -6703505550505048505A5056506C50785080509A508550B450B2000000000000 -99 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50C950CA50B350C250D650DE50E550ED50E350EE50F950F55109510151025116 -51155114511A5121513A5137513C513B513F51405152514C515451627AF85169 -516A516E5180518256D8518C5189518F519151935195519651A451A651A251A9 -51AA51AB51B351B151B251B051B551BD51C551C951DB51E0865551E951ED0000 -51F051F551FE5204520B5214520E5227522A522E52335239524F5244524B524C -525E5254526A527452695273527F527D528D529452925271528852918FA88FA7 -52AC52AD52BC52B552C152CD52D752DE52E352E698ED52E052F352F552F852F9 -530653087538530D5310530F5315531A5323532F533153335338534053465345 -4E175349534D51D6535E5369536E5918537B53775382539653A053A653A553AE -53B053B653C37C1296D953DF66FC71EE53EE53E853ED53FA5401543D5440542C -542D543C542E54365429541D544E548F5475548E545F5471547754705492547B -5480547654845490548654C754A254B854A554AC54C454C854A8000000000000 -9A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54AB54C254A454BE54BC54D854E554E6550F551454FD54EE54ED54FA54E25539 -55405563554C552E555C55455556555755385533555D5599558054AF558A559F -557B557E5598559E55AE557C558355A9558755A855DA55C555DF55C455DC55E4 -55D4561455F7561655FE55FD561B55F9564E565071DF56345636563256380000 -566B5664562F566C566A56865680568A56A05694568F56A556AE56B656B456C2 -56BC56C156C356C056C856CE56D156D356D756EE56F9570056FF570457095708 -570B570D57135718571655C7571C572657375738574E573B5740574F576957C0 -57885761577F5789579357A057B357A457AA57B057C357C657D457D257D3580A -57D657E3580B5819581D587258215862584B58706BC05852583D5879588558B9 -589F58AB58BA58DE58BB58B858AE58C558D358D158D758D958D858E558DC58E4 -58DF58EF58FA58F958FB58FC58FD5902590A5910591B68A65925592C592D5932 -5938593E7AD259555950594E595A5958596259605967596C5969000000000000 -9B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59785981599D4F5E4FAB59A359B259C659E859DC598D59D959DA5A255A1F5A11 -5A1C5A095A1A5A405A6C5A495A355A365A625A6A5A9A5ABC5ABE5ACB5AC25ABD -5AE35AD75AE65AE95AD65AFA5AFB5B0C5B0B5B165B325AD05B2A5B365B3E5B43 -5B455B405B515B555B5A5B5B5B655B695B705B735B755B7865885B7A5B800000 -5B835BA65BB85BC35BC75BC95BD45BD05BE45BE65BE25BDE5BE55BEB5BF05BF6 -5BF35C055C075C085C0D5C135C205C225C285C385C395C415C465C4E5C535C50 -5C4F5B715C6C5C6E4E625C765C795C8C5C915C94599B5CAB5CBB5CB65CBC5CB7 -5CC55CBE5CC75CD95CE95CFD5CFA5CED5D8C5CEA5D0B5D155D175D5C5D1F5D1B -5D115D145D225D1A5D195D185D4C5D525D4E5D4B5D6C5D735D765D875D845D82 -5DA25D9D5DAC5DAE5DBD5D905DB75DBC5DC95DCD5DD35DD25DD65DDB5DEB5DF2 -5DF55E0B5E1A5E195E115E1B5E365E375E445E435E405E4E5E575E545E5F5E62 -5E645E475E755E765E7A9EBC5E7F5EA05EC15EC25EC85ED05ECF000000000000 -9C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5ED65EE35EDD5EDA5EDB5EE25EE15EE85EE95EEC5EF15EF35EF05EF45EF85EFE -5F035F095F5D5F5C5F0B5F115F165F295F2D5F385F415F485F4C5F4E5F2F5F51 -5F565F575F595F615F6D5F735F775F835F825F7F5F8A5F885F915F875F9E5F99 -5F985FA05FA85FAD5FBC5FD65FFB5FE45FF85FF15FDD60B35FFF602160600000 -601960106029600E6031601B6015602B6026600F603A605A6041606A6077605F -604A6046604D6063604360646042606C606B60596081608D60E76083609A6084 -609B60966097609260A7608B60E160B860E060D360B45FF060BD60C660B560D8 -614D6115610660F660F7610060F460FA6103612160FB60F1610D610E6147613E -61286127614A613F613C612C6134613D614261446173617761586159615A616B -6174616F61656171615F615D6153617561996196618761AC6194619A618A6191 -61AB61AE61CC61CA61C961F761C861C361C661BA61CB7F7961CD61E661E361F6 -61FA61F461FF61FD61FC61FE620062086209620D620C6214621B000000000000 -9D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -621E6221622A622E6230623262336241624E625E6263625B62606268627C6282 -6289627E62926293629662D46283629462D762D162BB62CF62FF62C664D462C8 -62DC62CC62CA62C262C7629B62C9630C62EE62F163276302630862EF62F56350 -633E634D641C634F6396638E638063AB637663A3638F6389639F63B5636B0000 -636963BE63E963C063C663E363C963D263F663C4641664346406641364266436 -651D64176428640F6467646F6476644E652A6495649364A564A9648864BC64DA -64D264C564C764BB64D864C264F164E7820964E064E162AC64E364EF652C64F6 -64F464F264FA650064FD6518651C650565246523652B65346535653765366538 -754B654865566555654D6558655E655D65726578658265838B8A659B659F65AB -65B765C365C665C165C465CC65D265DB65D965E065E165F16772660A660365FB -6773663566366634661C664F664466496641665E665D666466676668665F6662 -667066836688668E668966846698669D66C166B966C966BE66BC000000000000 -9E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -66C466B866D666DA66E0663F66E666E966F066F566F7670F6716671E67266727 -9738672E673F67366741673867376746675E67606759676367646789677067A9 -677C676A678C678B67A667A1678567B767EF67B467EC67B367E967B867E467DE -67DD67E267EE67B967CE67C667E76A9C681E684668296840684D6832684E0000 -68B3682B685968636877687F689F688F68AD6894689D689B68836AAE68B96874 -68B568A068BA690F688D687E690168CA690868D86922692668E1690C68CD68D4 -68E768D569366912690468D768E3692568F968E068EF6928692A691A69236921 -68C669796977695C6978696B6954697E696E69396974693D695969306961695E -695D6981696A69B269AE69D069BF69C169D369BE69CE5BE869CA69DD69BB69C3 -69A76A2E699169A0699C699569B469DE69E86A026A1B69FF6B0A69F969F269E7 -6A0569B16A1E69ED6A1469EB6A0A6A126AC16A236A136A446A0C6A726A366A78 -6A476A626A596A666A486A386A226A906A8D6AA06A846AA26AA3000000000000 -9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A9786176ABB6AC36AC26AB86AB36AAC6ADE6AD16ADF6AAA6ADA6AEA6AFB6B05 -86166AFA6B126B169B316B1F6B386B3776DC6B3998EE6B476B436B496B506B59 -6B546B5B6B5F6B616B786B796B7F6B806B846B836B8D6B986B956B9E6BA46BAA -6BAB6BAF6BB26BB16BB36BB76BBC6BC66BCB6BD36BDF6BEC6BEB6BF36BEF0000 -9EBE6C086C136C146C1B6C246C236C5E6C556C626C6A6C826C8D6C9A6C816C9B -6C7E6C686C736C926C906CC46CF16CD36CBD6CD76CC56CDD6CAE6CB16CBE6CBA -6CDB6CEF6CD96CEA6D1F884D6D366D2B6D3D6D386D196D356D336D126D0C6D63 -6D936D646D5A6D796D596D8E6D956FE46D856DF96E156E0A6DB56DC76DE66DB8 -6DC66DEC6DDE6DCC6DE86DD26DC56DFA6DD96DE46DD56DEA6DEE6E2D6E6E6E2E -6E196E726E5F6E3E6E236E6B6E2B6E766E4D6E1F6E436E3A6E4E6E246EFF6E1D -6E386E826EAA6E986EC96EB76ED36EBD6EAF6EC46EB26ED46ED56E8F6EA56EC2 -6E9F6F416F11704C6EEC6EF86EFE6F3F6EF26F316EEF6F326ECC000000000000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F3E6F136EF76F866F7A6F786F816F806F6F6F5B6FF36F6D6F826F7C6F586F8E -6F916FC26F666FB36FA36FA16FA46FB96FC66FAA6FDF6FD56FEC6FD46FD86FF1 -6FEE6FDB7009700B6FFA70117001700F6FFE701B701A6F74701D7018701F7030 -703E7032705170637099709270AF70F170AC70B870B370AE70DF70CB70DD0000 -70D9710970FD711C711971657155718871667162714C7156716C718F71FB7184 -719571A871AC71D771B971BE71D271C971D471CE71E071EC71E771F571FC71F9 -71FF720D7210721B7228722D722C72307232723B723C723F72407246724B7258 -7274727E7282728172877292729672A272A772B972B272C372C672C472CE72D2 -72E272E072E172F972F7500F7317730A731C7316731D7334732F73297325733E -734E734F9ED87357736A7368737073787375737B737A73C873B373CE73BB73C0 -73E573EE73DE74A27405746F742573F87432743A7455743F745F74597441745C -746974707463746A7476747E748B749E74A774CA74CF74D473F1000000000000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74E074E374E774E974EE74F274F074F174F874F7750475037505750C750E750D -75157513751E7526752C753C7544754D754A7549755B7546755A756975647567 -756B756D75787576758675877574758A758975827594759A759D75A575A375C2 -75B375C375B575BD75B875BC75B175CD75CA75D275D975E375DE75FE75FF0000 -75FC760175F075FA75F275F3760B760D7609761F762776207621762276247634 -7630763B764776487646765C76587661766276687669766A7667766C76707672 -76767678767C768076837688768B768E769676937699769A76B076B476B876B9 -76BA76C276CD76D676D276DE76E176E576E776EA862F76FB7708770777047729 -7724771E77257726771B773777387747775A7768776B775B7765777F777E7779 -778E778B779177A0779E77B077B677B977BF77BC77BD77BB77C777CD77D777DA -77DC77E377EE77FC780C781279267820792A7845788E78747886787C789A788C -78A378B578AA78AF78D178C678CB78D478BE78BC78C578CA78EC000000000000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -78E778DA78FD78F47907791279117919792C792B794079607957795F795A7955 -7953797A797F798A799D79A79F4B79AA79AE79B379B979BA79C979D579E779EC -79E179E37A087A0D7A187A197A207A1F79807A317A3B7A3E7A377A437A577A49 -7A617A627A699F9D7A707A797A7D7A887A977A957A987A967AA97AC87AB00000 -7AB67AC57AC47ABF90837AC77ACA7ACD7ACF7AD57AD37AD97ADA7ADD7AE17AE2 -7AE67AED7AF07B027B0F7B0A7B067B337B187B197B1E7B357B287B367B507B7A -7B047B4D7B0B7B4C7B457B757B657B747B677B707B717B6C7B6E7B9D7B987B9F -7B8D7B9C7B9A7B8B7B927B8F7B5D7B997BCB7BC17BCC7BCF7BB47BC67BDD7BE9 -7C117C147BE67BE57C607C007C077C137BF37BF77C177C0D7BF67C237C277C2A -7C1F7C377C2B7C3D7C4C7C437C547C4F7C407C507C587C5F7C647C567C657C6C -7C757C837C907CA47CAD7CA27CAB7CA17CA87CB37CB27CB17CAE7CB97CBD7CC0 -7CC57CC27CD87CD27CDC7CE29B3B7CEF7CF27CF47CF67CFA7D06000000000000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7D027D1C7D157D0A7D457D4B7D2E7D327D3F7D357D467D737D567D4E7D727D68 -7D6E7D4F7D637D937D897D5B7D8F7D7D7D9B7DBA7DAE7DA37DB57DC77DBD7DAB -7E3D7DA27DAF7DDC7DB87D9F7DB07DD87DDD7DE47DDE7DFB7DF27DE17E057E0A -7E237E217E127E317E1F7E097E0B7E227E467E667E3B7E357E397E437E370000 -7E327E3A7E677E5D7E567E5E7E597E5A7E797E6A7E697E7C7E7B7E837DD57E7D -8FAE7E7F7E887E897E8C7E927E907E937E947E967E8E7E9B7E9C7F387F3A7F45 -7F4C7F4D7F4E7F507F517F557F547F587F5F7F607F687F697F677F787F827F86 -7F837F887F877F8C7F947F9E7F9D7F9A7FA37FAF7FB27FB97FAE7FB67FB88B71 -7FC57FC67FCA7FD57FD47FE17FE67FE97FF37FF998DC80068004800B80128018 -8019801C80218028803F803B804A804680528058805A805F8062806880738072 -807080768079807D807F808480868085809B8093809A80AD519080AC80DB80E5 -80D980DD80C480DA80D6810980EF80F1811B81298123812F814B000000000000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -968B8146813E8153815180FC8171816E81658166817481838188818A81808182 -81A0819581A481A3815F819381A981B081B581BE81B881BD81C081C281BA81C9 -81CD81D181D981D881C881DA81DF81E081E781FA81FB81FE8201820282058207 -820A820D821082168229822B82388233824082598258825D825A825F82640000 -82628268826A826B822E827182778278827E828D829282AB829F82BB82AC82E1 -82E382DF82D282F482F382FA8393830382FB82F982DE830682DC830982D98335 -83348316833283318340833983508345832F832B831783188385839A83AA839F -83A283968323838E8387838A837C83B58373837583A0838983A883F4841383EB -83CE83FD840383D8840B83C183F7840783E083F2840D8422842083BD84388506 -83FB846D842A843C855A84848477846B84AD846E848284698446842C846F8479 -843584CA846284B984BF849F84D984CD84BB84DA84D084C184C684D684A18521 -84FF84F485178518852C851F8515851484FC8540856385588548000000000000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -85418602854B8555858085A485888591858A85A8856D8594859B85EA8587859C -8577857E859085C985BA85CF85B985D085D585DD85E585DC85F9860A8613860B -85FE85FA86068622861A8630863F864D4E558654865F86678671869386A386A9 -86AA868B868C86B686AF86C486C686B086C9882386AB86D486DE86E986EC0000 -86DF86DB86EF8712870687088700870386FB87118709870D86F9870A8734873F -8737873B87258729871A8760875F8778874C874E877487578768876E87598753 -8763876A880587A2879F878287AF87CB87BD87C087D096D687AB87C487B387C7 -87C687BB87EF87F287E0880F880D87FE87F687F7880E87D28811881688158822 -88218831883688398827883B8844884288528859885E8862886B8881887E889E -8875887D88B5887288828897889288AE889988A2888D88A488B088BF88B188C3 -88C488D488D888D988DD88F9890288FC88F488E888F28904890C890A89138943 -891E8925892A892B89418944893B89368938894C891D8960895E000000000000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -89668964896D896A896F89748977897E89838988898A8993899889A189A989A6 -89AC89AF89B289BA89BD89BF89C089DA89DC89DD89E789F489F88A038A168A10 -8A0C8A1B8A1D8A258A368A418A5B8A528A468A488A7C8A6D8A6C8A628A858A82 -8A848AA88AA18A918AA58AA68A9A8AA38AC48ACD8AC28ADA8AEB8AF38AE70000 -8AE48AF18B148AE08AE28AF78ADE8ADB8B0C8B078B1A8AE18B168B108B178B20 -8B3397AB8B268B2B8B3E8B288B418B4C8B4F8B4E8B498B568B5B8B5A8B6B8B5F -8B6C8B6F8B748B7D8B808B8C8B8E8B928B938B968B998B9A8C3A8C418C3F8C48 -8C4C8C4E8C508C558C628C6C8C788C7A8C828C898C858C8A8C8D8C8E8C948C7C -8C98621D8CAD8CAA8CBD8CB28CB38CAE8CB68CC88CC18CE48CE38CDA8CFD8CFA -8CFB8D048D058D0A8D078D0F8D0D8D109F4E8D138CCD8D148D168D678D6D8D71 -8D738D818D998DC28DBE8DBA8DCF8DDA8DD68DCC8DDB8DCB8DEA8DEB8DDF8DE3 -8DFC8E088E098DFF8E1D8E1E8E108E1F8E428E358E308E348E4A000000000000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E478E498E4C8E508E488E598E648E608E2A8E638E558E768E728E7C8E818E87 -8E858E848E8B8E8A8E938E918E948E998EAA8EA18EAC8EB08EC68EB18EBE8EC5 -8EC88ECB8EDB8EE38EFC8EFB8EEB8EFE8F0A8F058F158F128F198F138F1C8F1F -8F1B8F0C8F268F338F3B8F398F458F428F3E8F4C8F498F468F4E8F578F5C0000 -8F628F638F648F9C8F9F8FA38FAD8FAF8FB78FDA8FE58FE28FEA8FEF90878FF4 -90058FF98FFA901190159021900D901E9016900B90279036903590398FF8904F -905090519052900E9049903E90569058905E9068906F907696A890729082907D -90819080908A9089908F90A890AF90B190B590E290E4624890DB910291129119 -91329130914A9156915891639165916991739172918B9189918291A291AB91AF -91AA91B591B491BA91C091C191C991CB91D091D691DF91E191DB91FC91F591F6 -921E91FF9214922C92159211925E925792459249926492489295923F924B9250 -929C92969293929B925A92CF92B992B792E9930F92FA9344932E000000000000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -93199322931A9323933A9335933B935C9360937C936E935693B093AC93AD9394 -93B993D693D793E893E593D893C393DD93D093C893E4941A9414941394039407 -94109436942B94359421943A944194529444945B94609462945E946A92299470 -94759477947D945A947C947E9481947F95829587958A95949596959895990000 -95A095A895A795AD95BC95BB95B995BE95CA6FF695C395CD95CC95D595D495D6 -95DC95E195E595E296219628962E962F9642964C964F964B9677965C965E965D -965F96669672966C968D96989695969796AA96A796B196B296B096B496B696B8 -96B996CE96CB96C996CD894D96DC970D96D596F99704970697089713970E9711 -970F971697199724972A97309739973D973E97449746974897429749975C9760 -97649766976852D2976B977197799785977C9781977A9786978B978F9790979C -97A897A697A397B397B497C397C697C897CB97DC97ED9F4F97F27ADF97F697F5 -980F980C9838982498219837983D9846984F984B986B986F9870000000000000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -98719874987398AA98AF98B198B698C498C398C698E998EB9903990999129914 -99189921991D991E99249920992C992E993D993E9942994999459950994B9951 -9952994C99559997999899A599AD99AE99BC99DF99DB99DD99D899D199ED99EE -99F199F299FB99F89A019A0F9A0599E29A199A2B9A379A459A429A409A430000 -9A3E9A559A4D9A5B9A579A5F9A629A659A649A699A6B9A6A9AAD9AB09ABC9AC0 -9ACF9AD19AD39AD49ADE9ADF9AE29AE39AE69AEF9AEB9AEE9AF49AF19AF79AFB -9B069B189B1A9B1F9B229B239B259B279B289B299B2A9B2E9B2F9B329B449B43 -9B4F9B4D9B4E9B519B589B749B939B839B919B969B979B9F9BA09BA89BB49BC0 -9BCA9BB99BC69BCF9BD19BD29BE39BE29BE49BD49BE19C3A9BF29BF19BF09C15 -9C149C099C139C0C9C069C089C129C0A9C049C2E9C1B9C259C249C219C309C47 -9C329C469C3E9C5A9C609C679C769C789CE79CEC9CF09D099D089CEB9D039D06 -9D2A9D269DAF9D239D1F9D449D159D129D419D3F9D3E9D469D48000000000000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9D5D9D5E9D649D519D509D599D729D899D879DAB9D6F9D7A9D9A9DA49DA99DB2 -9DC49DC19DBB9DB89DBA9DC69DCF9DC29DD99DD39DF89DE69DED9DEF9DFD9E1A -9E1B9E1E9E759E799E7D9E819E889E8B9E8C9E929E959E919E9D9EA59EA99EB8 -9EAA9EAD97619ECC9ECE9ECF9ED09ED49EDC9EDE9EDD9EE09EE59EE89EEF0000 -9EF49EF69EF79EF99EFB9EFC9EFD9F079F0876B79F159F219F2C9F3E9F4A9F52 -9F549F639F5F9F609F619F669F679F6C9F6A9F779F729F769F959F9C9FA0582F -69C79059746451DC719900000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7E8A891C9348928884DC4FC970BB663168C892F966FB5F454E284EE14EFC4F00 -4F034F394F564F924F8A4F9A4F944FCD504050224FFF501E5046507050425094 -50F450D8514A5164519D51BE51EC5215529C52A652C052DB5300530753245372 -539353B253DDFA0E549C548A54A954FF55865759576557AC57C857C7FA0F0000 -FA10589E58B2590B5953595B595D596359A459BA5B565BC0752F5BD85BEC5C1E -5CA65CBA5CF55D275D53FA115D425D6D5DB85DB95DD05F215F345F675FB75FDE -605D6085608A60DE60D5612060F26111613761306198621362A663F56460649D -64CE654E66006615663B6609662E661E6624666566576659FA126673669966A0 -66B266BF66FA670EF929676667BB685267C06801684468CFFA136968FA146998 -69E26A306A6B6A466A736A7E6AE26AE46BD66C3F6C5C6C866C6F6CDA6D046D87 -6D6F6D966DAC6DCF6DF86DF26DFC6E396E5C6E276E3C6EBF6F886FB56FF57005 -70077028708570AB710F7104715C71467147FA1571C171FE72B1000000000000 -EE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -72BE7324FA16737773BD73C973D673E373D2740773F57426742A7429742E7462 -7489749F7501756F7682769C769E769B76A6FA17774652AF7821784E7864787A -7930FA18FA19FA1A7994FA1B799B7AD17AE7FA1C7AEB7B9EFA1D7D487D5C7DB7 -7DA07DD67E527F477FA1FA1E83018362837F83C783F6844884B4855385590000 -856BFA1F85B0FA20FA21880788F58A128A378A798AA78ABE8ADFFA228AF68B53 -8B7F8CF08CF48D128D76FA238ECFFA24FA25906790DEFA269115912791DA91D7 -91DE91ED91EE91E491E592069210920A923A9240923C924E9259925192399267 -92A79277927892E792D792D992D0FA2792D592E092D39325932192FBFA28931E -92FF931D93029370935793A493C693DE93F89431944594489592F9DCFA29969D -96AF9733973B9743974D974F9751975598579865FA2AFA2B9927FA2C999E9A4E -9AD99ADC9B759B729B8F9BB19BBB9C009D709D6BFA2D9E199ED1000000002170 -217121722173217421752176217721782179FFE2FFE4FF07FF02000000000000 -FA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -2170217121722173217421752176217721782179216021612162216321642165 -2166216721682169FFE2FFE4FF07FF0232312116212122357E8A891C93489288 -84DC4FC970BB663168C892F966FB5F454E284EE14EFC4F004F034F394F564F92 -4F8A4F9A4F944FCD504050224FFF501E504650705042509450F450D8514A0000 -5164519D51BE51EC5215529C52A652C052DB5300530753245372539353B253DD -FA0E549C548A54A954FF55865759576557AC57C857C7FA0FFA10589E58B2590B -5953595B595D596359A459BA5B565BC0752F5BD85BEC5C1E5CA65CBA5CF55D27 -5D53FA115D425D6D5DB85DB95DD05F215F345F675FB75FDE605D6085608A60DE -60D5612060F26111613761306198621362A663F56460649D64CE654E66006615 -663B6609662E661E6624666566576659FA126673669966A066B266BF66FA670E -F929676667BB685267C06801684468CFFA136968FA14699869E26A306A6B6A46 -6A736A7E6AE26AE46BD66C3F6C5C6C866C6F6CDA6D046D876D6F000000000000 -FB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6D966DAC6DCF6DF86DF26DFC6E396E5C6E276E3C6EBF6F886FB56FF570057007 -7028708570AB710F7104715C71467147FA1571C171FE72B172BE7324FA167377 -73BD73C973D673E373D2740773F57426742A7429742E74627489749F7501756F -7682769C769E769B76A6FA17774652AF7821784E7864787A7930FA18FA190000 -FA1A7994FA1B799B7AD17AE7FA1C7AEB7B9EFA1D7D487D5C7DB77DA07DD67E52 -7F477FA1FA1E83018362837F83C783F6844884B485538559856BFA1F85B0FA20 -FA21880788F58A128A378A798AA78ABE8ADFFA228AF68B538B7F8CF08CF48D12 -8D76FA238ECFFA24FA25906790DEFA269115912791DA91D791DE91ED91EE91E4 -91E592069210920A923A9240923C924E925992519239926792A79277927892E7 -92D792D992D0FA2792D592E092D39325932192FBFA28931E92FF931D93029370 -935793A493C693DE93F89431944594489592F9DCFA29969D96AF9733973B9743 -974D974F9751975598579865FA2AFA2B9927FA2C999E9A4E9AD9000000000000 -FC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9ADC9B759B729B8F9BB19BBB9C009D709D6BFA2D9E199ED10000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/cp936.enc b/library/encoding/cp936.enc deleted file mode 100644 index 53d975c..0000000 --- a/library/encoding/cp936.enc +++ /dev/null @@ -1,2162 +0,0 @@ -# Encoding file: cp936, multi-byte -M -003F 0 127 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -81 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E024E044E054E064E0F4E124E174E1F4E204E214E234E264E294E2E4E2F4E31 -4E334E354E374E3C4E404E414E424E444E464E4A4E514E554E574E5A4E5B4E62 -4E634E644E654E674E684E6A4E6B4E6C4E6D4E6E4E6F4E724E744E754E764E77 -4E784E794E7A4E7B4E7C4E7D4E7F4E804E814E824E834E844E854E874E8A0000 -4E904E964E974E994E9C4E9D4E9E4EA34EAA4EAF4EB04EB14EB44EB64EB74EB8 -4EB94EBC4EBD4EBE4EC84ECC4ECF4ED04ED24EDA4EDB4EDC4EE04EE24EE64EE7 -4EE94EED4EEE4EEF4EF14EF44EF84EF94EFA4EFC4EFE4F004F024F034F044F05 -4F064F074F084F0B4F0C4F124F134F144F154F164F1C4F1D4F214F234F284F29 -4F2C4F2D4F2E4F314F334F354F374F394F3B4F3E4F3F4F404F414F424F444F45 -4F474F484F494F4A4F4B4F4C4F524F544F564F614F624F664F684F6A4F6B4F6D -4F6E4F714F724F754F774F784F794F7A4F7D4F804F814F824F854F864F874F8A -4F8C4F8E4F904F924F934F954F964F984F994F9A4F9C4F9E4F9F4FA14FA20000 -82 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4FA44FAB4FAD4FB04FB14FB24FB34FB44FB64FB74FB84FB94FBA4FBB4FBC4FBD -4FBE4FC04FC14FC24FC64FC74FC84FC94FCB4FCC4FCD4FD24FD34FD44FD54FD6 -4FD94FDB4FE04FE24FE44FE54FE74FEB4FEC4FF04FF24FF44FF54FF64FF74FF9 -4FFB4FFC4FFD4FFF5000500150025003500450055006500750085009500A0000 -500B500E501050115013501550165017501B501D501E50205022502350245027 -502B502F5030503150325033503450355036503750385039503B503D503F5040 -504150425044504550465049504A504B504D5050505150525053505450565057 -50585059505B505D505E505F506050615062506350645066506750685069506A -506B506D506E506F50705071507250735074507550785079507A507C507D5081 -508250835084508650875089508A508B508C508E508F50905091509250935094 -50955096509750985099509A509B509C509D509E509F50A050A150A250A450A6 -50AA50AB50AD50AE50AF50B050B150B350B450B550B650B750B850B950BC0000 -83 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50BD50BE50BF50C050C150C250C350C450C550C650C750C850C950CA50CB50CC -50CD50CE50D050D150D250D350D450D550D750D850D950DB50DC50DD50DE50DF -50E050E150E250E350E450E550E850E950EA50EB50EF50F050F150F250F450F6 -50F750F850F950FA50FC50FD50FE50FF51005101510251035104510551080000 -5109510A510C510D510E510F511051115113511451155116511751185119511A -511B511C511D511E511F512051225123512451255126512751285129512A512B -512C512D512E512F5130513151325133513451355136513751385139513A513B -513C513D513E51425147514A514C514E514F515051525153515751585159515B -515D515E515F5160516151635164516651675169516A516F5172517A517E517F -5183518451865187518A518B518E518F51905191519351945198519A519D519E -519F51A151A351A651A751A851A951AA51AD51AE51B451B851B951BA51BE51BF -51C151C251C351C551C851CA51CD51CE51D051D251D351D451D551D651D70000 -84 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -51D851D951DA51DC51DE51DF51E251E351E551E651E751E851E951EA51EC51EE -51F151F251F451F751FE520452055209520B520C520F5210521352145215521C -521E521F522152225223522552265227522A522C522F5231523252345235523C -523E524452455246524752485249524B524E524F525252535255525752580000 -5259525A525B525D525F526052625263526452665268526B526C526D526E5270 -52715273527452755276527752785279527A527B527C527E5280528352845285 -528652875289528A528B528C528D528E528F5291529252945295529652975298 -5299529A529C52A452A552A652A752AE52AF52B052B452B552B652B752B852B9 -52BA52BB52BC52BD52C052C152C252C452C552C652C852CA52CC52CD52CE52CF -52D152D352D452D552D752D952DA52DB52DC52DD52DE52E052E152E252E352E5 -52E652E752E852E952EA52EB52EC52ED52EE52EF52F152F252F352F452F552F6 -52F752F852FB52FC52FD530153025303530453075309530A530B530C530E0000 -85 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53115312531353145318531B531C531E531F532253245325532753285329532B -532C532D532F533053315332533353345335533653375338533C533D53405342 -53445346534B534C534D5350535453585359535B535D53655368536A536C536D -537253765379537B537C537D537E53805381538353875388538A538E538F0000 -53905391539253935394539653975399539B539C539E53A053A153A453A753AA -53AB53AC53AD53AF53B053B153B253B353B453B553B753B853B953BA53BC53BD -53BE53C053C353C453C553C653C753CE53CF53D053D253D353D553DA53DC53DD -53DE53E153E253E753F453FA53FE53FF5400540254055407540B541454185419 -541A541C542254245425542A5430543354365437543A543D543F544154425444 -544554475449544C544D544E544F5451545A545D545E545F5460546154635465 -54675469546A546B546C546D546E546F547054745479547A547E547F54815483 -5485548754885489548A548D5491549354975498549C549E549F54A054A10000 -86 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54A254A554AE54B054B254B554B654B754B954BA54BC54BE54C354C554CA54CB -54D654D854DB54E054E154E254E354E454EB54EC54EF54F054F154F454F554F6 -54F754F854F954FB54FE550055025503550455055508550A550B550C550D550E -5512551355155516551755185519551A551C551D551E551F5521552555260000 -55285529552B552D553255345535553655385539553A553B553D554055425545 -55475548554B554C554D554E554F5551555255535554555755585559555A555B -555D555E555F55605562556355685569556B556F557055715572557355745579 -557A557D557F55855586558C558D558E559055925593559555965597559A559B -559E55A055A155A255A355A455A555A655A855A955AA55AB55AC55AD55AE55AF -55B055B255B455B655B855BA55BC55BF55C055C155C255C355C655C755C855CA -55CB55CE55CF55D055D555D755D855D955DA55DB55DE55E055E255E755E955ED -55EE55F055F155F455F655F855F955FA55FB55FC55FF56025603560456050000 -87 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -56065607560A560B560D561056115612561356145615561656175619561A561C -561D5620562156225625562656285629562A562B562E562F5630563356355637 -5638563A563C563D563E5640564156425643564456455646564756485649564A -564B564F565056515652565356555656565A565B565D565E565F566056610000 -5663566556665667566D566E566F56705672567356745675567756785679567A -567D567E567F56805681568256835684568756885689568A568B568C568D5690 -56915692569456955696569756985699569A569B569C569D569E569F56A056A1 -56A256A456A556A656A756A856A956AA56AB56AC56AD56AE56B056B156B256B3 -56B456B556B656B856B956BA56BB56BD56BE56BF56C056C156C256C356C456C5 -56C656C756C856C956CB56CC56CD56CE56CF56D056D156D256D356D556D656D8 -56D956DC56E356E556E656E756E856E956EA56EC56EE56EF56F256F356F656F7 -56F856FB56FC57005701570257055707570B570C570D570E570F571057110000 -88 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -57125713571457155716571757185719571A571B571D571E5720572157225724 -572557265727572B5731573257345735573657375738573C573D573F57415743 -57445745574657485749574B5752575357545755575657585759576257635765 -5767576C576E5770577157725774577557785779577A577D577E577F57800000 -5781578757885789578A578D578E578F57905791579457955796579757985799 -579A579C579D579E579F57A557A857AA57AC57AF57B057B157B357B557B657B7 -57B957BA57BB57BC57BD57BE57BF57C057C157C457C557C657C757C857C957CA -57CC57CD57D057D157D357D657D757DB57DC57DE57E157E257E357E557E657E7 -57E857E957EA57EB57EC57EE57F057F157F257F357F557F657F757FB57FC57FE -57FF580158035804580558085809580A580C580E580F58105812581358145816 -58175818581A581B581C581D581F5822582358255826582758285829582B582C -582D582E582F58315832583358345836583758385839583A583B583C583D0000 -89 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -583E583F584058415842584358455846584758485849584A584B584E584F5850 -585258535855585658575859585A585B585C585D585F58605861586258635864 -5866586758685869586A586D586E586F58705871587258735874587558765877 -58785879587A587B587C587D587F58825884588658875888588A588B588C0000 -588D588E588F5890589158945895589658975898589B589C589D58A058A158A2 -58A358A458A558A658A758AA58AB58AC58AD58AE58AF58B058B158B258B358B4 -58B558B658B758B858B958BA58BB58BD58BE58BF58C058C258C358C458C658C7 -58C858C958CA58CB58CC58CD58CE58CF58D058D258D358D458D658D758D858D9 -58DA58DB58DC58DD58DE58DF58E058E158E258E358E558E658E758E858E958EA -58ED58EF58F158F258F458F558F758F858FA58FB58FC58FD58FE58FF59005901 -59035905590659085909590A590B590C590E591059115912591359175918591B -591D591E592059215922592359265928592C59305932593359355936593B0000 -8A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -593D593E593F5940594359455946594A594C594D5950595259535959595B595C -595D595E595F5961596359645966596759685969596A596B596C596D596E596F -59705971597259755977597A597B597C597E597F598059855989598B598C598E -598F59905991599459955998599A599B599C599D599F59A059A159A259A60000 -59A759AC59AD59B059B159B359B459B559B659B759B859BA59BC59BD59BF59C0 -59C159C259C359C459C559C759C859C959CC59CD59CE59CF59D559D659D959DB -59DE59DF59E059E159E259E459E659E759E959EA59EB59ED59EE59EF59F059F1 -59F259F359F459F559F659F759F859FA59FC59FD59FE5A005A025A0A5A0B5A0D -5A0E5A0F5A105A125A145A155A165A175A195A1A5A1B5A1D5A1E5A215A225A24 -5A265A275A285A2A5A2B5A2C5A2D5A2E5A2F5A305A335A355A375A385A395A3A -5A3B5A3D5A3E5A3F5A415A425A435A445A455A475A485A4B5A4C5A4D5A4E5A4F -5A505A515A525A535A545A565A575A585A595A5B5A5C5A5D5A5E5A5F5A600000 -8B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A615A635A645A655A665A685A695A6B5A6C5A6D5A6E5A6F5A705A715A725A73 -5A785A795A7B5A7C5A7D5A7E5A805A815A825A835A845A855A865A875A885A89 -5A8A5A8B5A8C5A8D5A8E5A8F5A905A915A935A945A955A965A975A985A995A9C -5A9D5A9E5A9F5AA05AA15AA25AA35AA45AA55AA65AA75AA85AA95AAB5AAC0000 -5AAD5AAE5AAF5AB05AB15AB45AB65AB75AB95ABA5ABB5ABC5ABD5ABF5AC05AC3 -5AC45AC55AC65AC75AC85ACA5ACB5ACD5ACE5ACF5AD05AD15AD35AD55AD75AD9 -5ADA5ADB5ADD5ADE5ADF5AE25AE45AE55AE75AE85AEA5AEC5AED5AEE5AEF5AF0 -5AF25AF35AF45AF55AF65AF75AF85AF95AFA5AFB5AFC5AFD5AFE5AFF5B005B01 -5B025B035B045B055B065B075B085B0A5B0B5B0C5B0D5B0E5B0F5B105B115B12 -5B135B145B155B185B195B1A5B1B5B1C5B1D5B1E5B1F5B205B215B225B235B24 -5B255B265B275B285B295B2A5B2B5B2C5B2D5B2E5B2F5B305B315B335B355B36 -5B385B395B3A5B3B5B3C5B3D5B3E5B3F5B415B425B435B445B455B465B470000 -8C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B485B495B4A5B4B5B4C5B4D5B4E5B4F5B525B565B5E5B605B615B675B685B6B -5B6D5B6E5B6F5B725B745B765B775B785B795B7B5B7C5B7E5B7F5B825B865B8A -5B8D5B8E5B905B915B925B945B965B9F5BA75BA85BA95BAC5BAD5BAE5BAF5BB1 -5BB25BB75BBA5BBB5BBC5BC05BC15BC35BC85BC95BCA5BCB5BCD5BCE5BCF0000 -5BD15BD45BD55BD65BD75BD85BD95BDA5BDB5BDC5BE05BE25BE35BE65BE75BE9 -5BEA5BEB5BEC5BED5BEF5BF15BF25BF35BF45BF55BF65BF75BFD5BFE5C005C02 -5C035C055C075C085C0B5C0C5C0D5C0E5C105C125C135C175C195C1B5C1E5C1F -5C205C215C235C265C285C295C2A5C2B5C2D5C2E5C2F5C305C325C335C355C36 -5C375C435C445C465C475C4C5C4D5C525C535C545C565C575C585C5A5C5B5C5C -5C5D5C5F5C625C645C675C685C695C6A5C6B5C6C5C6D5C705C725C735C745C75 -5C765C775C785C7B5C7C5C7D5C7E5C805C835C845C855C865C875C895C8A5C8B -5C8E5C8F5C925C935C955C9D5C9E5C9F5CA05CA15CA45CA55CA65CA75CA80000 -8D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5CAA5CAE5CAF5CB05CB25CB45CB65CB95CBA5CBB5CBC5CBE5CC05CC25CC35CC5 -5CC65CC75CC85CC95CCA5CCC5CCD5CCE5CCF5CD05CD15CD35CD45CD55CD65CD7 -5CD85CDA5CDB5CDC5CDD5CDE5CDF5CE05CE25CE35CE75CE95CEB5CEC5CEE5CEF -5CF15CF25CF35CF45CF55CF65CF75CF85CF95CFA5CFC5CFD5CFE5CFF5D000000 -5D015D045D055D085D095D0A5D0B5D0C5D0D5D0F5D105D115D125D135D155D17 -5D185D195D1A5D1C5D1D5D1F5D205D215D225D235D255D285D2A5D2B5D2C5D2F -5D305D315D325D335D355D365D375D385D395D3A5D3B5D3C5D3F5D405D415D42 -5D435D445D455D465D485D495D4D5D4E5D4F5D505D515D525D535D545D555D56 -5D575D595D5A5D5C5D5E5D5F5D605D615D625D635D645D655D665D675D685D6A -5D6D5D6E5D705D715D725D735D755D765D775D785D795D7A5D7B5D7C5D7D5D7E -5D7F5D805D815D835D845D855D865D875D885D895D8A5D8B5D8C5D8D5D8E5D8F -5D905D915D925D935D945D955D965D975D985D9A5D9B5D9C5D9E5D9F5DA00000 -8E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5DA15DA25DA35DA45DA55DA65DA75DA85DA95DAA5DAB5DAC5DAD5DAE5DAF5DB0 -5DB15DB25DB35DB45DB55DB65DB85DB95DBA5DBB5DBC5DBD5DBE5DBF5DC05DC1 -5DC25DC35DC45DC65DC75DC85DC95DCA5DCB5DCC5DCE5DCF5DD05DD15DD25DD3 -5DD45DD55DD65DD75DD85DD95DDA5DDC5DDF5DE05DE35DE45DEA5DEC5DED0000 -5DF05DF55DF65DF85DF95DFA5DFB5DFC5DFF5E005E045E075E095E0A5E0B5E0D -5E0E5E125E135E175E1E5E1F5E205E215E225E235E245E255E285E295E2A5E2B -5E2C5E2F5E305E325E335E345E355E365E395E3A5E3E5E3F5E405E415E435E46 -5E475E485E495E4A5E4B5E4D5E4E5E4F5E505E515E525E535E565E575E585E59 -5E5A5E5C5E5D5E5F5E605E635E645E655E665E675E685E695E6A5E6B5E6C5E6D -5E6E5E6F5E705E715E755E775E795E7E5E815E825E835E855E885E895E8C5E8D -5E8E5E925E985E9B5E9D5EA15EA25EA35EA45EA85EA95EAA5EAB5EAC5EAE5EAF -5EB05EB15EB25EB45EBA5EBB5EBC5EBD5EBF5EC05EC15EC25EC35EC45EC50000 -8F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5EC65EC75EC85ECB5ECC5ECD5ECE5ECF5ED05ED45ED55ED75ED85ED95EDA5EDC -5EDD5EDE5EDF5EE05EE15EE25EE35EE45EE55EE65EE75EE95EEB5EEC5EED5EEE -5EEF5EF05EF15EF25EF35EF55EF85EF95EFB5EFC5EFD5F055F065F075F095F0C -5F0D5F0E5F105F125F145F165F195F1A5F1C5F1D5F1E5F215F225F235F240000 -5F285F2B5F2C5F2E5F305F325F335F345F355F365F375F385F3B5F3D5F3E5F3F -5F415F425F435F445F455F465F475F485F495F4A5F4B5F4C5F4D5F4E5F4F5F51 -5F545F595F5A5F5B5F5C5F5E5F5F5F605F635F655F675F685F6B5F6E5F6F5F72 -5F745F755F765F785F7A5F7D5F7E5F7F5F835F865F8D5F8E5F8F5F915F935F94 -5F965F9A5F9B5F9D5F9E5F9F5FA05FA25FA35FA45FA55FA65FA75FA95FAB5FAC -5FAF5FB05FB15FB25FB35FB45FB65FB85FB95FBA5FBB5FBE5FBF5FC05FC15FC2 -5FC75FC85FCA5FCB5FCE5FD35FD45FD55FDA5FDB5FDC5FDE5FDF5FE25FE35FE5 -5FE65FE85FE95FEC5FEF5FF05FF25FF35FF45FF65FF75FF95FFA5FFC60070000 -90 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -60086009600B600C60106011601360176018601A601E601F602260236024602C -602D602E603060316032603360346036603760386039603A603D603E60406044 -60456046604760486049604A604C604E604F605160536054605660576058605B -605C605E605F6060606160656066606E60716072607460756077607E60800000 -608160826085608660876088608A608B608E608F609060916093609560976098 -6099609C609E60A160A260A460A560A760A960AA60AE60B060B360B560B660B7 -60B960BA60BD60BE60BF60C060C160C260C360C460C760C860C960CC60CD60CE -60CF60D060D260D360D460D660D760D960DB60DE60E160E260E360E460E560EA -60F160F260F560F760F860FB60FC60FD60FE60FF61026103610461056107610A -610B610C611061116112611361146116611761186119611B611C611D611E6121 -6122612561286129612A612C612D612E612F6130613161326133613461356136 -613761386139613A613B613C613D613E61406141614261436144614561460000 -91 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -61476149614B614D614F61506152615361546156615761586159615A615B615C -615E615F6160616161636164616561666169616A616B616C616D616E616F6171 -617261736174617661786179617A617B617C617D617E617F6180618161826183 -618461856186618761886189618A618C618D618F619061916192619361950000 -6196619761986199619A619B619C619E619F61A061A161A261A361A461A561A6 -61AA61AB61AD61AE61AF61B061B161B261B361B461B561B661B861B961BA61BB -61BC61BD61BF61C061C161C361C461C561C661C761C961CC61CD61CE61CF61D0 -61D361D561D661D761D861D961DA61DB61DC61DD61DE61DF61E061E161E261E3 -61E461E561E761E861E961EA61EB61EC61ED61EE61EF61F061F161F261F361F4 -61F661F761F861F961FA61FB61FC61FD61FE6200620162026203620462056207 -6209621362146219621C621D621E622062236226622762286229622B622D622F -6230623162326235623662386239623A623B623C6242624462456246624A0000 -92 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -624F62506255625662576259625A625C625D625E625F62606261626262646265 -6268627162726274627562776278627A627B627D628162826283628562866287 -6288628B628C628D628E628F629062946299629C629D629E62A362A662A762A9 -62AA62AD62AE62AF62B062B262B362B462B662B762B862BA62BE62C062C10000 -62C362CB62CF62D162D562DD62DE62E062E162E462EA62EB62F062F262F562F8 -62F962FA62FB63006303630463056306630A630B630C630D630F631063126313 -63146315631763186319631C632663276329632C632D632E6330633163336334 -6335633663376338633B633C633E633F63406341634463476348634A63516352 -635363546356635763586359635A635B635C635D63606364636563666368636A -636B636C636F6370637263736374637563786379637C637D637E637F63816383 -638463856386638B638D639163936394639563976399639A639B639C639D639E -639F63A163A463A663AB63AF63B163B263B563B663B963BB63BD63BF63C00000 -93 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63C163C263C363C563C763C863CA63CB63CC63D163D363D463D563D763D863D9 -63DA63DB63DC63DD63DF63E263E463E563E663E763E863EB63EC63EE63EF63F0 -63F163F363F563F763F963FA63FB63FC63FE640364046406640764086409640A -640D640E6411641264156416641764186419641A641D641F6422642364240000 -6425642764286429642B642E642F643064316432643364356436643764386439 -643B643C643E6440644264436449644B644C644D644E644F6450645164536455 -645664576459645A645B645C645D645F64606461646264636464646564666468 -646A646B646C646E646F64706471647264736474647564766477647B647C647D -647E647F648064816483648664886489648A648B648C648D648E648F64906493 -649464976498649A649B649C649D649F64A064A164A264A364A564A664A764A8 -64AA64AB64AF64B164B264B364B464B664B964BB64BD64BE64BF64C164C364C4 -64C664C764C864C964CA64CB64CC64CF64D164D364D464D564D664D964DA0000 -94 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -64DB64DC64DD64DF64E064E164E364E564E764E864E964EA64EB64EC64ED64EE -64EF64F064F164F264F364F464F564F664F764F864F964FA64FB64FC64FD64FE -64FF65016502650365046505650665076508650A650B650C650D650E650F6510 -6511651365146515651665176519651A651B651C651D651E651F652065210000 -6522652365246526652765286529652A652C652D65306531653265336537653A -653C653D6540654165426543654465466547654A654B654D654E655065526553 -655465576558655A655C655F6560656165646565656765686569656A656D656E -656F657165736575657665786579657A657B657C657D657E657F658065816582 -658365846585658665886589658A658D658E658F65926594659565966598659A -659D659E65A065A265A365A665A865AA65AC65AE65B165B265B365B465B565B6 -65B765B865BA65BB65BE65BF65C065C265C765C865C965CA65CD65D065D165D3 -65D465D565D865D965DA65DB65DC65DD65DE65DF65E165E365E465EA65EB0000 -95 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -65F265F365F465F565F865F965FB65FC65FD65FE65FF66016604660566076608 -6609660B660D661066116612661666176618661A661B661C661E662166226623 -662466266629662A662B662C662E663066326633663766386639663A663B663D -663F66406642664466456646664766486649664A664D664E6650665166580000 -6659665B665C665D665E666066626663666566676669666A666B666C666D6671 -66726673667566786679667B667C667D667F6680668166836685668666886689 -668A668B668D668E668F6690669266936694669566986699669A669B669C669E -669F66A066A166A266A366A466A566A666A966AA66AB66AC66AD66AF66B066B1 -66B266B366B566B666B766B866BA66BB66BC66BD66BF66C066C166C266C366C4 -66C566C666C766C866C966CA66CB66CC66CD66CE66CF66D066D166D266D366D4 -66D566D666D766D866DA66DE66DF66E066E166E266E366E466E566E766E866EA -66EB66EC66ED66EE66EF66F166F566F666F866FA66FB66FD6701670267030000 -96 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6704670567066707670C670E670F671167126713671667186719671A671C671E -67206721672267236724672567276729672E6730673267336736673767386739 -673B673C673E673F6741674467456747674A674B674D67526754675567576758 -6759675A675B675D67626763676467666767676B676C676E6771677467760000 -67786779677A677B677D678067826783678567866788678A678C678D678E678F -679167926793679467966799679B679F67A067A167A467A667A967AC67AE67B1 -67B267B467B967BA67BB67BC67BD67BE67BF67C067C267C567C667C767C867C9 -67CA67CB67CC67CD67CE67D567D667D767DB67DF67E167E367E467E667E767E8 -67EA67EB67ED67EE67F267F567F667F767F867F967FA67FB67FC67FE68016802 -680368046806680D681068126814681568186819681A681B681C681E681F6820 -6822682368246825682668276828682B682C682D682E682F6830683168346835 -6836683A683B683F6847684B684D684F68526856685768586859685A685B0000 -97 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -685C685D685E685F686A686C686D686E686F6870687168726873687568786879 -687A687B687C687D687E687F688068826884688768886889688A688B688C688D -688E68906891689268946895689668986899689A689B689C689D689E689F68A0 -68A168A368A468A568A968AA68AB68AC68AE68B168B268B468B668B768B80000 -68B968BA68BB68BC68BD68BE68BF68C168C368C468C568C668C768C868CA68CC -68CE68CF68D068D168D368D468D668D768D968DB68DC68DD68DE68DF68E168E2 -68E468E568E668E768E868E968EA68EB68EC68ED68EF68F268F368F468F668F7 -68F868FB68FD68FE68FF69006902690369046906690769086909690A690C690F -69116913691469156916691769186919691A691B691C691D691E692169226923 -69256926692769286929692A692B692C692E692F693169326933693569366937 -6938693A693B693C693E694069416943694469456946694769486949694A694B -694C694D694E694F69506951695269536955695669586959695B695C695F0000 -98 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6961696269646965696769686969696A696C696D696F69706972697369746975 -6976697A697B697D697E697F698169836985698A698B698C698E698F69906991 -69926993699669976999699A699D699E699F69A069A169A269A369A469A569A6 -69A969AA69AC69AE69AF69B069B269B369B569B669B869B969BA69BC69BD0000 -69BE69BF69C069C269C369C469C569C669C769C869C969CB69CD69CF69D169D2 -69D369D569D669D769D869D969DA69DC69DD69DE69E169E269E369E469E569E6 -69E769E869E969EA69EB69EC69EE69EF69F069F169F369F469F569F669F769F8 -69F969FA69FB69FC69FE6A006A016A026A036A046A056A066A076A086A096A0B -6A0C6A0D6A0E6A0F6A106A116A126A136A146A156A166A196A1A6A1B6A1C6A1D -6A1E6A206A226A236A246A256A266A276A296A2B6A2C6A2D6A2E6A306A326A33 -6A346A366A376A386A396A3A6A3B6A3C6A3F6A406A416A426A436A456A466A48 -6A496A4A6A4B6A4C6A4D6A4E6A4F6A516A526A536A546A556A566A576A5A0000 -99 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A5C6A5D6A5E6A5F6A606A626A636A646A666A676A686A696A6A6A6B6A6C6A6D -6A6E6A6F6A706A726A736A746A756A766A776A786A7A6A7B6A7D6A7E6A7F6A81 -6A826A836A856A866A876A886A896A8A6A8B6A8C6A8D6A8F6A926A936A946A95 -6A966A986A996A9A6A9B6A9C6A9D6A9E6A9F6AA16AA26AA36AA46AA56AA60000 -6AA76AA86AAA6AAD6AAE6AAF6AB06AB16AB26AB36AB46AB56AB66AB76AB86AB9 -6ABA6ABB6ABC6ABD6ABE6ABF6AC06AC16AC26AC36AC46AC56AC66AC76AC86AC9 -6ACA6ACB6ACC6ACD6ACE6ACF6AD06AD16AD26AD36AD46AD56AD66AD76AD86AD9 -6ADA6ADB6ADC6ADD6ADE6ADF6AE06AE16AE26AE36AE46AE56AE66AE76AE86AE9 -6AEA6AEB6AEC6AED6AEE6AEF6AF06AF16AF26AF36AF46AF56AF66AF76AF86AF9 -6AFA6AFB6AFC6AFD6AFE6AFF6B006B016B026B036B046B056B066B076B086B09 -6B0A6B0B6B0C6B0D6B0E6B0F6B106B116B126B136B146B156B166B176B186B19 -6B1A6B1B6B1C6B1D6B1E6B1F6B256B266B286B296B2A6B2B6B2C6B2D6B2E0000 -9A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6B2F6B306B316B336B346B356B366B386B3B6B3C6B3D6B3F6B406B416B426B44 -6B456B486B4A6B4B6B4D6B4E6B4F6B506B516B526B536B546B556B566B576B58 -6B5A6B5B6B5C6B5D6B5E6B5F6B606B616B686B696B6B6B6C6B6D6B6E6B6F6B70 -6B716B726B736B746B756B766B776B786B7A6B7D6B7E6B7F6B806B856B880000 -6B8C6B8E6B8F6B906B916B946B956B976B986B996B9C6B9D6B9E6B9F6BA06BA2 -6BA36BA46BA56BA66BA76BA86BA96BAB6BAC6BAD6BAE6BAF6BB06BB16BB26BB6 -6BB86BB96BBA6BBB6BBC6BBD6BBE6BC06BC36BC46BC66BC76BC86BC96BCA6BCC -6BCE6BD06BD16BD86BDA6BDC6BDD6BDE6BDF6BE06BE26BE36BE46BE56BE66BE7 -6BE86BE96BEC6BED6BEE6BF06BF16BF26BF46BF66BF76BF86BFA6BFB6BFC6BFE -6BFF6C006C016C026C036C046C086C096C0A6C0B6C0C6C0E6C126C176C1C6C1D -6C1E6C206C236C256C2B6C2C6C2D6C316C336C366C376C396C3A6C3B6C3C6C3E -6C3F6C436C446C456C486C4B6C4C6C4D6C4E6C4F6C516C526C536C566C580000 -9B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6C596C5A6C626C636C656C666C676C6B6C6C6C6D6C6E6C6F6C716C736C756C77 -6C786C7A6C7B6C7C6C7F6C806C846C876C8A6C8B6C8D6C8E6C916C926C956C96 -6C976C986C9A6C9C6C9D6C9E6CA06CA26CA86CAC6CAF6CB06CB46CB56CB66CB7 -6CBA6CC06CC16CC26CC36CC66CC76CC86CCB6CCD6CCE6CCF6CD16CD26CD80000 -6CD96CDA6CDC6CDD6CDF6CE46CE66CE76CE96CEC6CED6CF26CF46CF96CFF6D00 -6D026D036D056D066D086D096D0A6D0D6D0F6D106D116D136D146D156D166D18 -6D1C6D1D6D1F6D206D216D226D236D246D266D286D296D2C6D2D6D2F6D306D34 -6D366D376D386D3A6D3F6D406D426D446D496D4C6D506D556D566D576D586D5B -6D5D6D5F6D616D626D646D656D676D686D6B6D6C6D6D6D706D716D726D736D75 -6D766D796D7A6D7B6D7D6D7E6D7F6D806D816D836D846D866D876D8A6D8B6D8D -6D8F6D906D926D966D976D986D996D9A6D9C6DA26DA56DAC6DAD6DB06DB16DB3 -6DB46DB66DB76DB96DBA6DBB6DBC6DBD6DBE6DC16DC26DC36DC86DC96DCA0000 -9C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6DCD6DCE6DCF6DD06DD26DD36DD46DD56DD76DDA6DDB6DDC6DDF6DE26DE36DE5 -6DE76DE86DE96DEA6DED6DEF6DF06DF26DF46DF56DF66DF86DFA6DFD6DFE6DFF -6E006E016E026E036E046E066E076E086E096E0B6E0F6E126E136E156E186E19 -6E1B6E1C6E1E6E1F6E226E266E276E286E2A6E2C6E2E6E306E316E336E350000 -6E366E376E396E3B6E3C6E3D6E3E6E3F6E406E416E426E456E466E476E486E49 -6E4A6E4B6E4C6E4F6E506E516E526E556E576E596E5A6E5C6E5D6E5E6E606E61 -6E626E636E646E656E666E676E686E696E6A6E6C6E6D6E6F6E706E716E726E73 -6E746E756E766E776E786E796E7A6E7B6E7C6E7D6E806E816E826E846E876E88 -6E8A6E8B6E8C6E8D6E8E6E916E926E936E946E956E966E976E996E9A6E9B6E9D -6E9E6EA06EA16EA36EA46EA66EA86EA96EAB6EAC6EAD6EAE6EB06EB36EB56EB8 -6EB96EBC6EBE6EBF6EC06EC36EC46EC56EC66EC86EC96ECA6ECC6ECD6ECE6ED0 -6ED26ED66ED86ED96EDB6EDC6EDD6EE36EE76EEA6EEB6EEC6EED6EEE6EEF0000 -9D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6EF06EF16EF26EF36EF56EF66EF76EF86EFA6EFB6EFC6EFD6EFE6EFF6F006F01 -6F036F046F056F076F086F0A6F0B6F0C6F0D6F0E6F106F116F126F166F176F18 -6F196F1A6F1B6F1C6F1D6F1E6F1F6F216F226F236F256F266F276F286F2C6F2E -6F306F326F346F356F376F386F396F3A6F3B6F3C6F3D6F3F6F406F416F420000 -6F436F446F456F486F496F4A6F4C6F4E6F4F6F506F516F526F536F546F556F56 -6F576F596F5A6F5B6F5D6F5F6F606F616F636F646F656F676F686F696F6A6F6B -6F6C6F6F6F706F716F736F756F766F776F796F7B6F7D6F7E6F7F6F806F816F82 -6F836F856F866F876F8A6F8B6F8F6F906F916F926F936F946F956F966F976F98 -6F996F9A6F9B6F9D6F9E6F9F6FA06FA26FA36FA46FA56FA66FA86FA96FAA6FAB -6FAC6FAD6FAE6FAF6FB06FB16FB26FB46FB56FB76FB86FBA6FBB6FBC6FBD6FBE -6FBF6FC16FC36FC46FC56FC66FC76FC86FCA6FCB6FCC6FCD6FCE6FCF6FD06FD3 -6FD46FD56FD66FD76FD86FD96FDA6FDB6FDC6FDD6FDF6FE26FE36FE46FE50000 -9E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6FE66FE76FE86FE96FEA6FEB6FEC6FED6FF06FF16FF26FF36FF46FF56FF66FF7 -6FF86FF96FFA6FFB6FFC6FFD6FFE6FFF70007001700270037004700570067007 -70087009700A700B700C700D700E700F70107012701370147015701670177018 -7019701C701D701E701F702070217022702470257026702770287029702A0000 -702B702C702D702E702F70307031703270337034703670377038703A703B703C -703D703E703F7040704170427043704470457046704770487049704A704B704D -704E7050705170527053705470557056705770587059705A705B705C705D705F -7060706170627063706470657066706770687069706A706E7071707270737074 -70777079707A707B707D7081708270837084708670877088708B708C708D708F -70907091709370977098709A709B709E709F70A070A170A270A370A470A570A6 -70A770A870A970AA70B070B270B470B570B670BA70BE70BF70C470C570C670C7 -70C970CB70CC70CD70CE70CF70D070D170D270D370D470D570D670D770DA0000 -9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -70DC70DD70DE70E070E170E270E370E570EA70EE70F070F170F270F370F470F5 -70F670F870FA70FB70FC70FE70FF710071017102710371047105710671077108 -710B710C710D710E710F7111711271147117711B711C711D711E711F71207121 -7122712371247125712771287129712A712B712C712D712E7132713371340000 -7135713771387139713A713B713C713D713E713F714071417142714371447146 -714771487149714B714D714F7150715171527153715471557156715771587159 -715A715B715D715F716071617162716371657169716A716B716C716D716F7170 -717171747175717671777179717B717C717E717F718071817182718371857186 -718771887189718B718C718D718E7190719171927193719571967197719A719B -719C719D719E71A171A271A371A471A571A671A771A971AA71AB71AD71AE71AF -71B071B171B271B471B671B771B871BA71BB71BC71BD71BE71BF71C071C171C2 -71C471C571C671C771C871C971CA71CB71CC71CD71CF71D071D171D271D30000 -A0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -71D671D771D871D971DA71DB71DC71DD71DE71DF71E171E271E371E471E671E8 -71E971EA71EB71EC71ED71EF71F071F171F271F371F471F571F671F771F871FA -71FB71FC71FD71FE71FF720072017202720372047205720772087209720A720B -720C720D720E720F7210721172127213721472157216721772187219721A0000 -721B721C721E721F722072217222722372247225722672277229722B722D722E -722F723272337234723A723C723E72407241724272437244724572467249724A -724B724E724F7250725172537254725572577258725A725C725E726072637264 -72657268726A726B726C726D7270727172737274727672777278727B727C727D -7282728372857286728772887289728C728E7290729172937294729572967297 -72987299729A729B729C729D729E72A072A172A272A372A472A572A672A772A8 -72A972AA72AB72AE72B172B272B372B572BA72BB72BC72BD72BE72BF72C072C5 -72C672C772C972CA72CB72CC72CF72D172D372D472D572D672D872DA72DB0000 -A1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030003001300200B702C902C700A8300330052014FF5E2016202620182019 -201C201D3014301530083009300A300B300C300D300E300F3016301730103011 -00B100D700F72236222722282211220F222A222922082237221A22A522252220 -23122299222B222E2261224C2248223D221D2260226E226F22642265221E2235 -22342642264000B0203220332103FF0400A4FFE0FFE1203000A7211626062605 -25CB25CF25CE25C725C625A125A025B325B2203B219221902191219330130000 -A2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000217021712172217321742175217621772178217900000000000000000000 -000024882489248A248B248C248D248E248F2490249124922493249424952496 -249724982499249A249B247424752476247724782479247A247B247C247D247E -247F248024812482248324842485248624872460246124622463246424652466 -2467246824690000000032203221322232233224322532263227322832290000 -00002160216121622163216421652166216721682169216A216B000000000000 -A3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF01FF02FF03FFE5FF05FF06FF07FF08FF09FF0AFF0BFF0CFF0DFF0EFF0F -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19FF1AFF1BFF1CFF1DFF1EFF1F -FF20FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF3BFF3CFF3DFF3EFF3F -FF40FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5AFF5BFF5CFF5DFFE30000 -A4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -A5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -A6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -FE35FE36FE39FE3AFE3FFE40FE3DFE3EFE41FE42FE43FE4400000000FE3BFE3C -FE37FE38FE310000FE33FE340000000000000000000000000000000000000000 -A7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000004100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -A8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -02CA02CB02D920132015202520352105210921962197219821992215221F2223 -22522266226722BF2550255125522553255425552556255725582559255A255B -255C255D255E255F2560256125622563256425652566256725682569256A256B -256C256D256E256F257025712572257325812582258325842585258625870000 -25882589258A258B258C258D258E258F25932594259525BC25BD25E225E325E4 -25E5260922953012301D301E0000000000000000000000000000000000000000 -0000010100E101CE00E0011300E9011B00E8012B00ED01D000EC014D00F301D2 -00F2016B00FA01D400F901D601D801DA01DC00FC00EA02510000014401480000 -0261000000000000000031053106310731083109310A310B310C310D310E310F -3110311131123113311431153116311731183119311A311B311C311D311E311F -3120312131223123312431253126312731283129000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30213022302330243025302630273028302932A3338E338F339C339D339E33A1 -33C433CE33D133D233D5FE30FFE2FFE400002121323100002010000000000000 -30FC309B309C30FD30FE3006309D309EFE49FE4AFE4BFE4CFE4DFE4EFE4FFE50 -FE51FE52FE54FE55FE56FE57FE59FE5AFE5BFE5CFE5DFE5EFE5FFE60FE610000 -FE62FE63FE64FE65FE66FE68FE69FE6AFE6B0000000000000000000000000000 -0000000000000000000000003007000000000000000000000000000000000000 -00000000000000002500250125022503250425052506250725082509250A250B -250C250D250E250F2510251125122513251425152516251725182519251A251B -251C251D251E251F2520252125222523252425252526252725282529252A252B -252C252D252E252F2530253125322533253425352536253725382539253A253B -253C253D253E253F2540254125422543254425452546254725482549254A254B -0000000000000000000000000000000000000000000000000000000000000000 -AA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -72DC72DD72DF72E272E372E472E572E672E772EA72EB72F572F672F972FD72FE -72FF73007302730473057306730773087309730B730C730D730F731073117312 -731473187319731A731F732073237324732673277328732D732F733073327333 -73357336733A733B733C733D7340734173427343734473457346734773480000 -7349734A734B734C734E734F7351735373547355735673587359735A735B735C -735D735E735F736173627363736473657366736773687369736A736B736E7370 -7371000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -AB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -73727373737473757376737773787379737A737B737C737D737F738073817382 -7383738573867388738A738C738D738F73907392739373947395739773987399 -739A739C739D739E73A073A173A373A473A573A673A773A873AA73AC73AD73B1 -73B473B573B673B873B973BC73BD73BE73BF73C173C373C473C573C673C70000 -73CB73CC73CE73D273D373D473D573D673D773D873DA73DB73DC73DD73DF73E1 -73E273E373E473E673E873EA73EB73EC73EE73EF73F073F173F373F473F573F6 -73F7000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -AC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -73F873F973FA73FB73FC73FD73FE73FF740074017402740474077408740B740C -740D740E741174127413741474157416741774187419741C741D741E741F7420 -74217423742474277429742B742D742F74317432743774387439743A743B743D -743E743F744074427443744474457446744774487449744A744B744C744D0000 -744E744F7450745174527453745474567458745D746074617462746374647465 -7466746774687469746A746B746C746E746F7471747274737474747574787479 -747A000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -AD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -747B747C747D747F748274847485748674887489748A748C748D748F74917492 -7493749474957496749774987499749A749B749D749F74A074A174A274A374A4 -74A574A674AA74AB74AC74AD74AE74AF74B074B174B274B374B474B574B674B7 -74B874B974BB74BC74BD74BE74BF74C074C174C274C374C474C574C674C70000 -74C874C974CA74CB74CC74CD74CE74CF74D074D174D374D474D574D674D774D8 -74D974DA74DB74DD74DF74E174E574E774E874E974EA74EB74EC74ED74F074F1 -74F2000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -AE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74F374F574F874F974FA74FB74FC74FD74FE7500750175027503750575067507 -75087509750A750B750C750E751075127514751575167517751B751D751E7520 -752175227523752475267527752A752E753475367539753C753D753F75417542 -75437544754675477549754A754D755075517552755375557556755775580000 -755D755E755F75607561756275637564756775687569756B756C756D756E756F -757075717573757575767577757A757B757C757D757E75807581758275847585 -7587000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -AF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -75887589758A758C758D758E7590759375957598759B759C759E75A275A675A7 -75A875A975AA75AD75B675B775BA75BB75BF75C075C175C675CB75CC75CE75CF -75D075D175D375D775D975DA75DC75DD75DF75E075E175E575E975EC75ED75EE -75EF75F275F375F575F675F775F875FA75FB75FD75FE76027604760676070000 -76087609760B760D760E760F76117612761376147616761A761C761D761E7621 -762376277628762C762E762F76317632763676377639763A763B763D76417642 -7644000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -B0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -76457646764776487649764A764B764E764F7650765176527653765576577658 -7659765A765B765D765F766076617662766476657666766776687669766A766C -766D766E767076717672767376747675767676777679767A767C767F76807681 -768376857689768A768C768D768F769076927694769576977698769A769B0000 -769C769D769E769F76A076A176A276A376A576A676A776A876A976AA76AB76AC -76AD76AF76B076B376B576B676B776B876B976BA76BB76BC76BD76BE76C076C1 -76C3554A963F57C3632854CE550954C07691764C853C77EE827E788D72319698 -978D6C285B894FFA630966975CB880FA684880AE660276CE51F9655671AC7FF1 -888450B2596561CA6FB382AD634C625253ED54277B06516B75A45DF462D48DCB -9776628A8019575D97387F627238767D67CF767E64464F708D2562DC7A176591 -73ED642C6273822C9881677F7248626E62CC4F3474E3534A529E7ECA90A65E2E -6886699C81807ED168D278C5868C9551508D8C2482DE80DE5305891252650000 -B1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -76C476C776C976CB76CC76D376D576D976DA76DC76DD76DE76E076E176E276E3 -76E476E676E776E876E976EA76EB76EC76ED76F076F376F576F676F776FA76FB -76FD76FF77007702770377057706770A770C770E770F77107711771277137714 -7715771677177718771B771C771D771E77217723772477257727772A772B0000 -772C772E773077317732773377347739773B773D773E773F7742774477457746 -77487749774A774B774C774D774E774F77527753775477557756775777587759 -775C858496F94FDD582199715B9D62B162A566B48C799C8D7206676F789160B2 -535153178F8880CC8D1D94A1500D72C8590760EB711988AB595482EF672C7B28 -5D297EF7752D6CF58E668FF8903C9F3B6BD491197B145F7C78A784D6853D6BD5 -6BD96BD65E015E8775F995ED655D5F0A5FC58F9F58C181C2907F965B97AD8FB9 -7F168D2C62414FBF53D8535E8FA88FA98FAB904D68075F6A819888689CD6618B -522B762A5F6C658C6FD26EE85BBE6448517551B067C44E1979C9997C70B30000 -B2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -775D775E775F7760776477677769776A776D776E776F77707771777277737774 -7775777677777778777A777B777C7781778277837786778777887789778A778B -778F77907793779477957796779777987799779A779B779C779D779E77A177A3 -77A477A677A877AB77AD77AE77AF77B177B277B477B677B777B877B977BA0000 -77BC77BE77C077C177C277C377C477C577C677C777C877C977CA77CB77CC77CE -77CF77D077D177D277D377D477D577D677D877D977DA77DD77DE77DF77E077E1 -77E475C55E7673BB83E064AD62E894B56CE2535A52C3640F94C27B944F2F5E1B -82368116818A6E246CCA9A736355535C54FA886557E04E0D5E036B657C3F90E8 -601664E6731C88C16750624D8D22776C8E2991C75F6983DC8521991053C28695 -6B8B60ED60E8707F82CD82314ED36CA785CF64CD7CD969FD66F9834953957B56 -4FA7518C6D4B5C428E6D63D253C9832C833667E578B4643D5BDF5C945DEE8BE7 -62C667F48C7A640063BA8749998B8C177F2094F24EA7961098A4660C73160000 -B3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -77E677E877EA77EF77F077F177F277F477F577F777F977FA77FB77FC78037804 -7805780678077808780A780B780E780F7810781378157819781B781E78207821 -782278247828782A782B782E782F78317832783378357836783D783F78417842 -78437844784678487849784A784B784D784F78517853785478587859785A0000 -785B785C785E785F7860786178627863786478657866786778687869786F7870 -78717872787378747875787678787879787A787B787D787E787F788078817882 -7883573A5C1D5E38957F507F80A05382655E7545553150218D856284949E671D -56326F6E5DE2543570928F66626F64A463A35F7B6F8890F481E38FB05C186668 -5FF16C8996488D81886C649179F057CE6A59621054484E587A0B60E96F848BDA -627F901E9A8B79E4540375F4630153196C608FDF5F1B9A70803B9F7F4F885C3A -8D647FC565A570BD514551B2866B5D075BA062BD916C75748E0C7A2061017B79 -4EC77EF877854E1181ED521D51FA6A7153A88E87950496CF6EC19664695A0000 -B4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7884788578867888788A788B788F789078927894789578967899789D789E78A0 -78A278A478A678A878A978AA78AB78AC78AD78AE78AF78B578B678B778B878BA -78BB78BC78BD78BF78C078C278C378C478C678C778C878CC78CD78CE78CF78D1 -78D278D378D678D778D878DA78DB78DC78DD78DE78DF78E078E178E278E30000 -78E478E578E678E778E978EA78EB78ED78EE78EF78F078F178F378F578F678F8 -78F978FB78FC78FD78FE78FF79007902790379047906790779087909790A790B -790C784050A877D7641089E6590463E35DDD7A7F693D4F20823955984E3275AE -7A975E625E8A95EF521B5439708A6376952457826625693F918755076DF37EAF -882262337EF075B5832878C196CC8F9E614874F78BCD6B64523A8D506B21806A -847156F153064ECE4E1B51D17C97918B7C074FC38E7F7BE17A9C64675D1450AC -810676017CB96DEC7FE067515B585BF878CB64AE641363AA632B9519642D8FBE -7B5476296253592754466B7950A362345E266B864EE38D37888B5F85902E0000 -B5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -790D790E790F791079117912791479157916791779187919791A791B791C791D -791F792079217922792379257926792779287929792A792B792C792D792E792F -793079317932793379357936793779387939793D793F79427943794479457947 -794A794B794C794D794E794F7950795179527954795579587959796179630000 -796479667969796A796B796C796E79707971797279737974797579767979797B -797C797D797E797F798279837986798779887989798B798C798D798E79907991 -79926020803D62C54E39535590F863B880C665E66C2E4F4660EE6DE18BDE5F39 -86CB5F536321515A83616863520063638E4850125C9B79775BFC52307A3B60BC -905376D75FB75F9776848E6C706F767B7B4977AA51F3909358244F4E6EF48FEA -654C7B1B72C46DA47FDF5AE162B55E95573084827B2C5E1D5F1F90127F1498A0 -63826EC7789870B95178975B57AB75354F4375385E9760E659606DC06BBF7889 -53FC96D551CB52016389540A94938C038DCC7239789F87768FED8C0D53E00000 -B6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7993799479957996799779987999799B799C799D799E799F79A079A179A279A3 -79A479A579A679A879A979AA79AB79AC79AD79AE79AF79B079B179B279B479B5 -79B679B779B879BC79BF79C279C479C579C779C879CA79CC79CE79CF79D079D3 -79D479D679D779D979DA79DB79DC79DD79DE79E079E179E279E579E879EA0000 -79EC79EE79F179F279F379F479F579F679F779F979FA79FC79FE79FF7A017A04 -7A057A077A087A097A0A7A0C7A0F7A107A117A127A137A157A167A187A197A1B -7A1C4E0176EF53EE948998769F0E952D5B9A8BA24E224E1C51AC846361C252A8 -680B4F97606B51BB6D1E515C6296659796618C46901775D890FD77636BD2728A -72EC8BFB583577798D4C675C9540809A5EA66E2159927AEF77ED953B6BB565AD -7F0E58065151961F5BF958A954288E726566987F56E4949D76FE9041638754C6 -591A593A579B8EB267358DFA8235524160F0581586FE5CE89E454FC4989D8BB9 -5A2560765384627C904F9102997F6069800C513F80335C1499756D314E8C0000 -B7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7A1D7A1F7A217A227A247A257A267A277A287A297A2A7A2B7A2C7A2D7A2E7A2F -7A307A317A327A347A357A367A387A3A7A3E7A407A417A427A437A447A457A47 -7A487A497A4A7A4B7A4C7A4D7A4E7A4F7A507A527A537A547A557A567A587A59 -7A5A7A5B7A5C7A5D7A5E7A5F7A607A617A627A637A647A657A667A677A680000 -7A697A6A7A6B7A6C7A6D7A6E7A6F7A717A727A737A757A7B7A7C7A7D7A7E7A82 -7A857A877A897A8A7A8B7A8C7A8E7A8F7A907A937A947A997A9A7A9B7A9E7AA1 -7AA28D3053D17F5A7B4F4F104E4F96006CD573D085E95E06756A7FFB6A0A77FE -94927E4151E170E653CD8FD483038D2972AF996D6CDB574A82B365B980AA623F -963259A84EFF8BBF7EBA653E83F2975E556198DE80A5532A8BFD542080BA5E9F -6CB88D3982AC915A54296C1B52067EB7575F711A6C7E7C89594B4EFD5FFF6124 -7CAA4E305C0167AB87025CF0950B98CE75AF70FD902251AF7F1D8BBD594951E4 -4F5B5426592B657780A45B75627662C28F905E456C1F7B264F0F4FD8670D0000 -B8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7AA37AA47AA77AA97AAA7AAB7AAE7AAF7AB07AB17AB27AB47AB57AB67AB77AB8 -7AB97ABA7ABB7ABC7ABD7ABE7AC07AC17AC27AC37AC47AC57AC67AC77AC87AC9 -7ACA7ACC7ACD7ACE7ACF7AD07AD17AD27AD37AD47AD57AD77AD87ADA7ADB7ADC -7ADD7AE17AE27AE47AE77AE87AE97AEA7AEB7AEC7AEE7AF07AF17AF27AF30000 -7AF47AF57AF67AF77AF87AFB7AFC7AFE7B007B017B027B057B077B097B0C7B0D -7B0E7B107B127B137B167B177B187B1A7B1C7B1D7B1F7B217B227B237B277B29 -7B2D6D6E6DAA798F88B15F17752B629A8F854FEF91DC65A7812F81515E9C8150 -8D74526F89868D4B590D50854ED8961C723681798D1F5BCC8BA3964459877F1A -54905676560E8BE565396982949976D66E895E727518674667D17AFF809D8D76 -611F79C665628D635188521A94A27F38809B7EB25C976E2F67607BD9768B9AD8 -818F7F947CD5641E95507A3F544A54E56B4C640162089E3D80F3759952729769 -845B683C86E49601969494EC4E2A54047ED968398DDF801566F45E9A7FB90000 -B9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7B2F7B307B327B347B357B367B377B397B3B7B3D7B3F7B407B417B427B437B44 -7B467B487B4A7B4D7B4E7B537B557B577B597B5C7B5E7B5F7B617B637B647B65 -7B667B677B687B697B6A7B6B7B6C7B6D7B6F7B707B737B747B767B787B7A7B7C -7B7D7B7F7B817B827B837B847B867B877B887B897B8A7B8B7B8C7B8E7B8F0000 -7B917B927B937B967B987B997B9A7B9B7B9E7B9F7BA07BA37BA47BA57BAE7BAF -7BB07BB27BB37BB57BB67BB77BB97BBA7BBB7BBC7BBD7BBE7BBF7BC07BC27BC3 -7BC457C2803F68975DE5653B529F606D9F9A4F9B8EAC516C5BAB5F135DE96C5E -62F18D21517194A952FE6C9F82DF72D757A267848D2D591F8F9C83C754957B8D -4F306CBD5B6459D19F1353E486CA9AA88C3780A16545987E56FA96C7522E74DC -52505BE1630289024E5662D0602A68FA51735B9851A089C27BA199867F5060EF -704C8D2F51495E7F901B747089C4572D78455F529F9F95FA8F689B3C8BE17678 -684267DC8DEA8D35523D8F8A6EDA68CD950590ED56FD679C88F98FC754C80000 -BA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7BC57BC87BC97BCA7BCB7BCD7BCE7BCF7BD07BD27BD47BD57BD67BD77BD87BDB -7BDC7BDE7BDF7BE07BE27BE37BE47BE77BE87BE97BEB7BEC7BED7BEF7BF07BF2 -7BF37BF47BF57BF67BF87BF97BFA7BFB7BFD7BFF7C007C017C027C037C047C05 -7C067C087C097C0A7C0D7C0E7C107C117C127C137C147C157C177C187C190000 -7C1A7C1B7C1C7C1D7C1E7C207C217C227C237C247C257C287C297C2B7C2C7C2D -7C2E7C2F7C307C317C327C337C347C357C367C377C397C3A7C3B7C3C7C3D7C3E -7C429AB85B696D776C264EA55BB39A87916361A890AF97E9542B6DB55BD251FD -558A7F557FF064BC634D65F161BE608D710A6C576C49592F676D822A58D5568E -8C6A6BEB90DD597D801753F76D695475559D837783CF683879BE548C4F555408 -76D28C8996026CB36DB88D6B89109E648D3A563F9ED175D55F8872E0606854FC -4EA86A2A886160528F7054C470D886799E3F6D2A5B8F5F187EA255894FAF7334 -543C539A5019540E547C4E4E5FFD745A58F6846B80E1877472D07CCA6E560000 -BB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7C437C447C457C467C477C487C497C4A7C4B7C4C7C4E7C4F7C507C517C527C53 -7C547C557C567C577C587C597C5A7C5B7C5C7C5D7C5E7C5F7C607C617C627C63 -7C647C657C667C677C687C697C6A7C6B7C6C7C6D7C6E7C6F7C707C717C727C75 -7C767C777C787C797C7A7C7E7C7F7C807C817C827C837C847C857C867C870000 -7C887C8A7C8B7C8C7C8D7C8E7C8F7C907C937C947C967C997C9A7C9B7CA07CA1 -7CA37CA67CA77CA87CA97CAB7CAC7CAD7CAF7CB07CB47CB57CB67CB77CB87CBA -7CBB5F27864E552C62A44E926CAA623782B154D7534E733E6ED1753B52125316 -8BDD69D05F8A60006DEE574F6B2273AF68538FD87F13636260A3552475EA8C62 -71156DA35BA65E7B8352614C9EC478FA87577C27768751F060F6714C66435E4C -604D8C0E707063258F895FBD606286D456DE6BC160946167534960E066668D3F -79FD4F1A70E96C478BB38BF27ED88364660F5A5A9B426D516DF78C416D3B4F19 -706B83B7621660D1970D8D27797851FB573E57FA673A75787A3D79EF7B950000 -BC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7CBF7CC07CC27CC37CC47CC67CC97CCB7CCE7CCF7CD07CD17CD27CD37CD47CD8 -7CDA7CDB7CDD7CDE7CE17CE27CE37CE47CE57CE67CE77CE97CEA7CEB7CEC7CED -7CEE7CF07CF17CF27CF37CF47CF57CF67CF77CF97CFA7CFC7CFD7CFE7CFF7D00 -7D017D027D037D047D057D067D077D087D097D0B7D0C7D0D7D0E7D0F7D100000 -7D117D127D137D147D157D167D177D187D197D1A7D1B7D1C7D1D7D1E7D1F7D21 -7D237D247D257D267D287D297D2A7D2C7D2D7D2E7D307D317D327D337D347D35 -7D36808C99658FF96FC08BA59E2159EC7EE97F095409678168D88F917C4D96C6 -53CA602575BE6C7253735AC97EA7632451E0810A5DF184DF628051805B634F0E -796D524260B86D4E5BC45BC28BA18BB065E25FCC964559937EE77EAA560967B7 -59394F735BB652A0835A988A8D3E753294BE50477A3C4EF767B69A7E5AC16B7C -76D1575A5C167B3A95F4714E517C80A9827059787F04832768C067EC78B17877 -62E363617B804FED526A51CF835069DB92748DF58D3189C1952E7BAD4EF60000 -BD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7D377D387D397D3A7D3B7D3C7D3D7D3E7D3F7D407D417D427D437D447D457D46 -7D477D487D497D4A7D4B7D4C7D4D7D4E7D4F7D507D517D527D537D547D557D56 -7D577D587D597D5A7D5B7D5C7D5D7D5E7D5F7D607D617D627D637D647D657D66 -7D677D687D697D6A7D6B7D6C7D6D7D6F7D707D717D727D737D747D757D760000 -7D787D797D7A7D7B7D7C7D7D7D7E7D7F7D807D817D827D837D847D857D867D87 -7D887D897D8A7D8B7D8C7D8D7D8E7D8F7D907D917D927D937D947D957D967D97 -7D98506582305251996F6E106E856DA75EFA50F559DC5C066D466C5F7586848B -686859568BB253209171964D854969127901712680F64EA490CA6D479A845A07 -56BC640594F077EB4FA5811A72E189D2997A7F347EDE527F655991758F7F8F83 -53EB7A9663ED63A5768679F888579636622A52AB8282685467706377776B7AED -6D017ED389E359D0621285C982A5754C501F4ECB75A58BEB5C4A5DFE7B4B65A4 -91D14ECA6D25895F7D2795264EC58C288FDB9773664B79818FD170EC6D780000 -BE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7D997D9A7D9B7D9C7D9D7D9E7D9F7DA07DA17DA27DA37DA47DA57DA77DA87DA9 -7DAA7DAB7DAC7DAD7DAF7DB07DB17DB27DB37DB47DB57DB67DB77DB87DB97DBA -7DBB7DBC7DBD7DBE7DBF7DC07DC17DC27DC37DC47DC57DC67DC77DC87DC97DCA -7DCB7DCC7DCD7DCE7DCF7DD07DD17DD27DD37DD47DD57DD67DD77DD87DD90000 -7DDA7DDB7DDC7DDD7DDE7DDF7DE07DE17DE27DE37DE47DE57DE67DE77DE87DE9 -7DEA7DEB7DEC7DED7DEE7DEF7DF07DF17DF27DF37DF47DF57DF67DF77DF87DF9 -7DFA5C3D52B283465162830E775B66769CB84EAC60CA7CBE7CB37ECF4E958B66 -666F988897595883656C955C5F8475C997567ADF7ADE51C070AF7A9863EA7A76 -7EA0739697ED4E4570784E5D915253A9655165E781FC8205548E5C31759A97A0 -62D872D975BD5C459A7983CA5C40548077E94E3E6CAE805A62D2636E5DE85177 -8DDD8E1E952F4FF153E560E770AC526763509E435A1F5026773753777EE26485 -652B628963985014723589C951B38BC07EDD574783CC94A7519B541B5CFB0000 -BF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7DFB7DFC7DFD7DFE7DFF7E007E017E027E037E047E057E067E077E087E097E0A -7E0B7E0C7E0D7E0E7E0F7E107E117E127E137E147E157E167E177E187E197E1A -7E1B7E1C7E1D7E1E7E1F7E207E217E227E237E247E257E267E277E287E297E2A -7E2B7E2C7E2D7E2E7E2F7E307E317E327E337E347E357E367E377E387E390000 -7E3A7E3C7E3D7E3E7E3F7E407E427E437E447E457E467E487E497E4A7E4B7E4C -7E4D7E4E7E4F7E507E517E527E537E547E557E567E577E587E597E5A7E5B7E5C -7E5D4FCA7AE36D5A90E19A8F55805496536154AF5F0063E9697751EF6168520A -582A52D8574E780D770B5EB761777CE0625B62974EA27095800362F770E49760 -577782DB67EF68F578D5989779D158F354B353EF6E34514B523B5BA28BFE80AF -554357A660735751542D7A7A60505B5463A762A053E362635BC767AF54ED7A9F -82E691775E9388E4593857AE630E8DE880EF57577B774FA95FEB5BBD6B3E5321 -7B5072C2684677FF773665F751B54E8F76D45CBF7AA58475594E9B4150800000 -C0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7E5E7E5F7E607E617E627E637E647E657E667E677E687E697E6A7E6B7E6C7E6D -7E6E7E6F7E707E717E727E737E747E757E767E777E787E797E7A7E7B7E7C7E7D -7E7E7E7F7E807E817E837E847E857E867E877E887E897E8A7E8B7E8C7E8D7E8E -7E8F7E907E917E927E937E947E957E967E977E987E997E9A7E9C7E9D7E9E0000 -7EAE7EB47EBB7EBC7ED67EE47EEC7EF97F0A7F107F1E7F377F397F3B7F3C7F3D -7F3E7F3F7F407F417F437F467F477F487F497F4A7F4B7F4C7F4D7F4E7F4F7F52 -7F53998861276E8357646606634656F062EC62695ED39614578362C955878721 -814A8FA3556683B167658D5684DD5A6A680F62E67BEE961151706F9C8C3063FD -89C861D27F0670C26EE57405699472FC5ECA90CE67176D6A635E52B372628001 -4F6C59E5916A70D96D9D52D24E5096F7956D857E78CA7D2F5121579264C2808B -7C7B6CEA68F1695E51B7539868A872819ECE7BF172F879BB6F137406674E91CC -9CA4793C83898354540F68174E3D538952B1783E5386522950884F8B4FD00000 -C1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7F567F597F5B7F5C7F5D7F5E7F607F637F647F657F667F677F6B7F6C7F6D7F6F -7F707F737F757F767F777F787F7A7F7B7F7C7F7D7F7F7F807F827F837F847F85 -7F867F877F887F897F8B7F8D7F8F7F907F917F927F937F957F967F977F987F99 -7F9B7F9C7FA07FA27FA37FA57FA67FA87FA97FAA7FAB7FAC7FAD7FAE7FB10000 -7FB37FB47FB57FB67FB77FBA7FBB7FBE7FC07FC27FC37FC47FC67FC77FC87FC9 -7FCB7FCD7FCF7FD07FD17FD27FD37FD67FD77FD97FDA7FDB7FDC7FDD7FDE7FE2 -7FE375E27ACB7C926CA596B6529B748354E94FE9805483B28FDE95705EC9601C -6D9F5E18655B813894FE604B70BC7EC37CAE51C968817CB1826F4E248F8691CF -667E4EAE8C0564A9804A50DA759771CE5BE58FBD6F664E86648295635ED66599 -521788C270C852A3730E7433679778F797164E3490BB9CDE6DCB51DB8D41541D -62CE73B283F196F69F8494C34F367F9A51CC707596755CAD988653E64EE46E9C -740969B4786B998F7559521876246D4167F3516D9F99804B54997B3C7ABF0000 -C2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7FE47FE77FE87FEA7FEB7FEC7FED7FEF7FF27FF47FF57FF67FF77FF87FF97FFA -7FFD7FFE7FFF8002800780088009800A800E800F80118013801A801B801D801E -801F802180238024802B802C802D802E802F8030803280348039803A803C803E -8040804180448045804780488049804E804F8050805180538055805680570000 -8059805B805C805D805E805F806080618062806380648065806680678068806B -806C806D806E806F807080728073807480758076807780788079807A807B807C -807D9686578462E29647697C5A0464027BD36F0F964B82A6536298855E907089 -63B35364864F9C819E93788C97328DEF8D429E7F6F5E79845F559646622E9A74 -541594DD4FA365C55C655C617F1586516C2F5F8B73876EE47EFF5CE6631B5B6A -6EE653754E7163A0756562A18F6E4F264ED16CA67EB68BBA841D87BA7F57903B -95237BA99AA188F8843D6D1B9A867EDC59889EBB739B780186829A6C9A82561B -541757CB4E709EA653568FC881097792999286EE6EE1851366FC61626F2B0000 -C3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -807E8081808280858088808A808D808E808F8090809180928094809580978099 -809E80A380A680A780A880AC80B080B380B580B680B880B980BB80C580C780C8 -80C980CA80CB80CF80D080D180D280D380D480D580D880DF80E080E280E380E6 -80EE80F580F780F980FB80FE80FF8100810181038104810581078108810B0000 -810C811581178119811B811C811D811F81208121812281238124812581268127 -81288129812A812B812D812E813081338134813581378139813A813B813C813D -813F8C298292832B76F26C135FD983BD732B8305951A6BDB77DB94C6536F8302 -51925E3D8C8C8D384E4873AB679A68859176970971646CA177095A9295416BCF -7F8E66275BD059B95A9A95E895F74EEC840C84996AAC76DF9530731B68A65B5F -772F919A97617CDC8FF78C1C5F257C7379D889C56CCC871C5BC65E4268C97720 -7EF55195514D52C95A297F05976282D763CF778485D079D26E3A5E9959998511 -706D6C1162BF76BF654F60AF95FD660E879F9E2394ED540D547D8C2C64780000 -C4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -81408141814281438144814581478149814D814E814F8152815681578158815B -815C815D815E815F816181628163816481668168816A816B816C816F81728173 -81758176817781788181818381848185818681878189818B818C818D818E8190 -8192819381948195819681978199819A819E819F81A081A181A281A481A50000 -81A781A981AB81AC81AD81AE81AF81B081B181B281B481B581B681B781B881B9 -81BC81BD81BE81BF81C481C581C781C881C981CB81CD81CE81CF81D081D181D2 -81D3647986116A21819C78E864699B5462B9672B83AB58A89ED86CAB6F205BDE -964C8C0B725F67D062C772614EA959C66BCD589366AE5E5552DF6155672876EE -776672677A4662FF54EA545094A090A35A1C7EB36C164E435976801059485357 -753796BE56CA63208111607C95F96DD65462998151855AE980FD59AE9713502A -6CE55C3C62DF4F60533F817B90066EBA852B62C85E7478BE64B5637B5FF55A18 -917F9E1F5C3F634F80425B7D556E954A954D6D8560A867E072DE51DD5B810000 -C5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -81D481D581D681D781D881D981DA81DB81DC81DD81DE81DF81E081E181E281E4 -81E581E681E881E981EB81EE81EF81F081F181F281F581F681F781F881F981FA -81FD81FF8203820782088209820A820B820E820F821182138215821682178218 -8219821A821D822082248225822682278229822E8232823A823C823D823F0000 -8240824182428243824582468248824A824C824D824E82508251825282538254 -8255825682578259825B825C825D825E82608261826282638264826582668267 -826962E76CDE725B626D94AE7EBD81136D53519C5F04597452AA601259736696 -8650759F632A61E67CEF8BFA54E66B279E256BB485D5545550766CA4556A8DB4 -722C5E156015743662CD6392724C5F986E436D3E65006F5876D878D076FC7554 -522453DB4E535E9E65C1802A80D6629B5486522870AE888D8DD16CE1547880DA -57F988F48D54966A914D4F696C9B55B776C6783062A870F96F8E5F6D84EC68DA -787C7BF781A8670B9E4F636778B0576F78129739627962AB528874356BD70000 -C6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -826A826B826C826D82718275827682778278827B827C82808281828382858286 -82878289828C82908293829482958296829A829B829E82A082A282A382A782B2 -82B582B682BA82BB82BC82BF82C082C282C382C582C682C982D082D682D982DA -82DD82E282E782E882E982EA82EC82ED82EE82F082F282F382F582F682F80000 -82FA82FC82FD82FE82FF8300830A830B830D831083128313831683188319831D -831E831F83208321832283238324832583268329832A832E833083328337833B -833D5564813E75B276AE533975DE50FB5C418B6C7BC7504F72479A9798D86F02 -74E27968648777A562FC98918D2B54C180584E52576A82F9840D5E7351ED74F6 -8BC45C4F57616CFC98875A4678349B448FEB7C955256625194FA4EC683868461 -83E984B257D467345703666E6D668C3166DD7011671F6B3A6816621A59BB4E03 -51C46F0667D26C8F517668CB59476B6775665D0E81109F5065D7794879419A91 -8D775C824E5E4F01542F5951780C56686C148FC45F036C7D6CE38BAB63900000 -C7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -833E833F83418342834483458348834A834B834C834D834E8353835583568357 -83588359835D836283708371837283738374837583768379837A837E837F8380 -838183828383838483878388838A838B838C838D838F83908391839483958396 -83978399839A839D839F83A183A283A383A483A583A683A783AC83AD83AE0000 -83AF83B583BB83BE83BF83C283C383C483C683C883C983CB83CD83CE83D083D1 -83D283D383D583D783D983DA83DB83DE83E283E383E483E683E783E883EB83EC -83ED60706D3D72756266948E94C553438FC17B7E4EDF8C264E7E9ED494B194B3 -524D6F5C90636D458C3458115D4C6B206B4967AA545B81547F8C589985375F3A -62A26A47953965726084686577A74E544FA85DE7979864AC7FD85CED4FCF7A8D -520783044E14602F7A8394A64FB54EB279E6743452E482B964D279BD5BDD6C81 -97528F7B6C22503E537F6E0564CE66746C3060C598778BF75E86743C7A7779CB -4E1890B174036C4256DA914B6CC58D8B533A86C666F28EAF5C489A716E200000 -C8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -83EE83EF83F383F483F583F683F783FA83FB83FC83FE83FF8400840284058407 -84088409840A84108412841384148415841684178419841A841B841E841F8420 -8421842284238429842A842B842C842D842E842F843084328433843484358436 -84378439843A843B843E843F8440844184428443844484458447844884490000 -844A844B844C844D844E844F8450845284538454845584568458845D845E845F -8460846284648465846684678468846A846E846F84708472847484778479847B -847C53D65A369F8B8DA353BB570898A76743919B6CC9516875CA62F372AC5238 -529D7F3A7094763853749E4A69B7786E96C088D97FA4713671C3518967D374E4 -58E4651856B78BA9997662707ED560F970ED58EC4EC14EBA5FCD97E74EFB8BA4 -5203598A7EAB62544ECD65E5620E833884C98363878D71946EB65BB97ED25197 -63C967D480898339881551125B7A59828FB14E736C5D516589258F6F962E854A -745E951095F06DA682E55F3164926D128428816E9CC3585E8D5B4E0953C10000 -C9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -847D847E847F848084818483848484858486848A848D848F8490849184928493 -8494849584968498849A849B849D849E849F84A084A284A384A484A584A684A7 -84A884A984AA84AB84AC84AD84AE84B084B184B384B584B684B784BB84BC84BE -84C084C284C384C584C684C784C884CB84CC84CE84CF84D284D484D584D70000 -84D884D984DA84DB84DC84DE84E184E284E484E784E884E984EA84EB84ED84EE -84EF84F184F284F384F484F584F684F784F884F984FA84FB84FD84FE85008501 -85024F1E6563685155D34E2764149A9A626B5AC2745F82726DA968EE50E7838E -7802674052396C997EB150BB5565715E7B5B665273CA82EB67495C715220717D -886B95EA965564C58D6181B355846C5562477F2E58924F2455468D4F664C4E0A -5C1A88F368A2634E7A0D70E7828D52FA97F65C1154E890B57ECD59628D4A86C7 -820C820D8D6664445C0461516D89793E8BBE78377533547B4F388EAB6DF15A20 -7EC5795E6C885BA15A76751A80BE614E6E1758F0751F7525727253477EF30000 -CA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8503850485058506850785088509850A850B850D850E850F8510851285148515 -851685188519851B851C851D851E852085228523852485258526852785288529 -852A852D852E852F8530853185328533853485358536853E853F854085418542 -8544854585468547854B854C854D854E854F8550855185528553855485550000 -85578558855A855B855C855D855F85608561856285638565856685678569856A -856B856C856D856E856F8570857185738575857685778578857C857D857F8580 -8581770176DB526980DC57235E08593172EE65BD6E7F8BD75C388671534177F3 -62FE65F64EC098DF86805B9E8BC653F277E24F7F5C4E9A7659CB5F0F793A58EB -4E1667FF4E8B62ED8A93901D52BF662F55DC566C90024ED54F8D91CA99706C0F -5E0260435BA489C68BD56536624B99965B885BFF6388552E53D77626517D852C -67A268B36B8A62928F9353D482126DD1758F4E668D4E5B70719F85AF669166D9 -7F7287009ECD9F205C5E672F8FF06811675F620D7AD658855EB665706F310000 -CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -85828583858685888589858A858B858C858D858E859085918592859385948595 -8596859785988599859A859D859E859F85A085A185A285A385A585A685A785A9 -85AB85AC85AD85B185B285B385B485B585B685B885BA85BB85BC85BD85BE85BF -85C085C285C385C485C585C685C785C885CA85CB85CC85CD85CE85D185D20000 -85D485D685D785D885D985DA85DB85DD85DE85DF85E085E185E285E385E585E6 -85E785E885EA85EB85EC85ED85EE85EF85F085F185F285F385F485F585F685F7 -85F860555237800D6454887075295E05681362F4971C53CC723D8C016C347761 -7A0E542E77AC987A821C8BF47855671470C165AF64955636601D79C153F84E1D -6B7B80865BFA55E356DB4F3A4F3C99725DF3677E80386002988290015B8B8BBC -8BF5641C825864DE55FD82CF91654FD77D20901F7C9F50F358516EAF5BBF8BC9 -80839178849C7B97867D968B968F7EE59AD3788E5C817A57904296A7795F5B59 -635F7B0B84D168AD55067F2974107D2295016240584C4ED65B83597958540000 -CC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -85F985FA85FC85FD85FE860086018602860386048606860786088609860A860B -860C860D860E860F86108612861386148615861786188619861A861B861C861D -861E861F86208621862286238624862586268628862A862B862C862D862E862F -863086318632863386348635863686378639863A863B863D863E863F86400000 -864186428643864486458646864786488649864A864B864C8652865386558656 -865786588659865B865C865D865F866086618663866486658666866786688669 -866A736D631E8E4B8E0F80CE82D462AC53F06CF0915E592A60016C70574D644A -8D2A762B6EE9575B6A8075F06F6D8C2D8C0857666BEF889278B363A253F970AD -6C645858642A580268E0819B55107CD650188EBA6DCC8D9F70EB638F6D9B6ED4 -7EE68404684390036DD896768BA85957727985E4817E75BC8A8A68AF52548E22 -951163D098988E44557C4F5366FF568F60D56D9552435C4959296DFB586B7530 -751C606C82148146631167618FE2773A8DF38D3494C15E165385542C70C30000 -CD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -866D866F86708672867386748675867686778678868386848685868686878688 -8689868E868F86908691869286948696869786988699869A869B869E869F86A0 -86A186A286A586A686AB86AD86AE86B286B386B786B886B986BB86BC86BD86BE -86BF86C186C286C386C586C886CC86CD86D286D386D586D686D786DA86DC0000 -86DD86E086E186E286E386E586E686E786E886EA86EB86EC86EF86F586F686F7 -86FA86FB86FC86FD86FF8701870487058706870B870C870E870F871087118714 -87166C405EF7505C4EAD5EAD633A8247901A6850916E77B3540C94DC5F647AE5 -687663457B527EDF75DB507762955934900F51F879C37A8156FE5F9290146D82 -5C60571F541051546E4D56E263A89893817F8715892A9000541E5C6F81C062D6 -625881319E3596409A6E9A7C692D59A562D3553E631654C786D96D3C5A0374E6 -889C6B6A59168C4C5F2F6E7E73A9987D4E3870F75B8C7897633D665A769660CB -5B9B5A494E0781556C6A738B4EA167897F515F8065FA671B5FD859845A010000 -CE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8719871B871D871F87208724872687278728872A872B872C872D872F87308732 -87338735873687388739873A873C873D8740874187428743874487458746874A -874B874D874F8750875187528754875587568758875A875B875C875D875E875F -876187628766876787688769876A876B876C876D876F87718772877387750000 -877787788779877A877F878087818784878687878789878A878C878E878F8790 -8791879287948795879687988799879A879B879C879D879E87A087A187A287A3 -87A45DCD5FAE537197E68FDD684556F4552F60DF4E3A6F4D7EF482C7840E59D4 -4F1F4F2A5C3E7EAC672A851A5473754F80C355829B4F4F4D6E2D8C135C096170 -536B761F6E29868A658795FB7EB9543B7A337D0A95EE55E17FC174EE631D8717 -6DA17A9D621165A1536763E16C835DEB545C94A84E4C6C618BEC5C4B65E0829C -68A7543E54346BCB6B664E9463425348821E4F0D4FAE575E620A96FE66647269 -52FF52A1609F8BEF661471996790897F785277FD6670563B54389521727A0000 -CF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -87A587A687A787A987AA87AE87B087B187B287B487B687B787B887B987BB87BC -87BE87BF87C187C287C387C487C587C787C887C987CC87CD87CE87CF87D087D4 -87D587D687D787D887D987DA87DC87DD87DE87DF87E187E287E387E487E687E7 -87E887E987EB87EC87ED87EF87F087F187F287F387F487F587F687F787F80000 -87FA87FB87FC87FD87FF880088018802880488058806880788088809880B880C -880D880E880F8810881188128814881788188819881A881C881D881E881F8820 -88237A00606F5E0C6089819D591560DC718470EF6EAA6C5072806A8488AD5E2D -4E605AB3559C94E36D177CFB9699620F7EC6778E867E5323971E8F9666875CE1 -4FA072ED4E0B53A6590F54136380952851484ED99C9C7EA454B88D2488548237 -95F26D8E5F265ACC663E966973B0732E53BF817A99857FA15BAA967796507EBF -76F853A2957699997BB189446E584E617FD479658BE660F354CD4EAB98795DF7 -6A6150CF54118C618427785D9704524A54EE56A395006D885BB56DC666530000 -D0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -882488258826882788288829882A882B882C882D882E882F8830883188338834 -8835883688378838883A883B883D883E883F8841884288438846884788488849 -884A884B884E884F8850885188528853885588568858885A885B885C885D885E -885F886088668867886A886D886F8871887388748875887688788879887A0000 -887B887C88808883888688878889888A888C888E888F88908891889388948895 -889788988899889A889B889D889E889F88A088A188A388A588A688A788A888A9 -88AA5C0F5B5D6821809655787B11654869544E9B6B47874E978B534F631F643A -90AA659C80C18C10519968B0537887F961C86CC46CFB8C225C5185AA82AF950C -6B238F9B65B05FFB5FC34FE18845661F8165732960FA51745211578B5F6290A2 -884C91925E78674F602759D3514451F680F853086C7996C4718A4F114FEE7F9E -673D55C5950879C088967EE3589F620C9700865A5618987B5F908BB884C49157 -53D965ED5E8F755C60647D6E5A7F7EEA7EED8F6955A75BA360AC65CB73840000 -D1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -88AC88AE88AF88B088B288B388B488B588B688B888B988BA88BB88BD88BE88BF -88C088C388C488C788C888CA88CB88CC88CD88CF88D088D188D388D688D788DA -88DB88DC88DD88DE88E088E188E688E788E988EA88EB88EC88ED88EE88EF88F2 -88F588F688F788FA88FB88FD88FF890089018903890489058906890789080000 -8909890B890C890D890E890F891189148915891689178918891C891D891E891F -89208922892389248926892789288929892C892D892E892F8931893289338935 -89379009766377297EDA9774859B5B667A7496EA884052CB718F5FAA65EC8BE2 -5BFB9A6F5DE16B896C5B8BAD8BAF900A8FC5538B62BC9E269E2D54404E2B82BD -7259869C5D1688596DAF96C554D14E9A8BB6710954BD960970DF6DF976D04E25 -781487125CA95EF68A00989C960E708E6CBF594463A9773C884D6F1482735830 -71D5538C781A96C155015F6671305BB48C1A9A8C6B83592E9E2F79E76768626C -4F6F75A17F8A6D0B96336C274EF075D2517B68376F3E90808170599674760000 -D2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -89388939893A893B893C893D893E893F89408942894389458946894789488949 -894A894B894C894D894E894F8950895189528953895489558956895789588959 -895A895B895C895D896089618962896389648965896789688969896A896B896C -896D896E896F8970897189728973897489758976897789788979897A897C0000 -897D897E8980898289848985898789888989898A898B898C898D898E898F8990 -899189928993899489958996899789988999899A899B899C899D899E899F89A0 -89A164475C2790657A918C2359DA54AC8200836F898180006930564E80367237 -91CE51B64E5F987563964E1A53F666F3814B591C6DB24E0058F9533B63D694F1 -4F9D4F0A886398905937905779FB4EEA80F075916C825B9C59E85F5D69058681 -501A5DF24E5977E34EE5827A6291661390915C794EBF5F7981C69038808475AB -4EA688D4610F6BC55FC64E4976CA6EA28BE38BAE8C0A8BD15F027FFC7FCC7ECE -8335836B56E06BB797F3963459FB541F94F66DEB5BC5996E5C395F1596900000 -D3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -89A289A389A489A589A689A789A889A989AA89AB89AC89AD89AE89AF89B089B1 -89B289B389B489B589B689B789B889B989BA89BB89BC89BD89BE89BF89C089C3 -89CD89D389D489D589D789D889D989DB89DD89DF89E089E189E289E489E789E8 -89E989EA89EC89ED89EE89F089F189F289F489F589F689F789F889F989FA0000 -89FB89FC89FD89FE89FF8A018A028A038A048A058A068A088A098A0A8A0B8A0C -8A0D8A0E8A0F8A108A118A128A138A148A158A168A178A188A198A1A8A1B8A1C -8A1D537082F16A315A749E705E947F2883B984248425836787478FCE8D6276C8 -5F719896786C662054DF62E54F6381C375C85EB896CD8E0A86F9548F6CF36D8C -6C38607F52C775285E7D4F1860A05FE75C24753190AE94C072B96CB96E389149 -670953CB53F34F5191C98BF153C85E7C8FC26DE44E8E76C26986865E611A8206 -4F594FDE903E9C7C61096E1D6E1496854E885A3196E84E0E5C7F79B95B878BED -7FBD738957DF828B90C15401904755BB5CEA5FA161086B3272F180B28A890000 -D4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8A1E8A1F8A208A218A228A238A248A258A268A278A288A298A2A8A2B8A2C8A2D -8A2E8A2F8A308A318A328A338A348A358A368A378A388A398A3A8A3B8A3C8A3D -8A3F8A408A418A428A438A448A458A468A478A498A4A8A4B8A4C8A4D8A4E8A4F -8A508A518A528A538A548A558A568A578A588A598A5A8A5B8A5C8A5D8A5E0000 -8A5F8A608A618A628A638A648A658A668A678A688A698A6A8A6B8A6C8A6D8A6E -8A6F8A708A718A728A738A748A758A768A778A788A7A8A7B8A7C8A7D8A7E8A7F -8A806D745BD388D598848C6B9A6D9E336E0A51A4514357A38881539F63F48F95 -56ED54585706733F6E907F188FDC82D1613F6028966266F07EA68D8A8DC394A5 -5CB37CA4670860A6960580184E9190E75300966851418FD08574915D665597F5 -5B55531D78386742683D54C9707E5BB08F7D518D572854B1651266828D5E8D43 -810F846C906D7CDF51FF85FB67A365E96FA186A48E81566A90207682707671E5 -8D2362E952196CFD8D3C600E589E618E66FE8D60624E55B36E23672D8F670000 -D5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8A818A828A838A848A858A868A878A888A8B8A8C8A8D8A8E8A8F8A908A918A92 -8A948A958A968A978A988A998A9A8A9B8A9C8A9D8A9E8A9F8AA08AA18AA28AA3 -8AA48AA58AA68AA78AA88AA98AAA8AAB8AAC8AAD8AAE8AAF8AB08AB18AB28AB3 -8AB48AB58AB68AB78AB88AB98ABA8ABB8ABC8ABD8ABE8ABF8AC08AC18AC20000 -8AC38AC48AC58AC68AC78AC88AC98ACA8ACB8ACC8ACD8ACE8ACF8AD08AD18AD2 -8AD38AD48AD58AD68AD78AD88AD98ADA8ADB8ADC8ADD8ADE8ADF8AE08AE18AE2 -8AE394E195F87728680569A8548B4E4D70B88BC86458658B5B857A84503A5BE8 -77BB6BE18A797C986CBE76CF65A98F975D2D5C5586386808536062187AD96E5B -7EFD6A1F7AE05F706F335F20638C6DA867564E085E108D264ED780C07634969C -62DB662D627E6CBC8D7571677F695146808753EC906E629854F286F08F998005 -951785178FD96D5973CD659F771F7504782781FB8D1E94884FA6679575B98BCA -9707632F9547963584B8632377415F8172F04E896014657462EF6B63653F0000 -D6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8AE48AE58AE68AE78AE88AE98AEA8AEB8AEC8AED8AEE8AEF8AF08AF18AF28AF3 -8AF48AF58AF68AF78AF88AF98AFA8AFB8AFC8AFD8AFE8AFF8B008B018B028B03 -8B048B058B068B088B098B0A8B0B8B0C8B0D8B0E8B0F8B108B118B128B138B14 -8B158B168B178B188B198B1A8B1B8B1C8B1D8B1E8B1F8B208B218B228B230000 -8B248B258B278B288B298B2A8B2B8B2C8B2D8B2E8B2F8B308B318B328B338B34 -8B358B368B378B388B398B3A8B3B8B3C8B3D8B3E8B3F8B408B418B428B438B44 -8B455E2775C790D18BC1829D679D652F5431871877E580A281026C414E4B7EC7 -804C76F4690D6B966267503C4F84574063076B628DBE53EA65E87EB85FD7631A -63B781F381F47F6E5E1C5CD95236667A79E97A1A8D28709975D46EDE6CBB7A92 -4E2D76C55FE0949F88777EC879CD80BF91CD4EF24F17821F54685DDE6D328BCC -7CA58F7480985E1A549276B15B99663C9AA473E0682A86DB6731732A8BF88BDB -90107AF970DB716E62C477A956314E3B845767F152A986C08D2E94F87B510000 -D7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B468B478B488B498B4A8B4B8B4C8B4D8B4E8B4F8B508B518B528B538B548B55 -8B568B578B588B598B5A8B5B8B5C8B5D8B5E8B5F8B608B618B628B638B648B65 -8B678B688B698B6A8B6B8B6D8B6E8B6F8B708B718B728B738B748B758B768B77 -8B788B798B7A8B7B8B7C8B7D8B7E8B7F8B808B818B828B838B848B858B860000 -8B878B888B898B8A8B8B8B8C8B8D8B8E8B8F8B908B918B928B938B948B958B96 -8B978B988B998B9A8B9B8B9C8B9D8B9E8B9F8BAC8BB18BBB8BC78BD08BEA8C09 -8C1E4F4F6CE8795D9A7B6293722A62FD4E1378168F6C64B08D5A7BC668695E84 -88C55986649E58EE72B6690E95258FFD8D5857607F008C0651C6634962D95353 -684C74228301914C55447740707C6D4A517954A88D4459FF6ECB6DC45B5C7D2B -4ED47C7D6ED35B5081EA6E0D5B579B0368D58E2A5B977EFC603B7EB590B98D70 -594F63CD79DF8DB3535265CF79568BC5963B7EC494BB7E825634918967007F6A -5C0A907566285DE64F5067DE505A4F5C57505EA7000000000000000000000000 -D8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8C388C398C3A8C3B8C3C8C3D8C3E8C3F8C408C428C438C448C458C488C4A8C4B -8C4D8C4E8C4F8C508C518C528C538C548C568C578C588C598C5B8C5C8C5D8C5E -8C5F8C608C638C648C658C668C678C688C698C6C8C6D8C6E8C6F8C708C718C72 -8C748C758C768C778C7B8C7C8C7D8C7E8C7F8C808C818C838C848C868C870000 -8C888C8B8C8D8C8E8C8F8C908C918C928C938C958C968C978C998C9A8C9B8C9C -8C9D8C9E8C9F8CA08CA18CA28CA38CA48CA58CA68CA78CA88CA98CAA8CAB8CAC -8CAD4E8D4E0C51404E105EFF53454E154E984E1E9B325B6C56694E2879BA4E3F -53154E47592D723B536E6C1056DF80E499976BD3777E9F174E364E9F9F104E5C -4E694E9382885B5B556C560F4EC4538D539D53A353A553AE97658D5D531A53F5 -5326532E533E8D5C5366536352025208520E522D5233523F5240524C525E5261 -525C84AF527D528252815290529351827F544EBB4EC34EC94EC24EE84EE14EEB -4EDE4F1B4EF34F224F644EF54F254F274F094F2B4F5E4F6765384F5A4F5D0000 -D9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8CAE8CAF8CB08CB18CB28CB38CB48CB58CB68CB78CB88CB98CBA8CBB8CBC8CBD -8CBE8CBF8CC08CC18CC28CC38CC48CC58CC68CC78CC88CC98CCA8CCB8CCC8CCD -8CCE8CCF8CD08CD18CD28CD38CD48CD58CD68CD78CD88CD98CDA8CDB8CDC8CDD -8CDE8CDF8CE08CE18CE28CE38CE48CE58CE68CE78CE88CE98CEA8CEB8CEC0000 -8CED8CEE8CEF8CF08CF18CF28CF38CF48CF58CF68CF78CF88CF98CFA8CFB8CFC -8CFD8CFE8CFF8D008D018D028D038D048D058D068D078D088D098D0A8D0B8D0C -8D0D4F5F4F574F324F3D4F764F744F914F894F834F8F4F7E4F7B4FAA4F7C4FAC -4F944FE64FE84FEA4FC54FDA4FE34FDC4FD14FDF4FF85029504C4FF3502C500F -502E502D4FFE501C500C50255028507E504350555048504E506C507B50A550A7 -50A950BA50D6510650ED50EC50E650EE5107510B4EDD6C3D4F584F654FCE9FA0 -6C467C74516E5DFD9EC999985181591452F9530D8A07531051EB591951554EA0 -51564EB3886E88A44EB5811488D279805B3488037FB851AB51B151BD51BC0000 -DA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8D0E8D0F8D108D118D128D138D148D158D168D178D188D198D1A8D1B8D1C8D20 -8D518D528D578D5F8D658D688D698D6A8D6C8D6E8D6F8D718D728D788D798D7A -8D7B8D7C8D7D8D7E8D7F8D808D828D838D868D878D888D898D8C8D8D8D8E8D8F -8D908D928D938D958D968D978D988D998D9A8D9B8D9C8D9D8D9E8DA08DA10000 -8DA28DA48DA58DA68DA78DA88DA98DAA8DAB8DAC8DAD8DAE8DAF8DB08DB28DB6 -8DB78DB98DBB8DBD8DC08DC18DC28DC58DC78DC88DC98DCA8DCD8DD08DD28DD3 -8DD451C7519651A251A58BA08BA68BA78BAA8BB48BB58BB78BC28BC38BCB8BCF -8BCE8BD28BD38BD48BD68BD88BD98BDC8BDF8BE08BE48BE88BE98BEE8BF08BF3 -8BF68BF98BFC8BFF8C008C028C048C078C0C8C0F8C118C128C148C158C168C19 -8C1B8C188C1D8C1F8C208C218C258C278C2A8C2B8C2E8C2F8C328C338C358C36 -5369537A961D962296219631962A963D963C964296499654965F9667966C9672 -96749688968D969796B09097909B909D909990AC90A190B490B390B690BA0000 -DB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8DD58DD88DD98DDC8DE08DE18DE28DE58DE68DE78DE98DED8DEE8DF08DF18DF2 -8DF48DF68DFC8DFE8DFF8E008E018E028E038E048E068E078E088E0B8E0D8E0E -8E108E118E128E138E158E168E178E188E198E1A8E1B8E1C8E208E218E248E25 -8E268E278E288E2B8E2D8E308E328E338E348E368E378E388E3B8E3C8E3E0000 -8E3F8E438E458E468E4C8E4D8E4E8E4F8E508E538E548E558E568E578E588E5A -8E5B8E5C8E5D8E5E8E5F8E608E618E628E638E648E658E678E688E6A8E6B8E6E -8E7190B890B090CF90C590BE90D090C490C790D390E690E290DC90D790DB90EB -90EF90FE91049122911E91239131912F913991439146520D594252A252AC52AD -52BE54FF52D052D652F053DF71EE77CD5EF451F551FC9B2F53B65F01755A5DEF -574C57A957A1587E58BC58C558D15729572C572A57335739572E572F575C573B -574257695785576B5786577C577B5768576D5776577357AD57A4578C57B257CF -57A757B4579357A057D557D857DA57D957D257B857F457EF57F857E457DD0000 -DC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E738E758E778E788E798E7A8E7B8E7D8E7E8E808E828E838E848E868E888E89 -8E8A8E8B8E8C8E8D8E8E8E918E928E938E958E968E978E988E998E9A8E9B8E9D -8E9F8EA08EA18EA28EA38EA48EA58EA68EA78EA88EA98EAA8EAD8EAE8EB08EB1 -8EB38EB48EB58EB68EB78EB88EB98EBB8EBC8EBD8EBE8EBF8EC08EC18EC20000 -8EC38EC48EC58EC68EC78EC88EC98ECA8ECB8ECC8ECD8ECF8ED08ED18ED28ED3 -8ED48ED58ED68ED78ED88ED98EDA8EDB8EDC8EDD8EDE8EDF8EE08EE18EE28EE3 -8EE4580B580D57FD57ED5800581E5819584458205865586C58815889589A5880 -99A89F1961FF8279827D827F828F828A82A88284828E82918297829982AB82B8 -82BE82B082C882CA82E3829882B782AE82CB82CC82C182A982B482A182AA829F -82C482CE82A482E1830982F782E4830F830782DC82F482D282D8830C82FB82D3 -8311831A83068314831582E082D5831C8351835B835C83088392833C83348331 -839B835E832F834F83478343835F834083178360832D833A8333836683650000 -DD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8EE58EE68EE78EE88EE98EEA8EEB8EEC8EED8EEE8EEF8EF08EF18EF28EF38EF4 -8EF58EF68EF78EF88EF98EFA8EFB8EFC8EFD8EFE8EFF8F008F018F028F038F04 -8F058F068F078F088F098F0A8F0B8F0C8F0D8F0E8F0F8F108F118F128F138F14 -8F158F168F178F188F198F1A8F1B8F1C8F1D8F1E8F1F8F208F218F228F230000 -8F248F258F268F278F288F298F2A8F2B8F2C8F2D8F2E8F2F8F308F318F328F33 -8F348F358F368F378F388F398F3A8F3B8F3C8F3D8F3E8F3F8F408F418F428F43 -8F448368831B8369836C836A836D836E83B0837883B383B483A083AA8393839C -8385837C83B683A9837D83B8837B8398839E83A883BA83BC83C1840183E583D8 -58078418840B83DD83FD83D6841C84388411840683D483DF840F840383F883F9 -83EA83C583C0842683F083E1845C8451845A8459847384878488847A84898478 -843C844684698476848C848E8431846D84C184CD84D084E684BD84D384CA84BF -84BA84E084A184B984B4849784E584E3850C750D853884F08539851F853A0000 -DE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8F458F468F478F488F498F4A8F4B8F4C8F4D8F4E8F4F8F508F518F528F538F54 -8F558F568F578F588F598F5A8F5B8F5C8F5D8F5E8F5F8F608F618F628F638F64 -8F658F6A8F808F8C8F928F9D8FA08FA18FA28FA48FA58FA68FA78FAA8FAC8FAD -8FAE8FAF8FB28FB38FB48FB58FB78FB88FBA8FBB8FBC8FBF8FC08FC38FC60000 -8FC98FCA8FCB8FCC8FCD8FCF8FD28FD68FD78FDA8FE08FE18FE38FE78FEC8FEF -8FF18FF28FF48FF58FF68FFA8FFB8FFC8FFE8FFF90079008900C900E90139015 -90188556853B84FF84FC8559854885688564855E857A77A285438572857B85A4 -85A88587858F857985AE859C858585B985B785B085D385C185DC85FF86278605 -86298616863C5EFE5F08593C594180375955595A5958530F5C225C255C2C5C34 -624C626A629F62BB62CA62DA62D762EE632262F66339634B634363AD63F66371 -637A638E63B4636D63AC638A636963AE63BC63F263F863E063FF63C463DE63CE -645263C663BE64456441640B641B6420640C64266421645E6484646D64960000 -DF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9019901C902390249025902790289029902A902B902C90309031903290339034 -90379039903A903D903F904090439045904690489049904A904B904C904E9054 -905590569059905A905C905D905E905F906090619064906690679069906A906B -906C906F90709071907290739076907790789079907A907B907C907E90810000 -90849085908690879089908A908C908D908E908F90909092909490969098909A -909C909E909F90A090A490A590A790A890A990AB90AD90B290B790BC90BD90BF -90C0647A64B764B8649964BA64C064D064D764E464E265096525652E5F0B5FD2 -75195F11535F53F153FD53E953E853FB541254165406544B5452545354545456 -54435421545754595423543254825494547754715464549A549B548454765466 -549D54D054AD54C254B454D254A754A654D354D4547254A354D554BB54BF54CC -54D954DA54DC54A954AA54A454DD54CF54DE551B54E7552054FD551454F35522 -5523550F55115527552A5567558F55B55549556D55415555553F5550553C0000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -90C290C390C690C890C990CB90CC90CD90D290D490D590D690D890D990DA90DE -90DF90E090E390E490E590E990EA90EC90EE90F090F190F290F390F590F690F7 -90F990FA90FB90FC90FF91009101910391059106910791089109910A910B910C -910D910E910F911091119112911391149115911691179118911A911B911C0000 -911D911F91209121912491259126912791289129912A912B912C912D912E9130 -9132913391349135913691379138913A913B913C913D913E913F914091419142 -91445537555655755576557755335530555C558B55D2558355B155B955885581 -559F557E55D65591557B55DF55BD55BE5594559955EA55F755C9561F55D155EB -55EC55D455E655DD55C455EF55E555F255F355CC55CD55E855F555E48F94561E -5608560C56015624562355FE56005627562D565856395657562C564D56625659 -565C564C5654568656645671566B567B567C5685569356AF56D456D756DD56E1 -56F556EB56F956FF5704570A5709571C5E0F5E195E145E115E315E3B5E3C0000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9145914791489151915391549155915691589159915B915C915F916091669167 -9168916B916D9173917A917B917C9180918191829183918491869188918A918E -918F9193919491959196919791989199919C919D919E919F91A091A191A491A5 -91A691A791A891A991AB91AC91B091B191B291B391B691B791B891B991BB0000 -91BC91BD91BE91BF91C091C191C291C391C491C591C691C891CB91D091D291D3 -91D491D591D691D791D891D991DA91DB91DD91DE91DF91E091E191E291E391E4 -91E55E375E445E545E5B5E5E5E615C8C5C7A5C8D5C905C965C885C985C995C91 -5C9A5C9C5CB55CA25CBD5CAC5CAB5CB15CA35CC15CB75CC45CD25CE45CCB5CE5 -5D025D035D275D265D2E5D245D1E5D065D1B5D585D3E5D345D3D5D6C5D5B5D6F -5D5D5D6B5D4B5D4A5D695D745D825D995D9D8C735DB75DC55F735F775F825F87 -5F895F8C5F955F995F9C5FA85FAD5FB55FBC88625F6172AD72B072B472B772B8 -72C372C172CE72CD72D272E872EF72E972F272F472F7730172F3730372FA0000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -91E691E791E891E991EA91EB91EC91ED91EE91EF91F091F191F291F391F491F5 -91F691F791F891F991FA91FB91FC91FD91FE91FF920092019202920392049205 -9206920792089209920A920B920C920D920E920F921092119212921392149215 -9216921792189219921A921B921C921D921E921F922092219222922392240000 -92259226922792289229922A922B922C922D922E922F92309231923292339234 -92359236923792389239923A923B923C923D923E923F92409241924292439244 -924572FB731773137321730A731E731D7315732273397325732C733873317350 -734D73577360736C736F737E821B592598E7592459029963996799689969996A -996B996C99749977997D998099849987998A998D999099919993999499955E80 -5E915E8B5E965EA55EA05EB95EB55EBE5EB38D535ED25ED15EDB5EE85EEA81BA -5FC45FC95FD65FCF60035FEE60045FE15FE45FFE600560065FEA5FED5FF86019 -60356026601B600F600D6029602B600A603F602160786079607B607A60420000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9246924792489249924A924B924C924D924E924F925092519252925392549255 -9256925792589259925A925B925C925D925E925F926092619262926392649265 -9266926792689269926A926B926C926D926E926F927092719272927392759276 -927792789279927A927B927C927D927E927F9280928192829283928492850000 -9286928792889289928A928B928C928D928F9290929192929293929492959296 -929792989299929A929B929C929D929E929F92A092A192A292A392A492A592A6 -92A7606A607D6096609A60AD609D60836092608C609B60EC60BB60B160DD60D8 -60C660DA60B4612061266115612360F46100610E612B614A617561AC619461A7 -61B761D461F55FDD96B395E995EB95F195F395F595F695FC95FE960396049606 -9608960A960B960C960D960F96129615961696179619961A4E2C723F62156C35 -6C546C5C6C4A6CA36C856C906C946C8C6C686C696C746C766C866CA96CD06CD4 -6CAD6CF76CF86CF16CD76CB26CE06CD66CFA6CEB6CEE6CB16CD36CEF6CFE0000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -92A892A992AA92AB92AC92AD92AF92B092B192B292B392B492B592B692B792B8 -92B992BA92BB92BC92BD92BE92BF92C092C192C292C392C492C592C692C792C9 -92CA92CB92CC92CD92CE92CF92D092D192D292D392D492D592D692D792D892D9 -92DA92DB92DC92DD92DE92DF92E092E192E292E392E492E592E692E792E80000 -92E992EA92EB92EC92ED92EE92EF92F092F192F292F392F492F592F692F792F8 -92F992FA92FB92FC92FD92FE92FF930093019302930393049305930693079308 -93096D396D276D0C6D436D486D076D046D196D0E6D2B6D4D6D2E6D356D1A6D4F -6D526D546D336D916D6F6D9E6DA06D5E6D936D946D5C6D606D7C6D636E1A6DC7 -6DC56DDE6E0E6DBF6DE06E116DE66DDD6DD96E166DAB6E0C6DAE6E2B6E6E6E4E -6E6B6EB26E5F6E866E536E546E326E256E446EDF6EB16E986EE06F2D6EE26EA5 -6EA76EBD6EBB6EB76ED76EB46ECF6E8F6EC26E9F6F626F466F476F246F156EF9 -6F2F6F366F4B6F746F2A6F096F296F896F8D6F8C6F786F726F7C6F7A6FD10000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -930A930B930C930D930E930F9310931193129313931493159316931793189319 -931A931B931C931D931E931F9320932193229323932493259326932793289329 -932A932B932C932D932E932F9330933193329333933493359336933793389339 -933A933B933C933D933F93409341934293439344934593469347934893490000 -934A934B934C934D934E934F9350935193529353935493559356935793589359 -935A935B935C935D935E935F9360936193629363936493659366936793689369 -936B6FC96FA76FB96FB66FC26FE16FEE6FDE6FE06FEF701A7023701B70397035 -704F705E5B805B845B955B935BA55BB8752F9A9E64345BE45BEE89305BF08E47 -8B078FB68FD38FD58FE58FEE8FE48FE98FE68FF38FE890059004900B90269011 -900D9016902190359036902D902F9044905190529050906890589062905B66B9 -9074907D908290889083908B5F505F575F565F585C3B54AB5C505C595B715C63 -5C667FBC5F2A5F295F2D82745F3C9B3B5C6E59815983598D59A959AA59A30000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -936C936D936E936F9370937193729373937493759376937793789379937A937B -937C937D937E937F9380938193829383938493859386938793889389938A938B -938C938D938E9390939193929393939493959396939793989399939A939B939C -939D939E939F93A093A193A293A393A493A593A693A793A893A993AA93AB0000 -93AC93AD93AE93AF93B093B193B293B393B493B593B693B793B893B993BA93BB -93BC93BD93BE93BF93C093C193C293C393C493C593C693C793C893C993CB93CC -93CD599759CA59AB599E59A459D259B259AF59D759BE5A055A0659DD5A0859E3 -59D859F95A0C5A095A325A345A115A235A135A405A675A4A5A555A3C5A625A75 -80EC5AAA5A9B5A775A7A5ABE5AEB5AB25AD25AD45AB85AE05AE35AF15AD65AE6 -5AD85ADC5B095B175B165B325B375B405C155C1C5B5A5B655B735B515B535B62 -9A759A779A789A7A9A7F9A7D9A809A819A859A889A8A9A909A929A939A969A98 -9A9B9A9C9A9D9A9F9AA09AA29AA39AA59AA77E9F7EA17EA37EA57EA87EA90000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -93CE93CF93D093D193D293D393D493D593D793D893D993DA93DB93DC93DD93DE -93DF93E093E193E293E393E493E593E693E793E893E993EA93EB93EC93ED93EE -93EF93F093F193F293F393F493F593F693F793F893F993FA93FB93FC93FD93FE -93FF9400940194029403940494059406940794089409940A940B940C940D0000 -940E940F9410941194129413941494159416941794189419941A941B941C941D -941E941F9420942194229423942494259426942794289429942A942B942C942D -942E7EAD7EB07EBE7EC07EC17EC27EC97ECB7ECC7ED07ED47ED77EDB7EE07EE1 -7EE87EEB7EEE7EEF7EF17EF27F0D7EF67EFA7EFB7EFE7F017F027F037F077F08 -7F0B7F0C7F0F7F117F127F177F197F1C7F1B7F1F7F217F227F237F247F257F26 -7F277F2A7F2B7F2C7F2D7F2F7F307F317F327F337F355E7A757F5DDB753E9095 -738E739173AE73A2739F73CF73C273D173B773B373C073C973C873E573D9987C -740A73E973E773DE73BA73F2740F742A745B7426742574287430742E742C0000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -942F9430943194329433943494359436943794389439943A943B943C943D943F -9440944194429443944494459446944794489449944A944B944C944D944E944F -9450945194529453945494559456945794589459945A945B945C945D945E945F -9460946194629463946494659466946794689469946A946C946D946E946F0000 -9470947194729473947494759476947794789479947A947B947C947D947E947F -9480948194829483948494919496949894C794CF94D394D494DA94E694FB951C -9520741B741A7441745C7457745574597477746D747E749C748E748074817487 -748B749E74A874A9749074A774D274BA97EA97EB97EC674C6753675E67486769 -67A56787676A6773679867A7677567A8679E67AD678B6777677C67F0680967D8 -680A67E967B0680C67D967B567DA67B367DD680067C367B867E2680E67C167FD -6832683368606861684E6862684468646883681D68556866684168676840683E -684A6849682968B5688F687468776893686B68C2696E68FC691F692068F90000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -95279533953D95439548954B9555955A9560956E95749575957795789579957A -957B957C957D957E9580958195829583958495859586958795889589958A958B -958C958D958E958F9590959195929593959495959596959795989599959A959B -959C959D959E959F95A095A195A295A395A495A595A695A795A895A995AA0000 -95AB95AC95AD95AE95AF95B095B195B295B395B495B595B695B795B895B995BA -95BB95BC95BD95BE95BF95C095C195C295C395C495C595C695C795C895C995CA -95CB692468F0690B6901695768E369106971693969606942695D6984696B6980 -69986978693469CC6987698869CE6989696669636979699B69A769BB69AB69AD -69D469B169C169CA69DF699569E0698D69FF6A2F69ED6A176A186A6569F26A44 -6A3E6AA06A506A5B6A356A8E6A796A3D6A286A586A7C6A916A906AA96A976AAB -733773526B816B826B876B846B926B936B8D6B9A6B9B6BA16BAA8F6B8F6D8F71 -8F728F738F758F768F788F778F798F7A8F7C8F7E8F818F828F848F878F8B0000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -95CC95CD95CE95CF95D095D195D295D395D495D595D695D795D895D995DA95DB -95DC95DD95DE95DF95E095E195E295E395E495E595E695E795EC95FF96079613 -9618961B961E96209623962496259626962796289629962B962C962D962F9630 -963796389639963A963E96419643964A964E964F965196529653965696570000 -96589659965A965C965D965E9660966396659666966B966D966E966F96709671 -967396789679967A967B967C967D967E967F9680968196829683968496879689 -968A8F8D8F8E8F8F8F988F9A8ECE620B6217621B621F6222622162256224622C -81E774EF74F474FF750F75117513653465EE65EF65F0660A6619677266036615 -6600708566F7661D66346631663666358006665F66546641664F665666616657 -66776684668C66A7669D66BE66DB66DC66E666E98D328D338D368D3B8D3D8D40 -8D458D468D488D498D478D4D8D558D5989C789CA89CB89CC89CE89CF89D089D1 -726E729F725D7266726F727E727F7284728B728D728F72926308633263B00000 -EB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -968C968E96919692969396959696969A969B969D969E969F96A096A196A296A3 -96A496A596A696A896A996AA96AB96AC96AD96AE96AF96B196B296B496B596B7 -96B896BA96BB96BF96C296C396C896CA96CB96D096D196D396D496D696D796D8 -96D996DA96DB96DC96DD96DE96DF96E196E296E396E496E596E696E796EB0000 -96EC96ED96EE96F096F196F296F496F596F896FA96FB96FC96FD96FF97029703 -9705970A970B970C97109711971297149715971797189719971A971B971D971F -9720643F64D880046BEA6BF36BFD6BF56BF96C056C076C066C0D6C156C186C19 -6C1A6C216C296C246C2A6C3265356555656B724D72527256723086625216809F -809C809380BC670A80BD80B180AB80AD80B480B780E780E880E980EA80DB80C2 -80C480D980CD80D7671080DD80EB80F180F480ED810D810E80F280FC67158112 -8C5A8136811E812C811881328148814C815381748159815A817181608169817C -817D816D8167584D5AB58188818281916ED581A381AA81CC672681CA81BB0000 -EC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -972197229723972497259726972797289729972B972C972E972F973197339734 -973597369737973A973B973C973D973F97409741974297439744974597469747 -97489749974A974B974C974D974E974F975097519754975597579758975A975C -975D975F97639764976697679768976A976B976C976D976E976F977097710000 -97729775977797789779977A977B977D977E977F978097819782978397849786 -978797889789978A978C978E978F979097939795979697979799979A979B979C -979D81C181A66B246B376B396B436B466B5998D198D298D398D598D998DA6BB3 -5F406BC289F365909F51659365BC65C665C465C365CC65CE65D265D67080709C -7096709D70BB70C070B770AB70B170E870CA711071137116712F71317173715C -716871457172714A7178717A719871B371B571A871A071E071D471E771F9721D -7228706C7118716671B9623E623D624362486249793B794079467949795B795C -7953795A796279577960796F7967797A7985798A799A79A779B35FD15FD00000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -979E979F97A197A297A497A597A697A797A897A997AA97AC97AE97B097B197B3 -97B597B697B797B897B997BA97BB97BC97BD97BE97BF97C097C197C297C397C4 -97C597C697C797C897C997CA97CB97CC97CD97CE97CF97D097D197D297D397D4 -97D597D697D797D897D997DA97DB97DC97DD97DE97DF97E097E197E297E30000 -97E497E597E897EE97EF97F097F197F297F497F797F897F997FA97FB97FC97FD -97FE97FF9800980198029803980498059806980798089809980A980B980C980D -980E603C605D605A606760416059606360AB6106610D615D61A9619D61CB61D1 -62068080807F6C936CF66DFC77F677F87800780978177818781165AB782D781C -781D7839783A783B781F783C7825782C78237829784E786D7856785778267850 -7847784C786A789B7893789A7887789C78A178A378B278B978A578D478D978C9 -78EC78F2790578F479137924791E79349F9B9EF99EFB9EFC76F17704770D76F9 -77077708771A77227719772D7726773577387750775177477743775A77680000 -EE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -980F9810981198129813981498159816981798189819981A981B981C981D981E -981F9820982198229823982498259826982798289829982A982B982C982D982E -982F9830983198329833983498359836983798389839983A983B983C983D983E -983F9840984198429843984498459846984798489849984A984B984C984D0000 -984E984F9850985198529853985498559856985798589859985A985B985C985D -985E985F9860986198629863986498659866986798689869986A986B986C986D -986E77627765777F778D777D7780778C7791779F77A077B077B577BD753A7540 -754E754B7548755B7572757975837F587F617F5F8A487F687F747F717F797F81 -7F7E76CD76E58832948594869487948B948A948C948D948F9490949494979495 -949A949B949C94A394A494AB94AA94AD94AC94AF94B094B294B494B694B794B8 -94B994BA94BC94BD94BF94C494C894C994CA94CB94CC94CD94CE94D094D194D2 -94D594D694D794D994D894DB94DE94DF94E094E294E494E594E794E894EA0000 -EF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -986F98709871987298739874988B988E98929895989998A398A898A998AA98AB -98AC98AD98AE98AF98B098B198B298B398B498B598B698B798B898B998BA98BB -98BC98BD98BE98BF98C098C198C298C398C498C598C698C798C898C998CA98CB -98CC98CD98CF98D098D498D698D798DB98DC98DD98E098E198E298E398E40000 -98E598E698E998EA98EB98EC98ED98EE98EF98F098F198F298F398F498F598F6 -98F798F898F998FA98FB98FC98FD98FE98FF9900990199029903990499059906 -990794E994EB94EE94EF94F394F494F594F794F994FC94FD94FF950395029506 -95079509950A950D950E950F951295139514951595169518951B951D951E951F -9522952A952B9529952C953195329534953695379538953C953E953F95429535 -9544954595469549954C954E954F9552955395549556955795589559955B955E -955F955D95619562956495659566956795689569956A956B956C956F95719572 -9573953A77E777EC96C979D579ED79E379EB7A065D477A037A027A1E7A140000 -F0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -99089909990A990B990C990E990F991199129913991499159916991799189919 -991A991B991C991D991E991F9920992199229923992499259926992799289929 -992A992B992C992D992F9930993199329933993499359936993799389939993A -993B993C993D993E993F99409941994299439944994599469947994899490000 -994A994B994C994D994E994F99509951995299539956995799589959995A995B -995C995D995E995F99609961996299649966997399789979997B997E99829983 -99897A397A377A519ECF99A57A707688768E7693769976A474DE74E0752C9E20 -9E229E289E299E2A9E2B9E2C9E329E319E369E389E379E399E3A9E3E9E419E42 -9E449E469E479E489E499E4B9E4C9E4E9E519E559E579E5A9E5B9E5C9E5E9E63 -9E669E679E689E699E6A9E6B9E6C9E719E6D9E7375927594759675A0759D75AC -75A375B375B475B875C475B175B075C375C275D675CD75E375E875E675E475EB -75E7760375F175FC75FF761076007605760C7617760A76257618761576190000 -F1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -998C998E999A999B999C999D999E999F99A099A199A299A399A499A699A799A9 -99AA99AB99AC99AD99AE99AF99B099B199B299B399B499B599B699B799B899B9 -99BA99BB99BC99BD99BE99BF99C099C199C299C399C499C599C699C799C899C9 -99CA99CB99CC99CD99CE99CF99D099D199D299D399D499D599D699D799D80000 -99D999DA99DB99DC99DD99DE99DF99E099E199E299E399E499E599E699E799E8 -99E999EA99EB99EC99ED99EE99EF99F099F199F299F399F499F599F699F799F8 -99F9761B763C762276207640762D7630763F76357643763E7633764D765E7654 -765C7656766B766F7FCA7AE67A787A797A807A867A887A957AA67AA07AAC7AA8 -7AAD7AB3886488698872887D887F888288A288C688B788BC88C988E288CE88E3 -88E588F1891A88FC88E888FE88F0892189198913891B890A8934892B89368941 -8966897B758B80E576B276B477DC801280148016801C80208022802580268027 -802980288031800B803580438046804D80528069807189839878988098830000 -F2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -99FA99FB99FC99FD99FE99FF9A009A019A029A039A049A059A069A079A089A09 -9A0A9A0B9A0C9A0D9A0E9A0F9A109A119A129A139A149A159A169A179A189A19 -9A1A9A1B9A1C9A1D9A1E9A1F9A209A219A229A239A249A259A269A279A289A29 -9A2A9A2B9A2C9A2D9A2E9A2F9A309A319A329A339A349A359A369A379A380000 -9A399A3A9A3B9A3C9A3D9A3E9A3F9A409A419A429A439A449A459A469A479A48 -9A499A4A9A4B9A4C9A4D9A4E9A4F9A509A519A529A539A549A559A569A579A58 -9A599889988C988D988F9894989A989B989E989F98A198A298A598A6864D8654 -866C866E867F867A867C867B86A8868D868B86AC869D86A786A386AA869386A9 -86B686C486B586CE86B086BA86B186AF86C986CF86B486E986F186F286ED86F3 -86D0871386DE86F486DF86D886D18703870786F88708870A870D87098723873B -871E8725872E871A873E87488734873187298737873F87828722877D877E877B -87608770874C876E878B87538763877C876487598765879387AF87A887D20000 -F3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9A5A9A5B9A5C9A5D9A5E9A5F9A609A619A629A639A649A659A669A679A689A69 -9A6A9A6B9A729A839A899A8D9A8E9A949A959A999AA69AA99AAA9AAB9AAC9AAD -9AAE9AAF9AB29AB39AB49AB59AB99ABB9ABD9ABE9ABF9AC39AC49AC69AC79AC8 -9AC99ACA9ACD9ACE9ACF9AD09AD29AD49AD59AD69AD79AD99ADA9ADB9ADC0000 -9ADD9ADE9AE09AE29AE39AE49AE59AE79AE89AE99AEA9AEC9AEE9AF09AF19AF2 -9AF39AF49AF59AF69AF79AF89AFA9AFC9AFD9AFE9AFF9B009B019B029B049B05 -9B0687C68788878587AD8797878387AB87E587AC87B587B387CB87D387BD87D1 -87C087CA87DB87EA87E087EE8816881387FE880A881B88218839883C7F367F42 -7F447F4582107AFA7AFD7B087B037B047B157B0A7B2B7B0F7B477B387B2A7B19 -7B2E7B317B207B257B247B337B3E7B1E7B587B5A7B457B757B4C7B5D7B607B6E -7B7B7B627B727B717B907BA67BA77BB87BAC7B9D7BA87B857BAA7B9C7BA27BAB -7BB47BD17BC17BCC7BDD7BDA7BE57BE67BEA7C0C7BFE7BFC7C0F7C167C0B0000 -F4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9B079B099B0A9B0B9B0C9B0D9B0E9B109B119B129B149B159B169B179B189B19 -9B1A9B1B9B1C9B1D9B1E9B209B219B229B249B259B269B279B289B299B2A9B2B -9B2C9B2D9B2E9B309B319B339B349B359B369B379B389B399B3A9B3D9B3E9B3F -9B409B469B4A9B4B9B4C9B4E9B509B529B539B559B569B579B589B599B5A0000 -9B5B9B5C9B5D9B5E9B5F9B609B619B629B639B649B659B669B679B689B699B6A -9B6B9B6C9B6D9B6E9B6F9B709B719B729B739B749B759B769B779B789B799B7A -9B7B7C1F7C2A7C267C387C417C4081FE82018202820481EC8844822182228223 -822D822F8228822B8238823B82338234823E82448249824B824F825A825F8268 -887E8885888888D888DF895E7F9D7F9F7FA77FAF7FB07FB27C7C65497C917C9D -7C9C7C9E7CA27CB27CBC7CBD7CC17CC77CCC7CCD7CC87CC57CD77CE8826E66A8 -7FBF7FCE7FD57FE57FE17FE67FE97FEE7FF37CF87D777DA67DAE7E477E9B9EB8 -9EB48D738D848D948D918DB18D678D6D8C478C49914A9150914E914F91640000 -F5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9B7C9B7D9B7E9B7F9B809B819B829B839B849B859B869B879B889B899B8A9B8B -9B8C9B8D9B8E9B8F9B909B919B929B939B949B959B969B979B989B999B9A9B9B -9B9C9B9D9B9E9B9F9BA09BA19BA29BA39BA49BA59BA69BA79BA89BA99BAA9BAB -9BAC9BAD9BAE9BAF9BB09BB19BB29BB39BB49BB59BB69BB79BB89BB99BBA0000 -9BBB9BBC9BBD9BBE9BBF9BC09BC19BC29BC39BC49BC59BC69BC79BC89BC99BCA -9BCB9BCC9BCD9BCE9BCF9BD09BD19BD29BD39BD49BD59BD69BD79BD89BD99BDA -9BDB9162916191709169916F917D917E917291749179918C91859190918D9191 -91A291A391AA91AD91AE91AF91B591B491BA8C559E7E8DB88DEB8E058E598E69 -8DB58DBF8DBC8DBA8DC48DD68DD78DDA8DDE8DCE8DCF8DDB8DC68DEC8DF78DF8 -8DE38DF98DFB8DE48E098DFD8E148E1D8E1F8E2C8E2E8E238E2F8E3A8E408E39 -8E358E3D8E318E498E418E428E518E528E4A8E708E768E7C8E6F8E748E858E8F -8E948E908E9C8E9E8C788C828C8A8C858C988C94659B89D689DE89DA89DC0000 -F6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9BDC9BDD9BDE9BDF9BE09BE19BE29BE39BE49BE59BE69BE79BE89BE99BEA9BEB -9BEC9BED9BEE9BEF9BF09BF19BF29BF39BF49BF59BF69BF79BF89BF99BFA9BFB -9BFC9BFD9BFE9BFF9C009C019C029C039C049C059C069C079C089C099C0A9C0B -9C0C9C0D9C0E9C0F9C109C119C129C139C149C159C169C179C189C199C1A0000 -9C1B9C1C9C1D9C1E9C1F9C209C219C229C239C249C259C269C279C289C299C2A -9C2B9C2C9C2D9C2E9C2F9C309C319C329C339C349C359C369C379C389C399C3A -9C3B89E589EB89EF8A3E8B26975396E996F396EF970697019708970F970E972A -972D9730973E9F809F839F859F869F879F889F899F8A9F8C9EFE9F0B9F0D96B9 -96BC96BD96CE96D277BF96E0928E92AE92C8933E936A93CA938F943E946B9C7F -9C829C859C869C879C887A239C8B9C8E9C909C919C929C949C959C9A9C9B9C9E -9C9F9CA09CA19CA29CA39CA59CA69CA79CA89CA99CAB9CAD9CAE9CB09CB19CB2 -9CB39CB49CB59CB69CB79CBA9CBB9CBC9CBD9CC49CC59CC69CC79CCA9CCB0000 -F7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9C3C9C3D9C3E9C3F9C409C419C429C439C449C459C469C479C489C499C4A9C4B -9C4C9C4D9C4E9C4F9C509C519C529C539C549C559C569C579C589C599C5A9C5B -9C5C9C5D9C5E9C5F9C609C619C629C639C649C659C669C679C689C699C6A9C6B -9C6C9C6D9C6E9C6F9C709C719C729C739C749C759C769C779C789C799C7A0000 -9C7B9C7D9C7E9C809C839C849C899C8A9C8C9C8F9C939C969C979C989C999C9D -9CAA9CAC9CAF9CB99CBE9CBF9CC09CC19CC29CC89CC99CD19CD29CDA9CDB9CE0 -9CE19CCC9CCD9CCE9CCF9CD09CD39CD49CD59CD79CD89CD99CDC9CDD9CDF9CE2 -977C978597919792979497AF97AB97A397B297B49AB19AB09AB79E589AB69ABA -9ABC9AC19AC09AC59AC29ACB9ACC9AD19B459B439B479B499B489B4D9B5198E8 -990D992E995599549ADF9AE19AE69AEF9AEB9AFB9AED9AF99B089B0F9B139B1F -9B239EBD9EBE7E3B9E829E879E889E8B9E9293D69E9D9E9F9EDB9EDC9EDD9EE0 -9EDF9EE29EE99EE79EE59EEA9EEF9F229F2C9F2F9F399F379F3D9F3E9F440000 -F8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9CE39CE49CE59CE69CE79CE89CE99CEA9CEB9CEC9CED9CEE9CEF9CF09CF19CF2 -9CF39CF49CF59CF69CF79CF89CF99CFA9CFB9CFC9CFD9CFE9CFF9D009D019D02 -9D039D049D059D069D079D089D099D0A9D0B9D0C9D0D9D0E9D0F9D109D119D12 -9D139D149D159D169D179D189D199D1A9D1B9D1C9D1D9D1E9D1F9D209D210000 -9D229D239D249D259D269D279D289D299D2A9D2B9D2C9D2D9D2E9D2F9D309D31 -9D329D339D349D359D369D379D389D399D3A9D3B9D3C9D3D9D3E9D3F9D409D41 -9D42000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -F9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9D439D449D459D469D479D489D499D4A9D4B9D4C9D4D9D4E9D4F9D509D519D52 -9D539D549D559D569D579D589D599D5A9D5B9D5C9D5D9D5E9D5F9D609D619D62 -9D639D649D659D669D679D689D699D6A9D6B9D6C9D6D9D6E9D6F9D709D719D72 -9D739D749D759D769D779D789D799D7A9D7B9D7C9D7D9D7E9D7F9D809D810000 -9D829D839D849D859D869D879D889D899D8A9D8B9D8C9D8D9D8E9D8F9D909D91 -9D929D939D949D959D969D979D989D999D9A9D9B9D9C9D9D9D9E9D9F9DA09DA1 -9DA2000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9DA39DA49DA59DA69DA79DA89DA99DAA9DAB9DAC9DAD9DAE9DAF9DB09DB19DB2 -9DB39DB49DB59DB69DB79DB89DB99DBA9DBB9DBC9DBD9DBE9DBF9DC09DC19DC2 -9DC39DC49DC59DC69DC79DC89DC99DCA9DCB9DCC9DCD9DCE9DCF9DD09DD19DD2 -9DD39DD49DD59DD69DD79DD89DD99DDA9DDB9DDC9DDD9DDE9DDF9DE09DE10000 -9DE29DE39DE49DE59DE69DE79DE89DE99DEA9DEB9DEC9DED9DEE9DEF9DF09DF1 -9DF29DF39DF49DF59DF69DF79DF89DF99DFA9DFB9DFC9DFD9DFE9DFF9E009E01 -9E02000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9E039E049E059E069E079E089E099E0A9E0B9E0C9E0D9E0E9E0F9E109E119E12 -9E139E149E159E169E179E189E199E1A9E1B9E1C9E1D9E1E9E249E279E2E9E30 -9E349E3B9E3C9E409E4D9E509E529E539E549E569E599E5D9E5F9E609E619E62 -9E659E6E9E6F9E729E749E759E769E779E789E799E7A9E7B9E7C9E7D9E800000 -9E819E839E849E859E869E899E8A9E8C9E8D9E8E9E8F9E909E919E949E959E96 -9E979E989E999E9A9E9B9E9C9E9E9EA09EA19EA29EA39EA49EA59EA79EA89EA9 -9EAA000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9EAB9EAC9EAD9EAE9EAF9EB09EB19EB29EB39EB59EB69EB79EB99EBA9EBC9EBF -9EC09EC19EC29EC39EC59EC69EC79EC89ECA9ECB9ECC9ED09ED29ED39ED59ED6 -9ED79ED99EDA9EDE9EE19EE39EE49EE69EE89EEB9EEC9EED9EEE9EF09EF19EF2 -9EF39EF49EF59EF69EF79EF89EFA9EFD9EFF9F009F019F029F039F049F050000 -9F069F079F089F099F0A9F0C9F0F9F119F129F149F159F169F189F1A9F1B9F1C -9F1D9F1E9F1F9F219F239F249F259F269F279F289F299F2A9F2B9F2D9F2E9F30 -9F31000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9F329F339F349F359F369F389F3A9F3C9F3F9F409F419F429F439F459F469F47 -9F489F499F4A9F4B9F4C9F4D9F4E9F4F9F529F539F549F559F569F579F589F59 -9F5A9F5B9F5C9F5D9F5E9F5F9F609F619F629F639F649F659F669F679F689F69 -9F6A9F6B9F6C9F6D9F6E9F6F9F709F719F729F739F749F759F769F779F780000 -9F799F7A9F7B9F7C9F7D9F7E9F819F829F8D9F8E9F8F9F909F919F929F939F94 -9F959F969F979F989F9C9F9D9F9E9FA19FA29FA39FA49FA5F92CF979F995F9E7 -F9F1000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FA0CFA0DFA0EFA0FFA11FA13FA14FA18FA1FFA20FA21FA23FA24FA27FA28FA29 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/cp949.enc b/library/encoding/cp949.enc deleted file mode 100644 index 697fc6f94..0000000 --- a/library/encoding/cp949.enc +++ /dev/null @@ -1,2128 +0,0 @@ -# Encoding file: cp949, multi-byte -M -003F 0 125 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -81 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AC02AC03AC05AC06AC0BAC0CAC0DAC0EAC0FAC18AC1EAC1FAC21AC22AC23 -AC25AC26AC27AC28AC29AC2AAC2BAC2EAC32AC33AC3400000000000000000000 -0000AC35AC36AC37AC3AAC3BAC3DAC3EAC3FAC41AC42AC43AC44AC45AC46AC47 -AC48AC49AC4AAC4CAC4EAC4FAC50AC51AC52AC53AC5500000000000000000000 -0000AC56AC57AC59AC5AAC5BAC5DAC5EAC5FAC60AC61AC62AC63AC64AC65AC66 -AC67AC68AC69AC6AAC6BAC6CAC6DAC6EAC6FAC72AC73AC75AC76AC79AC7BAC7C -AC7DAC7EAC7FAC82AC87AC88AC8DAC8EAC8FAC91AC92AC93AC95AC96AC97AC98 -AC99AC9AAC9BAC9EACA2ACA3ACA4ACA5ACA6ACA7ACABACADACAEACB1ACB2ACB3 -ACB4ACB5ACB6ACB7ACBAACBEACBFACC0ACC2ACC3ACC5ACC6ACC7ACC9ACCAACCB -ACCDACCEACCFACD0ACD1ACD2ACD3ACD4ACD6ACD8ACD9ACDAACDBACDCACDDACDE -ACDFACE2ACE3ACE5ACE6ACE9ACEBACEDACEEACF2ACF4ACF7ACF8ACF9ACFAACFB -ACFEACFFAD01AD02AD03AD05AD07AD08AD09AD0AAD0BAD0EAD10AD12AD130000 -82 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AD14AD15AD16AD17AD19AD1AAD1BAD1DAD1EAD1FAD21AD22AD23AD24AD25 -AD26AD27AD28AD2AAD2BAD2EAD2FAD30AD31AD32AD3300000000000000000000 -0000AD36AD37AD39AD3AAD3BAD3DAD3EAD3FAD40AD41AD42AD43AD46AD48AD4A -AD4BAD4CAD4DAD4EAD4FAD51AD52AD53AD55AD56AD5700000000000000000000 -0000AD59AD5AAD5BAD5CAD5DAD5EAD5FAD60AD62AD64AD65AD66AD67AD68AD69 -AD6AAD6BAD6EAD6FAD71AD72AD77AD78AD79AD7AAD7EAD80AD83AD84AD85AD86 -AD87AD8AAD8BAD8DAD8EAD8FAD91AD92AD93AD94AD95AD96AD97AD98AD99AD9A -AD9BAD9EAD9FADA0ADA1ADA2ADA3ADA5ADA6ADA7ADA8ADA9ADAAADABADACADAD -ADAEADAFADB0ADB1ADB2ADB3ADB4ADB5ADB6ADB8ADB9ADBAADBBADBCADBDADBE -ADBFADC2ADC3ADC5ADC6ADC7ADC9ADCAADCBADCCADCDADCEADCFADD2ADD4ADD5 -ADD6ADD7ADD8ADD9ADDAADDBADDDADDEADDFADE1ADE2ADE3ADE5ADE6ADE7ADE8 -ADE9ADEAADEBADECADEDADEEADEFADF0ADF1ADF2ADF3ADF4ADF5ADF6ADF70000 -83 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000ADFAADFBADFDADFEAE02AE03AE04AE05AE06AE07AE0AAE0CAE0EAE0FAE10 -AE11AE12AE13AE15AE16AE17AE18AE19AE1AAE1BAE1C00000000000000000000 -0000AE1DAE1EAE1FAE20AE21AE22AE23AE24AE25AE26AE27AE28AE29AE2AAE2B -AE2CAE2DAE2EAE2FAE32AE33AE35AE36AE39AE3BAE3C00000000000000000000 -0000AE3DAE3EAE3FAE42AE44AE47AE48AE49AE4BAE4FAE51AE52AE53AE55AE57 -AE58AE59AE5AAE5BAE5EAE62AE63AE64AE66AE67AE6AAE6BAE6DAE6EAE6FAE71 -AE72AE73AE74AE75AE76AE77AE7AAE7EAE7FAE80AE81AE82AE83AE86AE87AE88 -AE89AE8AAE8BAE8DAE8EAE8FAE90AE91AE92AE93AE94AE95AE96AE97AE98AE99 -AE9AAE9BAE9CAE9DAE9EAE9FAEA0AEA1AEA2AEA3AEA4AEA5AEA6AEA7AEA8AEA9 -AEAAAEABAEACAEADAEAEAEAFAEB0AEB1AEB2AEB3AEB4AEB5AEB6AEB7AEB8AEB9 -AEBAAEBBAEBFAEC1AEC2AEC3AEC5AEC6AEC7AEC8AEC9AECAAECBAECEAED2AED3 -AED4AED5AED6AED7AEDAAEDBAEDDAEDEAEDFAEE0AEE1AEE2AEE3AEE4AEE50000 -84 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AEE6AEE7AEE9AEEAAEECAEEEAEEFAEF0AEF1AEF2AEF3AEF5AEF6AEF7AEF9 -AEFAAEFBAEFDAEFEAEFFAF00AF01AF02AF03AF04AF0500000000000000000000 -0000AF06AF09AF0AAF0BAF0CAF0EAF0FAF11AF12AF13AF14AF15AF16AF17AF18 -AF19AF1AAF1BAF1CAF1DAF1EAF1FAF20AF21AF22AF2300000000000000000000 -0000AF24AF25AF26AF27AF28AF29AF2AAF2BAF2EAF2FAF31AF33AF35AF36AF37 -AF38AF39AF3AAF3BAF3EAF40AF44AF45AF46AF47AF4AAF4BAF4CAF4DAF4EAF4F -AF51AF52AF53AF54AF55AF56AF57AF58AF59AF5AAF5BAF5EAF5FAF60AF61AF62 -AF63AF66AF67AF68AF69AF6AAF6BAF6CAF6DAF6EAF6FAF70AF71AF72AF73AF74 -AF75AF76AF77AF78AF7AAF7BAF7CAF7DAF7EAF7FAF81AF82AF83AF85AF86AF87 -AF89AF8AAF8BAF8CAF8DAF8EAF8FAF92AF93AF94AF96AF97AF98AF99AF9AAF9B -AF9DAF9EAF9FAFA0AFA1AFA2AFA3AFA4AFA5AFA6AFA7AFA8AFA9AFAAAFABAFAC -AFADAFAEAFAFAFB0AFB1AFB2AFB3AFB4AFB5AFB6AFB7AFBAAFBBAFBDAFBE0000 -85 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AFBFAFC1AFC2AFC3AFC4AFC5AFC6AFCAAFCCAFCFAFD0AFD1AFD2AFD3AFD5 -AFD6AFD7AFD8AFD9AFDAAFDBAFDDAFDEAFDFAFE0AFE100000000000000000000 -0000AFE2AFE3AFE4AFE5AFE6AFE7AFEAAFEBAFECAFEDAFEEAFEFAFF2AFF3AFF5 -AFF6AFF7AFF9AFFAAFFBAFFCAFFDAFFEAFFFB002B00300000000000000000000 -0000B005B006B007B008B009B00AB00BB00DB00EB00FB011B012B013B015B016 -B017B018B019B01AB01BB01EB01FB020B021B022B023B024B025B026B027B029 -B02AB02BB02CB02DB02EB02FB030B031B032B033B034B035B036B037B038B039 -B03AB03BB03CB03DB03EB03FB040B041B042B043B046B047B049B04BB04DB04F -B050B051B052B056B058B05AB05BB05CB05EB05FB060B061B062B063B064B065 -B066B067B068B069B06AB06BB06CB06DB06EB06FB070B071B072B073B074B075 -B076B077B078B079B07AB07BB07EB07FB081B082B083B085B086B087B088B089 -B08AB08BB08EB090B092B093B094B095B096B097B09BB09DB09EB0A3B0A40000 -86 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B0A5B0A6B0A7B0AAB0B0B0B2B0B6B0B7B0B9B0BAB0BBB0BDB0BEB0BFB0C0 -B0C1B0C2B0C3B0C6B0CAB0CBB0CCB0CDB0CEB0CFB0D200000000000000000000 -0000B0D3B0D5B0D6B0D7B0D9B0DAB0DBB0DCB0DDB0DEB0DFB0E1B0E2B0E3B0E4 -B0E6B0E7B0E8B0E9B0EAB0EBB0ECB0EDB0EEB0EFB0F000000000000000000000 -0000B0F1B0F2B0F3B0F4B0F5B0F6B0F7B0F8B0F9B0FAB0FBB0FCB0FDB0FEB0FF -B100B101B102B103B104B105B106B107B10AB10DB10EB10FB111B114B115B116 -B117B11AB11EB11FB120B121B122B126B127B129B12AB12BB12DB12EB12FB130 -B131B132B133B136B13AB13BB13CB13DB13EB13FB142B143B145B146B147B149 -B14AB14BB14CB14DB14EB14FB152B153B156B157B159B15AB15BB15DB15EB15F -B161B162B163B164B165B166B167B168B169B16AB16BB16CB16DB16EB16FB170 -B171B172B173B174B175B176B177B17AB17BB17DB17EB17FB181B183B184B185 -B186B187B18AB18CB18EB18FB190B191B195B196B197B199B19AB19BB19D0000 -87 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B19EB19FB1A0B1A1B1A2B1A3B1A4B1A5B1A6B1A7B1A9B1AAB1ABB1ACB1AD -B1AEB1AFB1B0B1B1B1B2B1B3B1B4B1B5B1B6B1B7B1B800000000000000000000 -0000B1B9B1BAB1BBB1BCB1BDB1BEB1BFB1C0B1C1B1C2B1C3B1C4B1C5B1C6B1C7 -B1C8B1C9B1CAB1CBB1CDB1CEB1CFB1D1B1D2B1D3B1D500000000000000000000 -0000B1D6B1D7B1D8B1D9B1DAB1DBB1DEB1E0B1E1B1E2B1E3B1E4B1E5B1E6B1E7 -B1EAB1EBB1EDB1EEB1EFB1F1B1F2B1F3B1F4B1F5B1F6B1F7B1F8B1FAB1FCB1FE -B1FFB200B201B202B203B206B207B209B20AB20DB20EB20FB210B211B212B213 -B216B218B21AB21BB21CB21DB21EB21FB221B222B223B224B225B226B227B228 -B229B22AB22BB22CB22DB22EB22FB230B231B232B233B235B236B237B238B239 -B23AB23BB23DB23EB23FB240B241B242B243B244B245B246B247B248B249B24A -B24BB24CB24DB24EB24FB250B251B252B253B254B255B256B257B259B25AB25B -B25DB25EB25FB261B262B263B264B265B266B267B26AB26BB26CB26DB26E0000 -88 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B26FB270B271B272B273B276B277B278B279B27AB27BB27DB27EB27FB280 -B281B282B283B286B287B288B28AB28BB28CB28DB28E00000000000000000000 -0000B28FB292B293B295B296B297B29BB29CB29DB29EB29FB2A2B2A4B2A7B2A8 -B2A9B2ABB2ADB2AEB2AFB2B1B2B2B2B3B2B5B2B6B2B700000000000000000000 -0000B2B8B2B9B2BAB2BBB2BCB2BDB2BEB2BFB2C0B2C1B2C2B2C3B2C4B2C5B2C6 -B2C7B2CAB2CBB2CDB2CEB2CFB2D1B2D3B2D4B2D5B2D6B2D7B2DAB2DCB2DEB2DF -B2E0B2E1B2E3B2E7B2E9B2EAB2F0B2F1B2F2B2F6B2FCB2FDB2FEB302B303B305 -B306B307B309B30AB30BB30CB30DB30EB30FB312B316B317B318B319B31AB31B -B31DB31EB31FB320B321B322B323B324B325B326B327B328B329B32AB32BB32C -B32DB32EB32FB330B331B332B333B334B335B336B337B338B339B33AB33BB33C -B33DB33EB33FB340B341B342B343B344B345B346B347B348B349B34AB34BB34C -B34DB34EB34FB350B351B352B353B357B359B35AB35DB360B361B362B3630000 -89 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B366B368B36AB36CB36DB36FB372B373B375B376B377B379B37AB37BB37C -B37DB37EB37FB382B386B387B388B389B38AB38BB38D00000000000000000000 -0000B38EB38FB391B392B393B395B396B397B398B399B39AB39BB39CB39DB39E -B39FB3A2B3A3B3A4B3A5B3A6B3A7B3A9B3AAB3ABB3AD00000000000000000000 -0000B3AEB3AFB3B0B3B1B3B2B3B3B3B4B3B5B3B6B3B7B3B8B3B9B3BAB3BBB3BC -B3BDB3BEB3BFB3C0B3C1B3C2B3C3B3C6B3C7B3C9B3CAB3CDB3CFB3D1B3D2B3D3 -B3D6B3D8B3DAB3DCB3DEB3DFB3E1B3E2B3E3B3E5B3E6B3E7B3E9B3EAB3EBB3EC -B3EDB3EEB3EFB3F0B3F1B3F2B3F3B3F4B3F5B3F6B3F7B3F8B3F9B3FAB3FBB3FD -B3FEB3FFB400B401B402B403B404B405B406B407B408B409B40AB40BB40CB40D -B40EB40FB411B412B413B414B415B416B417B419B41AB41BB41DB41EB41FB421 -B422B423B424B425B426B427B42AB42CB42DB42EB42FB430B431B432B433B435 -B436B437B438B439B43AB43BB43CB43DB43EB43FB440B441B442B443B4440000 -8A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B445B446B447B448B449B44AB44BB44CB44DB44EB44FB452B453B455B456 -B457B459B45AB45BB45CB45DB45EB45FB462B464B46600000000000000000000 -0000B467B468B469B46AB46BB46DB46EB46FB470B471B472B473B474B475B476 -B477B478B479B47AB47BB47CB47DB47EB47FB481B48200000000000000000000 -0000B483B484B485B486B487B489B48AB48BB48CB48DB48EB48FB490B491B492 -B493B494B495B496B497B498B499B49AB49BB49CB49EB49FB4A0B4A1B4A2B4A3 -B4A5B4A6B4A7B4A9B4AAB4ABB4ADB4AEB4AFB4B0B4B1B4B2B4B3B4B4B4B6B4B8 -B4BAB4BBB4BCB4BDB4BEB4BFB4C1B4C2B4C3B4C5B4C6B4C7B4C9B4CAB4CBB4CC -B4CDB4CEB4CFB4D1B4D2B4D3B4D4B4D6B4D7B4D8B4D9B4DAB4DBB4DEB4DFB4E1 -B4E2B4E5B4E7B4E8B4E9B4EAB4EBB4EEB4F0B4F2B4F3B4F4B4F5B4F6B4F7B4F9 -B4FAB4FBB4FCB4FDB4FEB4FFB500B501B502B503B504B505B506B507B508B509 -B50AB50BB50CB50DB50EB50FB510B511B512B513B516B517B519B51AB51D0000 -8B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B51EB51FB520B521B522B523B526B52BB52CB52DB52EB52FB532B533B535 -B536B537B539B53AB53BB53CB53DB53EB53FB542B54600000000000000000000 -0000B547B548B549B54AB54EB54FB551B552B553B555B556B557B558B559B55A -B55BB55EB562B563B564B565B566B567B568B569B56A00000000000000000000 -0000B56BB56CB56DB56EB56FB570B571B572B573B574B575B576B577B578B579 -B57AB57BB57CB57DB57EB57FB580B581B582B583B584B585B586B587B588B589 -B58AB58BB58CB58DB58EB58FB590B591B592B593B594B595B596B597B598B599 -B59AB59BB59CB59DB59EB59FB5A2B5A3B5A5B5A6B5A7B5A9B5ACB5ADB5AEB5AF -B5B2B5B6B5B7B5B8B5B9B5BAB5BEB5BFB5C1B5C2B5C3B5C5B5C6B5C7B5C8B5C9 -B5CAB5CBB5CEB5D2B5D3B5D4B5D5B5D6B5D7B5D9B5DAB5DBB5DCB5DDB5DEB5DF -B5E0B5E1B5E2B5E3B5E4B5E5B5E6B5E7B5E8B5E9B5EAB5EBB5EDB5EEB5EFB5F0 -B5F1B5F2B5F3B5F4B5F5B5F6B5F7B5F8B5F9B5FAB5FBB5FCB5FDB5FEB5FF0000 -8C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B600B601B602B603B604B605B606B607B608B609B60AB60BB60CB60DB60E -B60FB612B613B615B616B617B619B61AB61BB61CB61D00000000000000000000 -0000B61EB61FB620B621B622B623B624B626B627B628B629B62AB62BB62DB62E -B62FB630B631B632B633B635B636B637B638B639B63A00000000000000000000 -0000B63BB63CB63DB63EB63FB640B641B642B643B644B645B646B647B649B64A -B64BB64CB64DB64EB64FB650B651B652B653B654B655B656B657B658B659B65A -B65BB65CB65DB65EB65FB660B661B662B663B665B666B667B669B66AB66BB66C -B66DB66EB66FB670B671B672B673B674B675B676B677B678B679B67AB67BB67C -B67DB67EB67FB680B681B682B683B684B685B686B687B688B689B68AB68BB68C -B68DB68EB68FB690B691B692B693B694B695B696B697B698B699B69AB69BB69E -B69FB6A1B6A2B6A3B6A5B6A6B6A7B6A8B6A9B6AAB6ADB6AEB6AFB6B0B6B2B6B3 -B6B4B6B5B6B6B6B7B6B8B6B9B6BAB6BBB6BCB6BDB6BEB6BFB6C0B6C1B6C20000 -8D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B6C3B6C4B6C5B6C6B6C7B6C8B6C9B6CAB6CBB6CCB6CDB6CEB6CFB6D0B6D1 -B6D2B6D3B6D5B6D6B6D7B6D8B6D9B6DAB6DBB6DCB6DD00000000000000000000 -0000B6DEB6DFB6E0B6E1B6E2B6E3B6E4B6E5B6E6B6E7B6E8B6E9B6EAB6EBB6EC -B6EDB6EEB6EFB6F1B6F2B6F3B6F5B6F6B6F7B6F9B6FA00000000000000000000 -0000B6FBB6FCB6FDB6FEB6FFB702B703B704B706B707B708B709B70AB70BB70C -B70DB70EB70FB710B711B712B713B714B715B716B717B718B719B71AB71BB71C -B71DB71EB71FB720B721B722B723B724B725B726B727B72AB72BB72DB72EB731 -B732B733B734B735B736B737B73AB73CB73DB73EB73FB740B741B742B743B745 -B746B747B749B74AB74BB74DB74EB74FB750B751B752B753B756B757B758B759 -B75AB75BB75CB75DB75EB75FB761B762B763B765B766B767B769B76AB76BB76C -B76DB76EB76FB772B774B776B777B778B779B77AB77BB77EB77FB781B782B783 -B785B786B787B788B789B78AB78BB78EB793B794B795B79AB79BB79DB79E0000 -8E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B79FB7A1B7A2B7A3B7A4B7A5B7A6B7A7B7AAB7AEB7AFB7B0B7B1B7B2B7B3 -B7B6B7B7B7B9B7BAB7BBB7BCB7BDB7BEB7BFB7C0B7C100000000000000000000 -0000B7C2B7C3B7C4B7C5B7C6B7C8B7CAB7CBB7CCB7CDB7CEB7CFB7D0B7D1B7D2 -B7D3B7D4B7D5B7D6B7D7B7D8B7D9B7DAB7DBB7DCB7DD00000000000000000000 -0000B7DEB7DFB7E0B7E1B7E2B7E3B7E4B7E5B7E6B7E7B7E8B7E9B7EAB7EBB7EE -B7EFB7F1B7F2B7F3B7F5B7F6B7F7B7F8B7F9B7FAB7FBB7FEB802B803B804B805 -B806B80AB80BB80DB80EB80FB811B812B813B814B815B816B817B81AB81CB81E -B81FB820B821B822B823B826B827B829B82AB82BB82DB82EB82FB830B831B832 -B833B836B83AB83BB83CB83DB83EB83FB841B842B843B845B846B847B848B849 -B84AB84BB84CB84DB84EB84FB850B852B854B855B856B857B858B859B85AB85B -B85EB85FB861B862B863B865B866B867B868B869B86AB86BB86EB870B872B873 -B874B875B876B877B879B87AB87BB87DB87EB87FB880B881B882B883B8840000 -8F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B885B886B887B888B889B88AB88BB88CB88EB88FB890B891B892B893B894 -B895B896B897B898B899B89AB89BB89CB89DB89EB89F00000000000000000000 -0000B8A0B8A1B8A2B8A3B8A4B8A5B8A6B8A7B8A9B8AAB8ABB8ACB8ADB8AEB8AF -B8B1B8B2B8B3B8B5B8B6B8B7B8B9B8BAB8BBB8BCB8BD00000000000000000000 -0000B8BEB8BFB8C2B8C4B8C6B8C7B8C8B8C9B8CAB8CBB8CDB8CEB8CFB8D1B8D2 -B8D3B8D5B8D6B8D7B8D8B8D9B8DAB8DBB8DCB8DEB8E0B8E2B8E3B8E4B8E5B8E6 -B8E7B8EAB8EBB8EDB8EEB8EFB8F1B8F2B8F3B8F4B8F5B8F6B8F7B8FAB8FCB8FE -B8FFB900B901B902B903B905B906B907B908B909B90AB90BB90CB90DB90EB90F -B910B911B912B913B914B915B916B917B919B91AB91BB91CB91DB91EB91FB921 -B922B923B924B925B926B927B928B929B92AB92BB92CB92DB92EB92FB930B931 -B932B933B934B935B936B937B938B939B93AB93BB93EB93FB941B942B943B945 -B946B947B948B949B94AB94BB94DB94EB950B952B953B954B955B956B9570000 -90 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B95AB95BB95DB95EB95FB961B962B963B964B965B966B967B96AB96CB96E -B96FB970B971B972B973B976B977B979B97AB97BB97D00000000000000000000 -0000B97EB97FB980B981B982B983B986B988B98BB98CB98FB990B991B992B993 -B994B995B996B997B998B999B99AB99BB99CB99DB99E00000000000000000000 -0000B99FB9A0B9A1B9A2B9A3B9A4B9A5B9A6B9A7B9A8B9A9B9AAB9ABB9AEB9AF -B9B1B9B2B9B3B9B5B9B6B9B7B9B8B9B9B9BAB9BBB9BEB9C0B9C2B9C3B9C4B9C5 -B9C6B9C7B9CAB9CBB9CDB9D3B9D4B9D5B9D6B9D7B9DAB9DCB9DFB9E0B9E2B9E6 -B9E7B9E9B9EAB9EBB9EDB9EEB9EFB9F0B9F1B9F2B9F3B9F6B9FBB9FCB9FDB9FE -B9FFBA02BA03BA04BA05BA06BA07BA09BA0ABA0BBA0CBA0DBA0EBA0FBA10BA11 -BA12BA13BA14BA16BA17BA18BA19BA1ABA1BBA1CBA1DBA1EBA1FBA20BA21BA22 -BA23BA24BA25BA26BA27BA28BA29BA2ABA2BBA2CBA2DBA2EBA2FBA30BA31BA32 -BA33BA34BA35BA36BA37BA3ABA3BBA3DBA3EBA3FBA41BA43BA44BA45BA460000 -91 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BA47BA4ABA4CBA4FBA50BA51BA52BA56BA57BA59BA5ABA5BBA5DBA5EBA5F -BA60BA61BA62BA63BA66BA6ABA6BBA6CBA6DBA6EBA6F00000000000000000000 -0000BA72BA73BA75BA76BA77BA79BA7ABA7BBA7CBA7DBA7EBA7FBA80BA81BA82 -BA86BA88BA89BA8ABA8BBA8DBA8EBA8FBA90BA91BA9200000000000000000000 -0000BA93BA94BA95BA96BA97BA98BA99BA9ABA9BBA9CBA9DBA9EBA9FBAA0BAA1 -BAA2BAA3BAA4BAA5BAA6BAA7BAAABAADBAAEBAAFBAB1BAB3BAB4BAB5BAB6BAB7 -BABABABCBABEBABFBAC0BAC1BAC2BAC3BAC5BAC6BAC7BAC9BACABACBBACCBACD -BACEBACFBAD0BAD1BAD2BAD3BAD4BAD5BAD6BAD7BADABADBBADCBADDBADEBADF -BAE0BAE1BAE2BAE3BAE4BAE5BAE6BAE7BAE8BAE9BAEABAEBBAECBAEDBAEEBAEF -BAF0BAF1BAF2BAF3BAF4BAF5BAF6BAF7BAF8BAF9BAFABAFBBAFDBAFEBAFFBB01 -BB02BB03BB05BB06BB07BB08BB09BB0ABB0BBB0CBB0EBB10BB12BB13BB14BB15 -BB16BB17BB19BB1ABB1BBB1DBB1EBB1FBB21BB22BB23BB24BB25BB26BB270000 -92 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BB28BB2ABB2CBB2DBB2EBB2FBB30BB31BB32BB33BB37BB39BB3ABB3FBB40 -BB41BB42BB43BB46BB48BB4ABB4BBB4CBB4EBB51BB5200000000000000000000 -0000BB53BB55BB56BB57BB59BB5ABB5BBB5CBB5DBB5EBB5FBB60BB62BB64BB65 -BB66BB67BB68BB69BB6ABB6BBB6DBB6EBB6FBB70BB7100000000000000000000 -0000BB72BB73BB74BB75BB76BB77BB78BB79BB7ABB7BBB7CBB7DBB7EBB7FBB80 -BB81BB82BB83BB84BB85BB86BB87BB89BB8ABB8BBB8DBB8EBB8FBB91BB92BB93 -BB94BB95BB96BB97BB98BB99BB9ABB9BBB9CBB9DBB9EBB9FBBA0BBA1BBA2BBA3 -BBA5BBA6BBA7BBA9BBAABBABBBADBBAEBBAFBBB0BBB1BBB2BBB3BBB5BBB6BBB8 -BBB9BBBABBBBBBBCBBBDBBBEBBBFBBC1BBC2BBC3BBC5BBC6BBC7BBC9BBCABBCB -BBCCBBCDBBCEBBCFBBD1BBD2BBD4BBD5BBD6BBD7BBD8BBD9BBDABBDBBBDCBBDD -BBDEBBDFBBE0BBE1BBE2BBE3BBE4BBE5BBE6BBE7BBE8BBE9BBEABBEBBBECBBED -BBEEBBEFBBF0BBF1BBF2BBF3BBF4BBF5BBF6BBF7BBFABBFBBBFDBBFEBC010000 -93 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BC03BC04BC05BC06BC07BC0ABC0EBC10BC12BC13BC19BC1ABC20BC21BC22 -BC23BC26BC28BC2ABC2BBC2CBC2EBC2FBC32BC33BC3500000000000000000000 -0000BC36BC37BC39BC3ABC3BBC3CBC3DBC3EBC3FBC42BC46BC47BC48BC4ABC4B -BC4EBC4FBC51BC52BC53BC54BC55BC56BC57BC58BC5900000000000000000000 -0000BC5ABC5BBC5CBC5EBC5FBC60BC61BC62BC63BC64BC65BC66BC67BC68BC69 -BC6ABC6BBC6CBC6DBC6EBC6FBC70BC71BC72BC73BC74BC75BC76BC77BC78BC79 -BC7ABC7BBC7CBC7DBC7EBC7FBC80BC81BC82BC83BC86BC87BC89BC8ABC8DBC8F -BC90BC91BC92BC93BC96BC98BC9BBC9CBC9DBC9EBC9FBCA2BCA3BCA5BCA6BCA9 -BCAABCABBCACBCADBCAEBCAFBCB2BCB6BCB7BCB8BCB9BCBABCBBBCBEBCBFBCC1 -BCC2BCC3BCC5BCC6BCC7BCC8BCC9BCCABCCBBCCCBCCEBCD2BCD3BCD4BCD6BCD7 -BCD9BCDABCDBBCDDBCDEBCDFBCE0BCE1BCE2BCE3BCE4BCE5BCE6BCE7BCE8BCE9 -BCEABCEBBCECBCEDBCEEBCEFBCF0BCF1BCF2BCF3BCF7BCF9BCFABCFBBCFD0000 -94 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BCFEBCFFBD00BD01BD02BD03BD06BD08BD0ABD0BBD0CBD0DBD0EBD0FBD11 -BD12BD13BD15BD16BD17BD18BD19BD1ABD1BBD1CBD1D00000000000000000000 -0000BD1EBD1FBD20BD21BD22BD23BD25BD26BD27BD28BD29BD2ABD2BBD2DBD2E -BD2FBD30BD31BD32BD33BD34BD35BD36BD37BD38BD3900000000000000000000 -0000BD3ABD3BBD3CBD3DBD3EBD3FBD41BD42BD43BD44BD45BD46BD47BD4ABD4B -BD4DBD4EBD4FBD51BD52BD53BD54BD55BD56BD57BD5ABD5BBD5CBD5DBD5EBD5F -BD60BD61BD62BD63BD65BD66BD67BD69BD6ABD6BBD6CBD6DBD6EBD6FBD70BD71 -BD72BD73BD74BD75BD76BD77BD78BD79BD7ABD7BBD7CBD7DBD7EBD7FBD82BD83 -BD85BD86BD8BBD8CBD8DBD8EBD8FBD92BD94BD96BD97BD98BD9BBD9DBD9EBD9F -BDA0BDA1BDA2BDA3BDA5BDA6BDA7BDA8BDA9BDAABDABBDACBDADBDAEBDAFBDB1 -BDB2BDB3BDB4BDB5BDB6BDB7BDB9BDBABDBBBDBCBDBDBDBEBDBFBDC0BDC1BDC2 -BDC3BDC4BDC5BDC6BDC7BDC8BDC9BDCABDCBBDCCBDCDBDCEBDCFBDD0BDD10000 -95 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BDD2BDD3BDD6BDD7BDD9BDDABDDBBDDDBDDEBDDFBDE0BDE1BDE2BDE3BDE4 -BDE5BDE6BDE7BDE8BDEABDEBBDECBDEDBDEEBDEFBDF100000000000000000000 -0000BDF2BDF3BDF5BDF6BDF7BDF9BDFABDFBBDFCBDFDBDFEBDFFBE01BE02BE04 -BE06BE07BE08BE09BE0ABE0BBE0EBE0FBE11BE12BE1300000000000000000000 -0000BE15BE16BE17BE18BE19BE1ABE1BBE1EBE20BE21BE22BE23BE24BE25BE26 -BE27BE28BE29BE2ABE2BBE2CBE2DBE2EBE2FBE30BE31BE32BE33BE34BE35BE36 -BE37BE38BE39BE3ABE3BBE3CBE3DBE3EBE3FBE40BE41BE42BE43BE46BE47BE49 -BE4ABE4BBE4DBE4FBE50BE51BE52BE53BE56BE58BE5CBE5DBE5EBE5FBE62BE63 -BE65BE66BE67BE69BE6BBE6CBE6DBE6EBE6FBE72BE76BE77BE78BE79BE7ABE7E -BE7FBE81BE82BE83BE85BE86BE87BE88BE89BE8ABE8BBE8EBE92BE93BE94BE95 -BE96BE97BE9ABE9BBE9CBE9DBE9EBE9FBEA0BEA1BEA2BEA3BEA4BEA5BEA6BEA7 -BEA9BEAABEABBEACBEADBEAEBEAFBEB0BEB1BEB2BEB3BEB4BEB5BEB6BEB70000 -96 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BEB8BEB9BEBABEBBBEBCBEBDBEBEBEBFBEC0BEC1BEC2BEC3BEC4BEC5BEC6 -BEC7BEC8BEC9BECABECBBECCBECDBECEBECFBED2BED300000000000000000000 -0000BED5BED6BED9BEDABEDBBEDCBEDDBEDEBEDFBEE1BEE2BEE6BEE7BEE8BEE9 -BEEABEEBBEEDBEEEBEEFBEF0BEF1BEF2BEF3BEF4BEF500000000000000000000 -0000BEF6BEF7BEF8BEF9BEFABEFBBEFCBEFDBEFEBEFFBF00BF02BF03BF04BF05 -BF06BF07BF0ABF0BBF0CBF0DBF0EBF0FBF10BF11BF12BF13BF14BF15BF16BF17 -BF1ABF1EBF1FBF20BF21BF22BF23BF24BF25BF26BF27BF28BF29BF2ABF2BBF2C -BF2DBF2EBF2FBF30BF31BF32BF33BF34BF35BF36BF37BF38BF39BF3ABF3BBF3C -BF3DBF3EBF3FBF42BF43BF45BF46BF47BF49BF4ABF4BBF4CBF4DBF4EBF4FBF52 -BF53BF54BF56BF57BF58BF59BF5ABF5BBF5CBF5DBF5EBF5FBF60BF61BF62BF63 -BF64BF65BF66BF67BF68BF69BF6ABF6BBF6CBF6DBF6EBF6FBF70BF71BF72BF73 -BF74BF75BF76BF77BF78BF79BF7ABF7BBF7CBF7DBF7EBF7FBF80BF81BF820000 -97 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BF83BF84BF85BF86BF87BF88BF89BF8ABF8BBF8CBF8DBF8EBF8FBF90BF91 -BF92BF93BF95BF96BF97BF98BF99BF9ABF9BBF9CBF9D00000000000000000000 -0000BF9EBF9FBFA0BFA1BFA2BFA3BFA4BFA5BFA6BFA7BFA8BFA9BFAABFABBFAC -BFADBFAEBFAFBFB1BFB2BFB3BFB4BFB5BFB6BFB7BFB800000000000000000000 -0000BFB9BFBABFBBBFBCBFBDBFBEBFBFBFC0BFC1BFC2BFC3BFC4BFC6BFC7BFC8 -BFC9BFCABFCBBFCEBFCFBFD1BFD2BFD3BFD5BFD6BFD7BFD8BFD9BFDABFDBBFDD -BFDEBFE0BFE2BFE3BFE4BFE5BFE6BFE7BFE8BFE9BFEABFEBBFECBFEDBFEEBFEF -BFF0BFF1BFF2BFF3BFF4BFF5BFF6BFF7BFF8BFF9BFFABFFBBFFCBFFDBFFEBFFF -C000C001C002C003C004C005C006C007C008C009C00AC00BC00CC00DC00EC00F -C010C011C012C013C014C015C016C017C018C019C01AC01BC01CC01DC01EC01F -C020C021C022C023C024C025C026C027C028C029C02AC02BC02CC02DC02EC02F -C030C031C032C033C034C035C036C037C038C039C03AC03BC03DC03EC03F0000 -98 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C040C041C042C043C044C045C046C047C048C049C04AC04BC04CC04DC04E -C04FC050C052C053C054C055C056C057C059C05AC05B00000000000000000000 -0000C05DC05EC05FC061C062C063C064C065C066C067C06AC06BC06CC06DC06E -C06FC070C071C072C073C074C075C076C077C078C07900000000000000000000 -0000C07AC07BC07CC07DC07EC07FC080C081C082C083C084C085C086C087C088 -C089C08AC08BC08CC08DC08EC08FC092C093C095C096C097C099C09AC09BC09C -C09DC09EC09FC0A2C0A4C0A6C0A7C0A8C0A9C0AAC0ABC0AEC0B1C0B2C0B7C0B8 -C0B9C0BAC0BBC0BEC0C2C0C3C0C4C0C6C0C7C0CAC0CBC0CDC0CEC0CFC0D1C0D2 -C0D3C0D4C0D5C0D6C0D7C0DAC0DEC0DFC0E0C0E1C0E2C0E3C0E6C0E7C0E9C0EA -C0EBC0EDC0EEC0EFC0F0C0F1C0F2C0F3C0F6C0F8C0FAC0FBC0FCC0FDC0FEC0FF -C101C102C103C105C106C107C109C10AC10BC10CC10DC10EC10FC111C112C113 -C114C116C117C118C119C11AC11BC121C122C125C128C129C12AC12BC12E0000 -99 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C132C133C134C135C137C13AC13BC13DC13EC13FC141C142C143C144C145 -C146C147C14AC14EC14FC150C151C152C153C156C15700000000000000000000 -0000C159C15AC15BC15DC15EC15FC160C161C162C163C166C16AC16BC16CC16D -C16EC16FC171C172C173C175C176C177C179C17AC17B00000000000000000000 -0000C17CC17DC17EC17FC180C181C182C183C184C186C187C188C189C18AC18B -C18FC191C192C193C195C197C198C199C19AC19BC19EC1A0C1A2C1A3C1A4C1A6 -C1A7C1AAC1ABC1ADC1AEC1AFC1B1C1B2C1B3C1B4C1B5C1B6C1B7C1B8C1B9C1BA -C1BBC1BCC1BEC1BFC1C0C1C1C1C2C1C3C1C5C1C6C1C7C1C9C1CAC1CBC1CDC1CE -C1CFC1D0C1D1C1D2C1D3C1D5C1D6C1D9C1DAC1DBC1DCC1DDC1DEC1DFC1E1C1E2 -C1E3C1E5C1E6C1E7C1E9C1EAC1EBC1ECC1EDC1EEC1EFC1F2C1F4C1F5C1F6C1F7 -C1F8C1F9C1FAC1FBC1FEC1FFC201C202C203C205C206C207C208C209C20AC20B -C20EC210C212C213C214C215C216C217C21AC21BC21DC21EC221C222C2230000 -9A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C224C225C226C227C22AC22CC22EC230C233C235C236C237C238C239C23A -C23BC23CC23DC23EC23FC240C241C242C243C244C24500000000000000000000 -0000C246C247C249C24AC24BC24CC24DC24EC24FC252C253C255C256C257C259 -C25AC25BC25CC25DC25EC25FC261C262C263C264C26600000000000000000000 -0000C267C268C269C26AC26BC26EC26FC271C272C273C275C276C277C278C279 -C27AC27BC27EC280C282C283C284C285C286C287C28AC28BC28CC28DC28EC28F -C291C292C293C294C295C296C297C299C29AC29CC29EC29FC2A0C2A1C2A2C2A3 -C2A6C2A7C2A9C2AAC2ABC2AEC2AFC2B0C2B1C2B2C2B3C2B6C2B8C2BAC2BBC2BC -C2BDC2BEC2BFC2C0C2C1C2C2C2C3C2C4C2C5C2C6C2C7C2C8C2C9C2CAC2CBC2CC -C2CDC2CEC2CFC2D0C2D1C2D2C2D3C2D4C2D5C2D6C2D7C2D8C2D9C2DAC2DBC2DE -C2DFC2E1C2E2C2E5C2E6C2E7C2E8C2E9C2EAC2EEC2F0C2F2C2F3C2F4C2F5C2F7 -C2FAC2FDC2FEC2FFC301C302C303C304C305C306C307C30AC30BC30EC30F0000 -9B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C310C311C312C316C317C319C31AC31BC31DC31EC31FC320C321C322C323 -C326C327C32AC32BC32CC32DC32EC32FC330C331C33200000000000000000000 -0000C333C334C335C336C337C338C339C33AC33BC33CC33DC33EC33FC340C341 -C342C343C344C346C347C348C349C34AC34BC34CC34D00000000000000000000 -0000C34EC34FC350C351C352C353C354C355C356C357C358C359C35AC35BC35C -C35DC35EC35FC360C361C362C363C364C365C366C367C36AC36BC36DC36EC36F -C371C373C374C375C376C377C37AC37BC37EC37FC380C381C382C383C385C386 -C387C389C38AC38BC38DC38EC38FC390C391C392C393C394C395C396C397C398 -C399C39AC39BC39CC39DC39EC39FC3A0C3A1C3A2C3A3C3A4C3A5C3A6C3A7C3A8 -C3A9C3AAC3ABC3ACC3ADC3AEC3AFC3B0C3B1C3B2C3B3C3B4C3B5C3B6C3B7C3B8 -C3B9C3BAC3BBC3BCC3BDC3BEC3BFC3C1C3C2C3C3C3C4C3C5C3C6C3C7C3C8C3C9 -C3CAC3CBC3CCC3CDC3CEC3CFC3D0C3D1C3D2C3D3C3D4C3D5C3D6C3D7C3DA0000 -9C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C3DBC3DDC3DEC3E1C3E3C3E4C3E5C3E6C3E7C3EAC3EBC3ECC3EEC3EFC3F0 -C3F1C3F2C3F3C3F6C3F7C3F9C3FAC3FBC3FCC3FDC3FE00000000000000000000 -0000C3FFC400C401C402C403C404C405C406C407C409C40AC40BC40CC40DC40E -C40FC411C412C413C414C415C416C417C418C419C41A00000000000000000000 -0000C41BC41CC41DC41EC41FC420C421C422C423C425C426C427C428C429C42A -C42BC42DC42EC42FC431C432C433C435C436C437C438C439C43AC43BC43EC43F -C440C441C442C443C444C445C446C447C449C44AC44BC44CC44DC44EC44FC450 -C451C452C453C454C455C456C457C458C459C45AC45BC45CC45DC45EC45FC460 -C461C462C463C466C467C469C46AC46BC46DC46EC46FC470C471C472C473C476 -C477C478C47AC47BC47CC47DC47EC47FC481C482C483C484C485C486C487C488 -C489C48AC48BC48CC48DC48EC48FC490C491C492C493C495C496C497C498C499 -C49AC49BC49DC49EC49FC4A0C4A1C4A2C4A3C4A4C4A5C4A6C4A7C4A8C4A90000 -9D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C4AAC4ABC4ACC4ADC4AEC4AFC4B0C4B1C4B2C4B3C4B4C4B5C4B6C4B7C4B9 -C4BAC4BBC4BDC4BEC4BFC4C0C4C1C4C2C4C3C4C4C4C500000000000000000000 -0000C4C6C4C7C4C8C4C9C4CAC4CBC4CCC4CDC4CEC4CFC4D0C4D1C4D2C4D3C4D4 -C4D5C4D6C4D7C4D8C4D9C4DAC4DBC4DCC4DDC4DEC4DF00000000000000000000 -0000C4E0C4E1C4E2C4E3C4E4C4E5C4E6C4E7C4E8C4EAC4EBC4ECC4EDC4EEC4EF -C4F2C4F3C4F5C4F6C4F7C4F9C4FBC4FCC4FDC4FEC502C503C504C505C506C507 -C508C509C50AC50BC50DC50EC50FC511C512C513C515C516C517C518C519C51A -C51BC51DC51EC51FC520C521C522C523C524C525C526C527C52AC52BC52DC52E -C52FC531C532C533C534C535C536C537C53AC53CC53EC53FC540C541C542C543 -C546C547C54BC54FC550C551C552C556C55AC55BC55CC55FC562C563C565C566 -C567C569C56AC56BC56CC56DC56EC56FC572C576C577C578C579C57AC57BC57E -C57FC581C582C583C585C586C588C589C58AC58BC58EC590C592C593C5940000 -9E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C596C599C59AC59BC59DC59EC59FC5A1C5A2C5A3C5A4C5A5C5A6C5A7C5A8 -C5AAC5ABC5ACC5ADC5AEC5AFC5B0C5B1C5B2C5B3C5B600000000000000000000 -0000C5B7C5BAC5BFC5C0C5C1C5C2C5C3C5CBC5CDC5CFC5D2C5D3C5D5C5D6C5D7 -C5D9C5DAC5DBC5DCC5DDC5DEC5DFC5E2C5E4C5E6C5E700000000000000000000 -0000C5E8C5E9C5EAC5EBC5EFC5F1C5F2C5F3C5F5C5F8C5F9C5FAC5FBC602C603 -C604C609C60AC60BC60DC60EC60FC611C612C613C614C615C616C617C61AC61D -C61EC61FC620C621C622C623C626C627C629C62AC62BC62FC631C632C636C638 -C63AC63CC63DC63EC63FC642C643C645C646C647C649C64AC64BC64CC64DC64E -C64FC652C656C657C658C659C65AC65BC65EC65FC661C662C663C664C665C666 -C667C668C669C66AC66BC66DC66EC670C672C673C674C675C676C677C67AC67B -C67DC67EC67FC681C682C683C684C685C686C687C68AC68CC68EC68FC690C691 -C692C693C696C697C699C69AC69BC69DC69EC69FC6A0C6A1C6A2C6A3C6A60000 -9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C6A8C6AAC6ABC6ACC6ADC6AEC6AFC6B2C6B3C6B5C6B6C6B7C6BBC6BCC6BD -C6BEC6BFC6C2C6C4C6C6C6C7C6C8C6C9C6CAC6CBC6CE00000000000000000000 -0000C6CFC6D1C6D2C6D3C6D5C6D6C6D7C6D8C6D9C6DAC6DBC6DEC6DFC6E2C6E3 -C6E4C6E5C6E6C6E7C6EAC6EBC6EDC6EEC6EFC6F1C6F200000000000000000000 -0000C6F3C6F4C6F5C6F6C6F7C6FAC6FBC6FCC6FEC6FFC700C701C702C703C706 -C707C709C70AC70BC70DC70EC70FC710C711C712C713C716C718C71AC71BC71C -C71DC71EC71FC722C723C725C726C727C729C72AC72BC72CC72DC72EC72FC732 -C734C736C738C739C73AC73BC73EC73FC741C742C743C745C746C747C748C749 -C74BC74EC750C759C75AC75BC75DC75EC75FC761C762C763C764C765C766C767 -C769C76AC76CC76DC76EC76FC770C771C772C773C776C777C779C77AC77BC77F -C780C781C782C786C78BC78CC78DC78FC792C793C795C799C79BC79CC79DC79E -C79FC7A2C7A7C7A8C7A9C7AAC7ABC7AEC7AFC7B1C7B2C7B3C7B5C7B6C7B70000 -A0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C7B8C7B9C7BAC7BBC7BEC7C2C7C3C7C4C7C5C7C6C7C7C7CAC7CBC7CDC7CF -C7D1C7D2C7D3C7D4C7D5C7D6C7D7C7D9C7DAC7DBC7DC00000000000000000000 -0000C7DEC7DFC7E0C7E1C7E2C7E3C7E5C7E6C7E7C7E9C7EAC7EBC7EDC7EEC7EF -C7F0C7F1C7F2C7F3C7F4C7F5C7F6C7F7C7F8C7F9C7FA00000000000000000000 -0000C7FBC7FCC7FDC7FEC7FFC802C803C805C806C807C809C80BC80CC80DC80E -C80FC812C814C817C818C819C81AC81BC81EC81FC821C822C823C825C826C827 -C828C829C82AC82BC82EC830C832C833C834C835C836C837C839C83AC83BC83D -C83EC83FC841C842C843C844C845C846C847C84AC84BC84EC84FC850C851C852 -C853C855C856C857C858C859C85AC85BC85CC85DC85EC85FC860C861C862C863 -C864C865C866C867C868C869C86AC86BC86CC86DC86EC86FC872C873C875C876 -C877C879C87BC87CC87DC87EC87FC882C884C888C889C88AC88EC88FC890C891 -C892C893C895C896C897C898C899C89AC89BC89CC89EC8A0C8A2C8A3C8A40000 -A1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C8A5C8A6C8A7C8A9C8AAC8ABC8ACC8ADC8AEC8AFC8B0C8B1C8B2C8B3C8B4 -C8B5C8B6C8B7C8B8C8B9C8BAC8BBC8BEC8BFC8C0C8C100000000000000000000 -0000C8C2C8C3C8C5C8C6C8C7C8C9C8CAC8CBC8CDC8CEC8CFC8D0C8D1C8D2C8D3 -C8D6C8D8C8DAC8DBC8DCC8DDC8DEC8DFC8E2C8E3C8E500000000000000000000 -0000C8E6C8E7C8E8C8E9C8EAC8EBC8ECC8EDC8EEC8EFC8F0C8F1C8F2C8F3C8F4 -C8F6C8F7C8F8C8F9C8FAC8FBC8FEC8FFC901C902C903C907C908C909C90AC90B -C90E30003001300200B72025202600A8300300AD20152225FF3C223C20182019 -201C201D3014301530083009300A300B300C300D300E300F3010301100B100D7 -00F7226022642265221E223400B0203220332103212BFFE0FFE1FFE526422640 -222022A52312220222072261225200A7203B2606260525CB25CF25CE25C725C6 -25A125A025B325B225BD25BC219221902191219321943013226A226B221A223D -221D2235222B222C2208220B2286228722822283222A222922272228FFE20000 -A2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C910C912C913C914C915C916C917C919C91AC91BC91CC91DC91EC91FC920 -C921C922C923C924C925C926C927C928C929C92AC92B00000000000000000000 -0000C92DC92EC92FC930C931C932C933C935C936C937C938C939C93AC93BC93C -C93DC93EC93FC940C941C942C943C944C945C946C94700000000000000000000 -0000C948C949C94AC94BC94CC94DC94EC94FC952C953C955C956C957C959C95A -C95BC95CC95DC95EC95FC962C964C965C966C967C968C969C96AC96BC96DC96E -C96F21D221D42200220300B4FF5E02C702D802DD02DA02D900B802DB00A100BF -02D0222E2211220F00A42109203025C125C025B725B626642660266126652667 -2663229925C825A325D025D1259225A425A525A825A725A625A92668260F260E -261C261E00B62020202121952197219921962198266D2669266A266C327F321C -211633C7212233C233D821210000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C971C972C973C975C976C977C978C979C97AC97BC97DC97EC97FC980C981 -C982C983C984C985C986C987C98AC98BC98DC98EC98F00000000000000000000 -0000C991C992C993C994C995C996C997C99AC99CC99EC99FC9A0C9A1C9A2C9A3 -C9A4C9A5C9A6C9A7C9A8C9A9C9AAC9ABC9ACC9ADC9AE00000000000000000000 -0000C9AFC9B0C9B1C9B2C9B3C9B4C9B5C9B6C9B7C9B8C9B9C9BAC9BBC9BCC9BD -C9BEC9BFC9C2C9C3C9C5C9C6C9C9C9CBC9CCC9CDC9CEC9CFC9D2C9D4C9D7C9D8 -C9DBFF01FF02FF03FF04FF05FF06FF07FF08FF09FF0AFF0BFF0CFF0DFF0EFF0F -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19FF1AFF1BFF1CFF1DFF1EFF1F -FF20FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF3BFFE6FF3DFF3EFF3F -FF40FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5AFF5BFF5CFF5DFFE30000 -A4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C9DEC9DFC9E1C9E3C9E5C9E6C9E8C9E9C9EAC9EBC9EEC9F2C9F3C9F4C9F5 -C9F6C9F7C9FAC9FBC9FDC9FEC9FFCA01CA02CA03CA0400000000000000000000 -0000CA05CA06CA07CA0ACA0ECA0FCA10CA11CA12CA13CA15CA16CA17CA19CA1A -CA1BCA1CCA1DCA1ECA1FCA20CA21CA22CA23CA24CA2500000000000000000000 -0000CA26CA27CA28CA2ACA2BCA2CCA2DCA2ECA2FCA30CA31CA32CA33CA34CA35 -CA36CA37CA38CA39CA3ACA3BCA3CCA3DCA3ECA3FCA40CA41CA42CA43CA44CA45 -CA46313131323133313431353136313731383139313A313B313C313D313E313F -3140314131423143314431453146314731483149314A314B314C314D314E314F -3150315131523153315431553156315731583159315A315B315C315D315E315F -3160316131623163316431653166316731683169316A316B316C316D316E316F -3170317131723173317431753176317731783179317A317B317C317D317E317F -3180318131823183318431853186318731883189318A318B318C318D318E0000 -A5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CA47CA48CA49CA4ACA4BCA4ECA4FCA51CA52CA53CA55CA56CA57CA58CA59 -CA5ACA5BCA5ECA62CA63CA64CA65CA66CA67CA69CA6A00000000000000000000 -0000CA6BCA6CCA6DCA6ECA6FCA70CA71CA72CA73CA74CA75CA76CA77CA78CA79 -CA7ACA7BCA7CCA7ECA7FCA80CA81CA82CA83CA85CA8600000000000000000000 -0000CA87CA88CA89CA8ACA8BCA8CCA8DCA8ECA8FCA90CA91CA92CA93CA94CA95 -CA96CA97CA99CA9ACA9BCA9CCA9DCA9ECA9FCAA0CAA1CAA2CAA3CAA4CAA5CAA6 -CAA7217021712172217321742175217621772178217900000000000000000000 -2160216121622163216421652166216721682169000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -A6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CAA8CAA9CAAACAABCAACCAADCAAECAAFCAB0CAB1CAB2CAB3CAB4CAB5CAB6 -CAB7CAB8CAB9CABACABBCABECABFCAC1CAC2CAC3CAC500000000000000000000 -0000CAC6CAC7CAC8CAC9CACACACBCACECAD0CAD2CAD4CAD5CAD6CAD7CADACADB -CADCCADDCADECADFCAE1CAE2CAE3CAE4CAE5CAE6CAE700000000000000000000 -0000CAE8CAE9CAEACAEBCAEDCAEECAEFCAF0CAF1CAF2CAF3CAF5CAF6CAF7CAF8 -CAF9CAFACAFBCAFCCAFDCAFECAFFCB00CB01CB02CB03CB04CB05CB06CB07CB09 -CB0A25002502250C251025182514251C252C25242534253C25012503250F2513 -251B251725232533252B253B254B2520252F25282537253F251D253025252538 -254225122511251A251925162515250E250D251E251F25212522252625272529 -252A252D252E25312532253525362539253A253D253E25402541254325442545 -2546254725482549254A00000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CB0BCB0CCB0DCB0ECB0FCB11CB12CB13CB15CB16CB17CB19CB1ACB1BCB1C -CB1DCB1ECB1FCB22CB23CB24CB25CB26CB27CB28CB2900000000000000000000 -0000CB2ACB2BCB2CCB2DCB2ECB2FCB30CB31CB32CB33CB34CB35CB36CB37CB38 -CB39CB3ACB3BCB3CCB3DCB3ECB3FCB40CB42CB43CB4400000000000000000000 -0000CB45CB46CB47CB4ACB4BCB4DCB4ECB4FCB51CB52CB53CB54CB55CB56CB57 -CB5ACB5BCB5CCB5ECB5FCB60CB61CB62CB63CB65CB66CB67CB68CB69CB6ACB6B -CB6C3395339633972113339833C433A333A433A533A63399339A339B339C339D -339E339F33A033A133A233CA338D338E338F33CF3388338933C833A733A833B0 -33B133B233B333B433B533B633B733B833B93380338133823383338433BA33BB -33BC33BD33BE33BF33903391339233933394212633C033C1338A338B338C33D6 -33C533AD33AE33AF33DB33A933AA33AB33AC33DD33D033D333C333C933DC33C6 -0000000000000000000000000000000000000000000000000000000000000000 -A8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CB6DCB6ECB6FCB70CB71CB72CB73CB74CB75CB76CB77CB7ACB7BCB7CCB7D -CB7ECB7FCB80CB81CB82CB83CB84CB85CB86CB87CB8800000000000000000000 -0000CB89CB8ACB8BCB8CCB8DCB8ECB8FCB90CB91CB92CB93CB94CB95CB96CB97 -CB98CB99CB9ACB9BCB9DCB9ECB9FCBA0CBA1CBA2CBA300000000000000000000 -0000CBA4CBA5CBA6CBA7CBA8CBA9CBAACBABCBACCBADCBAECBAFCBB0CBB1CBB2 -CBB3CBB4CBB5CBB6CBB7CBB9CBBACBBBCBBCCBBDCBBECBBFCBC0CBC1CBC2CBC3 -CBC400C600D000AA0126000001320000013F014100D8015200BA00DE0166014A -00003260326132623263326432653266326732683269326A326B326C326D326E -326F3270327132723273327432753276327732783279327A327B24D024D124D2 -24D324D424D524D624D724D824D924DA24DB24DC24DD24DE24DF24E024E124E2 -24E324E424E524E624E724E824E9246024612462246324642465246624672468 -2469246A246B246C246D246E00BD2153215400BC00BE215B215C215D215E0000 -A9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CBC5CBC6CBC7CBC8CBC9CBCACBCBCBCCCBCDCBCECBCFCBD0CBD1CBD2CBD3 -CBD5CBD6CBD7CBD8CBD9CBDACBDBCBDCCBDDCBDECBDF00000000000000000000 -0000CBE0CBE1CBE2CBE3CBE5CBE6CBE8CBEACBEBCBECCBEDCBEECBEFCBF0CBF1 -CBF2CBF3CBF4CBF5CBF6CBF7CBF8CBF9CBFACBFBCBFC00000000000000000000 -0000CBFDCBFECBFFCC00CC01CC02CC03CC04CC05CC06CC07CC08CC09CC0ACC0B -CC0ECC0FCC11CC12CC13CC15CC16CC17CC18CC19CC1ACC1BCC1ECC1FCC20CC23 -CC2400E6011100F001270131013301380140014200F8015300DF00FE0167014B -01493200320132023203320432053206320732083209320A320B320C320D320E -320F3210321132123213321432153216321732183219321A321B249C249D249E -249F24A024A124A224A324A424A524A624A724A824A924AA24AB24AC24AD24AE -24AF24B024B124B224B324B424B5247424752476247724782479247A247B247C -247D247E247F24802481248200B900B200B32074207F20812082208320840000 -AA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CC25CC26CC2ACC2BCC2DCC2FCC31CC32CC33CC34CC35CC36CC37CC3ACC3F -CC40CC41CC42CC43CC46CC47CC49CC4ACC4BCC4DCC4E00000000000000000000 -0000CC4FCC50CC51CC52CC53CC56CC5ACC5BCC5CCC5DCC5ECC5FCC61CC62CC63 -CC65CC67CC69CC6ACC6BCC6CCC6DCC6ECC6FCC71CC7200000000000000000000 -0000CC73CC74CC76CC77CC78CC79CC7ACC7BCC7CCC7DCC7ECC7FCC80CC81CC82 -CC83CC84CC85CC86CC87CC88CC89CC8ACC8BCC8CCC8DCC8ECC8FCC90CC91CC92 -CC93304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -AB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CC94CC95CC96CC97CC9ACC9BCC9DCC9ECC9FCCA1CCA2CCA3CCA4CCA5CCA6 -CCA7CCAACCAECCAFCCB0CCB1CCB2CCB3CCB6CCB7CCB900000000000000000000 -0000CCBACCBBCCBDCCBECCBFCCC0CCC1CCC2CCC3CCC6CCC8CCCACCCBCCCCCCCD -CCCECCCFCCD1CCD2CCD3CCD5CCD6CCD7CCD8CCD9CCDA00000000000000000000 -0000CCDBCCDCCCDDCCDECCDFCCE0CCE1CCE2CCE3CCE5CCE6CCE7CCE8CCE9CCEA -CCEBCCEDCCEECCEFCCF1CCF2CCF3CCF4CCF5CCF6CCF7CCF8CCF9CCFACCFBCCFC -CCFD30A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -AC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CCFECCFFCD00CD02CD03CD04CD05CD06CD07CD0ACD0BCD0DCD0ECD0FCD11 -CD12CD13CD14CD15CD16CD17CD1ACD1CCD1ECD1FCD2000000000000000000000 -0000CD21CD22CD23CD25CD26CD27CD29CD2ACD2BCD2DCD2ECD2FCD30CD31CD32 -CD33CD34CD35CD36CD37CD38CD3ACD3BCD3CCD3DCD3E00000000000000000000 -0000CD3FCD40CD41CD42CD43CD44CD45CD46CD47CD48CD49CD4ACD4BCD4CCD4D -CD4ECD4FCD50CD51CD52CD53CD54CD55CD56CD57CD58CD59CD5ACD5BCD5DCD5E -CD5F04100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -AD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CD61CD62CD63CD65CD66CD67CD68CD69CD6ACD6BCD6ECD70CD72CD73CD74 -CD75CD76CD77CD79CD7ACD7BCD7CCD7DCD7ECD7FCD8000000000000000000000 -0000CD81CD82CD83CD84CD85CD86CD87CD89CD8ACD8BCD8CCD8DCD8ECD8FCD90 -CD91CD92CD93CD96CD97CD99CD9ACD9BCD9DCD9ECD9F00000000000000000000 -0000CDA0CDA1CDA2CDA3CDA6CDA8CDAACDABCDACCDADCDAECDAFCDB1CDB2CDB3 -CDB4CDB5CDB6CDB7CDB8CDB9CDBACDBBCDBCCDBDCDBECDBFCDC0CDC1CDC2CDC3 -CDC5000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -AE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CDC6CDC7CDC8CDC9CDCACDCBCDCDCDCECDCFCDD1CDD2CDD3CDD4CDD5CDD6 -CDD7CDD8CDD9CDDACDDBCDDCCDDDCDDECDDFCDE0CDE100000000000000000000 -0000CDE2CDE3CDE4CDE5CDE6CDE7CDE9CDEACDEBCDEDCDEECDEFCDF1CDF2CDF3 -CDF4CDF5CDF6CDF7CDFACDFCCDFECDFFCE00CE01CE0200000000000000000000 -0000CE03CE05CE06CE07CE09CE0ACE0BCE0DCE0ECE0FCE10CE11CE12CE13CE15 -CE16CE17CE18CE1ACE1BCE1CCE1DCE1ECE1FCE22CE23CE25CE26CE27CE29CE2A -CE2B000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -AF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CE2CCE2DCE2ECE2FCE32CE34CE36CE37CE38CE39CE3ACE3BCE3CCE3DCE3E -CE3FCE40CE41CE42CE43CE44CE45CE46CE47CE48CE4900000000000000000000 -0000CE4ACE4BCE4CCE4DCE4ECE4FCE50CE51CE52CE53CE54CE55CE56CE57CE5A -CE5BCE5DCE5ECE62CE63CE64CE65CE66CE67CE6ACE6C00000000000000000000 -0000CE6ECE6FCE70CE71CE72CE73CE76CE77CE79CE7ACE7BCE7DCE7ECE7FCE80 -CE81CE82CE83CE86CE88CE8ACE8BCE8CCE8DCE8ECE8FCE92CE93CE95CE96CE97 -CE99000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -B0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CE9ACE9BCE9CCE9DCE9ECE9FCEA2CEA6CEA7CEA8CEA9CEAACEABCEAECEAF -CEB0CEB1CEB2CEB3CEB4CEB5CEB6CEB7CEB8CEB9CEBA00000000000000000000 -0000CEBBCEBCCEBDCEBECEBFCEC0CEC2CEC3CEC4CEC5CEC6CEC7CEC8CEC9CECA -CECBCECCCECDCECECECFCED0CED1CED2CED3CED4CED500000000000000000000 -0000CED6CED7CED8CED9CEDACEDBCEDCCEDDCEDECEDFCEE0CEE1CEE2CEE3CEE6 -CEE7CEE9CEEACEEDCEEECEEFCEF0CEF1CEF2CEF3CEF6CEFACEFBCEFCCEFDCEFE -CEFFAC00AC01AC04AC07AC08AC09AC0AAC10AC11AC12AC13AC14AC15AC16AC17 -AC19AC1AAC1BAC1CAC1DAC20AC24AC2CAC2DAC2FAC30AC31AC38AC39AC3CAC40 -AC4BAC4DAC54AC58AC5CAC70AC71AC74AC77AC78AC7AAC80AC81AC83AC84AC85 -AC86AC89AC8AAC8BAC8CAC90AC94AC9CAC9DAC9FACA0ACA1ACA8ACA9ACAAACAC -ACAFACB0ACB8ACB9ACBBACBCACBDACC1ACC4ACC8ACCCACD5ACD7ACE0ACE1ACE4 -ACE7ACE8ACEAACECACEFACF0ACF1ACF3ACF5ACF6ACFCACFDAD00AD04AD060000 -B1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CF02CF03CF05CF06CF07CF09CF0ACF0BCF0CCF0DCF0ECF0FCF12CF14CF16 -CF17CF18CF19CF1ACF1BCF1DCF1ECF1FCF21CF22CF2300000000000000000000 -0000CF25CF26CF27CF28CF29CF2ACF2BCF2ECF32CF33CF34CF35CF36CF37CF39 -CF3ACF3BCF3CCF3DCF3ECF3FCF40CF41CF42CF43CF4400000000000000000000 -0000CF45CF46CF47CF48CF49CF4ACF4BCF4CCF4DCF4ECF4FCF50CF51CF52CF53 -CF56CF57CF59CF5ACF5BCF5DCF5ECF5FCF60CF61CF62CF63CF66CF68CF6ACF6B -CF6CAD0CAD0DAD0FAD11AD18AD1CAD20AD29AD2CAD2DAD34AD35AD38AD3CAD44 -AD45AD47AD49AD50AD54AD58AD61AD63AD6CAD6DAD70AD73AD74AD75AD76AD7B -AD7CAD7DAD7FAD81AD82AD88AD89AD8CAD90AD9CAD9DADA4ADB7ADC0ADC1ADC4 -ADC8ADD0ADD1ADD3ADDCADE0ADE4ADF8ADF9ADFCADFFAE00AE01AE08AE09AE0B -AE0DAE14AE30AE31AE34AE37AE38AE3AAE40AE41AE43AE45AE46AE4AAE4CAE4D -AE4EAE50AE54AE56AE5CAE5DAE5FAE60AE61AE65AE68AE69AE6CAE70AE780000 -B2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CF6DCF6ECF6FCF72CF73CF75CF76CF77CF79CF7ACF7BCF7CCF7DCF7ECF7F -CF81CF82CF83CF84CF86CF87CF88CF89CF8ACF8BCF8D00000000000000000000 -0000CF8ECF8FCF90CF91CF92CF93CF94CF95CF96CF97CF98CF99CF9ACF9BCF9C -CF9DCF9ECF9FCFA0CFA2CFA3CFA4CFA5CFA6CFA7CFA900000000000000000000 -0000CFAACFABCFACCFADCFAECFAFCFB1CFB2CFB3CFB4CFB5CFB6CFB7CFB8CFB9 -CFBACFBBCFBCCFBDCFBECFBFCFC0CFC1CFC2CFC3CFC5CFC6CFC7CFC8CFC9CFCA -CFCBAE79AE7BAE7CAE7DAE84AE85AE8CAEBCAEBDAEBEAEC0AEC4AECCAECDAECF -AED0AED1AED8AED9AEDCAEE8AEEBAEEDAEF4AEF8AEFCAF07AF08AF0DAF10AF2C -AF2DAF30AF32AF34AF3CAF3DAF3FAF41AF42AF43AF48AF49AF50AF5CAF5DAF64 -AF65AF79AF80AF84AF88AF90AF91AF95AF9CAFB8AFB9AFBCAFC0AFC7AFC8AFC9 -AFCBAFCDAFCEAFD4AFDCAFE8AFE9AFF0AFF1AFF4AFF8B000B001B004B00CB010 -B014B01CB01DB028B044B045B048B04AB04CB04EB053B054B055B057B0590000 -B3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CFCCCFCDCFCECFCFCFD0CFD1CFD2CFD3CFD4CFD5CFD6CFD7CFD8CFD9CFDA -CFDBCFDCCFDDCFDECFDFCFE2CFE3CFE5CFE6CFE7CFE900000000000000000000 -0000CFEACFEBCFECCFEDCFEECFEFCFF2CFF4CFF6CFF7CFF8CFF9CFFACFFBCFFD -CFFECFFFD001D002D003D005D006D007D008D009D00A00000000000000000000 -0000D00BD00CD00DD00ED00FD010D012D013D014D015D016D017D019D01AD01B -D01CD01DD01ED01FD020D021D022D023D024D025D026D027D028D029D02AD02B -D02CB05DB07CB07DB080B084B08CB08DB08FB091B098B099B09AB09CB09FB0A0 -B0A1B0A2B0A8B0A9B0ABB0ACB0ADB0AEB0AFB0B1B0B3B0B4B0B5B0B8B0BCB0C4 -B0C5B0C7B0C8B0C9B0D0B0D1B0D4B0D8B0E0B0E5B108B109B10BB10CB110B112 -B113B118B119B11BB11CB11DB123B124B125B128B12CB134B135B137B138B139 -B140B141B144B148B150B151B154B155B158B15CB160B178B179B17CB180B182 -B188B189B18BB18DB192B193B194B198B19CB1A8B1CCB1D0B1D4B1DCB1DD0000 -B4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D02ED02FD030D031D032D033D036D037D039D03AD03BD03DD03ED03FD040 -D041D042D043D046D048D04AD04BD04CD04DD04ED04F00000000000000000000 -0000D051D052D053D055D056D057D059D05AD05BD05CD05DD05ED05FD061D062 -D063D064D065D066D067D068D069D06AD06BD06ED06F00000000000000000000 -0000D071D072D073D075D076D077D078D079D07AD07BD07ED07FD080D082D083 -D084D085D086D087D088D089D08AD08BD08CD08DD08ED08FD090D091D092D093 -D094B1DFB1E8B1E9B1ECB1F0B1F9B1FBB1FDB204B205B208B20BB20CB214B215 -B217B219B220B234B23CB258B25CB260B268B269B274B275B27CB284B285B289 -B290B291B294B298B299B29AB2A0B2A1B2A3B2A5B2A6B2AAB2ACB2B0B2B4B2C8 -B2C9B2CCB2D0B2D2B2D8B2D9B2DBB2DDB2E2B2E4B2E5B2E6B2E8B2EBB2ECB2ED -B2EEB2EFB2F3B2F4B2F5B2F7B2F8B2F9B2FAB2FBB2FFB300B301B304B308B310 -B311B313B314B315B31CB354B355B356B358B35BB35CB35EB35FB364B3650000 -B5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D095D096D097D098D099D09AD09BD09CD09DD09ED09FD0A0D0A1D0A2D0A3 -D0A6D0A7D0A9D0AAD0ABD0ADD0AED0AFD0B0D0B1D0B200000000000000000000 -0000D0B3D0B6D0B8D0BAD0BBD0BCD0BDD0BED0BFD0C2D0C3D0C5D0C6D0C7D0CA -D0CBD0CCD0CDD0CED0CFD0D2D0D6D0D7D0D8D0D9D0DA00000000000000000000 -0000D0DBD0DED0DFD0E1D0E2D0E3D0E5D0E6D0E7D0E8D0E9D0EAD0EBD0EED0F2 -D0F3D0F4D0F5D0F6D0F7D0F9D0FAD0FBD0FCD0FDD0FED0FFD100D101D102D103 -D104B367B369B36BB36EB370B371B374B378B380B381B383B384B385B38CB390 -B394B3A0B3A1B3A8B3ACB3C4B3C5B3C8B3CBB3CCB3CEB3D0B3D4B3D5B3D7B3D9 -B3DBB3DDB3E0B3E4B3E8B3FCB410B418B41CB420B428B429B42BB434B450B451 -B454B458B460B461B463B465B46CB480B488B49DB4A4B4A8B4ACB4B5B4B7B4B9 -B4C0B4C4B4C8B4D0B4D5B4DCB4DDB4E0B4E3B4E4B4E6B4ECB4EDB4EFB4F1B4F8 -B514B515B518B51BB51CB524B525B527B528B529B52AB530B531B534B5380000 -B6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D105D106D107D108D109D10AD10BD10CD10ED10FD110D111D112D113D114 -D115D116D117D118D119D11AD11BD11CD11DD11ED11F00000000000000000000 -0000D120D121D122D123D124D125D126D127D128D129D12AD12BD12CD12DD12E -D12FD132D133D135D136D137D139D13BD13CD13DD13E00000000000000000000 -0000D13FD142D146D147D148D149D14AD14BD14ED14FD151D152D153D155D156 -D157D158D159D15AD15BD15ED160D162D163D164D165D166D167D169D16AD16B -D16DB540B541B543B544B545B54BB54CB54DB550B554B55CB55DB55FB560B561 -B5A0B5A1B5A4B5A8B5AAB5ABB5B0B5B1B5B3B5B4B5B5B5BBB5BCB5BDB5C0B5C4 -B5CCB5CDB5CFB5D0B5D1B5D8B5ECB610B611B614B618B625B62CB634B648B664 -B668B69CB69DB6A0B6A4B6ABB6ACB6B1B6D4B6F0B6F4B6F8B700B701B705B728 -B729B72CB72FB730B738B739B73BB744B748B74CB754B755B760B764B768B770 -B771B773B775B77CB77DB780B784B78CB78DB78FB790B791B792B796B7970000 -B7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D16ED16FD170D171D172D173D174D175D176D177D178D179D17AD17BD17D -D17ED17FD180D181D182D183D185D186D187D189D18A00000000000000000000 -0000D18BD18CD18DD18ED18FD190D191D192D193D194D195D196D197D198D199 -D19AD19BD19CD19DD19ED19FD1A2D1A3D1A5D1A6D1A700000000000000000000 -0000D1A9D1AAD1ABD1ACD1ADD1AED1AFD1B2D1B4D1B6D1B7D1B8D1B9D1BBD1BD -D1BED1BFD1C1D1C2D1C3D1C4D1C5D1C6D1C7D1C8D1C9D1CAD1CBD1CCD1CDD1CE -D1CFB798B799B79CB7A0B7A8B7A9B7ABB7ACB7ADB7B4B7B5B7B8B7C7B7C9B7EC -B7EDB7F0B7F4B7FCB7FDB7FFB800B801B807B808B809B80CB810B818B819B81B -B81DB824B825B828B82CB834B835B837B838B839B840B844B851B853B85CB85D -B860B864B86CB86DB86FB871B878B87CB88DB8A8B8B0B8B4B8B8B8C0B8C1B8C3 -B8C5B8CCB8D0B8D4B8DDB8DFB8E1B8E8B8E9B8ECB8F0B8F8B8F9B8FBB8FDB904 -B918B920B93CB93DB940B944B94CB94FB951B958B959B95CB960B968B9690000 -B8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D1D0D1D1D1D2D1D3D1D4D1D5D1D6D1D7D1D9D1DAD1DBD1DCD1DDD1DED1DF -D1E0D1E1D1E2D1E3D1E4D1E5D1E6D1E7D1E8D1E9D1EA00000000000000000000 -0000D1EBD1ECD1EDD1EED1EFD1F0D1F1D1F2D1F3D1F5D1F6D1F7D1F9D1FAD1FB -D1FCD1FDD1FED1FFD200D201D202D203D204D205D20600000000000000000000 -0000D208D20AD20BD20CD20DD20ED20FD211D212D213D214D215D216D217D218 -D219D21AD21BD21CD21DD21ED21FD220D221D222D223D224D225D226D227D228 -D229B96BB96DB974B975B978B97CB984B985B987B989B98AB98DB98EB9ACB9AD -B9B0B9B4B9BCB9BDB9BFB9C1B9C8B9C9B9CCB9CEB9CFB9D0B9D1B9D2B9D8B9D9 -B9DBB9DDB9DEB9E1B9E3B9E4B9E5B9E8B9ECB9F4B9F5B9F7B9F8B9F9B9FABA00 -BA01BA08BA15BA38BA39BA3CBA40BA42BA48BA49BA4BBA4DBA4EBA53BA54BA55 -BA58BA5CBA64BA65BA67BA68BA69BA70BA71BA74BA78BA83BA84BA85BA87BA8C -BAA8BAA9BAABBAACBAB0BAB2BAB8BAB9BABBBABDBAC4BAC8BAD8BAD9BAFC0000 -B9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D22AD22BD22ED22FD231D232D233D235D236D237D238D239D23AD23BD23E -D240D242D243D244D245D246D247D249D24AD24BD24C00000000000000000000 -0000D24DD24ED24FD250D251D252D253D254D255D256D257D258D259D25AD25B -D25DD25ED25FD260D261D262D263D265D266D267D26800000000000000000000 -0000D269D26AD26BD26CD26DD26ED26FD270D271D272D273D274D275D276D277 -D278D279D27AD27BD27CD27DD27ED27FD282D283D285D286D287D289D28AD28B -D28CBB00BB04BB0DBB0FBB11BB18BB1CBB20BB29BB2BBB34BB35BB36BB38BB3B -BB3CBB3DBB3EBB44BB45BB47BB49BB4DBB4FBB50BB54BB58BB61BB63BB6CBB88 -BB8CBB90BBA4BBA8BBACBBB4BBB7BBC0BBC4BBC8BBD0BBD3BBF8BBF9BBFCBBFF -BC00BC02BC08BC09BC0BBC0CBC0DBC0FBC11BC14BC15BC16BC17BC18BC1BBC1C -BC1DBC1EBC1FBC24BC25BC27BC29BC2DBC30BC31BC34BC38BC40BC41BC43BC44 -BC45BC49BC4CBC4DBC50BC5DBC84BC85BC88BC8BBC8CBC8EBC94BC95BC970000 -BA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D28DD28ED28FD292D293D294D296D297D298D299D29AD29BD29DD29ED29F -D2A1D2A2D2A3D2A5D2A6D2A7D2A8D2A9D2AAD2ABD2AD00000000000000000000 -0000D2AED2AFD2B0D2B2D2B3D2B4D2B5D2B6D2B7D2BAD2BBD2BDD2BED2C1D2C3 -D2C4D2C5D2C6D2C7D2CAD2CCD2CDD2CED2CFD2D0D2D100000000000000000000 -0000D2D2D2D3D2D5D2D6D2D7D2D9D2DAD2DBD2DDD2DED2DFD2E0D2E1D2E2D2E3 -D2E6D2E7D2E8D2E9D2EAD2EBD2ECD2EDD2EED2EFD2F2D2F3D2F5D2F6D2F7D2F9 -D2FABC99BC9ABCA0BCA1BCA4BCA7BCA8BCB0BCB1BCB3BCB4BCB5BCBCBCBDBCC0 -BCC4BCCDBCCFBCD0BCD1BCD5BCD8BCDCBCF4BCF5BCF6BCF8BCFCBD04BD05BD07 -BD09BD10BD14BD24BD2CBD40BD48BD49BD4CBD50BD58BD59BD64BD68BD80BD81 -BD84BD87BD88BD89BD8ABD90BD91BD93BD95BD99BD9ABD9CBDA4BDB0BDB8BDD4 -BDD5BDD8BDDCBDE9BDF0BDF4BDF8BE00BE03BE05BE0CBE0DBE10BE14BE1CBE1D -BE1FBE44BE45BE48BE4CBE4EBE54BE55BE57BE59BE5ABE5BBE60BE61BE640000 -BB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D2FBD2FCD2FDD2FED2FFD302D304D306D307D308D309D30AD30BD30FD311 -D312D313D315D317D318D319D31AD31BD31ED322D32300000000000000000000 -0000D324D326D327D32AD32BD32DD32ED32FD331D332D333D334D335D336D337 -D33AD33ED33FD340D341D342D343D346D347D348D34900000000000000000000 -0000D34AD34BD34CD34DD34ED34FD350D351D352D353D354D355D356D357D358 -D359D35AD35BD35CD35DD35ED35FD360D361D362D363D364D365D366D367D368 -D369BE68BE6ABE70BE71BE73BE74BE75BE7BBE7CBE7DBE80BE84BE8CBE8DBE8F -BE90BE91BE98BE99BEA8BED0BED1BED4BED7BED8BEE0BEE3BEE4BEE5BEECBF01 -BF08BF09BF18BF19BF1BBF1CBF1DBF40BF41BF44BF48BF50BF51BF55BF94BFB0 -BFC5BFCCBFCDBFD0BFD4BFDCBFDFBFE1C03CC051C058C05CC060C068C069C090 -C091C094C098C0A0C0A1C0A3C0A5C0ACC0ADC0AFC0B0C0B3C0B4C0B5C0B6C0BC -C0BDC0BFC0C0C0C1C0C5C0C8C0C9C0CCC0D0C0D8C0D9C0DBC0DCC0DDC0E40000 -BC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D36AD36BD36CD36DD36ED36FD370D371D372D373D374D375D376D377D378 -D379D37AD37BD37ED37FD381D382D383D385D386D38700000000000000000000 -0000D388D389D38AD38BD38ED392D393D394D395D396D397D39AD39BD39DD39E -D39FD3A1D3A2D3A3D3A4D3A5D3A6D3A7D3AAD3ACD3AE00000000000000000000 -0000D3AFD3B0D3B1D3B2D3B3D3B5D3B6D3B7D3B9D3BAD3BBD3BDD3BED3BFD3C0 -D3C1D3C2D3C3D3C6D3C7D3CAD3CBD3CCD3CDD3CED3CFD3D1D3D2D3D3D3D4D3D5 -D3D6C0E5C0E8C0ECC0F4C0F5C0F7C0F9C100C104C108C110C115C11CC11DC11E -C11FC120C123C124C126C127C12CC12DC12FC130C131C136C138C139C13CC140 -C148C149C14BC14CC14DC154C155C158C15CC164C165C167C168C169C170C174 -C178C185C18CC18DC18EC190C194C196C19CC19DC19FC1A1C1A5C1A8C1A9C1AC -C1B0C1BDC1C4C1C8C1CCC1D4C1D7C1D8C1E0C1E4C1E8C1F0C1F1C1F3C1FCC1FD -C200C204C20CC20DC20FC211C218C219C21CC21FC220C228C229C22BC22D0000 -BD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D3D7D3D9D3DAD3DBD3DCD3DDD3DED3DFD3E0D3E2D3E4D3E5D3E6D3E7D3E8 -D3E9D3EAD3EBD3EED3EFD3F1D3F2D3F3D3F5D3F6D3F700000000000000000000 -0000D3F8D3F9D3FAD3FBD3FED400D402D403D404D405D406D407D409D40AD40B -D40CD40DD40ED40FD410D411D412D413D414D415D41600000000000000000000 -0000D417D418D419D41AD41BD41CD41ED41FD420D421D422D423D424D425D426 -D427D428D429D42AD42BD42CD42DD42ED42FD430D431D432D433D434D435D436 -D437C22FC231C232C234C248C250C251C254C258C260C265C26CC26DC270C274 -C27CC27DC27FC281C288C289C290C298C29BC29DC2A4C2A5C2A8C2ACC2ADC2B4 -C2B5C2B7C2B9C2DCC2DDC2E0C2E3C2E4C2EBC2ECC2EDC2EFC2F1C2F6C2F8C2F9 -C2FBC2FCC300C308C309C30CC30DC313C314C315C318C31CC324C325C328C329 -C345C368C369C36CC370C372C378C379C37CC37DC384C388C38CC3C0C3D8C3D9 -C3DCC3DFC3E0C3E2C3E8C3E9C3EDC3F4C3F5C3F8C408C410C424C42CC4300000 -BE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D438D439D43AD43BD43CD43DD43ED43FD441D442D443D445D446D447D448 -D449D44AD44BD44CD44DD44ED44FD450D451D452D45300000000000000000000 -0000D454D455D456D457D458D459D45AD45BD45DD45ED45FD461D462D463D465 -D466D467D468D469D46AD46BD46CD46ED470D471D47200000000000000000000 -0000D473D474D475D476D477D47AD47BD47DD47ED481D483D484D485D486D487 -D48AD48CD48ED48FD490D491D492D493D495D496D497D498D499D49AD49BD49C -D49DC434C43CC43DC448C464C465C468C46CC474C475C479C480C494C49CC4B8 -C4BCC4E9C4F0C4F1C4F4C4F8C4FAC4FFC500C501C50CC510C514C51CC528C529 -C52CC530C538C539C53BC53DC544C545C548C549C54AC54CC54DC54EC553C554 -C555C557C558C559C55DC55EC560C561C564C568C570C571C573C574C575C57C -C57DC580C584C587C58CC58DC58FC591C595C597C598C59CC5A0C5A9C5B4C5B5 -C5B8C5B9C5BBC5BCC5BDC5BEC5C4C5C5C5C6C5C7C5C8C5C9C5CAC5CCC5CE0000 -BF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D49ED49FD4A0D4A1D4A2D4A3D4A4D4A5D4A6D4A7D4A8D4AAD4ABD4ACD4AD -D4AED4AFD4B0D4B1D4B2D4B3D4B4D4B5D4B6D4B7D4B800000000000000000000 -0000D4B9D4BAD4BBD4BCD4BDD4BED4BFD4C0D4C1D4C2D4C3D4C4D4C5D4C6D4C7 -D4C8D4C9D4CAD4CBD4CDD4CED4CFD4D1D4D2D4D3D4D500000000000000000000 -0000D4D6D4D7D4D8D4D9D4DAD4DBD4DDD4DED4E0D4E1D4E2D4E3D4E4D4E5D4E6 -D4E7D4E9D4EAD4EBD4EDD4EED4EFD4F1D4F2D4F3D4F4D4F5D4F6D4F7D4F9D4FA -D4FCC5D0C5D1C5D4C5D8C5E0C5E1C5E3C5E5C5ECC5EDC5EEC5F0C5F4C5F6C5F7 -C5FCC5FDC5FEC5FFC600C601C605C606C607C608C60CC610C618C619C61BC61C -C624C625C628C62CC62DC62EC630C633C634C635C637C639C63BC640C641C644 -C648C650C651C653C654C655C65CC65DC660C66CC66FC671C678C679C67CC680 -C688C689C68BC68DC694C695C698C69CC6A4C6A5C6A7C6A9C6B0C6B1C6B4C6B8 -C6B9C6BAC6C0C6C1C6C3C6C5C6CCC6CDC6D0C6D4C6DCC6DDC6E0C6E1C6E80000 -C0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D4FED4FFD500D501D502D503D505D506D507D509D50AD50BD50DD50ED50F -D510D511D512D513D516D518D519D51AD51BD51CD51D00000000000000000000 -0000D51ED51FD520D521D522D523D524D525D526D527D528D529D52AD52BD52C -D52DD52ED52FD530D531D532D533D534D535D536D53700000000000000000000 -0000D538D539D53AD53BD53ED53FD541D542D543D545D546D547D548D549D54A -D54BD54ED550D552D553D554D555D556D557D55AD55BD55DD55ED55FD561D562 -D563C6E9C6ECC6F0C6F8C6F9C6FDC704C705C708C70CC714C715C717C719C720 -C721C724C728C730C731C733C735C737C73CC73DC740C744C74AC74CC74DC74F -C751C752C753C754C755C756C757C758C75CC760C768C76BC774C775C778C77C -C77DC77EC783C784C785C787C788C789C78AC78EC790C791C794C796C797C798 -C79AC7A0C7A1C7A3C7A4C7A5C7A6C7ACC7ADC7B0C7B4C7BCC7BDC7BFC7C0C7C1 -C7C8C7C9C7CCC7CEC7D0C7D8C7DDC7E4C7E8C7ECC800C801C804C808C80A0000 -C1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D564D566D567D56AD56CD56ED56FD570D571D572D573D576D577D579D57A -D57BD57DD57ED57FD580D581D582D583D586D58AD58B00000000000000000000 -0000D58CD58DD58ED58FD591D592D593D594D595D596D597D598D599D59AD59B -D59CD59DD59ED59FD5A0D5A1D5A2D5A3D5A4D5A6D5A700000000000000000000 -0000D5A8D5A9D5AAD5ABD5ACD5ADD5AED5AFD5B0D5B1D5B2D5B3D5B4D5B5D5B6 -D5B7D5B8D5B9D5BAD5BBD5BCD5BDD5BED5BFD5C0D5C1D5C2D5C3D5C4D5C5D5C6 -D5C7C810C811C813C815C816C81CC81DC820C824C82CC82DC82FC831C838C83C -C840C848C849C84CC84DC854C870C871C874C878C87AC880C881C883C885C886 -C887C88BC88CC88DC894C89DC89FC8A1C8A8C8BCC8BDC8C4C8C8C8CCC8D4C8D5 -C8D7C8D9C8E0C8E1C8E4C8F5C8FCC8FDC900C904C905C906C90CC90DC90FC911 -C918C92CC934C950C951C954C958C960C961C963C96CC970C974C97CC988C989 -C98CC990C998C999C99BC99DC9C0C9C1C9C4C9C7C9C8C9CAC9D0C9D1C9D30000 -C2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D5CAD5CBD5CDD5CED5CFD5D1D5D3D5D4D5D5D5D6D5D7D5DAD5DCD5DED5DF -D5E0D5E1D5E2D5E3D5E6D5E7D5E9D5EAD5EBD5EDD5EE00000000000000000000 -0000D5EFD5F0D5F1D5F2D5F3D5F6D5F8D5FAD5FBD5FCD5FDD5FED5FFD602D603 -D605D606D607D609D60AD60BD60CD60DD60ED60FD61200000000000000000000 -0000D616D617D618D619D61AD61BD61DD61ED61FD621D622D623D625D626D627 -D628D629D62AD62BD62CD62ED62FD630D631D632D633D634D635D636D637D63A -D63BC9D5C9D6C9D9C9DAC9DCC9DDC9E0C9E2C9E4C9E7C9ECC9EDC9EFC9F0C9F1 -C9F8C9F9C9FCCA00CA08CA09CA0BCA0CCA0DCA14CA18CA29CA4CCA4DCA50CA54 -CA5CCA5DCA5FCA60CA61CA68CA7DCA84CA98CABCCABDCAC0CAC4CACCCACDCACF -CAD1CAD3CAD8CAD9CAE0CAECCAF4CB08CB10CB14CB18CB20CB21CB41CB48CB49 -CB4CCB50CB58CB59CB5DCB64CB78CB79CB9CCBB8CBD4CBE4CBE7CBE9CC0CCC0D -CC10CC14CC1CCC1DCC21CC22CC27CC28CC29CC2CCC2ECC30CC38CC39CC3B0000 -C3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D63DD63ED63FD641D642D643D644D646D647D64AD64CD64ED64FD650D652 -D653D656D657D659D65AD65BD65DD65ED65FD660D66100000000000000000000 -0000D662D663D664D665D666D668D66AD66BD66CD66DD66ED66FD672D673D675 -D676D677D678D679D67AD67BD67CD67DD67ED67FD68000000000000000000000 -0000D681D682D684D686D687D688D689D68AD68BD68ED68FD691D692D693D695 -D696D697D698D699D69AD69BD69CD69ED6A0D6A2D6A3D6A4D6A5D6A6D6A7D6A9 -D6AACC3CCC3DCC3ECC44CC45CC48CC4CCC54CC55CC57CC58CC59CC60CC64CC66 -CC68CC70CC75CC98CC99CC9CCCA0CCA8CCA9CCABCCACCCADCCB4CCB5CCB8CCBC -CCC4CCC5CCC7CCC9CCD0CCD4CCE4CCECCCF0CD01CD08CD09CD0CCD10CD18CD19 -CD1BCD1DCD24CD28CD2CCD39CD5CCD60CD64CD6CCD6DCD6FCD71CD78CD88CD94 -CD95CD98CD9CCDA4CDA5CDA7CDA9CDB0CDC4CDCCCDD0CDE8CDECCDF0CDF8CDF9 -CDFBCDFDCE04CE08CE0CCE14CE19CE20CE21CE24CE28CE30CE31CE33CE350000 -C4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D6ABD6ADD6AED6AFD6B1D6B2D6B3D6B4D6B5D6B6D6B7D6B8D6BAD6BCD6BD -D6BED6BFD6C0D6C1D6C2D6C3D6C6D6C7D6C9D6CAD6CB00000000000000000000 -0000D6CDD6CED6CFD6D0D6D2D6D3D6D5D6D6D6D8D6DAD6DBD6DCD6DDD6DED6DF -D6E1D6E2D6E3D6E5D6E6D6E7D6E9D6EAD6EBD6ECD6ED00000000000000000000 -0000D6EED6EFD6F1D6F2D6F3D6F4D6F6D6F7D6F8D6F9D6FAD6FBD6FED6FFD701 -D702D703D705D706D707D708D709D70AD70BD70CD70DD70ED70FD710D712D713 -D714CE58CE59CE5CCE5FCE60CE61CE68CE69CE6BCE6DCE74CE75CE78CE7CCE84 -CE85CE87CE89CE90CE91CE94CE98CEA0CEA1CEA3CEA4CEA5CEACCEADCEC1CEE4 -CEE5CEE8CEEBCEECCEF4CEF5CEF7CEF8CEF9CF00CF01CF04CF08CF10CF11CF13 -CF15CF1CCF20CF24CF2CCF2DCF2FCF30CF31CF38CF54CF55CF58CF5CCF64CF65 -CF67CF69CF70CF71CF74CF78CF80CF85CF8CCFA1CFA8CFB0CFC4CFE0CFE1CFE4 -CFE8CFF0CFF1CFF3CFF5CFFCD000D004D011D018D02DD034D035D038D03C0000 -C5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D715D716D717D71AD71BD71DD71ED71FD721D722D723D724D725D726D727 -D72AD72CD72ED72FD730D731D732D733D736D737D73900000000000000000000 -0000D73AD73BD73DD73ED73FD740D741D742D743D745D746D748D74AD74BD74C -D74DD74ED74FD752D753D755D75AD75BD75CD75DD75E00000000000000000000 -0000D75FD762D764D766D767D768D76AD76BD76DD76ED76FD771D772D773D775 -D776D777D778D779D77AD77BD77ED77FD780D782D783D784D785D786D787D78A -D78BD044D045D047D049D050D054D058D060D06CD06DD070D074D07CD07DD081 -D0A4D0A5D0A8D0ACD0B4D0B5D0B7D0B9D0C0D0C1D0C4D0C8D0C9D0D0D0D1D0D3 -D0D4D0D5D0DCD0DDD0E0D0E4D0ECD0EDD0EFD0F0D0F1D0F8D10DD130D131D134 -D138D13AD140D141D143D144D145D14CD14DD150D154D15CD15DD15FD161D168 -D16CD17CD184D188D1A0D1A1D1A4D1A8D1B0D1B1D1B3D1B5D1BAD1BCD1C0D1D8 -D1F4D1F8D207D209D210D22CD22DD230D234D23CD23DD23FD241D248D25C0000 -C6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D78DD78ED78FD791D792D793D794D795D796D797D79AD79CD79ED79FD7A0 -D7A1D7A2D7A30000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D264D280D281D284D288D290D291D295D29CD2A0D2A4D2ACD2B1D2B8D2B9 -D2BCD2BFD2C0D2C2D2C8D2C9D2CBD2D4D2D8D2DCD2E4D2E5D2F0D2F1D2F4D2F8 -D300D301D303D305D30CD30DD30ED310D314D316D31CD31DD31FD320D321D325 -D328D329D32CD330D338D339D33BD33CD33DD344D345D37CD37DD380D384D38C -D38DD38FD390D391D398D399D39CD3A0D3A8D3A9D3ABD3ADD3B4D3B8D3BCD3C4 -D3C5D3C8D3C9D3D0D3D8D3E1D3E3D3ECD3EDD3F0D3F4D3FCD3FDD3FFD4010000 -C7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D408D41DD440D444D45CD460D464D46DD46FD478D479D47CD47FD480D482 -D488D489D48BD48DD494D4A9D4CCD4D0D4D4D4DCD4DFD4E8D4ECD4F0D4F8D4FB -D4FDD504D508D50CD514D515D517D53CD53DD540D544D54CD54DD54FD551D558 -D559D55CD560D565D568D569D56BD56DD574D575D578D57CD584D585D587D588 -D589D590D5A5D5C8D5C9D5CCD5D0D5D2D5D8D5D9D5DBD5DDD5E4D5E5D5E8D5EC -D5F4D5F5D5F7D5F9D600D601D604D608D610D611D613D614D615D61CD6200000 -C8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D624D62DD638D639D63CD640D645D648D649D64BD64DD651D654D655D658 -D65CD667D669D670D671D674D683D685D68CD68DD690D694D69DD69FD6A1D6A8 -D6ACD6B0D6B9D6BBD6C4D6C5D6C8D6CCD6D1D6D4D6D7D6D9D6E0D6E4D6E8D6F0 -D6F5D6FCD6FDD700D704D711D718D719D71CD720D728D729D72BD72DD734D735 -D738D73CD744D747D749D750D751D754D756D757D758D759D760D761D763D765 -D769D76CD770D774D77CD77DD781D788D789D78CD790D798D799D79BD79D0000 -CA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F3D4F73504750F952A053EF547554E556095AC15BB6668767B667B767EF -6B4C73C275C27A3C82DB8304885788888A368CC88DCF8EFB8FE699D5523B5374 -5404606A61646BBC73CF811A89BA89D295A34F83520A58BE597859E65E725E79 -61C763C0674667EC687F6F97764E770B78F57A087AFF7C21809D826E82718AEB -95934E6B559D66F76E3478A37AED845B8910874E97A852D8574E582A5D4C611F -61BE6221656267D16A446E1B751875B376E377B07D3A90AF945194529F950000 -CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000053235CAC753280DB92409598525B580859DC5CA15D175EB75F3A5F4A6177 -6C5F757A75867CE07D737DB17F8C81548221859189418B1B92FC964D9C474ECB -4EF7500B51F1584F6137613E6168653969EA6F1175A5768676D67B8782A584CB -F90093A7958B55805BA25751F9017CB37FB991B5502853BB5C455DE862D2636E -64DA64E76E2070AC795B8DDD8E1EF902907D924592F84E7E4EF650655DFE5EFA -61066957817186548E4793759A2B4E5E5091677068405109528D52926AA20000 -CC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077BC92109ED452AB602F8FF2504861A963ED64CA683C6A846FC0818889A1 -96945805727D72AC75047D797E6D80A9898B8B7490639D5162896C7A6F547D50 -7F3A8A23517C614A7B9D8B199257938C4EAC4FD3501E50BE510652C152CD537F -577058835E9A5F91617661AC64CE656C666F66BB66F468976D87708570F1749F -74A574CA75D9786C78EC7ADF7AF67D457D938015803F811B83968B668F159015 -93E1980398389A5A9BE84FC25553583A59515B635C4660B86212684268B00000 -CD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068E86EAA754C767878CE7A3D7CFB7E6B7E7C8A088AA18C3F968E9DC453E4 -53E9544A547156FA59D15B645C3B5EAB62F765376545657266A067AF69C16CBD -75FC7690777E7A3F7F94800380A1818F82E682FD83F085C1883188B48AA5F903 -8F9C932E96C798679AD89F1354ED659B66F2688F7A408C379D6056F057645D11 -660668B168CD6EFE7428889E9BE46C68F9049AA84F9B516C5171529F5B545DE5 -6050606D62F163A7653B73D97A7A86A38CA2978F4E325BE16208679C74DC0000 -CE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000079D183D38A878AB28DE8904E934B98465ED369E885FF90EDF90551A05B98 -5BEC616368FA6B3E704C742F74D87BA17F5083C589C08CAB95DC9928522E605D -62EC90024F8A5149532158D95EE366E06D38709A72C273D67B5080F1945B5366 -639B7F6B4E565080584A58DE602A612762D069D09B415B8F7D1880B18F5F4EA4 -50D154AC55AC5B0C5DA05DE7652A654E68216A4B72E1768E77EF7D5E7FF981A0 -854E86DF8F038F4E90CA99039A559BAB4E184E454E5D4EC74FF1517752FE0000 -CF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000534053E353E5548E5614577557A25BC75D875ED061FC62D8655167B867E9 -69CB6B506BC66BEC6C426E9D707872D77396740377BF77E97A767D7F800981FC -8205820A82DF88628B338CFC8EC0901190B1926492B699D29A459CE99DD79F9C -570B5C4083CA97A097AB9EB4541B7A987FA488D98ECD90E158005C4863987A9F -5BAE5F137A797AAE828E8EAC5026523852F85377570862F363726B0A6DC37737 -53A5735785688E7695D5673A6AC36F708A6D8ECC994BF90666776B788CB40000 -D0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009B3CF90753EB572D594E63C669FB73EA78457ABA7AC57CFE8475898F8D73 -903595A852FB574775477B6083CC921EF9086A58514B524B5287621F68D86975 -969950C552A452E461C365A4683969FF747E7B4B82B983EB89B28B398FD19949 -F9094ECA599764D266116A8E7434798179BD82A9887E887F895FF90A93264F0B -53CA602562716C727D1A7D664E98516277DC80AF4F014F0E5176518055DC5668 -573B57FA57FC5914594759935BC45C905D0E5DF15E7E5FCC628065D765E30000 -D1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000671E671F675E68CB68C46A5F6B3A6C236C7D6C826DC773987426742A7482 -74A37578757F788178EF794179477948797A7B957D007DBA7F888006802D808C -8A188B4F8C488D779321932498E299519A0E9A0F9A659E927DCA4F76540962EE -685491D155AB513AF90BF90C5A1C61E6F90D62CF62FFF90EF90FF910F911F912 -F91390A3F914F915F916F917F9188AFEF919F91AF91BF91C6696F91D7156F91E -F91F96E3F920634F637A5357F921678F69606E73F9227537F923F924F9250000 -D2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007D0DF926F927887256CA5A18F928F929F92AF92BF92C4E43F92D51675948 -67F08010F92E59735E74649A79CA5FF5606C62C8637B5BE75BD752AAF92F5974 -5F296012F930F931F9327459F933F934F935F936F937F93899D1F939F93AF93B -F93CF93DF93EF93FF940F941F942F9436FC3F944F94581BF8FB260F1F946F947 -8166F948F9495C3FF94AF94BF94CF94DF94EF94FF950F9515AE98A25677B7D10 -F952F953F954F955F956F95780FDF958F9595C3C6CE5533F6EBA591A83360000 -D3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E394EB64F4655AE571858C75F5665B765E66A806BB56E4D77ED7AEF7C1E -7DDE86CB88929132935B64BB6FBE737A75B890545556574D61BA64D466C76DE1 -6E5B6F6D6FB975F0804381BD854189838AC78B5A931F6C9375537B548E0F905D -5510580258585E626207649E68E075767CD687B39EE84EE35788576E59275C0D -5CB15E365F85623464E173B381FA888B8CB8968A9EDB5B855FB760B350125200 -52305716583558575C0E5C605CF65D8B5EA65F9260BC63116389641768430000 -D4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068F96AC26DD86E216ED46FE471FE76DC777979B17A3B840489A98CED8DF3 -8E4890039014905390FD934D967697DC6BD27006725872A27368776379BF7BE4 -7E9B8B8058A960C7656665FD66BE6C8C711E71C98C5A98134E6D7A814EDD51AC -51CD52D5540C61A76771685068DF6D1E6F7C75BC77B37AE580F484639285515C -6597675C679375D87AC78373F95A8C469017982D5C6F81C0829A9041906F920D -5F975D9D6A5971C8767B7B4985E48B0491279A30558761F6F95B76697F850000 -D5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000863F87BA88F8908FF95C6D1B70D973DE7D61843DF95D916A99F1F95E4E82 -53756B046B12703E721B862D9E1E524C8FA35D5064E5652C6B166FEB7C437E9C -85CD896489BD62C981D8881F5ECA67176D6A72FC7405746F878290DE4F865D0D -5FA0840A51B763A075654EAE5006516951C968816A117CAE7CB17CE7826F8AD2 -8F1B91CF4FB6513752F554425EEC616E623E65C56ADA6FFE792A85DC882395AD -9A629A6A9E979ECE529B66C66B77701D792B8F6297426190620065236F230000 -D6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000714974897DF4806F84EE8F269023934A51BD521752A36D0C70C888C25EC9 -65826BAE6FC27C3E73754EE44F3656F9F95F5CBA5DBA601C73B27B2D7F9A7FCE -8046901E923496F6974898189F614F8B6FA779AE91B496B752DEF960648864C4 -6AD36F5E7018721076E780018606865C8DEF8F0597329B6F9DFA9E75788C797F -7DA083C993049E7F9E938AD658DF5F046727702774CF7C60807E512170287262 -78CA8CC28CDA8CF496F74E8650DA5BEE5ED6659971CE764277AD804A84FC0000 -D7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000907C9B279F8D58D85A415C626A136DDA6F0F763B7D2F7E37851E893893E4 -964B528965D267F369B46D416E9C700F7409746075597624786B8B2C985E516D -622E96784F96502B5D196DEA7DB88F2A5F8B61446817F961968652D2808B51DC -51CC695E7A1C7DBE83F196754FDA52295398540F550E5C6560A7674E68A86D6C -728172F874067483F96275E27C6C7F797FB8838988CF88E191CC91D096E29BC9 -541D6F7E71D0749885FA8EAA96A39C579E9F67976DCB743381E89716782C0000 -D8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007ACB7B207C926469746A75F278BC78E899AC9B549EBB5BDE5E556F20819C -83AB90884E07534D5A295DD25F4E6162633D666966FC6EFF6F2B7063779E842C -8513883B8F1399459C3B551C62B9672B6CAB8309896A977A4EA159845FD85FD9 -671B7DB27F548292832B83BD8F1E909957CB59B95A925BD06627679A68856BCF -71647F758CB78CE390819B4581088C8A964C9A409EA55B5F6C13731B76F276DF -840C51AA8993514D519552C968C96C94770477207DBF7DEC97629EB56EC50000 -D9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000851151A5540D547D660E669D69276E9F76BF7791831784C2879F91699298 -9CF488824FAE519252DF59C65E3D61556478647966AE67D06A216BCD6BDB725F -72617441773877DB801782BC83058B008B288C8C67286C90726776EE77667A46 -9DA96B7F6C92592267268499536F589359995EDF63CF663467736E3A732B7AD7 -82D7932852D95DEB61AE61CB620A62C764AB65E069596B666BCB712173F7755D -7E46821E8302856A8AA38CBF97279D6158A89ED85011520E543B554F65870000 -DA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006C767D0A7D0B805E868A958096EF52FF6C95726954735A9A5C3E5D4B5F4C -5FAE672A68B669636E3C6E4477097C737F8E85878B0E8FF797619EF45CB760B6 -610D61AB654F65FB65FC6C116CEF739F73C97DE195945BC6871C8B10525D535A -62CD640F64B267346A386CCA73C0749E7B947C957E1B818A823685848FEB96F9 -99C14F34534A53CD53DB62CC642C6500659169C36CEE6F5873ED7554762276E4 -76FC78D078FB792C7D46822C87E08FD4981298EF52C362D464A56E246F510000 -DB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000767C8DCB91B192629AEE9B435023508D574A59A85C285E475F77623F653E -65B965C16609678B699C6EC278C57D2180AA8180822B82B384A1868C8A2A8B17 -90A696329F90500D4FF3F96357F95F9862DC6392676F6E43711976C380CC80DA -88F488F589198CE08F29914D966A4F2F4F705E1B67CF6822767D767E9B445E61 -6A0A716971D4756AF9647E41854385E998DC4F107B4F7F7095A551E15E0668B5 -6C3E6C4E6CDB72AF7BC483036CD5743A50FB528858C164D86A9774A776560000 -DC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000078A7861795E29739F965535E5F018B8A8FA88FAF908A522577A59C499F08 -4E19500251755C5B5E77661E663A67C468C570B3750175C579C97ADD8F279920 -9A084FDD582158315BF6666E6B656D116E7A6F7D73E4752B83E988DC89138B5C -8F144F0F50D55310535C5B935FA9670D798F8179832F8514890789868F398F3B -99A59C12672C4E764FF859495C015CEF5CF0636768D270FD71A2742B7E2B84EC -8702902292D29CF34E0D4ED84FEF50855256526F5426549057E0592B5A660000 -DD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005B5A5B755BCC5E9CF9666276657765A76D6E6EA572367B267C3F7F368150 -8151819A8240829983A98A038CA08CE68CFB8D748DBA90E891DC961C964499D9 -9CE7531752065429567458B35954596E5FFF61A4626E66106C7E711A76C67C89 -7CDE7D1B82AC8CC196F0F9674F5B5F175F7F62C25D29670B68DA787C7E439D6C -4E1550995315532A535159835A625E8760B2618A624962796590678769A76BD4 -6BD66BD76BD86CB8F968743575FA7812789179D579D87C837DCB7FE180A50000 -DE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000813E81C283F2871A88E88AB98B6C8CBB9119975E98DB9F3B56AC5B2A5F6C -658C6AB36BAF6D5C6FF17015725D73AD8CA78CD3983B61916C3780589A014E4D -4E8B4E9B4ED54F3A4F3C4F7F4FDF50FF53F253F8550655E356DB58EB59625A11 -5BEB5BFA5C045DF35E2B5F99601D6368659C65AF67F667FB68AD6B7B6C996CD7 -6E23700973457802793E7940796079C17BE97D177D728086820D838E84D186C7 -88DF8A508A5E8B1D8CDC8D668FAD90AA98FC99DF9E9D524AF9696714F96A0000 -DF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005098522A5C7165636C5573CA7523759D7B97849C917897304E7764926BBA -715E85A94E09F96B674968EE6E17829F8518886B63F76F81921298AF4E0A50B7 -50CF511F554655AA56175B405C195CE05E385E8A5EA05EC260F368516A616E58 -723D724072C076F879657BB17FD488F389F48A738C618CDE971C585E74BD8CFD -55C7F96C7A617D2282727272751F7525F96D7B19588558FB5DBC5E8F5EB65F90 -60556292637F654D669166D966F8681668F27280745E7B6E7D6E7DD67F720000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000080E5821285AF897F8A93901D92E49ECD9F205915596D5E2D60DC66146673 -67906C506DC56F5F77F378A984C691CB932B4ED950CA514855845B0B5BA36247 -657E65CB6E32717D74017444748774BF766C79AA7DDA7E557FA8817A81B38239 -861A87EC8A758DE3907892919425994D9BAE53685C5169546CC46D296E2B820C -859B893B8A2D8AAA96EA9F67526166B96BB27E9687FE8D0D9583965D651D6D89 -71EEF96E57CE59D35BAC602760FA6210661F665F732973F976DB77017B6C0000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008056807281658AA091924E1652E26B726D177A057B397D30F96F8CB053EC -562F58515BB55C0F5C115DE2624063836414662D68B36CBC6D886EAF701F70A4 -71D27526758F758E76197B117BE07C2B7D207D39852C856D86078A34900D9061 -90B592B797F69A374FD75C6C675F6D917C9F7E8C8B168D16901F5B6B5DFD640D -84C0905C98E173875B8B609A677E6DDE8A1F8AA69001980C5237F9707051788E -9396887091D74FEE53D755FD56DA578258FD5AC25B885CAB5CC05E2561010000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000620D624B6388641C653665786A396B8A6C346D196F3171E772E973787407 -74B27626776179C07A577AEA7CB97D8F7DAC7E617F9E81298331849084DA85EA -88968AB08B908F3890429083916C929692B9968B96A796A896D6970098089996 -9AD39B1A53D4587E59195B705BBF6DD16F5A719F742174B9808583FD5DE15F87 -5FAA604265EC6812696F6A536B896D356DF373E376FE77AC7B4D7D148123821C -834084F485638A628AC49187931E980699B4620C88538FF092655D075D270000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005D69745F819D87686FD562FE7FD2893689724E1E4E5850E752DD5347627F -66077E698805965E4F8D5319563659CB5AA45C385C4E5C4D5E025F11604365BD -662F664267BE67F4731C77E2793A7FC5849484CD89968A668A698AE18C558C7A -57F45BD45F0F606F62ED690D6B966E5C71847BD287558B588EFE98DF98FE4F38 -4F814FE1547B5A205BB8613C65B0666871FC7533795E7D33814E81E3839885AA -85CE87038A0A8EAB8F9BF9718FC559315BA45BE660895BE95C0B5FC36C810000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9726DF1700B751A82AF8AF64EC05341F97396D96C0F4E9E4FC45152555E -5A255CE86211725982BD83AA86FE88598A1D963F96C599139D099D5D580A5CB3 -5DBD5E4460E1611563E16A026E2591029354984E9C109F775B895CB86309664F -6848773C96C1978D98549B9F65A18B018ECB95BC55355CA95DD65EB56697764C -83F495C758D362BC72CE9D284EF0592E600F663B6B8379E79D26539354C057C3 -5D16611B66D66DAF788D827E969897445384627C63966DB27E0A814B984D0000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006AFB7F4C9DAF9E1A4E5F503B51B6591C60F963F66930723A8036F97491CE -5F31F975F9767D0482E5846F84BB85E58E8DF9774F6FF978F97958E45B436059 -63DA6518656D6698F97A694A6A236D0B7001716C75D2760D79B37A70F97B7F8A -F97C8944F97D8B9391C0967DF97E990A57045FA165BC6F01760079A68A9E99AD -9B5A9F6C510461B662916A8D81C6504358305F6671098A008AFA5B7C86164FFA -513C56B4594463A96DF95DAA696D51864E884F59F97FF980F9815982F9820000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9836B5F6C5DF98474B57916F9858207824583398F3F8F5DF9869918F987 -F988F9894EA6F98A57DF5F796613F98BF98C75AB7E798B6FF98D90069A5B56A5 -582759F85A1F5BB4F98E5EF6F98FF9906350633BF991693D6C876CBF6D8E6D93 -6DF56F14F99270DF71367159F99371C371D5F994784F786FF9957B757DE3F996 -7E2FF997884D8EDFF998F999F99A925BF99B9CF6F99CF99DF99E60856D85F99F -71B1F9A0F9A195B153ADF9A2F9A3F9A467D3F9A5708E71307430827682D20000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9A695BB9AE59E7D66C4F9A771C18449F9A8F9A9584BF9AAF9AB5DB85F71 -F9AC6620668E697969AE6C386CF36E366F416FDA701B702F715071DF7370F9AD -745BF9AE74D476C87A4E7E93F9AFF9B082F18A608FCEF9B19348F9B29719F9B3 -F9B44E42502AF9B5520853E166F36C6D6FCA730A777F7A6282AE85DD8602F9B6 -88D48A638B7D8C6BF9B792B3F9B8971398104E944F0D4FC950B25348543E5433 -55DA586258BA59675A1B5BE4609FF9B961CA655665FF666468A76C5A6FB30000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000070CF71AC73527B7D87088AA49C329F075C4B6C8373447389923A6EAB7465 -761F7A697E15860A514058C564C174EE751576707FC1909596CD99546E2674E6 -7AA97AAA81E586D987788A1B5A495B8C5B9B68A169006D6373A97413742C7897 -7DE97FEB81188155839E8C4C962E981166F05F8065FA67896C6A738B502D5A03 -6B6A77EE59165D6C5DCD7325754FF9BAF9BB50E551F9582F592D599659DA5BE5 -F9BCF9BD5DA262D76416649364FEF9BE66DCF9BF6A48F9C071FF7464F9C10000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A887AAF7E477E5E80008170F9C287EF89818B209059F9C390809952617E -6B326D747E1F89258FB14FD150AD519752C757C758895BB95EB8614269956D8C -6E676EB6719474627528752C8073833884C98E0A939493DEF9C44E8E4F515076 -512A53C853CB53F35B875BD35C24611A618265F4725B7397744076C279507991 -79B97D067FBD828B85D5865E8FC2904790F591EA968596E896E952D65F6765ED -6631682F715C7A3690C1980A4E91F9C56A526B9E6F907189801882B885530000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000904B969596F297FB851A9B314E90718A96C45143539F54E15713571257A3 -5A9B5AC45BC36028613F63F46C856D396E726E907230733F745782D188818F45 -9060F9C6966298589D1B67088D8A925E4F4D504950DE5371570D59D45A015C09 -617066906E2D7232744B7DEF80C3840E8466853F875F885B89188B02905597CB -9B4F4E734F915112516AF9C7552F55A95B7A5BA55E7C5E7D5EBE60A060DF6108 -610963C465386709F9C867D467DAF9C9696169626CB96D27F9CA6E38F9CB0000 -EB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006FE173367337F9CC745C7531F9CD7652F9CEF9CF7DAD81FE843888D58A98 -8ADB8AED8E308E42904A903E907A914991C9936EF9D0F9D15809F9D26BD38089 -80B2F9D3F9D45141596B5C39F9D5F9D66F6473A780E48D07F9D79217958FF9D8 -F9D9F9DAF9DB807F620E701C7D68878DF9DC57A0606961476BB78ABE928096B1 -4E59541F6DEB852D967097F398EE63D66CE3909151DD61C981BA9DF94F9D501A -51005B9C610F61FF64EC69056BC5759177E37FA98264858F87FB88638ABC0000 -EC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008B7091AB4E8C4EE54F0AF9DDF9DE593759E8F9DF5DF25F1B5F5B6021F9E0 -F9E1F9E2F9E3723E73E5F9E4757075CDF9E579FBF9E6800C8033808482E18351 -F9E7F9E88CBD8CB39087F9E9F9EA98F4990CF9EBF9EC703776CA7FCA7FCC7FFC -8B1A4EBA4EC152035370F9ED54BD56E059FB5BC55F155FCD6E6EF9EEF9EF7D6A -8335F9F086938A8DF9F1976D9777F9F2F9F34E004F5A4F7E58F965E56EA29038 -93B099B94EFB58EC598A59D96041F9F4F9F57A14F9F6834F8CC3516553440000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9F7F9F8F9F94ECD52695B5582BF4ED4523A54A859C959FF5B505B575B5C -606361486ECB7099716E738674F775B578C17D2B800581EA8328851785C98AEE -8CC796CC4F5C52FA56BC65AB6628707C70B872357DBD828D914C96C09D725B71 -68E76B986F7A76DE5C9166AB6F5B7BB47C2A883696DC4E084ED75320583458BB -58EF596C5C075E335E845F35638C66B267566A1F6AA36B0C6F3F7246F9FA7350 -748B7AE07CA7817881DF81E7838A846C8523859485CF88DD8D1391AC95770000 -EE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000969C518D54C957285BB0624D6750683D68936E3D6ED3707D7E2188C18CA1 -8F099F4B9F4E722D7B8F8ACD931A4F474F4E5132548059D05E9562B56775696E -6A176CAE6E1A72D9732A75BD7BB87D3582E783F9845785F78A5B8CAF8E879019 -90B896CE9F5F52E3540A5AE15BC2645865756EF472C4F9FB76847A4D7B1B7C4D -7E3E7FDF837B8B2B8CCA8D648DE18E5F8FEA8FF9906993D14F434F7A50B35168 -5178524D526A5861587C59605C085C555EDB609B623068136BBF6C086FB10000 -EF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000714E742075307538755176727B4C7B8B7BAD7BC67E8F8A6E8F3E8F49923F -92939322942B96FB985A986B991E5207622A62986D5976647ACA7BC07D765360 -5CBE5E976F3870B97C9897119B8E9EDE63A5647A87764E014E954EAD505C5075 -544859C35B9A5E405EAD5EF75F8160C5633A653F657465CC6676667867FE6968 -6A896B636C406DC06DE86E1F6E5E701E70A1738E73FD753A775B7887798E7A0B -7A7D7CBE7D8E82478A028AEA8C9E912D914A91D8926692CC9320970697560000 -F0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000975C98029F0E52365291557C58245E1D5F1F608C63D068AF6FDF796D7B2C -81CD85BA88FD8AF88E44918D9664969B973D984C9F4A4FCE514651CB52A95632 -5F145F6B63AA64CD65E9664166FA66F9671D689D68D769FD6F156F6E716771E5 -722A74AA773A7956795A79DF7A207A957C977CDF7D447E70808785FB86A48A54 -8ABF8D998E819020906D91E3963B96D59CE565CF7C078DB393C35B585C0A5352 -62D9731D50275B975F9E60B0616B68D56DD9742E7A2E7D427D9C7E31816B0000 -F1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008E2A8E35937E94184F5057505DE65EA7632B7F6A4E3B4F4F4F8F505A59DD -80C4546A546855FE594F5B995DDE5EDA665D673167F1682A6CE86D326E4A6F8D -70B773E075877C4C7D027D2C7DA2821F86DB8A3B8A858D708E8A8F339031914E -9152944499D07AF97CA54FCA510151C657C85BEF5CFB66596A3D6D5A6E966FEC -710C756F7AE388229021907596CB99FF83014E2D4EF2884691CD537D6ADB696B -6C41847A589E618E66FE62EF70DD751175C77E5284B88B498D084E4B53EA0000 -F2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054AB573057405FD763016307646F652F65E8667A679D67B36B626C606C9A -6F2C77E57825794979577D1980A2810281F3829D82B787188A8CF9FC8D048DBE -907276F47A197A377E548077550755D45875632F64226649664B686D699B6B84 -6D256EB173CD746874A1755B75B976E1771E778B79E67E097E1D81FB852F8897 -8A3A8CD18EEB8FB0903293AD9663967397074F8453F159EA5AC95E19684E74C6 -75BE79E97A9281A386ED8CEA8DCC8FED659F6715F9FD57F76F577DDD8F2F0000 -F3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000093F696C65FB561F26F844E144F98501F53C955DF5D6F5DEE6B216B6478CB -7B9AF9FE8E498ECA906E6349643E77407A84932F947F9F6A64B06FAF71E674A8 -74DA7AC47C127E827CB27E988B9A8D0A947D9910994C52395BDF64E6672D7D2E -50ED53C358796158615961FA65AC7AD98B928B9650095021527555315A3C5EE0 -5F706134655E660C663666A269CD6EC46F32731676217A938139825983D684BC -50B557F05BC05BE85F6963A178267DB583DC852191C791F5518A67F57B560000 -F4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008CAC51C459BB60BD8655501CF9FF52545C3A617D621A62D364F265A56ECC -7620810A8E60965F96BB4EDF5343559859295DDD64C56CC96DFA73947A7F821B -85A68CE48E10907791E795E1962197C651F854F255865FB964A46F887DB48F1F -8F4D943550C95C166CBE6DFB751B77BB7C3D7C648A798AC2581E59BE5E166377 -7252758A776B8ADC8CBC8F125EF366746DF8807D83C18ACB97519BD6FA005243 -66FF6D956EEF7DE08AE6902E905E9AD4521D527F54E86194628462DB68A20000 -F5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006912695A6A3570927126785D7901790E79D27A0D8096827882D583498549 -8C828D859162918B91AE4FC356D171ED77D7870089F85BF85FD6675190A853E2 -585A5BF560A4618164607E3D80708525928364AE50AC5D146700589C62BD63A8 -690E69786A1E6E6B76BA79CB82BB84298ACF8DA88FFD9112914B919C93109318 -939A96DB9A369C0D4E11755C795D7AFA7B517BC97E2E84C48E598E748EF89010 -6625693F744351FA672E9EDC51455FE06C9687F2885D887760B481B584030000 -F6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008D0553D6543956345A365C31708A7FE0805A810681ED8DA391899A5F9DF2 -50744EC453A060FB6E2C5C644F88502455E45CD95E5F606568946CBB6DC471BE -75D475F476617A1A7A497DC77DFB7F6E81F486A98F1C96C999B39F52524752C5 -98ED89AA4E0367D26F064FB55BE267956C886D78741B782791DD937C87C479E4 -7A315FEB4ED654A4553E58AE59A560F0625362D6673669558235964099B199DD -502C53535544577CFA016258FA0264E2666B67DD6FC16FEF742274388A170000 -F7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000094385451560657665F48619A6B4E705870AD7DBB8A95596A812B63A27708 -803D8CAA5854642D69BB5B955E116E6FFA038569514C53F0592A6020614B6B86 -6C706CF07B1E80CE82D48DC690B098B1FA0464C76FA464916504514E5410571F -8A0E615F6876FA0575DB7B527D71901A580669CC817F892A9000983950785957 -59AC6295900F9B2A615D727995D657615A465DF4628A64AD64FA67776CE26D3E -722C743678347F7782AD8DDB981752245742677F724874E38CA98FA692110000 -F8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000962A516B53ED634C4F695504609665576C9B6D7F724C72FD7A1789878C9D -5F6D6F8E70F981A8610E4FBF504F624172477BC77DE87FE9904D97AD9A198CB6 -576A5E7367B0840D8A5554205B165E635EE25F0A658380BA853D9589965B4F48 -5305530D530F548654FA57035E036016629B62B16355FA066CE16D6675B17832 -80DE812F82DE846184B2888D8912900B92EA98FD9B915E4566B466DD70117206 -FA074FF5527D5F6A615367536A196F0274E2796888688C7998C798C49A430000 -F9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054C17A1F69538AF78C4A98A899AE5F7C62AB75B276AE88AB907F96425339 -5F3C5FC56CCC73CC7562758B7B4682FE999D4E4F903C4E0B4F5553A6590F5EC8 -66306CB37455837787668CC09050971E9C1558D15B7886508B149DB45BD26068 -608D65F16C576F226FA3701A7F557FF095919592965097D352728F4451FD542B -54B85563558A6ABB6DB57DD88266929C96779E79540854C876D286E495A495D4 -965C4EA24F0959EE5AE65DF760526297676D68416C866E2F7F38809B822A0000 -FA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FA08FA0998054EA5505554B35793595A5B695BB361C869776D77702387F9 -89E38A728AE7908299ED9AB852BE683850165E78674F8347884C4EAB541156AE -73E6911597FF9909995799995653589F865B8A3161B26AF6737B8ED26B4796AA -9A57595572008D6B97694FD45CF45F2661F8665B6CEB70AB738473B973FE7729 -774D7D437D627E2382378852FA0A8CE29249986F5B517A74884098015ACC4FE0 -5354593E5CFD633E6D7972F98105810783A292CF98304EA851445211578B0000 -FB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F626CC26ECE7005705070AF719273E97469834A87A28861900890A293A3 -99A8516E5F5760E0616766B385598E4A91AF978B4E4E4E92547C58D558FA597D -5CB55F2762366248660A66676BEB6D696DCF6E566EF86F946FE06FE9705D72D0 -7425745A74E07693795C7CCA7E1E80E182A6846B84BF864E865F87748B778C6A -93AC9800986560D1621691775A5A660F6DF76E3E743F9B425FFD60DA7B0F54C4 -5F186C5E6CD36D2A70D87D0586798A0C9D3B5316548C5B056A3A706B75750000 -FC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000798D79BE82B183EF8A718B418CA89774FA0B64F4652B78BA78BB7A6B4E38 -559A59505BA65E7B60A363DB6B61666568536E19716574B07D0890849A699C25 -6D3B6ED1733E8C4195CA51F05E4C5FA8604D60F66130614C6643664469A56CC1 -6E5F6EC96F62714C749C76877BC17C27835287579051968D9EC3532F56DE5EFB -5F8A6062609461F7666667036A9C6DEE6FAE7070736A7E6A81BE833486D48AA8 -8CC4528373725B966A6B940454EE56865B5D6548658566C9689F6D8D6DC60000 -FD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000723B80B491759A4D4FAF5019539A540E543C558955C55E3F5F8C673D7166 -73DD900552DB52F3586458CE7104718F71FB85B08A13668885A855A76684714A -8431534955996BC15F595FBD63EE668971478AF18F1D9EBE4F11643A70CB7566 -866760648B4E9DF8514751F653086D3680F89ED166156B23709875D554035C79 -7D078A166B206B3D6B46543860706D3D7FD5820850D651DE559C566B56CD59EC -5B095E0C619961986231665E66E6719971B971BA72A779A77A007FB28A700000 diff --git a/library/encoding/cp950.enc b/library/encoding/cp950.enc deleted file mode 100644 index 8816284..0000000 --- a/library/encoding/cp950.enc +++ /dev/null @@ -1,1499 +0,0 @@ -# Encoding file: cp950, multi-byte -M -003F 0 88 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3000FF0C30013002FF0E2027FF1BFF1AFF1FFF01FE3020262025FE50FE51FE52 -00B7FE54FE55FE56FE57FF5C2013FE312014FE332574FE34FE4FFF08FF09FE35 -FE36FF5BFF5DFE37FE3830143015FE39FE3A30103011FE3BFE3C300A300BFE3D -FE3E30083009FE3FFE40300C300DFE41FE42300E300FFE43FE44FE59FE5A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FE5BFE5CFE5DFE5E20182019201C201D301D301E20352032FF03FF06FF0A -203B00A7300325CB25CF25B325B225CE2606260525C725C625A125A025BD25BC -32A3210500AFFFE3FF3F02CDFE49FE4AFE4DFE4EFE4BFE4CFE5FFE60FE61FF0B -FF0D00D700F700B1221AFF1CFF1EFF1D226622672260221E22522261FE62FE63 -FE64FE65FE66FF5E2229222A22A52220221F22BF33D233D1222B222E22352234 -26402642229522992191219321902192219621972199219822252223FF0F0000 -A2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FF3C2215FE68FF04FFE53012FFE0FFE1FF05FF2021032109FE69FE6AFE6B33D5 -339C339D339E33CE33A1338E338F33C400B05159515B515E515D5161516355E7 -74E97CCE25812582258325842585258625872588258F258E258D258C258B258A -2589253C2534252C2524251C2594250025022595250C251025142518256D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000256E2570256F2550255E256A256125E225E325E525E4257125722573FF10 -FF11FF12FF13FF14FF15FF16FF17FF18FF192160216121622163216421652166 -216721682169302130223023302430253026302730283029534153445345FF21 -FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2FFF30FF31 -FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF41FF42FF43FF44FF45FF46FF47 -FF48FF49FF4AFF4BFF4CFF4DFF4EFF4FFF50FF51FF52FF53FF54FF55FF560000 -A3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FF57FF58FF59FF5A039103920393039403950396039703980399039A039B039C -039D039E039F03A003A103A303A403A503A603A703A803A903B103B203B303B4 -03B503B603B703B803B903BA03BB03BC03BD03BE03BF03C003C103C303C403C5 -03C603C703C803C931053106310731083109310A310B310C310D310E310F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00003110311131123113311431153116311731183119311A311B311C311D311E -311F312031213122312331243125312631273128312902D902C902CA02C702CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E004E594E014E034E434E5D4E864E8C4EBA513F5165516B51E052005201529B -53155341535C53C84E094E0B4E084E0A4E2B4E3851E14E454E484E5F4E5E4E8E -4EA15140520352FA534353C953E3571F58EB5915592759735B505B515B535BF8 -5C0F5C225C385C715DDD5DE55DF15DF25DF35DFE5E725EFE5F0B5F13624D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E114E104E0D4E2D4E304E394E4B5C394E884E914E954E924E944EA24EC1 -4EC04EC34EC64EC74ECD4ECA4ECB4EC4514351415167516D516E516C519751F6 -52065207520852FB52FE52FF53165339534853475345535E538453CB53CA53CD -58EC5929592B592A592D5B545C115C245C3A5C6F5DF45E7B5EFF5F145F155FC3 -62086236624B624E652F6587659765A465B965E566F0670867286B206B626B79 -6BCB6BD46BDB6C0F6C34706B722A7236723B72477259725B72AC738B4E190000 -A5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E164E154E144E184E3B4E4D4E4F4E4E4EE54ED84ED44ED54ED64ED74EE34EE4 -4ED94EDE514551445189518A51AC51F951FA51F8520A52A0529F530553065317 -531D4EDF534A534953615360536F536E53BB53EF53E453F353EC53EE53E953E8 -53FC53F853F553EB53E653EA53F253F153F053E553ED53FB56DB56DA59160000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000592E5931597459765B555B835C3C5DE85DE75DE65E025E035E735E7C5F01 -5F185F175FC5620A625362546252625165A565E6672E672C672A672B672D6B63 -6BCD6C116C106C386C416C406C3E72AF7384738974DC74E67518751F75287529 -7530753175327533758B767D76AE76BF76EE77DB77E277F3793A79BE7A747ACB -4E1E4E1F4E524E534E694E994EA44EA64EA54EFF4F094F194F0A4F154F0D4F10 -4F114F0F4EF24EF64EFB4EF04EF34EFD4F014F0B514951475146514851680000 -A6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5171518D51B0521752115212520E521652A3530853215320537053715409540F -540C540A54105401540B54045411540D54085403540E5406541256E056DE56DD -573357305728572D572C572F57295919591A59375938598459785983597D5979 -598259815B575B585B875B885B855B895BFA5C165C795DDE5E065E765E740000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F0F5F1B5FD95FD6620E620C620D62106263625B6258653665E965E865EC -65ED66F266F36709673D6734673167356B216B646B7B6C166C5D6C576C596C5F -6C606C506C556C616C5B6C4D6C4E7070725F725D767E7AF97C737CF87F367F8A -7FBD80018003800C80128033807F8089808B808C81E381EA81F381FC820C821B -821F826E8272827E866B8840884C8863897F96214E324EA84F4D4F4F4F474F57 -4F5E4F344F5B4F554F304F504F514F3D4F3A4F384F434F544F3C4F464F630000 -A7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4F5C4F604F2F4F4E4F364F594F5D4F484F5A514C514B514D517551B651B75225 -52245229522A522852AB52A952AA52AC532353735375541D542D541E543E5426 -544E542754465443543354485442541B5429544A5439543B5438542E54355436 -5420543C54405431542B541F542C56EA56F056E456EB574A57515740574D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005747574E573E5750574F573B58EF593E599D599259A8599E59A359995996 -598D59A45993598A59A55B5D5B5C5B5A5B5B5B8C5B8B5B8F5C2C5C405C415C3F -5C3E5C905C915C945C8C5DEB5E0C5E8F5E875E8A5EF75F045F1F5F645F625F77 -5F795FD85FCC5FD75FCD5FF15FEB5FF85FEA6212621162846297629662806276 -6289626D628A627C627E627962736292626F6298626E62956293629162866539 -653B653865F166F4675F674E674F67506751675C6756675E6749674667600000 -A8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -675367576B656BCF6C426C5E6C996C816C886C896C856C9B6C6A6C7A6C906C70 -6C8C6C686C966C926C7D6C836C726C7E6C746C866C766C8D6C946C986C827076 -707C707D707872627261726072C472C27396752C752B75377538768276EF77E3 -79C179C079BF7A767CFB7F5580968093809D8098809B809A80B2826F82920000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000828B828D898B89D28A008C378C468C558C9D8D648D708DB38EAB8ECA8F9B -8FB08FC28FC68FC58FC45DE1909190A290AA90A690A3914991C691CC9632962E -9631962A962C4E264E564E734E8B4E9B4E9E4EAB4EAC4F6F4F9D4F8D4F734F7F -4F6C4F9B4F8B4F864F834F704F754F884F694F7B4F964F7E4F8F4F914F7A5154 -51525155516951775176517851BD51FD523B52385237523A5230522E52365241 -52BE52BB5352535453535351536653775378537953D653D453D7547354750000 -A9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5496547854955480547B5477548454925486547C549054715476548C549A5462 -5468548B547D548E56FA57835777576A5769576157665764577C591C59495947 -59485944595459BE59BB59D459B959AE59D159C659D059CD59CB59D359CA59AF -59B359D259C55B5F5B645B635B975B9A5B985B9C5B995B9B5C1A5C485C450000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C465CB75CA15CB85CA95CAB5CB15CB35E185E1A5E165E155E1B5E115E78 -5E9A5E975E9C5E955E965EF65F265F275F295F805F815F7F5F7C5FDD5FE05FFD -5FF55FFF600F6014602F60356016602A6015602160276029602B601B62166215 -623F623E6240627F62C962CC62C462BF62C262B962D262DB62AB62D362D462CB -62C862A862BD62BC62D062D962C762CD62B562DA62B162D862D662D762C662AC -62CE653E65A765BC65FA66146613660C66066602660E6600660F6615660A0000 -AA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6607670D670B676D678B67956771679C677367776787679D6797676F6770677F -6789677E67906775679A6793677C676A67726B236B666B676B7F6C136C1B6CE3 -6CE86CF36CB16CCC6CE56CB36CBD6CBE6CBC6CE26CAB6CD56CD36CB86CC46CB9 -6CC16CAE6CD76CC56CF16CBF6CBB6CE16CDB6CCA6CAC6CEF6CDC6CD66CE00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007095708E7092708A7099722C722D723872487267726972C072CE72D972D7 -72D073A973A8739F73AB73A5753D759D7599759A768476C276F276F477E577FD -793E7940794179C979C87A7A7A797AFA7CFE7F547F8C7F8B800580BA80A580A2 -80B180A180AB80A980B480AA80AF81E581FE820D82B3829D829982AD82BD829F -82B982B182AC82A582AF82B882A382B082BE82B7864E8671521D88688ECB8FCE -8FD48FD190B590B890B190B691C791D195779580961C9640963F963B96440000 -AB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -964296B996E89752975E4E9F4EAD4EAE4FE14FB54FAF4FBF4FE04FD14FCF4FDD -4FC34FB64FD84FDF4FCA4FD74FAE4FD04FC44FC24FDA4FCE4FDE4FB751575192 -519151A0524E5243524A524D524C524B524752C752C952C352C1530D5357537B -539A53DB54AC54C054A854CE54C954B854A654B354C754C254BD54AA54C10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054C454C854AF54AB54B154BB54A954A754BF56FF5782578B57A057A357A2 -57CE57AE579359555951594F594E595059DC59D859FF59E359E85A0359E559EA -59DA59E65A0159FB5B695BA35BA65BA45BA25BA55C015C4E5C4F5C4D5C4B5CD9 -5CD25DF75E1D5E255E1F5E7D5EA05EA65EFA5F085F2D5F655F885F855F8A5F8B -5F875F8C5F896012601D60206025600E6028604D60706068606260466043606C -606B606A6064624162DC6316630962FC62ED630162EE62FD630762F162F70000 -AC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62EF62EC62FE62F463116302653F654565AB65BD65E26625662D66206627662F -661F66286631662466F767FF67D367F167D467D067EC67B667AF67F567E967EF -67C467D167B467DA67E567B867CF67DE67F367B067D967E267DD67D26B6A6B83 -6B866BB56BD26BD76C1F6CC96D0B6D326D2A6D416D256D0C6D316D1E6D170000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D3B6D3D6D3E6D366D1B6CF56D396D276D386D296D2E6D356D0E6D2B70AB -70BA70B370AC70AF70AD70B870AE70A472307272726F727472E972E072E173B7 -73CA73BB73B273CD73C073B3751A752D754F754C754E754B75AB75A475A575A2 -75A3767876867687768876C876C676C376C5770176F976F87709770B76FE76FC -770777DC78027814780C780D794679497948794779B979BA79D179D279CB7A7F -7A817AFF7AFD7C7D7D027D057D007D097D077D047D067F387F8E7FBF80040000 -AD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8010800D8011803680D680E580DA80C380C480CC80E180DB80CE80DE80E480DD -81F4822282E78303830582E382DB82E6830482E58302830982D282D782F18301 -82DC82D482D182DE82D382DF82EF830686508679867B867A884D886B898189D4 -8A088A028A038C9E8CA08D748D738DB48ECD8ECC8FF08FE68FE28FEA8FE50000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008FED8FEB8FE48FE890CA90CE90C190C3914B914A91CD95829650964B964C -964D9762976997CB97ED97F3980198A898DB98DF999699994E584EB3500C500D -50234FEF502650254FF8502950165006503C501F501A501250114FFA50005014 -50284FF15021500B501950184FF34FEE502D502A4FFE502B5009517C51A451A5 -51A251CD51CC51C651CB5256525C5254525B525D532A537F539F539D53DF54E8 -55105501553754FC54E554F2550654FA551454E954ED54E1550954EE54EA0000 -AE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54E65527550754FD550F5703570457C257D457CB57C35809590F59575958595A -5A115A185A1C5A1F5A1B5A1359EC5A205A235A295A255A0C5A095B6B5C585BB0 -5BB35BB65BB45BAE5BB55BB95BB85C045C515C555C505CED5CFD5CFB5CEA5CE8 -5CF05CF65D015CF45DEE5E2D5E2B5EAB5EAD5EA75F315F925F915F9060590000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006063606560506055606D6069606F6084609F609A608D6094608C60856096 -624762F3630862FF634E633E632F635563426346634F6349633A6350633D632A -632B6328634D634C65486549659965C165C566426649664F66436652664C6645 -664166F867146715671768216838684868466853683968426854682968B36817 -684C6851683D67F468506840683C6843682A68456813681868416B8A6B896BB7 -6C236C276C286C266C246CF06D6A6D956D886D876D666D786D776D596D930000 -AF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6D6C6D896D6E6D5A6D746D696D8C6D8A6D796D856D656D9470CA70D870E470D9 -70C870CF7239727972FC72F972FD72F872F7738673ED740973EE73E073EA73DE -7554755D755C755A755975BE75C575C775B275B375BD75BC75B975C275B8768B -76B076CA76CD76CE7729771F7720772877E9783078277838781D783478370000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007825782D7820781F7832795579507960795F7956795E795D7957795A79E4 -79E379E779DF79E679E979D87A847A887AD97B067B117C897D217D177D0B7D0A -7D207D227D147D107D157D1A7D1C7D0D7D197D1B7F3A7F5F7F947FC57FC18006 -8018801580198017803D803F80F1810280F0810580ED80F4810680F880F38108 -80FD810A80FC80EF81ED81EC82008210822A822B8228822C82BB832B83528354 -834A83388350834983358334834F833283398336831783408331832883430000 -B0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8654868A86AA869386A486A9868C86A3869C8870887788818882887D88798A18 -8A108A0E8A0C8A158A0A8A178A138A168A0F8A118C488C7A8C798CA18CA28D77 -8EAC8ED28ED48ECF8FB1900190068FF790008FFA8FF490038FFD90058FF89095 -90E190DD90E29152914D914C91D891DD91D791DC91D995839662966396610000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000965B965D96649658965E96BB98E299AC9AA89AD89B259B329B3C4E7E507A -507D505C50475043504C505A504950655076504E5055507550745077504F500F -506F506D515C519551F0526A526F52D252D952D852D55310530F5319533F5340 -533E53C366FC5546556A55665544555E55615543554A55315556554F5555552F -55645538552E555C552C55635533554155575708570B570957DF5805580A5806 -57E057E457FA5802583557F757F9592059625A365A415A495A665A6A5A400000 -B1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A3C5A625A5A5A465A4A5B705BC75BC55BC45BC25BBF5BC65C095C085C075C60 -5C5C5C5D5D075D065D0E5D1B5D165D225D115D295D145D195D245D275D175DE2 -5E385E365E335E375EB75EB85EB65EB55EBE5F355F375F575F6C5F695F6B5F97 -5F995F9E5F985FA15FA05F9C607F60A3608960A060A860CB60B460E660BD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060C560BB60B560DC60BC60D860D560C660DF60B860DA60C7621A621B6248 -63A063A76372639663A263A563776367639863AA637163A963896383639B636B -63A863846388639963A163AC6392638F6380637B63696368637A655D65566551 -65596557555F654F655865556554659C659B65AC65CF65CB65CC65CE665D665A -666466686666665E66F952D7671B688168AF68A2689368B5687F687668B168A7 -689768B0688368C468AD688668856894689D68A8689F68A168826B326BBA0000 -B2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6BEB6BEC6C2B6D8E6DBC6DF36DD96DB26DE16DCC6DE46DFB6DFA6E056DC76DCB -6DAF6DD16DAE6DDE6DF96DB86DF76DF56DC56DD26E1A6DB56DDA6DEB6DD86DEA -6DF16DEE6DE86DC66DC46DAA6DEC6DBF6DE670F97109710A70FD70EF723D727D -7281731C731B73167313731973877405740A7403740673FE740D74E074F60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000074F7751C75227565756675627570758F75D475D575B575CA75CD768E76D4 -76D276DB7737773E773C77367738773A786B7843784E79657968796D79FB7A92 -7A957B207B287B1B7B2C7B267B197B1E7B2E7C927C977C957D467D437D717D2E -7D397D3C7D407D307D337D447D2F7D427D327D317F3D7F9E7F9A7FCC7FCE7FD2 -801C804A8046812F81168123812B81298130812482028235823782368239838E -839E8398837883A2839683BD83AB8392838A8393838983A08377837B837C0000 -B3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -838683A786555F6A86C786C086B686C486B586C686CB86B186AF86C98853889E -888888AB88928896888D888B8993898F8A2A8A1D8A238A258A318A2D8A1F8A1B -8A228C498C5A8CA98CAC8CAB8CA88CAA8CA78D678D668DBE8DBA8EDB8EDF9019 -900D901A90179023901F901D90109015901E9020900F90229016901B90140000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090E890ED90FD915791CE91F591E691E391E791ED91E99589966A96759673 -96789670967496769677966C96C096EA96E97AE07ADF980298039B5A9CE59E75 -9E7F9EA59EBB50A2508D508550995091508050965098509A670051F152725274 -5275526952DE52DD52DB535A53A5557B558055A7557C558A559D55985582559C -55AA55945587558B558355B355AE559F553E55B2559A55BB55AC55B1557E5589 -55AB5599570D582F582A58345824583058315821581D582058F958FA59600000 -B4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A775A9A5A7F5A925A9B5AA75B735B715BD25BCC5BD35BD05C0A5C0B5C315D4C -5D505D345D475DFD5E455E3D5E405E435E7E5ECA5EC15EC25EC45F3C5F6D5FA9 -5FAA5FA860D160E160B260B660E0611C612360FA611560F060FB60F4616860F1 -610E60F6610961006112621F624963A3638C63CF63C063E963C963C663CD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000063D263E363D063E163D663ED63EE637663F463EA63DB645263DA63F9655E -6566656265636591659065AF666E667066746676666F6691667A667E667766FE -66FF671F671D68FA68D568E068D868D7690568DF68F568EE68E768F968D268F2 -68E368CB68CD690D6912690E68C968DA696E68FB6B3E6B3A6B3D6B986B966BBC -6BEF6C2E6C2F6C2C6E2F6E386E546E216E326E676E4A6E206E256E236E1B6E5B -6E586E246E566E6E6E2D6E266E6F6E346E4D6E3A6E2C6E436E1D6E3E6ECB0000 -B5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6E896E196E4E6E636E446E726E696E5F7119711A7126713071217136716E711C -724C728472807336732573347329743A742A743374227425743574367434742F -741B7426742875257526756B756A75E275DB75E375D975D875DE75E0767B767C -7696769376B476DC774F77ED785D786C786F7A0D7A087A0B7A057A007A980000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A977A967AE57AE37B497B567B467B507B527B547B4D7B4B7B4F7B517C9F -7CA57D5E7D507D687D557D2B7D6E7D727D617D667D627D707D7355847FD47FD5 -800B8052808581558154814B8151814E81398146813E814C815381748212821C -83E9840383F8840D83E083C5840B83C183EF83F183F48457840A83F0840C83CC -83FD83F283CA8438840E840483DC840783D483DF865B86DF86D986ED86D486DB -86E486D086DE885788C188C288B1898389968A3B8A608A558A5E8A3C8A410000 -B6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8A548A5B8A508A468A348A3A8A368A568C618C828CAF8CBC8CB38CBD8CC18CBB -8CC08CB48CB78CB68CBF8CB88D8A8D858D818DCE8DDD8DCB8DDA8DD18DCC8DDB -8DC68EFB8EF88EFC8F9C902E90359031903890329036910290F5910990FE9163 -916591CF9214921592239209921E920D9210920792119594958F958B95910000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000095939592958E968A968E968B967D96859686968D9672968496C196C596C4 -96C696C796EF96F297CC98059806980898E798EA98EF98E998F298ED99AE99AD -9EC39ECD9ED14E8250AD50B550B250B350C550BE50AC50B750BB50AF50C7527F -5277527D52DF52E652E452E252E3532F55DF55E855D355E655CE55DC55C755D1 -55E355E455EF55DA55E155C555C655E555C957125713585E585158585857585A -5854586B584C586D584A58625852584B59675AC15AC95ACC5ABE5ABD5ABC0000 -B7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5AB35AC25AB25D695D6F5E4C5E795EC95EC85F125F595FAC5FAE611A610F6148 -611F60F3611B60F961016108614E614C6144614D613E61346127610D61066137 -622162226413643E641E642A642D643D642C640F641C6414640D643664166417 -6406656C659F65B06697668966876688669666846698668D67036994696D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000695A697769606954697569306982694A6968696B695E695369796986695D -6963695B6B476B726BC06BBF6BD36BFD6EA26EAF6ED36EB66EC26E906E9D6EC7 -6EC56EA56E986EBC6EBA6EAB6ED16E966E9C6EC46ED46EAA6EA76EB4714E7159 -7169716471497167715C716C7166714C7165715E714671687156723A72527337 -7345733F733E746F745A7455745F745E7441743F7459745B745C757675787600 -75F0760175F275F175FA75FF75F475F376DE76DF775B776B7766775E77630000 -B8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7779776A776C775C77657768776277EE788E78B078977898788C7889787C7891 -7893787F797A797F7981842C79BD7A1C7A1A7A207A147A1F7A1E7A9F7AA07B77 -7BC07B607B6E7B677CB17CB37CB57D937D797D917D817D8F7D5B7F6E7F697F6A -7F727FA97FA87FA480568058808680848171817081788165816E8173816B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008179817A81668205824784828477843D843184758466846B8449846C845B -843C8435846184638469846D8446865E865C865F86F9871387088707870086FE -86FB870287038706870A885988DF88D488D988DC88D888DD88E188CA88D588D2 -899C89E38A6B8A728A738A668A698A708A878A7C8A638AA08A718A858A6D8A62 -8A6E8A6C8A798A7B8A3E8A688C628C8A8C898CCA8CC78CC88CC48CB28CC38CC2 -8CC58DE18DDF8DE88DEF8DF38DFA8DEA8DE48DE68EB28F038F098EFE8F0A0000 -B9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8F9F8FB2904B904A905390429054903C905590509047904F904E904D9051903E -904191129117916C916A916991C9923792579238923D9240923E925B924B9264 -925192349249924D92459239923F925A959896989694969596CD96CB96C996CA -96F796FB96F996F6975697749776981098119813980A9812980C98FC98F40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000098FD98FE99B399B199B49AE19CE99E829F0E9F139F2050E750EE50E550D6 -50ED50DA50D550CF50D150F150CE50E9516251F352835282533153AD55FE5600 -561B561755FD561456065609560D560E55F75616561F5608561055F657185716 -5875587E58835893588A58795885587D58FD592559225924596A59695AE15AE6 -5AE95AD75AD65AD85AE35B755BDE5BE75BE15BE55BE65BE85BE25BE45BDF5C0D -5C625D845D875E5B5E635E555E575E545ED35ED65F0A5F465F705FB961470000 -BA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -613F614B617761626163615F615A61586175622A64876458645464A46478645F -647A645164676434646D647B657265A165D765D666A266A8669D699C69A86995 -69C169AE69D369CB699B69B769BB69AB69B469D069CD69AD69CC69A669C369A3 -6B496B4C6C336F336F146EFE6F136EF46F296F3E6F206F2C6F0F6F026F220000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006EFF6EEF6F066F316F386F326F236F156F2B6F2F6F886F2A6EEC6F016EF2 -6ECC6EF771947199717D718A71847192723E729272967344735074647463746A -7470746D750475917627760D760B7609761376E176E37784777D777F776178C1 -789F78A778B378A978A3798E798F798D7A2E7A317AAA7AA97AED7AEF7BA17B95 -7B8B7B757B977B9D7B947B8F7BB87B877B847CB97CBD7CBE7DBB7DB07D9C7DBD -7DBE7DA07DCA7DB47DB27DB17DBA7DA27DBF7DB57DB87DAD7DD27DC77DAC0000 -BB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7F707FE07FE17FDF805E805A808781508180818F8188818A817F818281E781FA -82078214821E824B84C984BF84C684C48499849E84B2849C84CB84B884C084D3 -849084BC84D184CA873F871C873B872287258734871887558737872988F38902 -88F488F988F888FD88E8891A88EF8AA68A8C8A9E8AA38A8D8AA18A938AA40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008AAA8AA58AA88A988A918A9A8AA78C6A8C8D8C8C8CD38CD18CD28D6B8D99 -8D958DFC8F148F128F158F138FA390609058905C90639059905E9062905D905B -91199118911E917591789177917492789280928592989296927B9293929C92A8 -927C929195A195A895A995A395A595A49699969C969B96CC96D29700977C9785 -97F69817981898AF98B199039905990C990999C19AAF9AB09AE69B419B429CF4 -9CF69CF39EBC9F3B9F4A5104510050FB50F550F9510251085109510551DC0000 -BC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -528752885289528D528A52F053B2562E563B56395632563F563456295653564E -565756745636562F56305880589F589E58B3589C58AE58A958A6596D5B095AFB -5B0B5AF55B0C5B085BEE5BEC5BE95BEB5C645C655D9D5D945E625E5F5E615EE2 -5EDA5EDF5EDD5EE35EE05F485F715FB75FB561766167616E615D615561820000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000617C6170616B617E61A7619061AB618E61AC619A61A4619461AE622E6469 -646F6479649E64B26488649064B064A56493649564A9649264AE64AD64AB649A -64AC649964A264B365756577657866AE66AB66B466B16A236A1F69E86A016A1E -6A1969FD6A216A136A0A69F36A026A0569ED6A116B506B4E6BA46BC56BC66F3F -6F7C6F846F516F666F546F866F6D6F5B6F786F6E6F8E6F7A6F706F646F976F58 -6ED56F6F6F606F5F719F71AC71B171A87256729B734E73577469748B74830000 -BD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -747E7480757F76207629761F7624762676217622769A76BA76E4778E7787778C -7791778B78CB78C578BA78CA78BE78D578BC78D07A3F7A3C7A407A3D7A377A3B -7AAF7AAE7BAD7BB17BC47BB47BC67BC77BC17BA07BCC7CCA7DE07DF47DEF7DFB -7DD87DEC7DDD7DE87DE37DDA7DDE7DE97D9E7DD97DF27DF97F757F777FAF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007FE98026819B819C819D81A0819A81988517853D851A84EE852C852D8513 -851185238521851484EC852584FF850687828774877687608766877887688759 -8757874C8753885B885D89108907891289138915890A8ABC8AD28AC78AC48A95 -8ACB8AF88AB28AC98AC28ABF8AB08AD68ACD8AB68AB98ADB8C4C8C4E8C6C8CE0 -8CDE8CE68CE48CEC8CED8CE28CE38CDC8CEA8CE18D6D8D9F8DA38E2B8E108E1D -8E228E0F8E298E1F8E218E1E8EBA8F1D8F1B8F1F8F298F268F2A8F1C8F1E0000 -BE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8F259069906E9068906D90779130912D9127913191879189918B918392C592BB -92B792EA92AC92E492C192B392BC92D292C792F092B295AD95B1970497069707 -97099760978D978B978F9821982B981C98B3990A99139912991899DD99D099DF -99DB99D199D599D299D99AB79AEE9AEF9B279B459B449B779B6F9D069D090000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009D039EA99EBE9ECE58A89F5251125118511451105115518051AA51DD5291 -529352F35659566B5679566956645678566A566856655671566F566C56625676 -58C158BE58C758C5596E5B1D5B345B785BF05C0E5F4A61B2619161A9618A61CD -61B661BE61CA61C8623064C564C164CB64BB64BC64DA64C464C764C264CD64BF -64D264D464BE657466C666C966B966C466C766B86A3D6A386A3A6A596A6B6A58 -6A396A446A626A616A4B6A476A356A5F6A486B596B776C056FC26FB16FA10000 -BF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6FC36FA46FC16FA76FB36FC06FB96FB66FA66FA06FB471BE71C971D071D271C8 -71D571B971CE71D971DC71C371C47368749C74A37498749F749E74E2750C750D -76347638763A76E776E577A0779E779F77A578E878DA78EC78E779A67A4D7A4E -7A467A4C7A4B7ABA7BD97C117BC97BE47BDB7BE17BE97BE67CD57CD67E0A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007E117E087E1B7E237E1E7E1D7E097E107F797FB27FF07FF17FEE802881B3 -81A981A881FB820882588259854A855985488568856985438549856D856A855E -8783879F879E87A2878D8861892A89328925892B892189AA89A68AE68AFA8AEB -8AF18B008ADC8AE78AEE8AFE8B018B028AF78AED8AF38AF68AFC8C6B8C6D8C93 -8CF48E448E318E348E428E398E358F3B8F2F8F388F338FA88FA6907590749078 -9072907C907A913491929320933692F89333932F932292FC932B9304931A0000 -C0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9310932693219315932E931995BB96A796A896AA96D5970E97119716970D9713 -970F975B975C9766979898309838983B9837982D9839982499109928991E991B -9921991A99ED99E299F19AB89ABC9AFB9AED9B289B919D159D239D269D289D12 -9D1B9ED89ED49F8D9F9C512A511F5121513252F5568E56805690568556870000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000568F58D558D358D158CE5B305B2A5B245B7A5C375C685DBC5DBA5DBD5DB8 -5E6B5F4C5FBD61C961C261C761E661CB6232623464CE64CA64D864E064F064E6 -64EC64F164E264ED6582658366D966D66A806A946A846AA26A9C6ADB6AA36A7E -6A976A906AA06B5C6BAE6BDA6C086FD86FF16FDF6FE06FDB6FE46FEB6FEF6F80 -6FEC6FE16FE96FD56FEE6FF071E771DF71EE71E671E571ED71EC71F471E07235 -72467370737274A974B074A674A876467642764C76EA77B377AA77B077AC0000 -C1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -77A777AD77EF78F778FA78F478EF790179A779AA7A577ABF7C077C0D7BFE7BF7 -7C0C7BE07CE07CDC7CDE7CE27CDF7CD97CDD7E2E7E3E7E467E377E327E437E2B -7E3D7E317E457E417E347E397E487E357E3F7E2F7F447FF37FFC807180728070 -806F807381C681C381BA81C281C081BF81BD81C981BE81E88209827185AA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008584857E859C8591859485AF859B858785A8858A866787C087D187B387D2 -87C687AB87BB87BA87C887CB893B893689448938893D89AC8B0E8B178B198B1B -8B0A8B208B1D8B048B108C418C3F8C738CFA8CFD8CFC8CF88CFB8DA88E498E4B -8E488E4A8F448F3E8F428F458F3F907F907D9084908190829080913991A3919E -919C934D938293289375934A9365934B9318937E936C935B9370935A935495CA -95CB95CC95C895C696B196B896D6971C971E97A097D3984698B699359A010000 -C2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -99FF9BAE9BAB9BAA9BAD9D3B9D3F9E8B9ECF9EDE9EDC9EDD9EDB9F3E9F4B53E2 -569556AE58D958D85B385F5D61E3623364F464F264FE650664FA64FB64F765B7 -66DC67266AB36AAC6AC36ABB6AB86AC26AAE6AAF6B5F6B786BAF7009700B6FFE -70066FFA7011700F71FB71FC71FE71F87377737574A774BF7515765676580000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000765277BD77BF77BB77BC790E79AE7A617A627A607AC47AC57C2B7C277C2A -7C1E7C237C217CE77E547E557E5E7E5A7E617E527E597F487FF97FFB80778076 -81CD81CF820A85CF85A985CD85D085C985B085BA85B985A687EF87EC87F287E0 -898689B289F48B288B398B2C8B2B8C508D058E598E638E668E648E5F8E558EC0 -8F498F4D90879083908891AB91AC91D09394938A939693A293B393AE93AC93B0 -9398939A939795D495D695D095D596E296DC96D996DB96DE972497A397A60000 -C3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -97AD97F9984D984F984C984E985398BA993E993F993D992E99A59A0E9AC19B03 -9B069B4F9B4E9B4D9BCA9BC99BFD9BC89BC09D519D5D9D609EE09F159F2C5133 -56A558DE58DF58E25BF59F905EEC61F261F761F661F56500650F66E066DD6AE5 -6ADD6ADA6AD3701B701F7028701A701D701570187206720D725872A273780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000737A74BD74CA74E375877586765F766177C7791979B17A6B7A697C3E7C3F -7C387C3D7C377C407E6B7E6D7E797E697E6A7F857E737FB67FB97FB881D885E9 -85DD85EA85D585E485E585F787FB8805880D87F987FE8960895F8956895E8B41 -8B5C8B588B498B5A8B4E8B4F8B468B598D088D0A8E7C8E728E878E768E6C8E7A -8E748F548F4E8FAD908A908B91B191AE93E193D193DF93C393C893DC93DD93D6 -93E293CD93D893E493D793E895DC96B496E3972A9727976197DC97FB985E0000 -C4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9858985B98BC994599499A169A199B0D9BE89BE79BD69BDB9D899D619D729D6A -9D6C9E929E979E939EB452F856A856B756B656B456BC58E45B405B435B7D5BF6 -5DC961F861FA65186514651966E667276AEC703E703070327210737B74CF7662 -76657926792A792C792B7AC77AF67C4C7C437C4D7CEF7CF08FAE7E7D7E7C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007E827F4C800081DA826685FB85F9861185FA8606860B8607860A88148815 -896489BA89F88B708B6C8B668B6F8B5F8B6B8D0F8D0D8E898E818E858E8291B4 -91CB9418940393FD95E1973098C49952995199A89A2B9A309A379A359C139C0D -9E799EB59EE89F2F9F5F9F639F615137513856C156C056C259145C6C5DCD61FC -61FE651D651C659566E96AFB6B046AFA6BB2704C721B72A774D674D4766977D3 -7C507E8F7E8C7FBC8617862D861A882388228821881F896A896C89BD8B740000 -C5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B778B7D8D138E8A8E8D8E8B8F5F8FAF91BA942E94339435943A94389432942B -95E297389739973297FF9867986599579A459A439A409A3E9ACF9B549B519C2D -9C259DAF9DB49DC29DB89E9D9EEF9F199F5C9F669F67513C513B56C856CA56C9 -5B7F5DD45DD25F4E61FF65246B0A6B6170517058738074E4758A766E766C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000079B37C607C5F807E807D81DF8972896F89FC8B808D168D178E918E938F61 -9148944494519452973D973E97C397C1986B99559A559A4D9AD29B1A9C499C31 -9C3E9C3B9DD39DD79F349F6C9F6A9F9456CC5DD662006523652B652A66EC6B10 -74DA7ACA7C647C637C657E937E967E9481E28638863F88318B8A9090908F9463 -946094649768986F995C9A5A9A5B9A579AD39AD49AD19C549C579C569DE59E9F -9EF456D158E9652C705E7671767277D77F507F888836883988628B938B920000 -C6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B9682778D1B91C0946A97429748974497C698709A5F9B229B589C5F9DF99DFA -9E7C9E7D9F079F779F725EF36B1670637C6C7C6E883B89C08EA191C194729470 -9871995E9AD69B239ECC706477DA8B9A947797C99A629A657E9C8B9C8EAA91C5 -947D947E947C9C779C789EF78C54947F9E1A72289A6A9B319E1B9E1E7C720000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -C9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E424E5C51F5531A53824E074E0C4E474E8D56D7FA0C5C6E5F734E0F51874E0E -4E2E4E934EC24EC94EC8519852FC536C53B957205903592C5C105DFF65E16BB3 -6BCC6C14723F4E314E3C4EE84EDC4EE94EE14EDD4EDA520C531C534C57225723 -5917592F5B815B845C125C3B5C745C735E045E805E825FC9620962506C150000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006C366C436C3F6C3B72AE72B0738A79B8808A961E4F0E4F184F2C4EF54F14 -4EF14F004EF74F084F1D4F024F054F224F134F044EF44F1251B1521352095210 -52A65322531F534D538A540756E156DF572E572A5734593C5980597C5985597B -597E5977597F5B565C155C255C7C5C7A5C7B5C7E5DDF5E755E845F025F1A5F74 -5FD55FD45FCF625C625E626462616266626262596260625A626565EF65EE673E -67396738673B673A673F673C67336C186C466C526C5C6C4F6C4A6C546C4B0000 -CA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6C4C7071725E72B472B5738E752A767F7A757F518278827C8280827D827F864D -897E909990979098909B909496229624962096234F564F3B4F624F494F534F64 -4F3E4F674F524F5F4F414F584F2D4F334F3F4F61518F51B9521C521E522152AD -52AE530953635372538E538F54305437542A545454455419541C542554180000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000543D544F544154285424544756EE56E756E557415745574C5749574B5752 -5906594059A6599859A05997598E59A25990598F59A759A15B8E5B925C285C2A -5C8D5C8F5C885C8B5C895C925C8A5C865C935C955DE05E0A5E0E5E8B5E895E8C -5E885E8D5F055F1D5F785F765FD25FD15FD05FED5FE85FEE5FF35FE15FE45FE3 -5FFA5FEF5FF75FFB60005FF4623A6283628C628E628F629462876271627B627A -6270628162886277627D62726274653765F065F465F365F265F5674567470000 -CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67596755674C6748675D674D675A674B6BD06C196C1A6C786C676C6B6C846C8B -6C8F6C716C6F6C696C9A6C6D6C876C956C9C6C666C736C656C7B6C8E7074707A -726372BF72BD72C372C672C172BA72C573957397739373947392753A75397594 -75957681793D80348095809980908092809C8290828F8285828E829182930000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000828A828382848C788FC98FBF909F90A190A5909E90A790A096309628962F -962D4E334F984F7C4F854F7D4F804F874F764F744F894F844F774F4C4F974F6A -4F9A4F794F814F784F904F9C4F944F9E4F924F824F954F6B4F6E519E51BC51BE -5235523252335246523152BC530A530B533C539253945487547F548154915482 -5488546B547A547E5465546C54745466548D546F546154605498546354675464 -56F756F9576F5772576D576B57715770577657805775577B5773577457620000 -CC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5768577D590C594559B559BA59CF59CE59B259CC59C159B659BC59C359D659B1 -59BD59C059C859B459C75B625B655B935B955C445C475CAE5CA45CA05CB55CAF -5CA85CAC5C9F5CA35CAD5CA25CAA5CA75C9D5CA55CB65CB05CA65E175E145E19 -5F285F225F235F245F545F825F7E5F7D5FDE5FE5602D602660196032600B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006034600A60176033601A601E602C6022600D6010602E60136011600C6009 -601C6214623D62AD62B462D162BE62AA62B662CA62AE62B362AF62BB62A962B0 -62B8653D65A865BB660965FC66046612660865FB6603660B660D660565FD6611 -661066F6670A6785676C678E67926776677B6798678667846774678D678C677A -679F679167996783677D67816778677967946B256B806B7E6BDE6C1D6C936CEC -6CEB6CEE6CD96CB66CD46CAD6CE76CB76CD06CC26CBA6CC36CC66CED6CF20000 -CD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6CD26CDD6CB46C8A6C9D6C806CDE6CC06D306CCD6CC76CB06CF96CCF6CE96CD1 -709470987085709370867084709170967082709A7083726A72D672CB72D872C9 -72DC72D272D472DA72CC72D173A473A173AD73A673A273A073AC739D74DD74E8 -753F7540753E758C759876AF76F376F176F076F577F877FC77F977FB77FA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077F77942793F79C57A787A7B7AFB7C757CFD8035808F80AE80A380B880B5 -80AD822082A082C082AB829A8298829B82B582A782AE82BC829E82BA82B482A8 -82A182A982C282A482C382B682A28670866F866D866E8C568FD28FCB8FD38FCD -8FD68FD58FD790B290B490AF90B390B09639963D963C963A96434FCD4FC54FD3 -4FB24FC94FCB4FC14FD44FDC4FD94FBB4FB34FDB4FC74FD64FBA4FC04FB94FEC -5244524952C052C2533D537C539753965399539854BA54A154AD54A554CF0000 -CE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54C3830D54B754AE54D654B654C554C654A0547054BC54A254BE547254DE54B0 -57B5579E579F57A4578C5797579D579B57945798578F579957A5579A579558F4 -590D595359E159DE59EE5A0059F159DD59FA59FD59FC59F659E459F259F759DB -59E959F359F559E059FE59F459ED5BA85C4C5CD05CD85CCC5CD75CCB5CDB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005CDE5CDA5CC95CC75CCA5CD65CD35CD45CCF5CC85CC65CCE5CDF5CF85DF9 -5E215E225E235E205E245EB05EA45EA25E9B5EA35EA55F075F2E5F565F866037 -603960546072605E6045605360476049605B604C60406042605F602460446058 -6066606E6242624362CF630D630B62F5630E630362EB62F9630F630C62F862F6 -63006313631462FA631562FB62F06541654365AA65BF6636662166326635661C -662666226633662B663A661D66346639662E670F671067C167F267C867BA0000 -CF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67DC67BB67F867D867C067B767C567EB67E467DF67B567CD67B367F767F667EE -67E367C267B967CE67E767F067B267FC67C667ED67CC67AE67E667DB67FA67C9 -67CA67C367EA67CB6B286B826B846BB66BD66BD86BE06C206C216D286D346D2D -6D1F6D3C6D3F6D126D0A6CDA6D336D046D196D3A6D1A6D116D006D1D6D420000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D016D186D376D036D0F6D406D076D206D2C6D086D226D096D1070B7709F -70BE70B170B070A170B470B570A972417249724A726C72707273726E72CA72E4 -72E872EB72DF72EA72E672E3738573CC73C273C873C573B973B673B573B473EB -73BF73C773BE73C373C673B873CB74EC74EE752E7547754875A775AA767976C4 -7708770377047705770A76F776FB76FA77E777E878067811781278057810780F -780E780978037813794A794C794B7945794479D579CD79CF79D679CE7A800000 -D0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7A7E7AD17B007B017C7A7C787C797C7F7C807C817D037D087D017F587F917F8D -7FBE8007800E800F8014803780D880C780E080D180C880C280D080C580E380D9 -80DC80CA80D580C980CF80D780E680CD81FF8221829482D982FE82F9830782E8 -830082D5833A82EB82D682F482EC82E182F282F5830C82FB82F682F082EA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000082E482E082FA82F382ED86778674867C86738841884E8867886A886989D3 -8A048A078D728FE38FE18FEE8FE090F190BD90BF90D590C590BE90C790CB90C8 -91D491D39654964F96519653964A964E501E50055007501350225030501B4FF5 -4FF450335037502C4FF64FF75017501C502050275035502F5031500E515A5194 -519351CA51C451C551C851CE5261525A5252525E525F5255526252CD530E539E -552654E25517551254E754F354E4551A54FF5504550854EB5511550554F10000 -D1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -550A54FB54F754F854E0550E5503550B5701570257CC583257D557D257BA57C6 -57BD57BC57B857B657BF57C757D057B957C1590E594A5A195A165A2D5A2E5A15 -5A0F5A175A0A5A1E5A335B6C5BA75BAD5BAC5C035C565C545CEC5CFF5CEE5CF1 -5CF75D005CF95E295E285EA85EAE5EAA5EAC5F335F305F67605D605A60670000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000604160A26088608060926081609D60836095609B60976087609C608E6219 -624662F263106356632C634463456336634363E46339634B634A633C63296341 -6334635863546359632D63476333635A63516338635763406348654A654665C6 -65C365C465C2664A665F6647665167126713681F681A684968326833683B684B -684F68166831681C6835682B682D682F684E68446834681D6812681468266828 -682E684D683A682568206B2C6B2F6B2D6B316B346B6D80826B886BE66BE40000 -D2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6BE86BE36BE26BE76C256D7A6D636D646D766D0D6D616D926D586D626D6D6D6F -6D916D8D6DEF6D7F6D866D5E6D676D606D976D706D7C6D5F6D826D986D2F6D68 -6D8B6D7E6D806D846D166D836D7B6D7D6D756D9070DC70D370D170DD70CB7F39 -70E270D770D270DE70E070D470CD70C570C670C770DA70CE70E1724272780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000072777276730072FA72F472FE72F672F372FB730173D373D973E573D673BC -73E773E373E973DC73D273DB73D473DD73DA73D773D873E874DE74DF74F474F5 -7521755B755F75B075C175BB75C475C075BF75B675BA768A76C9771D771B7710 -771377127723771177157719771A772277277823782C78227835782F7828782E -782B782178297833782A78317954795B794F795C79537952795179EB79EC79E0 -79EE79ED79EA79DC79DE79DD7A867A897A857A8B7A8C7A8A7A877AD87B100000 -D3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7B047B137B057B0F7B087B0A7B0E7B097B127C847C917C8A7C8C7C887C8D7C85 -7D1E7D1D7D117D0E7D187D167D137D1F7D127D0F7D0C7F5C7F617F5E7F607F5D -7F5B7F967F927FC37FC27FC08016803E803980FA80F280F980F5810180FB8100 -8201822F82258333832D83448319835183258356833F83418326831C83220000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008342834E831B832A8308833C834D8316832483208337832F832983478345 -834C8353831E832C834B832783488653865286A286A88696868D8691869E8687 -86978686868B869A868586A5869986A186A786958698868E869D869086948843 -8844886D88758876887288808871887F886F8883887E8874887C8A128C478C57 -8C7B8CA48CA38D768D788DB58DB78DB68ED18ED38FFE8FF590028FFF8FFB9004 -8FFC8FF690D690E090D990DA90E390DF90E590D890DB90D790DC90E491500000 -D4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -914E914F91D591E291DA965C965F96BC98E39ADF9B2F4E7F5070506A5061505E -50605053504B505D50725048504D5041505B504A506250155045505F5069506B -5063506450465040506E50735057505151D0526B526D526C526E52D652D3532D -539C55755576553C554D55505534552A55515562553655355530555255450000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000550C55325565554E55395548552D553B5540554B570A570757FB581457E2 -57F657DC57F4580057ED57FD580857F8580B57F357CF580757EE57E357F257E5 -57EC57E1580E57FC581057E75801580C57F157E957F0580D5804595C5A605A58 -5A555A675A5E5A385A355A6D5A505A5F5A655A6C5A535A645A575A435A5D5A52 -5A445A5B5A485A8E5A3E5A4D5A395A4C5A705A695A475A515A565A425A5C5B72 -5B6E5BC15BC05C595D1E5D0B5D1D5D1A5D205D0C5D285D0D5D265D255D0F0000 -D5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5D305D125D235D1F5D2E5E3E5E345EB15EB45EB95EB25EB35F365F385F9B5F96 -5F9F608A6090608660BE60B060BA60D360D460CF60E460D960DD60C860B160DB -60B760CA60BF60C360CD60C063326365638A6382637D63BD639E63AD639D6397 -63AB638E636F63876390636E63AF6375639C636D63AE637C63A4633B639F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006378638563816391638D6370655365CD66656661665B6659665C66626718 -687968876890689C686D686E68AE68AB6956686F68A368AC68A96875687468B2 -688F68776892687C686B687268AA68806871687E689B6896688B68A0688968A4 -6878687B6891688C688A687D6B366B336B376B386B916B8F6B8D6B8E6B8C6C2A -6DC06DAB6DB46DB36E746DAC6DE96DE26DB76DF66DD46E006DC86DE06DDF6DD6 -6DBE6DE56DDC6DDD6DDB6DF46DCA6DBD6DED6DF06DBA6DD56DC26DCF6DC90000 -D6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6DD06DF26DD36DFD6DD76DCD6DE36DBB70FA710D70F7711770F4710C70F07104 -70F3711070FC70FF71067113710070F870F6710B7102710E727E727B727C727F -731D7317730773117318730A730872FF730F731E738873F673F873F574047401 -73FD7407740073FA73FC73FF740C740B73F474087564756375CE75D275CF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075CB75CC75D175D0768F768976D37739772F772D7731773277347733773D -7725773B7735784878527849784D784A784C782678457850796479677969796A -7963796B796179BB79FA79F879F679F77A8F7A947A907B357B477B347B257B30 -7B227B247B337B187B2A7B1D7B317B2B7B2D7B2F7B327B387B1A7B237C947C98 -7C967CA37D357D3D7D387D367D3A7D457D2C7D297D417D477D3E7D3F7D4A7D3B -7D287F637F957F9C7F9D7F9B7FCA7FCB7FCD7FD07FD17FC77FCF7FC9801F0000 -D7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -801E801B804780438048811881258119811B812D811F812C811E812181158127 -811D8122821182388233823A823482328274839083A383A8838D837A837383A4 -8374838F8381839583998375839483A9837D8383838C839D839B83AA838B837E -83A583AF8388839783B0837F83A6838783AE8376839A8659865686BF86B70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000086C286C186C586BA86B086C886B986B386B886CC86B486BB86BC86C386BD -86BE88528889889588A888A288AA889A889188A1889F889888A78899889B8897 -88A488AC888C8893888E898289D689D989D58A308A278A2C8A1E8C398C3B8C5C -8C5D8C7D8CA58D7D8D7B8D798DBC8DC28DB98DBF8DC18ED88EDE8EDD8EDC8ED7 -8EE08EE19024900B9011901C900C902190EF90EA90F090F490F290F390D490EB -90EC90E991569158915A9153915591EC91F491F191F391F891E491F991EA0000 -D8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -91EB91F791E891EE957A95869588967C966D966B9671966F96BF976A980498E5 -9997509B50955094509E508B50A35083508C508E509D5068509C509250825087 -515F51D45312531153A453A7559155A855A555AD5577564555A255935588558F -55B5558155A3559255A4557D558C55A6557F559555A1558E570C582958370000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005819581E58275823582857F558485825581C581B5833583F5836582E5839 -5838582D582C583B59615AAF5A945A9F5A7A5AA25A9E5A785AA65A7C5AA55AAC -5A955AAE5A375A845A8A5A975A835A8B5AA95A7B5A7D5A8C5A9C5A8F5A935A9D -5BEA5BCD5BCB5BD45BD15BCA5BCE5C0C5C305D375D435D6B5D415D4B5D3F5D35 -5D515D4E5D555D335D3A5D525D3D5D315D595D425D395D495D385D3C5D325D36 -5D405D455E445E415F585FA65FA55FAB60C960B960CC60E260CE60C461140000 -D9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -60F2610A6116610560F5611360F860FC60FE60C161036118611D611060FF6104 -610B624A639463B163B063CE63E563E863EF63C3649D63F363CA63E063F663D5 -63F263F5646163DF63BE63DD63DC63C463D863D363C263C763CC63CB63C863F0 -63D763D965326567656A6564655C65686565658C659D659E65AE65D065D20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000667C666C667B668066716679666A66726701690C68D3690468DC692A68EC -68EA68F1690F68D668F768EB68E468F66913691068F368E1690768CC69086970 -68B4691168EF68C6691468F868D068FD68FC68E8690B690A691768CE68C868DD -68DE68E668F468D1690668D468E96915692568C76B396B3B6B3F6B3C6B946B97 -6B996B956BBD6BF06BF26BF36C306DFC6E466E476E1F6E496E886E3C6E3D6E45 -6E626E2B6E3F6E416E5D6E736E1C6E336E4B6E406E516E3B6E036E2E6E5E0000 -DA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6E686E5C6E616E316E286E606E716E6B6E396E226E306E536E656E276E786E64 -6E776E556E796E526E666E356E366E5A7120711E712F70FB712E713171237125 -71227132711F7128713A711B724B725A7288728972867285728B7312730B7330 -73227331733373277332732D732673237335730C742E742C7430742B74160000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000741A7421742D743174247423741D74297420743274FB752F756F756C75E7 -75DA75E175E675DD75DF75E475D77695769276DA774677477744774D7745774A -774E774B774C77DE77EC786078647865785C786D7871786A786E787078697868 -785E786279747973797279707A027A0A7A037A0C7A047A997AE67AE47B4A7B3B -7B447B487B4C7B4E7B407B587B457CA27C9E7CA87CA17D587D6F7D637D537D56 -7D677D6A7D4F7D6D7D5C7D6B7D527D547D697D517D5F7D4E7F3E7F3F7F650000 -DB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7F667FA27FA07FA17FD78051804F805080FE80D48143814A8152814F8147813D -814D813A81E681EE81F781F881F98204823C823D823F8275833B83CF83F98423 -83C083E8841283E783E483FC83F6841083C683C883EB83E383BF840183DD83E5 -83D883FF83E183CB83CE83D683F583C98409840F83DE8411840683C283F30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000083D583FA83C783D183EA841383C383EC83EE83C483FB83D783E2841B83DB -83FE86D886E286E686D386E386DA86EA86DD86EB86DC86EC86E986D786E886D1 -88488856885588BA88D788B988B888C088BE88B688BC88B788BD88B2890188C9 -89958998899789DD89DA89DB8A4E8A4D8A398A598A408A578A588A448A458A52 -8A488A518A4A8A4C8A4F8C5F8C818C808CBA8CBE8CB08CB98CB58D848D808D89 -8DD88DD38DCD8DC78DD68DDC8DCF8DD58DD98DC88DD78DC58EEF8EF78EFA0000 -DC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8EF98EE68EEE8EE58EF58EE78EE88EF68EEB8EF18EEC8EF48EE9902D9034902F -9106912C910490FF90FC910890F990FB9101910091079105910391619164915F -916291609201920A92259203921A9226920F920C9200921291FF91FD92069204 -92279202921C92249219921792059216957B958D958C95909687967E96880000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000096899683968096C296C896C396F196F0976C9770976E980798A998EB9CE6 -9EF94E834E844EB650BD50BF50C650AE50C450CA50B450C850C250B050C150BA -50B150CB50C950B650B851D7527A5278527B527C55C355DB55CC55D055CB55CA -55DD55C055D455C455E955BF55D2558D55CF55D555E255D655C855F255CD55D9 -55C25714585358685864584F584D5849586F5855584E585D58595865585B583D -5863587158FC5AC75AC45ACB5ABA5AB85AB15AB55AB05ABF5AC85ABB5AC60000 -DD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5AB75AC05ACA5AB45AB65ACD5AB95A905BD65BD85BD95C1F5C335D715D635D4A -5D655D725D6C5D5E5D685D675D625DF05E4F5E4E5E4A5E4D5E4B5EC55ECC5EC6 -5ECB5EC75F405FAF5FAD60F76149614A612B614561366132612E6146612F614F -612961406220916862236225622463C563F163EB641064126409642064240000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000064336443641F641564186439643764226423640C64266430642864416435 -642F640A641A644064256427640B63E7641B642E6421640E656F659265D36686 -668C66956690668B668A66996694667867206966695F6938694E69626971693F -6945696A6939694269576959697A694869496935696C6933693D696568F06978 -693469696940696F69446976695869416974694C693B694B6937695C694F6951 -69326952692F697B693C6B466B456B436B426B486B416B9BFA0D6BFB6BFC0000 -DE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6BF96BF76BF86E9B6ED66EC86E8F6EC06E9F6E936E946EA06EB16EB96EC66ED2 -6EBD6EC16E9E6EC96EB76EB06ECD6EA66ECF6EB26EBE6EC36EDC6ED86E996E92 -6E8E6E8D6EA46EA16EBF6EB36ED06ECA6E976EAE6EA371477154715271637160 -7141715D716271727178716A7161714271587143714B7170715F715071530000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007144714D715A724F728D728C72917290728E733C7342733B733A7340734A -73497444744A744B7452745174577440744F7450744E74427446744D745474E1 -74FF74FE74FD751D75797577698375EF760F760375F775FE75FC75F975F87610 -75FB75F675ED75F575FD769976B576DD7755775F776077527756775A77697767 -77547759776D77E07887789A7894788F788478957885788678A1788378797899 -78807896787B797C7982797D79797A117A187A197A127A177A157A227A130000 -DF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7A1B7A107AA37AA27A9E7AEB7B667B647B6D7B747B697B727B657B737B717B70 -7B617B787B767B637CB27CB47CAF7D887D867D807D8D7D7F7D857D7A7D8E7D7B -7D837D7C7D8C7D947D847D7D7D927F6D7F6B7F677F687F6C7FA67FA57FA77FDB -7FDC8021816481608177815C8169815B816281726721815E81768167816F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081448161821D8249824482408242824584F1843F845684768479848F848D -846584518440848684678430844D847D845A845984748473845D8507845E8437 -843A8434847A8443847884328445842983D9844B842F8442842D845F84708439 -844E844C8452846F84C5848E843B8447843684338468847E8444842B84608454 -846E8450870B870486F7870C86FA86D686F5874D86F8870E8709870186F6870D -870588D688CB88CD88CE88DE88DB88DA88CC88D08985899B89DF89E589E40000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -89E189E089E289DC89E68A768A868A7F8A618A3F8A778A828A848A758A838A81 -8A748A7A8C3C8C4B8C4A8C658C648C668C868C848C858CCC8D688D698D918D8C -8D8E8D8F8D8D8D938D948D908D928DF08DE08DEC8DF18DEE8DD08DE98DE38DE2 -8DE78DF28DEB8DF48F068EFF8F018F008F058F078F088F028F0B9052903F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090449049903D9110910D910F911191169114910B910E916E916F92489252 -9230923A926692339265925E9283922E924A9246926D926C924F92609267926F -92369261927092319254926392509272924E9253924C92569232959F959C959E -959B969296939691969796CE96FA96FD96F896F59773977797789772980F980D -980E98AC98F698F999AF99B299B099B59AAD9AAB9B5B9CEA9CED9CE79E809EFD -50E650D450D750E850F350DB50EA50DD50E450D350EC50F050EF50E350E00000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -51D85280528152E952EB533053AC56275615560C561255FC560F561C56015613 -560255FA561D560455FF55F95889587C5890589858865881587F5874588B587A -58875891588E587658825888587B5894588F58FE596B5ADC5AEE5AE55AD55AEA -5ADA5AED5AEB5AF35AE25AE05ADB5AEC5ADE5ADD5AD95AE85ADF5B775BE00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005BE35C635D825D805D7D5D865D7A5D815D775D8A5D895D885D7E5D7C5D8D -5D795D7F5E585E595E535ED85ED15ED75ECE5EDC5ED55ED95ED25ED45F445F43 -5F6F5FB6612C61286141615E61716173615261536172616C618061746154617A -615B6165613B616A6161615662296227622B642B644D645B645D647464766472 -6473647D6475646664A6644E6482645E645C644B645364606450647F643F646C -646B645964656477657365A066A166A0669F67056704672269B169B669C90000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -69A069CE699669B069AC69BC69916999698E69A7698D69A969BE69AF69BF69C4 -69BD69A469D469B969CA699A69CF69B3699369AA69A1699E69D96997699069C2 -69B569A569C66B4A6B4D6B4B6B9E6B9F6BA06BC36BC46BFE6ECE6EF56EF16F03 -6F256EF86F376EFB6F2E6F096F4E6F196F1A6F276F186F3B6F126EED6F0A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006F366F736EF96EEE6F2D6F406F306F3C6F356EEB6F076F0E6F436F056EFD -6EF66F396F1C6EFC6F3A6F1F6F0D6F1E6F086F21718771907189718071857182 -718F717B718671817197724472537297729572937343734D7351734C74627473 -7471747574727467746E750075027503757D759076167608760C76157611760A -761476B87781777C77857782776E7780776F777E778378B278AA78B478AD78A8 -787E78AB789E78A578A078AC78A278A47998798A798B79967995799479930000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -79977988799279907A2B7A4A7A307A2F7A287A267AA87AAB7AAC7AEE7B887B9C -7B8A7B917B907B967B8D7B8C7B9B7B8E7B857B9852847B997BA47B827CBB7CBF -7CBC7CBA7DA77DB77DC27DA37DAA7DC17DC07DC57D9D7DCE7DC47DC67DCB7DCC -7DAF7DB97D967DBC7D9F7DA67DAE7DA97DA17DC97F737FE27FE37FE57FDE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008024805D805C8189818681838187818D818C818B8215849784A484A1849F -84BA84CE84C284AC84AE84AB84B984B484C184CD84AA849A84B184D0849D84A7 -84BB84A2849484C784CC849B84A984AF84A884D6849884B684CF84A084D784D4 -84D284DB84B084918661873387238728876B8740872E871E87218719871B8743 -872C8741873E874687208732872A872D873C8712873A87318735874287268727 -87388724871A8730871188F788E788F188F288FA88FE88EE88FC88F688FB0000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -88F088EC88EB899D89A1899F899E89E989EB89E88AAB8A998A8B8A928A8F8A96 -8C3D8C688C698CD58CCF8CD78D968E098E028DFF8E0D8DFD8E0A8E038E078E06 -8E058DFE8E008E048F108F118F0E8F0D9123911C91209122911F911D911A9124 -9121911B917A91729179917392A592A49276929B927A92A0929492AA928D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000092A6929A92AB92799297927F92A392EE928E9282929592A2927D928892A1 -928A9286928C929992A7927E928792A9929D928B922D969E96A196FF9758977D -977A977E978397809782977B97849781977F97CE97CD981698AD98AE99029900 -9907999D999C99C399B999BB99BA99C299BD99C79AB19AE39AE79B3E9B3F9B60 -9B619B5F9CF19CF29CF59EA750FF5103513050F85106510750F650FE510B510C -50FD510A528B528C52F152EF56485642564C56355641564A5649564656580000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -565A56405633563D562C563E5638562A563A571A58AB589D58B158A058A358AF -58AC58A558A158FF5AFF5AF45AFD5AF75AF65B035AF85B025AF95B015B075B05 -5B0F5C675D995D975D9F5D925DA25D935D955DA05D9C5DA15D9A5D9E5E695E5D -5E605E5C7DF35EDB5EDE5EE15F495FB2618B6183617961B161B061A261890000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000619B619361AF61AD619F619261AA61A1618D616661B3622D646E64706496 -64A064856497649C648F648B648A648C64A3649F646864B164986576657A6579 -657B65B265B366B566B066A966B266B766AA66AF6A006A066A1769E569F86A15 -69F169E46A2069FF69EC69E26A1B6A1D69FE6A2769F269EE6A1469F769E76A40 -6A0869E669FB6A0D69FC69EB6A096A046A186A256A0F69F66A266A0769F46A16 -6B516BA56BA36BA26BA66C016C006BFF6C026F416F266F7E6F876FC66F920000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F8D6F896F8C6F626F4F6F856F5A6F966F766F6C6F826F556F726F526F506F57 -6F946F936F5D6F006F616F6B6F7D6F676F906F536F8B6F696F7F6F956F636F77 -6F6A6F7B71B271AF719B71B071A0719A71A971B5719D71A5719E71A471A171AA -719C71A771B37298729A73587352735E735F7360735D735B7361735A73590000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000736274877489748A74867481747D74857488747C747975087507757E7625 -761E7619761D761C7623761A7628761B769C769D769E769B778D778F77897788 -78CD78BB78CF78CC78D178CE78D478C878C378C478C9799A79A179A0799C79A2 -799B6B767A397AB27AB47AB37BB77BCB7BBE7BAC7BCE7BAF7BB97BCA7BB57CC5 -7CC87CCC7CCB7DF77DDB7DEA7DE77DD77DE17E037DFA7DE67DF67DF17DF07DEE -7DDF7F767FAC7FB07FAD7FED7FEB7FEA7FEC7FE67FE88064806781A3819F0000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -819E819581A2819981978216824F825382528250824E82518524853B850F8500 -8529850E8509850D851F850A8527851C84FB852B84FA8508850C84F4852A84F2 -851584F784EB84F384FC851284EA84E9851684FE8528851D852E850284FD851E -84F68531852684E784E884F084EF84F9851885208530850B8519852F86620000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000875687638764877787E1877387588754875B87528761875A8751875E876D -876A8750874E875F875D876F876C877A876E875C8765874F877B877587628767 -8769885A8905890C8914890B891789188919890689168911890E890989A289A4 -89A389ED89F089EC8ACF8AC68AB88AD38AD18AD48AD58ABB8AD78ABE8AC08AC5 -8AD88AC38ABA8ABD8AD98C3E8C4D8C8F8CE58CDF8CD98CE88CDA8CDD8CE78DA0 -8D9C8DA18D9B8E208E238E258E248E2E8E158E1B8E168E118E198E268E270000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E148E128E188E138E1C8E178E1A8F2C8F248F188F1A8F208F238F168F179073 -9070906F9067906B912F912B9129912A91329126912E91859186918A91819182 -9184918092D092C392C492C092D992B692CF92F192DF92D892E992D792DD92CC -92EF92C292E892CA92C892CE92E692CD92D592C992E092DE92E792D192D30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000092B592E192C692B4957C95AC95AB95AE95B096A496A296D3970597089702 -975A978A978E978897D097CF981E981D9826982998289820981B982798B29908 -98FA9911991499169917991599DC99CD99CF99D399D499CE99C999D699D899CB -99D799CC9AB39AEC9AEB9AF39AF29AF19B469B439B679B749B719B669B769B75 -9B709B689B649B6C9CFC9CFA9CFD9CFF9CF79D079D009CF99CFB9D089D059D04 -9E839ED39F0F9F10511C51135117511A511151DE533453E156705660566E0000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -567356665663566D5672565E5677571C571B58C858BD58C958BF58BA58C258BC -58C65B175B195B1B5B215B145B135B105B165B285B1A5B205B1E5BEF5DAC5DB1 -5DA95DA75DB55DB05DAE5DAA5DA85DB25DAD5DAF5DB45E675E685E665E6F5EE9 -5EE75EE65EE85EE55F4B5FBC619D61A8619661C561B461C661C161CC61BA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000061BF61B8618C64D764D664D064CF64C964BD648964C364DB64F364D96533 -657F657C65A266C866BE66C066CA66CB66CF66BD66BB66BA66CC67236A346A66 -6A496A676A326A686A3E6A5D6A6D6A766A5B6A516A286A5A6A3B6A3F6A416A6A -6A646A506A4F6A546A6F6A696A606A3C6A5E6A566A556A4D6A4E6A466B556B54 -6B566BA76BAA6BAB6BC86BC76C046C036C066FAD6FCB6FA36FC76FBC6FCE6FC8 -6F5E6FC46FBD6F9E6FCA6FA870046FA56FAE6FBA6FAC6FAA6FCF6FBF6FB80000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6FA26FC96FAB6FCD6FAF6FB26FB071C571C271BF71B871D671C071C171CB71D4 -71CA71C771CF71BD71D871BC71C671DA71DB729D729E736973667367736C7365 -736B736A747F749A74A074947492749574A1750B7580762F762D7631763D7633 -763C76357632763076BB76E6779A779D77A1779C779B77A277A3779577990000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000779778DD78E978E578EA78DE78E378DB78E178E278ED78DF78E079A47A44 -7A487A477AB67AB87AB57AB17AB77BDE7BE37BE77BDD7BD57BE57BDA7BE87BF9 -7BD47BEA7BE27BDC7BEB7BD87BDF7CD27CD47CD77CD07CD17E127E217E177E0C -7E1F7E207E137E0E7E1C7E157E1A7E227E0B7E0F7E167E0D7E147E257E247F43 -7F7B7F7C7F7A7FB17FEF802A8029806C81B181A681AE81B981B581AB81B081AC -81B481B281B781A781F282558256825785568545856B854D8553856185580000 -EB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -854085468564854185628544855185478563853E855B8571854E856E85758555 -85678560858C8566855D85548565856C866386658664879B878F879787938792 -87888781879687988779878787A3878587908791879D87848794879C879A8789 -891E89268930892D892E89278931892289298923892F892C891F89F18AE00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008AE28AF28AF48AF58ADD8B148AE48ADF8AF08AC88ADE8AE18AE88AFF8AEF -8AFB8C918C928C908CF58CEE8CF18CF08CF38D6C8D6E8DA58DA78E338E3E8E38 -8E408E458E368E3C8E3D8E418E308E3F8EBD8F368F2E8F358F328F398F378F34 -90769079907B908690FA913391359136919391909191918D918F9327931E9308 -931F9306930F937A9338933C931B9323931293019346932D930E930D92CB931D -92FA9325931392F992F793349302932492FF932993399335932A9314930C0000 -EC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -930B92FE9309930092FB931695BC95CD95BE95B995BA95B695BF95B595BD96A9 -96D4970B9712971097999797979497F097F89835982F98329924991F99279929 -999E99EE99EC99E599E499F099E399EA99E999E79AB99ABF9AB49ABB9AF69AFA -9AF99AF79B339B809B859B879B7C9B7E9B7B9B829B939B929B909B7A9B950000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009B7D9B889D259D179D209D1E9D149D299D1D9D189D229D109D199D1F9E88 -9E869E879EAE9EAD9ED59ED69EFA9F129F3D51265125512251245120512952F4 -5693568C568D568656845683567E5682567F568158D658D458CF58D25B2D5B25 -5B325B235B2C5B275B265B2F5B2E5B7B5BF15BF25DB75E6C5E6A5FBE5FBB61C3 -61B561BC61E761E061E561E461E861DE64EF64E964E364EB64E464E865816580 -65B665DA66D26A8D6A966A816AA56A896A9F6A9B6AA16A9E6A876A936A8E0000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A956A836AA86AA46A916A7F6AA66A9A6A856A8C6A926B5B6BAD6C096FCC6FA9 -6FF46FD46FE36FDC6FED6FE76FE66FDE6FF26FDD6FE26FE871E171F171E871F2 -71E471F071E27373736E736F749774B274AB749074AA74AD74B174A574AF7510 -75117512750F7584764376487649764776A476E977B577AB77B277B777B60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077B477B177A877F078F378FD790278FB78FC78F2790578F978FE790479AB -79A87A5C7A5B7A567A587A547A5A7ABE7AC07AC17C057C0F7BF27C007BFF7BFB -7C0E7BF47C0B7BF37C027C097C037C017BF87BFD7C067BF07BF17C107C0A7CE8 -7E2D7E3C7E427E3398487E387E2A7E497E407E477E297E4C7E307E3B7E367E44 -7E3A7F457F7F7F7E7F7D7FF47FF2802C81BB81C481CC81CA81C581C781BC81E9 -825B825A825C85838580858F85A7859585A0858B85A3857B85A4859A859E0000 -EE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8577857C858985A1857A85788557858E85968586858D8599859D858185A28582 -858885858579857685988590859F866887BE87AA87AD87C587B087AC87B987B5 -87BC87AE87C987C387C287CC87B787AF87C487CA87B487B687BF87B887BD87DE -87B289358933893C893E894189528937894289AD89AF89AE89F289F38B1E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008B188B168B118B058B0B8B228B0F8B128B158B078B0D8B088B068B1C8B13 -8B1A8C4F8C708C728C718C6F8C958C948CF98D6F8E4E8E4D8E538E508E4C8E47 -8F438F409085907E9138919A91A2919B9199919F91A1919D91A093A1938393AF -936493569347937C9358935C93769349935093519360936D938F934C936A9379 -935793559352934F93719377937B9361935E936393679380934E935995C795C0 -95C995C395C595B796AE96B096AC9720971F9718971D9719979A97A1979C0000 -EF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -979E979D97D597D497F198419844984A9849984598439925992B992C992A9933 -9932992F992D99319930999899A399A19A0299FA99F499F799F999F899F699FB -99FD99FE99FC9A039ABE9AFE9AFD9B019AFC9B489B9A9BA89B9E9B9B9BA69BA1 -9BA59BA49B869BA29BA09BAF9D339D419D679D369D2E9D2F9D319D389D300000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009D459D429D439D3E9D379D409D3D7FF59D2D9E8A9E899E8D9EB09EC89EDA -9EFB9EFF9F249F239F229F549FA05131512D512E5698569C5697569A569D5699 -59705B3C5C695C6A5DC05E6D5E6E61D861DF61ED61EE61F161EA61F061EB61D6 -61E964FF650464FD64F86501650364FC659465DB66DA66DB66D86AC56AB96ABD -6AE16AC66ABA6AB66AB76AC76AB46AAD6B5E6BC96C0B7007700C700D70017005 -7014700E6FFF70006FFB70266FFC6FF7700A720171FF71F9720371FD73760000 -F0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74B874C074B574C174BE74B674BB74C275147513765C76647659765076537657 -765A76A676BD76EC77C277BA78FF790C79137914790979107912791179AD79AC -7A5F7C1C7C297C197C207C1F7C2D7C1D7C267C287C227C257C307E5C7E507E56 -7E637E587E627E5F7E517E607E577E537FB57FB37FF77FF8807581D181D20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081D0825F825E85B485C685C085C385C285B385B585BD85C785C485BF85CB -85CE85C885C585B185B685D2862485B885B785BE866987E787E687E287DB87EB -87EA87E587DF87F387E487D487DC87D387ED87D887E387A487D787D9880187F4 -87E887DD8953894B894F894C89468950895189498B2A8B278B238B338B308B35 -8B478B2F8B3C8B3E8B318B258B378B268B368B2E8B248B3B8B3D8B3A8C428C75 -8C998C988C978CFE8D048D028D008E5C8E628E608E578E568E5E8E658E670000 -F1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E5B8E5A8E618E5D8E698E548F468F478F488F4B9128913A913B913E91A891A5 -91A791AF91AA93B5938C939293B7939B939D938993A7938E93AA939E93A69395 -93889399939F938D93B1939193B293A493A893B493A393A595D295D395D196B3 -96D796DA5DC296DF96D896DD97239722972597AC97AE97A897AB97A497AA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000097A297A597D797D997D697D897FA98509851985298B89941993C993A9A0F -9A0B9A099A0D9A049A119A0A9A059A079A069AC09ADC9B089B049B059B299B35 -9B4A9B4C9B4B9BC79BC69BC39BBF9BC19BB59BB89BD39BB69BC49BB99BBD9D5C -9D539D4F9D4A9D5B9D4B9D599D569D4C9D579D529D549D5F9D589D5A9E8E9E8C -9EDF9F019F009F169F259F2B9F2A9F299F289F4C9F5551345135529652F753B4 -56AB56AD56A656A756AA56AC58DA58DD58DB59125B3D5B3E5B3F5DC35E700000 -F2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5FBF61FB65076510650D6509650C650E658465DE65DD66DE6AE76AE06ACC6AD1 -6AD96ACB6ADF6ADC6AD06AEB6ACF6ACD6ADE6B606BB06C0C7019702770207016 -702B702170227023702970177024701C702A720C720A72077202720572A572A6 -72A472A372A174CB74C574B774C37516766077C977CA77C477F1791D791B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007921791C7917791E79B07A677A687C337C3C7C397C2C7C3B7CEC7CEA7E76 -7E757E787E707E777E6F7E7A7E727E747E687F4B7F4A7F837F867FB77FFD7FFE -807881D781D582648261826385EB85F185ED85D985E185E885DA85D785EC85F2 -85F885D885DF85E385DC85D185F085E685EF85DE85E2880087FA880387F687F7 -8809880C880B880687FC880887FF880A88028962895A895B89578961895C8958 -895D8959898889B789B689F68B508B488B4A8B408B538B568B548B4B8B550000 -F3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B518B428B528B578C438C778C768C9A8D068D078D098DAC8DAA8DAD8DAB8E6D -8E788E738E6A8E6F8E7B8EC28F528F518F4F8F508F538FB49140913F91B091AD -93DE93C793CF93C293DA93D093F993EC93CC93D993A993E693CA93D493EE93E3 -93D593C493CE93C093D293E7957D95DA95DB96E19729972B972C972897260000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000097B397B797B697DD97DE97DF985C9859985D985798BF98BD98BB98BE9948 -9947994399A699A79A1A9A159A259A1D9A249A1B9A229A209A279A239A1E9A1C -9A149AC29B0B9B0A9B0E9B0C9B379BEA9BEB9BE09BDE9BE49BE69BE29BF09BD4 -9BD79BEC9BDC9BD99BE59BD59BE19BDA9D779D819D8A9D849D889D719D809D78 -9D869D8B9D8C9D7D9D6B9D749D759D709D699D859D739D7B9D829D6F9D799D7F -9D879D689E949E919EC09EFC9F2D9F409F419F4D9F569F579F58533756B20000 -F4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -56B556B358E35B455DC65DC75EEE5EEF5FC05FC161F9651765166515651365DF -66E866E366E46AF36AF06AEA6AE86AF96AF16AEE6AEF703C7035702F70377034 -703170427038703F703A70397040703B703370417213721472A8737D737C74BA -76AB76AA76BE76ED77CC77CE77CF77CD77F27925792379277928792479290000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000079B27A6E7A6C7A6D7AF77C497C487C4A7C477C457CEE7E7B7E7E7E817E80 -7FBA7FFF807981DB81D9820B82688269862285FF860185FE861B860085F68604 -86098605860C85FD8819881088118817881388168963896689B989F78B608B6A -8B5D8B688B638B658B678B6D8DAE8E868E888E848F598F568F578F558F588F5A -908D9143914191B791B591B291B3940B941393FB9420940F941493FE94159410 -94289419940D93F5940093F79407940E9416941293FA940993F8940A93FF0000 -F5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -93FC940C93F69411940695DE95E095DF972E972F97B997BB97FD97FE98609862 -9863985F98C198C29950994E9959994C994B99539A329A349A319A2C9A2A9A36 -9A299A2E9A389A2D9AC79ACA9AC69B109B129B119C0B9C089BF79C059C129BF8 -9C409C079C0E9C069C179C149C099D9F9D999DA49D9D9D929D989D909D9B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009DA09D949D9C9DAA9D979DA19D9A9DA29DA89D9E9DA39DBF9DA99D969DA6 -9DA79E999E9B9E9A9EE59EE49EE79EE69F309F2E9F5B9F609F5E9F5D9F599F91 -513A51395298529756C356BD56BE5B485B475DCB5DCF5EF161FD651B6B026AFC -6B036AF86B0070437044704A7048704970457046721D721A7219737E7517766A -77D0792D7931792F7C547C537CF27E8A7E877E887E8B7E867E8D7F4D7FBB8030 -81DD8618862A8626861F8623861C86198627862E862186208629861E86250000 -F6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8829881D881B88208824881C882B884A896D8969896E896B89FA8B798B788B45 -8B7A8B7B8D108D148DAF8E8E8E8C8F5E8F5B8F5D91469144914591B9943F943B -94369429943D943C94309439942A9437942C9440943195E595E495E39735973A -97BF97E1986498C998C698C0995899569A399A3D9A469A449A429A419A3A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009A3F9ACD9B159B179B189B169B3A9B529C2B9C1D9C1C9C2C9C239C289C29 -9C249C219DB79DB69DBC9DC19DC79DCA9DCF9DBE9DC59DC39DBB9DB59DCE9DB9 -9DBA9DAC9DC89DB19DAD9DCC9DB39DCD9DB29E7A9E9C9EEB9EEE9EED9F1B9F18 -9F1A9F319F4E9F659F649F924EB956C656C556CB59715B4B5B4C5DD55DD15EF2 -65216520652665226B0B6B086B096C0D7055705670577052721E721F72A9737F -74D874D574D974D7766D76AD793579B47A707A717C577C5C7C597C5B7C5A0000 -F7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7CF47CF17E917F4F7F8781DE826B863486358633862C86328636882C88288826 -882A8825897189BF89BE89FB8B7E8B848B828B868B858B7F8D158E958E948E9A -8E928E908E968E978F608F629147944C9450944A944B944F9447944594489449 -9446973F97E3986A986998CB9954995B9A4E9A539A549A4C9A4F9A489A4A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009A499A529A509AD09B199B2B9B3B9B569B559C469C489C3F9C449C399C33 -9C419C3C9C379C349C329C3D9C369DDB9DD29DDE9DDA9DCB9DD09DDC9DD19DDF -9DE99DD99DD89DD69DF59DD59DDD9EB69EF09F359F339F329F429F6B9F959FA2 -513D529958E858E759725B4D5DD8882F5F4F62016203620465296525659666EB -6B116B126B0F6BCA705B705A7222738273817383767077D47C677C667E95826C -863A86408639863C8631863B863E88308832882E883389768974897389FE0000 -F8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8B8C8B8E8B8B8B888C458D198E988F648F6391BC94629455945D9457945E97C4 -97C598009A569A599B1E9B1F9B209C529C589C509C4A9C4D9C4B9C559C599C4C -9C4E9DFB9DF79DEF9DE39DEB9DF89DE49DF69DE19DEE9DE69DF29DF09DE29DEC -9DF49DF39DE89DED9EC29ED09EF29EF39F069F1C9F389F379F369F439F4F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009F719F709F6E9F6F56D356CD5B4E5C6D652D66ED66EE6B13705F7061705D -7060722374DB74E577D5793879B779B67C6A7E977F89826D8643883888378835 -884B8B948B958E9E8E9F8EA08E9D91BE91BD91C2946B9468946996E597469743 -974797C797E59A5E9AD59B599C639C679C669C629C5E9C609E029DFE9E079E03 -9E069E059E009E019E099DFF9DFD9E049EA09F1E9F469F749F759F7656D4652E -65B86B186B196B176B1A7062722672AA77D877D979397C697C6B7CF67E9A0000 -F9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7E987E9B7E9981E081E18646864786488979897A897C897B89FF8B988B998EA5 -8EA48EA3946E946D946F9471947397499872995F9C689C6E9C6D9E0B9E0D9E10 -9E0F9E129E119EA19EF59F099F479F789F7B9F7A9F79571E70667C6F883C8DB2 -8EA691C394749478947694759A609C749C739C719C759E149E139EF69F0A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009FA4706870657CF7866A883E883D883F8B9E8C9C8EA98EC9974B98739874 -98CC996199AB9A649A669A679B249E159E179F4862076B1E7227864C8EA89482 -948094819A699A689B2E9E197229864B8B9F94839C799EB776759A6B9C7A9E1D -7069706A9EA49F7E9F499F98788192B988CF58BB60527CA75AFA255425662557 -2560256C2563255A2569255D255225642555255E256A256125582567255B2553 -25652556255F256B256225592568255C25512550256D256E2570256F25930000 diff --git a/library/encoding/dingbats.enc b/library/encoding/dingbats.enc deleted file mode 100644 index 9729487..0000000 --- a/library/encoding/dingbats.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: dingbats, single-byte -S -003F 1 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -00202701270227032704260E2706270727082709261B261E270C270D270E270F -2710271127122713271427152716271727182719271A271B271C271D271E271F -2720272127222723272427252726272726052729272A272B272C272D272E272F -2730273127322733273427352736273727382739273A273B273C273D273E273F -2740274127422743274427452746274727482749274A274B25CF274D25A0274F -27502751275225B225BC25C6275625D727582759275A275B275C275D275E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000276127622763276427652766276726632666266526602460246124622463 -2464246524662467246824692776277727782779277A277B277C277D277E277F -2780278127822783278427852786278727882789278A278B278C278D278E278F -2790279127922793279421922194219527982799279A279B279C279D279E279F -27A027A127A227A327A427A527A627A727A827A927AA27AB27AC27AD27AE27AF -000027B127B227B327B427B527B627B727B827B927BA27BB27BC27BD27BE0000 diff --git a/library/encoding/euc-cn.enc b/library/encoding/euc-cn.enc deleted file mode 100644 index 4b2f8c7..0000000 --- a/library/encoding/euc-cn.enc +++ /dev/null @@ -1,1397 +0,0 @@ -# Encoding file: euc-cn, multi-byte -M -003F 0 82 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030003001300230FB02C902C700A8300330052015FF5E2225202620182019 -201C201D3014301530083009300A300B300C300D300E300F3016301730103011 -00B100D700F72236222722282211220F222A222922082237221A22A522252220 -23122299222B222E2261224C2248223D221D2260226E226F22642265221E2235 -22342642264000B0203220332103FF0400A4FFE0FFE1203000A7211626062605 -25CB25CF25CE25C725C625A125A025B325B2203B219221902191219330130000 -A2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000024882489248A248B248C248D248E248F2490249124922493249424952496 -249724982499249A249B247424752476247724782479247A247B247C247D247E -247F248024812482248324842485248624872460246124622463246424652466 -2467246824690000000032203221322232233224322532263227322832290000 -00002160216121622163216421652166216721682169216A216B000000000000 -A3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF01FF02FF03FFE5FF05FF06FF07FF08FF09FF0AFF0BFF0CFF0DFF0EFF0F -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19FF1AFF1BFF1CFF1DFF1EFF1F -FF20FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF3BFF3CFF3DFF3EFF3F -FF40FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5AFF5BFF5CFF5DFFE30000 -A4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -A5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -A6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000004100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -A8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000010100E101CE00E0011300E9011B00E8012B00ED01D000EC014D00F301D2 -00F2016B00FA01D400F901D601D801DA01DC00FC00EA00000000000000000000 -0000000000000000000031053106310731083109310A310B310C310D310E310F -3110311131123113311431153116311731183119311A311B311C311D311E311F -3120312131223123312431253126312731283129000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00000000000000002500250125022503250425052506250725082509250A250B -250C250D250E250F2510251125122513251425152516251725182519251A251B -251C251D251E251F2520252125222523252425252526252725282529252A252B -252C252D252E252F2530253125322533253425352536253725382539253A253B -253C253D253E253F2540254125422543254425452546254725482549254A254B -0000000000000000000000000000000000000000000000000000000000000000 -B0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000554A963F57C3632854CE550954C07691764C853C77EE827E788D72319698 -978D6C285B894FFA630966975CB880FA684880AE660276CE51F9655671AC7FF1 -888450B2596561CA6FB382AD634C625253ED54277B06516B75A45DF462D48DCB -9776628A8019575D97387F627238767D67CF767E64464F708D2562DC7A176591 -73ED642C6273822C9881677F7248626E62CC4F3474E3534A529E7ECA90A65E2E -6886699C81807ED168D278C5868C9551508D8C2482DE80DE5305891252650000 -B1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000858496F94FDD582199715B9D62B162A566B48C799C8D7206676F789160B2 -535153178F8880CC8D1D94A1500D72C8590760EB711988AB595482EF672C7B28 -5D297EF7752D6CF58E668FF8903C9F3B6BD491197B145F7C78A784D6853D6BD5 -6BD96BD65E015E8775F995ED655D5F0A5FC58F9F58C181C2907F965B97AD8FB9 -7F168D2C62414FBF53D8535E8FA88FA98FAB904D68075F6A819888689CD6618B -522B762A5F6C658C6FD26EE85BBE6448517551B067C44E1979C9997C70B30000 -B2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075C55E7673BB83E064AD62E894B56CE2535A52C3640F94C27B944F2F5E1B -82368116818A6E246CCA9A736355535C54FA886557E04E0D5E036B657C3F90E8 -601664E6731C88C16750624D8D22776C8E2991C75F6983DC8521991053C28695 -6B8B60ED60E8707F82CD82314ED36CA785CF64CD7CD969FD66F9834953957B56 -4FA7518C6D4B5C428E6D63D253C9832C833667E578B4643D5BDF5C945DEE8BE7 -62C667F48C7A640063BA8749998B8C177F2094F24EA7961098A4660C73160000 -B3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000573A5C1D5E38957F507F80A05382655E7545553150218D856284949E671D -56326F6E5DE2543570928F66626F64A463A35F7B6F8890F481E38FB05C186668 -5FF16C8996488D81886C649179F057CE6A59621054484E587A0B60E96F848BDA -627F901E9A8B79E4540375F4630153196C608FDF5F1B9A70803B9F7F4F885C3A -8D647FC565A570BD514551B2866B5D075BA062BD916C75748E0C7A2061017B79 -4EC77EF877854E1181ED521D51FA6A7153A88E87950496CF6EC19664695A0000 -B4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000784050A877D7641089E6590463E35DDD7A7F693D4F20823955984E3275AE -7A975E625E8A95EF521B5439708A6376952457826625693F918755076DF37EAF -882262337EF075B5832878C196CC8F9E614874F78BCD6B64523A8D506B21806A -847156F153064ECE4E1B51D17C97918B7C074FC38E7F7BE17A9C64675D1450AC -810676017CB96DEC7FE067515B585BF878CB64AE641363AA632B9519642D8FBE -7B5476296253592754466B7950A362345E266B864EE38D37888B5F85902E0000 -B5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006020803D62C54E39535590F863B880C665E66C2E4F4660EE6DE18BDE5F39 -86CB5F536321515A83616863520063638E4850125C9B79775BFC52307A3B60BC -905376D75FB75F9776848E6C706F767B7B4977AA51F3909358244F4E6EF48FEA -654C7B1B72C46DA47FDF5AE162B55E95573084827B2C5E1D5F1F90127F1498A0 -63826EC7789870B95178975B57AB75354F4375385E9760E659606DC06BBF7889 -53FC96D551CB52016389540A94938C038DCC7239789F87768FED8C0D53E00000 -B6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E0176EF53EE948998769F0E952D5B9A8BA24E224E1C51AC846361C252A8 -680B4F97606B51BB6D1E515C6296659796618C46901775D890FD77636BD2728A -72EC8BFB583577798D4C675C9540809A5EA66E2159927AEF77ED953B6BB565AD -7F0E58065151961F5BF958A954288E726566987F56E4949D76FE9041638754C6 -591A593A579B8EB267358DFA8235524160F0581586FE5CE89E454FC4989D8BB9 -5A2560765384627C904F9102997F6069800C513F80335C1499756D314E8C0000 -B7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008D3053D17F5A7B4F4F104E4F96006CD573D085E95E06756A7FFB6A0A77FE -94927E4151E170E653CD8FD483038D2972AF996D6CDB574A82B365B980AA623F -963259A84EFF8BBF7EBA653E83F2975E556198DE80A5532A8BFD542080BA5E9F -6CB88D3982AC915A54296C1B52067EB7575F711A6C7E7C89594B4EFD5FFF6124 -7CAA4E305C0167AB87025CF0950B98CE75AF70FD902251AF7F1D8BBD594951E4 -4F5B5426592B657780A45B75627662C28F905E456C1F7B264F0F4FD8670D0000 -B8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D6E6DAA798F88B15F17752B629A8F854FEF91DC65A7812F81515E9C8150 -8D74526F89868D4B590D50854ED8961C723681798D1F5BCC8BA3964459877F1A -54905676560E8BE565396982949976D66E895E727518674667D17AFF809D8D76 -611F79C665628D635188521A94A27F38809B7EB25C976E2F67607BD9768B9AD8 -818F7F947CD5641E95507A3F544A54E56B4C640162089E3D80F3759952729769 -845B683C86E49601969494EC4E2A54047ED968398DDF801566F45E9A7FB90000 -B9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000057C2803F68975DE5653B529F606D9F9A4F9B8EAC516C5BAB5F135DE96C5E -62F18D21517194A952FE6C9F82DF72D757A267848D2D591F8F9C83C754957B8D -4F306CBD5B6459D19F1353E486CA9AA88C3780A16545987E56FA96C7522E74DC -52505BE1630289024E5662D0602A68FA51735B9851A089C27BA199867F5060EF -704C8D2F51495E7F901B747089C4572D78455F529F9F95FA8F689B3C8BE17678 -684267DC8DEA8D35523D8F8A6EDA68CD950590ED56FD679C88F98FC754C80000 -BA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009AB85B696D776C264EA55BB39A87916361A890AF97E9542B6DB55BD251FD -558A7F557FF064BC634D65F161BE608D710A6C576C49592F676D822A58D5568E -8C6A6BEB90DD597D801753F76D695475559D837783CF683879BE548C4F555408 -76D28C8996026CB36DB88D6B89109E648D3A563F9ED175D55F8872E0606854FC -4EA86A2A886160528F7054C470D886799E3F6D2A5B8F5F187EA255894FAF7334 -543C539A5019540E547C4E4E5FFD745A58F6846B80E1877472D07CCA6E560000 -BB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F27864E552C62A44E926CAA623782B154D7534E733E6ED1753B52125316 -8BDD69D05F8A60006DEE574F6B2273AF68538FD87F13636260A3552475EA8C62 -71156DA35BA65E7B8352614C9EC478FA87577C27768751F060F6714C66435E4C -604D8C0E707063258F895FBD606286D456DE6BC160946167534960E066668D3F -79FD4F1A70E96C478BB38BF27ED88364660F5A5A9B426D516DF78C416D3B4F19 -706B83B7621660D1970D8D27797851FB573E57FA673A75787A3D79EF7B950000 -BC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000808C99658FF96FC08BA59E2159EC7EE97F095409678168D88F917C4D96C6 -53CA602575BE6C7253735AC97EA7632451E0810A5DF184DF628051805B634F0E -796D524260B86D4E5BC45BC28BA18BB065E25FCC964559937EE77EAA560967B7 -59394F735BB652A0835A988A8D3E753294BE50477A3C4EF767B69A7E5AC16B7C -76D1575A5C167B3A95F4714E517C80A9827059787F04832768C067EC78B17877 -62E363617B804FED526A51CF835069DB92748DF58D3189C1952E7BAD4EF60000 -BD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000506582305251996F6E106E856DA75EFA50F559DC5C066D466C5F7586848B -686859568BB253209171964D854969127901712680F64EA490CA6D479A845A07 -56BC640594F077EB4FA5811A72E189D2997A7F347EDE527F655991758F7F8F83 -53EB7A9663ED63A5768679F888579636622A52AB8282685467706377776B7AED -6D017ED389E359D0621285C982A5754C501F4ECB75A58BEB5C4A5DFE7B4B65A4 -91D14ECA6D25895F7D2795264EC58C288FDB9773664B79818FD170EC6D780000 -BE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C3D52B283465162830E775B66769CB84EAC60CA7CBE7CB37ECF4E958B66 -666F988897595883656C955C5F8475C997567ADF7ADE51C070AF7A9863EA7A76 -7EA0739697ED4E4570784E5D915253A9655165E781FC8205548E5C31759A97A0 -62D872D975BD5C459A7983CA5C40548077E94E3E6CAE805A62D2636E5DE85177 -8DDD8E1E952F4FF153E560E770AC526763509E435A1F5026773753777EE26485 -652B628963985014723589C951B38BC07EDD574783CC94A7519B541B5CFB0000 -BF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004FCA7AE36D5A90E19A8F55805496536154AF5F0063E9697751EF6168520A -582A52D8574E780D770B5EB761777CE0625B62974EA27095800362F770E49760 -577782DB67EF68F578D5989779D158F354B353EF6E34514B523B5BA28BFE80AF -554357A660735751542D7A7A60505B5463A762A053E362635BC767AF54ED7A9F -82E691775E9388E4593857AE630E8DE880EF57577B774FA95FEB5BBD6B3E5321 -7B5072C2684677FF773665F751B54E8F76D45CBF7AA58475594E9B4150800000 -C0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000998861276E8357646606634656F062EC62695ED39614578362C955878721 -814A8FA3556683B167658D5684DD5A6A680F62E67BEE961151706F9C8C3063FD -89C861D27F0670C26EE57405699472FC5ECA90CE67176D6A635E52B372628001 -4F6C59E5916A70D96D9D52D24E5096F7956D857E78CA7D2F5121579264C2808B -7C7B6CEA68F1695E51B7539868A872819ECE7BF172F879BB6F137406674E91CC -9CA4793C83898354540F68174E3D538952B1783E5386522950884F8B4FD00000 -C1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075E27ACB7C926CA596B6529B748354E94FE9805483B28FDE95705EC9601C -6D9F5E18655B813894FE604B70BC7EC37CAE51C968817CB1826F4E248F8691CF -667E4EAE8C0564A9804A50DA759771CE5BE58FBD6F664E86648295635ED66599 -521788C270C852A3730E7433679778F797164E3490BB9CDE6DCB51DB8D41541D -62CE73B283F196F69F8494C34F367F9A51CC707596755CAD988653E64EE46E9C -740969B4786B998F7559521876246D4167F3516D9F99804B54997B3C7ABF0000 -C2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009686578462E29647697C5A0464027BD36F0F964B82A6536298855E907089 -63B35364864F9C819E93788C97328DEF8D429E7F6F5E79845F559646622E9A74 -541594DD4FA365C55C655C617F1586516C2F5F8B73876EE47EFF5CE6631B5B6A -6EE653754E7163A0756562A18F6E4F264ED16CA67EB68BBA841D87BA7F57903B -95237BA99AA188F8843D6D1B9A867EDC59889EBB739B780186829A6C9A82561B -541757CB4E709EA653568FC881097792999286EE6EE1851366FC61626F2B0000 -C3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008C298292832B76F26C135FD983BD732B8305951A6BDB77DB94C6536F8302 -51925E3D8C8C8D384E4873AB679A68859176970971646CA177095A9295416BCF -7F8E66275BD059B95A9A95E895F74EEC840C84996AAC76DF9530731B68A65B5F -772F919A97617CDC8FF78C1C5F257C7379D889C56CCC871C5BC65E4268C97720 -7EF55195514D52C95A297F05976282D763CF778485D079D26E3A5E9959998511 -706D6C1162BF76BF654F60AF95FD660E879F9E2394ED540D547D8C2C64780000 -C4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000647986116A21819C78E864699B5462B9672B83AB58A89ED86CAB6F205BDE -964C8C0B725F67D062C772614EA959C66BCD589366AE5E5552DF6155672876EE -776672677A4662FF54EA545094A090A35A1C7EB36C164E435976801059485357 -753796BE56CA63208111607C95F96DD65462998151855AE980FD59AE9713502A -6CE55C3C62DF4F60533F817B90066EBA852B62C85E7478BE64B5637B5FF55A18 -917F9E1F5C3F634F80425B7D556E954A954D6D8560A867E072DE51DD5B810000 -C5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000062E76CDE725B626D94AE7EBD81136D53519C5F04597452AA601259736696 -8650759F632A61E67CEF8BFA54E66B279E256BB485D5545550766CA4556A8DB4 -722C5E156015743662CD6392724C5F986E436D3E65006F5876D878D076FC7554 -522453DB4E535E9E65C1802A80D6629B5486522870AE888D8DD16CE1547880DA -57F988F48D54966A914D4F696C9B55B776C6783062A870F96F8E5F6D84EC68DA -787C7BF781A8670B9E4F636778B0576F78129739627962AB528874356BD70000 -C6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005564813E75B276AE533975DE50FB5C418B6C7BC7504F72479A9798D86F02 -74E27968648777A562FC98918D2B54C180584E52576A82F9840D5E7351ED74F6 -8BC45C4F57616CFC98875A4678349B448FEB7C955256625194FA4EC683868461 -83E984B257D467345703666E6D668C3166DD7011671F6B3A6816621A59BB4E03 -51C46F0667D26C8F517668CB59476B6775665D0E81109F5065D7794879419A91 -8D775C824E5E4F01542F5951780C56686C148FC45F036C7D6CE38BAB63900000 -C7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060706D3D72756266948E94C553438FC17B7E4EDF8C264E7E9ED494B194B3 -524D6F5C90636D458C3458115D4C6B206B4967AA545B81547F8C589985375F3A -62A26A47953965726084686577A74E544FA85DE7979864AC7FD85CED4FCF7A8D -520783044E14602F7A8394A64FB54EB279E6743452E482B964D279BD5BDD6C81 -97528F7B6C22503E537F6E0564CE66746C3060C598778BF75E86743C7A7779CB -4E1890B174036C4256DA914B6CC58D8B533A86C666F28EAF5C489A716E200000 -C8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000053D65A369F8B8DA353BB570898A76743919B6CC9516875CA62F372AC5238 -529D7F3A7094763853749E4A69B7786E96C088D97FA4713671C3518967D374E4 -58E4651856B78BA9997662707ED560F970ED58EC4EC14EBA5FCD97E74EFB8BA4 -5203598A7EAB62544ECD65E5620E833884C98363878D71946EB65BB97ED25197 -63C967D480898339881551125B7A59828FB14E736C5D516589258F6F962E854A -745E951095F06DA682E55F3164926D128428816E9CC3585E8D5B4E0953C10000 -C9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F1E6563685155D34E2764149A9A626B5AC2745F82726DA968EE50E7838E -7802674052396C997EB150BB5565715E7B5B665273CA82EB67495C715220717D -886B95EA965564C58D6181B355846C5562477F2E58924F2455468D4F664C4E0A -5C1A88F368A2634E7A0D70E7828D52FA97F65C1154E890B57ECD59628D4A86C7 -820C820D8D6664445C0461516D89793E8BBE78377533547B4F388EAB6DF15A20 -7EC5795E6C885BA15A76751A80BE614E6E1758F0751F7525727253477EF30000 -CA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000770176DB526980DC57235E08593172EE65BD6E7F8BD75C388671534177F3 -62FE65F64EC098DF86805B9E8BC653F277E24F7F5C4E9A7659CB5F0F793A58EB -4E1667FF4E8B62ED8A93901D52BF662F55DC566C90024ED54F8D91CA99706C0F -5E0260435BA489C68BD56536624B99965B885BFF6388552E53D77626517D852C -67A268B36B8A62928F9353D482126DD1758F4E668D4E5B70719F85AF669166D9 -7F7287009ECD9F205C5E672F8FF06811675F620D7AD658855EB665706F310000 -CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060555237800D6454887075295E05681362F4971C53CC723D8C016C347761 -7A0E542E77AC987A821C8BF47855671470C165AF64955636601D79C153F84E1D -6B7B80865BFA55E356DB4F3A4F3C99725DF3677E80386002988290015B8B8BBC -8BF5641C825864DE55FD82CF91654FD77D20901F7C9F50F358516EAF5BBF8BC9 -80839178849C7B97867D968B968F7EE59AD3788E5C817A57904296A7795F5B59 -635F7B0B84D168AD55067F2974107D2295016240584C4ED65B83597958540000 -CC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000736D631E8E4B8E0F80CE82D462AC53F06CF0915E592A60016C70574D644A -8D2A762B6EE9575B6A8075F06F6D8C2D8C0857666BEF889278B363A253F970AD -6C645858642A580268E0819B55107CD650188EBA6DCC8D9F70EB638F6D9B6ED4 -7EE68404684390036DD896768BA85957727985E4817E75BC8A8A68AF52548E22 -951163D098988E44557C4F5366FF568F60D56D9552435C4959296DFB586B7530 -751C606C82148146631167618FE2773A8DF38D3494C15E165385542C70C30000 -CD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006C405EF7505C4EAD5EAD633A8247901A6850916E77B3540C94DC5F647AE5 -687663457B527EDF75DB507762955934900F51F879C37A8156FE5F9290146D82 -5C60571F541051546E4D56E263A89893817F8715892A9000541E5C6F81C062D6 -625881319E3596409A6E9A7C692D59A562D3553E631654C786D96D3C5A0374E6 -889C6B6A59168C4C5F2F6E7E73A9987D4E3870F75B8C7897633D665A769660CB -5B9B5A494E0781556C6A738B4EA167897F515F8065FA671B5FD859845A010000 -CE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005DCD5FAE537197E68FDD684556F4552F60DF4E3A6F4D7EF482C7840E59D4 -4F1F4F2A5C3E7EAC672A851A5473754F80C355829B4F4F4D6E2D8C135C096170 -536B761F6E29868A658795FB7EB9543B7A337D0A95EE55E17FC174EE631D8717 -6DA17A9D621165A1536763E16C835DEB545C94A84E4C6C618BEC5C4B65E0829C -68A7543E54346BCB6B664E9463425348821E4F0D4FAE575E620A96FE66647269 -52FF52A1609F8BEF661471996790897F785277FD6670563B54389521727A0000 -CF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A00606F5E0C6089819D591560DC718470EF6EAA6C5072806A8488AD5E2D -4E605AB3559C94E36D177CFB9699620F7EC6778E867E5323971E8F9666875CE1 -4FA072ED4E0B53A6590F54136380952851484ED99C9C7EA454B88D2488548237 -95F26D8E5F265ACC663E966973B0732E53BF817A99857FA15BAA967796507EBF -76F853A2957699997BB189446E584E617FD479658BE660F354CD4EAB98795DF7 -6A6150CF54118C618427785D9704524A54EE56A395006D885BB56DC666530000 -D0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C0F5B5D6821809655787B11654869544E9B6B47874E978B534F631F643A -90AA659C80C18C10519968B0537887F961C86CC46CFB8C225C5185AA82AF950C -6B238F9B65B05FFB5FC34FE18845661F8165732960FA51745211578B5F6290A2 -884C91925E78674F602759D3514451F680F853086C7996C4718A4F114FEE7F9E -673D55C5950879C088967EE3589F620C9700865A5618987B5F908BB884C49157 -53D965ED5E8F755C60647D6E5A7F7EEA7EED8F6955A75BA360AC65CB73840000 -D1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009009766377297EDA9774859B5B667A7496EA884052CB718F5FAA65EC8BE2 -5BFB9A6F5DE16B896C5B8BAD8BAF900A8FC5538B62BC9E269E2D54404E2B82BD -7259869C5D1688596DAF96C554D14E9A8BB6710954BD960970DF6DF976D04E25 -781487125CA95EF68A00989C960E708E6CBF594463A9773C884D6F1482735830 -71D5538C781A96C155015F6671305BB48C1A9A8C6B83592E9E2F79E76768626C -4F6F75A17F8A6D0B96336C274EF075D2517B68376F3E90808170599674760000 -D2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000064475C2790657A918C2359DA54AC8200836F898180006930564E80367237 -91CE51B64E5F987563964E1A53F666F3814B591C6DB24E0058F9533B63D694F1 -4F9D4F0A886398905937905779FB4EEA80F075916C825B9C59E85F5D69058681 -501A5DF24E5977E34EE5827A6291661390915C794EBF5F7981C69038808475AB -4EA688D4610F6BC55FC64E4976CA6EA28BE38BAE8C0A8BD15F027FFC7FCC7ECE -8335836B56E06BB797F3963459FB541F94F66DEB5BC5996E5C395F1596900000 -D3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000537082F16A315A749E705E947F2883B984248425836787478FCE8D6276C8 -5F719896786C662054DF62E54F6381C375C85EB896CD8E0A86F9548F6CF36D8C -6C38607F52C775285E7D4F1860A05FE75C24753190AE94C072B96CB96E389149 -670953CB53F34F5191C98BF153C85E7C8FC26DE44E8E76C26986865E611A8206 -4F594FDE903E9C7C61096E1D6E1496854E885A3196E84E0E5C7F79B95B878BED -7FBD738957DF828B90C15401904755BB5CEA5FA161086B3272F180B28A890000 -D4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D745BD388D598848C6B9A6D9E336E0A51A4514357A38881539F63F48F95 -56ED54585706733F6E907F188FDC82D1613F6028966266F07EA68D8A8DC394A5 -5CB37CA4670860A6960580184E9190E75300966851418FD08574915D665597F5 -5B55531D78386742683D54C9707E5BB08F7D518D572854B1651266828D5E8D43 -810F846C906D7CDF51FF85FB67A365E96FA186A48E81566A90207682707671E5 -8D2362E952196CFD8D3C600E589E618E66FE8D60624E55B36E23672D8F670000 -D5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000094E195F87728680569A8548B4E4D70B88BC86458658B5B857A84503A5BE8 -77BB6BE18A797C986CBE76CF65A98F975D2D5C5586386808536062187AD96E5B -7EFD6A1F7AE05F706F335F20638C6DA867564E085E108D264ED780C07634969C -62DB662D627E6CBC8D7571677F695146808753EC906E629854F286F08F998005 -951785178FD96D5973CD659F771F7504782781FB8D1E94884FA6679575B98BCA -9707632F9547963584B8632377415F8172F04E896014657462EF6B63653F0000 -D6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005E2775C790D18BC1829D679D652F5431871877E580A281026C414E4B7EC7 -804C76F4690D6B966267503C4F84574063076B628DBE53EA65E87EB85FD7631A -63B781F381F47F6E5E1C5CD95236667A79E97A1A8D28709975D46EDE6CBB7A92 -4E2D76C55FE0949F88777EC879CD80BF91CD4EF24F17821F54685DDE6D328BCC -7CA58F7480985E1A549276B15B99663C9AA473E0682A86DB6731732A8BF88BDB -90107AF970DB716E62C477A956314E3B845767F152A986C08D2E94F87B510000 -D7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F4F6CE8795D9A7B6293722A62FD4E1378168F6C64B08D5A7BC668695E84 -88C55986649E58EE72B6690E95258FFD8D5857607F008C0651C6634962D95353 -684C74228301914C55447740707C6D4A517954A88D4459FF6ECB6DC45B5C7D2B -4ED47C7D6ED35B5081EA6E0D5B579B0368D58E2A5B977EFC603B7EB590B98D70 -594F63CD79DF8DB3535265CF79568BC5963B7EC494BB7E825634918967007F6A -5C0A907566285DE64F5067DE505A4F5C57505EA7000000000000000000000000 -D8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E8D4E0C51404E105EFF53454E154E984E1E9B325B6C56694E2879BA4E3F -53154E47592D723B536E6C1056DF80E499976BD3777E9F174E364E9F9F104E5C -4E694E9382885B5B556C560F4EC4538D539D53A353A553AE97658D5D531A53F5 -5326532E533E8D5C5366536352025208520E522D5233523F5240524C525E5261 -525C84AF527D528252815290529351827F544EBB4EC34EC94EC24EE84EE14EEB -4EDE4F1B4EF34F224F644EF54F254F274F094F2B4F5E4F6765384F5A4F5D0000 -D9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F5F4F574F324F3D4F764F744F914F894F834F8F4F7E4F7B4FAA4F7C4FAC -4F944FE64FE84FEA4FC54FDA4FE34FDC4FD14FDF4FF85029504C4FF3502C500F -502E502D4FFE501C500C50255028507E504350555048504E506C507B50A550A7 -50A950BA50D6510650ED50EC50E650EE5107510B4EDD6C3D4F584F654FCE9FA0 -6C467C74516E5DFD9EC999985181591452F9530D8A07531051EB591951554EA0 -51564EB3886E88A44EB5811488D279805B3488037FB851AB51B151BD51BC0000 -DA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000051C7519651A251A58BA08BA68BA78BAA8BB48BB58BB78BC28BC38BCB8BCF -8BCE8BD28BD38BD48BD68BD88BD98BDC8BDF8BE08BE48BE88BE98BEE8BF08BF3 -8BF68BF98BFC8BFF8C008C028C048C078C0C8C0F8C118C128C148C158C168C19 -8C1B8C188C1D8C1F8C208C218C258C278C2A8C2B8C2E8C2F8C328C338C358C36 -5369537A961D962296219631962A963D963C964296499654965F9667966C9672 -96749688968D969796B09097909B909D909990AC90A190B490B390B690BA0000 -DB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090B890B090CF90C590BE90D090C490C790D390E690E290DC90D790DB90EB -90EF90FE91049122911E91239131912F913991439146520D594252A252AC52AD -52BE54FF52D052D652F053DF71EE77CD5EF451F551FC9B2F53B65F01755A5DEF -574C57A957A1587E58BC58C558D15729572C572A57335739572E572F575C573B -574257695785576B5786577C577B5768576D5776577357AD57A4578C57B257CF -57A757B4579357A057D557D857DA57D957D257B857F457EF57F857E457DD0000 -DC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000580B580D57FD57ED5800581E5819584458205865586C58815889589A5880 -99A89F1961FF8279827D827F828F828A82A88284828E82918297829982AB82B8 -82BE82B082C882CA82E3829882B782AE82CB82CC82C182A982B482A182AA829F -82C482CE82A482E1830982F782E4830F830782DC82F482D282D8830C82FB82D3 -8311831A83068314831582E082D5831C8351835B835C83088392833C83348331 -839B835E832F834F83478343835F834083178360832D833A8333836683650000 -DD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008368831B8369836C836A836D836E83B0837883B383B483A083AA8393839C -8385837C83B683A9837D83B8837B8398839E83A883BA83BC83C1840183E583D8 -58078418840B83DD83FD83D6841C84388411840683D483DF840F840383F883F9 -83EA83C583C0842683F083E1845C8451845A8459847384878488847A84898478 -843C844684698476848C848E8431846D84C184CD84D084E684BD84D384CA84BF -84BA84E084A184B984B4849784E584E3850C750D853884F08539851F853A0000 -DE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008556853B84FF84FC8559854885688564855E857A77A285438572857B85A4 -85A88587858F857985AE859C858585B985B785B085D385C185DC85FF86278605 -86298616863C5EFE5F08593C594180375955595A5958530F5C225C255C2C5C34 -624C626A629F62BB62CA62DA62D762EE632262F66339634B634363AD63F66371 -637A638E63B4636D63AC638A636963AE63BC63F263F863E063FF63C463DE63CE -645263C663BE64456441640B641B6420640C64266421645E6484646D64960000 -DF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000647A64B764B8649964BA64C064D064D764E464E265096525652E5F0B5FD2 -75195F11535F53F153FD53E953E853FB541254165406544B5452545354545456 -54435421545754595423543254825494547754715464549A549B548454765466 -549D54D054AD54C254B454D254A754A654D354D4547254A354D554BB54BF54CC -54D954DA54DC54A954AA54A454DD54CF54DE551B54E7552054FD551454F35522 -5523550F55115527552A5567558F55B55549556D55415555553F5550553C0000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005537555655755576557755335530555C558B55D2558355B155B955885581 -559F557E55D65591557B55DF55BD55BE5594559955EA55F755C9561F55D155EB -55EC55D455E655DD55C455EF55E555F255F355CC55CD55E855F555E48F94561E -5608560C56015624562355FE56005627562D565856395657562C564D56625659 -565C564C5654568656645671566B567B567C5685569356AF56D456D756DD56E1 -56F556EB56F956FF5704570A5709571C5E0F5E195E145E115E315E3B5E3C0000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005E375E445E545E5B5E5E5E615C8C5C7A5C8D5C905C965C885C985C995C91 -5C9A5C9C5CB55CA25CBD5CAC5CAB5CB15CA35CC15CB75CC45CD25CE45CCB5CE5 -5D025D035D275D265D2E5D245D1E5D065D1B5D585D3E5D345D3D5D6C5D5B5D6F -5D5D5D6B5D4B5D4A5D695D745D825D995D9D8C735DB75DC55F735F775F825F87 -5F895F8C5F955F995F9C5FA85FAD5FB55FBC88625F6172AD72B072B472B772B8 -72C372C172CE72CD72D272E872EF72E972F272F472F7730172F3730372FA0000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000072FB731773137321730A731E731D7315732273397325732C733873317350 -734D73577360736C736F737E821B592598E7592459029963996799689969996A -996B996C99749977997D998099849987998A998D999099919993999499955E80 -5E915E8B5E965EA55EA05EB95EB55EBE5EB38D535ED25ED15EDB5EE85EEA81BA -5FC45FC95FD65FCF60035FEE60045FE15FE45FFE600560065FEA5FED5FF86019 -60356026601B600F600D6029602B600A603F602160786079607B607A60420000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000606A607D6096609A60AD609D60836092608C609B60EC60BB60B160DD60D8 -60C660DA60B4612061266115612360F46100610E612B614A617561AC619461A7 -61B761D461F55FDD96B395E995EB95F195F395F595F695FC95FE960396049606 -9608960A960B960C960D960F96129615961696179619961A4E2C723F62156C35 -6C546C5C6C4A6CA36C856C906C946C8C6C686C696C746C766C866CA96CD06CD4 -6CAD6CF76CF86CF16CD76CB26CE06CD66CFA6CEB6CEE6CB16CD36CEF6CFE0000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D396D276D0C6D436D486D076D046D196D0E6D2B6D4D6D2E6D356D1A6D4F -6D526D546D336D916D6F6D9E6DA06D5E6D936D946D5C6D606D7C6D636E1A6DC7 -6DC56DDE6E0E6DBF6DE06E116DE66DDD6DD96E166DAB6E0C6DAE6E2B6E6E6E4E -6E6B6EB26E5F6E866E536E546E326E256E446EDF6EB16E986EE06F2D6EE26EA5 -6EA76EBD6EBB6EB76ED76EB46ECF6E8F6EC26E9F6F626F466F476F246F156EF9 -6F2F6F366F4B6F746F2A6F096F296F896F8D6F8C6F786F726F7C6F7A6FD10000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006FC96FA76FB96FB66FC26FE16FEE6FDE6FE06FEF701A7023701B70397035 -704F705E5B805B845B955B935BA55BB8752F9A9E64345BE45BEE89305BF08E47 -8B078FB68FD38FD58FE58FEE8FE48FE98FE68FF38FE890059004900B90269011 -900D9016902190359036902D902F9044905190529050906890589062905B66B9 -9074907D908290889083908B5F505F575F565F585C3B54AB5C505C595B715C63 -5C667FBC5F2A5F295F2D82745F3C9B3B5C6E59815983598D59A959AA59A30000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000599759CA59AB599E59A459D259B259AF59D759BE5A055A0659DD5A0859E3 -59D859F95A0C5A095A325A345A115A235A135A405A675A4A5A555A3C5A625A75 -80EC5AAA5A9B5A775A7A5ABE5AEB5AB25AD25AD45AB85AE05AE35AF15AD65AE6 -5AD85ADC5B095B175B165B325B375B405C155C1C5B5A5B655B735B515B535B62 -9A759A779A789A7A9A7F9A7D9A809A819A859A889A8A9A909A929A939A969A98 -9A9B9A9C9A9D9A9F9AA09AA29AA39AA59AA77E9F7EA17EA37EA57EA87EA90000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007EAD7EB07EBE7EC07EC17EC27EC97ECB7ECC7ED07ED47ED77EDB7EE07EE1 -7EE87EEB7EEE7EEF7EF17EF27F0D7EF67EFA7EFB7EFE7F017F027F037F077F08 -7F0B7F0C7F0F7F117F127F177F197F1C7F1B7F1F7F217F227F237F247F257F26 -7F277F2A7F2B7F2C7F2D7F2F7F307F317F327F337F355E7A757F5DDB753E9095 -738E739173AE73A2739F73CF73C273D173B773B373C073C973C873E573D9987C -740A73E973E773DE73BA73F2740F742A745B7426742574287430742E742C0000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000741B741A7441745C7457745574597477746D747E749C748E748074817487 -748B749E74A874A9749074A774D274BA97EA97EB97EC674C6753675E67486769 -67A56787676A6773679867A7677567A8679E67AD678B6777677C67F0680967D8 -680A67E967B0680C67D967B567DA67B367DD680067C367B867E2680E67C167FD -6832683368606861684E6862684468646883681D68556866684168676840683E -684A6849682968B5688F687468776893686B68C2696E68FC691F692068F90000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000692468F0690B6901695768E369106971693969606942695D6984696B6980 -69986978693469CC6987698869CE6989696669636979699B69A769BB69AB69AD -69D469B169C169CA69DF699569E0698D69FF6A2F69ED6A176A186A6569F26A44 -6A3E6AA06A506A5B6A356A8E6A796A3D6A286A586A7C6A916A906AA96A976AAB -733773526B816B826B876B846B926B936B8D6B9A6B9B6BA16BAA8F6B8F6D8F71 -8F728F738F758F768F788F778F798F7A8F7C8F7E8F818F828F848F878F8B0000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008F8D8F8E8F8F8F988F9A8ECE620B6217621B621F6222622162256224622C -81E774EF74F474FF750F75117513653465EE65EF65F0660A6619677266036615 -6600708566F7661D66346631663666358006665F66546641664F665666616657 -66776684668C66A7669D66BE66DB66DC66E666E98D328D338D368D3B8D3D8D40 -8D458D468D488D498D478D4D8D558D5989C789CA89CB89CC89CE89CF89D089D1 -726E729F725D7266726F727E727F7284728B728D728F72926308633263B00000 -EB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000643F64D880046BEA6BF36BFD6BF56BF96C056C076C066C0D6C156C186C19 -6C1A6C216C296C246C2A6C3265356555656B724D72527256723086625216809F -809C809380BC670A80BD80B180AB80AD80B480B780E780E880E980EA80DB80C2 -80C480D980CD80D7671080DD80EB80F180F480ED810D810E80F280FC67158112 -8C5A8136811E812C811881328148814C815381748159815A817181608169817C -817D816D8167584D5AB58188818281916ED581A381AA81CC672681CA81BB0000 -EC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081C181A66B246B376B396B436B466B5998D198D298D398D598D998DA6BB3 -5F406BC289F365909F51659365BC65C665C465C365CC65CE65D265D67080709C -7096709D70BB70C070B770AB70B170E870CA711071137116712F71317173715C -716871457172714A7178717A719871B371B571A871A071E071D471E771F9721D -7228706C7118716671B9623E623D624362486249793B794079467949795B795C -7953795A796279577960796F7967797A7985798A799A79A779B35FD15FD00000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000603C605D605A606760416059606360AB6106610D615D61A9619D61CB61D1 -62068080807F6C936CF66DFC77F677F87800780978177818781165AB782D781C -781D7839783A783B781F783C7825782C78237829784E786D7856785778267850 -7847784C786A789B7893789A7887789C78A178A378B278B978A578D478D978C9 -78EC78F2790578F479137924791E79349F9B9EF99EFB9EFC76F17704770D76F9 -77077708771A77227719772D7726773577387750775177477743775A77680000 -EE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077627765777F778D777D7780778C7791779F77A077B077B577BD753A7540 -754E754B7548755B7572757975837F587F617F5F8A487F687F747F717F797F81 -7F7E76CD76E58832948594869487948B948A948C948D948F9490949494979495 -949A949B949C94A394A494AB94AA94AD94AC94AF94B094B294B494B694B794B8 -94B994BA94BC94BD94BF94C494C894C994CA94CB94CC94CD94CE94D094D194D2 -94D594D694D794D994D894DB94DE94DF94E094E294E494E594E794E894EA0000 -EF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000094E994EB94EE94EF94F394F494F594F794F994FC94FD94FF950395029506 -95079509950A950D950E950F951295139514951595169518951B951D951E951F -9522952A952B9529952C953195329534953695379538953C953E953F95429535 -9544954595469549954C954E954F9552955395549556955795589559955B955E -955F955D95619562956495659566956795689569956A956B956C956F95719572 -9573953A77E777EC96C979D579ED79E379EB7A065D477A037A027A1E7A140000 -F0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A397A377A519ECF99A57A707688768E7693769976A474DE74E0752C9E20 -9E229E289E299E2A9E2B9E2C9E329E319E369E389E379E399E3A9E3E9E419E42 -9E449E469E479E489E499E4B9E4C9E4E9E519E559E579E5A9E5B9E5C9E5E9E63 -9E669E679E689E699E6A9E6B9E6C9E719E6D9E7375927594759675A0759D75AC -75A375B375B475B875C475B175B075C375C275D675CD75E375E875E675E475EB -75E7760375F175FC75FF761076007605760C7617760A76257618761576190000 -F1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000761B763C762276207640762D7630763F76357643763E7633764D765E7654 -765C7656766B766F7FCA7AE67A787A797A807A867A887A957AA67AA07AAC7AA8 -7AAD7AB3886488698872887D887F888288A288C688B788BC88C988E288CE88E3 -88E588F1891A88FC88E888FE88F0892189198913891B890A8934892B89368941 -8966897B758B80E576B276B477DC801280148016801C80208022802580268027 -802980288031800B803580438046804D80528069807189839878988098830000 -F2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009889988C988D988F9894989A989B989E989F98A198A298A598A6864D8654 -866C866E867F867A867C867B86A8868D868B86AC869D86A786A386AA869386A9 -86B686C486B586CE86B086BA86B186AF86C986CF86B486E986F186F286ED86F3 -86D0871386DE86F486DF86D886D18703870786F88708870A870D87098723873B -871E8725872E871A873E87488734873187298737873F87828722877D877E877B -87608770874C876E878B87538763877C876487598765879387AF87A887D20000 -F3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000087C68788878587AD8797878387AB87E587AC87B587B387CB87D387BD87D1 -87C087CA87DB87EA87E087EE8816881387FE880A881B88218839883C7F367F42 -7F447F4582107AFA7AFD7B087B037B047B157B0A7B2B7B0F7B477B387B2A7B19 -7B2E7B317B207B257B247B337B3E7B1E7B587B5A7B457B757B4C7B5D7B607B6E -7B7B7B627B727B717B907BA67BA77BB87BAC7B9D7BA87B857BAA7B9C7BA27BAB -7BB47BD17BC17BCC7BDD7BDA7BE57BE67BEA7C0C7BFE7BFC7C0F7C167C0B0000 -F4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007C1F7C2A7C267C387C417C4081FE82018202820481EC8844822182228223 -822D822F8228822B8238823B82338234823E82448249824B824F825A825F8268 -887E8885888888D888DF895E7F9D7F9F7FA77FAF7FB07FB27C7C65497C917C9D -7C9C7C9E7CA27CB27CBC7CBD7CC17CC77CCC7CCD7CC87CC57CD77CE8826E66A8 -7FBF7FCE7FD57FE57FE17FE67FE97FEE7FF37CF87D777DA67DAE7E477E9B9EB8 -9EB48D738D848D948D918DB18D678D6D8C478C49914A9150914E914F91640000 -F5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009162916191709169916F917D917E917291749179918C91859190918D9191 -91A291A391AA91AD91AE91AF91B591B491BA8C559E7E8DB88DEB8E058E598E69 -8DB58DBF8DBC8DBA8DC48DD68DD78DDA8DDE8DCE8DCF8DDB8DC68DEC8DF78DF8 -8DE38DF98DFB8DE48E098DFD8E148E1D8E1F8E2C8E2E8E238E2F8E3A8E408E39 -8E358E3D8E318E498E418E428E518E528E4A8E708E768E7C8E6F8E748E858E8F -8E948E908E9C8E9E8C788C828C8A8C858C988C94659B89D689DE89DA89DC0000 -F6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000089E589EB89EF8A3E8B26975396E996F396EF970697019708970F970E972A -972D9730973E9F809F839F859F869F879F889F899F8A9F8C9EFE9F0B9F0D96B9 -96BC96BD96CE96D277BF96E0928E92AE92C8933E936A93CA938F943E946B9C7F -9C829C859C869C879C887A239C8B9C8E9C909C919C929C949C959C9A9C9B9C9E -9C9F9CA09CA19CA29CA39CA59CA69CA79CA89CA99CAB9CAD9CAE9CB09CB19CB2 -9CB39CB49CB59CB69CB79CBA9CBB9CBC9CBD9CC49CC59CC69CC79CCA9CCB0000 -F7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009CCC9CCD9CCE9CCF9CD09CD39CD49CD59CD79CD89CD99CDC9CDD9CDF9CE2 -977C978597919792979497AF97AB97A397B297B49AB19AB09AB79E589AB69ABA -9ABC9AC19AC09AC59AC29ACB9ACC9AD19B459B439B479B499B489B4D9B5198E8 -990D992E995599549ADF9AE19AE69AEF9AEB9AFB9AED9AF99B089B0F9B139B1F -9B239EBD9EBE7E3B9E829E879E889E8B9E9293D69E9D9E9F9EDB9EDC9EDD9EE0 -9EDF9EE29EE99EE79EE59EEA9EEF9F229F2C9F2F9F399F379F3D9F3E9F440000 diff --git a/library/encoding/euc-jp.enc b/library/encoding/euc-jp.enc deleted file mode 100644 index 9b7abb1..0000000 --- a/library/encoding/euc-jp.enc +++ /dev/null @@ -1,1346 +0,0 @@ -# Encoding file: euc-jp, multi-byte -M -003F 0 79 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D0000008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F -FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F -FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F -FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8 -FF3EFFE3FF3F30FD30FE309D309E30034EDD30053006300730FC20152010FF0F -FF3C301C2016FF5C2026202520182019201C201DFF08FF0930143015FF3BFF3D -FF5BFF5D30083009300A300B300C300D300E300F30103011FF0B221200B100D7 -00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5 -FF0400A200A3FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C70000 -A2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000025C625A125A025B325B225BD25BC203B3012219221902191219330130000 -00000000000000000000000000000000000000002208220B2286228722822283 -222A2229000000000000000000000000000000002227222800AC21D221D42200 -220300000000000000000000000000000000000000000000222022A523122202 -220722612252226A226B221A223D221D2235222B222C00000000000000000000 -00000000212B2030266F266D266A2020202100B6000000000000000025EF0000 -A3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19000000000000000000000000 -0000FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3A00000000000000000000 -0000FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5A00000000000000000000 -A4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -A5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -A6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000004100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -A8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000025002502250C251025182514251C252C25242534253C25012503250F2513 -251B251725232533252B253B254B2520252F25282537253F251D253025252538 -2542000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -B0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E9C55165A03963F54C0611B632859F690228475831C7A5060AA63E16E25 -65ED846682A69BF56893572765A162715B9B59D0867B98F47D627DBE9B8E6216 -7C9F88B75B895EB563096697684895C7978D674F4EE54F0A4F4D4F9D504956F2 -593759D45A015C0960DF610F61706613690570BA754F757079FB7DAD7DEF80C3 -840E88638B029055907A533B4E954EA557DF80B290C178EF4E0058F16EA29038 -7A328328828B9C2F5141537054BD54E156E059FB5F1598F26DEB80E4852D0000 -B1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009662967096A097FB540B53F35B8770CF7FBD8FC296E8536F9D5C7ABA4E11 -789381FC6E26561855046B1D851A9C3B59E553A96D6674DC958F56424E91904B -96F2834F990C53E155B65B305F71662066F368046C386CF36D29745B76C87A4E -983482F1885B8A6092ED6DB275AB76CA99C560A68B018D8A95B2698E53AD5186 -5712583059445BB45EF6602863A963F46CBF6F14708E7114715971D5733F7E01 -827682D185979060925B9D1B586965BC6C5A752551F9592E59655F805FDC0000 -B2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000062BC65FA6A2A6B276BB4738B7FC189569D2C9D0E9EC45CA16C96837B5104 -5C4B61B681C6687672614E594FFA537860696E297A4F97F34E0B53164EEE4F55 -4F3D4FA14F7352A053EF5609590F5AC15BB65BE179D16687679C67B66B4C6CB3 -706B73C2798D79BE7A3C7B8782B182DB8304837783EF83D387668AB256298CA8 -8FE6904E971E868A4FC45CE862117259753B81E582BD86FE8CC096C5991399D5 -4ECB4F1A89E356DE584A58CA5EFB5FEB602A6094606261D0621262D065390000 -B3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009B41666668B06D777070754C76867D7582A587F9958B968E8C9D51F152BE -591654B35BB35D16616869826DAF788D84CB88578A7293A79AB86D6C99A886D9 -57A367FF86CE920E5283568754045ED362E164B9683C68386BBB737278BA7A6B -899A89D28D6B8F0390ED95A3969497695B665CB3697D984D984E639B7B206A2B -6A7F68B69C0D6F5F5272559D607062EC6D3B6E076ED1845B89108F444E149C39 -53F6691B6A3A9784682A515C7AC384B291DC938C565B9D286822830584310000 -B4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007CA5520882C574E64E7E4F8351A05BD2520A52D852E75DFB559A582A59E6 -5B8C5B985BDB5E725E7960A3611F616361BE63DB656267D1685368FA6B3E6B53 -6C576F226F976F4574B0751876E3770B7AFF7BA17C217DE97F367FF0809D8266 -839E89B38ACC8CAB908494519593959195A2966597D3992882184E38542B5CB8 -5DCC73A9764C773C5CA97FEB8D0B96C19811985498584F014F0E5371559C5668 -57FA59475B095BC45C905E0C5E7E5FCC63EE673A65D765E2671F68CB68C40000 -B5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006A5F5E306BC56C176C7D757F79485B637A007D005FBD898F8A188CB48D77 -8ECC8F1D98E29A0E9B3C4E80507D510059935B9C622F628064EC6B3A72A07591 -79477FA987FB8ABC8B7063AC83CA97A05409540355AB68546A588A7078276775 -9ECD53745BA2811A865090064E184E454EC74F1153CA54385BAE5F1360256551 -673D6C426C726CE3707874037A767AAE7B087D1A7CFE7D6665E7725B53BB5C45 -5DE862D262E063196E20865A8A318DDD92F86F0179A69B5A4EA84EAB4EAC0000 -B6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F9B4FA050D151477AF6517151F653545321537F53EB55AC58835CE15F37 -5F4A602F6050606D631F65596A4B6CC172C272ED77EF80F881058208854E90F7 -93E197FF99579A5A4EF051DD5C2D6681696D5C4066F26975738968507C8150C5 -52E457475DFE932665A46B236B3D7434798179BD7B4B7DCA82B983CC887F895F -8B398FD191D1541F92804E5D503653E5533A72D7739677E982E68EAF99C699C8 -99D25177611A865E55B07A7A50765BD3904796854E326ADB91E75C515C480000 -B7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000063987A9F6C9397748F617AAA718A96887C8268177E706851936C52F2541B -85AB8A137FA48ECD90E15366888879414FC250BE521151445553572D73EA578B -59515F625F8460756176616761A963B2643A656C666F68426E1375667A3D7CFB -7D4C7D997E4B7F6B830E834A86CD8A088A638B668EFD981A9D8F82B88FCE9BE8 -5287621F64836FC09699684150916B206C7A6F547A747D5088408A2367084EF6 -503950265065517C5238526355A7570F58055ACC5EFA61B261F862F363720000 -B8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000691C6A29727D72AC732E7814786F7D79770C80A9898B8B198CE28ED29063 -9375967A98559A139E785143539F53B35E7B5F266E1B6E90738473FE7D438237 -8A008AFA96504E4E500B53E4547C56FA59D15B645DF15EAB5F276238654567AF -6E5672D07CCA88B480A180E183F0864E8A878DE8923796C798679F134E944E92 -4F0D53485449543E5A2F5F8C5FA1609F68A76A8E745A78818A9E8AA48B779190 -4E5E9BC94EA44F7C4FAF501950165149516C529F52B952FE539A53E354110000 -B9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000540E5589575157A2597D5B545B5D5B8F5DE55DE75DF75E785E835E9A5EB7 -5F186052614C629762D863A7653B6602664366F4676D6821689769CB6C5F6D2A -6D696E2F6E9D75327687786C7A3F7CE07D057D187D5E7DB18015800380AF80B1 -8154818F822A8352884C88618B1B8CA28CFC90CA91759271783F92FC95A4964D -980599999AD89D3B525B52AB53F7540858D562F76FE08C6A8F5F9EB9514B523B -544A56FD7A4091779D609ED273446F09817075115FFD60DA9AA872DB8FBC0000 -BA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006B6498034ECA56F0576458BE5A5A606861C7660F6606683968B16DF775D5 -7D3A826E9B424E9B4F5053C955065D6F5DE65DEE67FB6C99747378028A509396 -88DF57505EA7632B50B550AC518D670054C9585E59BB5BB05F69624D63A1683D -6B736E08707D91C7728078157826796D658E7D3083DC88C18F09969B52645728 -67507F6A8CA151B45742962A583A698A80B454B25D0E57FC78959DFA4F5C524A -548B643E6628671467F57A847B567D22932F685C9BAD7B395319518A52370000 -BB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005BDF62F664AE64E6672D6BBA85A996D176909BD6634C93069BAB76BF6652 -4E09509853C25C7160E864926563685F71E673CA75237B977E8286958B838CDB -9178991065AC66AB6B8B4ED54ED44F3A4F7F523A53F853F255E356DB58EB59CB -59C959FF5B505C4D5E025E2B5FD7601D6307652F5B5C65AF65BD65E8679D6B62 -6B7B6C0F7345794979C17CF87D197D2B80A2810281F389968A5E8A698A668A8C -8AEE8CC78CDC96CC98FC6B6F4E8B4F3C4F8D51505B575BFA6148630166420000 -BC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006B216ECB6CBB723E74BD75D478C1793A800C803381EA84948F9E6C509E7F -5F0F8B589D2B7AFA8EF85B8D96EB4E0353F157F759315AC95BA460896E7F6F06 -75BE8CEA5B9F85007BE0507267F4829D5C61854A7E1E820E51995C0463688D66 -659C716E793E7D1780058B1D8ECA906E86C790AA501F52FA5C3A6753707C7235 -914C91C8932B82E55BC25F3160F94E3B53D65B88624B67316B8A72E973E07A2E -816B8DA391529996511253D7546A5BFF63886A397DAC970056DA53CE54680000 -BD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005B975C315DDE4FEE610162FE6D3279C079CB7D427E4D7FD281ED821F8490 -884689728B908E748F2F9031914B916C96C6919C4EC04F4F514553415F93620E -67D46C416E0B73637E2691CD928353D459195BBF6DD1795D7E2E7C9B587E719F -51FA88538FF04FCA5CFB662577AC7AE3821C99FF51C65FAA65EC696F6B896DF3 -6E966F6476FE7D145DE190759187980651E6521D6240669166D96E1A5EB67DD2 -7F7266F885AF85F78AF852A953D959735E8F5F90605592E4966450B7511F0000 -BE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000052DD5320534753EC54E8554655315617596859BE5A3C5BB55C065C0F5C11 -5C1A5E845E8A5EE05F70627F628462DB638C63776607660C662D6676677E68A2 -6A1F6A356CBC6D886E096E58713C7126716775C77701785D7901796579F07AE0 -7B117CA77D39809683D6848B8549885D88F38A1F8A3C8A548A738C618CDE91A4 -9266937E9418969C97984E0A4E084E1E4E575197527057CE583458CC5B225E38 -60C564FE676167566D4472B675737A6384B88B7291B89320563157F498FE0000 -BF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000062ED690D6B9671ED7E548077827289E698DF87558FB15C3B4F384FE14FB5 -55075A205BDD5BE95FC3614E632F65B0664B68EE699B6D786DF1753375B9771F -795E79E67D3381E382AF85AA89AA8A3A8EAB8F9B903291DD97074EBA4EC15203 -587558EC5C0B751A5C3D814E8A0A8FC59663976D7B258ACF9808916256F353A8 -9017543957825E2563A86C34708A77617C8B7FE088709042915493109318968F -745E9AC45D075D69657067A28DA896DB636E6749691983C5981796C088FE0000 -C0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006F84647A5BF84E16702C755D662F51C4523652E259D35F8160276210653F -6574661F667468F268166B636E057272751F76DB7CBE805658F088FD897F8AA0 -8A938ACB901D91929752975965897A0E810696BB5E2D60DC621A65A566146790 -77F37A4D7C4D7E3E810A8CAC8D648DE18E5F78A9520762D963A5644262988A2D -7A837BC08AAC96EA7D76820C87494ED95148534353605BA35C025C165DDD6226 -624764B0681368346CC96D456D1767D36F5C714E717D65CB7A7F7BAD7DDA0000 -C1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007E4A7FA8817A821B823985A68A6E8CCE8DF59078907792AD929195839BAE -524D55846F387136516879857E5581B37CCE564C58515CA863AA66FE66FD695A -72D9758F758E790E795679DF7C977D207D4486078A34963B90619F2050E75275 -53CC53E2500955AA58EE594F723D5B8B5C64531D60E360F3635C6383633F63BB -64CD65E966F95DE369CD69FD6F1571E54E8975E976F87A937CDF7DCF7D9C8061 -83498358846C84BC85FB88C58D709001906D9397971C9A1250CF5897618E0000 -C2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081D385358D0890204FC3507452475373606F6349675F6E2C8DB3901F4FD7 -5C5E8CCA65CF7D9A53528896517663C35B585B6B5C0A640D6751905C4ED6591A -592A6C708A51553E581559A560F0625367C182356955964099C49A284F535806 -5BFE80105CB15E2F5F856020614B623466FF6CF06EDE80CE817F82D4888B8CB8 -9000902E968A9EDB9BDB4EE353F059277B2C918D984C9DF96EDD702753535544 -5B856258629E62D36CA26FEF74228A1794386FC18AFE833851E786F853EA0000 -C3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000053E94F4690548FB0596A81315DFD7AEA8FBF68DA8C3772F89C486A3D8AB0 -4E3953585606576662C563A265E66B4E6DE16E5B70AD77ED7AEF7BAA7DBB803D -80C686CB8A95935B56E358C75F3E65AD66966A806BB575378AC7502477E55730 -5F1B6065667A6C6075F47A1A7F6E81F48718904599B37BC9755C7AF97B5184C4 -901079E97A9283365AE177404E2D4EF25B995FE062BD663C67F16CE8866B8877 -8A3B914E92F399D06A177026732A82E784578CAF4E01514651CB558B5BF50000 -C4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005E165E335E815F145F355F6B5FB461F2631166A2671D6F6E7252753A773A -80748139817887768ABF8ADC8D858DF3929A957798029CE552C5635776F46715 -6C8873CD8CC393AE96736D25589C690E69CC8FFD939A75DB901A585A680263B4 -69FB4F436F2C67D88FBB85267DB49354693F6F70576A58F75B2C7D2C722A540A -91E39DB44EAD4F4E505C507552438C9E544858245B9A5E1D5E955EAD5EF75F1F -608C62B5633A63D068AF6C407887798E7A0B7DE082478A028AE68E4490130000 -C5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090B8912D91D89F0E6CE5645864E265756EF476847B1B906993D16EBA54F2 -5FB964A48F4D8FED92445178586B59295C555E976DFB7E8F751C8CBC8EE2985B -70B94F1D6BBF6FB1753096FB514E54105835585759AC5C605F926597675C6E21 -767B83DF8CED901490FD934D7825783A52AA5EA6571F597460125012515A51AC -51CD520055105854585859575B955CF65D8B60BC6295642D6771684368BC68DF -76D76DD86E6F6D9B706F71C85F5375D879777B497B547B527CD67D7152300000 -C6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008463856985E48A0E8B048C468E0F9003900F94199676982D9A3095D850CD -52D5540C58025C0E61A7649E6D1E77B37AE580F48404905392855CE09D07533F -5F975FB36D9C7279776379BF7BE46BD272EC8AAD68036A6151F87A8169345C4A -9CF682EB5BC59149701E56785C6F60C765666C8C8C5A90419813545166C7920D -594890A351854E4D51EA85998B0E7058637A934B696299B47E04757753576960 -8EDF96E36C5D4E8C5C3C5F108FE953028CD1808986795EFF65E54E7351650000 -C7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000059825C3F97EE4EFB598A5FCD8A8D6FE179B079625BE78471732B71B15E74 -5FF5637B649A71C37C984E435EFC4E4B57DC56A260A96FC37D0D80FD813381BF -8FB2899786A45DF4628A64AD898767776CE26D3E743678345A467F7582AD99AC -4FF35EC362DD63926557676F76C3724C80CC80BA8F29914D500D57F95A926885 -6973716472FD8CB758F28CE0966A9019877F79E477E784294F2F5265535A62CD -67CF6CCA767D7B947C95823685848FEB66DD6F2072067E1B83AB99C19EA60000 -C8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000051FD7BB178727BB880877B486AE85E61808C75517560516B92626E8C767A -91979AEA4F107F70629C7B4F95A59CE9567A585986E496BC4F345224534A53CD -53DB5E06642C6591677F6C3E6C4E724872AF73ED75547E41822C85E98CA97BC4 -91C67169981298EF633D6669756A76E478D0854386EE532A5351542659835E87 -5F7C60B26249627962AB65906BD46CCC75B276AE789179D87DCB7F7780A588AB -8AB98CBB907F975E98DB6A0B7C3850995C3E5FAE67876BD8743577097F8E0000 -C9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009F3B67CA7A175339758B9AED5F66819D83F180985F3C5FC575627B46903C -686759EB5A9B7D10767E8B2C4FF55F6A6A196C376F0274E2796888688A558C79 -5EDF63CF75C579D282D7932892F2849C86ED9C2D54C15F6C658C6D5C70158CA7 -8CD3983B654F74F64E0D4ED857E0592B5A665BCC51A85E035E9C601662766577 -65A7666E6D6E72367B268150819A82998B5C8CA08CE68D74961C96444FAE64AB -6B66821E8461856A90E85C01695398A8847A85574F0F526F5FA95E45670D0000 -CA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000798F8179890789866DF55F1762556CB84ECF72699B925206543B567458B3 -61A4626E711A596E7C897CDE7D1B96F06587805E4E194F75517558405E635E73 -5F0A67C44E26853D9589965B7C73980150FB58C1765678A7522577A585117B86 -504F590972477BC77DE88FBA8FD4904D4FBF52C95A295F0197AD4FDD821792EA -570363556B69752B88DC8F147A4252DF58936155620A66AE6BCD7C3F83E95023 -4FF853055446583159495B9D5CF05CEF5D295E9662B16367653E65B9670B0000 -CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006CD56CE170F978327E2B80DE82B3840C84EC870289128A2A8C4A90A692D2 -98FD9CF39D6C4E4F4EA1508D5256574A59A85E3D5FD85FD9623F66B4671B67D0 -68D251927D2180AA81A88B008C8C8CBF927E96325420982C531750D5535C58A8 -64B26734726777667A4691E652C36CA16B8658005E4C5954672C7FFB51E176C6 -646978E89B549EBB57CB59B96627679A6BCE54E969D95E55819C67959BAA67FE -9C52685D4EA64FE353C862B9672B6CAB8FC44FAD7E6D9EBF4E0761626E800000 -CC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006F2B85135473672A9B455DF37B955CAC5BC6871C6E4A84D17A1481085999 -7C8D6C11772052D959227121725F77DB97279D61690B5A7F5A1851A5540D547D -660E76DF8FF792989CF459EA725D6EC5514D68C97DBF7DEC97629EBA64786A21 -830259845B5F6BDB731B76F27DB280178499513267289ED976EE676252FF9905 -5C24623B7C7E8CB0554F60B67D0B958053014E5F51B6591C723A803691CE5F25 -77E253845F797D0485AC8A338E8D975667F385AE9453610961086CB976520000 -CD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008AED8F38552F4F51512A52C753CB5BA55E7D60A0618263D6670967DA6E67 -6D8C733673377531795088D58A98904A909190F596C4878D59154E884F594E0E -8A898F3F981050AD5E7C59965BB95EB863DA63FA64C166DC694A69D86D0B6EB6 -719475287AAF7F8A8000844984C989818B218E0A9065967D990A617E62916B32 -6C836D747FCC7FFC6DC07F8587BA88F8676583B1983C96F76D1B7D61843D916A -4E7153755D506B046FEB85CD862D89A75229540F5C65674E68A8740674830000 -CE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075E288CF88E191CC96E296785F8B73877ACB844E63A0756552896D416E9C -74097559786B7C9296867ADC9F8D4FB6616E65C5865C4E864EAE50DA4E2151CC -5BEE659968816DBC731F764277AD7A1C7CE7826F8AD2907C91CF96759818529B -7DD1502B539867976DCB71D0743381E88F2A96A39C579E9F746058416D997D2F -985E4EE44F364F8B51B752B15DBA601C73B2793C82D3923496B796F6970A9E97 -9F6266A66B74521752A370C888C25EC9604B61906F2371497C3E7DF4806F0000 -CF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000084EE9023932C54429B6F6AD370898CC28DEF973252B45A415ECA5F046717 -697C69946D6A6F0F726272FC7BED8001807E874B90CE516D9E937984808B9332 -8AD6502D548C8A716B6A8CC4810760D167A09DF24E994E989C108A6B85C18568 -69006E7E78978155000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -D0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F0C4E104E154E2A4E314E364E3C4E3F4E424E564E584E824E858C6B4E8A -82125F0D4E8E4E9E4E9F4EA04EA24EB04EB34EB64ECE4ECD4EC44EC64EC24ED7 -4EDE4EED4EDF4EF74F094F5A4F304F5B4F5D4F574F474F764F884F8F4F984F7B -4F694F704F914F6F4F864F9651184FD44FDF4FCE4FD84FDB4FD14FDA4FD04FE4 -4FE5501A50285014502A502550054F1C4FF650215029502C4FFE4FEF50115006 -504350476703505550505048505A5056506C50785080509A508550B450B20000 -D1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000050C950CA50B350C250D650DE50E550ED50E350EE50F950F5510951015102 -511651155114511A5121513A5137513C513B513F51405152514C515451627AF8 -5169516A516E5180518256D8518C5189518F519151935195519651A451A651A2 -51A951AA51AB51B351B151B251B051B551BD51C551C951DB51E0865551E951ED -51F051F551FE5204520B5214520E5227522A522E52335239524F5244524B524C -525E5254526A527452695273527F527D528D529452925271528852918FA80000 -D2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008FA752AC52AD52BC52B552C152CD52D752DE52E352E698ED52E052F352F5 -52F852F9530653087538530D5310530F5315531A5323532F5331533353385340 -534653454E175349534D51D6535E5369536E5918537B53775382539653A053A6 -53A553AE53B053B653C37C1296D953DF66FC71EE53EE53E853ED53FA5401543D -5440542C542D543C542E54365429541D544E548F5475548E545F547154775470 -5492547B5480547654845490548654C754A254B854A554AC54C454C854A80000 -D3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054AB54C254A454BE54BC54D854E554E6550F551454FD54EE54ED54FA54E2 -553955405563554C552E555C55455556555755385533555D5599558054AF558A -559F557B557E5598559E55AE557C558355A9558755A855DA55C555DF55C455DC -55E455D4561455F7561655FE55FD561B55F9564E565071DF5634563656325638 -566B5664562F566C566A56865680568A56A05694568F56A556AE56B656B456C2 -56BC56C156C356C056C856CE56D156D356D756EE56F9570056FF570457090000 -D4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005708570B570D57135718571655C7571C572657375738574E573B5740574F -576957C057885761577F5789579357A057B357A457AA57B057C357C657D457D2 -57D3580A57D657E3580B5819581D587258215862584B58706BC05852583D5879 -588558B9589F58AB58BA58DE58BB58B858AE58C558D358D158D758D958D858E5 -58DC58E458DF58EF58FA58F958FB58FC58FD5902590A5910591B68A65925592C -592D59325938593E7AD259555950594E595A5958596259605967596C59690000 -D5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000059785981599D4F5E4FAB59A359B259C659E859DC598D59D959DA5A255A1F -5A115A1C5A095A1A5A405A6C5A495A355A365A625A6A5A9A5ABC5ABE5ACB5AC2 -5ABD5AE35AD75AE65AE95AD65AFA5AFB5B0C5B0B5B165B325AD05B2A5B365B3E -5B435B455B405B515B555B5A5B5B5B655B695B705B735B755B7865885B7A5B80 -5B835BA65BB85BC35BC75BC95BD45BD05BE45BE65BE25BDE5BE55BEB5BF05BF6 -5BF35C055C075C085C0D5C135C205C225C285C385C395C415C465C4E5C530000 -D6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C505C4F5B715C6C5C6E4E625C765C795C8C5C915C94599B5CAB5CBB5CB6 -5CBC5CB75CC55CBE5CC75CD95CE95CFD5CFA5CED5D8C5CEA5D0B5D155D175D5C -5D1F5D1B5D115D145D225D1A5D195D185D4C5D525D4E5D4B5D6C5D735D765D87 -5D845D825DA25D9D5DAC5DAE5DBD5D905DB75DBC5DC95DCD5DD35DD25DD65DDB -5DEB5DF25DF55E0B5E1A5E195E115E1B5E365E375E445E435E405E4E5E575E54 -5E5F5E625E645E475E755E765E7A9EBC5E7F5EA05EC15EC25EC85ED05ECF0000 -D7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005ED65EE35EDD5EDA5EDB5EE25EE15EE85EE95EEC5EF15EF35EF05EF45EF8 -5EFE5F035F095F5D5F5C5F0B5F115F165F295F2D5F385F415F485F4C5F4E5F2F -5F515F565F575F595F615F6D5F735F775F835F825F7F5F8A5F885F915F875F9E -5F995F985FA05FA85FAD5FBC5FD65FFB5FE45FF85FF15FDD60B35FFF60216060 -601960106029600E6031601B6015602B6026600F603A605A6041606A6077605F -604A6046604D6063604360646042606C606B60596081608D60E76083609A0000 -D8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006084609B60966097609260A7608B60E160B860E060D360B45FF060BD60C6 -60B560D8614D6115610660F660F7610060F460FA6103612160FB60F1610D610E -6147613E61286127614A613F613C612C6134613D614261446173617761586159 -615A616B6174616F61656171615F615D6153617561996196618761AC6194619A -618A619161AB61AE61CC61CA61C961F761C861C361C661BA61CB7F7961CD61E6 -61E361F661FA61F461FF61FD61FC61FE620062086209620D620C6214621B0000 -D9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000621E6221622A622E6230623262336241624E625E6263625B62606268627C -62826289627E62926293629662D46283629462D762D162BB62CF62FF62C664D4 -62C862DC62CC62CA62C262C7629B62C9630C62EE62F163276302630862EF62F5 -6350633E634D641C634F6396638E638063AB637663A3638F6389639F63B5636B -636963BE63E963C063C663E363C963D263F663C4641664346406641364266436 -651D64176428640F6467646F6476644E652A6495649364A564A9648864BC0000 -DA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000064DA64D264C564C764BB64D864C264F164E7820964E064E162AC64E364EF -652C64F664F464F264FA650064FD6518651C650565246523652B653465356537 -65366538754B654865566555654D6558655E655D65726578658265838B8A659B -659F65AB65B765C365C665C165C465CC65D265DB65D965E065E165F16772660A -660365FB6773663566366634661C664F664466496641665E665D666466676668 -665F6662667066836688668E668966846698669D66C166B966C966BE66BC0000 -DB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000066C466B866D666DA66E0663F66E666E966F066F566F7670F6716671E6726 -67279738672E673F67366741673867376746675E676067596763676467896770 -67A9677C676A678C678B67A667A1678567B767EF67B467EC67B367E967B867E4 -67DE67DD67E267EE67B967CE67C667E76A9C681E684668296840684D6832684E -68B3682B685968636877687F689F688F68AD6894689D689B68836AAE68B96874 -68B568A068BA690F688D687E690168CA690868D86922692668E1690C68CD0000 -DC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068D468E768D569366912690468D768E3692568F968E068EF6928692A691A -6923692168C669796977695C6978696B6954697E696E69396974693D69596930 -6961695E695D6981696A69B269AE69D069BF69C169D369BE69CE5BE869CA69DD -69BB69C369A76A2E699169A0699C699569B469DE69E86A026A1B69FF6B0A69F9 -69F269E76A0569B16A1E69ED6A1469EB6A0A6A126AC16A236A136A446A0C6A72 -6A366A786A476A626A596A666A486A386A226A906A8D6AA06A846AA26AA30000 -DD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006A9786176ABB6AC36AC26AB86AB36AAC6ADE6AD16ADF6AAA6ADA6AEA6AFB -6B0586166AFA6B126B169B316B1F6B386B3776DC6B3998EE6B476B436B496B50 -6B596B546B5B6B5F6B616B786B796B7F6B806B846B836B8D6B986B956B9E6BA4 -6BAA6BAB6BAF6BB26BB16BB36BB76BBC6BC66BCB6BD36BDF6BEC6BEB6BF36BEF -9EBE6C086C136C146C1B6C246C236C5E6C556C626C6A6C826C8D6C9A6C816C9B -6C7E6C686C736C926C906CC46CF16CD36CBD6CD76CC56CDD6CAE6CB16CBE0000 -DE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006CBA6CDB6CEF6CD96CEA6D1F884D6D366D2B6D3D6D386D196D356D336D12 -6D0C6D636D936D646D5A6D796D596D8E6D956FE46D856DF96E156E0A6DB56DC7 -6DE66DB86DC66DEC6DDE6DCC6DE86DD26DC56DFA6DD96DE46DD56DEA6DEE6E2D -6E6E6E2E6E196E726E5F6E3E6E236E6B6E2B6E766E4D6E1F6E436E3A6E4E6E24 -6EFF6E1D6E386E826EAA6E986EC96EB76ED36EBD6EAF6EC46EB26ED46ED56E8F -6EA56EC26E9F6F416F11704C6EEC6EF86EFE6F3F6EF26F316EEF6F326ECC0000 -DF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006F3E6F136EF76F866F7A6F786F816F806F6F6F5B6FF36F6D6F826F7C6F58 -6F8E6F916FC26F666FB36FA36FA16FA46FB96FC66FAA6FDF6FD56FEC6FD46FD8 -6FF16FEE6FDB7009700B6FFA70117001700F6FFE701B701A6F74701D7018701F -7030703E7032705170637099709270AF70F170AC70B870B370AE70DF70CB70DD -70D9710970FD711C711971657155718871667162714C7156716C718F71FB7184 -719571A871AC71D771B971BE71D271C971D471CE71E071EC71E771F571FC0000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000071F971FF720D7210721B7228722D722C72307232723B723C723F72407246 -724B72587274727E7282728172877292729672A272A772B972B272C372C672C4 -72CE72D272E272E072E172F972F7500F7317730A731C7316731D7334732F7329 -7325733E734E734F9ED87357736A7368737073787375737B737A73C873B373CE -73BB73C073E573EE73DE74A27405746F742573F87432743A7455743F745F7459 -7441745C746974707463746A7476747E748B749E74A774CA74CF74D473F10000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000074E074E374E774E974EE74F274F074F174F874F7750475037505750C750E -750D75157513751E7526752C753C7544754D754A7549755B7546755A75697564 -7567756B756D75787576758675877574758A758975827594759A759D75A575A3 -75C275B375C375B575BD75B875BC75B175CD75CA75D275D975E375DE75FE75FF -75FC760175F075FA75F275F3760B760D7609761F762776207621762276247634 -7630763B764776487646765C76587661766276687669766A7667766C76700000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000767276767678767C768076837688768B768E769676937699769A76B076B4 -76B876B976BA76C276CD76D676D276DE76E176E576E776EA862F76FB77087707 -770477297724771E77257726771B773777387747775A7768776B775B7765777F -777E7779778E778B779177A0779E77B077B677B977BF77BC77BD77BB77C777CD -77D777DA77DC77E377EE77FC780C781279267820792A7845788E78747886787C -789A788C78A378B578AA78AF78D178C678CB78D478BE78BC78C578CA78EC0000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000078E778DA78FD78F47907791279117919792C792B794079607957795F795A -79557953797A797F798A799D79A79F4B79AA79AE79B379B979BA79C979D579E7 -79EC79E179E37A087A0D7A187A197A207A1F79807A317A3B7A3E7A377A437A57 -7A497A617A627A699F9D7A707A797A7D7A887A977A957A987A967AA97AC87AB0 -7AB67AC57AC47ABF90837AC77ACA7ACD7ACF7AD57AD37AD97ADA7ADD7AE17AE2 -7AE67AED7AF07B027B0F7B0A7B067B337B187B197B1E7B357B287B367B500000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007B7A7B047B4D7B0B7B4C7B457B757B657B747B677B707B717B6C7B6E7B9D -7B987B9F7B8D7B9C7B9A7B8B7B927B8F7B5D7B997BCB7BC17BCC7BCF7BB47BC6 -7BDD7BE97C117C147BE67BE57C607C007C077C137BF37BF77C177C0D7BF67C23 -7C277C2A7C1F7C377C2B7C3D7C4C7C437C547C4F7C407C507C587C5F7C647C56 -7C657C6C7C757C837C907CA47CAD7CA27CAB7CA17CA87CB37CB27CB17CAE7CB9 -7CBD7CC07CC57CC27CD87CD27CDC7CE29B3B7CEF7CF27CF47CF67CFA7D060000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007D027D1C7D157D0A7D457D4B7D2E7D327D3F7D357D467D737D567D4E7D72 -7D687D6E7D4F7D637D937D897D5B7D8F7D7D7D9B7DBA7DAE7DA37DB57DC77DBD -7DAB7E3D7DA27DAF7DDC7DB87D9F7DB07DD87DDD7DE47DDE7DFB7DF27DE17E05 -7E0A7E237E217E127E317E1F7E097E0B7E227E467E667E3B7E357E397E437E37 -7E327E3A7E677E5D7E567E5E7E597E5A7E797E6A7E697E7C7E7B7E837DD57E7D -8FAE7E7F7E887E897E8C7E927E907E937E947E967E8E7E9B7E9C7F387F3A0000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007F457F4C7F4D7F4E7F507F517F557F547F587F5F7F607F687F697F677F78 -7F827F867F837F887F877F8C7F947F9E7F9D7F9A7FA37FAF7FB27FB97FAE7FB6 -7FB88B717FC57FC67FCA7FD57FD47FE17FE67FE97FF37FF998DC80068004800B -801280188019801C80218028803F803B804A804680528058805A805F80628068 -80738072807080768079807D807F808480868085809B8093809A80AD519080AC -80DB80E580D980DD80C480DA80D6810980EF80F1811B81298123812F814B0000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000968B8146813E8153815180FC8171816E81658166817481838188818A8180 -818281A0819581A481A3815F819381A981B081B581BE81B881BD81C081C281BA -81C981CD81D181D981D881C881DA81DF81E081E781FA81FB81FE820182028205 -8207820A820D821082168229822B82388233824082598258825D825A825F8264 -82628268826A826B822E827182778278827E828D829282AB829F82BB82AC82E1 -82E382DF82D282F482F382FA8393830382FB82F982DE830682DC830982D90000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000833583348316833283318340833983508345832F832B831783188385839A -83AA839F83A283968323838E8387838A837C83B58373837583A0838983A883F4 -841383EB83CE83FD840383D8840B83C183F7840783E083F2840D8422842083BD -8438850683FB846D842A843C855A84848477846B84AD846E848284698446842C -846F8479843584CA846284B984BF849F84D984CD84BB84DA84D084C184C684D6 -84A1852184FF84F485178518852C851F8515851484FC85408563855885480000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000085418602854B8555858085A485888591858A85A8856D8594859B85EA8587 -859C8577857E859085C985BA85CF85B985D085D585DD85E585DC85F9860A8613 -860B85FE85FA86068622861A8630863F864D4E558654865F86678671869386A3 -86A986AA868B868C86B686AF86C486C686B086C9882386AB86D486DE86E986EC -86DF86DB86EF8712870687088700870386FB87118709870D86F9870A8734873F -8737873B87258729871A8760875F8778874C874E877487578768876E87590000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000087538763876A880587A2879F878287AF87CB87BD87C087D096D687AB87C4 -87B387C787C687BB87EF87F287E0880F880D87FE87F687F7880E87D288118816 -8815882288218831883688398827883B8844884288528859885E8862886B8881 -887E889E8875887D88B5887288828897889288AE889988A2888D88A488B088BF -88B188C388C488D488D888D988DD88F9890288FC88F488E888F28904890C890A -89138943891E8925892A892B89418944893B89368938894C891D8960895E0000 -EB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000089668964896D896A896F89748977897E89838988898A8993899889A189A9 -89A689AC89AF89B289BA89BD89BF89C089DA89DC89DD89E789F489F88A038A16 -8A108A0C8A1B8A1D8A258A368A418A5B8A528A468A488A7C8A6D8A6C8A628A85 -8A828A848AA88AA18A918AA58AA68A9A8AA38AC48ACD8AC28ADA8AEB8AF38AE7 -8AE48AF18B148AE08AE28AF78ADE8ADB8B0C8B078B1A8AE18B168B108B178B20 -8B3397AB8B268B2B8B3E8B288B418B4C8B4F8B4E8B498B568B5B8B5A8B6B0000 -EC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008B5F8B6C8B6F8B748B7D8B808B8C8B8E8B928B938B968B998B9A8C3A8C41 -8C3F8C488C4C8C4E8C508C558C628C6C8C788C7A8C828C898C858C8A8C8D8C8E -8C948C7C8C98621D8CAD8CAA8CBD8CB28CB38CAE8CB68CC88CC18CE48CE38CDA -8CFD8CFA8CFB8D048D058D0A8D078D0F8D0D8D109F4E8D138CCD8D148D168D67 -8D6D8D718D738D818D998DC28DBE8DBA8DCF8DDA8DD68DCC8DDB8DCB8DEA8DEB -8DDF8DE38DFC8E088E098DFF8E1D8E1E8E108E1F8E428E358E308E348E4A0000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008E478E498E4C8E508E488E598E648E608E2A8E638E558E768E728E7C8E81 -8E878E858E848E8B8E8A8E938E918E948E998EAA8EA18EAC8EB08EC68EB18EBE -8EC58EC88ECB8EDB8EE38EFC8EFB8EEB8EFE8F0A8F058F158F128F198F138F1C -8F1F8F1B8F0C8F268F338F3B8F398F458F428F3E8F4C8F498F468F4E8F578F5C -8F628F638F648F9C8F9F8FA38FAD8FAF8FB78FDA8FE58FE28FEA8FEF90878FF4 -90058FF98FFA901190159021900D901E9016900B90279036903590398FF80000 -EE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000904F905090519052900E9049903E90569058905E9068906F907696A89072 -9082907D90819080908A9089908F90A890AF90B190B590E290E4624890DB9102 -9112911991329130914A9156915891639165916991739172918B9189918291A2 -91AB91AF91AA91B591B491BA91C091C191C991CB91D091D691DF91E191DB91FC -91F591F6921E91FF9214922C92159211925E925792459249926492489295923F -924B9250929C92969293929B925A92CF92B992B792E9930F92FA9344932E0000 -EF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000093199322931A9323933A9335933B935C9360937C936E935693B093AC93AD -939493B993D693D793E893E593D893C393DD93D093C893E4941A941494139403 -940794109436942B94359421943A944194529444945B94609462945E946A9229 -947094759477947D945A947C947E9481947F95829587958A9594959695989599 -95A095A895A795AD95BC95BB95B995BE95CA6FF695C395CD95CC95D595D495D6 -95DC95E195E595E296219628962E962F9642964C964F964B9677965C965E0000 -F0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000965D965F96669672966C968D96989695969796AA96A796B196B296B096B4 -96B696B896B996CE96CB96C996CD894D96DC970D96D596F99704970697089713 -970E9711970F971697199724972A97309739973D973E97449746974897429749 -975C976097649766976852D2976B977197799785977C9781977A9786978B978F -9790979C97A897A697A397B397B497C397C697C897CB97DC97ED9F4F97F27ADF -97F697F5980F980C9838982498219837983D9846984F984B986B986F98700000 -F1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000098719874987398AA98AF98B198B698C498C398C698E998EB990399099912 -991499189921991D991E99249920992C992E993D993E9942994999459950994B -99519952994C99559997999899A599AD99AE99BC99DF99DB99DD99D899D199ED -99EE99F199F299FB99F89A019A0F9A0599E29A199A2B9A379A459A429A409A43 -9A3E9A559A4D9A5B9A579A5F9A629A659A649A699A6B9A6A9AAD9AB09ABC9AC0 -9ACF9AD19AD39AD49ADE9ADF9AE29AE39AE69AEF9AEB9AEE9AF49AF19AF70000 -F2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009AFB9B069B189B1A9B1F9B229B239B259B279B289B299B2A9B2E9B2F9B32 -9B449B439B4F9B4D9B4E9B519B589B749B939B839B919B969B979B9F9BA09BA8 -9BB49BC09BCA9BB99BC69BCF9BD19BD29BE39BE29BE49BD49BE19C3A9BF29BF1 -9BF09C159C149C099C139C0C9C069C089C129C0A9C049C2E9C1B9C259C249C21 -9C309C479C329C469C3E9C5A9C609C679C769C789CE79CEC9CF09D099D089CEB -9D039D069D2A9D269DAF9D239D1F9D449D159D129D419D3F9D3E9D469D480000 -F3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009D5D9D5E9D649D519D509D599D729D899D879DAB9D6F9D7A9D9A9DA49DA9 -9DB29DC49DC19DBB9DB89DBA9DC69DCF9DC29DD99DD39DF89DE69DED9DEF9DFD -9E1A9E1B9E1E9E759E799E7D9E819E889E8B9E8C9E929E959E919E9D9EA59EA9 -9EB89EAA9EAD97619ECC9ECE9ECF9ED09ED49EDC9EDE9EDD9EE09EE59EE89EEF -9EF49EF69EF79EF99EFB9EFC9EFD9F079F0876B79F159F219F2C9F3E9F4A9F52 -9F549F639F5F9F609F619F669F679F6C9F6A9F779F729F769F959F9C9FA00000 -F4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000582F69C79059746451DC7199000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/euc-kr.enc b/library/encoding/euc-kr.enc deleted file mode 100644 index 5e9bb93..0000000 --- a/library/encoding/euc-kr.enc +++ /dev/null @@ -1,1533 +0,0 @@ -# Encoding file: euc-kr, multi-byte -M -003F 0 90 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030003001300200B72025202600A8300300AD20152225FF3C223C20182019 -201C201D3014301530083009300A300B300C300D300E300F3010301100B100D7 -00F7226022642265221E223400B0203220332103212BFFE0FFE1FFE526422640 -222022A52312220222072261225200A7203B2606260525CB25CF25CE25C725C6 -25A125A025B325B225BD25BC219221902191219321943013226A226B221A223D -221D2235222B222C2208220B2286228722822283222A222922272228FFE20000 -A2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000021D221D42200220300B4FF5E02C702D802DD02DA02D900B802DB00A100BF -02D0222E2211220F00A42109203025C125C025B725B626642660266126652667 -2663229925C825A325D025D1259225A425A525A825A725A625A92668260F260E -261C261E00B62020202121952197219921962198266D2669266A266C327F321C -211633C7212233C233D821210000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF01FF02FF03FF04FF05FF06FF07FF08FF09FF0AFF0BFF0CFF0DFF0EFF0F -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19FF1AFF1BFF1CFF1DFF1EFF1F -FF20FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF3BFFE6FF3DFF3EFF3F -FF40FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5AFF5BFF5CFF5DFFE30000 -A4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000313131323133313431353136313731383139313A313B313C313D313E313F -3140314131423143314431453146314731483149314A314B314C314D314E314F -3150315131523153315431553156315731583159315A315B315C315D315E315F -3160316131623163316431653166316731683169316A316B316C316D316E316F -3170317131723173317431753176317731783179317A317B317C317D317E317F -3180318131823183318431853186318731883189318A318B318C318D318E0000 -A5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000217021712172217321742175217621772178217900000000000000000000 -2160216121622163216421652166216721682169000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -A6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000025002502250C251025182514251C252C25242534253C25012503250F2513 -251B251725232533252B253B254B2520252F25282537253F251D253025252538 -254225122511251A251925162515250E250D251E251F25212522252625272529 -252A252D252E25312532253525362539253A253D253E25402541254325442545 -2546254725482549254A00000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -A7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00003395339633972113339833C433A333A433A533A63399339A339B339C339D -339E339F33A033A133A233CA338D338E338F33CF3388338933C833A733A833B0 -33B133B233B333B433B533B633B733B833B93380338133823383338433BA33BB -33BC33BD33BE33BF33903391339233933394212633C033C1338A338B338C33D6 -33C533AD33AE33AF33DB33A933AA33AB33AC33DD33D033D333C333C933DC33C6 -0000000000000000000000000000000000000000000000000000000000000000 -A8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000C600D000AA0126000001320000013F014100D8015200BA00DE0166014A -00003260326132623263326432653266326732683269326A326B326C326D326E -326F3270327132723273327432753276327732783279327A327B24D024D124D2 -24D324D424D524D624D724D824D924DA24DB24DC24DD24DE24DF24E024E124E2 -24E324E424E524E624E724E824E9246024612462246324642465246624672468 -2469246A246B246C246D246E00BD2153215400BC00BE215B215C215D215E0000 -A9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000E6011100F001270131013301380140014200F8015300DF00FE0167014B -01493200320132023203320432053206320732083209320A320B320C320D320E -320F3210321132123213321432153216321732183219321A321B249C249D249E -249F24A024A124A224A324A424A524A624A724A824A924AA24AB24AC24AD24AE -24AF24B024B124B224B324B424B5247424752476247724782479247A247B247C -247D247E247F24802481248200B900B200B32074207F20812082208320840000 -AA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -AB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -AC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000004100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -B0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AC00AC01AC04AC07AC08AC09AC0AAC10AC11AC12AC13AC14AC15AC16AC17 -AC19AC1AAC1BAC1CAC1DAC20AC24AC2CAC2DAC2FAC30AC31AC38AC39AC3CAC40 -AC4BAC4DAC54AC58AC5CAC70AC71AC74AC77AC78AC7AAC80AC81AC83AC84AC85 -AC86AC89AC8AAC8BAC8CAC90AC94AC9CAC9DAC9FACA0ACA1ACA8ACA9ACAAACAC -ACAFACB0ACB8ACB9ACBBACBCACBDACC1ACC4ACC8ACCCACD5ACD7ACE0ACE1ACE4 -ACE7ACE8ACEAACECACEFACF0ACF1ACF3ACF5ACF6ACFCACFDAD00AD04AD060000 -B1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AD0CAD0DAD0FAD11AD18AD1CAD20AD29AD2CAD2DAD34AD35AD38AD3CAD44 -AD45AD47AD49AD50AD54AD58AD61AD63AD6CAD6DAD70AD73AD74AD75AD76AD7B -AD7CAD7DAD7FAD81AD82AD88AD89AD8CAD90AD9CAD9DADA4ADB7ADC0ADC1ADC4 -ADC8ADD0ADD1ADD3ADDCADE0ADE4ADF8ADF9ADFCADFFAE00AE01AE08AE09AE0B -AE0DAE14AE30AE31AE34AE37AE38AE3AAE40AE41AE43AE45AE46AE4AAE4CAE4D -AE4EAE50AE54AE56AE5CAE5DAE5FAE60AE61AE65AE68AE69AE6CAE70AE780000 -B2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AE79AE7BAE7CAE7DAE84AE85AE8CAEBCAEBDAEBEAEC0AEC4AECCAECDAECF -AED0AED1AED8AED9AEDCAEE8AEEBAEEDAEF4AEF8AEFCAF07AF08AF0DAF10AF2C -AF2DAF30AF32AF34AF3CAF3DAF3FAF41AF42AF43AF48AF49AF50AF5CAF5DAF64 -AF65AF79AF80AF84AF88AF90AF91AF95AF9CAFB8AFB9AFBCAFC0AFC7AFC8AFC9 -AFCBAFCDAFCEAFD4AFDCAFE8AFE9AFF0AFF1AFF4AFF8B000B001B004B00CB010 -B014B01CB01DB028B044B045B048B04AB04CB04EB053B054B055B057B0590000 -B3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B05DB07CB07DB080B084B08CB08DB08FB091B098B099B09AB09CB09FB0A0 -B0A1B0A2B0A8B0A9B0ABB0ACB0ADB0AEB0AFB0B1B0B3B0B4B0B5B0B8B0BCB0C4 -B0C5B0C7B0C8B0C9B0D0B0D1B0D4B0D8B0E0B0E5B108B109B10BB10CB110B112 -B113B118B119B11BB11CB11DB123B124B125B128B12CB134B135B137B138B139 -B140B141B144B148B150B151B154B155B158B15CB160B178B179B17CB180B182 -B188B189B18BB18DB192B193B194B198B19CB1A8B1CCB1D0B1D4B1DCB1DD0000 -B4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B1DFB1E8B1E9B1ECB1F0B1F9B1FBB1FDB204B205B208B20BB20CB214B215 -B217B219B220B234B23CB258B25CB260B268B269B274B275B27CB284B285B289 -B290B291B294B298B299B29AB2A0B2A1B2A3B2A5B2A6B2AAB2ACB2B0B2B4B2C8 -B2C9B2CCB2D0B2D2B2D8B2D9B2DBB2DDB2E2B2E4B2E5B2E6B2E8B2EBB2ECB2ED -B2EEB2EFB2F3B2F4B2F5B2F7B2F8B2F9B2FAB2FBB2FFB300B301B304B308B310 -B311B313B314B315B31CB354B355B356B358B35BB35CB35EB35FB364B3650000 -B5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B367B369B36BB36EB370B371B374B378B380B381B383B384B385B38CB390 -B394B3A0B3A1B3A8B3ACB3C4B3C5B3C8B3CBB3CCB3CEB3D0B3D4B3D5B3D7B3D9 -B3DBB3DDB3E0B3E4B3E8B3FCB410B418B41CB420B428B429B42BB434B450B451 -B454B458B460B461B463B465B46CB480B488B49DB4A4B4A8B4ACB4B5B4B7B4B9 -B4C0B4C4B4C8B4D0B4D5B4DCB4DDB4E0B4E3B4E4B4E6B4ECB4EDB4EFB4F1B4F8 -B514B515B518B51BB51CB524B525B527B528B529B52AB530B531B534B5380000 -B6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B540B541B543B544B545B54BB54CB54DB550B554B55CB55DB55FB560B561 -B5A0B5A1B5A4B5A8B5AAB5ABB5B0B5B1B5B3B5B4B5B5B5BBB5BCB5BDB5C0B5C4 -B5CCB5CDB5CFB5D0B5D1B5D8B5ECB610B611B614B618B625B62CB634B648B664 -B668B69CB69DB6A0B6A4B6ABB6ACB6B1B6D4B6F0B6F4B6F8B700B701B705B728 -B729B72CB72FB730B738B739B73BB744B748B74CB754B755B760B764B768B770 -B771B773B775B77CB77DB780B784B78CB78DB78FB790B791B792B796B7970000 -B7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B798B799B79CB7A0B7A8B7A9B7ABB7ACB7ADB7B4B7B5B7B8B7C7B7C9B7EC -B7EDB7F0B7F4B7FCB7FDB7FFB800B801B807B808B809B80CB810B818B819B81B -B81DB824B825B828B82CB834B835B837B838B839B840B844B851B853B85CB85D -B860B864B86CB86DB86FB871B878B87CB88DB8A8B8B0B8B4B8B8B8C0B8C1B8C3 -B8C5B8CCB8D0B8D4B8DDB8DFB8E1B8E8B8E9B8ECB8F0B8F8B8F9B8FBB8FDB904 -B918B920B93CB93DB940B944B94CB94FB951B958B959B95CB960B968B9690000 -B8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B96BB96DB974B975B978B97CB984B985B987B989B98AB98DB98EB9ACB9AD -B9B0B9B4B9BCB9BDB9BFB9C1B9C8B9C9B9CCB9CEB9CFB9D0B9D1B9D2B9D8B9D9 -B9DBB9DDB9DEB9E1B9E3B9E4B9E5B9E8B9ECB9F4B9F5B9F7B9F8B9F9B9FABA00 -BA01BA08BA15BA38BA39BA3CBA40BA42BA48BA49BA4BBA4DBA4EBA53BA54BA55 -BA58BA5CBA64BA65BA67BA68BA69BA70BA71BA74BA78BA83BA84BA85BA87BA8C -BAA8BAA9BAABBAACBAB0BAB2BAB8BAB9BABBBABDBAC4BAC8BAD8BAD9BAFC0000 -B9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BB00BB04BB0DBB0FBB11BB18BB1CBB20BB29BB2BBB34BB35BB36BB38BB3B -BB3CBB3DBB3EBB44BB45BB47BB49BB4DBB4FBB50BB54BB58BB61BB63BB6CBB88 -BB8CBB90BBA4BBA8BBACBBB4BBB7BBC0BBC4BBC8BBD0BBD3BBF8BBF9BBFCBBFF -BC00BC02BC08BC09BC0BBC0CBC0DBC0FBC11BC14BC15BC16BC17BC18BC1BBC1C -BC1DBC1EBC1FBC24BC25BC27BC29BC2DBC30BC31BC34BC38BC40BC41BC43BC44 -BC45BC49BC4CBC4DBC50BC5DBC84BC85BC88BC8BBC8CBC8EBC94BC95BC970000 -BA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BC99BC9ABCA0BCA1BCA4BCA7BCA8BCB0BCB1BCB3BCB4BCB5BCBCBCBDBCC0 -BCC4BCCDBCCFBCD0BCD1BCD5BCD8BCDCBCF4BCF5BCF6BCF8BCFCBD04BD05BD07 -BD09BD10BD14BD24BD2CBD40BD48BD49BD4CBD50BD58BD59BD64BD68BD80BD81 -BD84BD87BD88BD89BD8ABD90BD91BD93BD95BD99BD9ABD9CBDA4BDB0BDB8BDD4 -BDD5BDD8BDDCBDE9BDF0BDF4BDF8BE00BE03BE05BE0CBE0DBE10BE14BE1CBE1D -BE1FBE44BE45BE48BE4CBE4EBE54BE55BE57BE59BE5ABE5BBE60BE61BE640000 -BB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BE68BE6ABE70BE71BE73BE74BE75BE7BBE7CBE7DBE80BE84BE8CBE8DBE8F -BE90BE91BE98BE99BEA8BED0BED1BED4BED7BED8BEE0BEE3BEE4BEE5BEECBF01 -BF08BF09BF18BF19BF1BBF1CBF1DBF40BF41BF44BF48BF50BF51BF55BF94BFB0 -BFC5BFCCBFCDBFD0BFD4BFDCBFDFBFE1C03CC051C058C05CC060C068C069C090 -C091C094C098C0A0C0A1C0A3C0A5C0ACC0ADC0AFC0B0C0B3C0B4C0B5C0B6C0BC -C0BDC0BFC0C0C0C1C0C5C0C8C0C9C0CCC0D0C0D8C0D9C0DBC0DCC0DDC0E40000 -BC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C0E5C0E8C0ECC0F4C0F5C0F7C0F9C100C104C108C110C115C11CC11DC11E -C11FC120C123C124C126C127C12CC12DC12FC130C131C136C138C139C13CC140 -C148C149C14BC14CC14DC154C155C158C15CC164C165C167C168C169C170C174 -C178C185C18CC18DC18EC190C194C196C19CC19DC19FC1A1C1A5C1A8C1A9C1AC -C1B0C1BDC1C4C1C8C1CCC1D4C1D7C1D8C1E0C1E4C1E8C1F0C1F1C1F3C1FCC1FD -C200C204C20CC20DC20FC211C218C219C21CC21FC220C228C229C22BC22D0000 -BD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C22FC231C232C234C248C250C251C254C258C260C265C26CC26DC270C274 -C27CC27DC27FC281C288C289C290C298C29BC29DC2A4C2A5C2A8C2ACC2ADC2B4 -C2B5C2B7C2B9C2DCC2DDC2E0C2E3C2E4C2EBC2ECC2EDC2EFC2F1C2F6C2F8C2F9 -C2FBC2FCC300C308C309C30CC30DC313C314C315C318C31CC324C325C328C329 -C345C368C369C36CC370C372C378C379C37CC37DC384C388C38CC3C0C3D8C3D9 -C3DCC3DFC3E0C3E2C3E8C3E9C3EDC3F4C3F5C3F8C408C410C424C42CC4300000 -BE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C434C43CC43DC448C464C465C468C46CC474C475C479C480C494C49CC4B8 -C4BCC4E9C4F0C4F1C4F4C4F8C4FAC4FFC500C501C50CC510C514C51CC528C529 -C52CC530C538C539C53BC53DC544C545C548C549C54AC54CC54DC54EC553C554 -C555C557C558C559C55DC55EC560C561C564C568C570C571C573C574C575C57C -C57DC580C584C587C58CC58DC58FC591C595C597C598C59CC5A0C5A9C5B4C5B5 -C5B8C5B9C5BBC5BCC5BDC5BEC5C4C5C5C5C6C5C7C5C8C5C9C5CAC5CCC5CE0000 -BF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C5D0C5D1C5D4C5D8C5E0C5E1C5E3C5E5C5ECC5EDC5EEC5F0C5F4C5F6C5F7 -C5FCC5FDC5FEC5FFC600C601C605C606C607C608C60CC610C618C619C61BC61C -C624C625C628C62CC62DC62EC630C633C634C635C637C639C63BC640C641C644 -C648C650C651C653C654C655C65CC65DC660C66CC66FC671C678C679C67CC680 -C688C689C68BC68DC694C695C698C69CC6A4C6A5C6A7C6A9C6B0C6B1C6B4C6B8 -C6B9C6BAC6C0C6C1C6C3C6C5C6CCC6CDC6D0C6D4C6DCC6DDC6E0C6E1C6E80000 -C0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C6E9C6ECC6F0C6F8C6F9C6FDC704C705C708C70CC714C715C717C719C720 -C721C724C728C730C731C733C735C737C73CC73DC740C744C74AC74CC74DC74F -C751C752C753C754C755C756C757C758C75CC760C768C76BC774C775C778C77C -C77DC77EC783C784C785C787C788C789C78AC78EC790C791C794C796C797C798 -C79AC7A0C7A1C7A3C7A4C7A5C7A6C7ACC7ADC7B0C7B4C7BCC7BDC7BFC7C0C7C1 -C7C8C7C9C7CCC7CEC7D0C7D8C7DDC7E4C7E8C7ECC800C801C804C808C80A0000 -C1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C810C811C813C815C816C81CC81DC820C824C82CC82DC82FC831C838C83C -C840C848C849C84CC84DC854C870C871C874C878C87AC880C881C883C885C886 -C887C88BC88CC88DC894C89DC89FC8A1C8A8C8BCC8BDC8C4C8C8C8CCC8D4C8D5 -C8D7C8D9C8E0C8E1C8E4C8F5C8FCC8FDC900C904C905C906C90CC90DC90FC911 -C918C92CC934C950C951C954C958C960C961C963C96CC970C974C97CC988C989 -C98CC990C998C999C99BC99DC9C0C9C1C9C4C9C7C9C8C9CAC9D0C9D1C9D30000 -C2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C9D5C9D6C9D9C9DAC9DCC9DDC9E0C9E2C9E4C9E7C9ECC9EDC9EFC9F0C9F1 -C9F8C9F9C9FCCA00CA08CA09CA0BCA0CCA0DCA14CA18CA29CA4CCA4DCA50CA54 -CA5CCA5DCA5FCA60CA61CA68CA7DCA84CA98CABCCABDCAC0CAC4CACCCACDCACF -CAD1CAD3CAD8CAD9CAE0CAECCAF4CB08CB10CB14CB18CB20CB21CB41CB48CB49 -CB4CCB50CB58CB59CB5DCB64CB78CB79CB9CCBB8CBD4CBE4CBE7CBE9CC0CCC0D -CC10CC14CC1CCC1DCC21CC22CC27CC28CC29CC2CCC2ECC30CC38CC39CC3B0000 -C3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CC3CCC3DCC3ECC44CC45CC48CC4CCC54CC55CC57CC58CC59CC60CC64CC66 -CC68CC70CC75CC98CC99CC9CCCA0CCA8CCA9CCABCCACCCADCCB4CCB5CCB8CCBC -CCC4CCC5CCC7CCC9CCD0CCD4CCE4CCECCCF0CD01CD08CD09CD0CCD10CD18CD19 -CD1BCD1DCD24CD28CD2CCD39CD5CCD60CD64CD6CCD6DCD6FCD71CD78CD88CD94 -CD95CD98CD9CCDA4CDA5CDA7CDA9CDB0CDC4CDCCCDD0CDE8CDECCDF0CDF8CDF9 -CDFBCDFDCE04CE08CE0CCE14CE19CE20CE21CE24CE28CE30CE31CE33CE350000 -C4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CE58CE59CE5CCE5FCE60CE61CE68CE69CE6BCE6DCE74CE75CE78CE7CCE84 -CE85CE87CE89CE90CE91CE94CE98CEA0CEA1CEA3CEA4CEA5CEACCEADCEC1CEE4 -CEE5CEE8CEEBCEECCEF4CEF5CEF7CEF8CEF9CF00CF01CF04CF08CF10CF11CF13 -CF15CF1CCF20CF24CF2CCF2DCF2FCF30CF31CF38CF54CF55CF58CF5CCF64CF65 -CF67CF69CF70CF71CF74CF78CF80CF85CF8CCFA1CFA8CFB0CFC4CFE0CFE1CFE4 -CFE8CFF0CFF1CFF3CFF5CFFCD000D004D011D018D02DD034D035D038D03C0000 -C5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D044D045D047D049D050D054D058D060D06CD06DD070D074D07CD07DD081 -D0A4D0A5D0A8D0ACD0B4D0B5D0B7D0B9D0C0D0C1D0C4D0C8D0C9D0D0D0D1D0D3 -D0D4D0D5D0DCD0DDD0E0D0E4D0ECD0EDD0EFD0F0D0F1D0F8D10DD130D131D134 -D138D13AD140D141D143D144D145D14CD14DD150D154D15CD15DD15FD161D168 -D16CD17CD184D188D1A0D1A1D1A4D1A8D1B0D1B1D1B3D1B5D1BAD1BCD1C0D1D8 -D1F4D1F8D207D209D210D22CD22DD230D234D23CD23DD23FD241D248D25C0000 -C6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D264D280D281D284D288D290D291D295D29CD2A0D2A4D2ACD2B1D2B8D2B9 -D2BCD2BFD2C0D2C2D2C8D2C9D2CBD2D4D2D8D2DCD2E4D2E5D2F0D2F1D2F4D2F8 -D300D301D303D305D30CD30DD30ED310D314D316D31CD31DD31FD320D321D325 -D328D329D32CD330D338D339D33BD33CD33DD344D345D37CD37DD380D384D38C -D38DD38FD390D391D398D399D39CD3A0D3A8D3A9D3ABD3ADD3B4D3B8D3BCD3C4 -D3C5D3C8D3C9D3D0D3D8D3E1D3E3D3ECD3EDD3F0D3F4D3FCD3FDD3FFD4010000 -C7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D408D41DD440D444D45CD460D464D46DD46FD478D479D47CD47FD480D482 -D488D489D48BD48DD494D4A9D4CCD4D0D4D4D4DCD4DFD4E8D4ECD4F0D4F8D4FB -D4FDD504D508D50CD514D515D517D53CD53DD540D544D54CD54DD54FD551D558 -D559D55CD560D565D568D569D56BD56DD574D575D578D57CD584D585D587D588 -D589D590D5A5D5C8D5C9D5CCD5D0D5D2D5D8D5D9D5DBD5DDD5E4D5E5D5E8D5EC -D5F4D5F5D5F7D5F9D600D601D604D608D610D611D613D614D615D61CD6200000 -C8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D624D62DD638D639D63CD640D645D648D649D64BD64DD651D654D655D658 -D65CD667D669D670D671D674D683D685D68CD68DD690D694D69DD69FD6A1D6A8 -D6ACD6B0D6B9D6BBD6C4D6C5D6C8D6CCD6D1D6D4D6D7D6D9D6E0D6E4D6E8D6F0 -D6F5D6FCD6FDD700D704D711D718D719D71CD720D728D729D72BD72DD734D735 -D738D73CD744D747D749D750D751D754D756D757D758D759D760D761D763D765 -D769D76CD770D774D77CD77DD781D788D789D78CD790D798D799D79BD79D0000 -CA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F3D4F73504750F952A053EF547554E556095AC15BB6668767B667B767EF -6B4C73C275C27A3C82DB8304885788888A368CC88DCF8EFB8FE699D5523B5374 -5404606A61646BBC73CF811A89BA89D295A34F83520A58BE597859E65E725E79 -61C763C0674667EC687F6F97764E770B78F57A087AFF7C21809D826E82718AEB -95934E6B559D66F76E3478A37AED845B8910874E97A852D8574E582A5D4C611F -61BE6221656267D16A446E1B751875B376E377B07D3A90AF945194529F950000 -CB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000053235CAC753280DB92409598525B580859DC5CA15D175EB75F3A5F4A6177 -6C5F757A75867CE07D737DB17F8C81548221859189418B1B92FC964D9C474ECB -4EF7500B51F1584F6137613E6168653969EA6F1175A5768676D67B8782A584CB -F90093A7958B55805BA25751F9017CB37FB991B5502853BB5C455DE862D2636E -64DA64E76E2070AC795B8DDD8E1EF902907D924592F84E7E4EF650655DFE5EFA -61066957817186548E4793759A2B4E5E5091677068405109528D52926AA20000 -CC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077BC92109ED452AB602F8FF2504861A963ED64CA683C6A846FC0818889A1 -96945805727D72AC75047D797E6D80A9898B8B7490639D5162896C7A6F547D50 -7F3A8A23517C614A7B9D8B199257938C4EAC4FD3501E50BE510652C152CD537F -577058835E9A5F91617661AC64CE656C666F66BB66F468976D87708570F1749F -74A574CA75D9786C78EC7ADF7AF67D457D938015803F811B83968B668F159015 -93E1980398389A5A9BE84FC25553583A59515B635C4660B86212684268B00000 -CD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068E86EAA754C767878CE7A3D7CFB7E6B7E7C8A088AA18C3F968E9DC453E4 -53E9544A547156FA59D15B645C3B5EAB62F765376545657266A067AF69C16CBD -75FC7690777E7A3F7F94800380A1818F82E682FD83F085C1883188B48AA5F903 -8F9C932E96C798679AD89F1354ED659B66F2688F7A408C379D6056F057645D11 -660668B168CD6EFE7428889E9BE46C68F9049AA84F9B516C5171529F5B545DE5 -6050606D62F163A7653B73D97A7A86A38CA2978F4E325BE16208679C74DC0000 -CE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000079D183D38A878AB28DE8904E934B98465ED369E885FF90EDF90551A05B98 -5BEC616368FA6B3E704C742F74D87BA17F5083C589C08CAB95DC9928522E605D -62EC90024F8A5149532158D95EE366E06D38709A72C273D67B5080F1945B5366 -639B7F6B4E565080584A58DE602A612762D069D09B415B8F7D1880B18F5F4EA4 -50D154AC55AC5B0C5DA05DE7652A654E68216A4B72E1768E77EF7D5E7FF981A0 -854E86DF8F038F4E90CA99039A559BAB4E184E454E5D4EC74FF1517752FE0000 -CF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000534053E353E5548E5614577557A25BC75D875ED061FC62D8655167B867E9 -69CB6B506BC66BEC6C426E9D707872D77396740377BF77E97A767D7F800981FC -8205820A82DF88628B338CFC8EC0901190B1926492B699D29A459CE99DD79F9C -570B5C4083CA97A097AB9EB4541B7A987FA488D98ECD90E158005C4863987A9F -5BAE5F137A797AAE828E8EAC5026523852F85377570862F363726B0A6DC37737 -53A5735785688E7695D5673A6AC36F708A6D8ECC994BF90666776B788CB40000 -D0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009B3CF90753EB572D594E63C669FB73EA78457ABA7AC57CFE8475898F8D73 -903595A852FB574775477B6083CC921EF9086A58514B524B5287621F68D86975 -969950C552A452E461C365A4683969FF747E7B4B82B983EB89B28B398FD19949 -F9094ECA599764D266116A8E7434798179BD82A9887E887F895FF90A93264F0B -53CA602562716C727D1A7D664E98516277DC80AF4F014F0E5176518055DC5668 -573B57FA57FC5914594759935BC45C905D0E5DF15E7E5FCC628065D765E30000 -D1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000671E671F675E68CB68C46A5F6B3A6C236C7D6C826DC773987426742A7482 -74A37578757F788178EF794179477948797A7B957D007DBA7F888006802D808C -8A188B4F8C488D779321932498E299519A0E9A0F9A659E927DCA4F76540962EE -685491D155AB513AF90BF90C5A1C61E6F90D62CF62FFF90EF90FF910F911F912 -F91390A3F914F915F916F917F9188AFEF919F91AF91BF91C6696F91D7156F91E -F91F96E3F920634F637A5357F921678F69606E73F9227537F923F924F9250000 -D2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007D0DF926F927887256CA5A18F928F929F92AF92BF92C4E43F92D51675948 -67F08010F92E59735E74649A79CA5FF5606C62C8637B5BE75BD752AAF92F5974 -5F296012F930F931F9327459F933F934F935F936F937F93899D1F939F93AF93B -F93CF93DF93EF93FF940F941F942F9436FC3F944F94581BF8FB260F1F946F947 -8166F948F9495C3FF94AF94BF94CF94DF94EF94FF950F9515AE98A25677B7D10 -F952F953F954F955F956F95780FDF958F9595C3C6CE5533F6EBA591A83360000 -D3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E394EB64F4655AE571858C75F5665B765E66A806BB56E4D77ED7AEF7C1E -7DDE86CB88929132935B64BB6FBE737A75B890545556574D61BA64D466C76DE1 -6E5B6F6D6FB975F0804381BD854189838AC78B5A931F6C9375537B548E0F905D -5510580258585E626207649E68E075767CD687B39EE84EE35788576E59275C0D -5CB15E365F85623464E173B381FA888B8CB8968A9EDB5B855FB760B350125200 -52305716583558575C0E5C605CF65D8B5EA65F9260BC63116389641768430000 -D4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068F96AC26DD86E216ED46FE471FE76DC777979B17A3B840489A98CED8DF3 -8E4890039014905390FD934D967697DC6BD27006725872A27368776379BF7BE4 -7E9B8B8058A960C7656665FD66BE6C8C711E71C98C5A98134E6D7A814EDD51AC -51CD52D5540C61A76771685068DF6D1E6F7C75BC77B37AE580F484639285515C -6597675C679375D87AC78373F95A8C469017982D5C6F81C0829A9041906F920D -5F975D9D6A5971C8767B7B4985E48B0491279A30558761F6F95B76697F850000 -D5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000863F87BA88F8908FF95C6D1B70D973DE7D61843DF95D916A99F1F95E4E82 -53756B046B12703E721B862D9E1E524C8FA35D5064E5652C6B166FEB7C437E9C -85CD896489BD62C981D8881F5ECA67176D6A72FC7405746F878290DE4F865D0D -5FA0840A51B763A075654EAE5006516951C968816A117CAE7CB17CE7826F8AD2 -8F1B91CF4FB6513752F554425EEC616E623E65C56ADA6FFE792A85DC882395AD -9A629A6A9E979ECE529B66C66B77701D792B8F6297426190620065236F230000 -D6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000714974897DF4806F84EE8F269023934A51BD521752A36D0C70C888C25EC9 -65826BAE6FC27C3E73754EE44F3656F9F95F5CBA5DBA601C73B27B2D7F9A7FCE -8046901E923496F6974898189F614F8B6FA779AE91B496B752DEF960648864C4 -6AD36F5E7018721076E780018606865C8DEF8F0597329B6F9DFA9E75788C797F -7DA083C993049E7F9E938AD658DF5F046727702774CF7C60807E512170287262 -78CA8CC28CDA8CF496F74E8650DA5BEE5ED6659971CE764277AD804A84FC0000 -D7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000907C9B279F8D58D85A415C626A136DDA6F0F763B7D2F7E37851E893893E4 -964B528965D267F369B46D416E9C700F7409746075597624786B8B2C985E516D -622E96784F96502B5D196DEA7DB88F2A5F8B61446817F961968652D2808B51DC -51CC695E7A1C7DBE83F196754FDA52295398540F550E5C6560A7674E68A86D6C -728172F874067483F96275E27C6C7F797FB8838988CF88E191CC91D096E29BC9 -541D6F7E71D0749885FA8EAA96A39C579E9F67976DCB743381E89716782C0000 -D8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007ACB7B207C926469746A75F278BC78E899AC9B549EBB5BDE5E556F20819C -83AB90884E07534D5A295DD25F4E6162633D666966FC6EFF6F2B7063779E842C -8513883B8F1399459C3B551C62B9672B6CAB8309896A977A4EA159845FD85FD9 -671B7DB27F548292832B83BD8F1E909957CB59B95A925BD06627679A68856BCF -71647F758CB78CE390819B4581088C8A964C9A409EA55B5F6C13731B76F276DF -840C51AA8993514D519552C968C96C94770477207DBF7DEC97629EB56EC50000 -D9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000851151A5540D547D660E669D69276E9F76BF7791831784C2879F91699298 -9CF488824FAE519252DF59C65E3D61556478647966AE67D06A216BCD6BDB725F -72617441773877DB801782BC83058B008B288C8C67286C90726776EE77667A46 -9DA96B7F6C92592267268499536F589359995EDF63CF663467736E3A732B7AD7 -82D7932852D95DEB61AE61CB620A62C764AB65E069596B666BCB712173F7755D -7E46821E8302856A8AA38CBF97279D6158A89ED85011520E543B554F65870000 -DA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006C767D0A7D0B805E868A958096EF52FF6C95726954735A9A5C3E5D4B5F4C -5FAE672A68B669636E3C6E4477097C737F8E85878B0E8FF797619EF45CB760B6 -610D61AB654F65FB65FC6C116CEF739F73C97DE195945BC6871C8B10525D535A -62CD640F64B267346A386CCA73C0749E7B947C957E1B818A823685848FEB96F9 -99C14F34534A53CD53DB62CC642C6500659169C36CEE6F5873ED7554762276E4 -76FC78D078FB792C7D46822C87E08FD4981298EF52C362D464A56E246F510000 -DB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000767C8DCB91B192629AEE9B435023508D574A59A85C285E475F77623F653E -65B965C16609678B699C6EC278C57D2180AA8180822B82B384A1868C8A2A8B17 -90A696329F90500D4FF3F96357F95F9862DC6392676F6E43711976C380CC80DA -88F488F589198CE08F29914D966A4F2F4F705E1B67CF6822767D767E9B445E61 -6A0A716971D4756AF9647E41854385E998DC4F107B4F7F7095A551E15E0668B5 -6C3E6C4E6CDB72AF7BC483036CD5743A50FB528858C164D86A9774A776560000 -DC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000078A7861795E29739F965535E5F018B8A8FA88FAF908A522577A59C499F08 -4E19500251755C5B5E77661E663A67C468C570B3750175C579C97ADD8F279920 -9A084FDD582158315BF6666E6B656D116E7A6F7D73E4752B83E988DC89138B5C -8F144F0F50D55310535C5B935FA9670D798F8179832F8514890789868F398F3B -99A59C12672C4E764FF859495C015CEF5CF0636768D270FD71A2742B7E2B84EC -8702902292D29CF34E0D4ED84FEF50855256526F5426549057E0592B5A660000 -DD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005B5A5B755BCC5E9CF9666276657765A76D6E6EA572367B267C3F7F368150 -8151819A8240829983A98A038CA08CE68CFB8D748DBA90E891DC961C964499D9 -9CE7531752065429567458B35954596E5FFF61A4626E66106C7E711A76C67C89 -7CDE7D1B82AC8CC196F0F9674F5B5F175F7F62C25D29670B68DA787C7E439D6C -4E1550995315532A535159835A625E8760B2618A624962796590678769A76BD4 -6BD66BD76BD86CB8F968743575FA7812789179D579D87C837DCB7FE180A50000 -DE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000813E81C283F2871A88E88AB98B6C8CBB9119975E98DB9F3B56AC5B2A5F6C -658C6AB36BAF6D5C6FF17015725D73AD8CA78CD3983B61916C3780589A014E4D -4E8B4E9B4ED54F3A4F3C4F7F4FDF50FF53F253F8550655E356DB58EB59625A11 -5BEB5BFA5C045DF35E2B5F99601D6368659C65AF67F667FB68AD6B7B6C996CD7 -6E23700973457802793E7940796079C17BE97D177D728086820D838E84D186C7 -88DF8A508A5E8B1D8CDC8D668FAD90AA98FC99DF9E9D524AF9696714F96A0000 -DF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005098522A5C7165636C5573CA7523759D7B97849C917897304E7764926BBA -715E85A94E09F96B674968EE6E17829F8518886B63F76F81921298AF4E0A50B7 -50CF511F554655AA56175B405C195CE05E385E8A5EA05EC260F368516A616E58 -723D724072C076F879657BB17FD488F389F48A738C618CDE971C585E74BD8CFD -55C7F96C7A617D2282727272751F7525F96D7B19588558FB5DBC5E8F5EB65F90 -60556292637F654D669166D966F8681668F27280745E7B6E7D6E7DD67F720000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000080E5821285AF897F8A93901D92E49ECD9F205915596D5E2D60DC66146673 -67906C506DC56F5F77F378A984C691CB932B4ED950CA514855845B0B5BA36247 -657E65CB6E32717D74017444748774BF766C79AA7DDA7E557FA8817A81B38239 -861A87EC8A758DE3907892919425994D9BAE53685C5169546CC46D296E2B820C -859B893B8A2D8AAA96EA9F67526166B96BB27E9687FE8D0D9583965D651D6D89 -71EEF96E57CE59D35BAC602760FA6210661F665F732973F976DB77017B6C0000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008056807281658AA091924E1652E26B726D177A057B397D30F96F8CB053EC -562F58515BB55C0F5C115DE2624063836414662D68B36CBC6D886EAF701F70A4 -71D27526758F758E76197B117BE07C2B7D207D39852C856D86078A34900D9061 -90B592B797F69A374FD75C6C675F6D917C9F7E8C8B168D16901F5B6B5DFD640D -84C0905C98E173875B8B609A677E6DDE8A1F8AA69001980C5237F9707051788E -9396887091D74FEE53D755FD56DA578258FD5AC25B885CAB5CC05E2561010000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000620D624B6388641C653665786A396B8A6C346D196F3171E772E973787407 -74B27626776179C07A577AEA7CB97D8F7DAC7E617F9E81298331849084DA85EA -88968AB08B908F3890429083916C929692B9968B96A796A896D6970098089996 -9AD39B1A53D4587E59195B705BBF6DD16F5A719F742174B9808583FD5DE15F87 -5FAA604265EC6812696F6A536B896D356DF373E376FE77AC7B4D7D148123821C -834084F485638A628AC49187931E980699B4620C88538FF092655D075D270000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005D69745F819D87686FD562FE7FD2893689724E1E4E5850E752DD5347627F -66077E698805965E4F8D5319563659CB5AA45C385C4E5C4D5E025F11604365BD -662F664267BE67F4731C77E2793A7FC5849484CD89968A668A698AE18C558C7A -57F45BD45F0F606F62ED690D6B966E5C71847BD287558B588EFE98DF98FE4F38 -4F814FE1547B5A205BB8613C65B0666871FC7533795E7D33814E81E3839885AA -85CE87038A0A8EAB8F9BF9718FC559315BA45BE660895BE95C0B5FC36C810000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9726DF1700B751A82AF8AF64EC05341F97396D96C0F4E9E4FC45152555E -5A255CE86211725982BD83AA86FE88598A1D963F96C599139D099D5D580A5CB3 -5DBD5E4460E1611563E16A026E2591029354984E9C109F775B895CB86309664F -6848773C96C1978D98549B9F65A18B018ECB95BC55355CA95DD65EB56697764C -83F495C758D362BC72CE9D284EF0592E600F663B6B8379E79D26539354C057C3 -5D16611B66D66DAF788D827E969897445384627C63966DB27E0A814B984D0000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006AFB7F4C9DAF9E1A4E5F503B51B6591C60F963F66930723A8036F97491CE -5F31F975F9767D0482E5846F84BB85E58E8DF9774F6FF978F97958E45B436059 -63DA6518656D6698F97A694A6A236D0B7001716C75D2760D79B37A70F97B7F8A -F97C8944F97D8B9391C0967DF97E990A57045FA165BC6F01760079A68A9E99AD -9B5A9F6C510461B662916A8D81C6504358305F6671098A008AFA5B7C86164FFA -513C56B4594463A96DF95DAA696D51864E884F59F97FF980F9815982F9820000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9836B5F6C5DF98474B57916F9858207824583398F3F8F5DF9869918F987 -F988F9894EA6F98A57DF5F796613F98BF98C75AB7E798B6FF98D90069A5B56A5 -582759F85A1F5BB4F98E5EF6F98FF9906350633BF991693D6C876CBF6D8E6D93 -6DF56F14F99270DF71367159F99371C371D5F994784F786FF9957B757DE3F996 -7E2FF997884D8EDFF998F999F99A925BF99B9CF6F99CF99DF99E60856D85F99F -71B1F9A0F9A195B153ADF9A2F9A3F9A467D3F9A5708E71307430827682D20000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9A695BB9AE59E7D66C4F9A771C18449F9A8F9A9584BF9AAF9AB5DB85F71 -F9AC6620668E697969AE6C386CF36E366F416FDA701B702F715071DF7370F9AD -745BF9AE74D476C87A4E7E93F9AFF9B082F18A608FCEF9B19348F9B29719F9B3 -F9B44E42502AF9B5520853E166F36C6D6FCA730A777F7A6282AE85DD8602F9B6 -88D48A638B7D8C6BF9B792B3F9B8971398104E944F0D4FC950B25348543E5433 -55DA586258BA59675A1B5BE4609FF9B961CA655665FF666468A76C5A6FB30000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000070CF71AC73527B7D87088AA49C329F075C4B6C8373447389923A6EAB7465 -761F7A697E15860A514058C564C174EE751576707FC1909596CD99546E2674E6 -7AA97AAA81E586D987788A1B5A495B8C5B9B68A169006D6373A97413742C7897 -7DE97FEB81188155839E8C4C962E981166F05F8065FA67896C6A738B502D5A03 -6B6A77EE59165D6C5DCD7325754FF9BAF9BB50E551F9582F592D599659DA5BE5 -F9BCF9BD5DA262D76416649364FEF9BE66DCF9BF6A48F9C071FF7464F9C10000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A887AAF7E477E5E80008170F9C287EF89818B209059F9C390809952617E -6B326D747E1F89258FB14FD150AD519752C757C758895BB95EB8614269956D8C -6E676EB6719474627528752C8073833884C98E0A939493DEF9C44E8E4F515076 -512A53C853CB53F35B875BD35C24611A618265F4725B7397744076C279507991 -79B97D067FBD828B85D5865E8FC2904790F591EA968596E896E952D65F6765ED -6631682F715C7A3690C1980A4E91F9C56A526B9E6F907189801882B885530000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000904B969596F297FB851A9B314E90718A96C45143539F54E15713571257A3 -5A9B5AC45BC36028613F63F46C856D396E726E907230733F745782D188818F45 -9060F9C6966298589D1B67088D8A925E4F4D504950DE5371570D59D45A015C09 -617066906E2D7232744B7DEF80C3840E8466853F875F885B89188B02905597CB -9B4F4E734F915112516AF9C7552F55A95B7A5BA55E7C5E7D5EBE60A060DF6108 -610963C465386709F9C867D467DAF9C9696169626CB96D27F9CA6E38F9CB0000 -EB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006FE173367337F9CC745C7531F9CD7652F9CEF9CF7DAD81FE843888D58A98 -8ADB8AED8E308E42904A903E907A914991C9936EF9D0F9D15809F9D26BD38089 -80B2F9D3F9D45141596B5C39F9D5F9D66F6473A780E48D07F9D79217958FF9D8 -F9D9F9DAF9DB807F620E701C7D68878DF9DC57A0606961476BB78ABE928096B1 -4E59541F6DEB852D967097F398EE63D66CE3909151DD61C981BA9DF94F9D501A -51005B9C610F61FF64EC69056BC5759177E37FA98264858F87FB88638ABC0000 -EC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008B7091AB4E8C4EE54F0AF9DDF9DE593759E8F9DF5DF25F1B5F5B6021F9E0 -F9E1F9E2F9E3723E73E5F9E4757075CDF9E579FBF9E6800C8033808482E18351 -F9E7F9E88CBD8CB39087F9E9F9EA98F4990CF9EBF9EC703776CA7FCA7FCC7FFC -8B1A4EBA4EC152035370F9ED54BD56E059FB5BC55F155FCD6E6EF9EEF9EF7D6A -8335F9F086938A8DF9F1976D9777F9F2F9F34E004F5A4F7E58F965E56EA29038 -93B099B94EFB58EC598A59D96041F9F4F9F57A14F9F6834F8CC3516553440000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9F7F9F8F9F94ECD52695B5582BF4ED4523A54A859C959FF5B505B575B5C -606361486ECB7099716E738674F775B578C17D2B800581EA8328851785C98AEE -8CC796CC4F5C52FA56BC65AB6628707C70B872357DBD828D914C96C09D725B71 -68E76B986F7A76DE5C9166AB6F5B7BB47C2A883696DC4E084ED75320583458BB -58EF596C5C075E335E845F35638C66B267566A1F6AA36B0C6F3F7246F9FA7350 -748B7AE07CA7817881DF81E7838A846C8523859485CF88DD8D1391AC95770000 -EE -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000969C518D54C957285BB0624D6750683D68936E3D6ED3707D7E2188C18CA1 -8F099F4B9F4E722D7B8F8ACD931A4F474F4E5132548059D05E9562B56775696E -6A176CAE6E1A72D9732A75BD7BB87D3582E783F9845785F78A5B8CAF8E879019 -90B896CE9F5F52E3540A5AE15BC2645865756EF472C4F9FB76847A4D7B1B7C4D -7E3E7FDF837B8B2B8CCA8D648DE18E5F8FEA8FF9906993D14F434F7A50B35168 -5178524D526A5861587C59605C085C555EDB609B623068136BBF6C086FB10000 -EF -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000714E742075307538755176727B4C7B8B7BAD7BC67E8F8A6E8F3E8F49923F -92939322942B96FB985A986B991E5207622A62986D5976647ACA7BC07D765360 -5CBE5E976F3870B97C9897119B8E9EDE63A5647A87764E014E954EAD505C5075 -544859C35B9A5E405EAD5EF75F8160C5633A653F657465CC6676667867FE6968 -6A896B636C406DC06DE86E1F6E5E701E70A1738E73FD753A775B7887798E7A0B -7A7D7CBE7D8E82478A028AEA8C9E912D914A91D8926692CC9320970697560000 -F0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000975C98029F0E52365291557C58245E1D5F1F608C63D068AF6FDF796D7B2C -81CD85BA88FD8AF88E44918D9664969B973D984C9F4A4FCE514651CB52A95632 -5F145F6B63AA64CD65E9664166FA66F9671D689D68D769FD6F156F6E716771E5 -722A74AA773A7956795A79DF7A207A957C977CDF7D447E70808785FB86A48A54 -8ABF8D998E819020906D91E3963B96D59CE565CF7C078DB393C35B585C0A5352 -62D9731D50275B975F9E60B0616B68D56DD9742E7A2E7D427D9C7E31816B0000 -F1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008E2A8E35937E94184F5057505DE65EA7632B7F6A4E3B4F4F4F8F505A59DD -80C4546A546855FE594F5B995DDE5EDA665D673167F1682A6CE86D326E4A6F8D -70B773E075877C4C7D027D2C7DA2821F86DB8A3B8A858D708E8A8F339031914E -9152944499D07AF97CA54FCA510151C657C85BEF5CFB66596A3D6D5A6E966FEC -710C756F7AE388229021907596CB99FF83014E2D4EF2884691CD537D6ADB696B -6C41847A589E618E66FE62EF70DD751175C77E5284B88B498D084E4B53EA0000 -F2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054AB573057405FD763016307646F652F65E8667A679D67B36B626C606C9A -6F2C77E57825794979577D1980A2810281F3829D82B787188A8CF9FC8D048DBE -907276F47A197A377E548077550755D45875632F64226649664B686D699B6B84 -6D256EB173CD746874A1755B75B976E1771E778B79E67E097E1D81FB852F8897 -8A3A8CD18EEB8FB0903293AD9663967397074F8453F159EA5AC95E19684E74C6 -75BE79E97A9281A386ED8CEA8DCC8FED659F6715F9FD57F76F577DDD8F2F0000 -F3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000093F696C65FB561F26F844E144F98501F53C955DF5D6F5DEE6B216B6478CB -7B9AF9FE8E498ECA906E6349643E77407A84932F947F9F6A64B06FAF71E674A8 -74DA7AC47C127E827CB27E988B9A8D0A947D9910994C52395BDF64E6672D7D2E -50ED53C358796158615961FA65AC7AD98B928B9650095021527555315A3C5EE0 -5F706134655E660C663666A269CD6EC46F32731676217A938139825983D684BC -50B557F05BC05BE85F6963A178267DB583DC852191C791F5518A67F57B560000 -F4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008CAC51C459BB60BD8655501CF9FF52545C3A617D621A62D364F265A56ECC -7620810A8E60965F96BB4EDF5343559859295DDD64C56CC96DFA73947A7F821B -85A68CE48E10907791E795E1962197C651F854F255865FB964A46F887DB48F1F -8F4D943550C95C166CBE6DFB751B77BB7C3D7C648A798AC2581E59BE5E166377 -7252758A776B8ADC8CBC8F125EF366746DF8807D83C18ACB97519BD6FA005243 -66FF6D956EEF7DE08AE6902E905E9AD4521D527F54E86194628462DB68A20000 -F5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006912695A6A3570927126785D7901790E79D27A0D8096827882D583498549 -8C828D859162918B91AE4FC356D171ED77D7870089F85BF85FD6675190A853E2 -585A5BF560A4618164607E3D80708525928364AE50AC5D146700589C62BD63A8 -690E69786A1E6E6B76BA79CB82BB84298ACF8DA88FFD9112914B919C93109318 -939A96DB9A369C0D4E11755C795D7AFA7B517BC97E2E84C48E598E748EF89010 -6625693F744351FA672E9EDC51455FE06C9687F2885D887760B481B584030000 -F6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008D0553D6543956345A365C31708A7FE0805A810681ED8DA391899A5F9DF2 -50744EC453A060FB6E2C5C644F88502455E45CD95E5F606568946CBB6DC471BE -75D475F476617A1A7A497DC77DFB7F6E81F486A98F1C96C999B39F52524752C5 -98ED89AA4E0367D26F064FB55BE267956C886D78741B782791DD937C87C479E4 -7A315FEB4ED654A4553E58AE59A560F0625362D6673669558235964099B199DD -502C53535544577CFA016258FA0264E2666B67DD6FC16FEF742274388A170000 -F7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000094385451560657665F48619A6B4E705870AD7DBB8A95596A812B63A27708 -803D8CAA5854642D69BB5B955E116E6FFA038569514C53F0592A6020614B6B86 -6C706CF07B1E80CE82D48DC690B098B1FA0464C76FA464916504514E5410571F -8A0E615F6876FA0575DB7B527D71901A580669CC817F892A9000983950785957 -59AC6295900F9B2A615D727995D657615A465DF4628A64AD64FA67776CE26D3E -722C743678347F7782AD8DDB981752245742677F724874E38CA98FA692110000 -F8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000962A516B53ED634C4F695504609665576C9B6D7F724C72FD7A1789878C9D -5F6D6F8E70F981A8610E4FBF504F624172477BC77DE87FE9904D97AD9A198CB6 -576A5E7367B0840D8A5554205B165E635EE25F0A658380BA853D9589965B4F48 -5305530D530F548654FA57035E036016629B62B16355FA066CE16D6675B17832 -80DE812F82DE846184B2888D8912900B92EA98FD9B915E4566B466DD70117206 -FA074FF5527D5F6A615367536A196F0274E2796888688C7998C798C49A430000 -F9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054C17A1F69538AF78C4A98A899AE5F7C62AB75B276AE88AB907F96425339 -5F3C5FC56CCC73CC7562758B7B4682FE999D4E4F903C4E0B4F5553A6590F5EC8 -66306CB37455837787668CC09050971E9C1558D15B7886508B149DB45BD26068 -608D65F16C576F226FA3701A7F557FF095919592965097D352728F4451FD542B -54B85563558A6ABB6DB57DD88266929C96779E79540854C876D286E495A495D4 -965C4EA24F0959EE5AE65DF760526297676D68416C866E2F7F38809B822A0000 -FA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FA08FA0998054EA5505554B35793595A5B695BB361C869776D77702387F9 -89E38A728AE7908299ED9AB852BE683850165E78674F8347884C4EAB541156AE -73E6911597FF9909995799995653589F865B8A3161B26AF6737B8ED26B4796AA -9A57595572008D6B97694FD45CF45F2661F8665B6CEB70AB738473B973FE7729 -774D7D437D627E2382378852FA0A8CE29249986F5B517A74884098015ACC4FE0 -5354593E5CFD633E6D7972F98105810783A292CF98304EA851445211578B0000 -FB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F626CC26ECE7005705070AF719273E97469834A87A28861900890A293A3 -99A8516E5F5760E0616766B385598E4A91AF978B4E4E4E92547C58D558FA597D -5CB55F2762366248660A66676BEB6D696DCF6E566EF86F946FE06FE9705D72D0 -7425745A74E07693795C7CCA7E1E80E182A6846B84BF864E865F87748B778C6A -93AC9800986560D1621691775A5A660F6DF76E3E743F9B425FFD60DA7B0F54C4 -5F186C5E6CD36D2A70D87D0586798A0C9D3B5316548C5B056A3A706B75750000 -FC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000798D79BE82B183EF8A718B418CA89774FA0B64F4652B78BA78BB7A6B4E38 -559A59505BA65E7B60A363DB6B61666568536E19716574B07D0890849A699C25 -6D3B6ED1733E8C4195CA51F05E4C5FA8604D60F66130614C6643664469A56CC1 -6E5F6EC96F62714C749C76877BC17C27835287579051968D9EC3532F56DE5EFB -5F8A6062609461F7666667036A9C6DEE6FAE7070736A7E6A81BE833486D48AA8 -8CC4528373725B966A6B940454EE56865B5D6548658566C9689F6D8D6DC60000 -FD -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000723B80B491759A4D4FAF5019539A540E543C558955C55E3F5F8C673D7166 -73DD900552DB52F3586458CE7104718F71FB85B08A13668885A855A76684714A -8431534955996BC15F595FBD63EE668971478AF18F1D9EBE4F11643A70CB7566 -866760648B4E9DF8514751F653086D3680F89ED166156B23709875D554035C79 -7D078A166B206B3D6B46543860706D3D7FD5820850D651DE559C566B56CD59EC -5B095E0C619961986231665E66E6719971B971BA72A779A77A007FB28A700000 diff --git a/library/encoding/gb12345.enc b/library/encoding/gb12345.enc deleted file mode 100644 index 3f3f4d2..0000000 --- a/library/encoding/gb12345.enc +++ /dev/null @@ -1,1414 +0,0 @@ -# Encoding file: gb12345, double-byte -D -233F 0 83 -21 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030003001300230FB02C902C700A8300330052015FF5E2225202620182019 -201C201D3014301530083009300A300B300C300D300E300F3016301730103011 -00B100D700F72236222722282211220F222A222922082237221A22A522252220 -23122299222B222E2261224C2248223D221D2260226E226F22642265221E2235 -22342642264000B0203220332103FF0400A4FFE0FFE1203000A7211626062605 -25CB25CF25CE25C725C625A125A025B325B2203B219221902191219330130000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -22 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000024882489248A248B248C248D248E248F2490249124922493249424952496 -249724982499249A249B247424752476247724782479247A247B247C247D247E -247F248024812482248324842485248624872460246124622463246424652466 -2467246824690000000032203221322232233224322532263227322832290000 -00002160216121622163216421652166216721682169216A216B000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -23 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF01FF02FF03FFE5FF05FF06FF07FF08FF09FF0AFF0BFF0CFF0DFF0EFF0F -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19FF1AFF1BFF1CFF1DFF1EFF1F -FF20FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF3BFF3CFF3DFF3EFF3F -FF40FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5AFF5BFF5CFF5DFFE30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -24 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -25 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -26 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -27 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000004100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -28 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000010100E101CE00E0011300E9011B00E8012B00ED01D000EC014D00F301D2 -00F2016B00FA01D400F901D601D801DA01DC00FC00EA00000000000000000000 -0000000000000000000031053106310731083109310A310B310C310D310E310F -3110311131123113311431153116311731183119311A311B311C311D311E311F -3120312131223123312431253126312731283129000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -29 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00000000000000002500250125022503250425052506250725082509250A250B -250C250D250E250F2510251125122513251425152516251725182519251A251B -251C251D251E251F2520252125222523252425252526252725282529252A252B -252C252D252E252F2530253125322533253425352536253725382539253A253B -253C253D253E253F2540254125422543254425452546254725482549254A254B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000554A963F57C3632854CE550954C0769A764C85F977EE827E7919611B9698 -978D6C285B894FFA630966975CB880FA68489AAF660276CE51F9655671AC7FF1 -895650B2596561CA6FB382AD634C625253ED54277B06516B75A45DF462D48DCB -9776628A801958E997387F777238767D67CF767E64FA4F70655762DC7A176591 -73ED642C6273822C9812677F7248626E62CC4F3474E3534A8FA67D4690A65E6B -6886699C81807D8168D278C5868C938A508D8B1782DE80DE5305891252650000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -31 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000858496F94FDD582198FD5BF662B1583166B48C799B917206676F789160B2 -535153178F2980CC8C9D92C7500D72FD5099618A711988AB595482EF672C7B28 -5D297DB3752D6CF58E668FF8903C9F3B6BD491197B465F7C78A784D6853D7562 -65836BD65E635E8775F99589655D5F0A5FC58F9F58C181C2907F965B97AD908A -7DE88CB662414FBF8B8A535E8FA88FAF8FAE904D6A195F6A819888689C49618B -522B765F5F6C658C70156FF18CD364EF517551B067C44E1979C9990570B30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -32 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075C55E7673BB83E064AD64A592626CE2535A52C3640F92517B944F2F5E1B -82368116818A6E246CCA99C16355535C54FA88DC57E04E0D5E036B657C3F90E8 -601664E6731C88C16750624D8CA1776C8E2991C75F6983DC8521991053C38836 -6B98615A615871E684BC825950096EC485CF64CD7CD969FD66F9834953A07B56 -5074518C6E2C5C648E6D63D253C9832C833667E578B4643D5BDF5C945DEE8A6B -62C667F48C7A6519647B87EC995E8B927E8F93DF752395E1986B660C73160000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -33 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000583456175E389577511F81785EE0655E66A2553150218D8562849214671D -56326F6E5DE2543570928ECA626F64A463A35FB96F8890F481E38FB058756668 -5FF16C8996738D81896F64917A3157CE6A59621054484E587A0B61F26F848AA0 -627F901E9A0179E4540375F4630153196C6090725F1B99B3803B9F524F885C3A -8D647FC565A571BE5145885D87F25D075BF562BD916C75878E8A7A2061017C4C -4EC77DA27785919C81ED521D51FA6A7153A88E8792E496DB6EC19664695A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -34 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000790E513277D7641089F8865563E35DDD7A7F693D50B3823955984E327621 -7A975E625E8A95D652755439708A6376931857826625693F918755076DF37D14 -882262337DBD75B5832878C196CC8FAD614874F78A5E6B64523A8CDC6B218070 -847156F153065F9E53E251D17C97918B7C074FC38EA57BE17AC464675D1450AC -810676017CB96DEC7FE067515B585BF878CB64AE641363AA632B932F642D9054 -7B5476296253592754466B7950A362345E366B864EE38CB8888B5F85902E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -35 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006020803D64D44E3955AE913264A381BD65E66C2E4F46619A6DE18A955F48 -86CB757664CB9EE885696A94520064178E4850125CF679B15C0E52307A3B60BC -905376D75FB75F9776848E6C71C8767B7B4977AA51F3912758244F4E6EF48FEA -65757B1B72C46ECC7FDF5AE162B55E95573084827B2C5E1D5F1F905E7DE0985B -63826EC778989EDE5178975B588A96FB4F4375385E9760E659606FB16BBF7889 -53FC96D551CB52016389540A91E38ABF8DCC7239789F87768FED8ADC758A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -36 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E0176EF53EE91D898029F0E93205B9A8A024E22677151AC846361C252D5 -68DF4F97606B51CD6D1E515C62969B2596618C46901775D890FD77636BD272A2 -73688B80583577798CED675C934D809A5EA66E2159927AEF77ED935B6BB565B7 -7DDE58065151968A5C0D58A956788E726566981356E4920D76FE9041638754C6 -591A596A579B8EB267358DFA8235524160F058AE86FE5CE89D5D4FC4984D8A1B -5A2560E15384627C904F910299136069800C51528033723E990C6D314E8C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -37 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008CB3767C7F707B4F4F104E4F95A56CD573D085E95E06756A7FFB6A0A792C -91E97E4151E1716953CD8FD47BC48CA972AF98EF6CDB574A82B365B980AA623F -963259A84EFF8A2A7D21653E83F2975E556198DB80A5532A8AB9542080BA5EE2 -6CB88CBB82AC915A54296C1B52067D1B58B3711A6C7E7C89596E4EFD5FFF61A4 -7CDE8C505C01695387025CF092D298A8760B70FD902299AE7E2B8AF759499CF3 -4F5B5426592B6577819A5B75627662C28F3B5E456C1F7B264F0F4FD8670D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -38 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D6E6DAA798F88B15F17752B64AB8F144FEF91DC65A7812F81515E9C8150 -8D74526F89868CE65FA950854ED8961C723681798CA05BCC8A0396445A667E1B -54905676560E8A7265396982922384CB6E895E797518674667D17AFF809D8D95 -611F79C665628D1B5CA1525B92FC7F38809B7DB15D176E2F67607BD9768B9AD8 -818F7F947CD5641E93AC7A3F544A54E56B4C64F162089D3F80F3759952729769 -845B683C86E495A39694927B500B54047D6668398DDF801566F45E9A7FB90000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -39 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000057C2803F68975DE5653B529F606D9F944F9B8EAC516C5BAB5F13978F6C5E -62F18CA25171920E52FE6E9D82DF72D757A269CB8CFC591F8F9C83C754957B8D -4F306CBD5B6459D19F1353E488319AA88C3780A16545986756FA96C7522E74DC -526E5BE1630289024E5662D0602A68FA95DC5B9851A089C07BA199287F506163 -704C8CAB51495EE3901B7470898F572D78456B789F9C95A88ECC9B3C8A6D7678 -68426AC38DEA8CB4528A8F256EDA68CD934B90ED570B679C88F9904E54C80000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009AB85B696D776C264EA55BB399ED916361A890AF97D3542B6DB55BD251FD -558A7F557FF064BC634D65F161BE608D710A6C576F22592F676D822A58D5568E -8C6A6BEB90DD597D8017865F6D695475559D837783CF683879BE548C4F555408 -76D28C8995A16CB36DB88D6B89109DB48CC0563F9ED175D55F8872E0606854FC -4EA86A2A886160528F5F54C470D886799D3B6D2A5B8F5F187D0555894FAF7334 -543C539A50195F8C547C4E4E5FFD745A58FA846B80E1877472D07CCA6E560000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F27864E552C8B774E926EEC623782B1562983EF733E6ED1756B52835316 -8A7169D05F8A61F76DEE58DE6B6174B0685390847DE963DB60A3559A76138C62 -71656E195BA65E7B8352614C9EC478FA87577C27768751F060F6714C66435E4C -604D8B0A707063EE8F1D5FBD606286D456DE6BC160946167534960E066668CC4 -7A62670371F4532F8AF18AA87E6A8477660F5A5A9B426E3E6DF78C416D3B4F19 -706B7372621660D1970D8CA8798D64CA573E57FA6A5F75787A3D7A4D7B950000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000808C99518FF96FC08B4F9DC459EC7E3E7DDD5409697568D88F2F7C4D96C6 -53CA602575BE6C7253735AC97D1A64E05E7E810A5DF1858A628051805B634F0E -796D529160B86FDF5BC45BC28A088A1865E25FCC969B59937E7C7D00560967B7 -593E4F735BB652A083A298308CC87532924050477A3C50F967B699D55AC16BB2 -76E358055C167B8B9593714E517C80A9827159787DD87E6D6AA267EC78B19E7C -63C064BF7C215109526A51CF85A66ABB94528E108CE4898B93757BAD4EF60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000050658266528D991E6F386FFA6F975EFA50F559DC5C076F3F6C5F75868523 -69F3596C8B1B532091AC964D854969127901712681A04EA490CA6F869A555B0C -56BC652A927877EF50E5811A72E189D299037E737D5E527F655991758F4E8F03 -53EB7A9663ED63A5768679F88857968E622A52AB7BC0685467706377776B7AED -6F547D5089E359D0621285C982A5754C501F4ECB75A58AA15C4A5DFE7B4B65A4 -91D14ECA6D25895F7DCA932650C58B3990329773664979818FD171FC6D780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000076E152C1834651628396775B66769BE84EAC9A5A7CBE7CB37D934E958B66 -666F9838975C5883656C93E15F9175D997567ADF7AF651C870AF7A9863EA7A76 -7CFE739697ED4E4570784E5D915253A96551820A81FC8205548E5C31759A97A0 -62D872D975BD5C4599D283CA5C40548077E982096CAE805A62D264DA5DE85177 -8DDD8E1E92F84FF153E561FC70AC528763509D515A1F5026773753777D796485 -652B628963985014723589BA51B38A237D76574783CC921E8ECD541B5CFB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004FCA7AE36D5A90E199FF55805496536154AF958B63E9697751F16168520A -582A52D8574E780D770B5EB761777CE0625B62974EA27095800362F770E49760 -577782DB67EF68F578D5984679D16BBB54B353EF6E34514B523B5BA28AB280AF -554358BE61C75751542D7A7A60505B5463A7647353E362635BC767AF54ED7A9F -82E691775EAB89328A8757AE630E8DE880EF584A7B7751085FEB5BEC6B3E5321 -7B5072C268467926773666E051B5866776D45DCB7ABA8475594E9B4150800000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -40 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000994B61276F7057646606634656F062EC64F45ED395CA578362C95587881F -81D88FA35566840A4F868CF485CD5A6A6B0465147C4395CC862D703E8B95652C -89BD61F67E9C721B6FEB7405699472FC5ECA90CE67176D6A648852DE72628001 -4F6C59E5916A70D96F8752D26A0296F79433857E78CA7D2F512158D864C2808B -985E6CEA68F1695E51B7539868A872819ECE7C6C72F896E270557406674E88CF -9BC979AE83898354540F68179E9753B252F5792B6B77522950884F8B4FD00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -41 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075E27ACB7C92701D96B8529B748354E95006806F84EE9023942E5EC96190 -6F237C3E658281C993C8620071497DF47CE751C968817CB1826F51698F1B91CF -667E4EAE8AD264A9804A50DA764271CE5BE5907C6F664E86648294105ED66599 -521788C270C852A373757433679778F7971681E891309C576DCB51DB8CC3541D -62CE73B283F196F69F6192344F367F9A51CC974896755DBA981853E64EE46E9C -740969B4786B993E7559528976246D4167F3516D9F8D807E56A87C607ABF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -42 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000968658DF650F96B46A135A41645F7C0D6F0F964B860676E798715EEC7210 -64C46EF7865C9B6F9E93788C97328DEF8CC29E7F6F5E798493329678622E9A62 -541592C14FA365C55C655C627E37616E6C2F5F8B73876FFE7DD15DD265235B7F -706453754E8263A0756563848F2A502B4F966DEA7DB88AD6863F87BA7F85908F -947C7C6E9A3E88F8843D6D1B99F17D615ABD9EBB746A78BC879E99AC99E1561B -55CE57CB8CB79EA58CE390818109779E9945883B6EFF851366FC61626F2B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -43 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008B3E8292832B76F26C135FD983BD732B830593286BDB77DB925A536F8302 -51925E3D8C8C8CBF9EBD73AB679A68859176970971646CA177095A9293826BCF -7F8E66275BD059B95A9A958060B65011840C84996AAC76DF9333731B59225B5F -772F919A97617CDC8FF78B0E5F4C7C7379D889936CCC871C5BC65E4268C97720 -7DBF5195514D52C95A297DEC976282D763CF778485D079D26E3A5EDF59998511 -6EC56C1162BF76BF654F61AB95A9660E879F9CF49298540D547D8B2C64780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -44 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000647986116A21819C78E864699B5462B9672B83AB58A89ED86CAB6F205BDE -964C8B00725F67D062C77261755D59C66BCD589366AE5E5552DF6155672876EE -776672677A4662FF54EA5450920990A35A1C7D0D6C164E435976801059485357 -753796E356CA6493816660F19B276DD65462991251855AE980FD59AE9713502A -6CE55C3C64EC4F60533F81A990066EBA852B62C85E7478BE6506637B5FF55A18 -91C09CE55C3F634F80765B7D5699947793B36D8560A86AB8737051DD5BE70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -45 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000064F06FD8725B626D92157D1081BF6FC38FB25F04597452AA601259736696 -86507627632A61E67CEF8AFE54E66B509DD76BC685D5561450766F1A556A8DB4 -722C5E156015743662CD6392724C5F986E436D3E65006F5876E478D076FC7554 -522453DB4E539F9065C1802A80D6629B5486522870AE888D8DD16CE1547880DA -57F988F48CE0966A914D4F696C9B567476C6783062A870F96F8E5F6D84EC68DA -787C7BF781A8670B9D6C636778B0576F78129739627962AB528874356BD70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -46 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005564813E75B276AE533975DE50FB5C418B6C7BC7504F72479A1998C46F02 -74E27968648777A562FC983B8CA754C180584E52576A860B840D5E73619174F6 -8A555C4F57616F5198175A4678349B448FEB7C95525664B292EA50D583868461 -83E984B257D46A385703666E6D668B5C66DD7011671F6B3A68F2621A59BB4E03 -51C46F0667D26C8F517668CB59476B6775665D0E81CD9F4A65D7794879419A0E -8D778C484E5E4F0155535951780C56686C238FC468C46C7D6CE38A1663900000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -47 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060706D3D727D626691FA925B534390777C3D4EDF8B194E7E9ED493229257 -524D6F5B90636DFA8B7458795D4C6B206B4969CD55C681547F8C58BB85945F3A -64366A47936C657260846A4B77A755AC50D15DE7979864AC7FF95CED4FCF7AC5 -520783044E14602F7ACA6B3D4FB589AA79E6743452E482B964D279BD5BE26C81 -97528F156C2B50BE537F6E0564CE66746C3060C598038ACB617674CA7AAE79CB -4E1890B174036C4256DA914B6CC58DA8534086C666F28EC05C489A456E200000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -48 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000053D65A369F728DA353BB570898746B0A919B6CC9516875CA62F372AC5238 -52F87F3A7094763853749D7269B778BA96C088D97FA4713671C3518967D374E4 -58E4651856B78B93995264FE7E5E60F971B158EC4EC14EBA5FCD97CC4EFB8A8D -5203598A7D0962544ECD65E5620E833884C969AE878D71946EB65BB97D685197 -63C967D480898339881551125B7A59828FB14E736C5D516589258EDF962E854A -745E92ED958F6F6482E55F316492705185A9816E9C13585E8CFD4E0953C10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -49 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000050986563685155D355AA64149A3763835AC2745F82726F8068EE50E7838E -78026BBA52396C997D1750BB5565715E7BE966EC73CA82EB67495C715220717D -886B9583965D64C58D0D81B355846C5562477E55589250B755468CDE664C4E0A -5C1A88F368A2634E7A0D71D2828D52FA97F65C1154E890B57D3959628CD286C7 -820C63688D66651D5C0461FE6D89793E8A2D78377533547B4F388EAB6DF15A20 -7D33795E6C885BE95B38751A814E614E6EF28072751F7525727253477E690000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000770176DB526952DD80565E2B5931734565BD6FD58A695C388671534177F3 -62FE66424EC098DF87555BE68B5853F277E24F7F5C4E99DB59CB5F0F793A58EB -4E1667FF4E8B62ED8A93901D52E2662F55DC566C90694ED54F8D91CB98FE6C0F -5E0260435BA489968A666536624B99965B8858FD6388552E53D776267378852C -6A1E68B36B8A62928F3853D482126DD1758F66F88D165B70719F85AF669166D9 -7F7287009ECD9F205C6C88538FF06A39675F620D7AEA58855EB665786F310000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060555237800D6454887075295E25681362F4971C96D9723D8AB06C347761 -7A0E542E77AC9806821C8AAC78A96714720D65AF64955636601D79C153F87D72 -6B7B80865BFA55E356DB4F3A4F3C98FC5DF39B068073616B980C90015B8B8A1F -8AA6641C825864FB55FD860791654FD77D20901F7C9F50F358516EAF5BBF8A34 -80859178849C7B9796D6968B96A87D8F9AD3788E6B727A57904296A7795F5B6B -640D7B0B84D168AD55067E2E74637D2293966240584C4ED65B83597958540000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000737A64BB8E4B8E0F80CE82D462AC81FA6CF0915E592A614B6C70574D6524 -8CAA7671705858C76A8075F06F6D8B5A8AC757666BEF889278B363A2560670AD -6E6F5858642A580268E0819B55107CD650188EBA6DCC8D9F71D9638F6FE46ED4 -7E278404684390036DD896768A0E5957727985E49A3075BC8B0468AF52548E22 -92BB63D0984C8E44557C9AD466FF568F60D56D9552435C4959296DFB586B7530 -751C606C821481466311689D8FE2773A8DF38CBC94355E165EF3807D70F40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006C405EF7505C4EAD5EAD633A8247901A6850916E77B3540C92855F647AE5 -687663457B527D7175DB50776295982D900F51F879C37A8157165F9290145857 -5C60571F541051546E4D571863A8983D817F8715892A9000541E5C6F81C062D6 -625881319D15964099B199DD6A6259A562D3553E631654C786D97AAA5A0374E6 -896A6B6A59168C4C5F4E706373A998114E3870F75B8C7897633D665A769660CB -5B9B5A49842C81556C6A738B4EA167897DB25F8065FA671B5FD859845A010000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005DCD5FAE537197CB90556845570D552F60DF72326FF07DAD8466840E59D4 -504950DE5C3E7DEF672A851A5473754F80C355829B4F4F4D6E2D8B025C096170 -885B761F6E29868A6587805E7D0B543B7A697D0A554F55E17FC174EE64BE8778 -6E267AA9621165A1536763E16C835DEB55DA93A270CF6C618AA35C4B7121856A -68A7543E54346BCB6B664E9463425348821E4F0D4FAE5862620A972766647269 -52FF52D9609F8AA4661471996790897F785277FD6670563B5438932B72A70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A00606F5E0C6089819D591560DC718470EF6EAA6C5072806A8489725E2D -7FD25AB3559C92916D177CFB969962327D30778E87665323971E8F4466875CFD -4FE072F94E0B53A6590F56876380934151484ED99BAE7E9654B88CE2929C8237 -95916D8E5F265ACC986F96AA73FE737B7E23817A99217FA161B2967796507DAB -76F853A2947299997BB189446E5891097FD479658A7360F397FF4EAB98055DF7 -6A6150CF54118C61856D785D9704524A54EE56C292B76D885BB56DC666C90000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C0F5B5D68218096562F7B11654869544E9B6B47874E978B5354633E643A -90AA659C81058AE75BEB68B0537887F961C86CC470098B1D5C5185AA82AF92C5 -6B238F9B65B05FFB5FC34FE191C1661F8165732960FA82085211578B5F6290A2 -884C91925E78674F602759D3514451F680F853086C7996C4718A4F114FEE7F9E -673D55C592B979C088967D89589F620C9700865A561898085F908A3184C49157 -53D965ED5E8F755C60647D6E5A7F7DD27E8C8ED255A75BA361F865CB73840000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -51 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009078766C77297D629774859B5B787A7496EA884052DB718F5FAA65EC8A62 -5C0B99B45DE16B896C5B8A138A0A905C8FC558D362BC9D099D2854404E2B82BD -7259869C5D1688596DAF96C5555E4E9E8A1D710954BD95B970DF6DF99E7D56B4 -781487125CA95EF68A00985495BB708E6CBF594463A9773C884D6F1482775830 -71D553AD786F96C155015F6671305BB48AFA9A576B83592E9D2679E7694A63DA -4F6F760D7F8A6D0B967D6C274EF07662990A6A236F3E90808170599674760000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -52 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006447582F90657A918B2159DA54AC820085E5898180006930564E8036723A -91CE51B64E5F98016396696D844966F3814B591C6DB24E0058F991AB63D692A5 -4F9D4F0A886398245937907A79FB510080F075916C825B9C59E85F5D690587FB -501A5DF24E5977E34EE585DD6291661390915C7951045F7981C69038808475AB -4EA688D4610F6BC561B67FA976CA6EA28A638B708ABC8B6F5F027FFC7FCC7E79 -8335852D56E06BB797F3967059FB541F92806DEB5BC598F25C395F1596B10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000537082F16AFB5B309DF961C97E93746987A271DF719288058FCE8D0F76C8 -5F717A4E786C662055B264C150AD81C376705EB896CD8E3486F9548F6CF36D8C -6C38607F52C775285E7D512A60A061825C24753190F5923E73366CB96E389149 -670953CB53F34F5191C98A9853C85E7C8FC26DE44E8E76C26986865E611A8F3F -99184FDE903E9B5A61096E1D6F0196854E885A3196E882075DBC79B95B878A9E -7FBD738957DF828B9B315401904755BB5CEA5FA161086B32734480B28B7D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D745BD388D598108C6B99AD9D1B6DF551A4514357A38881539F63F48F45 -571254E15713733F6E907DE3906082D198586028966266F07D048D8A8E8D9470 -5CB37CA4670860A695B2801896F29116530096955141904B85F49196668897F5 -5B55531D783896DC683D54C9707E5BB08F09518D572854B1652266AB8D0A8D1C -81DF846C906D7CDF947F85FB68D765E96FA186A48E81566A902076827AC871E5 -8CAC64C752476FA48CCA600E589E618E66FE8D08624E55B36E23672D8ECB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -55 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000935895987728680569A8548B4E4D70B88A5064589F4B5B857A8450B55BE8 -77BB6C088A797C986CBE76DE65AC8F3E5D845C55863868E7536062307AD96E5B -7DBB6A1F7AE05F706F335F35638C6F3267564E085E338CEC4ED781397634969C -62DB662D627E6CBC8D9971677F695146808753EC906E629854F287C48F4D8005 -937A851790196D5973CD659F771F7504782781FB8C9E91DD5075679575B98A3A -9707632F93AE966384B86399775C5F817319722D6014657462EF6B63653F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -56 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005E407665912D8B49829D679D652F5431871877E580A281026C414E4B7E54 -807776F4690D6B9657F7503C4F84574063076B628DBE887965E87D195FD7646F -64F281F381F47F6E5E5F5CD95236667A79E97A1A8CEA709975D46EEF6CBB7A92 -4E2D76C55FE0941888777D427A2E816B91CD4EF28846821F54685DDE6D328B05 -7CA58EF880985E1A549276BA5B99665D9A5F73E0682A86DB6731732A8AF88A85 -90107AF971ED716E62C477DA56D14E3B845767F152A986C08CAF94447BC90000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -57 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F4F6CE8795D99D06293722A62FD5C0878DA8F4964B08CFA7BC66A01838A -88DD599D649E58EF72C0690E93108FFD8D05589C7DB48AC46E96634962D95353 -684C74228301914C55447740707C6FC1517954A88CC759FF6ECB6DC45B5C7D2B -4ED47C7D6ED35B5081EA6F2C5B579B0368D58E2A5B977D9C7E3D7E3191128D70 -594F63CD79DF8DB3535265CF79568A5B963B7D44947D7E825634918967007F6A -5C0A907566285DE64F5067DE505A4F5C57505EA7000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -58 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E8D4E0C51404E105EFF53454E154E984E1E9B325B6C56694E2879BA4E3F -53154E47592D723B536E6C1056DF80E499976BD3777E9F174E364E9F9F104E5C -4E694E9382885B5B55C7560F4EC45399539D53B453A553AE97688D0B531A53F5 -532D5331533E8CFE5366536352025208520E52445233528C5274524C525E5261 -525C84AF527D528252815290529351827F544EBB4EC34EC94EC24EE84EE14EEB -4EDE50B44EF34F224F644EF5500050964F094F474F5E4F6765384F5A4F5D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F5F4F574F324F3D4F764F744F914F894F834F8F4F7E4F7B51154F7C5102 -4F945114513C51374FC54FDA4FE34FDC4FD14FDF4FF85029504C4FF3502C500F -502E502D4FFE501C500C5025502850E8504350555048504E506C50C2513B5110 -513A50BA50D6510650ED50EC50E650EE5107510B4EDD6C3D4F5850C94FCE9FA0 -6C467CF4516E5DFD9ECC999856C5591452F9530D8A0753109CEC591951554EA0 -51564EB3886E88A4893B81E088D279805B3488037FB851AB51B151BD51BC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000051C7519651A251A58A018A108A0C8A158B338A4E8A258A418A368A468A54 -8A588A528A868A848A7F8A708A7C8A758A6C8A6E8ACD8AE28A618A9A8AA58A91 -8A928ACF8AD18AC98ADB8AD78AC28AB68AF68AEB8B148B018AE48AED8AFC8AF3 -8AE68AEE8ADE8B288B9C8B168B1A8B108B2B8B2D8B568B598B4E8B9E8B6B8B96 -5369537A961D962296219631962A963D963C964296589654965F9689966C9672 -96749688968D969796B09097909B913A9099911490A190B490B390B691340000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090B890B090DF90C590BE913690C490C79106914890E290DC90D790DB90EB -90EF90FE91049122911E91239131912F91399143914682BB595052F152AC52AD -52BE54FF52D052D652F053DF71EE77CD5EF451F551FC9B2F53B65F01755A5DF0 -574C580A57A1587E58BC58C558D15729572C572A573358D9572E572F58E2573B -5742576958E0576B58DA577C577B5768576D5776577357E157A4578C584F57CF -57A75816579357A057D55852581D586457D257B857F457EF57F857E457DD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000580B580D57FD57ED5800581E5819584458205865586C58815889589A5880 -99A89F1961FF8279827D827F828F828A82A88284828E8291858C829982AB8553 -82BE82B085F682CA82E3829882B782AE83A7840784EF82A982B482A182AA829F -82C482E782A482E1830982F782E48622830782DC82F482D282D8830C82FB82D3 -8526831A8306584B716282E082D5831C8351855884FD83088392833C83348331 -839B854E832F834F8347834385888340831785BA832D833A833372966ECE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008541831B85CE855284C08452846483B083788494843583A083AA8393839C -8385837C859F83A9837D8555837B8398839E83A89DAF849383C1840183E583D8 -58078418840B83DD83FD83D6841C84388411840683D483DF840F840383F883F9 -83EA83C583C07E0883F083E1845C8451845A8459847385468488847A85628478 -843C844684698476851E848E8431846D84C184CD84D09A4084BD84D384CA84BF -84BA863A84A184B984B4849793A38577850C750D853884F0861E851F85FA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008556853B84FF84FC8559854885688564855E857A77A285438604857B85A4 -85A88587858F857985EA859C858585B985B785B0861A85C185DC85FF86278605 -86298616863C5EFE5F08593C596980375955595A5958530F5C225C255C2C5C37 -624C636B647662BB62CA62DA62D762EE649F62F66339634B634363AD63F66371 -637A638E6451636D63AC638A636963AE645C63F263F863E064B363C463DE63CE -645263C663BE65046441640B641B6420640C64266421645E6516646D64960000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000647A64F764FC6499651B64C064D064D764E464E265096525652E5F0B5FD2 -75195F11535F53F1563053E953E853FB541254165406544B563856C8545456A6 -54435421550454BC5423543254825494547754715464549A5680548454765466 -565D54D054AD54C254B4566054A754A6563555F6547254A3566654BB54BF54CC -567254DA568C54A954AA54A4566554CF54DE561C54E7562E54FD551454F355E9 -5523550F55115527552A5616558F55B5554956C055415555553F5550553C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -60 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005537555655755576557755335530555C558B55D2558355B155B955885581 -559F557E55D65591557B55DF560D56B35594559955EA55F755C9561F55D156C1 -55EC55D455E655DD55C455EF55E555F2566F55CC55CD55E855F555E48F61561E -5608560C560156B6562355FE56005627562D565856395657562C564D56625659 -5695564C5654568656645671566B567B567C5685569356AF56D456D756DD56E1 -570756EB56F956FF5704570A5709571C5E435E195E145E115E6C5E585E570000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -61 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005E375E445E545E5B5E5E5E615C8C5C7A5C8D5C905D875C885CF45C995C91 -5D505C9C5CB55CA25D2C5CAC5CAB5CB15CA35CC15CB75DA75CD25DA05CCB5D22 -5D975D0D5D275D265D2E5D245D1E5D065D1B5DB85D3E5D345D3D5D6C5D5B5D6F -5D815D6B5D4B5D4A5D695D745D825D995D9D8C735DB75DD45F735F775F825F87 -5F89540E5FA05F995F9C5FA85FAD5FB55FBC88625F6172AD72B072B473777341 -72C372C172CE72CD72D272E8736A72E9733B72F472F7730172F3736B72FA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000072FB731773137380730A731E731D737C732273397325732C733873317350 -734D73577360736C736F737E821B592598E75924590298E0993398E9993C98EA -98EB98ED98F4990999114F59991B9937993F994399489949994A994C99625E80 -5EE15E8B5E965EA55EA05EB95EB55EBE5EB38CE15ED25ED15EDB5EE85EEA81BA -5FC45FC95FD661FA61AE5FEE616A5FE15FE4613E60B561345FEA5FED5FF86019 -60356026601B600F600D6029602B600A61CC6021615F61E860FB613760420000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000606A60F26096609A6173609D60836092608C609B611C60BB60B160DD60D8 -60C660DA60B4612061926115612360F46100610E612B614A617561AC619461A7 -61B761D461F55FDD96B39582958695C8958E9594958C95E595AD95AB9B2E95AC -95BE95B69B2995BF95BD95BC95C395CB95D495D095D595DE4E2C723F62156C35 -6C546C5C6C4A70436C856C906C946C8C6C686C696C746C766C866F596CD06CD4 -6CAD702770186CF16CD76CB26CE06CD66FFC6CEB6CEE6CB16CD36CEF6D870000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -64 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D396D276D0C6D796E5E6D076D046D196D0E6D2B6FAE6D2E6D356D1A700F -6EF86F6F6D336D916D6F6DF66F7F6D5E6D936D946D5C6D606D7C6D636E1A6DC7 -6DC56DDE70066DBF6DE06FA06DE66DDD6DD9700B6DAB6E0C6DAE6E2B6E6E6E4E -6E6B6EB26E5F6E866E536E546E326E256E4470676EB16E9870446F2D70056EA5 -6EA76EBD6EBB6EB76F776EB46ECF6E8F6EC26E9F6F627020701F6F246F156EF9 -6F2F6F3670326F746F2A6F096F296F896F8D6F8C6F786F726F7C6F7A70280000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -65 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006FC96FA76FB96FB66FC26FE16FEE6FDE6FE06FEF701A7023701B70397035 -705D705E5B805B845B955B935BA55BB8752F9A2B64345BE45BEE89305BF08E47 -8B078FB68FD38FD58FE58FEE8FE490878FE690158FE890059004900B90909011 -900D9016902190359036902D902F9044905190529050906890589062905B66B9 -9074907D908290889083908B5F505F575F565F585C3B54AB5C505C595B715C63 -5C687FBC5F335F295F2D82745F3C9B3B5C6E59815983598D5AF55AD759A30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -66 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000599759CA5B00599E59A459D259B259AF59D759BE5A6D5B0859DD5B4C59E3 -59D859F95A0C5A095AA75AFB5A115A235A135A405A675A4A5A555A3C5A625B0B -80EC5AAA5A9B5A775A7A5ABE5AEB5AB25B215B2A5AB85AE05AE35B195AD65AE6 -5AD85ADC5B095B175B165B325B375B405C155C1C5B5A5B655B735B515B535B62 -99D499DF99D99A369A5B99D199D89A4D9A4A99E29A6A9A0F9A0D9A059A429A2D -9A169A419A2E9A389A439A449A4F9A659A647CF97D067D027D077D087E8A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007D1C7D157D137D3A7D327D317E107D3C7D407D3F7D5D7D4E7D737D867D83 -7D887DBE7DBA7DCB7DD47DC47D9E7DAC7DB97DA37DB07DC77DD97DD77DF97DF2 -7E627DE67DF67DF17E0B7DE17E097E1D7E1F7E1E7E2D7E0A7E117E7D7E397E35 -7E327E467E457E887E5A7E527E6E7E7E7E707E6F7E985E7A757F5DDB753E9095 -738E74A3744B73A2739F73CF73C274CF73B773B373C073C973C873E573D9980A -740A73E973E773DE74BD743F7489742A745B7426742574287430742E742C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -68 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000741B741A7441745C74577455745974A6746D747E749C74D4748074817487 -748B749E74A874A9749074A774DA74BA97D997DE97DC674C6753675E674869AA -6AEA6787676A677367986898677568D66A05689F678B6777677C67F06ADB67D8 -6AF367E967B06AE867D967B567DA67B367DD680067C367B867E26ADF67C16A89 -68326833690F6A48684E6968684469BF6883681D68556A3A68416A9C68406B12 -684A6849682968B5688F687468776893686B6B1E696E68FC6ADD69E768F90000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -69 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006B0F68F0690B6901695768E369106971693969606942695D6B16696B6980 -69986978693469CC6AEC6ADA69CE6AF8696669636979699B69A769BB69AB69AD -69D469B169C169CA6AB369956AE7698D69FF6AA369ED6A176A186A6569F26A44 -6A3E6AA06A506A5B6A356A8E6AD36A3D6A286A586ADE6A916A906AA96A976AAB -733773526B816B826BA46B846B9E6BAE6B8D6BAB6B9B6BAF6BAA8ED48EDB8EF2 -8EFB8F648EF98EFC8EEB8EE48F628EFA8EFE8F0A8F078F058F128F268F1E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008F1F8F1C8F338F468F548ECE62146227621B621F62226221622562246229 -81E7750C74F474FF750F75117513653465EE65EF65F0660A66C7677266036615 -6600708566F7661D66346631663666358006665F66C46641664F668966616657 -66776684668C66D6669D66BE66DB66DC66E666E98CC18CB08CBA8CBD8D048CB2 -8CC58D108CD18CDA8CD58CEB8CE78CFB899889AC89A189BF89A689AF89B289B7 -726E729F725D7266726F727E727F7284728B728D728F72926308633263B00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000643F64D880046BEA6BF36BFD6BFF6BF96C056C0C6C066C0D6C156C186C19 -6C1A6C216C2C6C246C2A6C3265356555656B725872527256723086625216809F -809C809380BC670A80BD80B180AB80AD80B480B76727815680E981DA80DB80C2 -80C480D980CD80D7671080DD811B80F180F480ED81BE810E80F280FC67158112 -8C5A8161811E812C811881328148814C815381748159815A817181608169817C -817D816D8167584D5AB58188818281CF6ED581A381AA81CC672681CA81BB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081C181A66B5F6B376B396B436B466B5998AE98AF98B698BC98C698C86BB3 -5F408F4289F365909F4F659565BC65C665C465C365CC65CE65D265D6716C7152 -7096719770BB70C070B770AB70B171C170CA7110711371DC712F71317173715C -716871457172714A7178717A719871B371B571A871A071E071D471E771F9721D -7228706C71FE716671B9623E623D624362486249793B794079467949795B795C -7953795A79B079577960798E7967797A79AA798A799A79A779B35FD15FD00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000061DF605D605A606760416059606361646106610D615D61A9619D61CB61E3 -62078080807F6C936FA96DFC78EF77F878AD780978687818781165AB782D78B8 -781D7839792A7931781F783C7825782C78237829784E786D786478FD78267850 -7847784C786A78E77893789A788778E378A178A378B278B978A578D478D978C9 -78EC78F2790578F479137924791E79349F959EF99EFB9EFC76F17704779876F9 -77077708771A77227719772D772677357738775E77BC77477743775A77680000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077627765777F778D777D7780778C7791779F77A077B077B577BD753A7540 -754E754B7548755B7572757975837F587F617F5F8A487F687F867F717F797F88 -7F7E76CD76E5883291D291D391D491D991D791D591F791E791E4934691F591F9 -9208922692459211921092019227920492259200923A9266923792339255923D -9238925E926C926D923F9460923092499248924D922E9239943892AC92A0927A -92AA92EE92CF940392E3943A92B192A693A7929692CC92A993F59293927F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000093A9929A931A92AB9283940B92A892A39412933892F193D792E592F092EF -92E892BC92DD92F69426942792C392DF92E6931293069369931B934093019315 -932E934393079308931F93199365934793769354936493AA9370938493E493D8 -9428938793CC939893B893BF93A693B093B5944C93E293DC93DD93CD93DE93C3 -93C793D19414941D93F794659413946D9420947993F99419944A9432943F9454 -9463937E77E777EC96C979D579ED79E379EB7A065D477A037A027A1E7A140000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -70 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A397A377A619ECF99A57A707688768E7693769976A474DE74E0752C9CE9 -9CF69D079D069D239D879E159D1D9D1F9DE59D2F9DD99D309D429E1E9D539E1D -9D609D529DF39D5C9D619D939D6A9D6F9D899D989D9A9DC09DA59DA99DC29DBC -9E1A9DD39DDA9DEF9DE69DF29DF89E0C9DFA9E1B7592759476647658759D7667 -75A375B375B475B875C475B175B075C375C2760275CD75E3764675E675E47647 -75E7760375F175FC75FF761076007649760C761E760A7625763B761576190000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -71 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000761B763C762276207640762D7630766D76357643766E7633764D76697654 -765C76567672766F7FCA7AE67A787A797A807A867A887A957AC77AA07AAC7AA8 -7AB67AB3886488698872887D887F888288A2896088B788BC88C9893388CE895D -894788F1891A88FC88E888FE88F08921891989138938890A8964892B89368941 -8966897B758B80E576B876B477DC801280148016801C8020802E80258026802C -802980288031800B803580438046807980528075807189839807980E980F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -72 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009821981C6F4198269837984E98539873986298599865986C9870864D8654 -866C87E38806867A867C867B86A8868D868B8706869D86A786A386AA869386A9 -86B686C486B5882386B086BA86B186AF86C987F686B486E986FA87EF86ED8784 -86D0871386DE881086DF86D886D18703870786F88708870A870D87098723873B -871E8725872E871A873E87C88734873187298737873F87828722877D8811877B -87608770874C876E878B8753876387BB876487598765879387AF87CE87D20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -73 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000087C68788878587AD8797878387AB87E587AC87B587B387CB87D387BD87D1 -87C087CA87DB87EA87E087EE8816881387FE880A881B88218839883C7F367F4C -7F447F4582107AFA7AFD7B087BE47B047B677B0A7B2B7B0F7B477B387B2A7B19 -7B2E7B317B207B257B247B337C697B1E7B587BF37B457B757B4C7B8F7B607B6E -7B7B7B627B727B717B907C007BCB7BB87BAC7B9D7C5C7B857C1E7B9C7BA27C2B -7BB47C237BC17BCC7BDD7BDA7BE57BE67BEA7C0C7BFE7BFC7C0F7C6A7C0B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007C1F7C2A7C267C387C5F7C4081FE82018202820481EC8844822182228264 -822D822F8228822B8238826B82338234823E82448249824B824F825A825F8268 -887E88CA888888D888DF895E7F9D7FA57FA77FAF7FB07FB27C7C65497C917CF2 -7CF67C9E7CA27CB27CBC7CBD7CDD7CC77CCC7CCD7CC87CC57CD77CE8826E66A8 -7FBF7FCE7FD57FE57FE17FE67FE97FEE7FF37CF87E367DA67DAE7E477E9B9EA9 -9EB48D738D848D948D918DB28D678D6D8C478C49914A9150914E914F91640000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -75 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009162916191709169916F91C591C3917291749179918C91859190918D9191 -91A291A391AA91AD91AE91AF91B591B491BA8C559E7A8E898DEB8E058E598E69 -8DB58DBF8DBC8DBA8E4C8DD68DD78DDA8E928DCE8DCF8DDB8DC68DEC8E7A8E55 -8DE38E9A8E8B8DE48E098DFD8E148E1D8E1F8E938E2E8E238E918E3A8E408E39 -8E358E3D8E318E498E418E428EA18E638E4A8E708E768E7C8E6F8E748E858EAA -8E948E908EA68E9E8C788C828C8A8C858C988C94659B89D689F489DA89DC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -76 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000089E589EB89F68A3E8B26975A96E9974296EF9706973D9708970F970E972A -97449730973E9F549F5F9F599F609F5C9F669F6C9F6A9F779EFD9EFF9F0996B9 -96BC96BD96CE96D277BF8B8E928E947E92C893E8936A93CA938F943E946B9B77 -9B749B819B839B8E9C787A4C9B929C5F9B909BAD9B9A9BAA9B9E9C6D9BAB9B9D -9C589BC19C7A9C319C399C239C379BC09BCA9BC79BFD9BD69BEA9BEB9BE19BE4 -9BE79BDD9BE29BF09BDB9BF49BD49C5D9C089C109C0D9C129C099BFF9C200000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -77 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009C329C2D9C289C259C299C339C3E9C489C3B9C359C459C569C549C529C67 -977C978597C397BD979497C997AB97A397B297B49AB19AB09AB79DBB9AB69ABA -9ABC9AC19AC09ACF9AC29AD69AD59AD19B459B439B589B4E9B489B4D9B519957 -995C992E995599549ADF9AE19AE69AEF9AEB9AFB9AED9AF99B089B0F9B229B1F -9B234E489EBE7E3B9E829E879E889E8B9E9293D69E9D9E9F9EDB9EDC9EDD9EE0 -9EDF9EE29EF79EE79EE59EF29EEF9F229F2C9F2F9F399F379F3D9F3E9F440000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -78 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000896C95C693365F4685147E94538251B24E119F635679515A6DC09F156597 -56419AEE83034E3089075E727A4098B35E7F95A49B0D52128FF45F597A6B98E2 -51E050A24EF7835085915118636E6372524B5938774F8721814A7E8D91CC66C6 -5E1877AD9E7556C99EF46FDB61DE77C770309EB5884A95E282F951ED62514EC6 -673497C67C647E3497A69EAF786E820D672F677E56CC53F098B16AAF7F4E6D82 -7CF04E074FC27E6B9E7956AE9B1A846F53F690C179A67C72613F4E919AD20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -79 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075C796BB53EA7DFB88FD79CD78437B5151C6000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/gb1988.enc b/library/encoding/gb1988.enc deleted file mode 100644 index 298732c..0000000 --- a/library/encoding/gb1988.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: gb1988, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -002000210022002300A500250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D203E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F -FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F -FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F -FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/gb2312.enc b/library/encoding/gb2312.enc deleted file mode 100644 index 813d7a6..0000000 --- a/library/encoding/gb2312.enc +++ /dev/null @@ -1,1380 +0,0 @@ -# Encoding file: gb2312, double-byte -D -233F 0 81 -21 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030003001300230FB02C902C700A8300330052015FF5E2225202620182019 -201C201D3014301530083009300A300B300C300D300E300F3016301730103011 -00B100D700F72236222722282211220F222A222922082237221A22A522252220 -23122299222B222E2261224C2248223D221D2260226E226F22642265221E2235 -22342642264000B0203220332103FF0400A4FFE0FFE1203000A7211626062605 -25CB25CF25CE25C725C625A125A025B325B2203B219221902191219330130000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -22 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000024882489248A248B248C248D248E248F2490249124922493249424952496 -249724982499249A249B247424752476247724782479247A247B247C247D247E -247F248024812482248324842485248624872460246124622463246424652466 -2467246824690000000032203221322232233224322532263227322832290000 -00002160216121622163216421652166216721682169216A216B000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -23 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF01FF02FF03FFE5FF05FF06FF07FF08FF09FF0AFF0BFF0CFF0DFF0EFF0F -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19FF1AFF1BFF1CFF1DFF1EFF1F -FF20FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF3BFF3CFF3DFF3EFF3F -FF40FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5AFF5BFF5CFF5DFFE30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -24 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -25 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -26 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -27 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000004100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -28 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000010100E101CE00E0011300E9011B00E8012B00ED01D000EC014D00F301D2 -00F2016B00FA01D400F901D601D801DA01DC00FC00EA00000000000000000000 -0000000000000000000031053106310731083109310A310B310C310D310E310F -3110311131123113311431153116311731183119311A311B311C311D311E311F -3120312131223123312431253126312731283129000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -29 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00000000000000002500250125022503250425052506250725082509250A250B -250C250D250E250F2510251125122513251425152516251725182519251A251B -251C251D251E251F2520252125222523252425252526252725282529252A252B -252C252D252E252F2530253125322533253425352536253725382539253A253B -253C253D253E253F2540254125422543254425452546254725482549254A254B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000554A963F57C3632854CE550954C07691764C853C77EE827E788D72319698 -978D6C285B894FFA630966975CB880FA684880AE660276CE51F9655671AC7FF1 -888450B2596561CA6FB382AD634C625253ED54277B06516B75A45DF462D48DCB -9776628A8019575D97387F627238767D67CF767E64464F708D2562DC7A176591 -73ED642C6273822C9881677F7248626E62CC4F3474E3534A529E7ECA90A65E2E -6886699C81807ED168D278C5868C9551508D8C2482DE80DE5305891252650000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -31 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000858496F94FDD582199715B9D62B162A566B48C799C8D7206676F789160B2 -535153178F8880CC8D1D94A1500D72C8590760EB711988AB595482EF672C7B28 -5D297EF7752D6CF58E668FF8903C9F3B6BD491197B145F7C78A784D6853D6BD5 -6BD96BD65E015E8775F995ED655D5F0A5FC58F9F58C181C2907F965B97AD8FB9 -7F168D2C62414FBF53D8535E8FA88FA98FAB904D68075F6A819888689CD6618B -522B762A5F6C658C6FD26EE85BBE6448517551B067C44E1979C9997C70B30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -32 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075C55E7673BB83E064AD62E894B56CE2535A52C3640F94C27B944F2F5E1B -82368116818A6E246CCA9A736355535C54FA886557E04E0D5E036B657C3F90E8 -601664E6731C88C16750624D8D22776C8E2991C75F6983DC8521991053C28695 -6B8B60ED60E8707F82CD82314ED36CA785CF64CD7CD969FD66F9834953957B56 -4FA7518C6D4B5C428E6D63D253C9832C833667E578B4643D5BDF5C945DEE8BE7 -62C667F48C7A640063BA8749998B8C177F2094F24EA7961098A4660C73160000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -33 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000573A5C1D5E38957F507F80A05382655E7545553150218D856284949E671D -56326F6E5DE2543570928F66626F64A463A35F7B6F8890F481E38FB05C186668 -5FF16C8996488D81886C649179F057CE6A59621054484E587A0B60E96F848BDA -627F901E9A8B79E4540375F4630153196C608FDF5F1B9A70803B9F7F4F885C3A -8D647FC565A570BD514551B2866B5D075BA062BD916C75748E0C7A2061017B79 -4EC77EF877854E1181ED521D51FA6A7153A88E87950496CF6EC19664695A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -34 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000784050A877D7641089E6590463E35DDD7A7F693D4F20823955984E3275AE -7A975E625E8A95EF521B5439708A6376952457826625693F918755076DF37EAF -882262337EF075B5832878C196CC8F9E614874F78BCD6B64523A8D506B21806A -847156F153064ECE4E1B51D17C97918B7C074FC38E7F7BE17A9C64675D1450AC -810676017CB96DEC7FE067515B585BF878CB64AE641363AA632B9519642D8FBE -7B5476296253592754466B7950A362345E266B864EE38D37888B5F85902E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -35 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006020803D62C54E39535590F863B880C665E66C2E4F4660EE6DE18BDE5F39 -86CB5F536321515A83616863520063638E4850125C9B79775BFC52307A3B60BC -905376D75FB75F9776848E6C706F767B7B4977AA51F3909358244F4E6EF48FEA -654C7B1B72C46DA47FDF5AE162B55E95573084827B2C5E1D5F1F90127F1498A0 -63826EC7789870B95178975B57AB75354F4375385E9760E659606DC06BBF7889 -53FC96D551CB52016389540A94938C038DCC7239789F87768FED8C0D53E00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -36 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E0176EF53EE948998769F0E952D5B9A8BA24E224E1C51AC846361C252A8 -680B4F97606B51BB6D1E515C6296659796618C46901775D890FD77636BD2728A -72EC8BFB583577798D4C675C9540809A5EA66E2159927AEF77ED953B6BB565AD -7F0E58065151961F5BF958A954288E726566987F56E4949D76FE9041638754C6 -591A593A579B8EB267358DFA8235524160F0581586FE5CE89E454FC4989D8BB9 -5A2560765384627C904F9102997F6069800C513F80335C1499756D314E8C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -37 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008D3053D17F5A7B4F4F104E4F96006CD573D085E95E06756A7FFB6A0A77FE -94927E4151E170E653CD8FD483038D2972AF996D6CDB574A82B365B980AA623F -963259A84EFF8BBF7EBA653E83F2975E556198DE80A5532A8BFD542080BA5E9F -6CB88D3982AC915A54296C1B52067EB7575F711A6C7E7C89594B4EFD5FFF6124 -7CAA4E305C0167AB87025CF0950B98CE75AF70FD902251AF7F1D8BBD594951E4 -4F5B5426592B657780A45B75627662C28F905E456C1F7B264F0F4FD8670D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -38 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D6E6DAA798F88B15F17752B629A8F854FEF91DC65A7812F81515E9C8150 -8D74526F89868D4B590D50854ED8961C723681798D1F5BCC8BA3964459877F1A -54905676560E8BE565396982949976D66E895E727518674667D17AFF809D8D76 -611F79C665628D635188521A94A27F38809B7EB25C976E2F67607BD9768B9AD8 -818F7F947CD5641E95507A3F544A54E56B4C640162089E3D80F3759952729769 -845B683C86E49601969494EC4E2A54047ED968398DDF801566F45E9A7FB90000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -39 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000057C2803F68975DE5653B529F606D9F9A4F9B8EAC516C5BAB5F135DE96C5E -62F18D21517194A952FE6C9F82DF72D757A267848D2D591F8F9C83C754957B8D -4F306CBD5B6459D19F1353E486CA9AA88C3780A16545987E56FA96C7522E74DC -52505BE1630289024E5662D0602A68FA51735B9851A089C27BA199867F5060EF -704C8D2F51495E7F901B747089C4572D78455F529F9F95FA8F689B3C8BE17678 -684267DC8DEA8D35523D8F8A6EDA68CD950590ED56FD679C88F98FC754C80000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009AB85B696D776C264EA55BB39A87916361A890AF97E9542B6DB55BD251FD -558A7F557FF064BC634D65F161BE608D710A6C576C49592F676D822A58D5568E -8C6A6BEB90DD597D801753F76D695475559D837783CF683879BE548C4F555408 -76D28C8996026CB36DB88D6B89109E648D3A563F9ED175D55F8872E0606854FC -4EA86A2A886160528F7054C470D886799E3F6D2A5B8F5F187EA255894FAF7334 -543C539A5019540E547C4E4E5FFD745A58F6846B80E1877472D07CCA6E560000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F27864E552C62A44E926CAA623782B154D7534E733E6ED1753B52125316 -8BDD69D05F8A60006DEE574F6B2273AF68538FD87F13636260A3552475EA8C62 -71156DA35BA65E7B8352614C9EC478FA87577C27768751F060F6714C66435E4C -604D8C0E707063258F895FBD606286D456DE6BC160946167534960E066668D3F -79FD4F1A70E96C478BB38BF27ED88364660F5A5A9B426D516DF78C416D3B4F19 -706B83B7621660D1970D8D27797851FB573E57FA673A75787A3D79EF7B950000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000808C99658FF96FC08BA59E2159EC7EE97F095409678168D88F917C4D96C6 -53CA602575BE6C7253735AC97EA7632451E0810A5DF184DF628051805B634F0E -796D524260B86D4E5BC45BC28BA18BB065E25FCC964559937EE77EAA560967B7 -59394F735BB652A0835A988A8D3E753294BE50477A3C4EF767B69A7E5AC16B7C -76D1575A5C167B3A95F4714E517C80A9827059787F04832768C067EC78B17877 -62E363617B804FED526A51CF835069DB92748DF58D3189C1952E7BAD4EF60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000506582305251996F6E106E856DA75EFA50F559DC5C066D466C5F7586848B -686859568BB253209171964D854969127901712680F64EA490CA6D479A845A07 -56BC640594F077EB4FA5811A72E189D2997A7F347EDE527F655991758F7F8F83 -53EB7A9663ED63A5768679F888579636622A52AB8282685467706377776B7AED -6D017ED389E359D0621285C982A5754C501F4ECB75A58BEB5C4A5DFE7B4B65A4 -91D14ECA6D25895F7D2795264EC58C288FDB9773664B79818FD170EC6D780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C3D52B283465162830E775B66769CB84EAC60CA7CBE7CB37ECF4E958B66 -666F988897595883656C955C5F8475C997567ADF7ADE51C070AF7A9863EA7A76 -7EA0739697ED4E4570784E5D915253A9655165E781FC8205548E5C31759A97A0 -62D872D975BD5C459A7983CA5C40548077E94E3E6CAE805A62D2636E5DE85177 -8DDD8E1E952F4FF153E560E770AC526763509E435A1F5026773753777EE26485 -652B628963985014723589C951B38BC07EDD574783CC94A7519B541B5CFB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004FCA7AE36D5A90E19A8F55805496536154AF5F0063E9697751EF6168520A -582A52D8574E780D770B5EB761777CE0625B62974EA27095800362F770E49760 -577782DB67EF68F578D5989779D158F354B353EF6E34514B523B5BA28BFE80AF -554357A660735751542D7A7A60505B5463A762A053E362635BC767AF54ED7A9F -82E691775E9388E4593857AE630E8DE880EF57577B774FA95FEB5BBD6B3E5321 -7B5072C2684677FF773665F751B54E8F76D45CBF7AA58475594E9B4150800000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -40 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000998861276E8357646606634656F062EC62695ED39614578362C955878721 -814A8FA3556683B167658D5684DD5A6A680F62E67BEE961151706F9C8C3063FD -89C861D27F0670C26EE57405699472FC5ECA90CE67176D6A635E52B372628001 -4F6C59E5916A70D96D9D52D24E5096F7956D857E78CA7D2F5121579264C2808B -7C7B6CEA68F1695E51B7539868A872819ECE7BF172F879BB6F137406674E91CC -9CA4793C83898354540F68174E3D538952B1783E5386522950884F8B4FD00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -41 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075E27ACB7C926CA596B6529B748354E94FE9805483B28FDE95705EC9601C -6D9F5E18655B813894FE604B70BC7EC37CAE51C968817CB1826F4E248F8691CF -667E4EAE8C0564A9804A50DA759771CE5BE58FBD6F664E86648295635ED66599 -521788C270C852A3730E7433679778F797164E3490BB9CDE6DCB51DB8D41541D -62CE73B283F196F69F8494C34F367F9A51CC707596755CAD988653E64EE46E9C -740969B4786B998F7559521876246D4167F3516D9F99804B54997B3C7ABF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -42 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009686578462E29647697C5A0464027BD36F0F964B82A6536298855E907089 -63B35364864F9C819E93788C97328DEF8D429E7F6F5E79845F559646622E9A74 -541594DD4FA365C55C655C617F1586516C2F5F8B73876EE47EFF5CE6631B5B6A -6EE653754E7163A0756562A18F6E4F264ED16CA67EB68BBA841D87BA7F57903B -95237BA99AA188F8843D6D1B9A867EDC59889EBB739B780186829A6C9A82561B -541757CB4E709EA653568FC881097792999286EE6EE1851366FC61626F2B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -43 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008C298292832B76F26C135FD983BD732B8305951A6BDB77DB94C6536F8302 -51925E3D8C8C8D384E4873AB679A68859176970971646CA177095A9295416BCF -7F8E66275BD059B95A9A95E895F74EEC840C84996AAC76DF9530731B68A65B5F -772F919A97617CDC8FF78C1C5F257C7379D889C56CCC871C5BC65E4268C97720 -7EF55195514D52C95A297F05976282D763CF778485D079D26E3A5E9959998511 -706D6C1162BF76BF654F60AF95FD660E879F9E2394ED540D547D8C2C64780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -44 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000647986116A21819C78E864699B5462B9672B83AB58A89ED86CAB6F205BDE -964C8C0B725F67D062C772614EA959C66BCD589366AE5E5552DF6155672876EE -776672677A4662FF54EA545094A090A35A1C7EB36C164E435976801059485357 -753796BE56CA63208111607C95F96DD65462998151855AE980FD59AE9713502A -6CE55C3C62DF4F60533F817B90066EBA852B62C85E7478BE64B5637B5FF55A18 -917F9E1F5C3F634F80425B7D556E954A954D6D8560A867E072DE51DD5B810000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -45 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000062E76CDE725B626D94AE7EBD81136D53519C5F04597452AA601259736696 -8650759F632A61E67CEF8BFA54E66B279E256BB485D5545550766CA4556A8DB4 -722C5E156015743662CD6392724C5F986E436D3E65006F5876D878D076FC7554 -522453DB4E535E9E65C1802A80D6629B5486522870AE888D8DD16CE1547880DA -57F988F48D54966A914D4F696C9B55B776C6783062A870F96F8E5F6D84EC68DA -787C7BF781A8670B9E4F636778B0576F78129739627962AB528874356BD70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -46 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005564813E75B276AE533975DE50FB5C418B6C7BC7504F72479A9798D86F02 -74E27968648777A562FC98918D2B54C180584E52576A82F9840D5E7351ED74F6 -8BC45C4F57616CFC98875A4678349B448FEB7C955256625194FA4EC683868461 -83E984B257D467345703666E6D668C3166DD7011671F6B3A6816621A59BB4E03 -51C46F0667D26C8F517668CB59476B6775665D0E81109F5065D7794879419A91 -8D775C824E5E4F01542F5951780C56686C148FC45F036C7D6CE38BAB63900000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -47 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060706D3D72756266948E94C553438FC17B7E4EDF8C264E7E9ED494B194B3 -524D6F5C90636D458C3458115D4C6B206B4967AA545B81547F8C589985375F3A -62A26A47953965726084686577A74E544FA85DE7979864AC7FD85CED4FCF7A8D -520783044E14602F7A8394A64FB54EB279E6743452E482B964D279BD5BDD6C81 -97528F7B6C22503E537F6E0564CE66746C3060C598778BF75E86743C7A7779CB -4E1890B174036C4256DA914B6CC58D8B533A86C666F28EAF5C489A716E200000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -48 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000053D65A369F8B8DA353BB570898A76743919B6CC9516875CA62F372AC5238 -529D7F3A7094763853749E4A69B7786E96C088D97FA4713671C3518967D374E4 -58E4651856B78BA9997662707ED560F970ED58EC4EC14EBA5FCD97E74EFB8BA4 -5203598A7EAB62544ECD65E5620E833884C98363878D71946EB65BB97ED25197 -63C967D480898339881551125B7A59828FB14E736C5D516589258F6F962E854A -745E951095F06DA682E55F3164926D128428816E9CC3585E8D5B4E0953C10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -49 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F1E6563685155D34E2764149A9A626B5AC2745F82726DA968EE50E7838E -7802674052396C997EB150BB5565715E7B5B665273CA82EB67495C715220717D -886B95EA965564C58D6181B355846C5562477F2E58924F2455468D4F664C4E0A -5C1A88F368A2634E7A0D70E7828D52FA97F65C1154E890B57ECD59628D4A86C7 -820C820D8D6664445C0461516D89793E8BBE78377533547B4F388EAB6DF15A20 -7EC5795E6C885BA15A76751A80BE614E6E1758F0751F7525727253477EF30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000770176DB526980DC57235E08593172EE65BD6E7F8BD75C388671534177F3 -62FE65F64EC098DF86805B9E8BC653F277E24F7F5C4E9A7659CB5F0F793A58EB -4E1667FF4E8B62ED8A93901D52BF662F55DC566C90024ED54F8D91CA99706C0F -5E0260435BA489C68BD56536624B99965B885BFF6388552E53D77626517D852C -67A268B36B8A62928F9353D482126DD1758F4E668D4E5B70719F85AF669166D9 -7F7287009ECD9F205C5E672F8FF06811675F620D7AD658855EB665706F310000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060555237800D6454887075295E05681362F4971C53CC723D8C016C347761 -7A0E542E77AC987A821C8BF47855671470C165AF64955636601D79C153F84E1D -6B7B80865BFA55E356DB4F3A4F3C99725DF3677E80386002988290015B8B8BBC -8BF5641C825864DE55FD82CF91654FD77D20901F7C9F50F358516EAF5BBF8BC9 -80839178849C7B97867D968B968F7EE59AD3788E5C817A57904296A7795F5B59 -635F7B0B84D168AD55067F2974107D2295016240584C4ED65B83597958540000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000736D631E8E4B8E0F80CE82D462AC53F06CF0915E592A60016C70574D644A -8D2A762B6EE9575B6A8075F06F6D8C2D8C0857666BEF889278B363A253F970AD -6C645858642A580268E0819B55107CD650188EBA6DCC8D9F70EB638F6D9B6ED4 -7EE68404684390036DD896768BA85957727985E4817E75BC8A8A68AF52548E22 -951163D098988E44557C4F5366FF568F60D56D9552435C4959296DFB586B7530 -751C606C82148146631167618FE2773A8DF38D3494C15E165385542C70C30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006C405EF7505C4EAD5EAD633A8247901A6850916E77B3540C94DC5F647AE5 -687663457B527EDF75DB507762955934900F51F879C37A8156FE5F9290146D82 -5C60571F541051546E4D56E263A89893817F8715892A9000541E5C6F81C062D6 -625881319E3596409A6E9A7C692D59A562D3553E631654C786D96D3C5A0374E6 -889C6B6A59168C4C5F2F6E7E73A9987D4E3870F75B8C7897633D665A769660CB -5B9B5A494E0781556C6A738B4EA167897F515F8065FA671B5FD859845A010000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005DCD5FAE537197E68FDD684556F4552F60DF4E3A6F4D7EF482C7840E59D4 -4F1F4F2A5C3E7EAC672A851A5473754F80C355829B4F4F4D6E2D8C135C096170 -536B761F6E29868A658795FB7EB9543B7A337D0A95EE55E17FC174EE631D8717 -6DA17A9D621165A1536763E16C835DEB545C94A84E4C6C618BEC5C4B65E0829C -68A7543E54346BCB6B664E9463425348821E4F0D4FAE575E620A96FE66647269 -52FF52A1609F8BEF661471996790897F785277FD6670563B54389521727A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A00606F5E0C6089819D591560DC718470EF6EAA6C5072806A8488AD5E2D -4E605AB3559C94E36D177CFB9699620F7EC6778E867E5323971E8F9666875CE1 -4FA072ED4E0B53A6590F54136380952851484ED99C9C7EA454B88D2488548237 -95F26D8E5F265ACC663E966973B0732E53BF817A99857FA15BAA967796507EBF -76F853A2957699997BB189446E584E617FD479658BE660F354CD4EAB98795DF7 -6A6150CF54118C618427785D9704524A54EE56A395006D885BB56DC666530000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C0F5B5D6821809655787B11654869544E9B6B47874E978B534F631F643A -90AA659C80C18C10519968B0537887F961C86CC46CFB8C225C5185AA82AF950C -6B238F9B65B05FFB5FC34FE18845661F8165732960FA51745211578B5F6290A2 -884C91925E78674F602759D3514451F680F853086C7996C4718A4F114FEE7F9E -673D55C5950879C088967EE3589F620C9700865A5618987B5F908BB884C49157 -53D965ED5E8F755C60647D6E5A7F7EEA7EED8F6955A75BA360AC65CB73840000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -51 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009009766377297EDA9774859B5B667A7496EA884052CB718F5FAA65EC8BE2 -5BFB9A6F5DE16B896C5B8BAD8BAF900A8FC5538B62BC9E269E2D54404E2B82BD -7259869C5D1688596DAF96C554D14E9A8BB6710954BD960970DF6DF976D04E25 -781487125CA95EF68A00989C960E708E6CBF594463A9773C884D6F1482735830 -71D5538C781A96C155015F6671305BB48C1A9A8C6B83592E9E2F79E76768626C -4F6F75A17F8A6D0B96336C274EF075D2517B68376F3E90808170599674760000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -52 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000064475C2790657A918C2359DA54AC8200836F898180006930564E80367237 -91CE51B64E5F987563964E1A53F666F3814B591C6DB24E0058F9533B63D694F1 -4F9D4F0A886398905937905779FB4EEA80F075916C825B9C59E85F5D69058681 -501A5DF24E5977E34EE5827A6291661390915C794EBF5F7981C69038808475AB -4EA688D4610F6BC55FC64E4976CA6EA28BE38BAE8C0A8BD15F027FFC7FCC7ECE -8335836B56E06BB797F3963459FB541F94F66DEB5BC5996E5C395F1596900000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000537082F16A315A749E705E947F2883B984248425836787478FCE8D6276C8 -5F719896786C662054DF62E54F6381C375C85EB896CD8E0A86F9548F6CF36D8C -6C38607F52C775285E7D4F1860A05FE75C24753190AE94C072B96CB96E389149 -670953CB53F34F5191C98BF153C85E7C8FC26DE44E8E76C26986865E611A8206 -4F594FDE903E9C7C61096E1D6E1496854E885A3196E84E0E5C7F79B95B878BED -7FBD738957DF828B90C15401904755BB5CEA5FA161086B3272F180B28A890000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D745BD388D598848C6B9A6D9E336E0A51A4514357A38881539F63F48F95 -56ED54585706733F6E907F188FDC82D1613F6028966266F07EA68D8A8DC394A5 -5CB37CA4670860A6960580184E9190E75300966851418FD08574915D665597F5 -5B55531D78386742683D54C9707E5BB08F7D518D572854B1651266828D5E8D43 -810F846C906D7CDF51FF85FB67A365E96FA186A48E81566A90207682707671E5 -8D2362E952196CFD8D3C600E589E618E66FE8D60624E55B36E23672D8F670000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -55 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000094E195F87728680569A8548B4E4D70B88BC86458658B5B857A84503A5BE8 -77BB6BE18A797C986CBE76CF65A98F975D2D5C5586386808536062187AD96E5B -7EFD6A1F7AE05F706F335F20638C6DA867564E085E108D264ED780C07634969C -62DB662D627E6CBC8D7571677F695146808753EC906E629854F286F08F998005 -951785178FD96D5973CD659F771F7504782781FB8D1E94884FA6679575B98BCA -9707632F9547963584B8632377415F8172F04E896014657462EF6B63653F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -56 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005E2775C790D18BC1829D679D652F5431871877E580A281026C414E4B7EC7 -804C76F4690D6B966267503C4F84574063076B628DBE53EA65E87EB85FD7631A -63B781F381F47F6E5E1C5CD95236667A79E97A1A8D28709975D46EDE6CBB7A92 -4E2D76C55FE0949F88777EC879CD80BF91CD4EF24F17821F54685DDE6D328BCC -7CA58F7480985E1A549276B15B99663C9AA473E0682A86DB6731732A8BF88BDB -90107AF970DB716E62C477A956314E3B845767F152A986C08D2E94F87B510000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -57 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F4F6CE8795D9A7B6293722A62FD4E1378168F6C64B08D5A7BC668695E84 -88C55986649E58EE72B6690E95258FFD8D5857607F008C0651C6634962D95353 -684C74228301914C55447740707C6D4A517954A88D4459FF6ECB6DC45B5C7D2B -4ED47C7D6ED35B5081EA6E0D5B579B0368D58E2A5B977EFC603B7EB590B98D70 -594F63CD79DF8DB3535265CF79568BC5963B7EC494BB7E825634918967007F6A -5C0A907566285DE64F5067DE505A4F5C57505EA7000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -58 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E8D4E0C51404E105EFF53454E154E984E1E9B325B6C56694E2879BA4E3F -53154E47592D723B536E6C1056DF80E499976BD3777E9F174E364E9F9F104E5C -4E694E9382885B5B556C560F4EC4538D539D53A353A553AE97658D5D531A53F5 -5326532E533E8D5C5366536352025208520E522D5233523F5240524C525E5261 -525C84AF527D528252815290529351827F544EBB4EC34EC94EC24EE84EE14EEB -4EDE4F1B4EF34F224F644EF54F254F274F094F2B4F5E4F6765384F5A4F5D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F5F4F574F324F3D4F764F744F914F894F834F8F4F7E4F7B4FAA4F7C4FAC -4F944FE64FE84FEA4FC54FDA4FE34FDC4FD14FDF4FF85029504C4FF3502C500F -502E502D4FFE501C500C50255028507E504350555048504E506C507B50A550A7 -50A950BA50D6510650ED50EC50E650EE5107510B4EDD6C3D4F584F654FCE9FA0 -6C467C74516E5DFD9EC999985181591452F9530D8A07531051EB591951554EA0 -51564EB3886E88A44EB5811488D279805B3488037FB851AB51B151BD51BC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000051C7519651A251A58BA08BA68BA78BAA8BB48BB58BB78BC28BC38BCB8BCF -8BCE8BD28BD38BD48BD68BD88BD98BDC8BDF8BE08BE48BE88BE98BEE8BF08BF3 -8BF68BF98BFC8BFF8C008C028C048C078C0C8C0F8C118C128C148C158C168C19 -8C1B8C188C1D8C1F8C208C218C258C278C2A8C2B8C2E8C2F8C328C338C358C36 -5369537A961D962296219631962A963D963C964296499654965F9667966C9672 -96749688968D969796B09097909B909D909990AC90A190B490B390B690BA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090B890B090CF90C590BE90D090C490C790D390E690E290DC90D790DB90EB -90EF90FE91049122911E91239131912F913991439146520D594252A252AC52AD -52BE54FF52D052D652F053DF71EE77CD5EF451F551FC9B2F53B65F01755A5DEF -574C57A957A1587E58BC58C558D15729572C572A57335739572E572F575C573B -574257695785576B5786577C577B5768576D5776577357AD57A4578C57B257CF -57A757B4579357A057D557D857DA57D957D257B857F457EF57F857E457DD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000580B580D57FD57ED5800581E5819584458205865586C58815889589A5880 -99A89F1961FF8279827D827F828F828A82A88284828E82918297829982AB82B8 -82BE82B082C882CA82E3829882B782AE82CB82CC82C182A982B482A182AA829F -82C482CE82A482E1830982F782E4830F830782DC82F482D282D8830C82FB82D3 -8311831A83068314831582E082D5831C8351835B835C83088392833C83348331 -839B835E832F834F83478343835F834083178360832D833A8333836683650000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008368831B8369836C836A836D836E83B0837883B383B483A083AA8393839C -8385837C83B683A9837D83B8837B8398839E83A883BA83BC83C1840183E583D8 -58078418840B83DD83FD83D6841C84388411840683D483DF840F840383F883F9 -83EA83C583C0842683F083E1845C8451845A8459847384878488847A84898478 -843C844684698476848C848E8431846D84C184CD84D084E684BD84D384CA84BF -84BA84E084A184B984B4849784E584E3850C750D853884F08539851F853A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008556853B84FF84FC8559854885688564855E857A77A285438572857B85A4 -85A88587858F857985AE859C858585B985B785B085D385C185DC85FF86278605 -86298616863C5EFE5F08593C594180375955595A5958530F5C225C255C2C5C34 -624C626A629F62BB62CA62DA62D762EE632262F66339634B634363AD63F66371 -637A638E63B4636D63AC638A636963AE63BC63F263F863E063FF63C463DE63CE -645263C663BE64456441640B641B6420640C64266421645E6484646D64960000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000647A64B764B8649964BA64C064D064D764E464E265096525652E5F0B5FD2 -75195F11535F53F153FD53E953E853FB541254165406544B5452545354545456 -54435421545754595423543254825494547754715464549A549B548454765466 -549D54D054AD54C254B454D254A754A654D354D4547254A354D554BB54BF54CC -54D954DA54DC54A954AA54A454DD54CF54DE551B54E7552054FD551454F35522 -5523550F55115527552A5567558F55B55549556D55415555553F5550553C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -60 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005537555655755576557755335530555C558B55D2558355B155B955885581 -559F557E55D65591557B55DF55BD55BE5594559955EA55F755C9561F55D155EB -55EC55D455E655DD55C455EF55E555F255F355CC55CD55E855F555E48F94561E -5608560C56015624562355FE56005627562D565856395657562C564D56625659 -565C564C5654568656645671566B567B567C5685569356AF56D456D756DD56E1 -56F556EB56F956FF5704570A5709571C5E0F5E195E145E115E315E3B5E3C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -61 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005E375E445E545E5B5E5E5E615C8C5C7A5C8D5C905C965C885C985C995C91 -5C9A5C9C5CB55CA25CBD5CAC5CAB5CB15CA35CC15CB75CC45CD25CE45CCB5CE5 -5D025D035D275D265D2E5D245D1E5D065D1B5D585D3E5D345D3D5D6C5D5B5D6F -5D5D5D6B5D4B5D4A5D695D745D825D995D9D8C735DB75DC55F735F775F825F87 -5F895F8C5F955F995F9C5FA85FAD5FB55FBC88625F6172AD72B072B472B772B8 -72C372C172CE72CD72D272E872EF72E972F272F472F7730172F3730372FA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000072FB731773137321730A731E731D7315732273397325732C733873317350 -734D73577360736C736F737E821B592598E7592459029963996799689969996A -996B996C99749977997D998099849987998A998D999099919993999499955E80 -5E915E8B5E965EA55EA05EB95EB55EBE5EB38D535ED25ED15EDB5EE85EEA81BA -5FC45FC95FD65FCF60035FEE60045FE15FE45FFE600560065FEA5FED5FF86019 -60356026601B600F600D6029602B600A603F602160786079607B607A60420000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000606A607D6096609A60AD609D60836092608C609B60EC60BB60B160DD60D8 -60C660DA60B4612061266115612360F46100610E612B614A617561AC619461A7 -61B761D461F55FDD96B395E995EB95F195F395F595F695FC95FE960396049606 -9608960A960B960C960D960F96129615961696179619961A4E2C723F62156C35 -6C546C5C6C4A6CA36C856C906C946C8C6C686C696C746C766C866CA96CD06CD4 -6CAD6CF76CF86CF16CD76CB26CE06CD66CFA6CEB6CEE6CB16CD36CEF6CFE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -64 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006D396D276D0C6D436D486D076D046D196D0E6D2B6D4D6D2E6D356D1A6D4F -6D526D546D336D916D6F6D9E6DA06D5E6D936D946D5C6D606D7C6D636E1A6DC7 -6DC56DDE6E0E6DBF6DE06E116DE66DDD6DD96E166DAB6E0C6DAE6E2B6E6E6E4E -6E6B6EB26E5F6E866E536E546E326E256E446EDF6EB16E986EE06F2D6EE26EA5 -6EA76EBD6EBB6EB76ED76EB46ECF6E8F6EC26E9F6F626F466F476F246F156EF9 -6F2F6F366F4B6F746F2A6F096F296F896F8D6F8C6F786F726F7C6F7A6FD10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -65 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006FC96FA76FB96FB66FC26FE16FEE6FDE6FE06FEF701A7023701B70397035 -704F705E5B805B845B955B935BA55BB8752F9A9E64345BE45BEE89305BF08E47 -8B078FB68FD38FD58FE58FEE8FE48FE98FE68FF38FE890059004900B90269011 -900D9016902190359036902D902F9044905190529050906890589062905B66B9 -9074907D908290889083908B5F505F575F565F585C3B54AB5C505C595B715C63 -5C667FBC5F2A5F295F2D82745F3C9B3B5C6E59815983598D59A959AA59A30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -66 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000599759CA59AB599E59A459D259B259AF59D759BE5A055A0659DD5A0859E3 -59D859F95A0C5A095A325A345A115A235A135A405A675A4A5A555A3C5A625A75 -80EC5AAA5A9B5A775A7A5ABE5AEB5AB25AD25AD45AB85AE05AE35AF15AD65AE6 -5AD85ADC5B095B175B165B325B375B405C155C1C5B5A5B655B735B515B535B62 -9A759A779A789A7A9A7F9A7D9A809A819A859A889A8A9A909A929A939A969A98 -9A9B9A9C9A9D9A9F9AA09AA29AA39AA59AA77E9F7EA17EA37EA57EA87EA90000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007EAD7EB07EBE7EC07EC17EC27EC97ECB7ECC7ED07ED47ED77EDB7EE07EE1 -7EE87EEB7EEE7EEF7EF17EF27F0D7EF67EFA7EFB7EFE7F017F027F037F077F08 -7F0B7F0C7F0F7F117F127F177F197F1C7F1B7F1F7F217F227F237F247F257F26 -7F277F2A7F2B7F2C7F2D7F2F7F307F317F327F337F355E7A757F5DDB753E9095 -738E739173AE73A2739F73CF73C273D173B773B373C073C973C873E573D9987C -740A73E973E773DE73BA73F2740F742A745B7426742574287430742E742C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -68 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000741B741A7441745C7457745574597477746D747E749C748E748074817487 -748B749E74A874A9749074A774D274BA97EA97EB97EC674C6753675E67486769 -67A56787676A6773679867A7677567A8679E67AD678B6777677C67F0680967D8 -680A67E967B0680C67D967B567DA67B367DD680067C367B867E2680E67C167FD -6832683368606861684E6862684468646883681D68556866684168676840683E -684A6849682968B5688F687468776893686B68C2696E68FC691F692068F90000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -69 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000692468F0690B6901695768E369106971693969606942695D6984696B6980 -69986978693469CC6987698869CE6989696669636979699B69A769BB69AB69AD -69D469B169C169CA69DF699569E0698D69FF6A2F69ED6A176A186A6569F26A44 -6A3E6AA06A506A5B6A356A8E6A796A3D6A286A586A7C6A916A906AA96A976AAB -733773526B816B826B876B846B926B936B8D6B9A6B9B6BA16BAA8F6B8F6D8F71 -8F728F738F758F768F788F778F798F7A8F7C8F7E8F818F828F848F878F8B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008F8D8F8E8F8F8F988F9A8ECE620B6217621B621F6222622162256224622C -81E774EF74F474FF750F75117513653465EE65EF65F0660A6619677266036615 -6600708566F7661D66346631663666358006665F66546641664F665666616657 -66776684668C66A7669D66BE66DB66DC66E666E98D328D338D368D3B8D3D8D40 -8D458D468D488D498D478D4D8D558D5989C789CA89CB89CC89CE89CF89D089D1 -726E729F725D7266726F727E727F7284728B728D728F72926308633263B00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000643F64D880046BEA6BF36BFD6BF56BF96C056C076C066C0D6C156C186C19 -6C1A6C216C296C246C2A6C3265356555656B724D72527256723086625216809F -809C809380BC670A80BD80B180AB80AD80B480B780E780E880E980EA80DB80C2 -80C480D980CD80D7671080DD80EB80F180F480ED810D810E80F280FC67158112 -8C5A8136811E812C811881328148814C815381748159815A817181608169817C -817D816D8167584D5AB58188818281916ED581A381AA81CC672681CA81BB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081C181A66B246B376B396B436B466B5998D198D298D398D598D998DA6BB3 -5F406BC289F365909F51659365BC65C665C465C365CC65CE65D265D67080709C -7096709D70BB70C070B770AB70B170E870CA711071137116712F71317173715C -716871457172714A7178717A719871B371B571A871A071E071D471E771F9721D -7228706C7118716671B9623E623D624362486249793B794079467949795B795C -7953795A796279577960796F7967797A7985798A799A79A779B35FD15FD00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000603C605D605A606760416059606360AB6106610D615D61A9619D61CB61D1 -62068080807F6C936CF66DFC77F677F87800780978177818781165AB782D781C -781D7839783A783B781F783C7825782C78237829784E786D7856785778267850 -7847784C786A789B7893789A7887789C78A178A378B278B978A578D478D978C9 -78EC78F2790578F479137924791E79349F9B9EF99EFB9EFC76F17704770D76F9 -77077708771A77227719772D7726773577387750775177477743775A77680000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077627765777F778D777D7780778C7791779F77A077B077B577BD753A7540 -754E754B7548755B7572757975837F587F617F5F8A487F687F747F717F797F81 -7F7E76CD76E58832948594869487948B948A948C948D948F9490949494979495 -949A949B949C94A394A494AB94AA94AD94AC94AF94B094B294B494B694B794B8 -94B994BA94BC94BD94BF94C494C894C994CA94CB94CC94CD94CE94D094D194D2 -94D594D694D794D994D894DB94DE94DF94E094E294E494E594E794E894EA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000094E994EB94EE94EF94F394F494F594F794F994FC94FD94FF950395029506 -95079509950A950D950E950F951295139514951595169518951B951D951E951F -9522952A952B9529952C953195329534953695379538953C953E953F95429535 -9544954595469549954C954E954F9552955395549556955795589559955B955E -955F955D95619562956495659566956795689569956A956B956C956F95719572 -9573953A77E777EC96C979D579ED79E379EB7A065D477A037A027A1E7A140000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -70 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A397A377A519ECF99A57A707688768E7693769976A474DE74E0752C9E20 -9E229E289E299E2A9E2B9E2C9E329E319E369E389E379E399E3A9E3E9E419E42 -9E449E469E479E489E499E4B9E4C9E4E9E519E559E579E5A9E5B9E5C9E5E9E63 -9E669E679E689E699E6A9E6B9E6C9E719E6D9E7375927594759675A0759D75AC -75A375B375B475B875C475B175B075C375C275D675CD75E375E875E675E475EB -75E7760375F175FC75FF761076007605760C7617760A76257618761576190000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -71 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000761B763C762276207640762D7630763F76357643763E7633764D765E7654 -765C7656766B766F7FCA7AE67A787A797A807A867A887A957AA67AA07AAC7AA8 -7AAD7AB3886488698872887D887F888288A288C688B788BC88C988E288CE88E3 -88E588F1891A88FC88E888FE88F0892189198913891B890A8934892B89368941 -8966897B758B80E576B276B477DC801280148016801C80208022802580268027 -802980288031800B803580438046804D80528069807189839878988098830000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -72 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009889988C988D988F9894989A989B989E989F98A198A298A598A6864D8654 -866C866E867F867A867C867B86A8868D868B86AC869D86A786A386AA869386A9 -86B686C486B586CE86B086BA86B186AF86C986CF86B486E986F186F286ED86F3 -86D0871386DE86F486DF86D886D18703870786F88708870A870D87098723873B -871E8725872E871A873E87488734873187298737873F87828722877D877E877B -87608770874C876E878B87538763877C876487598765879387AF87A887D20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -73 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000087C68788878587AD8797878387AB87E587AC87B587B387CB87D387BD87D1 -87C087CA87DB87EA87E087EE8816881387FE880A881B88218839883C7F367F42 -7F447F4582107AFA7AFD7B087B037B047B157B0A7B2B7B0F7B477B387B2A7B19 -7B2E7B317B207B257B247B337B3E7B1E7B587B5A7B457B757B4C7B5D7B607B6E -7B7B7B627B727B717B907BA67BA77BB87BAC7B9D7BA87B857BAA7B9C7BA27BAB -7BB47BD17BC17BCC7BDD7BDA7BE57BE67BEA7C0C7BFE7BFC7C0F7C167C0B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007C1F7C2A7C267C387C417C4081FE82018202820481EC8844822182228223 -822D822F8228822B8238823B82338234823E82448249824B824F825A825F8268 -887E8885888888D888DF895E7F9D7F9F7FA77FAF7FB07FB27C7C65497C917C9D -7C9C7C9E7CA27CB27CBC7CBD7CC17CC77CCC7CCD7CC87CC57CD77CE8826E66A8 -7FBF7FCE7FD57FE57FE17FE67FE97FEE7FF37CF87D777DA67DAE7E477E9B9EB8 -9EB48D738D848D948D918DB18D678D6D8C478C49914A9150914E914F91640000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -75 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009162916191709169916F917D917E917291749179918C91859190918D9191 -91A291A391AA91AD91AE91AF91B591B491BA8C559E7E8DB88DEB8E058E598E69 -8DB58DBF8DBC8DBA8DC48DD68DD78DDA8DDE8DCE8DCF8DDB8DC68DEC8DF78DF8 -8DE38DF98DFB8DE48E098DFD8E148E1D8E1F8E2C8E2E8E238E2F8E3A8E408E39 -8E358E3D8E318E498E418E428E518E528E4A8E708E768E7C8E6F8E748E858E8F -8E948E908E9C8E9E8C788C828C8A8C858C988C94659B89D689DE89DA89DC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -76 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000089E589EB89EF8A3E8B26975396E996F396EF970697019708970F970E972A -972D9730973E9F809F839F859F869F879F889F899F8A9F8C9EFE9F0B9F0D96B9 -96BC96BD96CE96D277BF96E0928E92AE92C8933E936A93CA938F943E946B9C7F -9C829C859C869C879C887A239C8B9C8E9C909C919C929C949C959C9A9C9B9C9E -9C9F9CA09CA19CA29CA39CA59CA69CA79CA89CA99CAB9CAD9CAE9CB09CB19CB2 -9CB39CB49CB59CB69CB79CBA9CBB9CBC9CBD9CC49CC59CC69CC79CCA9CCB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -77 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009CCC9CCD9CCE9CCF9CD09CD39CD49CD59CD79CD89CD99CDC9CDD9CDF9CE2 -977C978597919792979497AF97AB97A397B297B49AB19AB09AB79E589AB69ABA -9ABC9AC19AC09AC59AC29ACB9ACC9AD19B459B439B479B499B489B4D9B5198E8 -990D992E995599549ADF9AE19AE69AEF9AEB9AFB9AED9AF99B089B0F9B139B1F -9B239EBD9EBE7E3B9E829E879E889E8B9E9293D69E9D9E9F9EDB9EDC9EDD9EE0 -9EDF9EE29EE99EE79EE59EEA9EEF9F229F2C9F2F9F399F379F3D9F3E9F440000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/iso2022-jp.enc b/library/encoding/iso2022-jp.enc deleted file mode 100644 index a4e455f..0000000 --- a/library/encoding/iso2022-jp.enc +++ /dev/null @@ -1,12 +0,0 @@ -# Encoding file: iso2022-jp, escape-driven -E -name iso2022-jp -init {} -final {} -iso8859-1 \x1b(B -jis0201 \x1b(J -jis0208 \x1b$@ -jis0208 \x1b$B -jis0212 \x1b$(D -gb2312 \x1b$A -ksc5601 \x1b$(C diff --git a/library/encoding/iso2022-kr.enc b/library/encoding/iso2022-kr.enc deleted file mode 100644 index d20ce2b..0000000 --- a/library/encoding/iso2022-kr.enc +++ /dev/null @@ -1,7 +0,0 @@ -# Encoding file: iso2022-kr, escape-driven -E -name iso2022-kr -init \x1b$)C -final {} -iso8859-1 \x0f -ksc5601 \x0e diff --git a/library/encoding/iso2022.enc b/library/encoding/iso2022.enc deleted file mode 100644 index ae7cde1..0000000 --- a/library/encoding/iso2022.enc +++ /dev/null @@ -1,16 +0,0 @@ -# Encoding file: iso2022, escape-driven -E -name iso2022 -init {} -final {} -iso8859-1 \x1b(B -jis0201 \x1b(J -gb1988 \x1b(T -jis0208 \x1b$@ -jis0208 \x1b$B -jis0212 \x1b$(D -gb2312 \x1b$A -ksc5601 \x1b$(C -jis0208 \x1b&@\x1b$B - - diff --git a/library/encoding/iso8859-1.enc b/library/encoding/iso8859-1.enc deleted file mode 100644 index 045d8fa..0000000 --- a/library/encoding/iso8859-1.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-1, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF -00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF -00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF -00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF -00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF -00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF diff --git a/library/encoding/iso8859-2.enc b/library/encoding/iso8859-2.enc deleted file mode 100644 index 16faab6..0000000 --- a/library/encoding/iso8859-2.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-2, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A0010402D8014100A4013D015A00A700A80160015E0164017900AD017D017B -00B0010502DB014200B4013E015B02C700B80161015F0165017A02DD017E017C -015400C100C2010200C40139010600C7010C00C9011800CB011A00CD00CE010E -01100143014700D300D4015000D600D70158016E00DA017000DC00DD016200DF -015500E100E2010300E4013A010700E7010D00E9011900EB011B00ED00EE010F -01110144014800F300F4015100F600F70159016F00FA017100FC00FD016302D9 diff --git a/library/encoding/iso8859-3.enc b/library/encoding/iso8859-3.enc deleted file mode 100644 index c914bce..0000000 --- a/library/encoding/iso8859-3.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-3, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A0012602D800A300A40000012400A700A80130015E011E013400AD0000017B -00B0012700B200B300B400B5012500B700B80131015F011F013500BD0000017C -00C000C100C2000000C4010A010800C700C800C900CA00CB00CC00CD00CE00CF -000000D100D200D300D4012000D600D7011C00D900DA00DB00DC016C015C00DF -00E000E100E2000000E4010B010900E700E800E900EA00EB00EC00ED00EE00EF -000000F100F200F300F4012100F600F7011D00F900FA00FB00FC016D015D02D9 diff --git a/library/encoding/iso8859-4.enc b/library/encoding/iso8859-4.enc deleted file mode 100644 index ef5c5a9..0000000 --- a/library/encoding/iso8859-4.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-4, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A001040138015600A40128013B00A700A8016001120122016600AD017D00AF -00B0010502DB015700B40129013C02C700B80161011301230167014A017E014B -010000C100C200C300C400C500C6012E010C00C9011800CB011600CD00CE012A -01100145014C013600D400D500D600D700D8017200DA00DB00DC0168016A00DF -010100E100E200E300E400E500E6012F010D00E9011900EB011700ED00EE012B -01110146014D013700F400F500F600F700F8017300FA00FB00FC0169016B02D9 diff --git a/library/encoding/iso8859-5.enc b/library/encoding/iso8859-5.enc deleted file mode 100644 index bf4ee82..0000000 --- a/library/encoding/iso8859-5.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-5, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A0040104020403040404050406040704080409040A040B040C00AD040E040F -0410041104120413041404150416041704180419041A041B041C041D041E041F -0420042104220423042404250426042704280429042A042B042C042D042E042F -0430043104320433043404350436043704380439043A043B043C043D043E043F -0440044104420443044404450446044704480449044A044B044C044D044E044F -2116045104520453045404550456045704580459045A045B045C00A7045E045F diff --git a/library/encoding/iso8859-6.enc b/library/encoding/iso8859-6.enc deleted file mode 100644 index 6510af7..0000000 --- a/library/encoding/iso8859-6.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-6, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0660066106620663066406650666066706680669003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A000000000000000A40000000000000000000000000000060C00AD00000000 -00000000000000000000000000000000000000000000061B000000000000061F -0000062106220623062406250626062706280629062A062B062C062D062E062F -0630063106320633063406350636063706380639063A00000000000000000000 -0640064106420643064406450646064706480649064A064B064C064D064E064F -0650065106520000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/iso8859-7.enc b/library/encoding/iso8859-7.enc deleted file mode 100644 index 2cb69a2..0000000 --- a/library/encoding/iso8859-7.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-7, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A002BD02BC00A30000000000A600A700A800A9000000AB00AC00AD00002015 -00B000B100B200B303840385038600B703880389038A00BB038C00BD038E038F -0390039103920393039403950396039703980399039A039B039C039D039E039F -03A003A1000003A303A403A503A603A703A803A903AA03AB03AC03AD03AE03AF -03B003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C203C303C403C503C603C703C803C903CA03CB03CC03CD03CE0000 diff --git a/library/encoding/iso8859-8.enc b/library/encoding/iso8859-8.enc deleted file mode 100644 index 6b424d5..0000000 --- a/library/encoding/iso8859-8.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-8, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A0000000A200A300A400A500A600A700A800A900D700AB00AC00AD00AE203E -00B000B100B200B300B400B500B600B700B800B900F700BB00BC00BD00BE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000002017 -05D005D105D205D305D405D505D605D705D805D905DA05DB05DC05DD05DE05DF -05E005E105E205E305E405E505E605E705E805E905EA00000000000000000000 diff --git a/library/encoding/iso8859-9.enc b/library/encoding/iso8859-9.enc deleted file mode 100644 index 6eed3f1..0000000 --- a/library/encoding/iso8859-9.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: iso8859-9, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF -00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF -00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF -011E00D100D200D300D400D500D600D700D800D900DA00DB00DC0130015E00DF -00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF -011F00F100F200F300F400F500F600F700F800F900FA00FB00FC0131015F00FF diff --git a/library/encoding/jis0201.enc b/library/encoding/jis0201.enc deleted file mode 100644 index 64f423f..0000000 --- a/library/encoding/jis0201.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: jis0201, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D203E007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F -FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F -FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F -FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/jis0208.enc b/library/encoding/jis0208.enc deleted file mode 100644 index 7102e88..0000000 --- a/library/encoding/jis0208.enc +++ /dev/null @@ -1,1312 +0,0 @@ -# Encoding file: jis0208, double-byte -D -2129 0 77 -21 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8 -FF3EFFE3FF3F30FD30FE309D309E30034EDD30053006300730FC20152010FF0F -FF3C301C2016FF5C2026202520182019201C201DFF08FF0930143015FF3BFF3D -FF5BFF5D30083009300A300B300C300D300E300F30103011FF0B221200B100D7 -00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5 -FF0400A200A3FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -22 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000025C625A125A025B325B225BD25BC203B3012219221902191219330130000 -00000000000000000000000000000000000000002208220B2286228722822283 -222A2229000000000000000000000000000000002227222800AC21D221D42200 -220300000000000000000000000000000000000000000000222022A523122202 -220722612252226A226B221A223D221D2235222B222C00000000000000000000 -00000000212B2030266F266D266A2020202100B6000000000000000025EF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -23 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19000000000000000000000000 -0000FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3A00000000000000000000 -0000FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5A00000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -24 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -25 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -26 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -27 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000004100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -28 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000025002502250C251025182514251C252C25242534253C25012503250F2513 -251B251725232533252B253B254B2520252F25282537253F251D253025252538 -2542000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E9C55165A03963F54C0611B632859F690228475831C7A5060AA63E16E25 -65ED846682A69BF56893572765A162715B9B59D0867B98F47D627DBE9B8E6216 -7C9F88B75B895EB563096697684895C7978D674F4EE54F0A4F4D4F9D504956F2 -593759D45A015C0960DF610F61706613690570BA754F757079FB7DAD7DEF80C3 -840E88638B029055907A533B4E954EA557DF80B290C178EF4E0058F16EA29038 -7A328328828B9C2F5141537054BD54E156E059FB5F1598F26DEB80E4852D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -31 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009662967096A097FB540B53F35B8770CF7FBD8FC296E8536F9D5C7ABA4E11 -789381FC6E26561855046B1D851A9C3B59E553A96D6674DC958F56424E91904B -96F2834F990C53E155B65B305F71662066F368046C386CF36D29745B76C87A4E -983482F1885B8A6092ED6DB275AB76CA99C560A68B018D8A95B2698E53AD5186 -5712583059445BB45EF6602863A963F46CBF6F14708E7114715971D5733F7E01 -827682D185979060925B9D1B586965BC6C5A752551F9592E59655F805FDC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -32 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000062BC65FA6A2A6B276BB4738B7FC189569D2C9D0E9EC45CA16C96837B5104 -5C4B61B681C6687672614E594FFA537860696E297A4F97F34E0B53164EEE4F55 -4F3D4FA14F7352A053EF5609590F5AC15BB65BE179D16687679C67B66B4C6CB3 -706B73C2798D79BE7A3C7B8782B182DB8304837783EF83D387668AB256298CA8 -8FE6904E971E868A4FC45CE862117259753B81E582BD86FE8CC096C5991399D5 -4ECB4F1A89E356DE584A58CA5EFB5FEB602A6094606261D0621262D065390000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -33 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009B41666668B06D777070754C76867D7582A587F9958B968E8C9D51F152BE -591654B35BB35D16616869826DAF788D84CB88578A7293A79AB86D6C99A886D9 -57A367FF86CE920E5283568754045ED362E164B9683C68386BBB737278BA7A6B -899A89D28D6B8F0390ED95A3969497695B665CB3697D984D984E639B7B206A2B -6A7F68B69C0D6F5F5272559D607062EC6D3B6E076ED1845B89108F444E149C39 -53F6691B6A3A9784682A515C7AC384B291DC938C565B9D286822830584310000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -34 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007CA5520882C574E64E7E4F8351A05BD2520A52D852E75DFB559A582A59E6 -5B8C5B985BDB5E725E7960A3611F616361BE63DB656267D1685368FA6B3E6B53 -6C576F226F976F4574B0751876E3770B7AFF7BA17C217DE97F367FF0809D8266 -839E89B38ACC8CAB908494519593959195A2966597D3992882184E38542B5CB8 -5DCC73A9764C773C5CA97FEB8D0B96C19811985498584F014F0E5371559C5668 -57FA59475B095BC45C905E0C5E7E5FCC63EE673A65D765E2671F68CB68C40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -35 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006A5F5E306BC56C176C7D757F79485B637A007D005FBD898F8A188CB48D77 -8ECC8F1D98E29A0E9B3C4E80507D510059935B9C622F628064EC6B3A72A07591 -79477FA987FB8ABC8B7063AC83CA97A05409540355AB68546A588A7078276775 -9ECD53745BA2811A865090064E184E454EC74F1153CA54385BAE5F1360256551 -673D6C426C726CE3707874037A767AAE7B087D1A7CFE7D6665E7725B53BB5C45 -5DE862D262E063196E20865A8A318DDD92F86F0179A69B5A4EA84EAB4EAC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -36 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F9B4FA050D151477AF6517151F653545321537F53EB55AC58835CE15F37 -5F4A602F6050606D631F65596A4B6CC172C272ED77EF80F881058208854E90F7 -93E197FF99579A5A4EF051DD5C2D6681696D5C4066F26975738968507C8150C5 -52E457475DFE932665A46B236B3D7434798179BD7B4B7DCA82B983CC887F895F -8B398FD191D1541F92804E5D503653E5533A72D7739677E982E68EAF99C699C8 -99D25177611A865E55B07A7A50765BD3904796854E326ADB91E75C515C480000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -37 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000063987A9F6C9397748F617AAA718A96887C8268177E706851936C52F2541B -85AB8A137FA48ECD90E15366888879414FC250BE521151445553572D73EA578B -59515F625F8460756176616761A963B2643A656C666F68426E1375667A3D7CFB -7D4C7D997E4B7F6B830E834A86CD8A088A638B668EFD981A9D8F82B88FCE9BE8 -5287621F64836FC09699684150916B206C7A6F547A747D5088408A2367084EF6 -503950265065517C5238526355A7570F58055ACC5EFA61B261F862F363720000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -38 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000691C6A29727D72AC732E7814786F7D79770C80A9898B8B198CE28ED29063 -9375967A98559A139E785143539F53B35E7B5F266E1B6E90738473FE7D438237 -8A008AFA96504E4E500B53E4547C56FA59D15B645DF15EAB5F276238654567AF -6E5672D07CCA88B480A180E183F0864E8A878DE8923796C798679F134E944E92 -4F0D53485449543E5A2F5F8C5FA1609F68A76A8E745A78818A9E8AA48B779190 -4E5E9BC94EA44F7C4FAF501950165149516C529F52B952FE539A53E354110000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -39 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000540E5589575157A2597D5B545B5D5B8F5DE55DE75DF75E785E835E9A5EB7 -5F186052614C629762D863A7653B6602664366F4676D6821689769CB6C5F6D2A -6D696E2F6E9D75327687786C7A3F7CE07D057D187D5E7DB18015800380AF80B1 -8154818F822A8352884C88618B1B8CA28CFC90CA91759271783F92FC95A4964D -980599999AD89D3B525B52AB53F7540858D562F76FE08C6A8F5F9EB9514B523B -544A56FD7A4091779D609ED273446F09817075115FFD60DA9AA872DB8FBC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006B6498034ECA56F0576458BE5A5A606861C7660F6606683968B16DF775D5 -7D3A826E9B424E9B4F5053C955065D6F5DE65DEE67FB6C99747378028A509396 -88DF57505EA7632B50B550AC518D670054C9585E59BB5BB05F69624D63A1683D -6B736E08707D91C7728078157826796D658E7D3083DC88C18F09969B52645728 -67507F6A8CA151B45742962A583A698A80B454B25D0E57FC78959DFA4F5C524A -548B643E6628671467F57A847B567D22932F685C9BAD7B395319518A52370000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005BDF62F664AE64E6672D6BBA85A996D176909BD6634C93069BAB76BF6652 -4E09509853C25C7160E864926563685F71E673CA75237B977E8286958B838CDB -9178991065AC66AB6B8B4ED54ED44F3A4F7F523A53F853F255E356DB58EB59CB -59C959FF5B505C4D5E025E2B5FD7601D6307652F5B5C65AF65BD65E8679D6B62 -6B7B6C0F7345794979C17CF87D197D2B80A2810281F389968A5E8A698A668A8C -8AEE8CC78CDC96CC98FC6B6F4E8B4F3C4F8D51505B575BFA6148630166420000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006B216ECB6CBB723E74BD75D478C1793A800C803381EA84948F9E6C509E7F -5F0F8B589D2B7AFA8EF85B8D96EB4E0353F157F759315AC95BA460896E7F6F06 -75BE8CEA5B9F85007BE0507267F4829D5C61854A7E1E820E51995C0463688D66 -659C716E793E7D1780058B1D8ECA906E86C790AA501F52FA5C3A6753707C7235 -914C91C8932B82E55BC25F3160F94E3B53D65B88624B67316B8A72E973E07A2E -816B8DA391529996511253D7546A5BFF63886A397DAC970056DA53CE54680000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005B975C315DDE4FEE610162FE6D3279C079CB7D427E4D7FD281ED821F8490 -884689728B908E748F2F9031914B916C96C6919C4EC04F4F514553415F93620E -67D46C416E0B73637E2691CD928353D459195BBF6DD1795D7E2E7C9B587E719F -51FA88538FF04FCA5CFB662577AC7AE3821C99FF51C65FAA65EC696F6B896DF3 -6E966F6476FE7D145DE190759187980651E6521D6240669166D96E1A5EB67DD2 -7F7266F885AF85F78AF852A953D959735E8F5F90605592E4966450B7511F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000052DD5320534753EC54E8554655315617596859BE5A3C5BB55C065C0F5C11 -5C1A5E845E8A5EE05F70627F628462DB638C63776607660C662D6676677E68A2 -6A1F6A356CBC6D886E096E58713C7126716775C77701785D7901796579F07AE0 -7B117CA77D39809683D6848B8549885D88F38A1F8A3C8A548A738C618CDE91A4 -9266937E9418969C97984E0A4E084E1E4E575197527057CE583458CC5B225E38 -60C564FE676167566D4472B675737A6384B88B7291B89320563157F498FE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000062ED690D6B9671ED7E548077827289E698DF87558FB15C3B4F384FE14FB5 -55075A205BDD5BE95FC3614E632F65B0664B68EE699B6D786DF1753375B9771F -795E79E67D3381E382AF85AA89AA8A3A8EAB8F9B903291DD97074EBA4EC15203 -587558EC5C0B751A5C3D814E8A0A8FC59663976D7B258ACF9808916256F353A8 -9017543957825E2563A86C34708A77617C8B7FE088709042915493109318968F -745E9AC45D075D69657067A28DA896DB636E6749691983C5981796C088FE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -40 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006F84647A5BF84E16702C755D662F51C4523652E259D35F8160276210653F -6574661F667468F268166B636E057272751F76DB7CBE805658F088FD897F8AA0 -8A938ACB901D91929752975965897A0E810696BB5E2D60DC621A65A566146790 -77F37A4D7C4D7E3E810A8CAC8D648DE18E5F78A9520762D963A5644262988A2D -7A837BC08AAC96EA7D76820C87494ED95148534353605BA35C025C165DDD6226 -624764B0681368346CC96D456D1767D36F5C714E717D65CB7A7F7BAD7DDA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -41 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007E4A7FA8817A821B823985A68A6E8CCE8DF59078907792AD929195839BAE -524D55846F387136516879857E5581B37CCE564C58515CA863AA66FE66FD695A -72D9758F758E790E795679DF7C977D207D4486078A34963B90619F2050E75275 -53CC53E2500955AA58EE594F723D5B8B5C64531D60E360F3635C6383633F63BB -64CD65E966F95DE369CD69FD6F1571E54E8975E976F87A937CDF7DCF7D9C8061 -83498358846C84BC85FB88C58D709001906D9397971C9A1250CF5897618E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -42 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000081D385358D0890204FC3507452475373606F6349675F6E2C8DB3901F4FD7 -5C5E8CCA65CF7D9A53528896517663C35B585B6B5C0A640D6751905C4ED6591A -592A6C708A51553E581559A560F0625367C182356955964099C49A284F535806 -5BFE80105CB15E2F5F856020614B623466FF6CF06EDE80CE817F82D4888B8CB8 -9000902E968A9EDB9BDB4EE353F059277B2C918D984C9DF96EDD702753535544 -5B856258629E62D36CA26FEF74228A1794386FC18AFE833851E786F853EA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -43 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000053E94F4690548FB0596A81315DFD7AEA8FBF68DA8C3772F89C486A3D8AB0 -4E3953585606576662C563A265E66B4E6DE16E5B70AD77ED7AEF7BAA7DBB803D -80C686CB8A95935B56E358C75F3E65AD66966A806BB575378AC7502477E55730 -5F1B6065667A6C6075F47A1A7F6E81F48718904599B37BC9755C7AF97B5184C4 -901079E97A9283365AE177404E2D4EF25B995FE062BD663C67F16CE8866B8877 -8A3B914E92F399D06A177026732A82E784578CAF4E01514651CB558B5BF50000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -44 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005E165E335E815F145F355F6B5FB461F2631166A2671D6F6E7252753A773A -80748139817887768ABF8ADC8D858DF3929A957798029CE552C5635776F46715 -6C8873CD8CC393AE96736D25589C690E69CC8FFD939A75DB901A585A680263B4 -69FB4F436F2C67D88FBB85267DB49354693F6F70576A58F75B2C7D2C722A540A -91E39DB44EAD4F4E505C507552438C9E544858245B9A5E1D5E955EAD5EF75F1F -608C62B5633A63D068AF6C407887798E7A0B7DE082478A028AE68E4490130000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -45 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090B8912D91D89F0E6CE5645864E265756EF476847B1B906993D16EBA54F2 -5FB964A48F4D8FED92445178586B59295C555E976DFB7E8F751C8CBC8EE2985B -70B94F1D6BBF6FB1753096FB514E54105835585759AC5C605F926597675C6E21 -767B83DF8CED901490FD934D7825783A52AA5EA6571F597460125012515A51AC -51CD520055105854585859575B955CF65D8B60BC6295642D6771684368BC68DF -76D76DD86E6F6D9B706F71C85F5375D879777B497B547B527CD67D7152300000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -46 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008463856985E48A0E8B048C468E0F9003900F94199676982D9A3095D850CD -52D5540C58025C0E61A7649E6D1E77B37AE580F48404905392855CE09D07533F -5F975FB36D9C7279776379BF7BE46BD272EC8AAD68036A6151F87A8169345C4A -9CF682EB5BC59149701E56785C6F60C765666C8C8C5A90419813545166C7920D -594890A351854E4D51EA85998B0E7058637A934B696299B47E04757753576960 -8EDF96E36C5D4E8C5C3C5F108FE953028CD1808986795EFF65E54E7351650000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -47 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000059825C3F97EE4EFB598A5FCD8A8D6FE179B079625BE78471732B71B15E74 -5FF5637B649A71C37C984E435EFC4E4B57DC56A260A96FC37D0D80FD813381BF -8FB2899786A45DF4628A64AD898767776CE26D3E743678345A467F7582AD99AC -4FF35EC362DD63926557676F76C3724C80CC80BA8F29914D500D57F95A926885 -6973716472FD8CB758F28CE0966A9019877F79E477E784294F2F5265535A62CD -67CF6CCA767D7B947C95823685848FEB66DD6F2072067E1B83AB99C19EA60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -48 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000051FD7BB178727BB880877B486AE85E61808C75517560516B92626E8C767A -91979AEA4F107F70629C7B4F95A59CE9567A585986E496BC4F345224534A53CD -53DB5E06642C6591677F6C3E6C4E724872AF73ED75547E41822C85E98CA97BC4 -91C67169981298EF633D6669756A76E478D0854386EE532A5351542659835E87 -5F7C60B26249627962AB65906BD46CCC75B276AE789179D87DCB7F7780A588AB -8AB98CBB907F975E98DB6A0B7C3850995C3E5FAE67876BD8743577097F8E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -49 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009F3B67CA7A175339758B9AED5F66819D83F180985F3C5FC575627B46903C -686759EB5A9B7D10767E8B2C4FF55F6A6A196C376F0274E2796888688A558C79 -5EDF63CF75C579D282D7932892F2849C86ED9C2D54C15F6C658C6D5C70158CA7 -8CD3983B654F74F64E0D4ED857E0592B5A665BCC51A85E035E9C601662766577 -65A7666E6D6E72367B268150819A82998B5C8CA08CE68D74961C96444FAE64AB -6B66821E8461856A90E85C01695398A8847A85574F0F526F5FA95E45670D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000798F8179890789866DF55F1762556CB84ECF72699B925206543B567458B3 -61A4626E711A596E7C897CDE7D1B96F06587805E4E194F75517558405E635E73 -5F0A67C44E26853D9589965B7C73980150FB58C1765678A7522577A585117B86 -504F590972477BC77DE88FBA8FD4904D4FBF52C95A295F0197AD4FDD821792EA -570363556B69752B88DC8F147A4252DF58936155620A66AE6BCD7C3F83E95023 -4FF853055446583159495B9D5CF05CEF5D295E9662B16367653E65B9670B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006CD56CE170F978327E2B80DE82B3840C84EC870289128A2A8C4A90A692D2 -98FD9CF39D6C4E4F4EA1508D5256574A59A85E3D5FD85FD9623F66B4671B67D0 -68D251927D2180AA81A88B008C8C8CBF927E96325420982C531750D5535C58A8 -64B26734726777667A4691E652C36CA16B8658005E4C5954672C7FFB51E176C6 -646978E89B549EBB57CB59B96627679A6BCE54E969D95E55819C67959BAA67FE -9C52685D4EA64FE353C862B9672B6CAB8FC44FAD7E6D9EBF4E0761626E800000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006F2B85135473672A9B455DF37B955CAC5BC6871C6E4A84D17A1481085999 -7C8D6C11772052D959227121725F77DB97279D61690B5A7F5A1851A5540D547D -660E76DF8FF792989CF459EA725D6EC5514D68C97DBF7DEC97629EBA64786A21 -830259845B5F6BDB731B76F27DB280178499513267289ED976EE676252FF9905 -5C24623B7C7E8CB0554F60B67D0B958053014E5F51B6591C723A803691CE5F25 -77E253845F797D0485AC8A338E8D975667F385AE9453610961086CB976520000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008AED8F38552F4F51512A52C753CB5BA55E7D60A0618263D6670967DA6E67 -6D8C733673377531795088D58A98904A909190F596C4878D59154E884F594E0E -8A898F3F981050AD5E7C59965BB95EB863DA63FA64C166DC694A69D86D0B6EB6 -719475287AAF7F8A8000844984C989818B218E0A9065967D990A617E62916B32 -6C836D747FCC7FFC6DC07F8587BA88F8676583B1983C96F76D1B7D61843D916A -4E7153755D506B046FEB85CD862D89A75229540F5C65674E68A8740674830000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075E288CF88E191CC96E296785F8B73877ACB844E63A0756552896D416E9C -74097559786B7C9296867ADC9F8D4FB6616E65C5865C4E864EAE50DA4E2151CC -5BEE659968816DBC731F764277AD7A1C7CE7826F8AD2907C91CF96759818529B -7DD1502B539867976DCB71D0743381E88F2A96A39C579E9F746058416D997D2F -985E4EE44F364F8B51B752B15DBA601C73B2793C82D3923496B796F6970A9E97 -9F6266A66B74521752A370C888C25EC9604B61906F2371497C3E7DF4806F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000084EE9023932C54429B6F6AD370898CC28DEF973252B45A415ECA5F046717 -697C69946D6A6F0F726272FC7BED8001807E874B90CE516D9E937984808B9332 -8AD6502D548C8A716B6A8CC4810760D167A09DF24E994E989C108A6B85C18568 -69006E7E78978155000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F0C4E104E154E2A4E314E364E3C4E3F4E424E564E584E824E858C6B4E8A -82125F0D4E8E4E9E4E9F4EA04EA24EB04EB34EB64ECE4ECD4EC44EC64EC24ED7 -4EDE4EED4EDF4EF74F094F5A4F304F5B4F5D4F574F474F764F884F8F4F984F7B -4F694F704F914F6F4F864F9651184FD44FDF4FCE4FD84FDB4FD14FDA4FD04FE4 -4FE5501A50285014502A502550054F1C4FF650215029502C4FFE4FEF50115006 -504350476703505550505048505A5056506C50785080509A508550B450B20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -51 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000050C950CA50B350C250D650DE50E550ED50E350EE50F950F5510951015102 -511651155114511A5121513A5137513C513B513F51405152514C515451627AF8 -5169516A516E5180518256D8518C5189518F519151935195519651A451A651A2 -51A951AA51AB51B351B151B251B051B551BD51C551C951DB51E0865551E951ED -51F051F551FE5204520B5214520E5227522A522E52335239524F5244524B524C -525E5254526A527452695273527F527D528D529452925271528852918FA80000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -52 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008FA752AC52AD52BC52B552C152CD52D752DE52E352E698ED52E052F352F5 -52F852F9530653087538530D5310530F5315531A5323532F5331533353385340 -534653454E175349534D51D6535E5369536E5918537B53775382539653A053A6 -53A553AE53B053B653C37C1296D953DF66FC71EE53EE53E853ED53FA5401543D -5440542C542D543C542E54365429541D544E548F5475548E545F547154775470 -5492547B5480547654845490548654C754A254B854A554AC54C454C854A80000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054AB54C254A454BE54BC54D854E554E6550F551454FD54EE54ED54FA54E2 -553955405563554C552E555C55455556555755385533555D5599558054AF558A -559F557B557E5598559E55AE557C558355A9558755A855DA55C555DF55C455DC -55E455D4561455F7561655FE55FD561B55F9564E565071DF5634563656325638 -566B5664562F566C566A56865680568A56A05694568F56A556AE56B656B456C2 -56BC56C156C356C056C856CE56D156D356D756EE56F9570056FF570457090000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005708570B570D57135718571655C7571C572657375738574E573B5740574F -576957C057885761577F5789579357A057B357A457AA57B057C357C657D457D2 -57D3580A57D657E3580B5819581D587258215862584B58706BC05852583D5879 -588558B9589F58AB58BA58DE58BB58B858AE58C558D358D158D758D958D858E5 -58DC58E458DF58EF58FA58F958FB58FC58FD5902590A5910591B68A65925592C -592D59325938593E7AD259555950594E595A5958596259605967596C59690000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -55 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000059785981599D4F5E4FAB59A359B259C659E859DC598D59D959DA5A255A1F -5A115A1C5A095A1A5A405A6C5A495A355A365A625A6A5A9A5ABC5ABE5ACB5AC2 -5ABD5AE35AD75AE65AE95AD65AFA5AFB5B0C5B0B5B165B325AD05B2A5B365B3E -5B435B455B405B515B555B5A5B5B5B655B695B705B735B755B7865885B7A5B80 -5B835BA65BB85BC35BC75BC95BD45BD05BE45BE65BE25BDE5BE55BEB5BF05BF6 -5BF35C055C075C085C0D5C135C205C225C285C385C395C415C465C4E5C530000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -56 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C505C4F5B715C6C5C6E4E625C765C795C8C5C915C94599B5CAB5CBB5CB6 -5CBC5CB75CC55CBE5CC75CD95CE95CFD5CFA5CED5D8C5CEA5D0B5D155D175D5C -5D1F5D1B5D115D145D225D1A5D195D185D4C5D525D4E5D4B5D6C5D735D765D87 -5D845D825DA25D9D5DAC5DAE5DBD5D905DB75DBC5DC95DCD5DD35DD25DD65DDB -5DEB5DF25DF55E0B5E1A5E195E115E1B5E365E375E445E435E405E4E5E575E54 -5E5F5E625E645E475E755E765E7A9EBC5E7F5EA05EC15EC25EC85ED05ECF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -57 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005ED65EE35EDD5EDA5EDB5EE25EE15EE85EE95EEC5EF15EF35EF05EF45EF8 -5EFE5F035F095F5D5F5C5F0B5F115F165F295F2D5F385F415F485F4C5F4E5F2F -5F515F565F575F595F615F6D5F735F775F835F825F7F5F8A5F885F915F875F9E -5F995F985FA05FA85FAD5FBC5FD65FFB5FE45FF85FF15FDD60B35FFF60216060 -601960106029600E6031601B6015602B6026600F603A605A6041606A6077605F -604A6046604D6063604360646042606C606B60596081608D60E76083609A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -58 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006084609B60966097609260A7608B60E160B860E060D360B45FF060BD60C6 -60B560D8614D6115610660F660F7610060F460FA6103612160FB60F1610D610E -6147613E61286127614A613F613C612C6134613D614261446173617761586159 -615A616B6174616F61656171615F615D6153617561996196618761AC6194619A -618A619161AB61AE61CC61CA61C961F761C861C361C661BA61CB7F7961CD61E6 -61E361F661FA61F461FF61FD61FC61FE620062086209620D620C6214621B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000621E6221622A622E6230623262336241624E625E6263625B62606268627C -62826289627E62926293629662D46283629462D762D162BB62CF62FF62C664D4 -62C862DC62CC62CA62C262C7629B62C9630C62EE62F163276302630862EF62F5 -6350633E634D641C634F6396638E638063AB637663A3638F6389639F63B5636B -636963BE63E963C063C663E363C963D263F663C4641664346406641364266436 -651D64176428640F6467646F6476644E652A6495649364A564A9648864BC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000064DA64D264C564C764BB64D864C264F164E7820964E064E162AC64E364EF -652C64F664F464F264FA650064FD6518651C650565246523652B653465356537 -65366538754B654865566555654D6558655E655D65726578658265838B8A659B -659F65AB65B765C365C665C165C465CC65D265DB65D965E065E165F16772660A -660365FB6773663566366634661C664F664466496641665E665D666466676668 -665F6662667066836688668E668966846698669D66C166B966C966BE66BC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000066C466B866D666DA66E0663F66E666E966F066F566F7670F6716671E6726 -67279738672E673F67366741673867376746675E676067596763676467896770 -67A9677C676A678C678B67A667A1678567B767EF67B467EC67B367E967B867E4 -67DE67DD67E267EE67B967CE67C667E76A9C681E684668296840684D6832684E -68B3682B685968636877687F689F688F68AD6894689D689B68836AAE68B96874 -68B568A068BA690F688D687E690168CA690868D86922692668E1690C68CD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068D468E768D569366912690468D768E3692568F968E068EF6928692A691A -6923692168C669796977695C6978696B6954697E696E69396974693D69596930 -6961695E695D6981696A69B269AE69D069BF69C169D369BE69CE5BE869CA69DD -69BB69C369A76A2E699169A0699C699569B469DE69E86A026A1B69FF6B0A69F9 -69F269E76A0569B16A1E69ED6A1469EB6A0A6A126AC16A236A136A446A0C6A72 -6A366A786A476A626A596A666A486A386A226A906A8D6AA06A846AA26AA30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006A9786176ABB6AC36AC26AB86AB36AAC6ADE6AD16ADF6AAA6ADA6AEA6AFB -6B0586166AFA6B126B169B316B1F6B386B3776DC6B3998EE6B476B436B496B50 -6B596B546B5B6B5F6B616B786B796B7F6B806B846B836B8D6B986B956B9E6BA4 -6BAA6BAB6BAF6BB26BB16BB36BB76BBC6BC66BCB6BD36BDF6BEC6BEB6BF36BEF -9EBE6C086C136C146C1B6C246C236C5E6C556C626C6A6C826C8D6C9A6C816C9B -6C7E6C686C736C926C906CC46CF16CD36CBD6CD76CC56CDD6CAE6CB16CBE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006CBA6CDB6CEF6CD96CEA6D1F884D6D366D2B6D3D6D386D196D356D336D12 -6D0C6D636D936D646D5A6D796D596D8E6D956FE46D856DF96E156E0A6DB56DC7 -6DE66DB86DC66DEC6DDE6DCC6DE86DD26DC56DFA6DD96DE46DD56DEA6DEE6E2D -6E6E6E2E6E196E726E5F6E3E6E236E6B6E2B6E766E4D6E1F6E436E3A6E4E6E24 -6EFF6E1D6E386E826EAA6E986EC96EB76ED36EBD6EAF6EC46EB26ED46ED56E8F -6EA56EC26E9F6F416F11704C6EEC6EF86EFE6F3F6EF26F316EEF6F326ECC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006F3E6F136EF76F866F7A6F786F816F806F6F6F5B6FF36F6D6F826F7C6F58 -6F8E6F916FC26F666FB36FA36FA16FA46FB96FC66FAA6FDF6FD56FEC6FD46FD8 -6FF16FEE6FDB7009700B6FFA70117001700F6FFE701B701A6F74701D7018701F -7030703E7032705170637099709270AF70F170AC70B870B370AE70DF70CB70DD -70D9710970FD711C711971657155718871667162714C7156716C718F71FB7184 -719571A871AC71D771B971BE71D271C971D471CE71E071EC71E771F571FC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -60 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000071F971FF720D7210721B7228722D722C72307232723B723C723F72407246 -724B72587274727E7282728172877292729672A272A772B972B272C372C672C4 -72CE72D272E272E072E172F972F7500F7317730A731C7316731D7334732F7329 -7325733E734E734F9ED87357736A7368737073787375737B737A73C873B373CE -73BB73C073E573EE73DE74A27405746F742573F87432743A7455743F745F7459 -7441745C746974707463746A7476747E748B749E74A774CA74CF74D473F10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -61 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000074E074E374E774E974EE74F274F074F174F874F7750475037505750C750E -750D75157513751E7526752C753C7544754D754A7549755B7546755A75697564 -7567756B756D75787576758675877574758A758975827594759A759D75A575A3 -75C275B375C375B575BD75B875BC75B175CD75CA75D275D975E375DE75FE75FF -75FC760175F075FA75F275F3760B760D7609761F762776207621762276247634 -7630763B764776487646765C76587661766276687669766A7667766C76700000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000767276767678767C768076837688768B768E769676937699769A76B076B4 -76B876B976BA76C276CD76D676D276DE76E176E576E776EA862F76FB77087707 -770477297724771E77257726771B773777387747775A7768776B775B7765777F -777E7779778E778B779177A0779E77B077B677B977BF77BC77BD77BB77C777CD -77D777DA77DC77E377EE77FC780C781279267820792A7845788E78747886787C -789A788C78A378B578AA78AF78D178C678CB78D478BE78BC78C578CA78EC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000078E778DA78FD78F47907791279117919792C792B794079607957795F795A -79557953797A797F798A799D79A79F4B79AA79AE79B379B979BA79C979D579E7 -79EC79E179E37A087A0D7A187A197A207A1F79807A317A3B7A3E7A377A437A57 -7A497A617A627A699F9D7A707A797A7D7A887A977A957A987A967AA97AC87AB0 -7AB67AC57AC47ABF90837AC77ACA7ACD7ACF7AD57AD37AD97ADA7ADD7AE17AE2 -7AE67AED7AF07B027B0F7B0A7B067B337B187B197B1E7B357B287B367B500000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -64 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007B7A7B047B4D7B0B7B4C7B457B757B657B747B677B707B717B6C7B6E7B9D -7B987B9F7B8D7B9C7B9A7B8B7B927B8F7B5D7B997BCB7BC17BCC7BCF7BB47BC6 -7BDD7BE97C117C147BE67BE57C607C007C077C137BF37BF77C177C0D7BF67C23 -7C277C2A7C1F7C377C2B7C3D7C4C7C437C547C4F7C407C507C587C5F7C647C56 -7C657C6C7C757C837C907CA47CAD7CA27CAB7CA17CA87CB37CB27CB17CAE7CB9 -7CBD7CC07CC57CC27CD87CD27CDC7CE29B3B7CEF7CF27CF47CF67CFA7D060000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -65 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007D027D1C7D157D0A7D457D4B7D2E7D327D3F7D357D467D737D567D4E7D72 -7D687D6E7D4F7D637D937D897D5B7D8F7D7D7D9B7DBA7DAE7DA37DB57DC77DBD -7DAB7E3D7DA27DAF7DDC7DB87D9F7DB07DD87DDD7DE47DDE7DFB7DF27DE17E05 -7E0A7E237E217E127E317E1F7E097E0B7E227E467E667E3B7E357E397E437E37 -7E327E3A7E677E5D7E567E5E7E597E5A7E797E6A7E697E7C7E7B7E837DD57E7D -8FAE7E7F7E887E897E8C7E927E907E937E947E967E8E7E9B7E9C7F387F3A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -66 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007F457F4C7F4D7F4E7F507F517F557F547F587F5F7F607F687F697F677F78 -7F827F867F837F887F877F8C7F947F9E7F9D7F9A7FA37FAF7FB27FB97FAE7FB6 -7FB88B717FC57FC67FCA7FD57FD47FE17FE67FE97FF37FF998DC80068004800B -801280188019801C80218028803F803B804A804680528058805A805F80628068 -80738072807080768079807D807F808480868085809B8093809A80AD519080AC -80DB80E580D980DD80C480DA80D6810980EF80F1811B81298123812F814B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000968B8146813E8153815180FC8171816E81658166817481838188818A8180 -818281A0819581A481A3815F819381A981B081B581BE81B881BD81C081C281BA -81C981CD81D181D981D881C881DA81DF81E081E781FA81FB81FE820182028205 -8207820A820D821082168229822B82388233824082598258825D825A825F8264 -82628268826A826B822E827182778278827E828D829282AB829F82BB82AC82E1 -82E382DF82D282F482F382FA8393830382FB82F982DE830682DC830982D90000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -68 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000833583348316833283318340833983508345832F832B831783188385839A -83AA839F83A283968323838E8387838A837C83B58373837583A0838983A883F4 -841383EB83CE83FD840383D8840B83C183F7840783E083F2840D8422842083BD -8438850683FB846D842A843C855A84848477846B84AD846E848284698446842C -846F8479843584CA846284B984BF849F84D984CD84BB84DA84D084C184C684D6 -84A1852184FF84F485178518852C851F8515851484FC85408563855885480000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -69 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000085418602854B8555858085A485888591858A85A8856D8594859B85EA8587 -859C8577857E859085C985BA85CF85B985D085D585DD85E585DC85F9860A8613 -860B85FE85FA86068622861A8630863F864D4E558654865F86678671869386A3 -86A986AA868B868C86B686AF86C486C686B086C9882386AB86D486DE86E986EC -86DF86DB86EF8712870687088700870386FB87118709870D86F9870A8734873F -8737873B87258729871A8760875F8778874C874E877487578768876E87590000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000087538763876A880587A2879F878287AF87CB87BD87C087D096D687AB87C4 -87B387C787C687BB87EF87F287E0880F880D87FE87F687F7880E87D288118816 -8815882288218831883688398827883B8844884288528859885E8862886B8881 -887E889E8875887D88B5887288828897889288AE889988A2888D88A488B088BF -88B188C388C488D488D888D988DD88F9890288FC88F488E888F28904890C890A -89138943891E8925892A892B89418944893B89368938894C891D8960895E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000089668964896D896A896F89748977897E89838988898A8993899889A189A9 -89A689AC89AF89B289BA89BD89BF89C089DA89DC89DD89E789F489F88A038A16 -8A108A0C8A1B8A1D8A258A368A418A5B8A528A468A488A7C8A6D8A6C8A628A85 -8A828A848AA88AA18A918AA58AA68A9A8AA38AC48ACD8AC28ADA8AEB8AF38AE7 -8AE48AF18B148AE08AE28AF78ADE8ADB8B0C8B078B1A8AE18B168B108B178B20 -8B3397AB8B268B2B8B3E8B288B418B4C8B4F8B4E8B498B568B5B8B5A8B6B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008B5F8B6C8B6F8B748B7D8B808B8C8B8E8B928B938B968B998B9A8C3A8C41 -8C3F8C488C4C8C4E8C508C558C628C6C8C788C7A8C828C898C858C8A8C8D8C8E -8C948C7C8C98621D8CAD8CAA8CBD8CB28CB38CAE8CB68CC88CC18CE48CE38CDA -8CFD8CFA8CFB8D048D058D0A8D078D0F8D0D8D109F4E8D138CCD8D148D168D67 -8D6D8D718D738D818D998DC28DBE8DBA8DCF8DDA8DD68DCC8DDB8DCB8DEA8DEB -8DDF8DE38DFC8E088E098DFF8E1D8E1E8E108E1F8E428E358E308E348E4A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008E478E498E4C8E508E488E598E648E608E2A8E638E558E768E728E7C8E81 -8E878E858E848E8B8E8A8E938E918E948E998EAA8EA18EAC8EB08EC68EB18EBE -8EC58EC88ECB8EDB8EE38EFC8EFB8EEB8EFE8F0A8F058F158F128F198F138F1C -8F1F8F1B8F0C8F268F338F3B8F398F458F428F3E8F4C8F498F468F4E8F578F5C -8F628F638F648F9C8F9F8FA38FAD8FAF8FB78FDA8FE58FE28FEA8FEF90878FF4 -90058FF98FFA901190159021900D901E9016900B90279036903590398FF80000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000904F905090519052900E9049903E90569058905E9068906F907696A89072 -9082907D90819080908A9089908F90A890AF90B190B590E290E4624890DB9102 -9112911991329130914A9156915891639165916991739172918B9189918291A2 -91AB91AF91AA91B591B491BA91C091C191C991CB91D091D691DF91E191DB91FC -91F591F6921E91FF9214922C92159211925E925792459249926492489295923F -924B9250929C92969293929B925A92CF92B992B792E9930F92FA9344932E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000093199322931A9323933A9335933B935C9360937C936E935693B093AC93AD -939493B993D693D793E893E593D893C393DD93D093C893E4941A941494139403 -940794109436942B94359421943A944194529444945B94609462945E946A9229 -947094759477947D945A947C947E9481947F95829587958A9594959695989599 -95A095A895A795AD95BC95BB95B995BE95CA6FF695C395CD95CC95D595D495D6 -95DC95E195E595E296219628962E962F9642964C964F964B9677965C965E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -70 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000965D965F96669672966C968D96989695969796AA96A796B196B296B096B4 -96B696B896B996CE96CB96C996CD894D96DC970D96D596F99704970697089713 -970E9711970F971697199724972A97309739973D973E97449746974897429749 -975C976097649766976852D2976B977197799785977C9781977A9786978B978F -9790979C97A897A697A397B397B497C397C697C897CB97DC97ED9F4F97F27ADF -97F697F5980F980C9838982498219837983D9846984F984B986B986F98700000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -71 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000098719874987398AA98AF98B198B698C498C398C698E998EB990399099912 -991499189921991D991E99249920992C992E993D993E9942994999459950994B -99519952994C99559997999899A599AD99AE99BC99DF99DB99DD99D899D199ED -99EE99F199F299FB99F89A019A0F9A0599E29A199A2B9A379A459A429A409A43 -9A3E9A559A4D9A5B9A579A5F9A629A659A649A699A6B9A6A9AAD9AB09ABC9AC0 -9ACF9AD19AD39AD49ADE9ADF9AE29AE39AE69AEF9AEB9AEE9AF49AF19AF70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -72 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009AFB9B069B189B1A9B1F9B229B239B259B279B289B299B2A9B2E9B2F9B32 -9B449B439B4F9B4D9B4E9B519B589B749B939B839B919B969B979B9F9BA09BA8 -9BB49BC09BCA9BB99BC69BCF9BD19BD29BE39BE29BE49BD49BE19C3A9BF29BF1 -9BF09C159C149C099C139C0C9C069C089C129C0A9C049C2E9C1B9C259C249C21 -9C309C479C329C469C3E9C5A9C609C679C769C789CE79CEC9CF09D099D089CEB -9D039D069D2A9D269DAF9D239D1F9D449D159D129D419D3F9D3E9D469D480000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -73 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009D5D9D5E9D649D519D509D599D729D899D879DAB9D6F9D7A9D9A9DA49DA9 -9DB29DC49DC19DBB9DB89DBA9DC69DCF9DC29DD99DD39DF89DE69DED9DEF9DFD -9E1A9E1B9E1E9E759E799E7D9E819E889E8B9E8C9E929E959E919E9D9EA59EA9 -9EB89EAA9EAD97619ECC9ECE9ECF9ED09ED49EDC9EDE9EDD9EE09EE59EE89EEF -9EF49EF69EF79EF99EFB9EFC9EFD9F079F0876B79F159F219F2C9F3E9F4A9F52 -9F549F639F5F9F609F619F669F679F6C9F6A9F779F729F769F959F9C9FA00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000582F69C79059746451DC7199000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/jis0212.enc b/library/encoding/jis0212.enc deleted file mode 100644 index cddbbba..0000000 --- a/library/encoding/jis0212.enc +++ /dev/null @@ -1,1159 +0,0 @@ -# Encoding file: jis0212, double-byte -D -2244 0 68 -22 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000002D8 -02C700B802D902DD00AF02DB02DA007E03840385000000000000000000000000 -0000000000A100A600BF00000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000BA00AA00A900AE2122 -00A4211600000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -26 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000038603880389038A03AA0000038C0000038E03AB0000038F000000000000 -000003AC03AD03AE03AF03CA039003CC03C203CD03CB03B003CE000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -27 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000004020403040404050406040704080409040A040B040C040E040F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000004520453045404550456045704580459045A045B045C045E045F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -29 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000C60110000001260000013200000141013F0000014A00D8015200000166 -00DE000000000000000000000000000000000000000000000000000000000000 -000000E6011100F00127013101330138014201400149014B00F8015300DF0167 -00FE000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -2A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000C100C000C400C2010201CD0100010400C500C301060108010C00C7010A -010E00C900C800CB00CA011A0116011201180000011C011E01220120012400CD -00CC00CF00CE01CF0130012A012E0128013401360139013D013B014301470145 -00D100D300D200D600D401D10150014C00D5015401580156015A015C0160015E -0164016200DA00D900DC00DB016C01D30170016A0172016E016801D701DB01D9 -01D5017400DD017801760179017D017B00000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -2B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000E100E000E400E2010301CE0101010500E500E301070109010D00E7010B -010F00E900E800EB00EA011B01170113011901F5011D011F00000121012500ED -00EC00EF00EE01D00000012B012F012901350137013A013E013C014401480146 -00F100F300F200F600F401D20151014D00F5015501590157015B015D0161015F -0165016300FA00F900FC00FB016D01D40171016B0173016F016901D801DC01DA -01D6017500FD00FF0177017A017E017C00000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E024E044E054E0C4E124E1F4E234E244E284E2B4E2E4E2F4E304E354E40 -4E414E444E474E514E5A4E5C4E634E684E694E744E754E794E7F4E8D4E964E97 -4E9D4EAF4EB94EC34ED04EDA4EDB4EE04EE14EE24EE84EEF4EF14EF34EF54EFD -4EFE4EFF4F004F024F034F084F0B4F0C4F124F154F164F174F194F2E4F314F60 -4F334F354F374F394F3B4F3E4F404F424F484F494F4B4F4C4F524F544F564F58 -4F5F4F634F6A4F6C4F6E4F714F774F784F794F7A4F7D4F7E4F814F824F840000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -31 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F854F894F8A4F8C4F8E4F904F924F934F944F974F994F9A4F9E4F9F4FB2 -4FB74FB94FBB4FBC4FBD4FBE4FC04FC14FC54FC64FC84FC94FCB4FCC4FCD4FCF -4FD24FDC4FE04FE24FF04FF24FFC4FFD4FFF5000500150045007500A500C500E -5010501350175018501B501C501D501E50225027502E50305032503350355040 -5041504250455046504A504C504E50515052505350575059505F506050625063 -50665067506A506D50705071503B5081508350845086508A508E508F50900000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -32 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005092509350945096509B509C509E509F50A050A150A250AA50AF50B050B9 -50BA50BD50C050C350C450C750CC50CE50D050D350D450D850DC50DD50DF50E2 -50E450E650E850E950EF50F150F650FA50FE5103510651075108510B510C510D -510E50F2511051175119511B511C511D511E512351275128512C512D512F5131 -513351345135513851395142514A514F5153515551575158515F51645166517E -51835184518B518E5198519D51A151A351AD51B851BA51BC51BE51BF51C20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -33 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000051C851CF51D151D251D351D551D851DE51E251E551EE51F251F351F451F7 -5201520252055212521352155216521852225228523152325235523C52455249 -525552575258525A525C525F526052615266526E527752785279528052825285 -528A528C52935295529652975298529A529C52A452A552A652A752AF52B052B6 -52B752B852BA52BB52BD52C052C452C652C852CC52CF52D152D452D652DB52DC -52E152E552E852E952EA52EC52F052F152F452F652F753005303530A530B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -34 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000530C531153135318531B531C531E531F5325532753285329532B532C532D -533053325335533C533D533E5342534C534B5359535B536153635365536C536D -53725379537E538353875388538E539353945399539D53A153A453AA53AB53AF -53B253B453B553B753B853BA53BD53C053C553CF53D253D353D553DA53DD53DE -53E053E653E753F554025413541A542154275428542A542F5431543454355443 -54445447544D544F545E54625464546654675469546B546D546E5474547F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -35 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054815483548554885489548D549154955496549C549F54A154A654A754A9 -54AA54AD54AE54B154B754B954BA54BB54BF54C654CA54CD54CE54E054EA54EC -54EF54F654FC54FE54FF55005501550555085509550C550D550E5515552A552B -553255355536553B553C553D554155475549554A554D555055515558555A555B -555E5560556155645566557F5581558255865588558E558F5591559255935594 -559755A355A455AD55B255BF55C155C355C655C955CB55CC55CE55D155D20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -36 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000055D355D755D855DB55DE55E255E955F655FF56055608560A560D560E560F -5610561156125619562C56305633563556375639563B563C563D563F56405641 -5643564456465649564B564D564F5654565E566056615662566356665669566D -566F567156725675568456855688568B568C56955699569A569D569E569F56A6 -56A756A856A956AB56AC56AD56B156B356B756BE56C556C956CA56CB56CF56D0 -56CC56CD56D956DC56DD56DF56E156E456E556E656E756E856F156EB56ED0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -37 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000056F656F7570157025707570A570C57115715571A571B571D572057225723 -572457255729572A572C572E572F57335734573D573E573F57455746574C574D -57525762576557675768576B576D576E576F5770577157735774577557775779 -577A577B577C577E57815783578C579457975799579A579C579D579E579F57A1 -579557A757A857A957AC57B857BD57C757C857CC57CF57D557DD57DE57E457E6 -57E757E957ED57F057F557F657F857FD57FE57FF580358045808580957E10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -38 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000580C580D581B581E581F582058265827582D58325839583F5849584C584D -584F58505855585F58615864586758685878587C587F58805881588758885889 -588A588C588D588F589058945896589D58A058A158A258A658A958B158B258C4 -58BC58C258C858CD58CE58D058D258D458D658DA58DD58E158E258E958F35905 -5906590B590C5912591359148641591D5921592359245928592F593059335935 -5936593F59435946595259535959595B595D595E595F59615963596B596D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -39 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000596F5972597559765979597B597C598B598C598E599259955997599F59A4 -59A759AD59AE59AF59B059B359B759BA59BC59C159C359C459C859CA59CD59D2 -59DD59DE59DF59E359E459E759EE59EF59F159F259F459F75A005A045A0C5A0D -5A0E5A125A135A1E5A235A245A275A285A2A5A2D5A305A445A455A475A485A4C -5A505A555A5E5A635A655A675A6D5A775A7A5A7B5A7E5A8B5A905A935A965A99 -5A9C5A9E5A9F5AA05AA25AA75AAC5AB15AB25AB35AB55AB85ABA5ABB5ABF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005AC45AC65AC85ACF5ADA5ADC5AE05AE55AEA5AEE5AF55AF65AFD5B005B01 -5B085B175B345B195B1B5B1D5B215B255B2D5B385B415B4B5B4C5B525B565B5E -5B685B6E5B6F5B7C5B7D5B7E5B7F5B815B845B865B8A5B8E5B905B915B935B94 -5B965BA85BA95BAC5BAD5BAF5BB15BB25BB75BBA5BBC5BC05BC15BCD5BCF5BD6 -5BD75BD85BD95BDA5BE05BEF5BF15BF45BFD5C0C5C175C1E5C1F5C235C265C29 -5C2B5C2C5C2E5C305C325C355C365C595C5A5C5C5C625C635C675C685C690000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005C6D5C705C745C755C7A5C7B5C7C5C7D5C875C885C8A5C8F5C925C9D5C9F -5CA05CA25CA35CA65CAA5CB25CB45CB55CBA5CC95CCB5CD25CDD5CD75CEE5CF1 -5CF25CF45D015D065D0D5D125D2B5D235D245D265D275D315D345D395D3D5D3F -5D425D435D465D485D555D515D595D4A5D5F5D605D615D625D645D6A5D6D5D70 -5D795D7A5D7E5D7F5D815D835D885D8A5D925D935D945D955D995D9B5D9F5DA0 -5DA75DAB5DB05DB45DB85DB95DC35DC75DCB5DD05DCE5DD85DD95DE05DE40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005DE95DF85DF95E005E075E0D5E125E145E155E185E1F5E205E2E5E285E32 -5E355E3E5E4B5E505E495E515E565E585E5B5E5C5E5E5E685E6A5E6B5E6C5E6D -5E6E5E705E805E8B5E8E5EA25EA45EA55EA85EAA5EAC5EB15EB35EBD5EBE5EBF -5EC65ECC5ECB5ECE5ED15ED25ED45ED55EDC5EDE5EE55EEB5F025F065F075F08 -5F0E5F195F1C5F1D5F215F225F235F245F285F2B5F2C5F2E5F305F345F365F3B -5F3D5F3F5F405F445F455F475F4D5F505F545F585F5B5F605F635F645F670000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F6F5F725F745F755F785F7A5F7D5F7E5F895F8D5F8F5F965F9C5F9D5FA2 -5FA75FAB5FA45FAC5FAF5FB05FB15FB85FC45FC75FC85FC95FCB5FD05FD15FD2 -5FD35FD45FDE5FE15FE25FE85FE95FEA5FEC5FED5FEE5FEF5FF25FF35FF65FFA -5FFC6007600A600D6013601460176018601A601F6024602D6033603560406047 -60486049604C6051605460566057605D606160676071607E607F608260866088 -608A608E6091609360956098609D609E60A260A460A560A860B060B160B70000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000060BB60BE60C260C460C860C960CA60CB60CE60CF60D460D560D960DB60DD -60DE60E260E560F260F560F860FC60FD61026107610A610C6110611161126113 -6114611661176119611C611E6122612A612B6130613161356136613761396141 -614561466149615E6160616C61726178617B617C617F6180618161836184618B -618D6192619361976198619C619D619F61A061A561A861AA61AD61B861B961BC -61C061C161C261CE61CF61D561DC61DD61DE61DF61E161E261E761E961E50000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000061EC61ED61EF620162036204620762136215621C62206222622362276229 -622B6239623D6242624362446246624C62506251625262546256625A625C6264 -626D626F6273627A627D628D628E628F629062A662A862B362B662B762BA62BE -62BF62C462CE62D562D662DA62EA62F262F462FC62FD63036304630A630B630D -63106313631663186329632A632D633563366339633C63416342634363446346 -634A634B634E6352635363546358635B63656366636C636D6371637463750000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -40 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006378637C637D637F638263846387638A6390639463956399639A639E63A4 -63A663AD63AE63AF63BD63C163C563C863CE63D163D363D463D563DC63E063E5 -63EA63EC63F263F363F563F863F96409640A6410641264146418641E64206422 -642464256429642A642F64306435643D643F644B644F6451645264536454645A -645B645C645D645F646064616463646D64736474647B647D64856487648F6490 -649164986499649B649D649F64A164A364A664A864AC64B364BD64BE64BF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -41 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000064C464C964CA64CB64CC64CE64D064D164D564D764E464E564E964EA64ED -64F064F564F764FB64FF6501650465086509650A650F6513651465166519651B -651E651F652265266529652E6531653A653C653D654365476549655065526554 -655F65606567656B657A657D65816585658A659265956598659D65A065A365A6 -65AE65B265B365B465BF65C265C865C965CE65D065D465D665D865DF65F065F2 -65F465F565F965FE65FF6600660466086609660D6611661266156616661D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -42 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000661E662166226623662466266629662A662B662C662E6630663166336639 -6637664066456646664A664C6651664E665766586659665B665C6660666166FB -666A666B666C667E66736675667F667766786679667B6680667C668B668C668D -669066926699669A669B669C669F66A066A466AD66B166B266B566BB66BF66C0 -66C266C366C866CC66CE66CF66D466DB66DF66E866EB66EC66EE66FA67056707 -670E67136719671C672067226733673E674567476748674C67546755675D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -43 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006766676C676E67746776677B67816784678E678F67916793679667986799 -679B67B067B167B267B567BB67BC67BD67F967C067C267C367C567C867C967D2 -67D767D967DC67E167E667F067F267F667F7685268146819681D681F68286827 -682C682D682F683068316833683B683F68446845684A684C685568576858685B -686B686E686F68706871687268756879687A687B687C68826884688668886896 -6898689A689C68A168A368A568A968AA68AE68B268BB68C568C868CC68CF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -44 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068D068D168D368D668D968DC68DD68E568E868EA68EB68EC68ED68F068F1 -68F568F668FB68FC68FD69066909690A69106911691369166917693169336935 -6938693B694269456949694E6957695B696369646965696669686969696C6970 -69716972697A697B697F6980698D69926996699869A169A569A669A869AB69AD -69AF69B769B869BA69BC69C569C869D169D669D769E269E569EE69EF69F169F3 -69F569FE6A006A016A036A0F6A116A156A1A6A1D6A206A246A286A306A320000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -45 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006A346A376A3B6A3E6A3F6A456A466A496A4A6A4E6A506A516A526A556A56 -6A5B6A646A676A6A6A716A736A7E6A816A836A866A876A896A8B6A916A9B6A9D -6A9E6A9F6AA56AAB6AAF6AB06AB16AB46ABD6ABE6ABF6AC66AC96AC86ACC6AD0 -6AD46AD56AD66ADC6ADD6AE46AE76AEC6AF06AF16AF26AFC6AFD6B026B036B06 -6B076B096B0F6B106B116B176B1B6B1E6B246B286B2B6B2C6B2F6B356B366B3B -6B3F6B466B4A6B4D6B526B566B586B5D6B606B676B6B6B6E6B706B756B7D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -46 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006B7E6B826B856B976B9B6B9F6BA06BA26BA36BA86BA96BAC6BAD6BAE6BB0 -6BB86BB96BBD6BBE6BC36BC46BC96BCC6BD66BDA6BE16BE36BE66BE76BEE6BF1 -6BF76BF96BFF6C026C046C056C096C0D6C0E6C106C126C196C1F6C266C276C28 -6C2C6C2E6C336C356C366C3A6C3B6C3F6C4A6C4B6C4D6C4F6C526C546C596C5B -6C5C6C6B6C6D6C6F6C746C766C786C796C7B6C856C866C876C896C946C956C97 -6C986C9C6C9F6CB06CB26CB46CC26CC66CCD6CCF6CD06CD16CD26CD46CD60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -47 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006CDA6CDC6CE06CE76CE96CEB6CEC6CEE6CF26CF46D046D076D0A6D0E6D0F -6D116D136D1A6D266D276D286C676D2E6D2F6D316D396D3C6D3F6D576D5E6D5F -6D616D656D676D6F6D706D7C6D826D876D916D926D946D966D976D986DAA6DAC -6DB46DB76DB96DBD6DBF6DC46DC86DCA6DCE6DCF6DD66DDB6DDD6DDF6DE06DE2 -6DE56DE96DEF6DF06DF46DF66DFC6E006E046E1E6E226E276E326E366E396E3B -6E3C6E446E456E486E496E4B6E4F6E516E526E536E546E576E5C6E5D6E5E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -48 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006E626E636E686E736E7B6E7D6E8D6E936E996EA06EA76EAD6EAE6EB16EB3 -6EBB6EBF6EC06EC16EC36EC76EC86ECA6ECD6ECE6ECF6EEB6EED6EEE6EF96EFB -6EFD6F046F086F0A6F0C6F0D6F166F186F1A6F1B6F266F296F2A6F2F6F306F33 -6F366F3B6F3C6F2D6F4F6F516F526F536F576F596F5A6F5D6F5E6F616F626F68 -6F6C6F7D6F7E6F836F876F886F8B6F8C6F8D6F906F926F936F946F966F9A6F9F -6FA06FA56FA66FA76FA86FAE6FAF6FB06FB56FB66FBC6FC56FC76FC86FCA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -49 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006FDA6FDE6FE86FE96FF06FF56FF96FFC6FFD7000700570067007700D7017 -70207023702F703470377039703C7043704470487049704A704B70547055705D -705E704E70647065706C706E70757076707E7081708570867094709570967097 -7098709B70A470AB70B070B170B470B770CA70D170D370D470D570D670D870DC -70E470FA71037104710571067107710B710C710F711E7120712B712D712F7130 -713171387141714571467147714A714B715071527157715A715C715E71600000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000071687179718071857187718C7192719A719B71A071A271AF71B071B271B3 -71BA71BF71C071C171C471CB71CC71D371D671D971DA71DC71F871FE72007207 -7208720972137217721A721D721F7224722B722F723472387239724172427243 -7245724E724F7250725372557256725A725C725E726072637268726B726E726F -727172777278727B727C727F72847289728D728E7293729B72A872AD72AE72B1 -72B472BE72C172C772C972CC72D572D672D872DF72E572F372F472FA72FB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000072FE7302730473057307730B730D7312731373187319731E732273247327 -7328732C733173327335733A733B733D7343734D7350735273567358735D735E -735F7360736673677369736B736C736E736F737173777379737C738073817383 -73857386738E73907393739573977398739C739E739F73A073A273A573A673AA -73AB73AD73B573B773B973BC73BD73BF73C573C673C973CB73CC73CF73D273D3 -73D673D973DD73E173E373E673E773E973F473F573F773F973FA73FB73FD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000073FF7400740174047407740A7411741A741B7424742674287429742A742B -742C742D742E742F74307431743974407443744474467447744B744D74517452 -7457745D7462746674677468746B746D746E7471747274807481748574867487 -7489748F74907491749274987499749A749C749F74A074A174A374A674A874A9 -74AA74AB74AE74AF74B174B274B574B974BB74BF74C874C974CC74D074D374D8 -74DA74DB74DE74DF74E474E874EA74EB74EF74F474FA74FB74FC74FF75060000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000075127516751775207521752475277529752A752F75367539753D753E753F -7540754375477548754E755075527557755E755F7561756F75717579757A757B -757C757D757E7581758575907592759375957599759C75A275A475B475BA75BF -75C075C175C475C675CC75CE75CF75D775DC75DF75E075E175E475E775EC75EE -75EF75F175F9760076027603760476077608760A760C760F7612761376157616 -7619761B761C761D761E7623762576267629762D763276337635763876390000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000763A763C764A764076417643764476457649764B76557659765F76647665 -766D766E766F7671767476817685768C768D7695769B769C769D769F76A076A2 -76A376A476A576A676A776A876AA76AD76BD76C176C576C976CB76CC76CE76D4 -76D976E076E676E876EC76F076F176F676F976FC77007706770A770E77127714 -771577177719771A771C77227728772D772E772F7734773577367739773D773E -774277457746774A774D774E774F775277567757775C775E775F776077620000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077647767776A776C7770777277737774777A777D77807784778C778D7794 -77957796779A779F77A277A777AA77AE77AF77B177B577BE77C377C977D177D2 -77D577D977DE77DF77E077E477E677EA77EC77F077F177F477F877FB78057806 -7809780D780E7811781D782178227823782D782E783078357837784378447847 -7848784C784E7852785C785E78607861786378647868786A786E787A787E788A -788F7894789878A1789D789E789F78A478A878AC78AD78B078B178B278B30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000078BB78BD78BF78C778C878C978CC78CE78D278D378D578D678E478DB78DF -78E078E178E678EA78F278F3790078F678F778FA78FB78FF7906790C7910791A -791C791E791F7920792579277929792D793179347935793B793D793F79447945 -7946794A794B794F795179547958795B795C79677969796B79727979797B797C -797E798B798C799179937994799579967998799B799C79A179A879A979AB79AF -79B179B479B879BB79C279C479C779C879CA79CF79D479D679DA79DD79DE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -51 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000079E079E279E579EA79EB79ED79F179F879FC7A027A037A077A097A0A7A0C -7A117A157A1B7A1E7A217A277A2B7A2D7A2F7A307A347A357A387A397A3A7A44 -7A457A477A487A4C7A557A567A597A5C7A5D7A5F7A607A657A677A6A7A6D7A75 -7A787A7E7A807A827A857A867A8A7A8B7A907A917A947A9E7AA07AA37AAC7AB3 -7AB57AB97ABB7ABC7AC67AC97ACC7ACE7AD17ADB7AE87AE97AEB7AEC7AF17AF4 -7AFB7AFD7AFE7B077B147B1F7B237B277B297B2A7B2B7B2D7B2E7B2F7B300000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -52 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007B317B347B3D7B3F7B407B417B477B4E7B557B607B647B667B697B6A7B6D -7B6F7B727B737B777B847B897B8E7B907B917B967B9B7B9E7BA07BA57BAC7BAF -7BB07BB27BB57BB67BBA7BBB7BBC7BBD7BC27BC57BC87BCA7BD47BD67BD77BD9 -7BDA7BDB7BE87BEA7BF27BF47BF57BF87BF97BFA7BFC7BFE7C017C027C037C04 -7C067C097C0B7C0C7C0E7C0F7C197C1B7C207C257C267C287C2C7C317C337C34 -7C367C397C3A7C467C4A7C557C517C527C537C597C5A7C5B7C5C7C5D7C5E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007C617C637C677C697C6D7C6E7C707C727C797C7C7C7D7C867C877C8F7C94 -7C9E7CA07CA67CB07CB67CB77CBA7CBB7CBC7CBF7CC47CC77CC87CC97CCD7CCF -7CD37CD47CD57CD77CD97CDA7CDD7CE67CE97CEB7CF57D037D077D087D097D0F -7D117D127D137D167D1D7D1E7D237D267D2A7D2D7D317D3C7D3D7D3E7D407D41 -7D477D487D4D7D517D537D577D597D5A7D5C7D5D7D657D677D6A7D707D787D7A -7D7B7D7F7D817D827D837D857D867D887D8B7D8C7D8D7D917D967D977D9D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007D9E7DA67DA77DAA7DB37DB67DB77DB97DC27DC37DC47DC57DC67DCC7DCD -7DCE7DD77DD97E007DE27DE57DE67DEA7DEB7DED7DF17DF57DF67DF97DFA7E08 -7E107E117E157E177E1C7E1D7E207E277E287E2C7E2D7E2F7E337E367E3F7E44 -7E457E477E4E7E507E527E587E5F7E617E627E657E6B7E6E7E6F7E737E787E7E -7E817E867E877E8A7E8D7E917E957E987E9A7E9D7E9E7F3C7F3B7F3D7F3E7F3F -7F437F447F477F4F7F527F537F5B7F5C7F5D7F617F637F647F657F667F6D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -55 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007F717F7D7F7E7F7F7F807F8B7F8D7F8F7F907F917F967F977F9C7FA17FA2 -7FA67FAA7FAD7FB47FBC7FBF7FC07FC37FC87FCE7FCF7FDB7FDF7FE37FE57FE8 -7FEC7FEE7FEF7FF27FFA7FFD7FFE7FFF80078008800A800D800E800F80118013 -80148016801D801E801F802080248026802C802E80308034803580378039803A -803C803E80408044806080648066806D8071807580818088808E809C809E80A6 -80A780AB80B880B980C880CD80CF80D280D480D580D780D880E080ED80EE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -56 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000080F080F280F380F680F980FA80FE8103810B811681178118811C811E8120 -81248127812C81308135813A813C81458147814A814C81528157816081618167 -81688169816D816F817781818190818481858186818B818E81968198819B819E -81A281AE81B281B481BB81CB81C381C581CA81CE81CF81D581D781DB81DD81DE -81E181E481EB81EC81F081F181F281F581F681F881F981FD81FF82008203820F -821382148219821A821D82218222822882328234823A82438244824582460000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -57 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000824B824E824F82518256825C826082638267826D8274827B827D827F8280 -82818283828482878289828A828E8291829482968298829A829B82A082A182A3 -82A482A782A882A982AA82AE82B082B282B482B782BA82BC82BE82BF82C682D0 -82D582DA82E082E282E482E882EA82ED82EF82F682F782FD82FE830083018307 -8308830A830B8354831B831D831E831F83218322832C832D832E833083338337 -833A833C833D8342834383448347834D834E8351835583568357837083780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -58 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000837D837F8380838283848386838D83928394839583988399839B839C839D -83A683A783A983AC83BE83BF83C083C783C983CF83D083D183D483DD835383E8 -83EA83F683F883F983FC84018406840A840F84118415841983AD842F84398445 -84478448844A844D844F84518452845684588459845A845C8460846484658467 -846A84708473847484768478847C847D84818485849284938495849E84A684A8 -84A984AA84AF84B184B484BA84BD84BE84C084C284C784C884CC84CF84D30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000084DC84E784EA84EF84F084F184F284F7853284FA84FB84FD850285038507 -850C850E8510851C851E85228523852485258527852A852B852F853385348536 -853F8546854F855085518552855385568559855C855D855E855F856085618562 -8564856B856F8579857A857B857D857F8581858585868589858B858C858F8593 -8598859D859F85A085A285A585A785B485B685B785B885BC85BD85BE85BF85C2 -85C785CA85CB85CE85AD85D885DA85DF85E085E685E885ED85F385F685FC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000085FF860086048605860D860E86108611861286188619861B861E86218627 -862986368638863A863C863D864086428646865286538656865786588659865D -866086618662866386648669866C866F867586768677867A868D869186968698 -869A869C86A186A686A786A886AD86B186B386B486B586B786B886B986BF86C0 -86C186C386C586D186D286D586D786DA86DC86E086E386E586E7868886FA86FC -86FD870487058707870B870E870F8710871387148719871E871F872187230000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008728872E872F873187328739873A873C873D873E874087438745874D8758 -875D876187648765876F87718772877B8783878487858786878787888789878B -878C879087938795879787988799879E87A087A387A787AC87AD87AE87B187B5 -87BE87BF87C187C887C987CA87CE87D587D687D987DA87DC87DF87E287E387E4 -87EA87EB87ED87F187F387F887FA87FF8801880388068809880A880B88108819 -8812881388148818881A881B881C881E881F8828882D882E8830883288350000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000883A883C88418843884588488849884A884B884E8851885588568858885A -885C885F88608864886988718879887B88808898889A889B889C889F88A088A8 -88AA88BA88BD88BE88C088CA88CB88CC88CD88CE88D188D288D388DB88DE88E7 -88EF88F088F188F588F789018906890D890E890F8915891689188919891A891C -892089268927892889308931893289358939893A893E89408942894589468949 -894F89528957895A895B895C896189628963896B896E897089738975897A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000897B897C897D8989898D899089948995899B899C899F89A089A589B089B4 -89B589B689B789BC89D489D589D689D789D889E589E989EB89ED89F189F389F6 -89F989FD89FF8A048A058A078A0F8A118A128A148A158A1E8A208A228A248A26 -8A2B8A2C8A2F8A358A378A3D8A3E8A408A438A458A478A498A4D8A4E8A538A56 -8A578A588A5C8A5D8A618A658A678A758A768A778A798A7A8A7B8A7E8A7F8A80 -8A838A868A8B8A8F8A908A928A968A978A998A9F8AA78AA98AAE8AAF8AB30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008AB68AB78ABB8ABE8AC38AC68AC88AC98ACA8AD18AD38AD48AD58AD78ADD -8ADF8AEC8AF08AF48AF58AF68AFC8AFF8B058B068B0B8B118B1C8B1E8B1F8B0A -8B2D8B308B378B3C8B428B438B448B458B468B488B528B538B548B598B4D8B5E -8B638B6D8B768B788B798B7C8B7E8B818B848B858B8B8B8D8B8F8B948B958B9C -8B9E8B9F8C388C398C3D8C3E8C458C478C498C4B8C4F8C518C538C548C578C58 -8C5B8C5D8C598C638C648C668C688C698C6D8C738C758C768C7B8C7E8C860000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008C878C8B8C908C928C938C998C9B8C9C8CA48CB98CBA8CC58CC68CC98CCB -8CCF8CD68CD58CD98CDD8CE18CE88CEC8CEF8CF08CF28CF58CF78CF88CFE8CFF -8D018D038D098D128D178D1B8D658D698D6C8D6E8D7F8D828D848D888D8D8D90 -8D918D958D9E8D9F8DA08DA68DAB8DAC8DAF8DB28DB58DB78DB98DBB8DC08DC5 -8DC68DC78DC88DCA8DCE8DD18DD48DD58DD78DD98DE48DE58DE78DEC8DF08DBC -8DF18DF28DF48DFD8E018E048E058E068E0B8E118E148E168E208E218E220000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -60 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008E238E268E278E318E338E368E378E388E398E3D8E408E418E4B8E4D8E4E -8E4F8E548E5B8E5C8E5D8E5E8E618E628E698E6C8E6D8E6F8E708E718E798E7A -8E7B8E828E838E898E908E928E958E9A8E9B8E9D8E9E8EA28EA78EA98EAD8EAE -8EB38EB58EBA8EBB8EC08EC18EC38EC48EC78ECF8ED18ED48EDC8EE88EEE8EF0 -8EF18EF78EF98EFA8EED8F008F028F078F088F0F8F108F168F178F188F1E8F20 -8F218F238F258F278F288F2C8F2D8F2E8F348F358F368F378F3A8F408F410000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -61 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008F438F478F4F8F518F528F538F548F558F588F5D8F5E8F658F9D8FA08FA1 -8FA48FA58FA68FB58FB68FB88FBE8FC08FC18FC68FCA8FCB8FCD8FD08FD28FD3 -8FD58FE08FE38FE48FE88FEE8FF18FF58FF68FFB8FFE900290049008900C9018 -901B90289029902F902A902C902D903390349037903F90439044904C905B905D -906290669067906C90709074907990859088908B908C908E9090909590979098 -9099909B90A090A190A290A590B090B290B390B490B690BD90CC90BE90C30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000090C490C590C790C890D590D790D890D990DC90DD90DF90E590D290F690EB -90EF90F090F490FE90FF91009104910591069108910D91109114911691179118 -911A911C911E912091259122912391279129912E912F91319134913691379139 -913A913C913D914391479148914F915391579159915A915B916191649167916D -91749179917A917B9181918391859186918A918E91919193919491959198919E -91A191A691A891AC91AD91AE91B091B191B291B391B691BB91BC91BD91BF0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000091C291C391C591D391D491D791D991DA91DE91E491E591E991EA91EC91ED -91EE91EF91F091F191F791F991FB91FD9200920192049205920692079209920A -920C92109212921392169218921C921D92239224922592269228922E922F9230 -92339235923692389239923A923C923E92409242924392469247924A924D924E -924F925192589259925C925D926092619265926792689269926E926F92709275 -9276927792789279927B927C927D927F92889289928A928D928E929292970000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -64 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009299929F92A092A492A592A792A892AB92AF92B292B692B892BA92BB92BC -92BD92BF92C092C192C292C392C592C692C792C892CB92CC92CD92CE92D092D3 -92D592D792D892D992DC92DD92DF92E092E192E392E592E792E892EC92EE92F0 -92F992FB92FF930093029308930D931193149315931C931D931E931F93219324 -932593279329932A933393349336933793479348934993509351935293559357 -9358935A935E9364936593679369936A936D936F937093719373937493760000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -65 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000937A937D937F9380938193829388938A938B938D938F939293959398939B -939E93A193A393A493A693A893AB93B493B593B693BA93A993C193C493C593C6 -93C793C993CA93CB93CC93CD93D393D993DC93DE93DF93E293E693E793F993F7 -93F893FA93FB93FD94019402940494089409940D940E940F941594169417941F -942E942F9431943294339434943B943F943D944394459448944A944C94559459 -945C945F946194639468946B946D946E946F9471947294849483957895790000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -66 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000957E95849588958C958D958E959D959E959F95A195A695A995AB95AC95B4 -95B695BA95BD95BF95C695C895C995CB95D095D195D295D395D995DA95DD95DE -95DF95E095E495E6961D961E9622962496259626962C96319633963796389639 -963A963C963D9641965296549656965796589661966E9674967B967C967E967F -9681968296839684968996919696969A969D969F96A496A596A696A996AE96AF -96B396BA96CA96D25DB296D896DA96DD96DE96DF96E996EF96F196FA97020000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000970397059709971A971B971D97219722972397289731973397419743974A -974E974F975597579758975A975B97639767976A976E9773977697779778977B -977D977F978097899795979697979799979A979E979F97A297AC97AE97B197B2 -97B597B697B897B997BA97BC97BE97BF97C197C497C597C797C997CA97CC97CD -97CE97D097D197D497D797D897D997DD97DE97E097DB97E197E497EF97F197F4 -97F797F897FA9807980A9819980D980E98149816981C981E9820982398260000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -68 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000982B982E982F98309832983398359825983E98449847984A985198529853 -985698579859985A9862986398659866986A986C98AB98AD98AE98B098B498B7 -98B898BA98BB98BF98C298C598C898CC98E198E398E598E698E798EA98F398F6 -9902990799089911991599169917991A991B991C991F992299269927992B9931 -99329933993499359939993A993B993C99409941994699479948994D994E9954 -99589959995B995C995E995F9960999B999D999F99A699B099B199B299B50000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -69 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000099B999BA99BD99BF99C399C999D399D499D999DA99DC99DE99E799EA99EB -99EC99F099F499F599F999FD99FE9A029A039A049A0B9A0C9A109A119A169A1E -9A209A229A239A249A279A2D9A2E9A339A359A369A389A479A419A449A4A9A4B -9A4C9A4E9A519A549A569A5D9AAA9AAC9AAE9AAF9AB29AB49AB59AB69AB99ABB -9ABE9ABF9AC19AC39AC69AC89ACE9AD09AD29AD59AD69AD79ADB9ADC9AE09AE4 -9AE59AE79AE99AEC9AF29AF39AF59AF99AFA9AFD9AFF9B009B019B029B030000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009B049B059B089B099B0B9B0C9B0D9B0E9B109B129B169B199B1B9B1C9B20 -9B269B2B9B2D9B339B349B359B379B399B3A9B3D9B489B4B9B4C9B559B569B57 -9B5B9B5E9B619B639B659B669B689B6A9B6B9B6C9B6D9B6E9B739B759B779B78 -9B799B7F9B809B849B859B869B879B899B8A9B8B9B8D9B8F9B909B949B9A9B9D -9B9E9BA69BA79BA99BAC9BB09BB19BB29BB79BB89BBB9BBC9BBE9BBF9BC19BC7 -9BC89BCE9BD09BD79BD89BDD9BDF9BE59BE79BEA9BEB9BEF9BF39BF79BF80000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009BF99BFA9BFD9BFF9C009C029C0B9C0F9C119C169C189C199C1A9C1C9C1E -9C229C239C269C279C289C299C2A9C319C359C369C379C3D9C419C439C449C45 -9C499C4A9C4E9C4F9C509C539C549C569C589C5B9C5D9C5E9C5F9C639C699C6A -9C5C9C6B9C689C6E9C709C729C759C779C7B9CE69CF29CF79CF99D0B9D029D11 -9D179D189D1C9D1D9D1E9D2F9D309D329D339D349D3A9D3C9D459D3D9D429D43 -9D479D4A9D539D549D5F9D639D629D659D699D6A9D6B9D709D769D779D7B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009D7C9D7E9D839D849D869D8A9D8D9D8E9D929D939D959D969D979D989DA1 -9DAA9DAC9DAE9DB19DB59DB99DBC9DBF9DC39DC79DC99DCA9DD49DD59DD69DD7 -9DDA9DDE9DDF9DE09DE59DE79DE99DEB9DEE9DF09DF39DF49DFE9E0A9E029E07 -9E0E9E109E119E129E159E169E199E1C9E1D9E7A9E7B9E7C9E809E829E839E84 -9E859E879E8E9E8F9E969E989E9B9E9E9EA49EA89EAC9EAE9EAF9EB09EB39EB4 -9EB59EC69EC89ECB9ED59EDF9EE49EE79EEC9EED9EEE9EF09EF19EF29EF50000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009EF89EFF9F029F039F099F0F9F109F119F129F149F169F179F199F1A9F1B -9F1F9F229F269F2A9F2B9F2F9F319F329F349F379F399F3A9F3C9F3D9F3F9F41 -9F439F449F459F469F479F539F559F569F579F589F5A9F5D9F5E9F689F699F6D -9F6E9F6F9F709F719F739F759F7A9F7D9F8F9F909F919F929F949F969F979F9E -9FA19FA29FA39FA5000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/ksc5601.enc b/library/encoding/ksc5601.enc deleted file mode 100644 index bec61d0..0000000 --- a/library/encoding/ksc5601.enc +++ /dev/null @@ -1,1516 +0,0 @@ -# Encoding file: ksc5601, double-byte -D -233F 0 89 -21 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030003001300200B72025202600A8300300AD20152225FF3C223C20182019 -201C201D3014301530083009300A300B300C300D300E300F3010301100B100D7 -00F7226022642265221E223400B0203220332103212BFFE0FFE1FFE526422640 -222022A52312220222072261225200A7203B2606260525CB25CF25CE25C725C6 -25A125A025B325B225BD25BC219221902191219321943013226A226B221A223D -221D2235222B222C2208220B2286228722822283222A222922272228FFE20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -22 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000021D221D42200220300B4FF5E02C702D802DD02DA02D900B802DB00A100BF -02D0222E2211220F00A42109203025C125C025B725B626642660266126652667 -2663229925C825A325D025D1259225A425A525A825A725A625A92668260F260E -261C261E00B62020202121952197219921962198266D2669266A266C327F321C -211633C7212233C233D821210000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -23 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF01FF02FF03FF04FF05FF06FF07FF08FF09FF0AFF0BFF0CFF0DFF0EFF0F -FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19FF1AFF1BFF1CFF1DFF1EFF1F -FF20FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F -FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF3BFFE6FF3DFF3EFF3F -FF40FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5AFF5BFF5CFF5DFFE30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -24 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000313131323133313431353136313731383139313A313B313C313D313E313F -3140314131423143314431453146314731483149314A314B314C314D314E314F -3150315131523153315431553156315731583159315A315B315C315D315E315F -3160316131623163316431653166316731683169316A316B316C316D316E316F -3170317131723173317431753176317731783179317A317B317C317D317E317F -3180318131823183318431853186318731883189318A318B318C318D318E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -25 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000217021712172217321742175217621772178217900000000000000000000 -2160216121622163216421652166216721682169000000000000000000000000 -0000039103920393039403950396039703980399039A039B039C039D039E039F -03A003A103A303A403A503A603A703A803A90000000000000000000000000000 -000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF -03C003C103C303C403C503C603C703C803C90000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -26 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000025002502250C251025182514251C252C25242534253C25012503250F2513 -251B251725232533252B253B254B2520252F25282537253F251D253025252538 -254225122511251A251925162515250E250D251E251F25212522252625272529 -252A252D252E25312532253525362539253A253D253E25402541254325442545 -2546254725482549254A00000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -27 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00003395339633972113339833C433A333A433A533A63399339A339B339C339D -339E339F33A033A133A233CA338D338E338F33CF3388338933C833A733A833B0 -33B133B233B333B433B533B633B733B833B93380338133823383338433BA33BB -33BC33BD33BE33BF33903391339233933394212633C033C1338A338B338C33D6 -33C533AD33AE33AF33DB33A933AA33AB33AC33DD33D033D333C333C933DC33C6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -28 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000C600D000AA0126000001320000013F014100D8015200BA00DE0166014A -00003260326132623263326432653266326732683269326A326B326C326D326E -326F3270327132723273327432753276327732783279327A327B24D024D124D2 -24D324D424D524D624D724D824D924DA24DB24DC24DD24DE24DF24E024E124E2 -24E324E424E524E624E724E824E9246024612462246324642465246624672468 -2469246A246B246C246D246E00BD2153215400BC00BE215B215C215D215E0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -29 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000E6011100F001270131013301380140014200F8015300DF00FE0167014B -01493200320132023203320432053206320732083209320A320B320C320D320E -320F3210321132123213321432153216321732183219321A321B249C249D249E -249F24A024A124A224A324A424A524A624A724A824A924AA24AB24AC24AD24AE -24AF24B024B124B224B324B424B5247424752476247724782479247A247B247C -247D247E247F24802481248200B900B200B32074207F20812082208320840000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -2A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000304130423043304430453046304730483049304A304B304C304D304E304F -3050305130523053305430553056305730583059305A305B305C305D305E305F -3060306130623063306430653066306730683069306A306B306C306D306E306F -3070307130723073307430753076307730783079307A307B307C307D307E307F -3080308130823083308430853086308730883089308A308B308C308D308E308F -3090309130923093000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -2B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF -30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF -30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF -30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -2C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000004100411041204130414041504010416041704180419041A041B041C041D -041E041F0420042104220423042404250426042704280429042A042B042C042D -042E042F00000000000000000000000000000000000000000000000000000000 -000004300431043204330434043504510436043704380439043A043B043C043D -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AC00AC01AC04AC07AC08AC09AC0AAC10AC11AC12AC13AC14AC15AC16AC17 -AC19AC1AAC1BAC1CAC1DAC20AC24AC2CAC2DAC2FAC30AC31AC38AC39AC3CAC40 -AC4BAC4DAC54AC58AC5CAC70AC71AC74AC77AC78AC7AAC80AC81AC83AC84AC85 -AC86AC89AC8AAC8BAC8CAC90AC94AC9CAC9DAC9FACA0ACA1ACA8ACA9ACAAACAC -ACAFACB0ACB8ACB9ACBBACBCACBDACC1ACC4ACC8ACCCACD5ACD7ACE0ACE1ACE4 -ACE7ACE8ACEAACECACEFACF0ACF1ACF3ACF5ACF6ACFCACFDAD00AD04AD060000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -31 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AD0CAD0DAD0FAD11AD18AD1CAD20AD29AD2CAD2DAD34AD35AD38AD3CAD44 -AD45AD47AD49AD50AD54AD58AD61AD63AD6CAD6DAD70AD73AD74AD75AD76AD7B -AD7CAD7DAD7FAD81AD82AD88AD89AD8CAD90AD9CAD9DADA4ADB7ADC0ADC1ADC4 -ADC8ADD0ADD1ADD3ADDCADE0ADE4ADF8ADF9ADFCADFFAE00AE01AE08AE09AE0B -AE0DAE14AE30AE31AE34AE37AE38AE3AAE40AE41AE43AE45AE46AE4AAE4CAE4D -AE4EAE50AE54AE56AE5CAE5DAE5FAE60AE61AE65AE68AE69AE6CAE70AE780000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -32 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000AE79AE7BAE7CAE7DAE84AE85AE8CAEBCAEBDAEBEAEC0AEC4AECCAECDAECF -AED0AED1AED8AED9AEDCAEE8AEEBAEEDAEF4AEF8AEFCAF07AF08AF0DAF10AF2C -AF2DAF30AF32AF34AF3CAF3DAF3FAF41AF42AF43AF48AF49AF50AF5CAF5DAF64 -AF65AF79AF80AF84AF88AF90AF91AF95AF9CAFB8AFB9AFBCAFC0AFC7AFC8AFC9 -AFCBAFCDAFCEAFD4AFDCAFE8AFE9AFF0AFF1AFF4AFF8B000B001B004B00CB010 -B014B01CB01DB028B044B045B048B04AB04CB04EB053B054B055B057B0590000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -33 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B05DB07CB07DB080B084B08CB08DB08FB091B098B099B09AB09CB09FB0A0 -B0A1B0A2B0A8B0A9B0ABB0ACB0ADB0AEB0AFB0B1B0B3B0B4B0B5B0B8B0BCB0C4 -B0C5B0C7B0C8B0C9B0D0B0D1B0D4B0D8B0E0B0E5B108B109B10BB10CB110B112 -B113B118B119B11BB11CB11DB123B124B125B128B12CB134B135B137B138B139 -B140B141B144B148B150B151B154B155B158B15CB160B178B179B17CB180B182 -B188B189B18BB18DB192B193B194B198B19CB1A8B1CCB1D0B1D4B1DCB1DD0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -34 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B1DFB1E8B1E9B1ECB1F0B1F9B1FBB1FDB204B205B208B20BB20CB214B215 -B217B219B220B234B23CB258B25CB260B268B269B274B275B27CB284B285B289 -B290B291B294B298B299B29AB2A0B2A1B2A3B2A5B2A6B2AAB2ACB2B0B2B4B2C8 -B2C9B2CCB2D0B2D2B2D8B2D9B2DBB2DDB2E2B2E4B2E5B2E6B2E8B2EBB2ECB2ED -B2EEB2EFB2F3B2F4B2F5B2F7B2F8B2F9B2FAB2FBB2FFB300B301B304B308B310 -B311B313B314B315B31CB354B355B356B358B35BB35CB35EB35FB364B3650000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -35 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B367B369B36BB36EB370B371B374B378B380B381B383B384B385B38CB390 -B394B3A0B3A1B3A8B3ACB3C4B3C5B3C8B3CBB3CCB3CEB3D0B3D4B3D5B3D7B3D9 -B3DBB3DDB3E0B3E4B3E8B3FCB410B418B41CB420B428B429B42BB434B450B451 -B454B458B460B461B463B465B46CB480B488B49DB4A4B4A8B4ACB4B5B4B7B4B9 -B4C0B4C4B4C8B4D0B4D5B4DCB4DDB4E0B4E3B4E4B4E6B4ECB4EDB4EFB4F1B4F8 -B514B515B518B51BB51CB524B525B527B528B529B52AB530B531B534B5380000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -36 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B540B541B543B544B545B54BB54CB54DB550B554B55CB55DB55FB560B561 -B5A0B5A1B5A4B5A8B5AAB5ABB5B0B5B1B5B3B5B4B5B5B5BBB5BCB5BDB5C0B5C4 -B5CCB5CDB5CFB5D0B5D1B5D8B5ECB610B611B614B618B625B62CB634B648B664 -B668B69CB69DB6A0B6A4B6ABB6ACB6B1B6D4B6F0B6F4B6F8B700B701B705B728 -B729B72CB72FB730B738B739B73BB744B748B74CB754B755B760B764B768B770 -B771B773B775B77CB77DB780B784B78CB78DB78FB790B791B792B796B7970000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -37 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B798B799B79CB7A0B7A8B7A9B7ABB7ACB7ADB7B4B7B5B7B8B7C7B7C9B7EC -B7EDB7F0B7F4B7FCB7FDB7FFB800B801B807B808B809B80CB810B818B819B81B -B81DB824B825B828B82CB834B835B837B838B839B840B844B851B853B85CB85D -B860B864B86CB86DB86FB871B878B87CB88DB8A8B8B0B8B4B8B8B8C0B8C1B8C3 -B8C5B8CCB8D0B8D4B8DDB8DFB8E1B8E8B8E9B8ECB8F0B8F8B8F9B8FBB8FDB904 -B918B920B93CB93DB940B944B94CB94FB951B958B959B95CB960B968B9690000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -38 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000B96BB96DB974B975B978B97CB984B985B987B989B98AB98DB98EB9ACB9AD -B9B0B9B4B9BCB9BDB9BFB9C1B9C8B9C9B9CCB9CEB9CFB9D0B9D1B9D2B9D8B9D9 -B9DBB9DDB9DEB9E1B9E3B9E4B9E5B9E8B9ECB9F4B9F5B9F7B9F8B9F9B9FABA00 -BA01BA08BA15BA38BA39BA3CBA40BA42BA48BA49BA4BBA4DBA4EBA53BA54BA55 -BA58BA5CBA64BA65BA67BA68BA69BA70BA71BA74BA78BA83BA84BA85BA87BA8C -BAA8BAA9BAABBAACBAB0BAB2BAB8BAB9BABBBABDBAC4BAC8BAD8BAD9BAFC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -39 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BB00BB04BB0DBB0FBB11BB18BB1CBB20BB29BB2BBB34BB35BB36BB38BB3B -BB3CBB3DBB3EBB44BB45BB47BB49BB4DBB4FBB50BB54BB58BB61BB63BB6CBB88 -BB8CBB90BBA4BBA8BBACBBB4BBB7BBC0BBC4BBC8BBD0BBD3BBF8BBF9BBFCBBFF -BC00BC02BC08BC09BC0BBC0CBC0DBC0FBC11BC14BC15BC16BC17BC18BC1BBC1C -BC1DBC1EBC1FBC24BC25BC27BC29BC2DBC30BC31BC34BC38BC40BC41BC43BC44 -BC45BC49BC4CBC4DBC50BC5DBC84BC85BC88BC8BBC8CBC8EBC94BC95BC970000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BC99BC9ABCA0BCA1BCA4BCA7BCA8BCB0BCB1BCB3BCB4BCB5BCBCBCBDBCC0 -BCC4BCCDBCCFBCD0BCD1BCD5BCD8BCDCBCF4BCF5BCF6BCF8BCFCBD04BD05BD07 -BD09BD10BD14BD24BD2CBD40BD48BD49BD4CBD50BD58BD59BD64BD68BD80BD81 -BD84BD87BD88BD89BD8ABD90BD91BD93BD95BD99BD9ABD9CBDA4BDB0BDB8BDD4 -BDD5BDD8BDDCBDE9BDF0BDF4BDF8BE00BE03BE05BE0CBE0DBE10BE14BE1CBE1D -BE1FBE44BE45BE48BE4CBE4EBE54BE55BE57BE59BE5ABE5BBE60BE61BE640000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000BE68BE6ABE70BE71BE73BE74BE75BE7BBE7CBE7DBE80BE84BE8CBE8DBE8F -BE90BE91BE98BE99BEA8BED0BED1BED4BED7BED8BEE0BEE3BEE4BEE5BEECBF01 -BF08BF09BF18BF19BF1BBF1CBF1DBF40BF41BF44BF48BF50BF51BF55BF94BFB0 -BFC5BFCCBFCDBFD0BFD4BFDCBFDFBFE1C03CC051C058C05CC060C068C069C090 -C091C094C098C0A0C0A1C0A3C0A5C0ACC0ADC0AFC0B0C0B3C0B4C0B5C0B6C0BC -C0BDC0BFC0C0C0C1C0C5C0C8C0C9C0CCC0D0C0D8C0D9C0DBC0DCC0DDC0E40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C0E5C0E8C0ECC0F4C0F5C0F7C0F9C100C104C108C110C115C11CC11DC11E -C11FC120C123C124C126C127C12CC12DC12FC130C131C136C138C139C13CC140 -C148C149C14BC14CC14DC154C155C158C15CC164C165C167C168C169C170C174 -C178C185C18CC18DC18EC190C194C196C19CC19DC19FC1A1C1A5C1A8C1A9C1AC -C1B0C1BDC1C4C1C8C1CCC1D4C1D7C1D8C1E0C1E4C1E8C1F0C1F1C1F3C1FCC1FD -C200C204C20CC20DC20FC211C218C219C21CC21FC220C228C229C22BC22D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C22FC231C232C234C248C250C251C254C258C260C265C26CC26DC270C274 -C27CC27DC27FC281C288C289C290C298C29BC29DC2A4C2A5C2A8C2ACC2ADC2B4 -C2B5C2B7C2B9C2DCC2DDC2E0C2E3C2E4C2EBC2ECC2EDC2EFC2F1C2F6C2F8C2F9 -C2FBC2FCC300C308C309C30CC30DC313C314C315C318C31CC324C325C328C329 -C345C368C369C36CC370C372C378C379C37CC37DC384C388C38CC3C0C3D8C3D9 -C3DCC3DFC3E0C3E2C3E8C3E9C3EDC3F4C3F5C3F8C408C410C424C42CC4300000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C434C43CC43DC448C464C465C468C46CC474C475C479C480C494C49CC4B8 -C4BCC4E9C4F0C4F1C4F4C4F8C4FAC4FFC500C501C50CC510C514C51CC528C529 -C52CC530C538C539C53BC53DC544C545C548C549C54AC54CC54DC54EC553C554 -C555C557C558C559C55DC55EC560C561C564C568C570C571C573C574C575C57C -C57DC580C584C587C58CC58DC58FC591C595C597C598C59CC5A0C5A9C5B4C5B5 -C5B8C5B9C5BBC5BCC5BDC5BEC5C4C5C5C5C6C5C7C5C8C5C9C5CAC5CCC5CE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C5D0C5D1C5D4C5D8C5E0C5E1C5E3C5E5C5ECC5EDC5EEC5F0C5F4C5F6C5F7 -C5FCC5FDC5FEC5FFC600C601C605C606C607C608C60CC610C618C619C61BC61C -C624C625C628C62CC62DC62EC630C633C634C635C637C639C63BC640C641C644 -C648C650C651C653C654C655C65CC65DC660C66CC66FC671C678C679C67CC680 -C688C689C68BC68DC694C695C698C69CC6A4C6A5C6A7C6A9C6B0C6B1C6B4C6B8 -C6B9C6BAC6C0C6C1C6C3C6C5C6CCC6CDC6D0C6D4C6DCC6DDC6E0C6E1C6E80000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -40 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C6E9C6ECC6F0C6F8C6F9C6FDC704C705C708C70CC714C715C717C719C720 -C721C724C728C730C731C733C735C737C73CC73DC740C744C74AC74CC74DC74F -C751C752C753C754C755C756C757C758C75CC760C768C76BC774C775C778C77C -C77DC77EC783C784C785C787C788C789C78AC78EC790C791C794C796C797C798 -C79AC7A0C7A1C7A3C7A4C7A5C7A6C7ACC7ADC7B0C7B4C7BCC7BDC7BFC7C0C7C1 -C7C8C7C9C7CCC7CEC7D0C7D8C7DDC7E4C7E8C7ECC800C801C804C808C80A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -41 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C810C811C813C815C816C81CC81DC820C824C82CC82DC82FC831C838C83C -C840C848C849C84CC84DC854C870C871C874C878C87AC880C881C883C885C886 -C887C88BC88CC88DC894C89DC89FC8A1C8A8C8BCC8BDC8C4C8C8C8CCC8D4C8D5 -C8D7C8D9C8E0C8E1C8E4C8F5C8FCC8FDC900C904C905C906C90CC90DC90FC911 -C918C92CC934C950C951C954C958C960C961C963C96CC970C974C97CC988C989 -C98CC990C998C999C99BC99DC9C0C9C1C9C4C9C7C9C8C9CAC9D0C9D1C9D30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -42 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000C9D5C9D6C9D9C9DAC9DCC9DDC9E0C9E2C9E4C9E7C9ECC9EDC9EFC9F0C9F1 -C9F8C9F9C9FCCA00CA08CA09CA0BCA0CCA0DCA14CA18CA29CA4CCA4DCA50CA54 -CA5CCA5DCA5FCA60CA61CA68CA7DCA84CA98CABCCABDCAC0CAC4CACCCACDCACF -CAD1CAD3CAD8CAD9CAE0CAECCAF4CB08CB10CB14CB18CB20CB21CB41CB48CB49 -CB4CCB50CB58CB59CB5DCB64CB78CB79CB9CCBB8CBD4CBE4CBE7CBE9CC0CCC0D -CC10CC14CC1CCC1DCC21CC22CC27CC28CC29CC2CCC2ECC30CC38CC39CC3B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -43 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CC3CCC3DCC3ECC44CC45CC48CC4CCC54CC55CC57CC58CC59CC60CC64CC66 -CC68CC70CC75CC98CC99CC9CCCA0CCA8CCA9CCABCCACCCADCCB4CCB5CCB8CCBC -CCC4CCC5CCC7CCC9CCD0CCD4CCE4CCECCCF0CD01CD08CD09CD0CCD10CD18CD19 -CD1BCD1DCD24CD28CD2CCD39CD5CCD60CD64CD6CCD6DCD6FCD71CD78CD88CD94 -CD95CD98CD9CCDA4CDA5CDA7CDA9CDB0CDC4CDCCCDD0CDE8CDECCDF0CDF8CDF9 -CDFBCDFDCE04CE08CE0CCE14CE19CE20CE21CE24CE28CE30CE31CE33CE350000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -44 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000CE58CE59CE5CCE5FCE60CE61CE68CE69CE6BCE6DCE74CE75CE78CE7CCE84 -CE85CE87CE89CE90CE91CE94CE98CEA0CEA1CEA3CEA4CEA5CEACCEADCEC1CEE4 -CEE5CEE8CEEBCEECCEF4CEF5CEF7CEF8CEF9CF00CF01CF04CF08CF10CF11CF13 -CF15CF1CCF20CF24CF2CCF2DCF2FCF30CF31CF38CF54CF55CF58CF5CCF64CF65 -CF67CF69CF70CF71CF74CF78CF80CF85CF8CCFA1CFA8CFB0CFC4CFE0CFE1CFE4 -CFE8CFF0CFF1CFF3CFF5CFFCD000D004D011D018D02DD034D035D038D03C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -45 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D044D045D047D049D050D054D058D060D06CD06DD070D074D07CD07DD081 -D0A4D0A5D0A8D0ACD0B4D0B5D0B7D0B9D0C0D0C1D0C4D0C8D0C9D0D0D0D1D0D3 -D0D4D0D5D0DCD0DDD0E0D0E4D0ECD0EDD0EFD0F0D0F1D0F8D10DD130D131D134 -D138D13AD140D141D143D144D145D14CD14DD150D154D15CD15DD15FD161D168 -D16CD17CD184D188D1A0D1A1D1A4D1A8D1B0D1B1D1B3D1B5D1BAD1BCD1C0D1D8 -D1F4D1F8D207D209D210D22CD22DD230D234D23CD23DD23FD241D248D25C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -46 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D264D280D281D284D288D290D291D295D29CD2A0D2A4D2ACD2B1D2B8D2B9 -D2BCD2BFD2C0D2C2D2C8D2C9D2CBD2D4D2D8D2DCD2E4D2E5D2F0D2F1D2F4D2F8 -D300D301D303D305D30CD30DD30ED310D314D316D31CD31DD31FD320D321D325 -D328D329D32CD330D338D339D33BD33CD33DD344D345D37CD37DD380D384D38C -D38DD38FD390D391D398D399D39CD3A0D3A8D3A9D3ABD3ADD3B4D3B8D3BCD3C4 -D3C5D3C8D3C9D3D0D3D8D3E1D3E3D3ECD3EDD3F0D3F4D3FCD3FDD3FFD4010000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -47 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D408D41DD440D444D45CD460D464D46DD46FD478D479D47CD47FD480D482 -D488D489D48BD48DD494D4A9D4CCD4D0D4D4D4DCD4DFD4E8D4ECD4F0D4F8D4FB -D4FDD504D508D50CD514D515D517D53CD53DD540D544D54CD54DD54FD551D558 -D559D55CD560D565D568D569D56BD56DD574D575D578D57CD584D585D587D588 -D589D590D5A5D5C8D5C9D5CCD5D0D5D2D5D8D5D9D5DBD5DDD5E4D5E5D5E8D5EC -D5F4D5F5D5F7D5F9D600D601D604D608D610D611D613D614D615D61CD6200000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -48 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000D624D62DD638D639D63CD640D645D648D649D64BD64DD651D654D655D658 -D65CD667D669D670D671D674D683D685D68CD68DD690D694D69DD69FD6A1D6A8 -D6ACD6B0D6B9D6BBD6C4D6C5D6C8D6CCD6D1D6D4D6D7D6D9D6E0D6E4D6E8D6F0 -D6F5D6FCD6FDD700D704D711D718D719D71CD720D728D729D72BD72DD734D735 -D738D73CD744D747D749D750D751D754D756D757D758D759D760D761D763D765 -D769D76CD770D774D77CD77DD781D788D789D78CD790D798D799D79BD79D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004F3D4F73504750F952A053EF547554E556095AC15BB6668767B667B767EF -6B4C73C275C27A3C82DB8304885788888A368CC88DCF8EFB8FE699D5523B5374 -5404606A61646BBC73CF811A89BA89D295A34F83520A58BE597859E65E725E79 -61C763C0674667EC687F6F97764E770B78F57A087AFF7C21809D826E82718AEB -95934E6B559D66F76E3478A37AED845B8910874E97A852D8574E582A5D4C611F -61BE6221656267D16A446E1B751875B376E377B07D3A90AF945194529F950000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000053235CAC753280DB92409598525B580859DC5CA15D175EB75F3A5F4A6177 -6C5F757A75867CE07D737DB17F8C81548221859189418B1B92FC964D9C474ECB -4EF7500B51F1584F6137613E6168653969EA6F1175A5768676D67B8782A584CB -F90093A7958B55805BA25751F9017CB37FB991B5502853BB5C455DE862D2636E -64DA64E76E2070AC795B8DDD8E1EF902907D924592F84E7E4EF650655DFE5EFA -61066957817186548E4793759A2B4E5E5091677068405109528D52926AA20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000077BC92109ED452AB602F8FF2504861A963ED64CA683C6A846FC0818889A1 -96945805727D72AC75047D797E6D80A9898B8B7490639D5162896C7A6F547D50 -7F3A8A23517C614A7B9D8B199257938C4EAC4FD3501E50BE510652C152CD537F -577058835E9A5F91617661AC64CE656C666F66BB66F468976D87708570F1749F -74A574CA75D9786C78EC7ADF7AF67D457D938015803F811B83968B668F159015 -93E1980398389A5A9BE84FC25553583A59515B635C4660B86212684268B00000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068E86EAA754C767878CE7A3D7CFB7E6B7E7C8A088AA18C3F968E9DC453E4 -53E9544A547156FA59D15B645C3B5EAB62F765376545657266A067AF69C16CBD -75FC7690777E7A3F7F94800380A1818F82E682FD83F085C1883188B48AA5F903 -8F9C932E96C798679AD89F1354ED659B66F2688F7A408C379D6056F057645D11 -660668B168CD6EFE7428889E9BE46C68F9049AA84F9B516C5171529F5B545DE5 -6050606D62F163A7653B73D97A7A86A38CA2978F4E325BE16208679C74DC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000079D183D38A878AB28DE8904E934B98465ED369E885FF90EDF90551A05B98 -5BEC616368FA6B3E704C742F74D87BA17F5083C589C08CAB95DC9928522E605D -62EC90024F8A5149532158D95EE366E06D38709A72C273D67B5080F1945B5366 -639B7F6B4E565080584A58DE602A612762D069D09B415B8F7D1880B18F5F4EA4 -50D154AC55AC5B0C5DA05DE7652A654E68216A4B72E1768E77EF7D5E7FF981A0 -854E86DF8F038F4E90CA99039A559BAB4E184E454E5D4EC74FF1517752FE0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -4F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000534053E353E5548E5614577557A25BC75D875ED061FC62D8655167B867E9 -69CB6B506BC66BEC6C426E9D707872D77396740377BF77E97A767D7F800981FC -8205820A82DF88628B338CFC8EC0901190B1926492B699D29A459CE99DD79F9C -570B5C4083CA97A097AB9EB4541B7A987FA488D98ECD90E158005C4863987A9F -5BAE5F137A797AAE828E8EAC5026523852F85377570862F363726B0A6DC37737 -53A5735785688E7695D5673A6AC36F708A6D8ECC994BF90666776B788CB40000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00009B3CF90753EB572D594E63C669FB73EA78457ABA7AC57CFE8475898F8D73 -903595A852FB574775477B6083CC921EF9086A58514B524B5287621F68D86975 -969950C552A452E461C365A4683969FF747E7B4B82B983EB89B28B398FD19949 -F9094ECA599764D266116A8E7434798179BD82A9887E887F895FF90A93264F0B -53CA602562716C727D1A7D664E98516277DC80AF4F014F0E5176518055DC5668 -573B57FA57FC5914594759935BC45C905D0E5DF15E7E5FCC628065D765E30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -51 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000671E671F675E68CB68C46A5F6B3A6C236C7D6C826DC773987426742A7482 -74A37578757F788178EF794179477948797A7B957D007DBA7F888006802D808C -8A188B4F8C488D779321932498E299519A0E9A0F9A659E927DCA4F76540962EE -685491D155AB513AF90BF90C5A1C61E6F90D62CF62FFF90EF90FF910F911F912 -F91390A3F914F915F916F917F9188AFEF919F91AF91BF91C6696F91D7156F91E -F91F96E3F920634F637A5357F921678F69606E73F9227537F923F924F9250000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -52 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007D0DF926F927887256CA5A18F928F929F92AF92BF92C4E43F92D51675948 -67F08010F92E59735E74649A79CA5FF5606C62C8637B5BE75BD752AAF92F5974 -5F296012F930F931F9327459F933F934F935F936F937F93899D1F939F93AF93B -F93CF93DF93EF93FF940F941F942F9436FC3F944F94581BF8FB260F1F946F947 -8166F948F9495C3FF94AF94BF94CF94DF94EF94FF950F9515AE98A25677B7D10 -F952F953F954F955F956F95780FDF958F9595C3C6CE5533F6EBA591A83360000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00004E394EB64F4655AE571858C75F5665B765E66A806BB56E4D77ED7AEF7C1E -7DDE86CB88929132935B64BB6FBE737A75B890545556574D61BA64D466C76DE1 -6E5B6F6D6FB975F0804381BD854189838AC78B5A931F6C9375537B548E0F905D -5510580258585E626207649E68E075767CD687B39EE84EE35788576E59275C0D -5CB15E365F85623464E173B381FA888B8CB8968A9EDB5B855FB760B350125200 -52305716583558575C0E5C605CF65D8B5EA65F9260BC63116389641768430000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000068F96AC26DD86E216ED46FE471FE76DC777979B17A3B840489A98CED8DF3 -8E4890039014905390FD934D967697DC6BD27006725872A27368776379BF7BE4 -7E9B8B8058A960C7656665FD66BE6C8C711E71C98C5A98134E6D7A814EDD51AC -51CD52D5540C61A76771685068DF6D1E6F7C75BC77B37AE580F484639285515C -6597675C679375D87AC78373F95A8C469017982D5C6F81C0829A9041906F920D -5F975D9D6A5971C8767B7B4985E48B0491279A30558761F6F95B76697F850000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -55 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000863F87BA88F8908FF95C6D1B70D973DE7D61843DF95D916A99F1F95E4E82 -53756B046B12703E721B862D9E1E524C8FA35D5064E5652C6B166FEB7C437E9C -85CD896489BD62C981D8881F5ECA67176D6A72FC7405746F878290DE4F865D0D -5FA0840A51B763A075654EAE5006516951C968816A117CAE7CB17CE7826F8AD2 -8F1B91CF4FB6513752F554425EEC616E623E65C56ADA6FFE792A85DC882395AD -9A629A6A9E979ECE529B66C66B77701D792B8F6297426190620065236F230000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -56 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000714974897DF4806F84EE8F269023934A51BD521752A36D0C70C888C25EC9 -65826BAE6FC27C3E73754EE44F3656F9F95F5CBA5DBA601C73B27B2D7F9A7FCE -8046901E923496F6974898189F614F8B6FA779AE91B496B752DEF960648864C4 -6AD36F5E7018721076E780018606865C8DEF8F0597329B6F9DFA9E75788C797F -7DA083C993049E7F9E938AD658DF5F046727702774CF7C60807E512170287262 -78CA8CC28CDA8CF496F74E8650DA5BEE5ED6659971CE764277AD804A84FC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -57 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000907C9B279F8D58D85A415C626A136DDA6F0F763B7D2F7E37851E893893E4 -964B528965D267F369B46D416E9C700F7409746075597624786B8B2C985E516D -622E96784F96502B5D196DEA7DB88F2A5F8B61446817F961968652D2808B51DC -51CC695E7A1C7DBE83F196754FDA52295398540F550E5C6560A7674E68A86D6C -728172F874067483F96275E27C6C7F797FB8838988CF88E191CC91D096E29BC9 -541D6F7E71D0749885FA8EAA96A39C579E9F67976DCB743381E89716782C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -58 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007ACB7B207C926469746A75F278BC78E899AC9B549EBB5BDE5E556F20819C -83AB90884E07534D5A295DD25F4E6162633D666966FC6EFF6F2B7063779E842C -8513883B8F1399459C3B551C62B9672B6CAB8309896A977A4EA159845FD85FD9 -671B7DB27F548292832B83BD8F1E909957CB59B95A925BD06627679A68856BCF -71647F758CB78CE390819B4581088C8A964C9A409EA55B5F6C13731B76F276DF -840C51AA8993514D519552C968C96C94770477207DBF7DEC97629EB56EC50000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000851151A5540D547D660E669D69276E9F76BF7791831784C2879F91699298 -9CF488824FAE519252DF59C65E3D61556478647966AE67D06A216BCD6BDB725F -72617441773877DB801782BC83058B008B288C8C67286C90726776EE77667A46 -9DA96B7F6C92592267268499536F589359995EDF63CF663467736E3A732B7AD7 -82D7932852D95DEB61AE61CB620A62C764AB65E069596B666BCB712173F7755D -7E46821E8302856A8AA38CBF97279D6158A89ED85011520E543B554F65870000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006C767D0A7D0B805E868A958096EF52FF6C95726954735A9A5C3E5D4B5F4C -5FAE672A68B669636E3C6E4477097C737F8E85878B0E8FF797619EF45CB760B6 -610D61AB654F65FB65FC6C116CEF739F73C97DE195945BC6871C8B10525D535A -62CD640F64B267346A386CCA73C0749E7B947C957E1B818A823685848FEB96F9 -99C14F34534A53CD53DB62CC642C6500659169C36CEE6F5873ED7554762276E4 -76FC78D078FB792C7D46822C87E08FD4981298EF52C362D464A56E246F510000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000767C8DCB91B192629AEE9B435023508D574A59A85C285E475F77623F653E -65B965C16609678B699C6EC278C57D2180AA8180822B82B384A1868C8A2A8B17 -90A696329F90500D4FF3F96357F95F9862DC6392676F6E43711976C380CC80DA -88F488F589198CE08F29914D966A4F2F4F705E1B67CF6822767D767E9B445E61 -6A0A716971D4756AF9647E41854385E998DC4F107B4F7F7095A551E15E0668B5 -6C3E6C4E6CDB72AF7BC483036CD5743A50FB528858C164D86A9774A776560000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000078A7861795E29739F965535E5F018B8A8FA88FAF908A522577A59C499F08 -4E19500251755C5B5E77661E663A67C468C570B3750175C579C97ADD8F279920 -9A084FDD582158315BF6666E6B656D116E7A6F7D73E4752B83E988DC89138B5C -8F144F0F50D55310535C5B935FA9670D798F8179832F8514890789868F398F3B -99A59C12672C4E764FF859495C015CEF5CF0636768D270FD71A2742B7E2B84EC -8702902292D29CF34E0D4ED84FEF50855256526F5426549057E0592B5A660000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005B5A5B755BCC5E9CF9666276657765A76D6E6EA572367B267C3F7F368150 -8151819A8240829983A98A038CA08CE68CFB8D748DBA90E891DC961C964499D9 -9CE7531752065429567458B35954596E5FFF61A4626E66106C7E711A76C67C89 -7CDE7D1B82AC8CC196F0F9674F5B5F175F7F62C25D29670B68DA787C7E439D6C -4E1550995315532A535159835A625E8760B2618A624962796590678769A76BD4 -6BD66BD76BD86CB8F968743575FA7812789179D579D87C837DCB7FE180A50000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000813E81C283F2871A88E88AB98B6C8CBB9119975E98DB9F3B56AC5B2A5F6C -658C6AB36BAF6D5C6FF17015725D73AD8CA78CD3983B61916C3780589A014E4D -4E8B4E9B4ED54F3A4F3C4F7F4FDF50FF53F253F8550655E356DB58EB59625A11 -5BEB5BFA5C045DF35E2B5F99601D6368659C65AF67F667FB68AD6B7B6C996CD7 -6E23700973457802793E7940796079C17BE97D177D728086820D838E84D186C7 -88DF8A508A5E8B1D8CDC8D668FAD90AA98FC99DF9E9D524AF9696714F96A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005098522A5C7165636C5573CA7523759D7B97849C917897304E7764926BBA -715E85A94E09F96B674968EE6E17829F8518886B63F76F81921298AF4E0A50B7 -50CF511F554655AA56175B405C195CE05E385E8A5EA05EC260F368516A616E58 -723D724072C076F879657BB17FD488F389F48A738C618CDE971C585E74BD8CFD -55C7F96C7A617D2282727272751F7525F96D7B19588558FB5DBC5E8F5EB65F90 -60556292637F654D669166D966F8681668F27280745E7B6E7D6E7DD67F720000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -60 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000080E5821285AF897F8A93901D92E49ECD9F205915596D5E2D60DC66146673 -67906C506DC56F5F77F378A984C691CB932B4ED950CA514855845B0B5BA36247 -657E65CB6E32717D74017444748774BF766C79AA7DDA7E557FA8817A81B38239 -861A87EC8A758DE3907892919425994D9BAE53685C5169546CC46D296E2B820C -859B893B8A2D8AAA96EA9F67526166B96BB27E9687FE8D0D9583965D651D6D89 -71EEF96E57CE59D35BAC602760FA6210661F665F732973F976DB77017B6C0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -61 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008056807281658AA091924E1652E26B726D177A057B397D30F96F8CB053EC -562F58515BB55C0F5C115DE2624063836414662D68B36CBC6D886EAF701F70A4 -71D27526758F758E76197B117BE07C2B7D207D39852C856D86078A34900D9061 -90B592B797F69A374FD75C6C675F6D917C9F7E8C8B168D16901F5B6B5DFD640D -84C0905C98E173875B8B609A677E6DDE8A1F8AA69001980C5237F9707051788E -9396887091D74FEE53D755FD56DA578258FD5AC25B885CAB5CC05E2561010000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000620D624B6388641C653665786A396B8A6C346D196F3171E772E973787407 -74B27626776179C07A577AEA7CB97D8F7DAC7E617F9E81298331849084DA85EA -88968AB08B908F3890429083916C929692B9968B96A796A896D6970098089996 -9AD39B1A53D4587E59195B705BBF6DD16F5A719F742174B9808583FD5DE15F87 -5FAA604265EC6812696F6A536B896D356DF373E376FE77AC7B4D7D148123821C -834084F485638A628AC49187931E980699B4620C88538FF092655D075D270000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005D69745F819D87686FD562FE7FD2893689724E1E4E5850E752DD5347627F -66077E698805965E4F8D5319563659CB5AA45C385C4E5C4D5E025F11604365BD -662F664267BE67F4731C77E2793A7FC5849484CD89968A668A698AE18C558C7A -57F45BD45F0F606F62ED690D6B966E5C71847BD287558B588EFE98DF98FE4F38 -4F814FE1547B5A205BB8613C65B0666871FC7533795E7D33814E81E3839885AA -85CE87038A0A8EAB8F9BF9718FC559315BA45BE660895BE95C0B5FC36C810000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -64 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9726DF1700B751A82AF8AF64EC05341F97396D96C0F4E9E4FC45152555E -5A255CE86211725982BD83AA86FE88598A1D963F96C599139D099D5D580A5CB3 -5DBD5E4460E1611563E16A026E2591029354984E9C109F775B895CB86309664F -6848773C96C1978D98549B9F65A18B018ECB95BC55355CA95DD65EB56697764C -83F495C758D362BC72CE9D284EF0592E600F663B6B8379E79D26539354C057C3 -5D16611B66D66DAF788D827E969897445384627C63966DB27E0A814B984D0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -65 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006AFB7F4C9DAF9E1A4E5F503B51B6591C60F963F66930723A8036F97491CE -5F31F975F9767D0482E5846F84BB85E58E8DF9774F6FF978F97958E45B436059 -63DA6518656D6698F97A694A6A236D0B7001716C75D2760D79B37A70F97B7F8A -F97C8944F97D8B9391C0967DF97E990A57045FA165BC6F01760079A68A9E99AD -9B5A9F6C510461B662916A8D81C6504358305F6671098A008AFA5B7C86164FFA -513C56B4594463A96DF95DAA696D51864E884F59F97FF980F9815982F9820000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -66 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9836B5F6C5DF98474B57916F9858207824583398F3F8F5DF9869918F987 -F988F9894EA6F98A57DF5F796613F98BF98C75AB7E798B6FF98D90069A5B56A5 -582759F85A1F5BB4F98E5EF6F98FF9906350633BF991693D6C876CBF6D8E6D93 -6DF56F14F99270DF71367159F99371C371D5F994784F786FF9957B757DE3F996 -7E2FF997884D8EDFF998F999F99A925BF99B9CF6F99CF99DF99E60856D85F99F -71B1F9A0F9A195B153ADF9A2F9A3F9A467D3F9A5708E71307430827682D20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -67 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9A695BB9AE59E7D66C4F9A771C18449F9A8F9A9584BF9AAF9AB5DB85F71 -F9AC6620668E697969AE6C386CF36E366F416FDA701B702F715071DF7370F9AD -745BF9AE74D476C87A4E7E93F9AFF9B082F18A608FCEF9B19348F9B29719F9B3 -F9B44E42502AF9B5520853E166F36C6D6FCA730A777F7A6282AE85DD8602F9B6 -88D48A638B7D8C6BF9B792B3F9B8971398104E944F0D4FC950B25348543E5433 -55DA586258BA59675A1B5BE4609FF9B961CA655665FF666468A76C5A6FB30000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -68 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000070CF71AC73527B7D87088AA49C329F075C4B6C8373447389923A6EAB7465 -761F7A697E15860A514058C564C174EE751576707FC1909596CD99546E2674E6 -7AA97AAA81E586D987788A1B5A495B8C5B9B68A169006D6373A97413742C7897 -7DE97FEB81188155839E8C4C962E981166F05F8065FA67896C6A738B502D5A03 -6B6A77EE59165D6C5DCD7325754FF9BAF9BB50E551F9582F592D599659DA5BE5 -F9BCF9BD5DA262D76416649364FEF9BE66DCF9BF6A48F9C071FF7464F9C10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -69 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00007A887AAF7E477E5E80008170F9C287EF89818B209059F9C390809952617E -6B326D747E1F89258FB14FD150AD519752C757C758895BB95EB8614269956D8C -6E676EB6719474627528752C8073833884C98E0A939493DEF9C44E8E4F515076 -512A53C853CB53F35B875BD35C24611A618265F4725B7397744076C279507991 -79B97D067FBD828B85D5865E8FC2904790F591EA968596E896E952D65F6765ED -6631682F715C7A3690C1980A4E91F9C56A526B9E6F907189801882B885530000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000904B969596F297FB851A9B314E90718A96C45143539F54E15713571257A3 -5A9B5AC45BC36028613F63F46C856D396E726E907230733F745782D188818F45 -9060F9C6966298589D1B67088D8A925E4F4D504950DE5371570D59D45A015C09 -617066906E2D7232744B7DEF80C3840E8466853F875F885B89188B02905597CB -9B4F4E734F915112516AF9C7552F55A95B7A5BA55E7C5E7D5EBE60A060DF6108 -610963C465386709F9C867D467DAF9C9696169626CB96D27F9CA6E38F9CB0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006FE173367337F9CC745C7531F9CD7652F9CEF9CF7DAD81FE843888D58A98 -8ADB8AED8E308E42904A903E907A914991C9936EF9D0F9D15809F9D26BD38089 -80B2F9D3F9D45141596B5C39F9D5F9D66F6473A780E48D07F9D79217958FF9D8 -F9D9F9DAF9DB807F620E701C7D68878DF9DC57A0606961476BB78ABE928096B1 -4E59541F6DEB852D967097F398EE63D66CE3909151DD61C981BA9DF94F9D501A -51005B9C610F61FF64EC69056BC5759177E37FA98264858F87FB88638ABC0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008B7091AB4E8C4EE54F0AF9DDF9DE593759E8F9DF5DF25F1B5F5B6021F9E0 -F9E1F9E2F9E3723E73E5F9E4757075CDF9E579FBF9E6800C8033808482E18351 -F9E7F9E88CBD8CB39087F9E9F9EA98F4990CF9EBF9EC703776CA7FCA7FCC7FFC -8B1A4EBA4EC152035370F9ED54BD56E059FB5BC55F155FCD6E6EF9EEF9EF7D6A -8335F9F086938A8DF9F1976D9777F9F2F9F34E004F5A4F7E58F965E56EA29038 -93B099B94EFB58EC598A59D96041F9F4F9F57A14F9F6834F8CC3516553440000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F9F7F9F8F9F94ECD52695B5582BF4ED4523A54A859C959FF5B505B575B5C -606361486ECB7099716E738674F775B578C17D2B800581EA8328851785C98AEE -8CC796CC4F5C52FA56BC65AB6628707C70B872357DBD828D914C96C09D725B71 -68E76B986F7A76DE5C9166AB6F5B7BB47C2A883696DC4E084ED75320583458BB -58EF596C5C075E335E845F35638C66B267566A1F6AA36B0C6F3F7246F9FA7350 -748B7AE07CA7817881DF81E7838A846C8523859485CF88DD8D1391AC95770000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000969C518D54C957285BB0624D6750683D68936E3D6ED3707D7E2188C18CA1 -8F099F4B9F4E722D7B8F8ACD931A4F474F4E5132548059D05E9562B56775696E -6A176CAE6E1A72D9732A75BD7BB87D3582E783F9845785F78A5B8CAF8E879019 -90B896CE9F5F52E3540A5AE15BC2645865756EF472C4F9FB76847A4D7B1B7C4D -7E3E7FDF837B8B2B8CCA8D648DE18E5F8FEA8FF9906993D14F434F7A50B35168 -5178524D526A5861587C59605C085C555EDB609B623068136BBF6C086FB10000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000714E742075307538755176727B4C7B8B7BAD7BC67E8F8A6E8F3E8F49923F -92939322942B96FB985A986B991E5207622A62986D5976647ACA7BC07D765360 -5CBE5E976F3870B97C9897119B8E9EDE63A5647A87764E014E954EAD505C5075 -544859C35B9A5E405EAD5EF75F8160C5633A653F657465CC6676667867FE6968 -6A896B636C406DC06DE86E1F6E5E701E70A1738E73FD753A775B7887798E7A0B -7A7D7CBE7D8E82478A028AEA8C9E912D914A91D8926692CC9320970697560000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -70 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000975C98029F0E52365291557C58245E1D5F1F608C63D068AF6FDF796D7B2C -81CD85BA88FD8AF88E44918D9664969B973D984C9F4A4FCE514651CB52A95632 -5F145F6B63AA64CD65E9664166FA66F9671D689D68D769FD6F156F6E716771E5 -722A74AA773A7956795A79DF7A207A957C977CDF7D447E70808785FB86A48A54 -8ABF8D998E819020906D91E3963B96D59CE565CF7C078DB393C35B585C0A5352 -62D9731D50275B975F9E60B0616B68D56DD9742E7A2E7D427D9C7E31816B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -71 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008E2A8E35937E94184F5057505DE65EA7632B7F6A4E3B4F4F4F8F505A59DD -80C4546A546855FE594F5B995DDE5EDA665D673167F1682A6CE86D326E4A6F8D -70B773E075877C4C7D027D2C7DA2821F86DB8A3B8A858D708E8A8F339031914E -9152944499D07AF97CA54FCA510151C657C85BEF5CFB66596A3D6D5A6E966FEC -710C756F7AE388229021907596CB99FF83014E2D4EF2884691CD537D6ADB696B -6C41847A589E618E66FE62EF70DD751175C77E5284B88B498D084E4B53EA0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -72 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054AB573057405FD763016307646F652F65E8667A679D67B36B626C606C9A -6F2C77E57825794979577D1980A2810281F3829D82B787188A8CF9FC8D048DBE -907276F47A197A377E548077550755D45875632F64226649664B686D699B6B84 -6D256EB173CD746874A1755B75B976E1771E778B79E67E097E1D81FB852F8897 -8A3A8CD18EEB8FB0903293AD9663967397074F8453F159EA5AC95E19684E74C6 -75BE79E97A9281A386ED8CEA8DCC8FED659F6715F9FD57F76F577DDD8F2F0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -73 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000093F696C65FB561F26F844E144F98501F53C955DF5D6F5DEE6B216B6478CB -7B9AF9FE8E498ECA906E6349643E77407A84932F947F9F6A64B06FAF71E674A8 -74DA7AC47C127E827CB27E988B9A8D0A947D9910994C52395BDF64E6672D7D2E -50ED53C358796158615961FA65AC7AD98B928B9650095021527555315A3C5EE0 -5F706134655E660C663666A269CD6EC46F32731676217A938139825983D684BC -50B557F05BC05BE85F6963A178267DB583DC852191C791F5518A67F57B560000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008CAC51C459BB60BD8655501CF9FF52545C3A617D621A62D364F265A56ECC -7620810A8E60965F96BB4EDF5343559859295DDD64C56CC96DFA73947A7F821B -85A68CE48E10907791E795E1962197C651F854F255865FB964A46F887DB48F1F -8F4D943550C95C166CBE6DFB751B77BB7C3D7C648A798AC2581E59BE5E166377 -7252758A776B8ADC8CBC8F125EF366746DF8807D83C18ACB97519BD6FA005243 -66FF6D956EEF7DE08AE6902E905E9AD4521D527F54E86194628462DB68A20000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -75 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00006912695A6A3570927126785D7901790E79D27A0D8096827882D583498549 -8C828D859162918B91AE4FC356D171ED77D7870089F85BF85FD6675190A853E2 -585A5BF560A4618164607E3D80708525928364AE50AC5D146700589C62BD63A8 -690E69786A1E6E6B76BA79CB82BB84298ACF8DA88FFD9112914B919C93109318 -939A96DB9A369C0D4E11755C795D7AFA7B517BC97E2E84C48E598E748EF89010 -6625693F744351FA672E9EDC51455FE06C9687F2885D887760B481B584030000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -76 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00008D0553D6543956345A365C31708A7FE0805A810681ED8DA391899A5F9DF2 -50744EC453A060FB6E2C5C644F88502455E45CD95E5F606568946CBB6DC471BE -75D475F476617A1A7A497DC77DFB7F6E81F486A98F1C96C999B39F52524752C5 -98ED89AA4E0367D26F064FB55BE267956C886D78741B782791DD937C87C479E4 -7A315FEB4ED654A4553E58AE59A560F0625362D6673669558235964099B199DD -502C53535544577CFA016258FA0264E2666B67DD6FC16FEF742274388A170000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -77 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000094385451560657665F48619A6B4E705870AD7DBB8A95596A812B63A27708 -803D8CAA5854642D69BB5B955E116E6FFA038569514C53F0592A6020614B6B86 -6C706CF07B1E80CE82D48DC690B098B1FA0464C76FA464916504514E5410571F -8A0E615F6876FA0575DB7B527D71901A580669CC817F892A9000983950785957 -59AC6295900F9B2A615D727995D657615A465DF4628A64AD64FA67776CE26D3E -722C743678347F7782AD8DDB981752245742677F724874E38CA98FA692110000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -78 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000962A516B53ED634C4F695504609665576C9B6D7F724C72FD7A1789878C9D -5F6D6F8E70F981A8610E4FBF504F624172477BC77DE87FE9904D97AD9A198CB6 -576A5E7367B0840D8A5554205B165E635EE25F0A658380BA853D9589965B4F48 -5305530D530F548654FA57035E036016629B62B16355FA066CE16D6675B17832 -80DE812F82DE846184B2888D8912900B92EA98FD9B915E4566B466DD70117206 -FA074FF5527D5F6A615367536A196F0274E2796888688C7998C798C49A430000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -79 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000054C17A1F69538AF78C4A98A899AE5F7C62AB75B276AE88AB907F96425339 -5F3C5FC56CCC73CC7562758B7B4682FE999D4E4F903C4E0B4F5553A6590F5EC8 -66306CB37455837787668CC09050971E9C1558D15B7886508B149DB45BD26068 -608D65F16C576F226FA3701A7F557FF095919592965097D352728F4451FD542B -54B85563558A6ABB6DB57DD88266929C96779E79540854C876D286E495A495D4 -965C4EA24F0959EE5AE65DF760526297676D68416C866E2F7F38809B822A0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FA08FA0998054EA5505554B35793595A5B695BB361C869776D77702387F9 -89E38A728AE7908299ED9AB852BE683850165E78674F8347884C4EAB541156AE -73E6911597FF9909995799995653589F865B8A3161B26AF6737B8ED26B4796AA -9A57595572008D6B97694FD45CF45F2661F8665B6CEB70AB738473B973FE7729 -774D7D437D627E2382378852FA0A8CE29249986F5B517A74884098015ACC4FE0 -5354593E5CFD633E6D7972F98105810783A292CF98304EA851445211578B0000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00005F626CC26ECE7005705070AF719273E97469834A87A28861900890A293A3 -99A8516E5F5760E0616766B385598E4A91AF978B4E4E4E92547C58D558FA597D -5CB55F2762366248660A66676BEB6D696DCF6E566EF86F946FE06FE9705D72D0 -7425745A74E07693795C7CCA7E1E80E182A6846B84BF864E865F87748B778C6A -93AC9800986560D1621691775A5A660F6DF76E3E743F9B425FFD60DA7B0F54C4 -5F186C5E6CD36D2A70D87D0586798A0C9D3B5316548C5B056A3A706B75750000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000798D79BE82B183EF8A718B418CA89774FA0B64F4652B78BA78BB7A6B4E38 -559A59505BA65E7B60A363DB6B61666568536E19716574B07D0890849A699C25 -6D3B6ED1733E8C4195CA51F05E4C5FA8604D60F66130614C6643664469A56CC1 -6E5F6EC96F62714C749C76877BC17C27835287579051968D9EC3532F56DE5EFB -5F8A6062609461F7666667036A9C6DEE6FAE7070736A7E6A81BE833486D48AA8 -8CC4528373725B966A6B940454EE56865B5D6548658566C9689F6D8D6DC60000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000723B80B491759A4D4FAF5019539A540E543C558955C55E3F5F8C673D7166 -73DD900552DB52F3586458CE7104718F71FB85B08A13668885A855A76684714A -8431534955996BC15F595FBD63EE668971478AF18F1D9EBE4F11643A70CB7566 -866760648B4E9DF8514751F653086D3680F89ED166156B23709875D554035C79 -7D078A166B206B3D6B46543860706D3D7FD5820850D651DE559C566B56CD59EC -5B095E0C619961986231665E66E6719971B971BA72A779A77A007FB28A700000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/macCentEuro.enc b/library/encoding/macCentEuro.enc deleted file mode 100644 index dde616a..0000000 --- a/library/encoding/macCentEuro.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macCentEuro, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C40100010100C9010400D600DC00E10105010C00E4010D0106010700E90179 -017A010E00ED010F01120113011600F3011700F400F600F500FA011A011B00FC -202000B0011800A300A7202200B600DF00AE00A92122011900A822600123012E -012F012A22642265012B0136220222110142013B013C013D013E0139013A0145 -0146014300AC221A01440147220600AB00BB202600A00148015000D50151014C -20132014201C201D2018201900F725CA014D0154015501582039203A01590156 -01570160201A201E0161015A015B00C10164016500CD017D017E016A00D300D4 -016B016E00DA016F017001710172017300DD00FD0137017B0141017C012202C7 diff --git a/library/encoding/macCroatian.enc b/library/encoding/macCroatian.enc deleted file mode 100644 index 132a74c..0000000 --- a/library/encoding/macCroatian.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macCroatian, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C400C500C700C900D100D600DC00E100E000E200E400E300E500E700E900E8 -00EA00EB00ED00EC00EE00EF00F100F300F200F400F600F500FA00F900FB00FC -202000B000A200A300A7202200B600DF00AE0160212200B400A82260017D00D8 -221E00B122642265220600B522022211220F0161222B00AA00BA2126017E00F8 -00BF00A100AC221A01922248010600AB010C202600A000C000C300D501520153 -01102014201C201D2018201900F725CAF8FF00A9204400A42039203A00C600BB -201300B7201A201E203000C2010700C1010D00C800CD00CE00CF00CC00D300D4 -011100D200DA00DB00D9013102C602DC00AF03C000CB02DA00B800CA00E602C7 diff --git a/library/encoding/macCyrillic.enc b/library/encoding/macCyrillic.enc deleted file mode 100644 index 5590833..0000000 --- a/library/encoding/macCyrillic.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macCyrillic, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0410041104120413041404150416041704180419041A041B041C041D041E041F -0420042104220423042404250426042704280429042A042B042C042D042E042F -202000B000A200A300A7202200B6040600AE00A9212204020452226004030453 -221E00B122642265045600B522020408040404540407045704090459040A045A -0458040500AC221A01922248220600AB00BB202600A0040B045B040C045C0455 -20132014201C201D2018201900F7201E040E045E040F045F211604010451044F -0430043104320433043404350436043704380439043A043B043C043D043E043F -0440044104420443044404450446044704480449044A044B044C044D044E00A4 diff --git a/library/encoding/macDingbats.enc b/library/encoding/macDingbats.enc deleted file mode 100644 index 28449cd..0000000 --- a/library/encoding/macDingbats.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macDingbats, single-byte -S -003F 1 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -00202701270227032704260E2706270727082709261B261E270C270D270E270F -2710271127122713271427152716271727182719271A271B271C271D271E271F -2720272127222723272427252726272726052729272A272B272C272D272E272F -2730273127322733273427352736273727382739273A273B273C273D273E273F -2740274127422743274427452746274727482749274A274B25CF274D25A0274F -27502751275225B225BC25C6275625D727582759275A275B275C275D275E007F -F8D7F8D8F8D9F8DAF8DBF8DCF8DDF8DEF8DFF8E0F8E1F8E2F8E3F8E4008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -0000276127622763276427652766276726632666266526602460246124622463 -2464246524662467246824692776277727782779277A277B277C277D277E277F -2780278127822783278427852786278727882789278A278B278C278D278E278F -2790279127922793279421922194219527982799279A279B279C279D279E279F -27A027A127A227A327A427A527A627A727A827A927AA27AB27AC27AD27AE27AF -000027B127B227B327B427B527B627B727B827B927BA27BB27BC27BD27BE0000 diff --git a/library/encoding/macGreek.enc b/library/encoding/macGreek.enc deleted file mode 100644 index fbfa51f..0000000 --- a/library/encoding/macGreek.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macGreek, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C400B900B200C900B300D600DC038500E000E200E4038400A800E700E900E8 -00EA00EB00A3212200EE00EF202200BD203000F400F600A600AD00F900FB00FC -2020039303940398039B039E03A000DF00AE00A903A303AA00A7226000B00387 -039100B12264226500A503920395039603970399039A039C03A603AB03A803A9 -03AC039D00AC039F03A1224803A400AB00BB202600A003A503A7038603880153 -20132015201C201D2018201900F70389038A038C038E03AD03AE03AF03CC038F -03CD03B103B203C803B403B503C603B303B703B903BE03BA03BB03BC03BD03BF -03C003CE03C103C303C403B803C903C203C703C503B603CA03CB039003B0F8A0 diff --git a/library/encoding/macIceland.enc b/library/encoding/macIceland.enc deleted file mode 100644 index e3fe9a9..0000000 --- a/library/encoding/macIceland.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macIceland, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C400C500C700C900D100D600DC00E100E000E200E400E300E500E700E900E8 -00EA00EB00ED00EC00EE00EF00F100F300F200F400F600F500FA00F900FB00FC -00DD00B000A200A300A7202200B600DF00AE00A9212200B400A8226000C600D8 -221E00B12264226500A500B522022211220F03C0222B00AA00BA212600E600F8 -00BF00A100AC221A01922248220600AB00BB202600A000C000C300D501520153 -20132014201C201D2018201900F725CA00FF0178204400A400D000F000DE00FE -00FD00B7201A201E203000C200CA00C100CB00C800CD00CE00CF00CC00D300D4 -F8FF00D200DA00DB00D9013102C602DC00AF02D802D902DA00B802DD02DB02C7 diff --git a/library/encoding/macJapan.enc b/library/encoding/macJapan.enc deleted file mode 100644 index dba24bd..0000000 --- a/library/encoding/macJapan.enc +++ /dev/null @@ -1,785 +0,0 @@ -# Encoding file: macJapan, multi-byte -M -003F 0 46 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00A0FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F -FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F -FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F -FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F -0000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000A921222026 -81 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8FF3E -203EFF3F30FD30FE309D309E30034EDD30053006300730FC20142010FF0FFF3C -301C2016FF5C22EF202520182019201C201DFF08FF0930143015FF3BFF3DFF5B -FF5D30083009300A300B300C300D300E300F30103011FF0B221200B100D70000 -00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5 -FF0400A200A3FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C725C6 -25A125A025B325B225BD25BC203B301221922190219121933013000000000000 -000000000000000000000000000000002208220B2286228722822283222A2229 -000000000000000000000000000000002227222800AC21D221D4220022030000 -0000000000000000000000000000000000000000222022A52312220222072261 -2252226A226B221A223D221D2235222B222C0000000000000000000000000000 -212B2030266F266D266A2020202100B6000000000000000025EF000000000000 -82 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000FF10 -FF11FF12FF13FF14FF15FF16FF17FF18FF190000000000000000000000000000 -FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2FFF30 -FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3A000000000000000000000000 -0000FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5A00000000000000003041 -30423043304430453046304730483049304A304B304C304D304E304F30503051 -30523053305430553056305730583059305A305B305C305D305E305F30603061 -30623063306430653066306730683069306A306B306C306D306E306F30703071 -30723073307430753076307730783079307A307B307C307D307E307F30803081 -30823083308430853086308730883089308A308B308C308D308E308F30903091 -3092309300000000000000000000000000000000000000000000000000000000 -83 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF30B0 -30B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF30C0 -30C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF30D0 -30D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF0000 -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000391 -03920393039403950396039703980399039A039B039C039D039E039F03A003A1 -03A303A403A503A603A703A803A90000000000000000000000000000000003B1 -03B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF03C003C1 -03C303C403C503C603C703C803C9000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -84 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -04100411041204130414041504010416041704180419041A041B041C041D041E -041F0420042104220423042404250426042704280429042A042B042C042D042E -042F000000000000000000000000000000000000000000000000000000000000 -04300431043204330434043504510436043704380439043A043B043C043D0000 -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000002500 -2502250C251025182514251C252C25242534253C25012503250F2513251B2517 -25232533252B253B254B2520252F25282537253F251D25302525253825420000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -85 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -2460246124622463246424652466246724682469246A246B246C246D246E246F -2470247124722473000000000000000000000000000000000000000024742475 -2476247724782479247A247B247C247D247E247F248024812482248324842485 -2486248700000000000000000000000000000000000000002776277727780000 -2779277A277B277C277D277E0000000000000000000000000000000000000000 -0000F8A124882489248A248B248C248D248E248F249000000000000000002160 -216121622163216421652166216721682169216A216BF8A2F8A3F8A400000000 -0000000000002170217121722173217421752176217721782179217A217BF8A5 -F8A6F8A700000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000249C249D249E249F24A0 -24A124A224A324A424A524A624A724A824A924AA24AB24AC24AD24AE24AF24B0 -24B124B224B324B424B500000000000000000000000000000000000000000000 -86 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -339C339F339D33A033A4F8A833A133A5339E33A2338EF8A9338F33C433963397 -F8AA339833B333B233B133B0210933D433CB3390338533863387F8AB00000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000211633CD2121F8AC2664 -2667266126622660266326652666000000000000000000000000000000000000 -0000000000003020260E30040000000000000000000000000000000000000000 -0000000000000000000000000000261E261C261D261F21C621C421C5F8AD21E8 -21E621E721E9F8AEF8AFF8B0F8B1000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -87 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -3230322A322B322C322D322E322F32403237324232433239323A3231323E3234 -3232323B323632333235323C323D323F32380000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000059275C0F32A432A532A632A732A832A93296329D3298329E63A732993349 -3322334D3314331633053333334E330333363318331533273351334A33393357 -330D334233233326333B332B00000000000000000000000000003300331E332A -3331334700000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000337E337D337C337B0000000000000000000000000000 -0000000000000000000000000000000000000000337FF8B2F8B3000000000000 -88 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -222E221F22BF0000000000000000000000000000000000000000000000000000 -0000000000000000301DF8B40000000000000000000000000000000000000000 -000000000000000000000000000000003094000030F730F830F930FA00000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000004E9C -55165A03963F54C0611B632859F690228475831C7A5060AA63E16E2565ED8466 -82A69BF56893572765A162715B9B59D0867B98F47D627DBE9B8E62167C9F88B7 -5B895EB563096697684895C7978D674F4EE54F0A4F4D4F9D504956F2593759D4 -5A015C0960DF610F61706613690570BA754F757079FB7DAD7DEF80C3840E8863 -8B029055907A533B4E954EA557DF80B290C178EF4E0058F16EA290387A328328 -828B9C2F5141537054BD54E156E059FB5F1598F26DEB80E4852D000000000000 -89 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9662967096A097FB540B53F35B8770CF7FBD8FC296E8536F9D5C7ABA4E117893 -81FC6E26561855046B1D851A9C3B59E553A96D6674DC958F56424E91904B96F2 -834F990C53E155B65B305F71662066F368046C386CF36D29745B76C87A4E9834 -82F1885B8A6092ED6DB275AB76CA99C560A68B018D8A95B2698E53AD51860000 -5712583059445BB45EF6602863A963F46CBF6F14708E7114715971D5733F7E01 -827682D185979060925B9D1B586965BC6C5A752551F9592E59655F805FDC62BC -65FA6A2A6B276BB4738B7FC189569D2C9D0E9EC45CA16C96837B51045C4B61B6 -81C6687672614E594FFA537860696E297A4F97F34E0B53164EEE4F554F3D4FA1 -4F7352A053EF5609590F5AC15BB65BE179D16687679C67B66B4C6CB3706B73C2 -798D79BE7A3C7B8782B182DB8304837783EF83D387668AB256298CA88FE6904E -971E868A4FC45CE862117259753B81E582BD86FE8CC096C5991399D54ECB4F1A -89E356DE584A58CA5EFB5FEB602A6094606261D0621262D06539000000000000 -8A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9B41666668B06D777070754C76867D7582A587F9958B968E8C9D51F152BE5916 -54B35BB35D16616869826DAF788D84CB88578A7293A79AB86D6C99A886D957A3 -67FF86CE920E5283568754045ED362E164B9683C68386BBB737278BA7A6B899A -89D28D6B8F0390ED95A3969497695B665CB3697D984D984E639B7B206A2B0000 -6A7F68B69C0D6F5F5272559D607062EC6D3B6E076ED1845B89108F444E149C39 -53F6691B6A3A9784682A515C7AC384B291DC938C565B9D286822830584317CA5 -520882C574E64E7E4F8351A05BD2520A52D852E75DFB559A582A59E65B8C5B98 -5BDB5E725E7960A3611F616361BE63DB656267D1685368FA6B3E6B536C576F22 -6F976F4574B0751876E3770B7AFF7BA17C217DE97F367FF0809D8266839E89B3 -8ACC8CAB908494519593959195A2966597D3992882184E38542B5CB85DCC73A9 -764C773C5CA97FEB8D0B96C19811985498584F014F0E5371559C566857FA5947 -5B095BC45C905E0C5E7E5FCC63EE673A65D765E2671F68CB68C4000000000000 -8B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A5F5E306BC56C176C7D757F79485B637A007D005FBD898F8A188CB48D778ECC -8F1D98E29A0E9B3C4E80507D510059935B9C622F628064EC6B3A72A075917947 -7FA987FB8ABC8B7063AC83CA97A05409540355AB68546A588A70782767759ECD -53745BA2811A865090064E184E454EC74F1153CA54385BAE5F13602565510000 -673D6C426C726CE3707874037A767AAE7B087D1A7CFE7D6665E7725B53BB5C45 -5DE862D262E063196E20865A8A318DDD92F86F0179A69B5A4EA84EAB4EAC4F9B -4FA050D151477AF6517151F653545321537F53EB55AC58835CE15F375F4A602F -6050606D631F65596A4B6CC172C272ED77EF80F881058208854E90F793E197FF -99579A5A4EF051DD5C2D6681696D5C4066F26975738968507C8150C552E45747 -5DFE932665A46B236B3D7434798179BD7B4B7DCA82B983CC887F895F8B398FD1 -91D1541F92804E5D503653E5533A72D7739677E982E68EAF99C699C899D25177 -611A865E55B07A7A50765BD3904796854E326ADB91E75C515C48000000000000 -8C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63987A9F6C9397748F617AAA718A96887C8268177E706851936C52F2541B85AB -8A137FA48ECD90E15366888879414FC250BE521151445553572D73EA578B5951 -5F625F8460756176616761A963B2643A656C666F68426E1375667A3D7CFB7D4C -7D997E4B7F6B830E834A86CD8A088A638B668EFD981A9D8F82B88FCE9BE80000 -5287621F64836FC09699684150916B206C7A6F547A747D5088408A2367084EF6 -503950265065517C5238526355A7570F58055ACC5EFA61B261F862F36372691C -6A29727D72AC732E7814786F7D79770C80A9898B8B198CE28ED290639375967A -98559A139E785143539F53B35E7B5F266E1B6E90738473FE7D4382378A008AFA -96504E4E500B53E4547C56FA59D15B645DF15EAB5F276238654567AF6E5672D0 -7CCA88B480A180E183F0864E8A878DE8923796C798679F134E944E924F0D5348 -5449543E5A2F5F8C5FA1609F68A76A8E745A78818A9E8AA48B7791904E5E9BC9 -4EA44F7C4FAF501950165149516C529F52B952FE539A53E35411000000000000 -8D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -540E5589575157A2597D5B545B5D5B8F5DE55DE75DF75E785E835E9A5EB75F18 -6052614C629762D863A7653B6602664366F4676D6821689769CB6C5F6D2A6D69 -6E2F6E9D75327687786C7A3F7CE07D057D187D5E7DB18015800380AF80B18154 -818F822A8352884C88618B1B8CA28CFC90CA91759271783F92FC95A4964D0000 -980599999AD89D3B525B52AB53F7540858D562F76FE08C6A8F5F9EB9514B523B -544A56FD7A4091779D609ED273446F09817075115FFD60DA9AA872DB8FBC6B64 -98034ECA56F0576458BE5A5A606861C7660F6606683968B16DF775D57D3A826E -9B424E9B4F5053C955065D6F5DE65DEE67FB6C99747378028A50939688DF5750 -5EA7632B50B550AC518D670054C9585E59BB5BB05F69624D63A1683D6B736E08 -707D91C7728078157826796D658E7D3083DC88C18F09969B5264572867507F6A -8CA151B45742962A583A698A80B454B25D0E57FC78959DFA4F5C524A548B643E -6628671467F57A847B567D22932F685C9BAD7B395319518A5237000000000000 -8E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5BDF62F664AE64E6672D6BBA85A996D176909BD6634C93069BAB76BF66524E09 -509853C25C7160E864926563685F71E673CA75237B977E8286958B838CDB9178 -991065AC66AB6B8B4ED54ED44F3A4F7F523A53F853F255E356DB58EB59CB59C9 -59FF5B505C4D5E025E2B5FD7601D6307652F5B5C65AF65BD65E8679D6B620000 -6B7B6C0F7345794979C17CF87D197D2B80A2810281F389968A5E8A698A668A8C -8AEE8CC78CDC96CC98FC6B6F4E8B4F3C4F8D51505B575BFA6148630166426B21 -6ECB6CBB723E74BD75D478C1793A800C803381EA84948F9E6C509E7F5F0F8B58 -9D2B7AFA8EF85B8D96EB4E0353F157F759315AC95BA460896E7F6F0675BE8CEA -5B9F85007BE0507267F4829D5C61854A7E1E820E51995C0463688D66659C716E -793E7D1780058B1D8ECA906E86C790AA501F52FA5C3A6753707C7235914C91C8 -932B82E55BC25F3160F94E3B53D65B88624B67316B8A72E973E07A2E816B8DA3 -91529996511253D7546A5BFF63886A397DAC970056DA53CE5468000000000000 -8F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B975C315DDE4FEE610162FE6D3279C079CB7D427E4D7FD281ED821F84908846 -89728B908E748F2F9031914B916C96C6919C4EC04F4F514553415F93620E67D4 -6C416E0B73637E2691CD928353D459195BBF6DD1795D7E2E7C9B587E719F51FA -88538FF04FCA5CFB662577AC7AE3821C99FF51C65FAA65EC696F6B896DF30000 -6E966F6476FE7D145DE190759187980651E6521D6240669166D96E1A5EB67DD2 -7F7266F885AF85F78AF852A953D959735E8F5F90605592E4966450B7511F52DD -5320534753EC54E8554655315617596859BE5A3C5BB55C065C0F5C115C1A5E84 -5E8A5EE05F70627F628462DB638C63776607660C662D6676677E68A26A1F6A35 -6CBC6D886E096E58713C7126716775C77701785D7901796579F07AE07B117CA7 -7D39809683D6848B8549885D88F38A1F8A3C8A548A738C618CDE91A49266937E -9418969C97984E0A4E084E1E4E575197527057CE583458CC5B225E3860C564FE -676167566D4472B675737A6384B88B7291B89320563157F498FE000000000000 -90 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62ED690D6B9671ED7E548077827289E698DF87558FB15C3B4F384FE14FB55507 -5A205BDD5BE95FC3614E632F65B0664B68EE699B6D786DF1753375B9771F795E -79E67D3381E382AF85AA89AA8A3A8EAB8F9B903291DD97074EBA4EC152035875 -58EC5C0B751A5C3D814E8A0A8FC59663976D7B258ACF9808916256F353A80000 -9017543957825E2563A86C34708A77617C8B7FE088709042915493109318968F -745E9AC45D075D69657067A28DA896DB636E6749691983C5981796C088FE6F84 -647A5BF84E16702C755D662F51C4523652E259D35F8160276210653F6574661F -667468F268166B636E057272751F76DB7CBE805658F088FD897F8AA08A938ACB -901D91929752975965897A0E810696BB5E2D60DC621A65A56614679077F37A4D -7C4D7E3E810A8CAC8D648DE18E5F78A9520762D963A5644262988A2D7A837BC0 -8AAC96EA7D76820C87494ED95148534353605BA35C025C165DDD6226624764B0 -681368346CC96D456D1767D36F5C714E717D65CB7A7F7BAD7DDA000000000000 -91 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7E4A7FA8817A821B823985A68A6E8CCE8DF59078907792AD929195839BAE524D -55846F387136516879857E5581B37CCE564C58515CA863AA66FE66FD695A72D9 -758F758E790E795679DF7C977D207D4486078A34963B90619F2050E7527553CC -53E2500955AA58EE594F723D5B8B5C64531D60E360F3635C6383633F63BB0000 -64CD65E966F95DE369CD69FD6F1571E54E8975E976F87A937CDF7DCF7D9C8061 -83498358846C84BC85FB88C58D709001906D9397971C9A1250CF5897618E81D3 -85358D0890204FC3507452475373606F6349675F6E2C8DB3901F4FD75C5E8CCA -65CF7D9A53528896517663C35B585B6B5C0A640D6751905C4ED6591A592A6C70 -8A51553E581559A560F0625367C182356955964099C49A284F5358065BFE8010 -5CB15E2F5F856020614B623466FF6CF06EDE80CE817F82D4888B8CB89000902E -968A9EDB9BDB4EE353F059277B2C918D984C9DF96EDD7027535355445B856258 -629E62D36CA26FEF74228A1794386FC18AFE833851E786F853EA000000000000 -92 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53E94F4690548FB0596A81315DFD7AEA8FBF68DA8C3772F89C486A3D8AB04E39 -53585606576662C563A265E66B4E6DE16E5B70AD77ED7AEF7BAA7DBB803D80C6 -86CB8A95935B56E358C75F3E65AD66966A806BB575378AC7502477E557305F1B -6065667A6C6075F47A1A7F6E81F48718904599B37BC9755C7AF97B5184C40000 -901079E97A9283365AE177404E2D4EF25B995FE062BD663C67F16CE8866B8877 -8A3B914E92F399D06A177026732A82E784578CAF4E01514651CB558B5BF55E16 -5E335E815F145F355F6B5FB461F2631166A2671D6F6E7252753A773A80748139 -817887768ABF8ADC8D858DF3929A957798029CE552C5635776F467156C8873CD -8CC393AE96736D25589C690E69CC8FFD939A75DB901A585A680263B469FB4F43 -6F2C67D88FBB85267DB49354693F6F70576A58F75B2C7D2C722A540A91E39DB4 -4EAD4F4E505C507552438C9E544858245B9A5E1D5E955EAD5EF75F1F608C62B5 -633A63D068AF6C407887798E7A0B7DE082478A028AE68E449013000000000000 -93 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -90B8912D91D89F0E6CE5645864E265756EF476847B1B906993D16EBA54F25FB9 -64A48F4D8FED92445178586B59295C555E976DFB7E8F751C8CBC8EE2985B70B9 -4F1D6BBF6FB1753096FB514E54105835585759AC5C605F926597675C6E21767B -83DF8CED901490FD934D7825783A52AA5EA6571F597460125012515A51AC0000 -51CD520055105854585859575B955CF65D8B60BC6295642D6771684368BC68DF -76D76DD86E6F6D9B706F71C85F5375D879777B497B547B527CD67D7152308463 -856985E48A0E8B048C468E0F9003900F94199676982D9A3095D850CD52D5540C -58025C0E61A7649E6D1E77B37AE580F48404905392855CE09D07533F5F975FB3 -6D9C7279776379BF7BE46BD272EC8AAD68036A6151F87A8169345C4A9CF682EB -5BC59149701E56785C6F60C765666C8C8C5A90419813545166C7920D594890A3 -51854E4D51EA85998B0E7058637A934B696299B47E047577535769608EDF96E3 -6C5D4E8C5C3C5F108FE953028CD1808986795EFF65E54E735165000000000000 -94 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59825C3F97EE4EFB598A5FCD8A8D6FE179B079625BE78471732B71B15E745FF5 -637B649A71C37C984E435EFC4E4B57DC56A260A96FC37D0D80FD813381BF8FB2 -899786A45DF4628A64AD898767776CE26D3E743678345A467F7582AD99AC4FF3 -5EC362DD63926557676F76C3724C80CC80BA8F29914D500D57F95A9268850000 -6973716472FD8CB758F28CE0966A9019877F79E477E784294F2F5265535A62CD -67CF6CCA767D7B947C95823685848FEB66DD6F2072067E1B83AB99C19EA651FD -7BB178727BB880877B486AE85E61808C75517560516B92626E8C767A91979AEA -4F107F70629C7B4F95A59CE9567A585986E496BC4F345224534A53CD53DB5E06 -642C6591677F6C3E6C4E724872AF73ED75547E41822C85E98CA97BC491C67169 -981298EF633D6669756A76E478D0854386EE532A5351542659835E875F7C60B2 -6249627962AB65906BD46CCC75B276AE789179D87DCB7F7780A588AB8AB98CBB -907F975E98DB6A0B7C3850995C3E5FAE67876BD8743577097F8E000000000000 -95 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9F3B67CA7A175339758B9AED5F66819D83F180985F3C5FC575627B46903C6867 -59EB5A9B7D10767E8B2C4FF55F6A6A196C376F0274E2796888688A558C795EDF -63CF75C579D282D7932892F2849C86ED9C2D54C15F6C658C6D5C70158CA78CD3 -983B654F74F64E0D4ED857E0592B5A665BCC51A85E035E9C6016627665770000 -65A7666E6D6E72367B268150819A82998B5C8CA08CE68D74961C96444FAE64AB -6B66821E8461856A90E85C01695398A8847A85574F0F526F5FA95E45670D798F -8179890789866DF55F1762556CB84ECF72699B925206543B567458B361A4626E -711A596E7C897CDE7D1B96F06587805E4E194F75517558405E635E735F0A67C4 -4E26853D9589965B7C73980150FB58C1765678A7522577A585117B86504F5909 -72477BC77DE88FBA8FD4904D4FBF52C95A295F0197AD4FDD821792EA57036355 -6B69752B88DC8F147A4252DF58936155620A66AE6BCD7C3F83E950234FF85305 -5446583159495B9D5CF05CEF5D295E9662B16367653E65B9670B000000000000 -96 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6CD56CE170F978327E2B80DE82B3840C84EC870289128A2A8C4A90A692D298FD -9CF39D6C4E4F4EA1508D5256574A59A85E3D5FD85FD9623F66B4671B67D068D2 -51927D2180AA81A88B008C8C8CBF927E96325420982C531750D5535C58A864B2 -6734726777667A4691E652C36CA16B8658005E4C5954672C7FFB51E176C60000 -646978E89B549EBB57CB59B96627679A6BCE54E969D95E55819C67959BAA67FE -9C52685D4EA64FE353C862B9672B6CAB8FC44FAD7E6D9EBF4E0761626E806F2B -85135473672A9B455DF37B955CAC5BC6871C6E4A84D17A14810859997C8D6C11 -772052D959227121725F77DB97279D61690B5A7F5A1851A5540D547D660E76DF -8FF792989CF459EA725D6EC5514D68C97DBF7DEC97629EBA64786A2183025984 -5B5F6BDB731B76F27DB280178499513267289ED976EE676252FF99055C24623B -7C7E8CB0554F60B67D0B958053014E5F51B6591C723A803691CE5F2577E25384 -5F797D0485AC8A338E8D975667F385AE9453610961086CB97652000000000000 -97 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8AED8F38552F4F51512A52C753CB5BA55E7D60A0618263D6670967DA6E676D8C -733673377531795088D58A98904A909190F596C4878D59154E884F594E0E8A89 -8F3F981050AD5E7C59965BB95EB863DA63FA64C166DC694A69D86D0B6EB67194 -75287AAF7F8A8000844984C989818B218E0A9065967D990A617E62916B320000 -6C836D747FCC7FFC6DC07F8587BA88F8676583B1983C96F76D1B7D61843D916A -4E7153755D506B046FEB85CD862D89A75229540F5C65674E68A87406748375E2 -88CF88E191CC96E296785F8B73877ACB844E63A0756552896D416E9C74097559 -786B7C9296867ADC9F8D4FB6616E65C5865C4E864EAE50DA4E2151CC5BEE6599 -68816DBC731F764277AD7A1C7CE7826F8AD2907C91CF96759818529B7DD1502B -539867976DCB71D0743381E88F2A96A39C579E9F746058416D997D2F985E4EE4 -4F364F8B51B752B15DBA601C73B2793C82D3923496B796F6970A9E979F6266A6 -6B74521752A370C888C25EC9604B61906F2371497C3E7DF4806F000000000000 -98 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -84EE9023932C54429B6F6AD370898CC28DEF973252B45A415ECA5F046717697C -69946D6A6F0F726272FC7BED8001807E874B90CE516D9E937984808B93328AD6 -502D548C8A716B6A8CC4810760D167A09DF24E994E989C108A6B85C185686900 -6E7E789781550000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000005F0C -4E104E154E2A4E314E364E3C4E3F4E424E564E584E824E858C6B4E8A82125F0D -4E8E4E9E4E9F4EA04EA24EB04EB34EB64ECE4ECD4EC44EC64EC24ED74EDE4EED -4EDF4EF74F094F5A4F304F5B4F5D4F574F474F764F884F8F4F984F7B4F694F70 -4F914F6F4F864F9651184FD44FDF4FCE4FD84FDB4FD14FDA4FD04FE44FE5501A -50285014502A502550054F1C4FF650215029502C4FFE4FEF5011500650435047 -6703505550505048505A5056506C50785080509A508550B450B2000000000000 -99 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50C950CA50B350C250D650DE50E550ED50E350EE50F950F55109510151025116 -51155114511A5121513A5137513C513B513F51405152514C515451627AF85169 -516A516E5180518256D8518C5189518F519151935195519651A451A651A251A9 -51AA51AB51B351B151B251B051B551BD51C551C951DB51E0865551E951ED0000 -51F051F551FE5204520B5214520E5227522A522E52335239524F5244524B524C -525E5254526A527452695273527F527D528D529452925271528852918FA88FA7 -52AC52AD52BC52B552C152CD52D752DE52E352E698ED52E052F352F552F852F9 -530653087538530D5310530F5315531A5323532F533153335338534053465345 -4E175349534D51D6535E5369536E5918537B53775382539653A053A653A553AE -53B053B653C37C1296D953DF66FC71EE53EE53E853ED53FA5401543D5440542C -542D543C542E54365429541D544E548F5475548E545F5471547754705492547B -5480547654845490548654C754A254B854A554AC54C454C854A8000000000000 -9A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54AB54C254A454BE54BC54D854E554E6550F551454FD54EE54ED54FA54E25539 -55405563554C552E555C55455556555755385533555D5599558054AF558A559F -557B557E5598559E55AE557C558355A9558755A855DA55C555DF55C455DC55E4 -55D4561455F7561655FE55FD561B55F9564E565071DF56345636563256380000 -566B5664562F566C566A56865680568A56A05694568F56A556AE56B656B456C2 -56BC56C156C356C056C856CE56D156D356D756EE56F9570056FF570457095708 -570B570D57135718571655C7571C572657375738574E573B5740574F576957C0 -57885761577F5789579357A057B357A457AA57B057C357C657D457D257D3580A -57D657E3580B5819581D587258215862584B58706BC05852583D5879588558B9 -589F58AB58BA58DE58BB58B858AE58C558D358D158D758D958D858E558DC58E4 -58DF58EF58FA58F958FB58FC58FD5902590A5910591B68A65925592C592D5932 -5938593E7AD259555950594E595A5958596259605967596C5969000000000000 -9B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59785981599D4F5E4FAB59A359B259C659E859DC598D59D959DA5A255A1F5A11 -5A1C5A095A1A5A405A6C5A495A355A365A625A6A5A9A5ABC5ABE5ACB5AC25ABD -5AE35AD75AE65AE95AD65AFA5AFB5B0C5B0B5B165B325AD05B2A5B365B3E5B43 -5B455B405B515B555B5A5B5B5B655B695B705B735B755B7865885B7A5B800000 -5B835BA65BB85BC35BC75BC95BD45BD05BE45BE65BE25BDE5BE55BEB5BF05BF6 -5BF35C055C075C085C0D5C135C205C225C285C385C395C415C465C4E5C535C50 -5C4F5B715C6C5C6E4E625C765C795C8C5C915C94599B5CAB5CBB5CB65CBC5CB7 -5CC55CBE5CC75CD95CE95CFD5CFA5CED5D8C5CEA5D0B5D155D175D5C5D1F5D1B -5D115D145D225D1A5D195D185D4C5D525D4E5D4B5D6C5D735D765D875D845D82 -5DA25D9D5DAC5DAE5DBD5D905DB75DBC5DC95DCD5DD35DD25DD65DDB5DEB5DF2 -5DF55E0B5E1A5E195E115E1B5E365E375E445E435E405E4E5E575E545E5F5E62 -5E645E475E755E765E7A9EBC5E7F5EA05EC15EC25EC85ED05ECF000000000000 -9C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5ED65EE35EDD5EDA5EDB5EE25EE15EE85EE95EEC5EF15EF35EF05EF45EF85EFE -5F035F095F5D5F5C5F0B5F115F165F295F2D5F385F415F485F4C5F4E5F2F5F51 -5F565F575F595F615F6D5F735F775F835F825F7F5F8A5F885F915F875F9E5F99 -5F985FA05FA85FAD5FBC5FD65FFB5FE45FF85FF15FDD60B35FFF602160600000 -601960106029600E6031601B6015602B6026600F603A605A6041606A6077605F -604A6046604D6063604360646042606C606B60596081608D60E76083609A6084 -609B60966097609260A7608B60E160B860E060D360B45FF060BD60C660B560D8 -614D6115610660F660F7610060F460FA6103612160FB60F1610D610E6147613E -61286127614A613F613C612C6134613D614261446173617761586159615A616B -6174616F61656171615F615D6153617561996196618761AC6194619A618A6191 -61AB61AE61CC61CA61C961F761C861C361C661BA61CB7F7961CD61E661E361F6 -61FA61F461FF61FD61FC61FE620062086209620D620C6214621B000000000000 -9D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -621E6221622A622E6230623262336241624E625E6263625B62606268627C6282 -6289627E62926293629662D46283629462D762D162BB62CF62FF62C664D462C8 -62DC62CC62CA62C262C7629B62C9630C62EE62F163276302630862EF62F56350 -633E634D641C634F6396638E638063AB637663A3638F6389639F63B5636B0000 -636963BE63E963C063C663E363C963D263F663C4641664346406641364266436 -651D64176428640F6467646F6476644E652A6495649364A564A9648864BC64DA -64D264C564C764BB64D864C264F164E7820964E064E162AC64E364EF652C64F6 -64F464F264FA650064FD6518651C650565246523652B65346535653765366538 -754B654865566555654D6558655E655D65726578658265838B8A659B659F65AB -65B765C365C665C165C465CC65D265DB65D965E065E165F16772660A660365FB -6773663566366634661C664F664466496641665E665D666466676668665F6662 -667066836688668E668966846698669D66C166B966C966BE66BC000000000000 -9E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -66C466B866D666DA66E0663F66E666E966F066F566F7670F6716671E67266727 -9738672E673F67366741673867376746675E67606759676367646789677067A9 -677C676A678C678B67A667A1678567B767EF67B467EC67B367E967B867E467DE -67DD67E267EE67B967CE67C667E76A9C681E684668296840684D6832684E0000 -68B3682B685968636877687F689F688F68AD6894689D689B68836AAE68B96874 -68B568A068BA690F688D687E690168CA690868D86922692668E1690C68CD68D4 -68E768D569366912690468D768E3692568F968E068EF6928692A691A69236921 -68C669796977695C6978696B6954697E696E69396974693D695969306961695E -695D6981696A69B269AE69D069BF69C169D369BE69CE5BE869CA69DD69BB69C3 -69A76A2E699169A0699C699569B469DE69E86A026A1B69FF6B0A69F969F269E7 -6A0569B16A1E69ED6A1469EB6A0A6A126AC16A236A136A446A0C6A726A366A78 -6A476A626A596A666A486A386A226A906A8D6AA06A846AA26AA3000000000000 -9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A9786176ABB6AC36AC26AB86AB36AAC6ADE6AD16ADF6AAA6ADA6AEA6AFB6B05 -86166AFA6B126B169B316B1F6B386B3776DC6B3998EE6B476B436B496B506B59 -6B546B5B6B5F6B616B786B796B7F6B806B846B836B8D6B986B956B9E6BA46BAA -6BAB6BAF6BB26BB16BB36BB76BBC6BC66BCB6BD36BDF6BEC6BEB6BF36BEF0000 -9EBE6C086C136C146C1B6C246C236C5E6C556C626C6A6C826C8D6C9A6C816C9B -6C7E6C686C736C926C906CC46CF16CD36CBD6CD76CC56CDD6CAE6CB16CBE6CBA -6CDB6CEF6CD96CEA6D1F884D6D366D2B6D3D6D386D196D356D336D126D0C6D63 -6D936D646D5A6D796D596D8E6D956FE46D856DF96E156E0A6DB56DC76DE66DB8 -6DC66DEC6DDE6DCC6DE86DD26DC56DFA6DD96DE46DD56DEA6DEE6E2D6E6E6E2E -6E196E726E5F6E3E6E236E6B6E2B6E766E4D6E1F6E436E3A6E4E6E246EFF6E1D -6E386E826EAA6E986EC96EB76ED36EBD6EAF6EC46EB26ED46ED56E8F6EA56EC2 -6E9F6F416F11704C6EEC6EF86EFE6F3F6EF26F316EEF6F326ECC000000000000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F3E6F136EF76F866F7A6F786F816F806F6F6F5B6FF36F6D6F826F7C6F586F8E -6F916FC26F666FB36FA36FA16FA46FB96FC66FAA6FDF6FD56FEC6FD46FD86FF1 -6FEE6FDB7009700B6FFA70117001700F6FFE701B701A6F74701D7018701F7030 -703E7032705170637099709270AF70F170AC70B870B370AE70DF70CB70DD0000 -70D9710970FD711C711971657155718871667162714C7156716C718F71FB7184 -719571A871AC71D771B971BE71D271C971D471CE71E071EC71E771F571FC71F9 -71FF720D7210721B7228722D722C72307232723B723C723F72407246724B7258 -7274727E7282728172877292729672A272A772B972B272C372C672C472CE72D2 -72E272E072E172F972F7500F7317730A731C7316731D7334732F73297325733E -734E734F9ED87357736A7368737073787375737B737A73C873B373CE73BB73C0 -73E573EE73DE74A27405746F742573F87432743A7455743F745F74597441745C -746974707463746A7476747E748B749E74A774CA74CF74D473F1000000000000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74E074E374E774E974EE74F274F074F174F874F7750475037505750C750E750D -75157513751E7526752C753C7544754D754A7549755B7546755A756975647567 -756B756D75787576758675877574758A758975827594759A759D75A575A375C2 -75B375C375B575BD75B875BC75B175CD75CA75D275D975E375DE75FE75FF0000 -75FC760175F075FA75F275F3760B760D7609761F762776207621762276247634 -7630763B764776487646765C76587661766276687669766A7667766C76707672 -76767678767C768076837688768B768E769676937699769A76B076B476B876B9 -76BA76C276CD76D676D276DE76E176E576E776EA862F76FB7708770777047729 -7724771E77257726771B773777387747775A7768776B775B7765777F777E7779 -778E778B779177A0779E77B077B677B977BF77BC77BD77BB77C777CD77D777DA -77DC77E377EE77FC780C781279267820792A7845788E78747886787C789A788C -78A378B578AA78AF78D178C678CB78D478BE78BC78C578CA78EC000000000000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -78E778DA78FD78F47907791279117919792C792B794079607957795F795A7955 -7953797A797F798A799D79A79F4B79AA79AE79B379B979BA79C979D579E779EC -79E179E37A087A0D7A187A197A207A1F79807A317A3B7A3E7A377A437A577A49 -7A617A627A699F9D7A707A797A7D7A887A977A957A987A967AA97AC87AB00000 -7AB67AC57AC47ABF90837AC77ACA7ACD7ACF7AD57AD37AD97ADA7ADD7AE17AE2 -7AE67AED7AF07B027B0F7B0A7B067B337B187B197B1E7B357B287B367B507B7A -7B047B4D7B0B7B4C7B457B757B657B747B677B707B717B6C7B6E7B9D7B987B9F -7B8D7B9C7B9A7B8B7B927B8F7B5D7B997BCB7BC17BCC7BCF7BB47BC67BDD7BE9 -7C117C147BE67BE57C607C007C077C137BF37BF77C177C0D7BF67C237C277C2A -7C1F7C377C2B7C3D7C4C7C437C547C4F7C407C507C587C5F7C647C567C657C6C -7C757C837C907CA47CAD7CA27CAB7CA17CA87CB37CB27CB17CAE7CB97CBD7CC0 -7CC57CC27CD87CD27CDC7CE29B3B7CEF7CF27CF47CF67CFA7D06000000000000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7D027D1C7D157D0A7D457D4B7D2E7D327D3F7D357D467D737D567D4E7D727D68 -7D6E7D4F7D637D937D897D5B7D8F7D7D7D9B7DBA7DAE7DA37DB57DC77DBD7DAB -7E3D7DA27DAF7DDC7DB87D9F7DB07DD87DDD7DE47DDE7DFB7DF27DE17E057E0A -7E237E217E127E317E1F7E097E0B7E227E467E667E3B7E357E397E437E370000 -7E327E3A7E677E5D7E567E5E7E597E5A7E797E6A7E697E7C7E7B7E837DD57E7D -8FAE7E7F7E887E897E8C7E927E907E937E947E967E8E7E9B7E9C7F387F3A7F45 -7F4C7F4D7F4E7F507F517F557F547F587F5F7F607F687F697F677F787F827F86 -7F837F887F877F8C7F947F9E7F9D7F9A7FA37FAF7FB27FB97FAE7FB67FB88B71 -7FC57FC67FCA7FD57FD47FE17FE67FE97FF37FF998DC80068004800B80128018 -8019801C80218028803F803B804A804680528058805A805F8062806880738072 -807080768079807D807F808480868085809B8093809A80AD519080AC80DB80E5 -80D980DD80C480DA80D6810980EF80F1811B81298123812F814B000000000000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -968B8146813E8153815180FC8171816E81658166817481838188818A81808182 -81A0819581A481A3815F819381A981B081B581BE81B881BD81C081C281BA81C9 -81CD81D181D981D881C881DA81DF81E081E781FA81FB81FE8201820282058207 -820A820D821082168229822B82388233824082598258825D825A825F82640000 -82628268826A826B822E827182778278827E828D829282AB829F82BB82AC82E1 -82E382DF82D282F482F382FA8393830382FB82F982DE830682DC830982D98335 -83348316833283318340833983508345832F832B831783188385839A83AA839F -83A283968323838E8387838A837C83B58373837583A0838983A883F4841383EB -83CE83FD840383D8840B83C183F7840783E083F2840D8422842083BD84388506 -83FB846D842A843C855A84848477846B84AD846E848284698446842C846F8479 -843584CA846284B984BF849F84D984CD84BB84DA84D084C184C684D684A18521 -84FF84F485178518852C851F8515851484FC8540856385588548000000000000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -85418602854B8555858085A485888591858A85A8856D8594859B85EA8587859C -8577857E859085C985BA85CF85B985D085D585DD85E585DC85F9860A8613860B -85FE85FA86068622861A8630863F864D4E558654865F86678671869386A386A9 -86AA868B868C86B686AF86C486C686B086C9882386AB86D486DE86E986EC0000 -86DF86DB86EF8712870687088700870386FB87118709870D86F9870A8734873F -8737873B87258729871A8760875F8778874C874E877487578768876E87598753 -8763876A880587A2879F878287AF87CB87BD87C087D096D687AB87C487B387C7 -87C687BB87EF87F287E0880F880D87FE87F687F7880E87D28811881688158822 -88218831883688398827883B8844884288528859885E8862886B8881887E889E -8875887D88B5887288828897889288AE889988A2888D88A488B088BF88B188C3 -88C488D488D888D988DD88F9890288FC88F488E888F28904890C890A89138943 -891E8925892A892B89418944893B89368938894C891D8960895E000000000000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -89668964896D896A896F89748977897E89838988898A8993899889A189A989A6 -89AC89AF89B289BA89BD89BF89C089DA89DC89DD89E789F489F88A038A168A10 -8A0C8A1B8A1D8A258A368A418A5B8A528A468A488A7C8A6D8A6C8A628A858A82 -8A848AA88AA18A918AA58AA68A9A8AA38AC48ACD8AC28ADA8AEB8AF38AE70000 -8AE48AF18B148AE08AE28AF78ADE8ADB8B0C8B078B1A8AE18B168B108B178B20 -8B3397AB8B268B2B8B3E8B288B418B4C8B4F8B4E8B498B568B5B8B5A8B6B8B5F -8B6C8B6F8B748B7D8B808B8C8B8E8B928B938B968B998B9A8C3A8C418C3F8C48 -8C4C8C4E8C508C558C628C6C8C788C7A8C828C898C858C8A8C8D8C8E8C948C7C -8C98621D8CAD8CAA8CBD8CB28CB38CAE8CB68CC88CC18CE48CE38CDA8CFD8CFA -8CFB8D048D058D0A8D078D0F8D0D8D109F4E8D138CCD8D148D168D678D6D8D71 -8D738D818D998DC28DBE8DBA8DCF8DDA8DD68DCC8DDB8DCB8DEA8DEB8DDF8DE3 -8DFC8E088E098DFF8E1D8E1E8E108E1F8E428E358E308E348E4A000000000000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E478E498E4C8E508E488E598E648E608E2A8E638E558E768E728E7C8E818E87 -8E858E848E8B8E8A8E938E918E948E998EAA8EA18EAC8EB08EC68EB18EBE8EC5 -8EC88ECB8EDB8EE38EFC8EFB8EEB8EFE8F0A8F058F158F128F198F138F1C8F1F -8F1B8F0C8F268F338F3B8F398F458F428F3E8F4C8F498F468F4E8F578F5C0000 -8F628F638F648F9C8F9F8FA38FAD8FAF8FB78FDA8FE58FE28FEA8FEF90878FF4 -90058FF98FFA901190159021900D901E9016900B90279036903590398FF8904F -905090519052900E9049903E90569058905E9068906F907696A890729082907D -90819080908A9089908F90A890AF90B190B590E290E4624890DB910291129119 -91329130914A9156915891639165916991739172918B9189918291A291AB91AF -91AA91B591B491BA91C091C191C991CB91D091D691DF91E191DB91FC91F591F6 -921E91FF9214922C92159211925E925792459249926492489295923F924B9250 -929C92969293929B925A92CF92B992B792E9930F92FA9344932E000000000000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -93199322931A9323933A9335933B935C9360937C936E935693B093AC93AD9394 -93B993D693D793E893E593D893C393DD93D093C893E4941A9414941394039407 -94109436942B94359421943A944194529444945B94609462945E946A92299470 -94759477947D945A947C947E9481947F95829587958A95949596959895990000 -95A095A895A795AD95BC95BB95B995BE95CA6FF695C395CD95CC95D595D495D6 -95DC95E195E595E296219628962E962F9642964C964F964B9677965C965E965D -965F96669672966C968D96989695969796AA96A796B196B296B096B496B696B8 -96B996CE96CB96C996CD894D96DC970D96D596F99704970697089713970E9711 -970F971697199724972A97309739973D973E97449746974897429749975C9760 -97649766976852D2976B977197799785977C9781977A9786978B978F9790979C -97A897A697A397B397B497C397C697C897CB97DC97ED9F4F97F27ADF97F697F5 -980F980C9838982498219837983D9846984F984B986B986F9870000000000000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -98719874987398AA98AF98B198B698C498C398C698E998EB9903990999129914 -99189921991D991E99249920992C992E993D993E9942994999459950994B9951 -9952994C99559997999899A599AD99AE99BC99DF99DB99DD99D899D199ED99EE -99F199F299FB99F89A019A0F9A0599E29A199A2B9A379A459A429A409A430000 -9A3E9A559A4D9A5B9A579A5F9A629A659A649A699A6B9A6A9AAD9AB09ABC9AC0 -9ACF9AD19AD39AD49ADE9ADF9AE29AE39AE69AEF9AEB9AEE9AF49AF19AF79AFB -9B069B189B1A9B1F9B229B239B259B279B289B299B2A9B2E9B2F9B329B449B43 -9B4F9B4D9B4E9B519B589B749B939B839B919B969B979B9F9BA09BA89BB49BC0 -9BCA9BB99BC69BCF9BD19BD29BE39BE29BE49BD49BE19C3A9BF29BF19BF09C15 -9C149C099C139C0C9C069C089C129C0A9C049C2E9C1B9C259C249C219C309C47 -9C329C469C3E9C5A9C609C679C769C789CE79CEC9CF09D099D089CEB9D039D06 -9D2A9D269DAF9D239D1F9D449D159D129D419D3F9D3E9D469D48000000000000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9D5D9D5E9D649D519D509D599D729D899D879DAB9D6F9D7A9D9A9DA49DA99DB2 -9DC49DC19DBB9DB89DBA9DC69DCF9DC29DD99DD39DF89DE69DED9DEF9DFD9E1A -9E1B9E1E9E759E799E7D9E819E889E8B9E8C9E929E959E919E9D9EA59EA99EB8 -9EAA9EAD97619ECC9ECE9ECF9ED09ED49EDC9EDE9EDD9EE09EE59EE89EEF0000 -9EF49EF69EF79EF99EFB9EFC9EFD9F079F0876B79F159F219F2C9F3E9F4A9F52 -9F549F639F5F9F609F619F669F679F6C9F6A9F779F729F769F959F9C9FA0582F -69C79059746451DC719900000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -EB -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F8B5F8B60000000000000000000000000000000000000000000000000000 -F8B7FE33000000000000000000000000000000000000F8B8FE31F8B900000000 -F8BAF8BBF8BCF8BDFE300000000000000000FE35FE36FE39FE3AF8BEF8BFFE37 -FE38FE3FFE40FE3DFE3EFE41FE42FE43FE44FE3BFE3C00000000000000000000 -0000F8C000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -EC -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000F8C1 -0000F8C20000F8C30000F8C40000F8C500000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F8C600000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000F8C70000F8C80000F8C9000000000000000000000000F8CA000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -ED -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -F8CB0000F8CC0000F8CD0000F8CE0000F8CF0000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -00000000F8D00000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000000000F8D10000F8D20000F8D3000000000000000000000000F8D40000 -00000000000000000000F8D5F8D6000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/macRoman.enc b/library/encoding/macRoman.enc deleted file mode 100644 index 6cfd749..0000000 --- a/library/encoding/macRoman.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macRoman, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C400C500C700C900D100D600DC00E100E000E200E400E300E500E700E900E8 -00EA00EB00ED00EC00EE00EF00F100F300F200F400F600F500FA00F900FB00FC -202000B000A200A300A7202200B600DF00AE00A9212200B400A8226000C600D8 -221E00B12264226500A500B522022211220F03C0222B00AA00BA212600E600F8 -00BF00A100AC221A01922248220600AB00BB202600A000C000C300D501520153 -20132014201C201D2018201900F725CA00FF0178204400A42039203AFB01FB02 -202100B7201A201E203000C200CA00C100CB00C800CD00CE00CF00CC00D300D4 -F8FF00D200DA00DB00D9013102C602DC00AF02D802D902DA00B802DD02DB02C7 diff --git a/library/encoding/macRomania.enc b/library/encoding/macRomania.enc deleted file mode 100644 index ce41cf4..0000000 --- a/library/encoding/macRomania.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macRomania, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C400C500C700C900D100D600DC00E100E000E200E400E300E500E700E900E8 -00EA00EB00ED00EC00EE00EF00F100F300F200F400F600F500FA00F900FB00FC -202000B000A200A300A7202200B600DF00AE00A9212200B400A822600102015E -221E00B12264226500A500B522022211220F03C0222B00AA00BA21260103015F -00BF00A100AC221A01922248220600AB00BB202600A000C000C300D501520153 -20132014201C201D2018201900F725CA00FF0178204400A42039203A01620163 -202100B7201A201E203000C200CA00C100CB00C800CD00CE00CF00CC00D300D4 -F8FF00D200DA00DB00D9013102C602DC00AF02D802D902DA00B802DD02DB02C7 diff --git a/library/encoding/macThai.enc b/library/encoding/macThai.enc deleted file mode 100644 index 7d9c8ad..0000000 --- a/library/encoding/macThai.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macThai, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00AB00BB2026F88CF88FF892F895F898F88BF88EF891F894F897201C201DF899 -FFFD2022F884F889F885F886F887F888F88AF88DF890F893F89620182019FFFD -00A00E010E020E030E040E050E060E070E080E090E0A0E0B0E0C0E0D0E0E0E0F -0E100E110E120E130E140E150E160E170E180E190E1A0E1B0E1C0E1D0E1E0E1F -0E200E210E220E230E240E250E260E270E280E290E2A0E2B0E2C0E2D0E2E0E2F -0E300E310E320E330E340E350E360E370E380E390E3AFEFF200B201320140E3F -0E400E410E420E430E440E450E460E470E480E490E4A0E4B0E4C0E4D21220E4F -0E500E510E520E530E540E550E560E570E580E5900AE00A9FFFDFFFDFFFDFFFD diff --git a/library/encoding/macTurkish.enc b/library/encoding/macTurkish.enc deleted file mode 100644 index 73e8687..0000000 --- a/library/encoding/macTurkish.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macTurkish, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -00C400C500C700C900D100D600DC00E100E000E200E400E300E500E700E900E8 -00EA00EB00ED00EC00EE00EF00F100F300F200F400F600F500FA00F900FB00FC -202000B000A200A300A7202200B600DF00AE00A9212200B400A8226000C600D8 -221E00B12264226500A500B522022211220F03C0222B00AA00BA212600E600F8 -00BF00A100AC221A01922248220600AB00BB202600A000C000C300D501520153 -20132014201C201D2018201900F725CA00FF0178011E011F01300131015E015F -202100B7201A201E203000C200CA00C100CB00C800CD00CE00CF00CC00D300D4 -F8FF00D200DA00DB00D9F8A002C602DC00AF02D802D902DA00B802DD02DB02C7 diff --git a/library/encoding/macUkraine.enc b/library/encoding/macUkraine.enc deleted file mode 100644 index 643cc45..0000000 --- a/library/encoding/macUkraine.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: macUkraine, single-byte -S -003F 0 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0410041104120413041404150416041704180419041A041B041C041D041E041F -0420042104220423042404250426042704280429042A042B042C042D042E042F -202000B0049000A300A7202200B6040600AE00A9212204020452226004030453 -221E00B122642265045600B504910408040404540407045704090459040A045A -0458040500AC221A01922248220600AB00BB202600A0040B045B040C045C0455 -20132014201C201D2018201900F7201E040E045E040F045F211604010451044F -0430043104320433043404350436043704380439043A043B043C043D043E043F -0440044104420443044404450446044704480449044A044B044C044D044E00A4 diff --git a/library/encoding/shiftjis.enc b/library/encoding/shiftjis.enc deleted file mode 100644 index c8d2504..0000000 --- a/library/encoding/shiftjis.enc +++ /dev/null @@ -1,683 +0,0 @@ -# Encoding file: shiftjis, multi-byte -M -003F 0 40 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002100220023002400250026002700280029002A002B002C002D002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -0040004100420043004400450046004700480049004A004B004C004D004E004F -0050005100520053005400550056005700580059005A005B005C005D005E005F -0060006100620063006400650066006700680069006A006B006C006D006E006F -0070007100720073007400750076007700780079007A007B007C007D007E007F -0080000000000000000000850086008700000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F -FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F -FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F -FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -81 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8FF3E -FFE3FF3F30FD30FE309D309E30034EDD30053006300730FC20152010FF0FFF3C -301C2016FF5C2026202520182019201C201DFF08FF0930143015FF3BFF3DFF5B -FF5D30083009300A300B300C300D300E300F30103011FF0B221200B100D70000 -00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5 -FF0400A200A3FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C725C6 -25A125A025B325B225BD25BC203B301221922190219121933013000000000000 -000000000000000000000000000000002208220B2286228722822283222A2229 -000000000000000000000000000000002227222800AC21D221D4220022030000 -0000000000000000000000000000000000000000222022A52312220222072261 -2252226A226B221A223D221D2235222B222C0000000000000000000000000000 -212B2030266F266D266A2020202100B6000000000000000025EF000000000000 -82 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000FF10 -FF11FF12FF13FF14FF15FF16FF17FF18FF190000000000000000000000000000 -FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2FFF30 -FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3A000000000000000000000000 -0000FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F -FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5A00000000000000003041 -30423043304430453046304730483049304A304B304C304D304E304F30503051 -30523053305430553056305730583059305A305B305C305D305E305F30603061 -30623063306430653066306730683069306A306B306C306D306E306F30703071 -30723073307430753076307730783079307A307B307C307D307E307F30803081 -30823083308430853086308730883089308A308B308C308D308E308F30903091 -3092309300000000000000000000000000000000000000000000000000000000 -83 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -30A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF30B0 -30B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF30C0 -30C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF30D0 -30D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF0000 -30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF -30F030F130F230F330F430F530F6000000000000000000000000000000000391 -03920393039403950396039703980399039A039B039C039D039E039F03A003A1 -03A303A403A503A603A703A803A90000000000000000000000000000000003B1 -03B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF03C003C1 -03C303C403C503C603C703C803C9000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -84 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -04100411041204130414041504010416041704180419041A041B041C041D041E -041F0420042104220423042404250426042704280429042A042B042C042D042E -042F000000000000000000000000000000000000000000000000000000000000 -04300431043204330434043504510436043704380439043A043B043C043D0000 -043E043F0440044104420443044404450446044704480449044A044B044C044D -044E044F00000000000000000000000000000000000000000000000000002500 -2502250C251025182514251C252C25242534253C25012503250F2513251B2517 -25232533252B253B254B2520252F25282537253F251D25302525253825420000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -88 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000004E9C -55165A03963F54C0611B632859F690228475831C7A5060AA63E16E2565ED8466 -82A69BF56893572765A162715B9B59D0867B98F47D627DBE9B8E62167C9F88B7 -5B895EB563096697684895C7978D674F4EE54F0A4F4D4F9D504956F2593759D4 -5A015C0960DF610F61706613690570BA754F757079FB7DAD7DEF80C3840E8863 -8B029055907A533B4E954EA557DF80B290C178EF4E0058F16EA290387A328328 -828B9C2F5141537054BD54E156E059FB5F1598F26DEB80E4852D000000000000 -89 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9662967096A097FB540B53F35B8770CF7FBD8FC296E8536F9D5C7ABA4E117893 -81FC6E26561855046B1D851A9C3B59E553A96D6674DC958F56424E91904B96F2 -834F990C53E155B65B305F71662066F368046C386CF36D29745B76C87A4E9834 -82F1885B8A6092ED6DB275AB76CA99C560A68B018D8A95B2698E53AD51860000 -5712583059445BB45EF6602863A963F46CBF6F14708E7114715971D5733F7E01 -827682D185979060925B9D1B586965BC6C5A752551F9592E59655F805FDC62BC -65FA6A2A6B276BB4738B7FC189569D2C9D0E9EC45CA16C96837B51045C4B61B6 -81C6687672614E594FFA537860696E297A4F97F34E0B53164EEE4F554F3D4FA1 -4F7352A053EF5609590F5AC15BB65BE179D16687679C67B66B4C6CB3706B73C2 -798D79BE7A3C7B8782B182DB8304837783EF83D387668AB256298CA88FE6904E -971E868A4FC45CE862117259753B81E582BD86FE8CC096C5991399D54ECB4F1A -89E356DE584A58CA5EFB5FEB602A6094606261D0621262D06539000000000000 -8A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9B41666668B06D777070754C76867D7582A587F9958B968E8C9D51F152BE5916 -54B35BB35D16616869826DAF788D84CB88578A7293A79AB86D6C99A886D957A3 -67FF86CE920E5283568754045ED362E164B9683C68386BBB737278BA7A6B899A -89D28D6B8F0390ED95A3969497695B665CB3697D984D984E639B7B206A2B0000 -6A7F68B69C0D6F5F5272559D607062EC6D3B6E076ED1845B89108F444E149C39 -53F6691B6A3A9784682A515C7AC384B291DC938C565B9D286822830584317CA5 -520882C574E64E7E4F8351A05BD2520A52D852E75DFB559A582A59E65B8C5B98 -5BDB5E725E7960A3611F616361BE63DB656267D1685368FA6B3E6B536C576F22 -6F976F4574B0751876E3770B7AFF7BA17C217DE97F367FF0809D8266839E89B3 -8ACC8CAB908494519593959195A2966597D3992882184E38542B5CB85DCC73A9 -764C773C5CA97FEB8D0B96C19811985498584F014F0E5371559C566857FA5947 -5B095BC45C905E0C5E7E5FCC63EE673A65D765E2671F68CB68C4000000000000 -8B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A5F5E306BC56C176C7D757F79485B637A007D005FBD898F8A188CB48D778ECC -8F1D98E29A0E9B3C4E80507D510059935B9C622F628064EC6B3A72A075917947 -7FA987FB8ABC8B7063AC83CA97A05409540355AB68546A588A70782767759ECD -53745BA2811A865090064E184E454EC74F1153CA54385BAE5F13602565510000 -673D6C426C726CE3707874037A767AAE7B087D1A7CFE7D6665E7725B53BB5C45 -5DE862D262E063196E20865A8A318DDD92F86F0179A69B5A4EA84EAB4EAC4F9B -4FA050D151477AF6517151F653545321537F53EB55AC58835CE15F375F4A602F -6050606D631F65596A4B6CC172C272ED77EF80F881058208854E90F793E197FF -99579A5A4EF051DD5C2D6681696D5C4066F26975738968507C8150C552E45747 -5DFE932665A46B236B3D7434798179BD7B4B7DCA82B983CC887F895F8B398FD1 -91D1541F92804E5D503653E5533A72D7739677E982E68EAF99C699C899D25177 -611A865E55B07A7A50765BD3904796854E326ADB91E75C515C48000000000000 -8C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -63987A9F6C9397748F617AAA718A96887C8268177E706851936C52F2541B85AB -8A137FA48ECD90E15366888879414FC250BE521151445553572D73EA578B5951 -5F625F8460756176616761A963B2643A656C666F68426E1375667A3D7CFB7D4C -7D997E4B7F6B830E834A86CD8A088A638B668EFD981A9D8F82B88FCE9BE80000 -5287621F64836FC09699684150916B206C7A6F547A747D5088408A2367084EF6 -503950265065517C5238526355A7570F58055ACC5EFA61B261F862F36372691C -6A29727D72AC732E7814786F7D79770C80A9898B8B198CE28ED290639375967A -98559A139E785143539F53B35E7B5F266E1B6E90738473FE7D4382378A008AFA -96504E4E500B53E4547C56FA59D15B645DF15EAB5F276238654567AF6E5672D0 -7CCA88B480A180E183F0864E8A878DE8923796C798679F134E944E924F0D5348 -5449543E5A2F5F8C5FA1609F68A76A8E745A78818A9E8AA48B7791904E5E9BC9 -4EA44F7C4FAF501950165149516C529F52B952FE539A53E35411000000000000 -8D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -540E5589575157A2597D5B545B5D5B8F5DE55DE75DF75E785E835E9A5EB75F18 -6052614C629762D863A7653B6602664366F4676D6821689769CB6C5F6D2A6D69 -6E2F6E9D75327687786C7A3F7CE07D057D187D5E7DB18015800380AF80B18154 -818F822A8352884C88618B1B8CA28CFC90CA91759271783F92FC95A4964D0000 -980599999AD89D3B525B52AB53F7540858D562F76FE08C6A8F5F9EB9514B523B -544A56FD7A4091779D609ED273446F09817075115FFD60DA9AA872DB8FBC6B64 -98034ECA56F0576458BE5A5A606861C7660F6606683968B16DF775D57D3A826E -9B424E9B4F5053C955065D6F5DE65DEE67FB6C99747378028A50939688DF5750 -5EA7632B50B550AC518D670054C9585E59BB5BB05F69624D63A1683D6B736E08 -707D91C7728078157826796D658E7D3083DC88C18F09969B5264572867507F6A -8CA151B45742962A583A698A80B454B25D0E57FC78959DFA4F5C524A548B643E -6628671467F57A847B567D22932F685C9BAD7B395319518A5237000000000000 -8E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5BDF62F664AE64E6672D6BBA85A996D176909BD6634C93069BAB76BF66524E09 -509853C25C7160E864926563685F71E673CA75237B977E8286958B838CDB9178 -991065AC66AB6B8B4ED54ED44F3A4F7F523A53F853F255E356DB58EB59CB59C9 -59FF5B505C4D5E025E2B5FD7601D6307652F5B5C65AF65BD65E8679D6B620000 -6B7B6C0F7345794979C17CF87D197D2B80A2810281F389968A5E8A698A668A8C -8AEE8CC78CDC96CC98FC6B6F4E8B4F3C4F8D51505B575BFA6148630166426B21 -6ECB6CBB723E74BD75D478C1793A800C803381EA84948F9E6C509E7F5F0F8B58 -9D2B7AFA8EF85B8D96EB4E0353F157F759315AC95BA460896E7F6F0675BE8CEA -5B9F85007BE0507267F4829D5C61854A7E1E820E51995C0463688D66659C716E -793E7D1780058B1D8ECA906E86C790AA501F52FA5C3A6753707C7235914C91C8 -932B82E55BC25F3160F94E3B53D65B88624B67316B8A72E973E07A2E816B8DA3 -91529996511253D7546A5BFF63886A397DAC970056DA53CE5468000000000000 -8F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5B975C315DDE4FEE610162FE6D3279C079CB7D427E4D7FD281ED821F84908846 -89728B908E748F2F9031914B916C96C6919C4EC04F4F514553415F93620E67D4 -6C416E0B73637E2691CD928353D459195BBF6DD1795D7E2E7C9B587E719F51FA -88538FF04FCA5CFB662577AC7AE3821C99FF51C65FAA65EC696F6B896DF30000 -6E966F6476FE7D145DE190759187980651E6521D6240669166D96E1A5EB67DD2 -7F7266F885AF85F78AF852A953D959735E8F5F90605592E4966450B7511F52DD -5320534753EC54E8554655315617596859BE5A3C5BB55C065C0F5C115C1A5E84 -5E8A5EE05F70627F628462DB638C63776607660C662D6676677E68A26A1F6A35 -6CBC6D886E096E58713C7126716775C77701785D7901796579F07AE07B117CA7 -7D39809683D6848B8549885D88F38A1F8A3C8A548A738C618CDE91A49266937E -9418969C97984E0A4E084E1E4E575197527057CE583458CC5B225E3860C564FE -676167566D4472B675737A6384B88B7291B89320563157F498FE000000000000 -90 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -62ED690D6B9671ED7E548077827289E698DF87558FB15C3B4F384FE14FB55507 -5A205BDD5BE95FC3614E632F65B0664B68EE699B6D786DF1753375B9771F795E -79E67D3381E382AF85AA89AA8A3A8EAB8F9B903291DD97074EBA4EC152035875 -58EC5C0B751A5C3D814E8A0A8FC59663976D7B258ACF9808916256F353A80000 -9017543957825E2563A86C34708A77617C8B7FE088709042915493109318968F -745E9AC45D075D69657067A28DA896DB636E6749691983C5981796C088FE6F84 -647A5BF84E16702C755D662F51C4523652E259D35F8160276210653F6574661F -667468F268166B636E057272751F76DB7CBE805658F088FD897F8AA08A938ACB -901D91929752975965897A0E810696BB5E2D60DC621A65A56614679077F37A4D -7C4D7E3E810A8CAC8D648DE18E5F78A9520762D963A5644262988A2D7A837BC0 -8AAC96EA7D76820C87494ED95148534353605BA35C025C165DDD6226624764B0 -681368346CC96D456D1767D36F5C714E717D65CB7A7F7BAD7DDA000000000000 -91 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7E4A7FA8817A821B823985A68A6E8CCE8DF59078907792AD929195839BAE524D -55846F387136516879857E5581B37CCE564C58515CA863AA66FE66FD695A72D9 -758F758E790E795679DF7C977D207D4486078A34963B90619F2050E7527553CC -53E2500955AA58EE594F723D5B8B5C64531D60E360F3635C6383633F63BB0000 -64CD65E966F95DE369CD69FD6F1571E54E8975E976F87A937CDF7DCF7D9C8061 -83498358846C84BC85FB88C58D709001906D9397971C9A1250CF5897618E81D3 -85358D0890204FC3507452475373606F6349675F6E2C8DB3901F4FD75C5E8CCA -65CF7D9A53528896517663C35B585B6B5C0A640D6751905C4ED6591A592A6C70 -8A51553E581559A560F0625367C182356955964099C49A284F5358065BFE8010 -5CB15E2F5F856020614B623466FF6CF06EDE80CE817F82D4888B8CB89000902E -968A9EDB9BDB4EE353F059277B2C918D984C9DF96EDD7027535355445B856258 -629E62D36CA26FEF74228A1794386FC18AFE833851E786F853EA000000000000 -92 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -53E94F4690548FB0596A81315DFD7AEA8FBF68DA8C3772F89C486A3D8AB04E39 -53585606576662C563A265E66B4E6DE16E5B70AD77ED7AEF7BAA7DBB803D80C6 -86CB8A95935B56E358C75F3E65AD66966A806BB575378AC7502477E557305F1B -6065667A6C6075F47A1A7F6E81F48718904599B37BC9755C7AF97B5184C40000 -901079E97A9283365AE177404E2D4EF25B995FE062BD663C67F16CE8866B8877 -8A3B914E92F399D06A177026732A82E784578CAF4E01514651CB558B5BF55E16 -5E335E815F145F355F6B5FB461F2631166A2671D6F6E7252753A773A80748139 -817887768ABF8ADC8D858DF3929A957798029CE552C5635776F467156C8873CD -8CC393AE96736D25589C690E69CC8FFD939A75DB901A585A680263B469FB4F43 -6F2C67D88FBB85267DB49354693F6F70576A58F75B2C7D2C722A540A91E39DB4 -4EAD4F4E505C507552438C9E544858245B9A5E1D5E955EAD5EF75F1F608C62B5 -633A63D068AF6C407887798E7A0B7DE082478A028AE68E449013000000000000 -93 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -90B8912D91D89F0E6CE5645864E265756EF476847B1B906993D16EBA54F25FB9 -64A48F4D8FED92445178586B59295C555E976DFB7E8F751C8CBC8EE2985B70B9 -4F1D6BBF6FB1753096FB514E54105835585759AC5C605F926597675C6E21767B -83DF8CED901490FD934D7825783A52AA5EA6571F597460125012515A51AC0000 -51CD520055105854585859575B955CF65D8B60BC6295642D6771684368BC68DF -76D76DD86E6F6D9B706F71C85F5375D879777B497B547B527CD67D7152308463 -856985E48A0E8B048C468E0F9003900F94199676982D9A3095D850CD52D5540C -58025C0E61A7649E6D1E77B37AE580F48404905392855CE09D07533F5F975FB3 -6D9C7279776379BF7BE46BD272EC8AAD68036A6151F87A8169345C4A9CF682EB -5BC59149701E56785C6F60C765666C8C8C5A90419813545166C7920D594890A3 -51854E4D51EA85998B0E7058637A934B696299B47E047577535769608EDF96E3 -6C5D4E8C5C3C5F108FE953028CD1808986795EFF65E54E735165000000000000 -94 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59825C3F97EE4EFB598A5FCD8A8D6FE179B079625BE78471732B71B15E745FF5 -637B649A71C37C984E435EFC4E4B57DC56A260A96FC37D0D80FD813381BF8FB2 -899786A45DF4628A64AD898767776CE26D3E743678345A467F7582AD99AC4FF3 -5EC362DD63926557676F76C3724C80CC80BA8F29914D500D57F95A9268850000 -6973716472FD8CB758F28CE0966A9019877F79E477E784294F2F5265535A62CD -67CF6CCA767D7B947C95823685848FEB66DD6F2072067E1B83AB99C19EA651FD -7BB178727BB880877B486AE85E61808C75517560516B92626E8C767A91979AEA -4F107F70629C7B4F95A59CE9567A585986E496BC4F345224534A53CD53DB5E06 -642C6591677F6C3E6C4E724872AF73ED75547E41822C85E98CA97BC491C67169 -981298EF633D6669756A76E478D0854386EE532A5351542659835E875F7C60B2 -6249627962AB65906BD46CCC75B276AE789179D87DCB7F7780A588AB8AB98CBB -907F975E98DB6A0B7C3850995C3E5FAE67876BD8743577097F8E000000000000 -95 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9F3B67CA7A175339758B9AED5F66819D83F180985F3C5FC575627B46903C6867 -59EB5A9B7D10767E8B2C4FF55F6A6A196C376F0274E2796888688A558C795EDF -63CF75C579D282D7932892F2849C86ED9C2D54C15F6C658C6D5C70158CA78CD3 -983B654F74F64E0D4ED857E0592B5A665BCC51A85E035E9C6016627665770000 -65A7666E6D6E72367B268150819A82998B5C8CA08CE68D74961C96444FAE64AB -6B66821E8461856A90E85C01695398A8847A85574F0F526F5FA95E45670D798F -8179890789866DF55F1762556CB84ECF72699B925206543B567458B361A4626E -711A596E7C897CDE7D1B96F06587805E4E194F75517558405E635E735F0A67C4 -4E26853D9589965B7C73980150FB58C1765678A7522577A585117B86504F5909 -72477BC77DE88FBA8FD4904D4FBF52C95A295F0197AD4FDD821792EA57036355 -6B69752B88DC8F147A4252DF58936155620A66AE6BCD7C3F83E950234FF85305 -5446583159495B9D5CF05CEF5D295E9662B16367653E65B9670B000000000000 -96 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6CD56CE170F978327E2B80DE82B3840C84EC870289128A2A8C4A90A692D298FD -9CF39D6C4E4F4EA1508D5256574A59A85E3D5FD85FD9623F66B4671B67D068D2 -51927D2180AA81A88B008C8C8CBF927E96325420982C531750D5535C58A864B2 -6734726777667A4691E652C36CA16B8658005E4C5954672C7FFB51E176C60000 -646978E89B549EBB57CB59B96627679A6BCE54E969D95E55819C67959BAA67FE -9C52685D4EA64FE353C862B9672B6CAB8FC44FAD7E6D9EBF4E0761626E806F2B -85135473672A9B455DF37B955CAC5BC6871C6E4A84D17A14810859997C8D6C11 -772052D959227121725F77DB97279D61690B5A7F5A1851A5540D547D660E76DF -8FF792989CF459EA725D6EC5514D68C97DBF7DEC97629EBA64786A2183025984 -5B5F6BDB731B76F27DB280178499513267289ED976EE676252FF99055C24623B -7C7E8CB0554F60B67D0B958053014E5F51B6591C723A803691CE5F2577E25384 -5F797D0485AC8A338E8D975667F385AE9453610961086CB9765200000000FF5E -97 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8AED8F38552F4F51512A52C753CB5BA55E7D60A0618263D6670967DA6E676D8C -733673377531795088D58A98904A909190F596C4878D59154E884F594E0E8A89 -8F3F981050AD5E7C59965BB95EB863DA63FA64C166DC694A69D86D0B6EB67194 -75287AAF7F8A8000844984C989818B218E0A9065967D990A617E62916B320000 -6C836D747FCC7FFC6DC07F8587BA88F8676583B1983C96F76D1B7D61843D916A -4E7153755D506B046FEB85CD862D89A75229540F5C65674E68A87406748375E2 -88CF88E191CC96E296785F8B73877ACB844E63A0756552896D416E9C74097559 -786B7C9296867ADC9F8D4FB6616E65C5865C4E864EAE50DA4E2151CC5BEE6599 -68816DBC731F764277AD7A1C7CE7826F8AD2907C91CF96759818529B7DD1502B -539867976DCB71D0743381E88F2A96A39C579E9F746058416D997D2F985E4EE4 -4F364F8B51B752B15DBA601C73B2793C82D3923496B796F6970A9E979F6266A6 -6B74521752A370C888C25EC9604B61906F2371497C3E7DF4806F000000000000 -98 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -84EE9023932C54429B6F6AD370898CC28DEF973252B45A415ECA5F046717697C -69946D6A6F0F726272FC7BED8001807E874B90CE516D9E937984808B93328AD6 -502D548C8A716B6A8CC4810760D167A09DF24E994E989C108A6B85C185686900 -6E7E789781550000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000005F0C -4E104E154E2A4E314E364E3C4E3F4E424E564E584E824E858C6B4E8A82125F0D -4E8E4E9E4E9F4EA04EA24EB04EB34EB64ECE4ECD4EC44EC64EC24ED74EDE4EED -4EDF4EF74F094F5A4F304F5B4F5D4F574F474F764F884F8F4F984F7B4F694F70 -4F914F6F4F864F9651184FD44FDF4FCE4FD84FDB4FD14FDA4FD04FE44FE5501A -50285014502A502550054F1C4FF650215029502C4FFE4FEF5011500650435047 -6703505550505048505A5056506C50785080509A508550B450B2000000000000 -99 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -50C950CA50B350C250D650DE50E550ED50E350EE50F950F55109510151025116 -51155114511A5121513A5137513C513B513F51405152514C515451627AF85169 -516A516E5180518256D8518C5189518F519151935195519651A451A651A251A9 -51AA51AB51B351B151B251B051B551BD51C551C951DB51E0865551E951ED0000 -51F051F551FE5204520B5214520E5227522A522E52335239524F5244524B524C -525E5254526A527452695273527F527D528D529452925271528852918FA88FA7 -52AC52AD52BC52B552C152CD52D752DE52E352E698ED52E052F352F552F852F9 -530653087538530D5310530F5315531A5323532F533153335338534053465345 -4E175349534D51D6535E5369536E5918537B53775382539653A053A653A553AE -53B053B653C37C1296D953DF66FC71EE53EE53E853ED53FA5401543D5440542C -542D543C542E54365429541D544E548F5475548E545F5471547754705492547B -5480547654845490548654C754A254B854A554AC54C454C854A8000000000000 -9A -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -54AB54C254A454BE54BC54D854E554E6550F551454FD54EE54ED54FA54E25539 -55405563554C552E555C55455556555755385533555D5599558054AF558A559F -557B557E5598559E55AE557C558355A9558755A855DA55C555DF55C455DC55E4 -55D4561455F7561655FE55FD561B55F9564E565071DF56345636563256380000 -566B5664562F566C566A56865680568A56A05694568F56A556AE56B656B456C2 -56BC56C156C356C056C856CE56D156D356D756EE56F9570056FF570457095708 -570B570D57135718571655C7571C572657375738574E573B5740574F576957C0 -57885761577F5789579357A057B357A457AA57B057C357C657D457D257D3580A -57D657E3580B5819581D587258215862584B58706BC05852583D5879588558B9 -589F58AB58BA58DE58BB58B858AE58C558D358D158D758D958D858E558DC58E4 -58DF58EF58FA58F958FB58FC58FD5902590A5910591B68A65925592C592D5932 -5938593E7AD259555950594E595A5958596259605967596C5969000000000000 -9B -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -59785981599D4F5E4FAB59A359B259C659E859DC598D59D959DA5A255A1F5A11 -5A1C5A095A1A5A405A6C5A495A355A365A625A6A5A9A5ABC5ABE5ACB5AC25ABD -5AE35AD75AE65AE95AD65AFA5AFB5B0C5B0B5B165B325AD05B2A5B365B3E5B43 -5B455B405B515B555B5A5B5B5B655B695B705B735B755B7865885B7A5B800000 -5B835BA65BB85BC35BC75BC95BD45BD05BE45BE65BE25BDE5BE55BEB5BF05BF6 -5BF35C055C075C085C0D5C135C205C225C285C385C395C415C465C4E5C535C50 -5C4F5B715C6C5C6E4E625C765C795C8C5C915C94599B5CAB5CBB5CB65CBC5CB7 -5CC55CBE5CC75CD95CE95CFD5CFA5CED5D8C5CEA5D0B5D155D175D5C5D1F5D1B -5D115D145D225D1A5D195D185D4C5D525D4E5D4B5D6C5D735D765D875D845D82 -5DA25D9D5DAC5DAE5DBD5D905DB75DBC5DC95DCD5DD35DD25DD65DDB5DEB5DF2 -5DF55E0B5E1A5E195E115E1B5E365E375E445E435E405E4E5E575E545E5F5E62 -5E645E475E755E765E7A9EBC5E7F5EA05EC15EC25EC85ED05ECF000000000000 -9C -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -5ED65EE35EDD5EDA5EDB5EE25EE15EE85EE95EEC5EF15EF35EF05EF45EF85EFE -5F035F095F5D5F5C5F0B5F115F165F295F2D5F385F415F485F4C5F4E5F2F5F51 -5F565F575F595F615F6D5F735F775F835F825F7F5F8A5F885F915F875F9E5F99 -5F985FA05FA85FAD5FBC5FD65FFB5FE45FF85FF15FDD60B35FFF602160600000 -601960106029600E6031601B6015602B6026600F603A605A6041606A6077605F -604A6046604D6063604360646042606C606B60596081608D60E76083609A6084 -609B60966097609260A7608B60E160B860E060D360B45FF060BD60C660B560D8 -614D6115610660F660F7610060F460FA6103612160FB60F1610D610E6147613E -61286127614A613F613C612C6134613D614261446173617761586159615A616B -6174616F61656171615F615D6153617561996196618761AC6194619A618A6191 -61AB61AE61CC61CA61C961F761C861C361C661BA61CB7F7961CD61E661E361F6 -61FA61F461FF61FD61FC61FE620062086209620D620C6214621B000000000000 -9D -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -621E6221622A622E6230623262336241624E625E6263625B62606268627C6282 -6289627E62926293629662D46283629462D762D162BB62CF62FF62C664D462C8 -62DC62CC62CA62C262C7629B62C9630C62EE62F163276302630862EF62F56350 -633E634D641C634F6396638E638063AB637663A3638F6389639F63B5636B0000 -636963BE63E963C063C663E363C963D263F663C4641664346406641364266436 -651D64176428640F6467646F6476644E652A6495649364A564A9648864BC64DA -64D264C564C764BB64D864C264F164E7820964E064E162AC64E364EF652C64F6 -64F464F264FA650064FD6518651C650565246523652B65346535653765366538 -754B654865566555654D6558655E655D65726578658265838B8A659B659F65AB -65B765C365C665C165C465CC65D265DB65D965E065E165F16772660A660365FB -6773663566366634661C664F664466496641665E665D666466676668665F6662 -667066836688668E668966846698669D66C166B966C966BE66BC000000000000 -9E -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -66C466B866D666DA66E0663F66E666E966F066F566F7670F6716671E67266727 -9738672E673F67366741673867376746675E67606759676367646789677067A9 -677C676A678C678B67A667A1678567B767EF67B467EC67B367E967B867E467DE -67DD67E267EE67B967CE67C667E76A9C681E684668296840684D6832684E0000 -68B3682B685968636877687F689F688F68AD6894689D689B68836AAE68B96874 -68B568A068BA690F688D687E690168CA690868D86922692668E1690C68CD68D4 -68E768D569366912690468D768E3692568F968E068EF6928692A691A69236921 -68C669796977695C6978696B6954697E696E69396974693D695969306961695E -695D6981696A69B269AE69D069BF69C169D369BE69CE5BE869CA69DD69BB69C3 -69A76A2E699169A0699C699569B469DE69E86A026A1B69FF6B0A69F969F269E7 -6A0569B16A1E69ED6A1469EB6A0A6A126AC16A236A136A446A0C6A726A366A78 -6A476A626A596A666A486A386A226A906A8D6AA06A846AA26AA3000000000000 -9F -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6A9786176ABB6AC36AC26AB86AB36AAC6ADE6AD16ADF6AAA6ADA6AEA6AFB6B05 -86166AFA6B126B169B316B1F6B386B3776DC6B3998EE6B476B436B496B506B59 -6B546B5B6B5F6B616B786B796B7F6B806B846B836B8D6B986B956B9E6BA46BAA -6BAB6BAF6BB26BB16BB36BB76BBC6BC66BCB6BD36BDF6BEC6BEB6BF36BEF0000 -9EBE6C086C136C146C1B6C246C236C5E6C556C626C6A6C826C8D6C9A6C816C9B -6C7E6C686C736C926C906CC46CF16CD36CBD6CD76CC56CDD6CAE6CB16CBE6CBA -6CDB6CEF6CD96CEA6D1F884D6D366D2B6D3D6D386D196D356D336D126D0C6D63 -6D936D646D5A6D796D596D8E6D956FE46D856DF96E156E0A6DB56DC76DE66DB8 -6DC66DEC6DDE6DCC6DE86DD26DC56DFA6DD96DE46DD56DEA6DEE6E2D6E6E6E2E -6E196E726E5F6E3E6E236E6B6E2B6E766E4D6E1F6E436E3A6E4E6E246EFF6E1D -6E386E826EAA6E986EC96EB76ED36EBD6EAF6EC46EB26ED46ED56E8F6EA56EC2 -6E9F6F416F11704C6EEC6EF86EFE6F3F6EF26F316EEF6F326ECC000000000000 -E0 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -6F3E6F136EF76F866F7A6F786F816F806F6F6F5B6FF36F6D6F826F7C6F586F8E -6F916FC26F666FB36FA36FA16FA46FB96FC66FAA6FDF6FD56FEC6FD46FD86FF1 -6FEE6FDB7009700B6FFA70117001700F6FFE701B701A6F74701D7018701F7030 -703E7032705170637099709270AF70F170AC70B870B370AE70DF70CB70DD0000 -70D9710970FD711C711971657155718871667162714C7156716C718F71FB7184 -719571A871AC71D771B971BE71D271C971D471CE71E071EC71E771F571FC71F9 -71FF720D7210721B7228722D722C72307232723B723C723F72407246724B7258 -7274727E7282728172877292729672A272A772B972B272C372C672C472CE72D2 -72E272E072E172F972F7500F7317730A731C7316731D7334732F73297325733E -734E734F9ED87357736A7368737073787375737B737A73C873B373CE73BB73C0 -73E573EE73DE74A27405746F742573F87432743A7455743F745F74597441745C -746974707463746A7476747E748B749E74A774CA74CF74D473F1000000000000 -E1 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -74E074E374E774E974EE74F274F074F174F874F7750475037505750C750E750D -75157513751E7526752C753C7544754D754A7549755B7546755A756975647567 -756B756D75787576758675877574758A758975827594759A759D75A575A375C2 -75B375C375B575BD75B875BC75B175CD75CA75D275D975E375DE75FE75FF0000 -75FC760175F075FA75F275F3760B760D7609761F762776207621762276247634 -7630763B764776487646765C76587661766276687669766A7667766C76707672 -76767678767C768076837688768B768E769676937699769A76B076B476B876B9 -76BA76C276CD76D676D276DE76E176E576E776EA862F76FB7708770777047729 -7724771E77257726771B773777387747775A7768776B775B7765777F777E7779 -778E778B779177A0779E77B077B677B977BF77BC77BD77BB77C777CD77D777DA -77DC77E377EE77FC780C781279267820792A7845788E78747886787C789A788C -78A378B578AA78AF78D178C678CB78D478BE78BC78C578CA78EC000000000000 -E2 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -78E778DA78FD78F47907791279117919792C792B794079607957795F795A7955 -7953797A797F798A799D79A79F4B79AA79AE79B379B979BA79C979D579E779EC -79E179E37A087A0D7A187A197A207A1F79807A317A3B7A3E7A377A437A577A49 -7A617A627A699F9D7A707A797A7D7A887A977A957A987A967AA97AC87AB00000 -7AB67AC57AC47ABF90837AC77ACA7ACD7ACF7AD57AD37AD97ADA7ADD7AE17AE2 -7AE67AED7AF07B027B0F7B0A7B067B337B187B197B1E7B357B287B367B507B7A -7B047B4D7B0B7B4C7B457B757B657B747B677B707B717B6C7B6E7B9D7B987B9F -7B8D7B9C7B9A7B8B7B927B8F7B5D7B997BCB7BC17BCC7BCF7BB47BC67BDD7BE9 -7C117C147BE67BE57C607C007C077C137BF37BF77C177C0D7BF67C237C277C2A -7C1F7C377C2B7C3D7C4C7C437C547C4F7C407C507C587C5F7C647C567C657C6C -7C757C837C907CA47CAD7CA27CAB7CA17CA87CB37CB27CB17CAE7CB97CBD7CC0 -7CC57CC27CD87CD27CDC7CE29B3B7CEF7CF27CF47CF67CFA7D06000000000000 -E3 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -7D027D1C7D157D0A7D457D4B7D2E7D327D3F7D357D467D737D567D4E7D727D68 -7D6E7D4F7D637D937D897D5B7D8F7D7D7D9B7DBA7DAE7DA37DB57DC77DBD7DAB -7E3D7DA27DAF7DDC7DB87D9F7DB07DD87DDD7DE47DDE7DFB7DF27DE17E057E0A -7E237E217E127E317E1F7E097E0B7E227E467E667E3B7E357E397E437E370000 -7E327E3A7E677E5D7E567E5E7E597E5A7E797E6A7E697E7C7E7B7E837DD57E7D -8FAE7E7F7E887E897E8C7E927E907E937E947E967E8E7E9B7E9C7F387F3A7F45 -7F4C7F4D7F4E7F507F517F557F547F587F5F7F607F687F697F677F787F827F86 -7F837F887F877F8C7F947F9E7F9D7F9A7FA37FAF7FB27FB97FAE7FB67FB88B71 -7FC57FC67FCA7FD57FD47FE17FE67FE97FF37FF998DC80068004800B80128018 -8019801C80218028803F803B804A804680528058805A805F8062806880738072 -807080768079807D807F808480868085809B8093809A80AD519080AC80DB80E5 -80D980DD80C480DA80D6810980EF80F1811B81298123812F814B000000000000 -E4 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -968B8146813E8153815180FC8171816E81658166817481838188818A81808182 -81A0819581A481A3815F819381A981B081B581BE81B881BD81C081C281BA81C9 -81CD81D181D981D881C881DA81DF81E081E781FA81FB81FE8201820282058207 -820A820D821082168229822B82388233824082598258825D825A825F82640000 -82628268826A826B822E827182778278827E828D829282AB829F82BB82AC82E1 -82E382DF82D282F482F382FA8393830382FB82F982DE830682DC830982D98335 -83348316833283318340833983508345832F832B831783188385839A83AA839F -83A283968323838E8387838A837C83B58373837583A0838983A883F4841383EB -83CE83FD840383D8840B83C183F7840783E083F2840D8422842083BD84388506 -83FB846D842A843C855A84848477846B84AD846E848284698446842C846F8479 -843584CA846284B984BF849F84D984CD84BB84DA84D084C184C684D684A18521 -84FF84F485178518852C851F8515851484FC8540856385588548000000000000 -E5 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -85418602854B8555858085A485888591858A85A8856D8594859B85EA8587859C -8577857E859085C985BA85CF85B985D085D585DD85E585DC85F9860A8613860B -85FE85FA86068622861A8630863F864D4E558654865F86678671869386A386A9 -86AA868B868C86B686AF86C486C686B086C9882386AB86D486DE86E986EC0000 -86DF86DB86EF8712870687088700870386FB87118709870D86F9870A8734873F -8737873B87258729871A8760875F8778874C874E877487578768876E87598753 -8763876A880587A2879F878287AF87CB87BD87C087D096D687AB87C487B387C7 -87C687BB87EF87F287E0880F880D87FE87F687F7880E87D28811881688158822 -88218831883688398827883B8844884288528859885E8862886B8881887E889E -8875887D88B5887288828897889288AE889988A2888D88A488B088BF88B188C3 -88C488D488D888D988DD88F9890288FC88F488E888F28904890C890A89138943 -891E8925892A892B89418944893B89368938894C891D8960895E000000000000 -E6 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -89668964896D896A896F89748977897E89838988898A8993899889A189A989A6 -89AC89AF89B289BA89BD89BF89C089DA89DC89DD89E789F489F88A038A168A10 -8A0C8A1B8A1D8A258A368A418A5B8A528A468A488A7C8A6D8A6C8A628A858A82 -8A848AA88AA18A918AA58AA68A9A8AA38AC48ACD8AC28ADA8AEB8AF38AE70000 -8AE48AF18B148AE08AE28AF78ADE8ADB8B0C8B078B1A8AE18B168B108B178B20 -8B3397AB8B268B2B8B3E8B288B418B4C8B4F8B4E8B498B568B5B8B5A8B6B8B5F -8B6C8B6F8B748B7D8B808B8C8B8E8B928B938B968B998B9A8C3A8C418C3F8C48 -8C4C8C4E8C508C558C628C6C8C788C7A8C828C898C858C8A8C8D8C8E8C948C7C -8C98621D8CAD8CAA8CBD8CB28CB38CAE8CB68CC88CC18CE48CE38CDA8CFD8CFA -8CFB8D048D058D0A8D078D0F8D0D8D109F4E8D138CCD8D148D168D678D6D8D71 -8D738D818D998DC28DBE8DBA8DCF8DDA8DD68DCC8DDB8DCB8DEA8DEB8DDF8DE3 -8DFC8E088E098DFF8E1D8E1E8E108E1F8E428E358E308E348E4A000000000000 -E7 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -8E478E498E4C8E508E488E598E648E608E2A8E638E558E768E728E7C8E818E87 -8E858E848E8B8E8A8E938E918E948E998EAA8EA18EAC8EB08EC68EB18EBE8EC5 -8EC88ECB8EDB8EE38EFC8EFB8EEB8EFE8F0A8F058F158F128F198F138F1C8F1F -8F1B8F0C8F268F338F3B8F398F458F428F3E8F4C8F498F468F4E8F578F5C0000 -8F628F638F648F9C8F9F8FA38FAD8FAF8FB78FDA8FE58FE28FEA8FEF90878FF4 -90058FF98FFA901190159021900D901E9016900B90279036903590398FF8904F -905090519052900E9049903E90569058905E9068906F907696A890729082907D -90819080908A9089908F90A890AF90B190B590E290E4624890DB910291129119 -91329130914A9156915891639165916991739172918B9189918291A291AB91AF -91AA91B591B491BA91C091C191C991CB91D091D691DF91E191DB91FC91F591F6 -921E91FF9214922C92159211925E925792459249926492489295923F924B9250 -929C92969293929B925A92CF92B992B792E9930F92FA9344932E000000000000 -E8 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -93199322931A9323933A9335933B935C9360937C936E935693B093AC93AD9394 -93B993D693D793E893E593D893C393DD93D093C893E4941A9414941394039407 -94109436942B94359421943A944194529444945B94609462945E946A92299470 -94759477947D945A947C947E9481947F95829587958A95949596959895990000 -95A095A895A795AD95BC95BB95B995BE95CA6FF695C395CD95CC95D595D495D6 -95DC95E195E595E296219628962E962F9642964C964F964B9677965C965E965D -965F96669672966C968D96989695969796AA96A796B196B296B096B496B696B8 -96B996CE96CB96C996CD894D96DC970D96D596F99704970697089713970E9711 -970F971697199724972A97309739973D973E97449746974897429749975C9760 -97649766976852D2976B977197799785977C9781977A9786978B978F9790979C -97A897A697A397B397B497C397C697C897CB97DC97ED9F4F97F27ADF97F697F5 -980F980C9838982498219837983D9846984F984B986B986F9870000000000000 -E9 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -98719874987398AA98AF98B198B698C498C398C698E998EB9903990999129914 -99189921991D991E99249920992C992E993D993E9942994999459950994B9951 -9952994C99559997999899A599AD99AE99BC99DF99DB99DD99D899D199ED99EE -99F199F299FB99F89A019A0F9A0599E29A199A2B9A379A459A429A409A430000 -9A3E9A559A4D9A5B9A579A5F9A629A659A649A699A6B9A6A9AAD9AB09ABC9AC0 -9ACF9AD19AD39AD49ADE9ADF9AE29AE39AE69AEF9AEB9AEE9AF49AF19AF79AFB -9B069B189B1A9B1F9B229B239B259B279B289B299B2A9B2E9B2F9B329B449B43 -9B4F9B4D9B4E9B519B589B749B939B839B919B969B979B9F9BA09BA89BB49BC0 -9BCA9BB99BC69BCF9BD19BD29BE39BE29BE49BD49BE19C3A9BF29BF19BF09C15 -9C149C099C139C0C9C069C089C129C0A9C049C2E9C1B9C259C249C219C309C47 -9C329C469C3E9C5A9C609C679C769C789CE79CEC9CF09D099D089CEB9D039D06 -9D2A9D269DAF9D239D1F9D449D159D129D419D3F9D3E9D469D48000000000000 -EA -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -9D5D9D5E9D649D519D509D599D729D899D879DAB9D6F9D7A9D9A9DA49DA99DB2 -9DC49DC19DBB9DB89DBA9DC69DCF9DC29DD99DD39DF89DE69DED9DEF9DFD9E1A -9E1B9E1E9E759E799E7D9E819E889E8B9E8C9E929E959E919E9D9EA59EA99EB8 -9EAA9EAD97619ECC9ECE9ECF9ED09ED49EDC9EDE9EDD9EE09EE59EE89EEF0000 -9EF49EF69EF79EF99EFB9EFC9EFD9F079F0876B79F159F219F2C9F3E9F4A9F52 -9F549F639F5F9F609F619F669F679F6C9F6A9F779F729F769F959F9C9FA0582F -69C79059746451DC719900000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000 diff --git a/library/encoding/symbol.enc b/library/encoding/symbol.enc deleted file mode 100644 index ffda9e3..0000000 --- a/library/encoding/symbol.enc +++ /dev/null @@ -1,20 +0,0 @@ -# Encoding file: symbol, single-byte -S -003F 1 1 -00 -0000000100020003000400050006000700080009000A000B000C000D000E000F -0010001100120013001400150016001700180019001A001B001C001D001E001F -0020002122000023220300250026220D002800292217002B002C2212002E002F -0030003100320033003400350036003700380039003A003B003C003D003E003F -22450391039203A70394039503A603930397039903D1039A039B039C039D039F -03A0039803A103A303A403A503C203A9039E03A80396005B2234005D22A5005F -F8E503B103B203C703B403B503C603B303B703B903D503BA03BB03BC03BD03BF -03C003B803C103C303C403C503D603C903BE03C803B6007B007C007D223C007F -0080008100820083008400850086008700880089008A008B008C008D008E008F -0090009100920093009400950096009700980099009A009B009C009D009E009F -000003D2203222642044221E0192266326662665266021942190219121922193 -00B000B12033226500D7221D2202202200F72260226122482026F8E6F8E721B5 -21352111211C21182297229522052229222A2283228722842282228622082209 -2220220700AE00A92122220F221A22C500AC2227222821D421D021D121D221D3 -22C42329F8E8F8E9F8EA2211F8EBF8ECF8EDF8EEF8EFF8F0F8F1F8F2F8F3F8F4 -F8FF232A222B2320F8F52321F8F6F8F7F8F8F8F9F8FAF8FBF8FCF8FDF8FE0000 diff --git a/library/history.tcl b/library/history.tcl deleted file mode 100644 index a3bfb85..0000000 --- a/library/history.tcl +++ /dev/null @@ -1,369 +0,0 @@ -# history.tcl -- -# -# Implementation of the history command. -# -# RCS: @(#) $Id: history.tcl,v 1.3 1998/09/14 18:40:03 stanton Exp $ -# -# Copyright (c) 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 tcl::history array holds the history list and -# some additional bookkeeping variables. -# -# nextid the index used for the next history list item. -# keep the max size of the history list -# oldest the index of the oldest item in the history. - -namespace eval tcl { - variable history - if {![info exists history]} { - array set history { - nextid 0 - keep 20 - oldest -20 - } - } -} - -# history -- -# -# This is the main history command. See the man page for its interface. -# This does argument checking and calls helper procedures in the -# history namespace. - -proc history {args} { - set len [llength $args] - if {$len == 0} { - return [tcl::HistInfo] - } - set key [lindex $args 0] - set options "add, change, clear, event, info, keep, nextid, or redo" - switch -glob -- $key { - a* { # history add - - if {$len > 3} { - return -code error "wrong # args: should be \"history add event ?exec?\"" - } - if {![string match $key* add]} { - return -code error "bad option \"$key\": must be $options" - } - if {$len == 3} { - set arg [lindex $args 2] - if {! ([string match e* $arg] && [string match $arg* exec])} { - return -code error "bad argument \"$arg\": should be \"exec\"" - } - } - return [tcl::HistAdd [lindex $args 1] [lindex $args 2]] - } - ch* { # history change - - if {($len > 3) || ($len < 2)} { - return -code error "wrong # args: should be \"history change newValue ?event?\"" - } - if {![string match $key* change]} { - return -code error "bad option \"$key\": must be $options" - } - if {$len == 2} { - set event 0 - } else { - set event [lindex $args 2] - } - - return [tcl::HistChange [lindex $args 1] $event] - } - cl* { # history clear - - if {($len > 1)} { - return -code error "wrong # args: should be \"history clear\"" - } - if {![string match $key* clear]} { - return -code error "bad option \"$key\": must be $options" - } - return [tcl::HistClear] - } - e* { # history event - - if {$len > 2} { - return -code error "wrong # args: should be \"history event ?event?\"" - } - if {![string match $key* event]} { - return -code error "bad option \"$key\": must be $options" - } - if {$len == 1} { - set event -1 - } else { - set event [lindex $args 1] - } - return [tcl::HistEvent $event] - } - i* { # history info - - if {$len > 2} { - return -code error "wrong # args: should be \"history info ?count?\"" - } - if {![string match $key* info]} { - return -code error "bad option \"$key\": must be $options" - } - return [tcl::HistInfo [lindex $args 1]] - } - k* { # history keep - - if {$len > 2} { - return -code error "wrong # args: should be \"history keep ?count?\"" - } - if {$len == 1} { - return [tcl::HistKeep] - } else { - set limit [lindex $args 1] - if {[catch {expr {~$limit}}] || ($limit < 0)} { - return -code error "illegal keep count \"$limit\"" - } - return [tcl::HistKeep $limit] - } - } - n* { # history nextid - - if {$len > 1} { - return -code error "wrong # args: should be \"history nextid\"" - } - if {![string match $key* nextid]} { - return -code error "bad option \"$key\": must be $options" - } - return [expr {$tcl::history(nextid) + 1}] - } - r* { # history redo - - if {$len > 2} { - return -code error "wrong # args: should be \"history redo ?event?\"" - } - if {![string match $key* redo]} { - return -code error "bad option \"$key\": must be $options" - } - return [tcl::HistRedo [lindex $args 1]] - } - default { - return -code error "bad option \"$key\": must be $options" - } - } -} - -# tcl::HistAdd -- -# -# Add an item to the history, and optionally eval it at the global scope -# -# Parameters: -# command the command to add -# exec (optional) a substring of "exec" causes the -# command to be evaled. -# Results: -# If executing, then the results of the command are returned -# -# Side Effects: -# Adds to the history list - - proc tcl::HistAdd {command {exec {}}} { - variable history - set i [incr history(nextid)] - set history($i) $command - set j [incr history(oldest)] - if {[info exists history($j)]} {unset history($j)} - if {[string match e* $exec]} { - return [uplevel #0 $command] - } else { - return {} - } -} - -# tcl::HistKeep -- -# -# Set or query the limit on the length of the history list -# -# Parameters: -# limit (optional) the length of the history list -# -# Results: -# If no limit is specified, the current limit is returned -# -# Side Effects: -# Updates history(keep) if a limit is specified - - proc tcl::HistKeep {{limit {}}} { - variable history - if {[string length $limit] == 0} { - return $history(keep) - } else { - set oldold $history(oldest) - set history(oldest) [expr {$history(nextid) - $limit}] - for {} {$oldold <= $history(oldest)} {incr oldold} { - if {[info exists history($oldold)]} {unset history($oldold)} - } - set history(keep) $limit - } -} - -# tcl::HistClear -- -# -# Erase the history list -# -# Parameters: -# none -# -# Results: -# none -# -# Side Effects: -# Resets the history array, except for the keep limit - - proc tcl::HistClear {} { - variable history - set keep $history(keep) - unset history - array set history [list \ - nextid 0 \ - keep $keep \ - oldest -$keep \ - ] -} - -# tcl::HistInfo -- -# -# Return a pretty-printed version of the history list -# -# Parameters: -# num (optional) the length of the history list to return -# -# Results: -# A formatted history list - - proc tcl::HistInfo {{num {}}} { - variable history - if {$num == {}} { - set num [expr {$history(keep) + 1}] - } - set result {} - set newline "" - for {set i [expr {$history(nextid) - $num + 1}]} \ - {$i <= $history(nextid)} {incr i} { - if {![info exists history($i)]} { - continue - } - set cmd [string trimright $history($i) \ \n] - regsub -all \n $cmd "\n\t" cmd - append result $newline[format "%6d %s" $i $cmd] - set newline \n - } - return $result -} - -# tcl::HistRedo -- -# -# Fetch the previous or specified event, execute it, and then -# replace the current history item with that event. -# -# Parameters: -# event (optional) index of history item to redo. Defaults to -1, -# which means the previous event. -# -# Results: -# Those of the command being redone. -# -# Side Effects: -# Replaces the current history list item with the one being redone. - - proc tcl::HistRedo {{event -1}} { - variable history - if {[string length $event] == 0} { - set event -1 - } - set i [HistIndex $event] - if {$i == $history(nextid)} { - return -code error "cannot redo the current event" - } - set cmd $history($i) - HistChange $cmd 0 - uplevel #0 $cmd -} - -# tcl::HistIndex -- -# -# Map from an event specifier to an index in the history list. -# -# Parameters: -# event index of history item to redo. -# If this is a positive number, it is used directly. -# If it is a negative number, then it counts back to a previous -# event, where -1 is the most recent event. -# A string can be matched, either by being the prefix of -# a command or by matching a command with string match. -# -# Results: -# The index into history, or an error if the index didn't match. - - proc tcl::HistIndex {event} { - variable history - if {[catch {expr {~$event}}]} { - for {set i $history(nextid)} {[info exists history($i)]} {incr i -1} { - if {[string match $event* $history($i)]} { - return $i; - } - if {[string match $event $history($i)]} { - return $i; - } - } - return -code error "no event matches \"$event\"" - } elseif {$event <= 0} { - set i [expr {$history(nextid) + $event}] - } else { - set i $event - } - if {$i <= $history(oldest)} { - return -code error "event \"$event\" is too far in the past" - } - if {$i > $history(nextid)} { - return -code error "event \"$event\" hasn't occured yet" - } - return $i -} - -# tcl::HistEvent -- -# -# Map from an event specifier to the value in the history list. -# -# Parameters: -# event index of history item to redo. See index for a -# description of possible event patterns. -# -# Results: -# The value from the history list. - - proc tcl::HistEvent {event} { - variable history - set i [HistIndex $event] - if {[info exists history($i)]} { - return [string trimright $history($i) \ \n] - } else { - return ""; - } -} - -# tcl::HistChange -- -# -# Replace a value in the history list. -# -# Parameters: -# cmd The new value to put into the history list. -# event (optional) index of history item to redo. See index for a -# description of possible event patterns. This defaults -# to 0, which specifies the current event. -# -# Side Effects: -# Changes the history list. - - proc tcl::HistChange {cmd {event 0}} { - variable history - set i [HistIndex $event] - set history($i) $cmd -} diff --git a/library/http/http.tcl b/library/http/http.tcl deleted file mode 100644 index 6ad16df..0000000 --- a/library/http/http.tcl +++ /dev/null @@ -1,466 +0,0 @@ -# http.tcl -- -# -# Client-side HTTP for GET, POST, and HEAD commands. -# These routines can be used in untrusted code that uses -# the Safesock security policy. These procedures use a -# callback interface to avoid using vwait, which is not -# defined in the safe base. -# -# See the file "license.terms" for information on usage and -# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: http.tcl,v 1.5 1999/02/02 22:28:30 stanton Exp $ - -package provide http 2.0 ;# This uses Tcl namespaces - -namespace eval http { - variable http - - array set http { - -accept */* - -proxyhost {} - -proxyport {} - -useragent {Tcl http client package 2.0} - -proxyfilter http::ProxyRequired - } - - variable formMap - set alphanumeric a-zA-Z0-9 - - for {set i 1} {$i <= 256} {incr i} { - set c [format %c $i] - if {![string match \[$alphanumeric\] $c]} { - set formMap($c) %[format %.2x $i] - } - } - # These are handled specially - array set formMap { - " " + \n %0d%0a - } - - namespace export geturl config reset wait formatQuery - # Useful, but not exported: data size status code -} - -# http::config -- -# -# See documentaion for details. -# -# Arguments: -# args Options parsed by the procedure. -# Results: -# TODO - -proc http::config {args} { - variable http - set options [lsort [array names http -*]] - set usage [join $options ", "] - if {[llength $args] == 0} { - set result {} - foreach name $options { - lappend result $name $http($name) - } - return $result - } - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - if {[llength $args] == 1} { - set flag [lindex $args 0] - if {[regexp -- $pat $flag]} { - return $http($flag) - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } else { - foreach {flag value} $args { - if {[regexp -- $pat $flag]} { - set http($flag) $value - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } - } -} - - proc http::Finish { token {errormsg ""} } { - variable $token - upvar 0 $token state - global errorInfo errorCode - if {[string length $errormsg] != 0} { - set state(error) [list $errormsg $errorInfo $errorCode] - set state(status) error - } - catch {close $state(sock)} - catch {after cancel $state(after)} - if {[info exists state(-command)]} { - if {[catch {eval $state(-command) {$token}} err]} { - if {[string length $errormsg] == 0} { - set state(error) [list $err $errorInfo $errorCode] - set state(status) error - } - } - if {[info exist state(-command)]} { - # Command callback may already have unset our state - unset state(-command) - } - } -} - -# http::reset -- -# -# See documentaion for details. -# -# Arguments: -# token Connection token. -# why Status info. -# Results: -# TODO - -proc http::reset { token {why reset} } { - variable $token - upvar 0 $token state - set state(status) $why - catch {fileevent $state(sock) readable {}} - Finish $token - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } -} - -# http::geturl -- -# -# Establishes a connection to a remote url via http. -# -# Arguments: -# url The http URL to goget. -# args Option value pairs. Valid options include: -# -blocksize, -validate, -headers, -timeout -# Results: -# Returns a token for this connection. - - -proc http::geturl { url args } { - variable http - if {![info exists http(uid)]} { - set http(uid) 0 - } - set token [namespace current]::[incr http(uid)] - variable $token - upvar 0 $token state - reset $token - array set state { - -blocksize 8192 - -validate 0 - -headers {} - -timeout 0 - state header - meta {} - currentsize 0 - totalsize 0 - type text/html - body {} - status "" - } - set options {-blocksize -channel -command -handler -headers \ - -progress -query -validate -timeout} - set usage [join $options ", "] - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - foreach {flag value} $args { - if {[regexp $pat $flag]} { - # Validate numbers - if {[info exists state($flag)] && \ - [regexp {^[0-9]+$} $state($flag)] && \ - ![regexp {^[0-9]+$} $value]} { - return -code error "Bad value for $flag ($value), must be integer" - } - set state($flag) $value - } else { - return -code error "Unknown option $flag, can be: $usage" - } - } - if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $url \ - x proto host y port srvurl]} { - error "Unsupported URL: $url" - } - if {[string length $port] == 0} { - set port 80 - } - if {[string length $srvurl] == 0} { - set srvurl / - } - if {[string length $proto] == 0} { - set url http://$url - } - set state(url) $url - if {![catch {$http(-proxyfilter) $host} proxy]} { - set phost [lindex $proxy 0] - set pport [lindex $proxy 1] - } - if {$state(-timeout) > 0} { - set state(after) [after $state(-timeout) [list http::reset $token timeout]] - } - if {[info exists phost] && [string length $phost]} { - set srvurl $url - set s [socket $phost $pport] - } else { - set s [socket $host $port] - } - set state(sock) $s - - # Send data in cr-lf format, but accept any line terminators - - fconfigure $s -translation {auto crlf} -buffersize $state(-blocksize) - - # The following is disallowed in safe interpreters, but the socket - # is already in non-blocking mode in that case. - - catch {fconfigure $s -blocking off} - set len 0 - set how GET - if {[info exists state(-query)]} { - set len [string length $state(-query)] - if {$len > 0} { - set how POST - } - } elseif {$state(-validate)} { - set how HEAD - } - puts $s "$how $srvurl HTTP/1.0" - puts $s "Accept: $http(-accept)" - puts $s "Host: $host" - puts $s "User-Agent: $http(-useragent)" - foreach {key value} $state(-headers) { - regsub -all \[\n\r\] $value {} value - set key [string trim $key] - if {[string length $key]} { - puts $s "$key: $value" - } - } - if {$len > 0} { - puts $s "Content-Length: $len" - puts $s "Content-Type: application/x-www-form-urlencoded" - puts $s "" - fconfigure $s -translation {auto binary} - puts $s $state(-query) - } else { - puts $s "" - } - flush $s - fileevent $s readable [list http::Event $token] - if {! [info exists state(-command)]} { - wait $token - } - return $token -} - -# Data access functions: -# Data - the URL data -# Status - the transaction status: ok, reset, eof, timeout -# Code - the HTTP transaction code, e.g., 200 -# Size - the size of the URL data - -proc http::data {token} { - variable $token - upvar 0 $token state - return $state(body) -} -proc http::status {token} { - variable $token - upvar 0 $token state - return $state(status) -} -proc http::code {token} { - variable $token - upvar 0 $token state - return $state(http) -} -proc http::size {token} { - variable $token - upvar 0 $token state - return $state(currentsize) -} - - proc http::Event {token} { - variable $token - upvar 0 $token state - set s $state(sock) - - if {[::eof $s]} { - Eof $token - return - } - if {$state(state) == "header"} { - set n [gets $s line] - if {$n == 0} { - set state(state) body - if {![regexp -nocase ^text $state(type)]} { - # Turn off conversions for non-text data - fconfigure $s -translation binary - if {[info exists state(-channel)]} { - fconfigure $state(-channel) -translation binary - } - } - if {[info exists state(-channel)] && - ![info exists state(-handler)]} { - # Initiate a sequence of background fcopies - fileevent $s readable {} - CopyStart $s $token - } - } elseif {$n > 0} { - if {[regexp -nocase {^content-type:(.+)$} $line x type]} { - set state(type) [string trim $type] - } - if {[regexp -nocase {^content-length:(.+)$} $line x length]} { - set state(totalsize) [string trim $length] - } - if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} { - lappend state(meta) $key $value - } elseif {[regexp ^HTTP $line]} { - set state(http) $line - } - } - } else { - if {[catch { - if {[info exists state(-handler)]} { - set n [eval $state(-handler) {$s $token}] - } else { - set block [read $s $state(-blocksize)] - set n [string length $block] - if {$n >= 0} { - append state(body) $block - } - } - if {$n >= 0} { - incr state(currentsize) $n - } - } err]} { - Finish $token $err - } else { - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - } - } -} - proc http::CopyStart {s token} { - variable $token - upvar 0 $token state - if {[catch { - fcopy $s $state(-channel) -size $state(-blocksize) -command \ - [list http::CopyDone $token] - } err]} { - Finish $token $err - } -} - proc http::CopyDone {token count {error {}}} { - variable $token - upvar 0 $token state - set s $state(sock) - incr state(currentsize) $count - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - # At this point the token may have been reset - if {([string length $error] != 0)} { - Finish $token $error - } elseif {[catch {::eof $s} iseof] || $iseof} { - Eof $token - } else { - CopyStart $s $token - } -} - proc http::Eof {token} { - variable $token - upvar 0 $token state - if {$state(state) == "header"} { - # Premature eof - set state(status) eof - } else { - set state(status) ok - } - set state(state) eof - Finish $token -} - -# http::wait -- -# -# See documentaion for details. -# -# Arguments: -# token Connection token. -# Results: -# The status after the wait. - -proc http::wait {token} { - variable $token - upvar 0 $token state - - if {![info exists state(status)] || [string length $state(status)] == 0} { - vwait $token\(status) - } - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } - return $state(status) -} - -# http::formatQuery -- -# -# See documentaion for details. -# Call http::formatQuery with an even number of arguments, where -# the first is a name, the second is a value, the third is another -# name, and so on. -# -# Arguments: -# args A list of name-value pairs. -# Results: -# TODO - -proc http::formatQuery {args} { - set result "" - set sep "" - foreach i $args { - append result $sep [mapReply $i] - if {$sep != "="} { - set sep = - } else { - set sep & - } - } - return $result -} - -# do x-www-urlencoded character mapping -# The spec says: "non-alphanumeric characters are replaced by '%HH'" -# 1 leave alphanumerics characters alone -# 2 Convert every other character to an array lookup -# 3 Escape constructs that are "special" to the tcl parser -# 4 "subst" the result, doing all the array substitutions - - proc http::mapReply {string} { - variable formMap - set alphanumeric a-zA-Z0-9 - regsub -all \[^$alphanumeric\] $string {$formMap(&)} string - regsub -all \n $string {\\n} string - regsub -all \t $string {\\t} string - regsub -all {[][{})\\]\)} $string {\\&} string - return [subst $string] -} - -# Default proxy filter. - proc http::ProxyRequired {host} { - variable http - if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} { - if {![info exists http(-proxyport)] || ![string length $http(-proxyport)]} { - set http(-proxyport) 8080 - } - return [list $http(-proxyhost) $http(-proxyport)] - } else { - return {} - } -} diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl deleted file mode 100644 index 01052f3..0000000 --- a/library/http/pkgIndex.tcl +++ /dev/null @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.0 -# 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 http 2.0 [list tclPkgSetup $dir http 2.0 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait}}}] diff --git a/library/http1.0/http.tcl b/library/http1.0/http.tcl deleted file mode 100644 index fe78879..0000000 --- a/library/http1.0/http.tcl +++ /dev/null @@ -1,379 +0,0 @@ -# http.tcl -# Client-side HTTP for GET, POST, and HEAD commands. -# These routines can be used in untrusted code that uses the Safesock -# security policy. -# These procedures use a callback interface to avoid using vwait, -# which is not defined in the safe base. -# -# RCS: @(#) $Id: http.tcl,v 1.3 1998/09/14 18:40:03 stanton Exp $ -# -# See the http.n man page for documentation - -package provide http 1.0 - -array set http { - -accept */* - -proxyhost {} - -proxyport {} - -useragent {Tcl http client package 1.0} - -proxyfilter httpProxyRequired -} -proc http_config {args} { - global http - set options [lsort [array names http -*]] - set usage [join $options ", "] - if {[llength $args] == 0} { - set result {} - foreach name $options { - lappend result $name $http($name) - } - return $result - } - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - if {[llength $args] == 1} { - set flag [lindex $args 0] - if {[regexp -- $pat $flag]} { - return $http($flag) - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } else { - foreach {flag value} $args { - if {[regexp -- $pat $flag]} { - set http($flag) $value - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } - } -} - - proc httpFinish { token {errormsg ""} } { - upvar #0 $token state - global errorInfo errorCode - if {[string length $errormsg] != 0} { - set state(error) [list $errormsg $errorInfo $errorCode] - set state(status) error - } - catch {close $state(sock)} - catch {after cancel $state(after)} - if {[info exists state(-command)]} { - if {[catch {eval $state(-command) {$token}} err]} { - if {[string length $errormsg] == 0} { - set state(error) [list $err $errorInfo $errorCode] - set state(status) error - } - } - unset state(-command) - } -} -proc http_reset { token {why reset} } { - upvar #0 $token state - set state(status) $why - catch {fileevent $state(sock) readable {}} - httpFinish $token - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } -} -proc http_get { url args } { - global http - if {![info exists http(uid)]} { - set http(uid) 0 - } - set token http#[incr http(uid)] - upvar #0 $token state - http_reset $token - array set state { - -blocksize 8192 - -validate 0 - -headers {} - -timeout 0 - state header - meta {} - currentsize 0 - totalsize 0 - type text/html - body {} - status "" - } - set options {-blocksize -channel -command -handler -headers \ - -progress -query -validate -timeout} - set usage [join $options ", "] - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - foreach {flag value} $args { - if {[regexp $pat $flag]} { - # Validate numbers - if {[info exists state($flag)] && \ - [regexp {^[0-9]+$} $state($flag)] && \ - ![regexp {^[0-9]+$} $value]} { - return -code error "Bad value for $flag ($value), must be integer" - } - set state($flag) $value - } else { - return -code error "Unknown option $flag, can be: $usage" - } - } - if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $url \ - x proto host y port srvurl]} { - error "Unsupported URL: $url" - } - if {[string length $port] == 0} { - set port 80 - } - if {[string length $srvurl] == 0} { - set srvurl / - } - if {[string length $proto] == 0} { - set url http://$url - } - set state(url) $url - if {![catch {$http(-proxyfilter) $host} proxy]} { - set phost [lindex $proxy 0] - set pport [lindex $proxy 1] - } - if {$state(-timeout) > 0} { - set state(after) [after $state(-timeout) [list http_reset $token timeout]] - } - if {[info exists phost] && [string length $phost]} { - set srvurl $url - set s [socket $phost $pport] - } else { - set s [socket $host $port] - } - set state(sock) $s - - # Send data in cr-lf format, but accept any line terminators - - fconfigure $s -translation {auto crlf} -buffersize $state(-blocksize) - - # The following is disallowed in safe interpreters, but the socket - # is already in non-blocking mode in that case. - - catch {fconfigure $s -blocking off} - set len 0 - set how GET - if {[info exists state(-query)]} { - set len [string length $state(-query)] - if {$len > 0} { - set how POST - } - } elseif {$state(-validate)} { - set how HEAD - } - puts $s "$how $srvurl HTTP/1.0" - puts $s "Accept: $http(-accept)" - puts $s "Host: $host" - puts $s "User-Agent: $http(-useragent)" - foreach {key value} $state(-headers) { - regsub -all \[\n\r\] $value {} value - set key [string trim $key] - if {[string length $key]} { - puts $s "$key: $value" - } - } - if {$len > 0} { - puts $s "Content-Length: $len" - puts $s "Content-Type: application/x-www-form-urlencoded" - puts $s "" - fconfigure $s -translation {auto binary} - puts $s $state(-query) - } else { - puts $s "" - } - flush $s - fileevent $s readable [list httpEvent $token] - if {! [info exists state(-command)]} { - http_wait $token - } - return $token -} -proc http_data {token} { - upvar #0 $token state - return $state(body) -} -proc http_status {token} { - upvar #0 $token state - return $state(status) -} -proc http_code {token} { - upvar #0 $token state - return $state(http) -} -proc http_size {token} { - upvar #0 $token state - return $state(currentsize) -} - - proc httpEvent {token} { - upvar #0 $token state - set s $state(sock) - - if {[eof $s]} { - httpEof $token - return - } - if {$state(state) == "header"} { - set n [gets $s line] - if {$n == 0} { - set state(state) body - if {![regexp -nocase ^text $state(type)]} { - # Turn off conversions for non-text data - fconfigure $s -translation binary - if {[info exists state(-channel)]} { - fconfigure $state(-channel) -translation binary - } - } - if {[info exists state(-channel)] && - ![info exists state(-handler)]} { - # Initiate a sequence of background fcopies - fileevent $s readable {} - httpCopyStart $s $token - } - } elseif {$n > 0} { - if {[regexp -nocase {^content-type:(.+)$} $line x type]} { - set state(type) [string trim $type] - } - if {[regexp -nocase {^content-length:(.+)$} $line x length]} { - set state(totalsize) [string trim $length] - } - if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} { - lappend state(meta) $key $value - } elseif {[regexp ^HTTP $line]} { - set state(http) $line - } - } - } else { - if {[catch { - if {[info exists state(-handler)]} { - set n [eval $state(-handler) {$s $token}] - } else { - set block [read $s $state(-blocksize)] - set n [string length $block] - if {$n >= 0} { - append state(body) $block - } - } - if {$n >= 0} { - incr state(currentsize) $n - } - } err]} { - httpFinish $token $err - } else { - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - } - } -} - proc httpCopyStart {s token} { - upvar #0 $token state - if {[catch { - fcopy $s $state(-channel) -size $state(-blocksize) -command \ - [list httpCopyDone $token] - } err]} { - httpFinish $token $err - } -} - proc httpCopyDone {token count {error {}}} { - upvar #0 $token state - set s $state(sock) - incr state(currentsize) $count - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - if {([string length $error] != 0)} { - httpFinish $token $error - } elseif {[eof $s]} { - httpEof $token - } else { - httpCopyStart $s $token - } -} - proc httpEof {token} { - upvar #0 $token state - if {$state(state) == "header"} { - # Premature eof - set state(status) eof - } else { - set state(status) ok - } - set state(state) eof - httpFinish $token -} -proc http_wait {token} { - upvar #0 $token state - if {![info exists state(status)] || [string length $state(status)] == 0} { - vwait $token\(status) - } - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } - return $state(status) -} - -# Call http_formatQuery with an even number of arguments, where the first is -# a name, the second is a value, the third is another name, and so on. - -proc http_formatQuery {args} { - set result "" - set sep "" - foreach i $args { - append result $sep [httpMapReply $i] - if {$sep != "="} { - set sep = - } else { - set sep & - } - } - return $result -} - -# do x-www-urlencoded character mapping -# The spec says: "non-alphanumeric characters are replaced by '%HH'" -# 1 leave alphanumerics characters alone -# 2 Convert every other character to an array lookup -# 3 Escape constructs that are "special" to the tcl parser -# 4 "subst" the result, doing all the array substitutions - - proc httpMapReply {string} { - global httpFormMap - set alphanumeric a-zA-Z0-9 - if {![info exists httpFormMap]} { - - for {set i 1} {$i <= 256} {incr i} { - set c [format %c $i] - if {![string match \[$alphanumeric\] $c]} { - set httpFormMap($c) %[format %.2x $i] - } - } - # These are handled specially - array set httpFormMap { - " " + \n %0d%0a - } - } - regsub -all \[^$alphanumeric\] $string {$httpFormMap(&)} string - regsub -all \n $string {\\n} string - regsub -all \t $string {\\t} string - regsub -all {[][{})\\]\)} $string {\\&} string - return [subst $string] -} - -# Default proxy filter. - proc httpProxyRequired {host} { - global http - if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} { - if {![info exists http(-proxyport)] || ![string length $http(-proxyport)]} { - set http(-proxyport) 8080 - } - return [list $http(-proxyhost) $http(-proxyport)] - } else { - return {} - } -} diff --git a/library/http1.0/pkgIndex.tcl b/library/http1.0/pkgIndex.tcl deleted file mode 100644 index ab6170f..0000000 --- a/library/http1.0/pkgIndex.tcl +++ /dev/null @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.0 -# 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 http 1.0 [list tclPkgSetup $dir http 1.0 {{http.tcl source {httpCopyDone httpCopyStart httpEof httpEvent httpFinish httpMapReply httpProxyRequired http_code http_config http_data http_formatQuery http_get http_reset http_size http_status http_wait}}}] diff --git a/library/http2.0/http.tcl b/library/http2.0/http.tcl deleted file mode 100644 index 6ad16df..0000000 --- a/library/http2.0/http.tcl +++ /dev/null @@ -1,466 +0,0 @@ -# http.tcl -- -# -# Client-side HTTP for GET, POST, and HEAD commands. -# These routines can be used in untrusted code that uses -# the Safesock security policy. These procedures use a -# callback interface to avoid using vwait, which is not -# defined in the safe base. -# -# See the file "license.terms" for information on usage and -# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: http.tcl,v 1.5 1999/02/02 22:28:30 stanton Exp $ - -package provide http 2.0 ;# This uses Tcl namespaces - -namespace eval http { - variable http - - array set http { - -accept */* - -proxyhost {} - -proxyport {} - -useragent {Tcl http client package 2.0} - -proxyfilter http::ProxyRequired - } - - variable formMap - set alphanumeric a-zA-Z0-9 - - for {set i 1} {$i <= 256} {incr i} { - set c [format %c $i] - if {![string match \[$alphanumeric\] $c]} { - set formMap($c) %[format %.2x $i] - } - } - # These are handled specially - array set formMap { - " " + \n %0d%0a - } - - namespace export geturl config reset wait formatQuery - # Useful, but not exported: data size status code -} - -# http::config -- -# -# See documentaion for details. -# -# Arguments: -# args Options parsed by the procedure. -# Results: -# TODO - -proc http::config {args} { - variable http - set options [lsort [array names http -*]] - set usage [join $options ", "] - if {[llength $args] == 0} { - set result {} - foreach name $options { - lappend result $name $http($name) - } - return $result - } - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - if {[llength $args] == 1} { - set flag [lindex $args 0] - if {[regexp -- $pat $flag]} { - return $http($flag) - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } else { - foreach {flag value} $args { - if {[regexp -- $pat $flag]} { - set http($flag) $value - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } - } -} - - proc http::Finish { token {errormsg ""} } { - variable $token - upvar 0 $token state - global errorInfo errorCode - if {[string length $errormsg] != 0} { - set state(error) [list $errormsg $errorInfo $errorCode] - set state(status) error - } - catch {close $state(sock)} - catch {after cancel $state(after)} - if {[info exists state(-command)]} { - if {[catch {eval $state(-command) {$token}} err]} { - if {[string length $errormsg] == 0} { - set state(error) [list $err $errorInfo $errorCode] - set state(status) error - } - } - if {[info exist state(-command)]} { - # Command callback may already have unset our state - unset state(-command) - } - } -} - -# http::reset -- -# -# See documentaion for details. -# -# Arguments: -# token Connection token. -# why Status info. -# Results: -# TODO - -proc http::reset { token {why reset} } { - variable $token - upvar 0 $token state - set state(status) $why - catch {fileevent $state(sock) readable {}} - Finish $token - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } -} - -# http::geturl -- -# -# Establishes a connection to a remote url via http. -# -# Arguments: -# url The http URL to goget. -# args Option value pairs. Valid options include: -# -blocksize, -validate, -headers, -timeout -# Results: -# Returns a token for this connection. - - -proc http::geturl { url args } { - variable http - if {![info exists http(uid)]} { - set http(uid) 0 - } - set token [namespace current]::[incr http(uid)] - variable $token - upvar 0 $token state - reset $token - array set state { - -blocksize 8192 - -validate 0 - -headers {} - -timeout 0 - state header - meta {} - currentsize 0 - totalsize 0 - type text/html - body {} - status "" - } - set options {-blocksize -channel -command -handler -headers \ - -progress -query -validate -timeout} - set usage [join $options ", "] - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - foreach {flag value} $args { - if {[regexp $pat $flag]} { - # Validate numbers - if {[info exists state($flag)] && \ - [regexp {^[0-9]+$} $state($flag)] && \ - ![regexp {^[0-9]+$} $value]} { - return -code error "Bad value for $flag ($value), must be integer" - } - set state($flag) $value - } else { - return -code error "Unknown option $flag, can be: $usage" - } - } - if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $url \ - x proto host y port srvurl]} { - error "Unsupported URL: $url" - } - if {[string length $port] == 0} { - set port 80 - } - if {[string length $srvurl] == 0} { - set srvurl / - } - if {[string length $proto] == 0} { - set url http://$url - } - set state(url) $url - if {![catch {$http(-proxyfilter) $host} proxy]} { - set phost [lindex $proxy 0] - set pport [lindex $proxy 1] - } - if {$state(-timeout) > 0} { - set state(after) [after $state(-timeout) [list http::reset $token timeout]] - } - if {[info exists phost] && [string length $phost]} { - set srvurl $url - set s [socket $phost $pport] - } else { - set s [socket $host $port] - } - set state(sock) $s - - # Send data in cr-lf format, but accept any line terminators - - fconfigure $s -translation {auto crlf} -buffersize $state(-blocksize) - - # The following is disallowed in safe interpreters, but the socket - # is already in non-blocking mode in that case. - - catch {fconfigure $s -blocking off} - set len 0 - set how GET - if {[info exists state(-query)]} { - set len [string length $state(-query)] - if {$len > 0} { - set how POST - } - } elseif {$state(-validate)} { - set how HEAD - } - puts $s "$how $srvurl HTTP/1.0" - puts $s "Accept: $http(-accept)" - puts $s "Host: $host" - puts $s "User-Agent: $http(-useragent)" - foreach {key value} $state(-headers) { - regsub -all \[\n\r\] $value {} value - set key [string trim $key] - if {[string length $key]} { - puts $s "$key: $value" - } - } - if {$len > 0} { - puts $s "Content-Length: $len" - puts $s "Content-Type: application/x-www-form-urlencoded" - puts $s "" - fconfigure $s -translation {auto binary} - puts $s $state(-query) - } else { - puts $s "" - } - flush $s - fileevent $s readable [list http::Event $token] - if {! [info exists state(-command)]} { - wait $token - } - return $token -} - -# Data access functions: -# Data - the URL data -# Status - the transaction status: ok, reset, eof, timeout -# Code - the HTTP transaction code, e.g., 200 -# Size - the size of the URL data - -proc http::data {token} { - variable $token - upvar 0 $token state - return $state(body) -} -proc http::status {token} { - variable $token - upvar 0 $token state - return $state(status) -} -proc http::code {token} { - variable $token - upvar 0 $token state - return $state(http) -} -proc http::size {token} { - variable $token - upvar 0 $token state - return $state(currentsize) -} - - proc http::Event {token} { - variable $token - upvar 0 $token state - set s $state(sock) - - if {[::eof $s]} { - Eof $token - return - } - if {$state(state) == "header"} { - set n [gets $s line] - if {$n == 0} { - set state(state) body - if {![regexp -nocase ^text $state(type)]} { - # Turn off conversions for non-text data - fconfigure $s -translation binary - if {[info exists state(-channel)]} { - fconfigure $state(-channel) -translation binary - } - } - if {[info exists state(-channel)] && - ![info exists state(-handler)]} { - # Initiate a sequence of background fcopies - fileevent $s readable {} - CopyStart $s $token - } - } elseif {$n > 0} { - if {[regexp -nocase {^content-type:(.+)$} $line x type]} { - set state(type) [string trim $type] - } - if {[regexp -nocase {^content-length:(.+)$} $line x length]} { - set state(totalsize) [string trim $length] - } - if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} { - lappend state(meta) $key $value - } elseif {[regexp ^HTTP $line]} { - set state(http) $line - } - } - } else { - if {[catch { - if {[info exists state(-handler)]} { - set n [eval $state(-handler) {$s $token}] - } else { - set block [read $s $state(-blocksize)] - set n [string length $block] - if {$n >= 0} { - append state(body) $block - } - } - if {$n >= 0} { - incr state(currentsize) $n - } - } err]} { - Finish $token $err - } else { - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - } - } -} - proc http::CopyStart {s token} { - variable $token - upvar 0 $token state - if {[catch { - fcopy $s $state(-channel) -size $state(-blocksize) -command \ - [list http::CopyDone $token] - } err]} { - Finish $token $err - } -} - proc http::CopyDone {token count {error {}}} { - variable $token - upvar 0 $token state - set s $state(sock) - incr state(currentsize) $count - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - # At this point the token may have been reset - if {([string length $error] != 0)} { - Finish $token $error - } elseif {[catch {::eof $s} iseof] || $iseof} { - Eof $token - } else { - CopyStart $s $token - } -} - proc http::Eof {token} { - variable $token - upvar 0 $token state - if {$state(state) == "header"} { - # Premature eof - set state(status) eof - } else { - set state(status) ok - } - set state(state) eof - Finish $token -} - -# http::wait -- -# -# See documentaion for details. -# -# Arguments: -# token Connection token. -# Results: -# The status after the wait. - -proc http::wait {token} { - variable $token - upvar 0 $token state - - if {![info exists state(status)] || [string length $state(status)] == 0} { - vwait $token\(status) - } - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } - return $state(status) -} - -# http::formatQuery -- -# -# See documentaion for details. -# Call http::formatQuery with an even number of arguments, where -# the first is a name, the second is a value, the third is another -# name, and so on. -# -# Arguments: -# args A list of name-value pairs. -# Results: -# TODO - -proc http::formatQuery {args} { - set result "" - set sep "" - foreach i $args { - append result $sep [mapReply $i] - if {$sep != "="} { - set sep = - } else { - set sep & - } - } - return $result -} - -# do x-www-urlencoded character mapping -# The spec says: "non-alphanumeric characters are replaced by '%HH'" -# 1 leave alphanumerics characters alone -# 2 Convert every other character to an array lookup -# 3 Escape constructs that are "special" to the tcl parser -# 4 "subst" the result, doing all the array substitutions - - proc http::mapReply {string} { - variable formMap - set alphanumeric a-zA-Z0-9 - regsub -all \[^$alphanumeric\] $string {$formMap(&)} string - regsub -all \n $string {\\n} string - regsub -all \t $string {\\t} string - regsub -all {[][{})\\]\)} $string {\\&} string - return [subst $string] -} - -# Default proxy filter. - proc http::ProxyRequired {host} { - variable http - if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} { - if {![info exists http(-proxyport)] || ![string length $http(-proxyport)]} { - set http(-proxyport) 8080 - } - return [list $http(-proxyhost) $http(-proxyport)] - } else { - return {} - } -} diff --git a/library/http2.0/pkgIndex.tcl b/library/http2.0/pkgIndex.tcl deleted file mode 100644 index 01052f3..0000000 --- a/library/http2.0/pkgIndex.tcl +++ /dev/null @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.0 -# 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 http 2.0 [list tclPkgSetup $dir http 2.0 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait}}}] diff --git a/library/http2.1/http.tcl b/library/http2.1/http.tcl deleted file mode 100644 index 6ad16df..0000000 --- a/library/http2.1/http.tcl +++ /dev/null @@ -1,466 +0,0 @@ -# http.tcl -- -# -# Client-side HTTP for GET, POST, and HEAD commands. -# These routines can be used in untrusted code that uses -# the Safesock security policy. These procedures use a -# callback interface to avoid using vwait, which is not -# defined in the safe base. -# -# See the file "license.terms" for information on usage and -# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: http.tcl,v 1.5 1999/02/02 22:28:30 stanton Exp $ - -package provide http 2.0 ;# This uses Tcl namespaces - -namespace eval http { - variable http - - array set http { - -accept */* - -proxyhost {} - -proxyport {} - -useragent {Tcl http client package 2.0} - -proxyfilter http::ProxyRequired - } - - variable formMap - set alphanumeric a-zA-Z0-9 - - for {set i 1} {$i <= 256} {incr i} { - set c [format %c $i] - if {![string match \[$alphanumeric\] $c]} { - set formMap($c) %[format %.2x $i] - } - } - # These are handled specially - array set formMap { - " " + \n %0d%0a - } - - namespace export geturl config reset wait formatQuery - # Useful, but not exported: data size status code -} - -# http::config -- -# -# See documentaion for details. -# -# Arguments: -# args Options parsed by the procedure. -# Results: -# TODO - -proc http::config {args} { - variable http - set options [lsort [array names http -*]] - set usage [join $options ", "] - if {[llength $args] == 0} { - set result {} - foreach name $options { - lappend result $name $http($name) - } - return $result - } - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - if {[llength $args] == 1} { - set flag [lindex $args 0] - if {[regexp -- $pat $flag]} { - return $http($flag) - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } else { - foreach {flag value} $args { - if {[regexp -- $pat $flag]} { - set http($flag) $value - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } - } -} - - proc http::Finish { token {errormsg ""} } { - variable $token - upvar 0 $token state - global errorInfo errorCode - if {[string length $errormsg] != 0} { - set state(error) [list $errormsg $errorInfo $errorCode] - set state(status) error - } - catch {close $state(sock)} - catch {after cancel $state(after)} - if {[info exists state(-command)]} { - if {[catch {eval $state(-command) {$token}} err]} { - if {[string length $errormsg] == 0} { - set state(error) [list $err $errorInfo $errorCode] - set state(status) error - } - } - if {[info exist state(-command)]} { - # Command callback may already have unset our state - unset state(-command) - } - } -} - -# http::reset -- -# -# See documentaion for details. -# -# Arguments: -# token Connection token. -# why Status info. -# Results: -# TODO - -proc http::reset { token {why reset} } { - variable $token - upvar 0 $token state - set state(status) $why - catch {fileevent $state(sock) readable {}} - Finish $token - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } -} - -# http::geturl -- -# -# Establishes a connection to a remote url via http. -# -# Arguments: -# url The http URL to goget. -# args Option value pairs. Valid options include: -# -blocksize, -validate, -headers, -timeout -# Results: -# Returns a token for this connection. - - -proc http::geturl { url args } { - variable http - if {![info exists http(uid)]} { - set http(uid) 0 - } - set token [namespace current]::[incr http(uid)] - variable $token - upvar 0 $token state - reset $token - array set state { - -blocksize 8192 - -validate 0 - -headers {} - -timeout 0 - state header - meta {} - currentsize 0 - totalsize 0 - type text/html - body {} - status "" - } - set options {-blocksize -channel -command -handler -headers \ - -progress -query -validate -timeout} - set usage [join $options ", "] - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - foreach {flag value} $args { - if {[regexp $pat $flag]} { - # Validate numbers - if {[info exists state($flag)] && \ - [regexp {^[0-9]+$} $state($flag)] && \ - ![regexp {^[0-9]+$} $value]} { - return -code error "Bad value for $flag ($value), must be integer" - } - set state($flag) $value - } else { - return -code error "Unknown option $flag, can be: $usage" - } - } - if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $url \ - x proto host y port srvurl]} { - error "Unsupported URL: $url" - } - if {[string length $port] == 0} { - set port 80 - } - if {[string length $srvurl] == 0} { - set srvurl / - } - if {[string length $proto] == 0} { - set url http://$url - } - set state(url) $url - if {![catch {$http(-proxyfilter) $host} proxy]} { - set phost [lindex $proxy 0] - set pport [lindex $proxy 1] - } - if {$state(-timeout) > 0} { - set state(after) [after $state(-timeout) [list http::reset $token timeout]] - } - if {[info exists phost] && [string length $phost]} { - set srvurl $url - set s [socket $phost $pport] - } else { - set s [socket $host $port] - } - set state(sock) $s - - # Send data in cr-lf format, but accept any line terminators - - fconfigure $s -translation {auto crlf} -buffersize $state(-blocksize) - - # The following is disallowed in safe interpreters, but the socket - # is already in non-blocking mode in that case. - - catch {fconfigure $s -blocking off} - set len 0 - set how GET - if {[info exists state(-query)]} { - set len [string length $state(-query)] - if {$len > 0} { - set how POST - } - } elseif {$state(-validate)} { - set how HEAD - } - puts $s "$how $srvurl HTTP/1.0" - puts $s "Accept: $http(-accept)" - puts $s "Host: $host" - puts $s "User-Agent: $http(-useragent)" - foreach {key value} $state(-headers) { - regsub -all \[\n\r\] $value {} value - set key [string trim $key] - if {[string length $key]} { - puts $s "$key: $value" - } - } - if {$len > 0} { - puts $s "Content-Length: $len" - puts $s "Content-Type: application/x-www-form-urlencoded" - puts $s "" - fconfigure $s -translation {auto binary} - puts $s $state(-query) - } else { - puts $s "" - } - flush $s - fileevent $s readable [list http::Event $token] - if {! [info exists state(-command)]} { - wait $token - } - return $token -} - -# Data access functions: -# Data - the URL data -# Status - the transaction status: ok, reset, eof, timeout -# Code - the HTTP transaction code, e.g., 200 -# Size - the size of the URL data - -proc http::data {token} { - variable $token - upvar 0 $token state - return $state(body) -} -proc http::status {token} { - variable $token - upvar 0 $token state - return $state(status) -} -proc http::code {token} { - variable $token - upvar 0 $token state - return $state(http) -} -proc http::size {token} { - variable $token - upvar 0 $token state - return $state(currentsize) -} - - proc http::Event {token} { - variable $token - upvar 0 $token state - set s $state(sock) - - if {[::eof $s]} { - Eof $token - return - } - if {$state(state) == "header"} { - set n [gets $s line] - if {$n == 0} { - set state(state) body - if {![regexp -nocase ^text $state(type)]} { - # Turn off conversions for non-text data - fconfigure $s -translation binary - if {[info exists state(-channel)]} { - fconfigure $state(-channel) -translation binary - } - } - if {[info exists state(-channel)] && - ![info exists state(-handler)]} { - # Initiate a sequence of background fcopies - fileevent $s readable {} - CopyStart $s $token - } - } elseif {$n > 0} { - if {[regexp -nocase {^content-type:(.+)$} $line x type]} { - set state(type) [string trim $type] - } - if {[regexp -nocase {^content-length:(.+)$} $line x length]} { - set state(totalsize) [string trim $length] - } - if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} { - lappend state(meta) $key $value - } elseif {[regexp ^HTTP $line]} { - set state(http) $line - } - } - } else { - if {[catch { - if {[info exists state(-handler)]} { - set n [eval $state(-handler) {$s $token}] - } else { - set block [read $s $state(-blocksize)] - set n [string length $block] - if {$n >= 0} { - append state(body) $block - } - } - if {$n >= 0} { - incr state(currentsize) $n - } - } err]} { - Finish $token $err - } else { - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - } - } -} - proc http::CopyStart {s token} { - variable $token - upvar 0 $token state - if {[catch { - fcopy $s $state(-channel) -size $state(-blocksize) -command \ - [list http::CopyDone $token] - } err]} { - Finish $token $err - } -} - proc http::CopyDone {token count {error {}}} { - variable $token - upvar 0 $token state - set s $state(sock) - incr state(currentsize) $count - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - # At this point the token may have been reset - if {([string length $error] != 0)} { - Finish $token $error - } elseif {[catch {::eof $s} iseof] || $iseof} { - Eof $token - } else { - CopyStart $s $token - } -} - proc http::Eof {token} { - variable $token - upvar 0 $token state - if {$state(state) == "header"} { - # Premature eof - set state(status) eof - } else { - set state(status) ok - } - set state(state) eof - Finish $token -} - -# http::wait -- -# -# See documentaion for details. -# -# Arguments: -# token Connection token. -# Results: -# The status after the wait. - -proc http::wait {token} { - variable $token - upvar 0 $token state - - if {![info exists state(status)] || [string length $state(status)] == 0} { - vwait $token\(status) - } - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } - return $state(status) -} - -# http::formatQuery -- -# -# See documentaion for details. -# Call http::formatQuery with an even number of arguments, where -# the first is a name, the second is a value, the third is another -# name, and so on. -# -# Arguments: -# args A list of name-value pairs. -# Results: -# TODO - -proc http::formatQuery {args} { - set result "" - set sep "" - foreach i $args { - append result $sep [mapReply $i] - if {$sep != "="} { - set sep = - } else { - set sep & - } - } - return $result -} - -# do x-www-urlencoded character mapping -# The spec says: "non-alphanumeric characters are replaced by '%HH'" -# 1 leave alphanumerics characters alone -# 2 Convert every other character to an array lookup -# 3 Escape constructs that are "special" to the tcl parser -# 4 "subst" the result, doing all the array substitutions - - proc http::mapReply {string} { - variable formMap - set alphanumeric a-zA-Z0-9 - regsub -all \[^$alphanumeric\] $string {$formMap(&)} string - regsub -all \n $string {\\n} string - regsub -all \t $string {\\t} string - regsub -all {[][{})\\]\)} $string {\\&} string - return [subst $string] -} - -# Default proxy filter. - proc http::ProxyRequired {host} { - variable http - if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} { - if {![info exists http(-proxyport)] || ![string length $http(-proxyport)]} { - set http(-proxyport) 8080 - } - return [list $http(-proxyhost) $http(-proxyport)] - } else { - return {} - } -} diff --git a/library/http2.1/pkgIndex.tcl b/library/http2.1/pkgIndex.tcl deleted file mode 100644 index 01052f3..0000000 --- a/library/http2.1/pkgIndex.tcl +++ /dev/null @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.0 -# 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 http 2.0 [list tclPkgSetup $dir http 2.0 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait}}}] diff --git a/library/http2.3/http.tcl b/library/http2.3/http.tcl deleted file mode 100644 index 6ad16df..0000000 --- a/library/http2.3/http.tcl +++ /dev/null @@ -1,466 +0,0 @@ -# http.tcl -- -# -# Client-side HTTP for GET, POST, and HEAD commands. -# These routines can be used in untrusted code that uses -# the Safesock security policy. These procedures use a -# callback interface to avoid using vwait, which is not -# defined in the safe base. -# -# See the file "license.terms" for information on usage and -# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: http.tcl,v 1.5 1999/02/02 22:28:30 stanton Exp $ - -package provide http 2.0 ;# This uses Tcl namespaces - -namespace eval http { - variable http - - array set http { - -accept */* - -proxyhost {} - -proxyport {} - -useragent {Tcl http client package 2.0} - -proxyfilter http::ProxyRequired - } - - variable formMap - set alphanumeric a-zA-Z0-9 - - for {set i 1} {$i <= 256} {incr i} { - set c [format %c $i] - if {![string match \[$alphanumeric\] $c]} { - set formMap($c) %[format %.2x $i] - } - } - # These are handled specially - array set formMap { - " " + \n %0d%0a - } - - namespace export geturl config reset wait formatQuery - # Useful, but not exported: data size status code -} - -# http::config -- -# -# See documentaion for details. -# -# Arguments: -# args Options parsed by the procedure. -# Results: -# TODO - -proc http::config {args} { - variable http - set options [lsort [array names http -*]] - set usage [join $options ", "] - if {[llength $args] == 0} { - set result {} - foreach name $options { - lappend result $name $http($name) - } - return $result - } - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - if {[llength $args] == 1} { - set flag [lindex $args 0] - if {[regexp -- $pat $flag]} { - return $http($flag) - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } else { - foreach {flag value} $args { - if {[regexp -- $pat $flag]} { - set http($flag) $value - } else { - return -code error "Unknown option $flag, must be: $usage" - } - } - } -} - - proc http::Finish { token {errormsg ""} } { - variable $token - upvar 0 $token state - global errorInfo errorCode - if {[string length $errormsg] != 0} { - set state(error) [list $errormsg $errorInfo $errorCode] - set state(status) error - } - catch {close $state(sock)} - catch {after cancel $state(after)} - if {[info exists state(-command)]} { - if {[catch {eval $state(-command) {$token}} err]} { - if {[string length $errormsg] == 0} { - set state(error) [list $err $errorInfo $errorCode] - set state(status) error - } - } - if {[info exist state(-command)]} { - # Command callback may already have unset our state - unset state(-command) - } - } -} - -# http::reset -- -# -# See documentaion for details. -# -# Arguments: -# token Connection token. -# why Status info. -# Results: -# TODO - -proc http::reset { token {why reset} } { - variable $token - upvar 0 $token state - set state(status) $why - catch {fileevent $state(sock) readable {}} - Finish $token - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } -} - -# http::geturl -- -# -# Establishes a connection to a remote url via http. -# -# Arguments: -# url The http URL to goget. -# args Option value pairs. Valid options include: -# -blocksize, -validate, -headers, -timeout -# Results: -# Returns a token for this connection. - - -proc http::geturl { url args } { - variable http - if {![info exists http(uid)]} { - set http(uid) 0 - } - set token [namespace current]::[incr http(uid)] - variable $token - upvar 0 $token state - reset $token - array set state { - -blocksize 8192 - -validate 0 - -headers {} - -timeout 0 - state header - meta {} - currentsize 0 - totalsize 0 - type text/html - body {} - status "" - } - set options {-blocksize -channel -command -handler -headers \ - -progress -query -validate -timeout} - set usage [join $options ", "] - regsub -all -- - $options {} options - set pat ^-([join $options |])$ - foreach {flag value} $args { - if {[regexp $pat $flag]} { - # Validate numbers - if {[info exists state($flag)] && \ - [regexp {^[0-9]+$} $state($flag)] && \ - ![regexp {^[0-9]+$} $value]} { - return -code error "Bad value for $flag ($value), must be integer" - } - set state($flag) $value - } else { - return -code error "Unknown option $flag, can be: $usage" - } - } - if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $url \ - x proto host y port srvurl]} { - error "Unsupported URL: $url" - } - if {[string length $port] == 0} { - set port 80 - } - if {[string length $srvurl] == 0} { - set srvurl / - } - if {[string length $proto] == 0} { - set url http://$url - } - set state(url) $url - if {![catch {$http(-proxyfilter) $host} proxy]} { - set phost [lindex $proxy 0] - set pport [lindex $proxy 1] - } - if {$state(-timeout) > 0} { - set state(after) [after $state(-timeout) [list http::reset $token timeout]] - } - if {[info exists phost] && [string length $phost]} { - set srvurl $url - set s [socket $phost $pport] - } else { - set s [socket $host $port] - } - set state(sock) $s - - # Send data in cr-lf format, but accept any line terminators - - fconfigure $s -translation {auto crlf} -buffersize $state(-blocksize) - - # The following is disallowed in safe interpreters, but the socket - # is already in non-blocking mode in that case. - - catch {fconfigure $s -blocking off} - set len 0 - set how GET - if {[info exists state(-query)]} { - set len [string length $state(-query)] - if {$len > 0} { - set how POST - } - } elseif {$state(-validate)} { - set how HEAD - } - puts $s "$how $srvurl HTTP/1.0" - puts $s "Accept: $http(-accept)" - puts $s "Host: $host" - puts $s "User-Agent: $http(-useragent)" - foreach {key value} $state(-headers) { - regsub -all \[\n\r\] $value {} value - set key [string trim $key] - if {[string length $key]} { - puts $s "$key: $value" - } - } - if {$len > 0} { - puts $s "Content-Length: $len" - puts $s "Content-Type: application/x-www-form-urlencoded" - puts $s "" - fconfigure $s -translation {auto binary} - puts $s $state(-query) - } else { - puts $s "" - } - flush $s - fileevent $s readable [list http::Event $token] - if {! [info exists state(-command)]} { - wait $token - } - return $token -} - -# Data access functions: -# Data - the URL data -# Status - the transaction status: ok, reset, eof, timeout -# Code - the HTTP transaction code, e.g., 200 -# Size - the size of the URL data - -proc http::data {token} { - variable $token - upvar 0 $token state - return $state(body) -} -proc http::status {token} { - variable $token - upvar 0 $token state - return $state(status) -} -proc http::code {token} { - variable $token - upvar 0 $token state - return $state(http) -} -proc http::size {token} { - variable $token - upvar 0 $token state - return $state(currentsize) -} - - proc http::Event {token} { - variable $token - upvar 0 $token state - set s $state(sock) - - if {[::eof $s]} { - Eof $token - return - } - if {$state(state) == "header"} { - set n [gets $s line] - if {$n == 0} { - set state(state) body - if {![regexp -nocase ^text $state(type)]} { - # Turn off conversions for non-text data - fconfigure $s -translation binary - if {[info exists state(-channel)]} { - fconfigure $state(-channel) -translation binary - } - } - if {[info exists state(-channel)] && - ![info exists state(-handler)]} { - # Initiate a sequence of background fcopies - fileevent $s readable {} - CopyStart $s $token - } - } elseif {$n > 0} { - if {[regexp -nocase {^content-type:(.+)$} $line x type]} { - set state(type) [string trim $type] - } - if {[regexp -nocase {^content-length:(.+)$} $line x length]} { - set state(totalsize) [string trim $length] - } - if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} { - lappend state(meta) $key $value - } elseif {[regexp ^HTTP $line]} { - set state(http) $line - } - } - } else { - if {[catch { - if {[info exists state(-handler)]} { - set n [eval $state(-handler) {$s $token}] - } else { - set block [read $s $state(-blocksize)] - set n [string length $block] - if {$n >= 0} { - append state(body) $block - } - } - if {$n >= 0} { - incr state(currentsize) $n - } - } err]} { - Finish $token $err - } else { - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - } - } -} - proc http::CopyStart {s token} { - variable $token - upvar 0 $token state - if {[catch { - fcopy $s $state(-channel) -size $state(-blocksize) -command \ - [list http::CopyDone $token] - } err]} { - Finish $token $err - } -} - proc http::CopyDone {token count {error {}}} { - variable $token - upvar 0 $token state - set s $state(sock) - incr state(currentsize) $count - if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} - } - # At this point the token may have been reset - if {([string length $error] != 0)} { - Finish $token $error - } elseif {[catch {::eof $s} iseof] || $iseof} { - Eof $token - } else { - CopyStart $s $token - } -} - proc http::Eof {token} { - variable $token - upvar 0 $token state - if {$state(state) == "header"} { - # Premature eof - set state(status) eof - } else { - set state(status) ok - } - set state(state) eof - Finish $token -} - -# http::wait -- -# -# See documentaion for details. -# -# Arguments: -# token Connection token. -# Results: -# The status after the wait. - -proc http::wait {token} { - variable $token - upvar 0 $token state - - if {![info exists state(status)] || [string length $state(status)] == 0} { - vwait $token\(status) - } - if {[info exists state(error)]} { - set errorlist $state(error) - unset state(error) - eval error $errorlist - } - return $state(status) -} - -# http::formatQuery -- -# -# See documentaion for details. -# Call http::formatQuery with an even number of arguments, where -# the first is a name, the second is a value, the third is another -# name, and so on. -# -# Arguments: -# args A list of name-value pairs. -# Results: -# TODO - -proc http::formatQuery {args} { - set result "" - set sep "" - foreach i $args { - append result $sep [mapReply $i] - if {$sep != "="} { - set sep = - } else { - set sep & - } - } - return $result -} - -# do x-www-urlencoded character mapping -# The spec says: "non-alphanumeric characters are replaced by '%HH'" -# 1 leave alphanumerics characters alone -# 2 Convert every other character to an array lookup -# 3 Escape constructs that are "special" to the tcl parser -# 4 "subst" the result, doing all the array substitutions - - proc http::mapReply {string} { - variable formMap - set alphanumeric a-zA-Z0-9 - regsub -all \[^$alphanumeric\] $string {$formMap(&)} string - regsub -all \n $string {\\n} string - regsub -all \t $string {\\t} string - regsub -all {[][{})\\]\)} $string {\\&} string - return [subst $string] -} - -# Default proxy filter. - proc http::ProxyRequired {host} { - variable http - if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} { - if {![info exists http(-proxyport)] || ![string length $http(-proxyport)]} { - set http(-proxyport) 8080 - } - return [list $http(-proxyhost) $http(-proxyport)] - } else { - return {} - } -} diff --git a/library/http2.3/pkgIndex.tcl b/library/http2.3/pkgIndex.tcl deleted file mode 100644 index 01052f3..0000000 --- a/library/http2.3/pkgIndex.tcl +++ /dev/null @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.0 -# 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 http 2.0 [list tclPkgSetup $dir http 2.0 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait}}}] diff --git a/library/init.tcl b/library/init.tcl deleted file mode 100644 index acd403d..0000000 --- a/library/init.tcl +++ /dev/null @@ -1,562 +0,0 @@ -# init.tcl -- -# -# Default system startup file for Tcl-based applications. Defines -# "unknown" procedure and auto-load facilities. -# -# RCS: @(#) $Id: init.tcl,v 1.29 1999/04/16 00:46:56 stanton Exp $ -# -# Copyright (c) 1991-1993 The Regents of the University of California. -# Copyright (c) 1994-1996 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. -# - -if {[info commands package] == ""} { - error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" -} -package require -exact Tcl 8.1 - -# Compute the auto path to use in this interpreter. -# The values on the path come from several locations: -# -# The environment variable TCLLIBPATH -# -# tcl_library, which is the directory containing this init.tcl script. -# tclInitScript.h searches around for the directory containing this -# init.tcl and defines tcl_library to that location before sourcing it. -# -# The parent directory of tcl_library. Adding the parent -# means that packages in peer directories will be found automatically. -# -# tcl_pkgPath, which is set by the platform-specific initialization routines -# On UNIX it is compiled in -# On Windows it comes from the registry -# On Macintosh it is "Tool Command Language" in the Extensions folder - -if {![info exists auto_path]} { - if {[info exist env(TCLLIBPATH)]} { - set auto_path $env(TCLLIBPATH) - } else { - set auto_path "" - } -} -if {[string compare [info library] {}]} { - foreach __dir [list [info library] [file dirname [info library]]] { - if {[lsearch -exact $auto_path $__dir] < 0} { - lappend auto_path $__dir - } - } -} -if {[info exist tcl_pkgPath]} { - foreach __dir $tcl_pkgPath { - if {[lsearch -exact $auto_path $__dir] < 0} { - lappend auto_path $__dir - } - } -} -if {[info exists __dir]} { - unset __dir -} - -# Windows specific end of initialization - -if {(![interp issafe]) && ($tcl_platform(platform) == "windows")} { - namespace eval tcl { - proc envTraceProc {lo n1 n2 op} { - set x $::env($n2) - set ::env($lo) $x - set ::env([string toupper $lo]) $x - } - } - foreach p [array names env] { - set u [string toupper $p] - if {$u != $p} { - switch -- $u { - COMSPEC - - PATH { - if {![info exists env($u)]} { - set env($u) $env($p) - } - trace variable env($p) w [list tcl::envTraceProc $p] - trace variable env($u) w [list tcl::envTraceProc $p] - } - } - } - } - if {[info exists p]} { - unset p - } - if {[info exists u]} { - unset u - } - if {![info exists env(COMSPEC)]} { - if {$tcl_platform(os) == {Windows NT}} { - set env(COMSPEC) cmd.exe - } else { - set env(COMSPEC) command.com - } - } -} - -# Setup the unknown package handler - -package unknown tclPkgUnknown - -# Conditionalize for presence of exec. - -if {[info commands exec] == ""} { - - # Some machines, such as the Macintosh, do not have exec. Also, on all - # platforms, safe interpreters do not have exec. - - set auto_noexec 1 -} -set errorCode "" -set errorInfo "" - -# Define a log command (which can be overwitten to log errors -# differently, specially when stderr is not available) - -if {[info commands tclLog] == ""} { - proc tclLog {string} { - catch {puts stderr $string} - } -} - -# unknown -- -# This procedure is called when a Tcl command is invoked that doesn't -# exist in the interpreter. It takes the following steps to make the -# command available: -# -# 1. See if the command has the form "namespace inscope ns cmd" and -# if so, concatenate its arguments onto the end and evaluate it. -# 2. See if the autoload facility can locate the command in a -# Tcl script file. If so, load it and execute it. -# 3. If the command was invoked interactively at top-level: -# (a) see if the command exists as an executable UNIX program. -# If so, "exec" the command. -# (b) see if the command requests csh-like history substitution -# in one of the common forms !!, !, or ^old^new. If -# so, emulate csh's history substitution. -# (c) see if the command is a unique abbreviation for another -# command. If so, invoke the command. -# -# Arguments: -# args - A list whose elements are the words of the original -# command, including the command name. - -proc unknown args { - global auto_noexec auto_noload env unknown_pending tcl_interactive - global errorCode errorInfo - - # If the command word has the form "namespace inscope ns cmd" - # then concatenate its arguments onto the end and evaluate it. - - set cmd [lindex $args 0] - if {[regexp "^namespace\[ \t\n\]+inscope" $cmd] && [llength $cmd] == 4} { - set arglist [lrange $args 1 end] - set ret [catch {uplevel $cmd $arglist} result] - if {$ret == 0} { - return $result - } else { - return -code $ret -errorcode $errorCode $result - } - } - - # Save the values of errorCode and errorInfo variables, since they - # may get modified if caught errors occur below. The variables will - # be restored just before re-executing the missing command. - - set savedErrorCode $errorCode - set savedErrorInfo $errorInfo - set name [lindex $args 0] - if {![info exists auto_noload]} { - # - # Make sure we're not trying to load the same proc twice. - # - if {[info exists unknown_pending($name)]} { - return -code error "self-referential recursion in \"unknown\" for command \"$name\""; - } - set unknown_pending($name) pending; - set ret [catch {auto_load $name [uplevel 1 {namespace current}]} msg] - unset unknown_pending($name); - if {$ret != 0} { - return -code $ret -errorcode $errorCode \ - "error while autoloading \"$name\": $msg" - } - if {![array size unknown_pending]} { - unset unknown_pending - } - if {$msg} { - set errorCode $savedErrorCode - set errorInfo $savedErrorInfo - set code [catch {uplevel 1 $args} msg] - if {$code == 1} { - # - # Strip the last five lines off the error stack (they're - # from the "uplevel" command). - # - - set new [split $errorInfo \n] - set new [join [lrange $new 0 [expr {[llength $new] - 6}]] \n] - return -code error -errorcode $errorCode \ - -errorinfo $new $msg - } else { - return -code $code $msg - } - } - } - - if {([info level] == 1) && ([info script] == "") \ - && [info exists tcl_interactive] && $tcl_interactive} { - if {![info exists auto_noexec]} { - set new [auto_execok $name] - if {$new != ""} { - set errorCode $savedErrorCode - set errorInfo $savedErrorInfo - set redir "" - if {[info commands console] == ""} { - set redir ">&@stdout <@stdin" - } - return [uplevel exec $redir $new [lrange $args 1 end]] - } - } - set errorCode $savedErrorCode - set errorInfo $savedErrorInfo - if {$name == "!!"} { - set newcmd [history event] - } elseif {[regexp {^!(.+)$} $name dummy event]} { - set newcmd [history event $event] - } elseif {[regexp {^\^([^^]*)\^([^^]*)\^?$} $name dummy old new]} { - set newcmd [history event -1] - catch {regsub -all -- $old $newcmd $new newcmd} - } - if {[info exists newcmd]} { - tclLog $newcmd - history change $newcmd 0 - return [uplevel $newcmd] - } - - set ret [catch {set cmds [info commands $name*]} msg] - if {[string compare $name "::"] == 0} { - set name "" - } - if {$ret != 0} { - return -code $ret -errorcode $errorCode \ - "error in unknown while checking if \"$name\" is a unique command abbreviation: $msg" - } - if {[llength $cmds] == 1} { - return [uplevel [lreplace $args 0 0 $cmds]] - } - if {[llength $cmds] != 0} { - if {$name == ""} { - return -code error "empty command name \"\"" - } else { - return -code error \ - "ambiguous command name \"$name\": [lsort $cmds]" - } - } - } - return -code error "invalid command name \"$name\"" -} - -# auto_load -- -# Checks a collection of library directories to see if a procedure -# is defined in one of them. If so, it sources the appropriate -# library file to create the procedure. Returns 1 if it successfully -# loaded the procedure, 0 otherwise. -# -# Arguments: -# cmd - Name of the command to find and load. -# namespace (optional) The namespace where the command is being used - must be -# a canonical namespace as returned [namespace current] -# for instance. If not given, namespace current is used. - -proc auto_load {cmd {namespace {}}} { - global auto_index auto_oldpath auto_path - - if {[string length $namespace] == 0} { - set namespace [uplevel {namespace current}] - } - set nameList [auto_qualify $cmd $namespace] - # workaround non canonical auto_index entries that might be around - # from older auto_mkindex versions - lappend nameList $cmd - foreach name $nameList { - if {[info exists auto_index($name)]} { - uplevel #0 $auto_index($name) - return [expr {[info commands $name] != ""}] - } - } - if {![info exists auto_path]} { - return 0 - } - - if {![auto_load_index]} { - return 0 - } - - foreach name $nameList { - if {[info exists auto_index($name)]} { - uplevel #0 $auto_index($name) - if {[info commands $name] != ""} { - return 1 - } - } - } - return 0 -} - -# auto_load_index -- -# Loads the contents of tclIndex files on the auto_path directory -# list. This is usually invoked within auto_load to load the index -# of available commands. Returns 1 if the index is loaded, and 0 if -# the index is already loaded and up to date. -# -# Arguments: -# None. - -proc auto_load_index {} { - global auto_index auto_oldpath auto_path errorInfo errorCode - - if {[info exists auto_oldpath]} { - if {$auto_oldpath == $auto_path} { - return 0 - } - } - set auto_oldpath $auto_path - - # Check if we are a safe interpreter. In that case, we support only - # newer format tclIndex files. - - set issafe [interp issafe] - for {set i [expr {[llength $auto_path] - 1}]} {$i >= 0} {incr i -1} { - set dir [lindex $auto_path $i] - set f "" - if {$issafe} { - catch {source [file join $dir tclIndex]} - } elseif {[catch {set f [open [file join $dir tclIndex]]}]} { - continue - } else { - set error [catch { - set id [gets $f] - if {$id == "# Tcl autoload index file, version 2.0"} { - eval [read $f] - } elseif {$id == \ - "# Tcl autoload index file: each line identifies a Tcl"} { - while {[gets $f line] >= 0} { - if {([string index $line 0] == "#") - || ([llength $line] != 2)} { - continue - } - set name [lindex $line 0] - set auto_index($name) \ - "source [file join $dir [lindex $line 1]]" - } - } else { - error \ - "[file join $dir tclIndex] isn't a proper Tcl index file" - } - } msg] - if {$f != ""} { - close $f - } - if {$error} { - error $msg $errorInfo $errorCode - } - } - } - return 1 -} - -# auto_qualify -- -# -# Compute a fully qualified names list for use in the auto_index array. -# For historical reasons, commands in the global namespace do not have leading -# :: in the index key. The list has two elements when the command name is -# relative (no leading ::) and the namespace is not the global one. Otherwise -# only one name is returned (and searched in the auto_index). -# -# Arguments - -# cmd The command name. Can be any name accepted for command -# invocations (Like "foo::::bar"). -# namespace The namespace where the command is being used - must be -# a canonical namespace as returned by [namespace current] -# for instance. - -proc auto_qualify {cmd namespace} { - - # count separators and clean them up - # (making sure that foo:::::bar will be treated as foo::bar) - set n [regsub -all {::+} $cmd :: cmd] - - # Ignore namespace if the name starts with :: - # Handle special case of only leading :: - - # Before each return case we give an example of which category it is - # with the following form : - # ( inputCmd, inputNameSpace) -> output - - if {[regexp {^::(.*)$} $cmd x tail]} { - if {$n > 1} { - # ( ::foo::bar , * ) -> ::foo::bar - return [list $cmd] - } else { - # ( ::global , * ) -> global - return [list $tail] - } - } - - # Potentially returning 2 elements to try : - # (if the current namespace is not the global one) - - if {$n == 0} { - if {[string compare $namespace ::] == 0} { - # ( nocolons , :: ) -> nocolons - return [list $cmd] - } else { - # ( nocolons , ::sub ) -> ::sub::nocolons nocolons - return [list ${namespace}::$cmd $cmd] - } - } else { - if {[string compare $namespace ::] == 0} { - # ( foo::bar , :: ) -> ::foo::bar - return [list ::$cmd] - } else { - # ( foo::bar , ::sub ) -> ::sub::foo::bar ::foo::bar - return [list ${namespace}::$cmd ::$cmd] - } - } -} - -# auto_import -- -# -# Invoked during "namespace import" to make see if the imported commands -# reside in an autoloaded library. If so, the commands are loaded so -# that they will be available for the import links. If not, then this -# procedure does nothing. -# -# Arguments - -# pattern The pattern of commands being imported (like "foo::*") -# a canonical namespace as returned by [namespace current] - -proc auto_import {pattern} { - global auto_index - - set ns [uplevel namespace current] - set patternList [auto_qualify $pattern $ns] - - auto_load_index - - foreach pattern $patternList { - foreach name [array names auto_index] { - if {[string match $pattern $name] && "" == [info commands $name]} { - uplevel #0 $auto_index($name) - } - } - } -} - -# auto_execok -- -# -# Returns string that indicates name of program to execute if -# name corresponds to a shell builtin or an executable in the -# Windows search path, or "" otherwise. Builds an associative -# array auto_execs that caches information about previous checks, -# for speed. -# -# Arguments: -# name - Name of a command. - -if {[string compare $tcl_platform(platform) windows] == 0} { -# Windows version. -# -# Note that info executable doesn't work under Windows, so we have to -# look for files with .exe, .com, or .bat extensions. Also, the path -# may be in the Path or PATH environment variables, and path -# components are separated with semicolons, not colons as under Unix. -# -proc auto_execok name { - global auto_execs env tcl_platform - - if {[info exists auto_execs($name)]} { - return $auto_execs($name) - } - set auto_execs($name) "" - - if {[lsearch -exact {cls copy date del erase dir echo mkdir md rename - ren rmdir rd time type ver vol} $name] != -1} { - return [set auto_execs($name) [list $env(COMSPEC) /c $name]] - } - - if {[llength [file split $name]] != 1} { - foreach ext {{} .com .exe .bat} { - set file ${name}${ext} - if {[file exists $file] && ![file isdirectory $file]} { - return [set auto_execs($name) [list $file]] - } - } - return "" - } - - set path "[file dirname [info nameof]];.;" - if {[info exists env(WINDIR)]} { - set windir $env(WINDIR) - } - if {[info exists windir]} { - if {$tcl_platform(os) == "Windows NT"} { - append path "$windir/system32;" - } - append path "$windir/system;$windir;" - } - - if {[info exists env(PATH)]} { - append path $env(PATH) - } - - foreach dir [split $path {;}] { - if {$dir == ""} { - set dir . - } - foreach ext {{} .com .exe .bat} { - set file [file join $dir ${name}${ext}] - if {[file exists $file] && ![file isdirectory $file]} { - return [set auto_execs($name) [list $file]] - } - } - } - return "" -} - -} else { -# Unix version. -# -proc auto_execok name { - global auto_execs env - - if {[info exists auto_execs($name)]} { - return $auto_execs($name) - } - set auto_execs($name) "" - if {[llength [file split $name]] != 1} { - if {[file executable $name] && ![file isdirectory $name]} { - set auto_execs($name) [list $name] - } - return $auto_execs($name) - } - foreach dir [split $env(PATH) :] { - if {$dir == ""} { - set dir . - } - set file [file join $dir $name] - if {[file executable $file] && ![file isdirectory $file]} { - set auto_execs($name) [list $file] - return $auto_execs($name) - } - } - return "" -} - -} diff --git a/library/ldAout.tcl b/library/ldAout.tcl deleted file mode 100644 index ad12624..0000000 --- a/library/ldAout.tcl +++ /dev/null @@ -1,240 +0,0 @@ -# ldAout.tcl -- -# -# This "tclldAout" procedure in this script acts as a replacement -# for the "ld" command when linking an object file that will be -# loaded dynamically into Tcl or Tk using pseudo-static linking. -# -# Parameters: -# The arguments to the script are the command line options for -# an "ld" command. -# -# Results: -# The "ld" command is parsed, and the "-o" option determines the -# module name. ".a" and ".o" options are accumulated. -# The input archives and object files are examined with the "nm" -# command to determine whether the modules initialization -# entry and safe initialization entry are present. A trivial -# C function that locates the entries is composed, compiled, and -# its .o file placed before all others in the command; then -# "ld" is executed to bind the objects together. -# -# RCS: @(#) $Id: ldAout.tcl,v 1.3 1998/11/11 02:39:31 welch Exp $ -# -# Copyright (c) 1995, by General Electric Company. All rights reserved. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# This work was supported in part by the ARPA Manufacturing Automation -# and Design Engineering (MADE) Initiative through ARPA contract -# F33615-94-C-4400. - -proc tclLdAout {{cc {}} {shlib_suffix {}} {shlib_cflags none}} { - global env - global argv - - if {$cc==""} { - set cc $env(CC) - } - - # if only two parameters are supplied there is assumed that the - # only shlib_suffix is missing. This parameter is anyway available - # as "info sharedlibextension" too, so there is no need to transfer - # 3 parameters to the function tclLdAout. For compatibility, this - # function now accepts both 2 and 3 parameters. - - if {$shlib_suffix==""} { - set shlib_cflags $env(SHLIB_CFLAGS) - } else { - if {$shlib_cflags=="none"} { - set shlib_cflags $shlib_suffix - } - } - - # seenDotO is nonzero if a .o or .a file has been seen - - set seenDotO 0 - - # minusO is nonzero if the last command line argument was "-o". - - set minusO 0 - - # head has command line arguments up to but not including the first - # .o or .a file. tail has the rest of the arguments. - - set head {} - set tail {} - - # nmCommand is the "nm" command that lists global symbols from the - # object files. - - set nmCommand {|nm -g} - - # entryProtos is the table of _Init and _SafeInit prototypes found in the - # module. - - set entryProtos {} - - # entryPoints is the table of _Init and _SafeInit entries found in the - # module. - - set entryPoints {} - - # libraries is the list of -L and -l flags to the linker. - - set libraries {} - set libdirs {} - - # Process command line arguments - - foreach a $argv { - if {!$minusO && [regexp {\.[ao]$} $a]} { - set seenDotO 1 - lappend nmCommand $a - } - if {$minusO} { - set outputFile $a - set minusO 0 - } elseif {![string compare $a -o]} { - set minusO 1 - } - if {[regexp {^-[lL]} $a]} { - lappend libraries $a - if {[regexp {^-L} $a]} { - lappend libdirs [string range $a 2 end] - } - } elseif {$seenDotO} { - lappend tail $a - } else { - lappend head $a - } - } - lappend libdirs /lib /usr/lib - - # MIPS -- If there are corresponding G0 libraries, replace the - # ordinary ones with the G0 ones. - - set libs {} - foreach lib $libraries { - if {[regexp {^-l} $lib]} { - set lname [string range $lib 2 end] - foreach dir $libdirs { - if {[file exists [file join $dir lib${lname}_G0.a]]} { - set lname ${lname}_G0 - break - } - } - lappend libs -l$lname - } else { - lappend libs $lib - } - } - set libraries $libs - - # Extract the module name from the "-o" option - - if {![info exists outputFile]} { - error "-o option must be supplied to link a Tcl load module" - } - set m [file tail $outputFile] - if {[regexp {\.a$} $outputFile]} { - set shlib_suffix .a - } else { - set shlib_suffix "" - } - if {[regexp {\..*$} $outputFile match]} { - set l [expr {[string length $m] - [string length $match]}] - } else { - error "Output file does not appear to have a suffix" - } - set modName [string tolower [string range $m 0 [expr {$l-1}]]] - if {[regexp {^lib} $modName]} { - set modName [string range $modName 3 end] - } - if {[regexp {[0-9\.]*(_g0)?$} $modName match]} { - set modName [string range $modName 0 [expr {[string length $modName]-[string length $match]-1}]] - } - set modName "[string toupper [string index $modName 0]][string range $modName 1 end]" - - # Catalog initialization entry points found in the module - - set f [open $nmCommand r] - while {[gets $f l] >= 0} { - if {[regexp {T[ ]*_?([A-Z][a-z0-9_]*_(Safe)?Init(__FP10Tcl_Interp)?)$} $l trash symbol]} { - if {![regexp {_?([A-Z][a-z0-9_]*_(Safe)?Init)} $symbol trash s]} { - set s $symbol - } - append entryProtos {extern int } $symbol { (); } \n - append entryPoints { } \{ { "} $s {", } $symbol { } \} , \n - } - } - close $f - - if {$entryPoints==""} { - error "No entry point found in objects" - } - - # Compose a C function that resolves the initialization entry points and - # embeds the required libraries in the object code. - - set C {#include } - append C \n - append C {char TclLoadLibraries_} $modName { [] =} \n - append C { "@LIBS: } $libraries {";} \n - append C $entryProtos - append C {static struct } \{ \n - append C { char * name;} \n - append C { int (*value)();} \n - append C \} {dictionary [] = } \{ \n - append C $entryPoints - append C { 0, 0 } \n \} \; \n - append C {typedef struct Tcl_Interp Tcl_Interp;} \n - append C {typedef int Tcl_PackageInitProc (Tcl_Interp *);} \n - append C {Tcl_PackageInitProc *} \n - append C TclLoadDictionary_ $modName { (symbol)} \n - append C { char * symbol;} \n - append C {{ - int i; - for (i = 0; dictionary [i] . name != 0; ++i) { - if (!strcmp (symbol, dictionary [i] . name)) { - return dictionary [i].value; - } - } - return 0; -}} \n - - # Write the C module and compile it - - set cFile tcl$modName.c - set f [open $cFile w] - puts -nonewline $f $C - close $f - set ccCommand "$cc -c $shlib_cflags $cFile" - puts stderr $ccCommand - eval exec $ccCommand - - # Now compose and execute the ld command that packages the module - - if {$shlib_suffix == ".a"} { - set ldCommand "ar cr $outputFile" - regsub { -o} $tail {} tail - } else { - set ldCommand ld - foreach item $head { - lappend ldCommand $item - } - } - lappend ldCommand tcl$modName.o - foreach item $tail { - lappend ldCommand $item - } - puts stderr $ldCommand - eval exec $ldCommand - if {$shlib_suffix == ".a"} { - exec ranlib $outputFile - } - - # Clean up working files - - exec /bin/rm $cFile [file rootname $cFile].o -} diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl deleted file mode 100644 index 37676da..0000000 --- a/library/msgcat/msgcat.tcl +++ /dev/null @@ -1,177 +0,0 @@ -# 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 (c) 1998 by Scriptics Corporation. -# Copyright (c) 1998 by Mark Harrison. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: msgcat.tcl,v 1.2 1999/04/16 00:47:17 stanton Exp $ - -package provide msgcat 1.0 - -namespace eval msgcat { - namespace export mc mcset mclocale mcpreferences mcunknown - - # Records the current locale as passed to mclocale - variable locale "" - - # Records the list of locales to search - variable loclist {} - - # Records the mapping between source strings and translated strings. The - # array key is of the form ",," and the value is - # the translated string. - array set msgs {} -} - -# msgcat::mc -- -# -# Find the translation for the given string based on the current -# locale setting. -# -# Arguments: -# src The string to translate. -# -# Results: -# Returns the translatd string. - -proc msgcat::mc {src} { - set ns [uplevel {namespace current}] - foreach loc $::msgcat::loclist { - if {[info exists ::msgcat::msgs($loc,$ns,$src)]} { - return $::msgcat::msgs($loc,$ns,$src) - } - } - # we have not found the translation - return [uplevel 1 [list [namespace origin mcunknown] \ - $::msgcat::locale $src]] -} - -# msgcat::mclocale -- -# -# Query or set the current locale. -# -# Arguments: -# newLocale (Optional) The new locale string. Locale strings -# should be composed of one or more sublocale parts -# separated by underscores (e.g. en_US). -# -# Results: -# Returns the current locale. - -proc msgcat::mclocale {args} { - set len [llength $args] - - if {$len > 1} { - error {wrong # args: should be "mclocale ?newLocale?"} - } - - set args [string tolower $args] - if {$len == 1} { - set ::msgcat::locale $args - set ::msgcat::loclist {} - set word "" - foreach part [split $args _] { - set word [string trimleft "${word}_${part}" _] - set ::msgcat::loclist \ - [linsert $::msgcat::loclist 0 $word] - } - } - return $::msgcat::locale -} - -# msgcat::mcpreferences -- -# -# Fetch the list of locales used to look up strings, ordered from -# most preferred to least preferred. -# -# Arguments: -# None. -# -# Results: -# Returns an ordered list of the locales preferred by the user. - -proc msgcat::mcpreferences {} { - return $::msgcat::loclist -} - -# msgcat::mcload -- -# -# Attempt to load message catalogs for each locale in the -# preference list from the specified directory. -# -# Arguments: -# langdir The directory to search. -# -# Results: -# Returns the number of message catalogs that were loaded. - -proc msgcat::mcload {langdir} { - set x 0 - foreach p [::msgcat::mcpreferences] { - set langfile [file join $langdir $p.msg] - if {[file exists $langfile]} { - incr x - uplevel [list source $langfile] - } - } - return $x -} - -# msgcat::mcset -- -# -# Set the translation for a given string in a specified locale. -# -# Arguments: -# locale The locale to use. -# src The source string. -# dest (Optional) The translated string. If omitted, -# the source string is used. -# -# Results: -# Returns the new locale. - -proc msgcat::mcset {locale src {dest ""}} { - if {$dest == ""} { - set dest $src - } - - set ns [uplevel {namespace current}] - - set ::msgcat::msgs([string tolower $locale],$ns,$src) $dest - return $dest -} - -# msgcat::mcunknown -- -# -# This routine is called by msgcat::mc if a translation cannot -# be found for a string. This routine is intended to be replaced -# by an application specific routine for error reporting -# purposes. The default behavior is to return the source string. -# -# Arguments: -# locale The current locale. -# src The string to be translated. -# -# Results: -# Returns the translated value. - -proc msgcat::mcunknown {locale src} { - return $src -} - -# Initialize the default locale - -namespace eval msgcat { - # set default locale, try to get from environment - if {[info exists ::env(LANG)]} { - mclocale $::env(LANG) - } else { - mclocale "C" - } -} diff --git a/library/msgcat/pkgIndex.tcl b/library/msgcat/pkgIndex.tcl deleted file mode 100644 index b40a4f3..0000000 --- a/library/msgcat/pkgIndex.tcl +++ /dev/null @@ -1 +0,0 @@ -package ifneeded msgcat 1.0 [list source [file join $dir msgcat.tcl]] diff --git a/library/msgcat1.0/msgcat.tcl b/library/msgcat1.0/msgcat.tcl deleted file mode 100644 index 37676da..0000000 --- a/library/msgcat1.0/msgcat.tcl +++ /dev/null @@ -1,177 +0,0 @@ -# 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 (c) 1998 by Scriptics Corporation. -# Copyright (c) 1998 by Mark Harrison. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: msgcat.tcl,v 1.2 1999/04/16 00:47:17 stanton Exp $ - -package provide msgcat 1.0 - -namespace eval msgcat { - namespace export mc mcset mclocale mcpreferences mcunknown - - # Records the current locale as passed to mclocale - variable locale "" - - # Records the list of locales to search - variable loclist {} - - # Records the mapping between source strings and translated strings. The - # array key is of the form ",," and the value is - # the translated string. - array set msgs {} -} - -# msgcat::mc -- -# -# Find the translation for the given string based on the current -# locale setting. -# -# Arguments: -# src The string to translate. -# -# Results: -# Returns the translatd string. - -proc msgcat::mc {src} { - set ns [uplevel {namespace current}] - foreach loc $::msgcat::loclist { - if {[info exists ::msgcat::msgs($loc,$ns,$src)]} { - return $::msgcat::msgs($loc,$ns,$src) - } - } - # we have not found the translation - return [uplevel 1 [list [namespace origin mcunknown] \ - $::msgcat::locale $src]] -} - -# msgcat::mclocale -- -# -# Query or set the current locale. -# -# Arguments: -# newLocale (Optional) The new locale string. Locale strings -# should be composed of one or more sublocale parts -# separated by underscores (e.g. en_US). -# -# Results: -# Returns the current locale. - -proc msgcat::mclocale {args} { - set len [llength $args] - - if {$len > 1} { - error {wrong # args: should be "mclocale ?newLocale?"} - } - - set args [string tolower $args] - if {$len == 1} { - set ::msgcat::locale $args - set ::msgcat::loclist {} - set word "" - foreach part [split $args _] { - set word [string trimleft "${word}_${part}" _] - set ::msgcat::loclist \ - [linsert $::msgcat::loclist 0 $word] - } - } - return $::msgcat::locale -} - -# msgcat::mcpreferences -- -# -# Fetch the list of locales used to look up strings, ordered from -# most preferred to least preferred. -# -# Arguments: -# None. -# -# Results: -# Returns an ordered list of the locales preferred by the user. - -proc msgcat::mcpreferences {} { - return $::msgcat::loclist -} - -# msgcat::mcload -- -# -# Attempt to load message catalogs for each locale in the -# preference list from the specified directory. -# -# Arguments: -# langdir The directory to search. -# -# Results: -# Returns the number of message catalogs that were loaded. - -proc msgcat::mcload {langdir} { - set x 0 - foreach p [::msgcat::mcpreferences] { - set langfile [file join $langdir $p.msg] - if {[file exists $langfile]} { - incr x - uplevel [list source $langfile] - } - } - return $x -} - -# msgcat::mcset -- -# -# Set the translation for a given string in a specified locale. -# -# Arguments: -# locale The locale to use. -# src The source string. -# dest (Optional) The translated string. If omitted, -# the source string is used. -# -# Results: -# Returns the new locale. - -proc msgcat::mcset {locale src {dest ""}} { - if {$dest == ""} { - set dest $src - } - - set ns [uplevel {namespace current}] - - set ::msgcat::msgs([string tolower $locale],$ns,$src) $dest - return $dest -} - -# msgcat::mcunknown -- -# -# This routine is called by msgcat::mc if a translation cannot -# be found for a string. This routine is intended to be replaced -# by an application specific routine for error reporting -# purposes. The default behavior is to return the source string. -# -# Arguments: -# locale The current locale. -# src The string to be translated. -# -# Results: -# Returns the translated value. - -proc msgcat::mcunknown {locale src} { - return $src -} - -# Initialize the default locale - -namespace eval msgcat { - # set default locale, try to get from environment - if {[info exists ::env(LANG)]} { - mclocale $::env(LANG) - } else { - mclocale "C" - } -} diff --git a/library/msgcat1.0/pkgIndex.tcl b/library/msgcat1.0/pkgIndex.tcl deleted file mode 100644 index b40a4f3..0000000 --- a/library/msgcat1.0/pkgIndex.tcl +++ /dev/null @@ -1 +0,0 @@ -package ifneeded msgcat 1.0 [list source [file join $dir msgcat.tcl]] diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl deleted file mode 100644 index 289a39a..0000000 --- a/library/opt/optparse.tcl +++ /dev/null @@ -1,1097 +0,0 @@ -# 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. -# -# RCS: @(#) $Id: optparse.tcl,v 1.2 1999/04/16 00:47:18 stanton Exp $ - -package provide opt 0.4.1 - -namespace eval ::tcl { - - # Exported APIs - namespace export OptKeyRegister OptKeyDelete OptKeyError OptKeyParse \ - OptProc OptProcArgGiven OptParse \ - Lempty Lget \ - Lassign Lvarpop Lvarpop1 Lvarset Lvarincr Lfirst Lrest \ - 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 slaves"} - {-nestedloading2 -boolean true "OK to load into nested slaves"} - {-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 ! ############### -# You should really not look any further : -# The following is private unexported undocumented unblessed... code -# time to hit "q" ;-) ! - -# Hmmm... ok, you really want to know ? - -# You've been warned... Here it is... - - # 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 [Lfirst $program] >= 2 -# while -# llength [Lfirst $singleStep] == 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 struture -# is complex and there is maybe some places where the -# string rep might be calculated at great exense. 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 {[string compare $key ""] == 0} { - # 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 == "args"} { - # more items after 'args'... - return -code error "'args' special argument must be the last one"; - } - set res [OptNormalizeOne $item]; - set state [Lfirst $res]; - if {$inflags} { - if {$state == "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 == "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 ppl 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 [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 namespace current]; - if { ([string match $name "::*"]) - || ([string compare $namespace "::"]==0)} { - # 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 [list proc $name args "set Args \[::tcl::OptKeyParse $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 Args alist; - expr {[lsearch $alist $argname] >=0} -} - - ####### - # Programs/Descriptions manipulation - - # Return the instruction word/list of a given step/(sub)program - proc OptInstr {lst} { - Lfirst $lst; - } - # 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 {[Lfirst $item]=="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 $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 [Lfirst $lst] 1 end] { - lappend res [Lget $lst $idx]; - } - return $res; - } - - # Advance to next description - proc OptNextDesc {descName} { - uplevel [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 $descriptionsName descriptions - # get the current item full adress - set adress [OptCurAddr $descriptions]; - # use the 3th 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} { - Lfirst $item - } - - # current state - proc OptCurState {descriptions} { - OptState [OptCurDesc $descriptions]; - } - - ####### - # Arguments manipulation - - # Returns the argument that has to be processed now - proc OptCurrentArg {lst} { - Lfirst $lst; - } - # Advance to next argument - proc OptNextArg {argsName} { - uplevel [list Lvarpop1 $argsName]; - } - ####### - - - - - - # Loop over all descriptions, calling OptDoOne which will - # eventually eat all the arguments. - proc OptDoAll {descriptionsName argumentsName} { - upvar $descriptionsName descriptions - upvar $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 $argumentsName arguments; - upvar $descriptionsName descriptions; - upvar $stateName state; - - # the special state/instruction "args" eats all - # the remaining args (if any) - if {($state == "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 == "flags"} { - # no argument and no flags : we're done -# puts "returning to previous (sub)prg (no more args)"; - return -code return; - } elseif {$state == "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 {[string compare "--" $arg] == 0} { - # 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 == "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 {[string compare "-help" [string tolower $arglist]] == 0} { - 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 usefull, 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 {![regexp {^(-+)?[0-9]+$} $arg]} { - error "not an integer" - } - return $arg; - } - float { - return [expr {double($arg)}] - } - script - - list { - # if llength fail : malformed list - if {[llength $arg]==0} { - if {[OptIsFlag $arg]} { - error "no values with leading -" - } - } - return $arg; - } - boolean { - if {![regexp -nocase {^(true|false|0|1)$} $arg]} { - error "non canonic boolean" - } - # convert true/false because expr/if is broken with "!,... - if {$arg} { - return 1 - } else { - return 0 - } - } - choice { - if {[lsearch -exact $typeArgs $arg] < 0} { - 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 $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 {[string compare $larg $lflag]==0} { - # Exact match case - OptSetPrgCounter desc $i; - return 1; - } - } else { - if {[string compare $larg [string range $lflag 0 $last]]==0} { - 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} { - string compare [OptType $item] 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 {[string compare $varname "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 {[string compare $type "string"] == 0} { - 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 == "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 lasy type determination - proc OptGuessType {arg} { - if {[regexp -nocase {^(true|false)$} $arg]} { - return boolean - } - if {[regexp {^(-+)?[0-9]+$} $arg]} { - return int - } - if {![catch {expr {double($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 $nlName nl; - upvar $tlName tl; - upvar $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] != "header"} { - set dv "($dv)"; - } - set l [string length $dv]; - # limit the space allocated to potentially big "choices" - if {([OptType $item] != "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] != "header"} { - set dv "($dv)"; - } - append res [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 [Lfirst $indexLst]] [Lrest $indexLst]; -} -# 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 $listName list; - if {[llength $indexLst] <= 1} { - Lvarset1nc list $indexLst $newValue; - } else { - set idx [Lfirst $indexLst]; - 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 [Lrest $indexLst] $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 $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 $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 $listName list; - if {[llength $indexLst] <= 1} { - Lvarincr1 list $indexLst $howMuch; - } else { - set idx [Lfirst $indexLst]; - set targetList [lindex $list $idx]; - # reduce refcount on targetList - Lvarset1nc list $idx {}; - # recursively replace in targetList - Lvarincr targetList [Lrest $indexLst] $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 $listName list; - set newValue [expr {[lindex $list $index]+$howMuch}]; - set list [lreplace $list $index $index $newValue]; - return $newValue; -} -# Returns the first element of a list -proc ::tcl::Lfirst {list} { - lindex $list 0 -} -# Returns the rest of the list minus first element -proc ::tcl::Lrest {list} { - lrange $list 1 end -} -# Removes the first element of a list -# and returns the new list value -proc ::tcl::Lvarpop1 {listName} { - upvar $listName list; - set list [lrange $list 1 end]; -} -# Same but returns the removed element -# (Like the tclX version) -proc ::tcl::Lvarpop {listName} { - upvar $listName list; - set el [Lfirst $list]; - 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 [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 {} -} diff --git a/library/opt/pkgIndex.tcl b/library/opt/pkgIndex.tcl deleted file mode 100644 index 260e572..0000000 --- a/library/opt/pkgIndex.tcl +++ /dev/null @@ -1,11 +0,0 @@ -# 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. - -package ifneeded opt 0.4.1 [list source [file join $dir optparse.tcl]] diff --git a/library/opt0.4/optparse.tcl b/library/opt0.4/optparse.tcl deleted file mode 100644 index 289a39a..0000000 --- a/library/opt0.4/optparse.tcl +++ /dev/null @@ -1,1097 +0,0 @@ -# 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. -# -# RCS: @(#) $Id: optparse.tcl,v 1.2 1999/04/16 00:47:18 stanton Exp $ - -package provide opt 0.4.1 - -namespace eval ::tcl { - - # Exported APIs - namespace export OptKeyRegister OptKeyDelete OptKeyError OptKeyParse \ - OptProc OptProcArgGiven OptParse \ - Lempty Lget \ - Lassign Lvarpop Lvarpop1 Lvarset Lvarincr Lfirst Lrest \ - 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 slaves"} - {-nestedloading2 -boolean true "OK to load into nested slaves"} - {-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 ! ############### -# You should really not look any further : -# The following is private unexported undocumented unblessed... code -# time to hit "q" ;-) ! - -# Hmmm... ok, you really want to know ? - -# You've been warned... Here it is... - - # 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 [Lfirst $program] >= 2 -# while -# llength [Lfirst $singleStep] == 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 struture -# is complex and there is maybe some places where the -# string rep might be calculated at great exense. 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 {[string compare $key ""] == 0} { - # 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 == "args"} { - # more items after 'args'... - return -code error "'args' special argument must be the last one"; - } - set res [OptNormalizeOne $item]; - set state [Lfirst $res]; - if {$inflags} { - if {$state == "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 == "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 ppl 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 [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 namespace current]; - if { ([string match $name "::*"]) - || ([string compare $namespace "::"]==0)} { - # 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 [list proc $name args "set Args \[::tcl::OptKeyParse $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 Args alist; - expr {[lsearch $alist $argname] >=0} -} - - ####### - # Programs/Descriptions manipulation - - # Return the instruction word/list of a given step/(sub)program - proc OptInstr {lst} { - Lfirst $lst; - } - # 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 {[Lfirst $item]=="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 $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 [Lfirst $lst] 1 end] { - lappend res [Lget $lst $idx]; - } - return $res; - } - - # Advance to next description - proc OptNextDesc {descName} { - uplevel [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 $descriptionsName descriptions - # get the current item full adress - set adress [OptCurAddr $descriptions]; - # use the 3th 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} { - Lfirst $item - } - - # current state - proc OptCurState {descriptions} { - OptState [OptCurDesc $descriptions]; - } - - ####### - # Arguments manipulation - - # Returns the argument that has to be processed now - proc OptCurrentArg {lst} { - Lfirst $lst; - } - # Advance to next argument - proc OptNextArg {argsName} { - uplevel [list Lvarpop1 $argsName]; - } - ####### - - - - - - # Loop over all descriptions, calling OptDoOne which will - # eventually eat all the arguments. - proc OptDoAll {descriptionsName argumentsName} { - upvar $descriptionsName descriptions - upvar $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 $argumentsName arguments; - upvar $descriptionsName descriptions; - upvar $stateName state; - - # the special state/instruction "args" eats all - # the remaining args (if any) - if {($state == "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 == "flags"} { - # no argument and no flags : we're done -# puts "returning to previous (sub)prg (no more args)"; - return -code return; - } elseif {$state == "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 {[string compare "--" $arg] == 0} { - # 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 == "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 {[string compare "-help" [string tolower $arglist]] == 0} { - 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 usefull, 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 {![regexp {^(-+)?[0-9]+$} $arg]} { - error "not an integer" - } - return $arg; - } - float { - return [expr {double($arg)}] - } - script - - list { - # if llength fail : malformed list - if {[llength $arg]==0} { - if {[OptIsFlag $arg]} { - error "no values with leading -" - } - } - return $arg; - } - boolean { - if {![regexp -nocase {^(true|false|0|1)$} $arg]} { - error "non canonic boolean" - } - # convert true/false because expr/if is broken with "!,... - if {$arg} { - return 1 - } else { - return 0 - } - } - choice { - if {[lsearch -exact $typeArgs $arg] < 0} { - 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 $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 {[string compare $larg $lflag]==0} { - # Exact match case - OptSetPrgCounter desc $i; - return 1; - } - } else { - if {[string compare $larg [string range $lflag 0 $last]]==0} { - 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} { - string compare [OptType $item] 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 {[string compare $varname "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 {[string compare $type "string"] == 0} { - 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 == "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 lasy type determination - proc OptGuessType {arg} { - if {[regexp -nocase {^(true|false)$} $arg]} { - return boolean - } - if {[regexp {^(-+)?[0-9]+$} $arg]} { - return int - } - if {![catch {expr {double($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 $nlName nl; - upvar $tlName tl; - upvar $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] != "header"} { - set dv "($dv)"; - } - set l [string length $dv]; - # limit the space allocated to potentially big "choices" - if {([OptType $item] != "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] != "header"} { - set dv "($dv)"; - } - append res [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 [Lfirst $indexLst]] [Lrest $indexLst]; -} -# 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 $listName list; - if {[llength $indexLst] <= 1} { - Lvarset1nc list $indexLst $newValue; - } else { - set idx [Lfirst $indexLst]; - 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 [Lrest $indexLst] $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 $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 $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 $listName list; - if {[llength $indexLst] <= 1} { - Lvarincr1 list $indexLst $howMuch; - } else { - set idx [Lfirst $indexLst]; - set targetList [lindex $list $idx]; - # reduce refcount on targetList - Lvarset1nc list $idx {}; - # recursively replace in targetList - Lvarincr targetList [Lrest $indexLst] $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 $listName list; - set newValue [expr {[lindex $list $index]+$howMuch}]; - set list [lreplace $list $index $index $newValue]; - return $newValue; -} -# Returns the first element of a list -proc ::tcl::Lfirst {list} { - lindex $list 0 -} -# Returns the rest of the list minus first element -proc ::tcl::Lrest {list} { - lrange $list 1 end -} -# Removes the first element of a list -# and returns the new list value -proc ::tcl::Lvarpop1 {listName} { - upvar $listName list; - set list [lrange $list 1 end]; -} -# Same but returns the removed element -# (Like the tclX version) -proc ::tcl::Lvarpop {listName} { - upvar $listName list; - set el [Lfirst $list]; - 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 [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 {} -} diff --git a/library/opt0.4/pkgIndex.tcl b/library/opt0.4/pkgIndex.tcl deleted file mode 100644 index 260e572..0000000 --- a/library/opt0.4/pkgIndex.tcl +++ /dev/null @@ -1,11 +0,0 @@ -# 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. - -package ifneeded opt 0.4.1 [list source [file join $dir optparse.tcl]] diff --git a/library/package.tcl b/library/package.tcl deleted file mode 100644 index cf8d1ba..0000000 --- a/library/package.tcl +++ /dev/null @@ -1,473 +0,0 @@ -# package.tcl -- -# -# utility procs formerly in init.tcl which can be loaded on demand -# for package management. -# -# RCS: @(#) $Id: package.tcl,v 1.2 1999/04/16 00:46:56 stanton Exp $ -# -# Copyright (c) 1991-1993 The Regents of the University of California. -# Copyright (c) 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. -# - -# 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 pkg_compareExtension { fileName {ext {}} } { - global tcl_platform - if {[string length $ext] == 0} { - set ext [info sharedlibextension] - } - if {[string compare $tcl_platform(platform) "windows"] == 0} { - return [expr {[string compare \ - [string tolower [file extension $fileName]] \ - [string tolower $ext]] == 0}] - } else { - return [expr {[string compare [file extension $fileName] $ext] == 0}] - } -} - -# 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 rocessed 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} { - global errorCode errorInfo - set usage {"pkg_mkIndex ?-direct? ?-verbose? ?-load pattern? ?--? dir ?pattern ...?"}; - - set argCount [llength $args] - if {$argCount < 1} { - return -code error "wrong # args: should be\n$usage" - } - - set more "" - set direct 0 - 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 - } - -direct { - set direct 1 - 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] == 0} { - set patternList [list "*.tcl" "*[info sharedlibextension]"] - } - - 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" - set oldDir [pwd] - cd $dir - - if {[catch {eval glob $patternList} fileList]} { - global errorCode errorInfo - cd $oldDir - return -code error -errorcode $errorCode -errorinfo $errorInfo $fileList - } - 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 {[string compare $file "pkgIndex.tcl"] == 0} { - continue - } - - # Changed back to the original directory before initializing the - # slave in case TCL_LIBRARY is a relative path (e.g. in the test - # suite). - - cd $oldDir - set c [interp create] - - # Load into the child any packages currently loaded in the parent - # interpreter that match the -load pattern. - - foreach pkg [info loaded] { - if {! [string match $loadPat [lindex $pkg 1]]} { - continue - } - if {[lindex $pkg 1] == "Tk"} { - $c eval {set argv {-geometry +0+0}} - } - if {[catch { - load [lindex $pkg 0] [lindex $pkg 1] $c - } err]} { - if {$doVerbose} { - tclLog "warning: load [lindex $pkg 0] [lindex $pkg 1]\nfailed with: $err" - } - } else { - if {$doVerbose} { - tclLog "loaded [lindex $pkg 0] [lindex $pkg 1]" - } - } - } - cd $dir - - $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 { eval __package_orig {$what} $args } - } - } - proc tclPkgUnknown args {} - package unknown tclPkgUnknown - - # Stub out the unknown command so package can call - # into each other during their initialilzation. - - 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 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::file $file] - $c eval [list set ::tcl::direct $direct] - - # Download needed procedures into the slave because we've - # just deleted the unknown procedure. This doesn't handle - # procedures with default arguments. - - foreach p {pkg_compareExtension} { - $c eval [list proc $p [info args $p] [info body $p]] - } - - if {[catch { - $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] { - eval lappend list [::tcl::GetAllNamespaces $ns] - } - return $list - } - - # initialize the list of existing namespaces, packages, commands - - foreach ::tcl::x [::tcl::GetAllNamespaces] { - set ::tcl::namespaces($::tcl::x) 1 - } - foreach ::tcl::x [package names] { - 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 {[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::file] - set ::tcl::type load - } else { - set ::tcl::debug sourcing - source $::tcl::file - set ::tcl::type source - } - - # 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 { - catch {unset ::tcl::newCmds($::tcl::x)} - } - foreach ::tcl::x [array names ::tcl::newCmds] { - # reverse engineer 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 [auto_qualify $::tcl::abs ::] - - if {[string compare $::tcl::x $::tcl::abs] != 0} { - # 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 {([string compare [package provide $::tcl::x] ""] != 0) \ - && ![info exists ::tcl::packages($::tcl::x)]} { - lappend ::tcl::newPkgs \ - [list $::tcl::x [package provide $::tcl::x]] - } - } - } - } msg] == 1} { - set what [$c eval set ::tcl::debug] - if {$doVerbose} { - tclLog "warning: error while $what $file: $msg" - } - } else { - set type [$c eval set ::tcl::type] - set cmds [lsort [$c eval array names ::tcl::newCmds]] - set pkgs [$c eval set ::tcl::newPkgs] - 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 - } - } - - foreach pkg [lsort [array names files]] { - append index "\npackage ifneeded $pkg " - if {$direct} { - set cmdList {} - foreach elem $files($pkg) { - set file [lindex $elem 0] - set type [lindex $elem 1] - lappend cmdList "\[list $type \[file join \$dir\ - [list $file]\]\]" - } - append index [join $cmdList "\\n"] - } else { - append index "\[list tclPkgSetup \$dir [lrange $pkg 0 0]\ - [lrange $pkg 1 1] [list $files($pkg)]\]" - } - } - set f [open pkgIndex.tcl w] - puts $f $index - close $f - cd $oldDir -} - -# 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 == "load"} { - set auto_index($cmd) [list load [file join $dir $f] $pkg] - } else { - set auto_index($cmd) [list source [file join $dir $f]] - } - } - } -} - -# tclMacPkgSearch -- -# The procedure is used on the Macintosh to search a given directory for files -# with a TEXT resource named "pkgIndex". If it exists it is sourced in to the -# interpreter to setup the package database. - -proc tclMacPkgSearch {dir} { - foreach x [glob -nocomplain [file join $dir *.shlb]] { - if {[file isfile $x]} { - set res [resource open $x] - foreach y [resource list TEXT $res] { - if {$y == "pkgIndex"} {source -rsrc pkgIndex} - } - catch {resource close $res} - } - } -} - -# 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. (On the Macintosh we also search for pkgIndex -# TEXT resources in all files.) -# -# 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 version {exact {}}} { - global auto_path tcl_platform env - - if {![info exists auto_path]} { - return - } - for {set i [expr {[llength $auto_path] - 1}]} {$i >= 0} {incr i -1} { - # we can't use glob in safe interps, so enclose the following - # in a catch statement - catch { - foreach file [glob -nocomplain [file join [lindex $auto_path $i] \ - * pkgIndex.tcl]] { - set dir [file dirname $file] - if {[catch {source $file} msg]} { - tclLog "error reading package index file $file: $msg" - } - } - } - set dir [lindex $auto_path $i] - set file [file join $dir pkgIndex.tcl] - # safe interps usually don't have "file readable", nor stderr channel - if {[interp issafe] || [file readable $file]} { - if {[catch {source $file} msg] && ![interp issafe]} { - tclLog "error reading package index file $file: $msg" - } - } - # On the Macintosh we also look in the resource fork - # of shared libraries - # We can't use tclMacPkgSearch in safe interps because it uses glob - if {(![interp issafe]) && ($tcl_platform(platform) == "macintosh")} { - set dir [lindex $auto_path $i] - tclMacPkgSearch $dir - foreach x [glob -nocomplain [file join $dir *]] { - if {[file isdirectory $x]} { - set dir $x - tclMacPkgSearch $dir - } - } - } - } -} diff --git a/library/parray.tcl b/library/parray.tcl deleted file mode 100644 index 92655b2..0000000 --- a/library/parray.tcl +++ /dev/null @@ -1,29 +0,0 @@ -# parray: -# Print the contents of a global array on stdout. -# -# RCS: @(#) $Id: parray.tcl,v 1.3 1998/09/14 18:40:03 stanton Exp $ -# -# Copyright (c) 1991-1993 The Regents of the University of California. -# Copyright (c) 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]} { - error "\"$a\" isn't an array" - } - set maxl 0 - foreach name [lsort [array names array $pattern]] { - if {[string length $name] > $maxl} { - set maxl [string length $name] - } - } - set maxl [expr {$maxl + [string length $a] + 2}] - foreach name [lsort [array names array $pattern]] { - set nameString [format %s(%s) $a $name] - puts stdout [format "%-*s = %s" $maxl $nameString $array($name)] - } -} diff --git a/library/safe.tcl b/library/safe.tcl deleted file mode 100644 index 3be7739..0000000 --- a/library/safe.tcl +++ /dev/null @@ -1,931 +0,0 @@ -# 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 -# slave. It runs in a master interpreter and sets up data structure and -# aliases that will be invoked when used from a slave interpreter. -# -# See the safe.n man page for details. -# -# Copyright (c) 1996-1997 Sun Microsystems, Inc. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: safe.tcl,v 1.5 1999/04/16 00:46:57 stanton Exp $ - -# -# 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.1; - -# Create the safe namespace -namespace eval ::safe { - - # Exported API: - namespace export interpCreate interpInit interpConfigure interpDelete \ - interpAddToAccessPath interpFindInAccessPath \ - setLogCmd ; - - #### - # - # Setup the arguments parsing - # - #### - - # Share the descriptions - set temp [::tcl::OptKeyRegister { - {-accessPath -list {} "access path for the slave"} - {-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"} - }] - - # create case (slave is optional) - ::tcl::OptKeyRegister { - {?slave? -name {} "name of the slave (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 (slave is needed) - ::tcl::OptKeyRegister { - {slave -name {} "name of the slave"} - } ::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; - - - # Helper function to resolve the dual way of specifying staticsok - # (either by -noStatics or -statics 0) - proc 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 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 interpCreate {args} { - set Args [::tcl::OptKeyParse ::safe::interpCreate $args] - InterpCreate $slave $accessPath \ - [InterpStatics] [InterpNested] $deleteHook; - } - - proc interpInit {args} { - set Args [::tcl::OptKeyParse ::safe::interpIC $args] - if {![::interp exists $slave]} { - return -code error \ - "\"$slave\" is not an interpreter"; - } - InterpInit $slave $accessPath \ - [InterpStatics] [InterpNested] $deleteHook; - } - - proc CheckInterp {slave} { - if {![IsInterp $slave]} { - return -code error \ - "\"$slave\" 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 tcl8.1 ?) - proc interpConfigure {args} { - 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 "slave" - # is our given argument because it also checks - # for the "-help" option. - set Args [::tcl::OptKeyParse ::safe::interpIC $args]; - CheckInterp $slave; - set res {} - lappend res [list -accessPath [Set [PathListName $slave]]] - lappend res [list -statics [Set [StaticsOkName $slave]]] - lappend res [list -nested [Set [NestedOkName $slave]]] - lappend res [list -deleteHook [Set [DeleteHookName $slave]]] - join $res - } - 2 { - # If we have exactly 2 arguments - # the semantic is a "configure get" - ::tcl::Lassign $args slave 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 $slave; - set item [::tcl::OptCurDesc $desc]; - set name [::tcl::OptName $item]; - switch -exact -- $name { - -accessPath { - return [list -accessPath [Set [PathListName $slave]]] - } - -statics { - return [list -statics [Set [StaticsOkName $slave]]] - } - -nested { - return [list -nested [Set [NestedOkName $slave]]] - } - -deleteHook { - return [list -deleteHook [Set [DeleteHookName $slave]]] - } - -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 - # unambigous -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 $slave; - # Get the current (and not the default) values of - # whatever has not been given: - if {![::tcl::OptProcArgGiven -accessPath]} { - set doreset 1 - set accessPath [Set [PathListName $slave]] - } else { - set doreset 0 - } - if { (![::tcl::OptProcArgGiven -statics]) - && (![::tcl::OptProcArgGiven -noStatics]) } { - set statics [Set [StaticsOkName $slave]] - } else { - set statics [InterpStatics] - } - if { ([::tcl::OptProcArgGiven -nested]) - || ([::tcl::OptProcArgGiven -nestedLoadOk]) } { - set nested [InterpNested] - } else { - set nested [Set [NestedOkName $slave]] - } - if {![::tcl::OptProcArgGiven -deleteHook]} { - set deleteHook [Set [DeleteHookName $slave]] - } - # we can now reconfigure : - InterpSetConfig $slave $accessPath \ - $statics $nested $deleteHook; - # auto_reset the slave (to completly synch the new access_path) - if {$doreset} { - if {[catch {::interp eval $slave {auto_reset}} msg]} { - Log $slave "auto_reset failed: $msg"; - } else { - Log $slave "successful auto_reset" NOTICE; - } - } - } - } - } - - - #### - # - # Functions that actually implements the exported APIs - # - #### - - - # - # safe::InterpCreate : doing the real job - # - # This procedure creates a safe slave and initializes it with the - # safe base aliases. - # NB: slave name must be simple alphanumeric string, no spaces, - # no (), no {},... {because the state array is stored as part of the name} - # - # Returns the slave name. - # - # Optional Arguments : - # + slave name : if empty, generated name will be used - # + access_path: path list controlling where load/source can occur, - # if empty: the master auto_path 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 { - slave - access_path - staticsok - nestedok - deletehook - } { - # Create the slave. - if {[string compare "" $slave]} { - ::interp create -safe $slave; - } else { - # empty argument: generate slave name - set slave [::interp create -safe]; - } - Log $slave "Created" NOTICE; - - # Initialize it. (returns slave name) - InterpInit $slave $access_path $staticsok $nestedok $deletehook; - } - - - # - # InterpSetConfig (was setAccessPath) : - # Sets up slave virtual auto_path and corresponding structure - # within the master. Also sets the tcl_library in the slave - # to be the first directory in the path. - # Nb: If you change the path after the slave has been initialized - # you probably need to call "auto_reset" in the slave in order that it - # gets the right auto_index() array values. - - proc ::safe::InterpSetConfig {slave access_path staticsok\ - nestedok deletehook} { - - # determine and store the access path if empty - if {[string match "" $access_path]} { - set access_path [uplevel #0 set 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 == -1} { - # not found, add it. - set access_path [concat [list [info library]] $access_path]; - Log $slave "tcl_library was not in auto_path,\ - added it to slave's access_path" NOTICE; - } elseif {$where != 0} { - # not first, move it first - set access_path [concat [list [info library]]\ - [lreplace $access_path $where $where]]; - Log $slave "tcl_libray was not in first in auto_path,\ - moved it to front of slave's access_path" NOTICE; - - } - - # Add 1st level sub dirs (will searched by auto loading from tcl - # code in the slave using glob and thus fail, so we add them - # here so by default it works the same). - set access_path [AddSubDirs $access_path]; - } - - Log $slave "Setting accessPath=($access_path) staticsok=$staticsok\ - nestedok=$nestedok deletehook=($deletehook)" NOTICE; - - # clear old autopath if it existed - set nname [PathNumberName $slave]; - if {[Exists $nname]} { - set n [Set $nname]; - for {set i 0} {$i<$n} {incr i} { - Unset [PathToken $i $slave]; - } - } - - # build new one - set slave_auto_path {} - set i 0; - foreach dir $access_path { - Set [PathToken $i $slave] $dir; - lappend slave_auto_path "\$[PathToken $i]"; - incr i; - } - Set $nname $i; - Set [PathListName $slave] $access_path; - Set [VirtualPathListName $slave] $slave_auto_path; - - Set [StaticsOkName $slave] $staticsok - Set [NestedOkName $slave] $nestedok - Set [DeleteHookName $slave] $deletehook - - SyncAccessPath $slave; - } - - # - # - # FindInAccessPath: - # Search for a real directory and returns its virtual Id - # (including the "$") -proc ::safe::interpFindInAccessPath {slave path} { - set access_path [GetAccessPath $slave]; - set where [lsearch -exact $access_path $path]; - if {$where == -1} { - return -code error "$path not found in access path $access_path"; - } - return "\$[PathToken $where]"; - } - - # - # addToAccessPath: - # add (if needed) a real directory to access path - # and return its virtual token (including the "$"). -proc ::safe::interpAddToAccessPath {slave path} { - # first check if the directory is already in there - if {![catch {interpFindInAccessPath $slave $path} res]} { - return $res; - } - # new one, add it: - set nname [PathNumberName $slave]; - set n [Set $nname]; - Set [PathToken $n $slave] $path; - - set token "\$[PathToken $n]"; - - Lappend [VirtualPathListName $slave] $token; - Lappend [PathListName $slave] $path; - Set $nname [expr {$n+1}]; - - SyncAccessPath $slave; - - 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 { - slave - access_path - staticsok - nestedok - deletehook - } { - - # Configure will generate an access_path when access_path is - # empty. - InterpSetConfig $slave $access_path $staticsok $nestedok $deletehook; - - # These aliases let the slave load files to define new commands - - # NB we need to add [namespace current], aliases are always - # absolute paths. - ::interp alias $slave source {} [namespace current]::AliasSource $slave - ::interp alias $slave load {} [namespace current]::AliasLoad $slave - - # This alias lets the slave use the encoding names, convertfrom, - # convertto, and system, but not "encoding system " to set - # the system encoding. - - ::interp alias $slave encoding {} [namespace current]::AliasEncoding \ - $slave - - # This alias lets the slave have access to a subset of the 'file' - # command functionality. - - AliasSubset $slave file file dir.* join root.* ext.* tail \ - path.* split - - # This alias interposes on the 'exit' command and cleanly terminates - # the slave. - - ::interp alias $slave exit {} [namespace current]::interpDelete $slave - - # The allowed slave variables already have been set - # by Tcl_MakeSafe(3) - - - # Source init.tcl into the slave, to get auto_load and other - # procedures defined: - - # We don't try to use the -rsrc on the mac because it would get - # confusing if you would want to customize init.tcl - # for a given set of safe slaves, on all the platforms - # you just need to give a specific access_path and - # the mac should be no exception. As there is no - # obvious full "safe ressources" design nor implementation - # for the mac, safe interps there will just don't - # have that ability. (A specific app can still reenable - # that using custom aliases if they want to). - # It would also make the security analysis and the Safe Tcl security - # model platform dependant and thus more error prone. - - if {[catch {::interp eval $slave\ - {source [file join $tcl_library init.tcl]}}\ - msg]} { - Log $slave "can't source init.tcl ($msg)"; - error "can't source init.tcl into slave $slave ($msg)" - } - - return $slave - } - - - # 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 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 {[lsearch -exact $res $dir]<0} { - lappend res $dir; - } - foreach sub [glob -nocomplain -- [file join $dir *]] { - if { ([file isdirectory $sub]) - && ([lsearch -exact $res $sub]<0) } { - # new sub dir, add it ! - lappend res $sub; - } - } - } - } - return $res; - } - - # This procedure deletes a safe slave managed by Safe Tcl and - # cleans up associated state: - -proc ::safe::interpDelete {slave} { - - Log $slave "About to delete" NOTICE; - - # If the slave has a cleanup hook registered, call it. - # check the existance because we might be called to delete an interp - # which has not been registered with us at all - set hookname [DeleteHookName $slave]; - if {[Exists $hookname]} { - set hook [Set $hookname]; - if {![::tcl::Lempty $hook]} { - # remove the hook now, otherwise if the hook - # calls us somehow, we'll loop - Unset $hookname; - if {[catch {eval $hook [list $slave]} err]} { - Log $slave "Delete hook error ($err)"; - } - } - } - - # Discard the global array of state associated with the slave, and - # delete the interpreter. - - set statename [InterpStateName $slave]; - if {[Exists $statename]} { - Unset $statename; - } - - # if we have been called twice, the interp might have been deleted - # already - if {[::interp exists $slave]} { - ::interp delete $slave; - Log $slave "Deleted" NOTICE; - } - - return - } - - # Set (or get) the loging mecanism - -proc ::safe::setLogCmd {args} { - variable Log; - if {[llength $args] == 0} { - return $Log; - } else { - if {[llength $args] == 1} { - set Log [lindex $args 0]; - } else { - set Log $args - } - } -} - - # internal variable - variable Log {} - - # ------------------- END OF PUBLIC METHODS ------------ - - - # - # sets the slave auto_path to the master recorded value. - # also sets tcl_library to the first token of the virtual path. - # - proc SyncAccessPath {slave} { - set slave_auto_path [Set [VirtualPathListName $slave]]; - ::interp eval $slave [list set auto_path $slave_auto_path]; - Log $slave \ - "auto_path in $slave has been set to $slave_auto_path"\ - NOTICE; - ::interp eval $slave [list set tcl_library [lindex $slave_auto_path 0]]; - } - - # base name for storing all the slave states - # the array variable name for slave foo is thus "Sfoo" - # and for sub slave {foo bar} "Sfoo bar" (spaces are handled - # ok everywhere (or should)) - # We add the S prefix to avoid that a slave interp called "Log" - # would smash our "Log" variable. - proc InterpStateName {slave} { - return "S$slave"; - } - - # Check that the given slave is "one of us" - proc IsInterp {slave} { - expr { ([Exists [InterpStateName $slave]]) - && ([::interp exists $slave])} - } - - # returns the virtual token for directory number N - # if the slave argument is given, - # it will return the corresponding master global variable name - proc PathToken {n {slave ""}} { - if {[string compare "" $slave]} { - return "[InterpStateName $slave](access_path,$n)"; - } else { - # 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:)"; - } - } - # returns the variable name of the complete path list - proc PathListName {slave} { - return "[InterpStateName $slave](access_path)"; - } - # returns the variable name of the complete path list - proc VirtualPathListName {slave} { - return "[InterpStateName $slave](access_path_slave)"; - } - # returns the variable name of the number of items - proc PathNumberName {slave} { - return "[InterpStateName $slave](access_path,n)"; - } - # returns the staticsok flag var name - proc StaticsOkName {slave} { - return "[InterpStateName $slave](staticsok)"; - } - # returns the nestedok flag var name - proc NestedOkName {slave} { - return "[InterpStateName $slave](nestedok)"; - } - # Run some code at the namespace toplevel - proc Toplevel {args} { - namespace eval [namespace current] $args; - } - # set/get values - proc Set {args} { - eval Toplevel set $args; - } - # lappend on toplevel vars - proc Lappend {args} { - eval Toplevel lappend $args; - } - # unset a var/token (currently just an global level eval) - proc Unset {args} { - eval Toplevel unset $args; - } - # test existance - proc Exists {varname} { - Toplevel info exists $varname; - } - # short cut for access path getting - proc GetAccessPath {slave} { - Set [PathListName $slave] - } - # short cut for statics ok flag getting - proc StaticsOk {slave} { - Set [StaticsOkName $slave] - } - # short cut for getting the multiples interps sub loading ok flag - proc NestedOk {slave} { - Set [NestedOkName $slave] - } - # interp deletion storing hook name - proc DeleteHookName {slave} { - return [InterpStateName $slave](cleanupHook) - } - - # - # translate virtual path into real path - # - proc TranslatePath {slave path} { - # somehow strip the namespaces 'functionality' out (the danger - # is that we would strip valid macintosh "../" queries... : - if {[regexp {(::)|(\.\.)} $path]} { - error "invalid characters in path $path"; - } - set n [expr {[Set [PathNumberName $slave]]-1}]; - for {} {$n>=0} {incr n -1} { - # fill the token virtual names with their real value - set [PathToken $n] [Set [PathToken $n $slave]]; - } - # replaces the token by their value - subst -nobackslashes -nocommands $path; - } - - - # Log eventually log an error - # to enable error logging, set Log to {puts stderr} for instance - proc Log {slave msg {type ERROR}} { - variable Log; - if {[info exists Log] && [llength $Log]} { - eval $Log [list "$type for slave $slave : $msg"]; - } - } - - - # file name control (limit access to files/ressources that should be - # a valid tcl source file) - proc CheckFileName {slave file} { - # limit what can be sourced to .tcl - # and forbid files with more than 1 dot and - # longer than 14 chars - set ftail [file tail $file]; - if {[string length $ftail]>14} { - error "$ftail: filename too long"; - } - if {[regexp {\..*\.} $ftail]} { - error "$ftail: more than one dot is forbidden"; - } - if {[string compare $ftail "tclIndex"] && \ - [string compare [string tolower [file extension $ftail]]\ - ".tcl"]} { - error "$ftail: must be a *.tcl or tclIndex"; - } - - if {![file exists $file]} { - # don't tell the file path - error "no such file or directory"; - } - - if {![file readable $file]} { - # don't tell the file path - error "not readable"; - } - - } - - - # AliasSource is the target of the "source" alias in safe interpreters. - - proc AliasSource {slave args} { - - set argc [llength $args]; - # Allow only "source filename" - # (and not mac specific -rsrc for instance - see comment in ::init - # for current rationale) - if {$argc != 1} { - set msg "wrong # args: should be \"source fileName\"" - Log $slave "$msg ($args)"; - return -code error $msg; - } - set file [lindex $args 0] - - # get the real path from the virtual one. - if {[catch {set file [TranslatePath $slave $file]} msg]} { - Log $slave $msg; - return -code error "permission denied" - } - - # check that the path is in the access path of that slave - if {[catch {FileInAccessPath $slave $file} msg]} { - Log $slave $msg; - return -code error "permission denied" - } - - # do the checks on the filename : - if {[catch {CheckFileName $slave $file} msg]} { - Log $slave "$file:$msg"; - return -code error $msg; - } - - # passed all the tests , lets source it: - if {[catch {::interp invokehidden $slave source $file} msg]} { - Log $slave $msg; - return -code error "script error"; - } - return $msg - } - - # AliasLoad is the target of the "load" alias in safe interpreters. - - proc AliasLoad {slave file args} { - - set argc [llength $args]; - if {$argc > 2} { - set msg "load error: too many arguments"; - Log $slave "$msg ($argc) {$file $args}"; - return -code error $msg; - } - - # package name (can be empty if file is not). - set package [lindex $args 0]; - - # 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 {[string length $target]} { - # we will try to load into a sub sub interp - # check that we want to authorize that. - if {![NestedOk $slave]} { - Log $slave "loading to a sub interp (nestedok)\ - disabled (trying to load $package to $target)"; - return -code error "permission denied (nested load)"; - } - - } - - # Determine what kind of load is requested - if {[string length $file] == 0} { - # static package loading - if {[string length $package] == 0} { - set msg "load error: empty filename and no package name"; - Log $slave $msg; - return -code error $msg; - } - if {![StaticsOk $slave]} { - Log $slave "static packages loading disabled\ - (trying to load $package to $target)"; - return -code error "permission denied (static package)"; - } - } else { - # file loading - - # get the real path from the virtual one. - if {[catch {set file [TranslatePath $slave $file]} msg]} { - Log $slave $msg; - return -code error "permission denied" - } - - # check the translated path - if {[catch {FileInAccessPath $slave $file} msg]} { - Log $slave $msg; - return -code error "permission denied (path)" - } - } - - if {[catch {::interp invokehidden\ - $slave load $file $package $target} msg]} { - Log $slave $msg; - return -code error $msg - } - - return $msg - } - - # FileInAccessPath raises an error if the file is not found in - # the list of directories contained in the (master side recorded) slave's - # access path. - - # the security here relies on "file dirname" answering the proper - # result.... needs checking ? - proc FileInAccessPath {slave file} { - - set access_path [GetAccessPath $slave]; - - if {[file isdirectory $file]} { - error "\"$file\": is a directory" - } - set parent [file dirname $file] - if {[lsearch -exact $access_path $parent] == -1} { - error "\"$file\": not in access_path"; - } - } - - # This procedure enables access from a safe interpreter to only a subset of - # the subcommands of a command: - - proc Subset {slave command okpat args} { - set subcommand [lindex $args 0] - if {[regexp $okpat $subcommand]} { - return [eval {$command $subcommand} [lrange $args 1 end]] - } - set msg "not allowed to invoke subcommand $subcommand of $command"; - Log $slave $msg; - error $msg; - } - - # This procedure installs an alias in a slave that invokes "safesubset" - # in the master to execute allowed subcommands. It precomputes the pattern - # of allowed subcommands; you can use wildcards in the pattern if you wish - # to allow subcommand abbreviation. - # - # Syntax is: AliasSubset slave alias target subcommand1 subcommand2... - - proc AliasSubset {slave alias target args} { - set pat ^(; set sep "" - foreach sub $args { - append pat $sep$sub - set sep | - } - append pat )\$ - ::interp alias $slave $alias {}\ - [namespace current]::Subset $slave $target $pat - } - - # AliasEncoding is the target of the "encoding" alias in safe interpreters. - - proc AliasEncoding {slave args} { - - set argc [llength $args]; - - set okpat "^(name.*|convert.*)\$" - set subcommand [lindex $args 0] - - if {[regexp $okpat $subcommand]} { - return [eval ::interp invokehidden $slave encoding $subcommand \ - [lrange $args 1 end]] - } - - if {[string match $subcommand system]} { - if {$argc == 1} { - # passed all the tests , lets source it: - if {[catch {::interp invokehidden \ - $slave encoding system} msg]} { - Log $slave $msg; - return -code error "script error"; - } - } else { - set msg "wrong # args: should be \"encoding system\""; - Log $slave $msg; - error $msg; - } - } else { - set msg "wrong # args: should be \"encoding option ?arg ...?\""; - Log $slave $msg; - error $msg; - } - - - return $msg - } - -} diff --git a/library/tclIndex b/library/tclIndex deleted file mode 100644 index 35c7cf6..0000000 --- a/library/tclIndex +++ /dev/null @@ -1,81 +0,0 @@ -# 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 source [file join $dir auto.tcl]] -set auto_index(tcl_findLibrary) [list source [file join $dir auto.tcl]] -set auto_index(auto_mkindex) [list source [file join $dir auto.tcl]] -set auto_index(auto_mkindex_old) [list source [file join $dir auto.tcl]] -set auto_index(::auto_mkindex_parser::init) [list source [file join $dir auto.tcl]] -set auto_index(::auto_mkindex_parser::cleanup) [list source [file join $dir auto.tcl]] -set auto_index(::auto_mkindex_parser::mkindex) [list source [file join $dir auto.tcl]] -set auto_index(::auto_mkindex_parser::hook) [list source [file join $dir auto.tcl]] -set auto_index(::auto_mkindex_parser::slavehook) [list source [file join $dir auto.tcl]] -set auto_index(::auto_mkindex_parser::command) [list source [file join $dir auto.tcl]] -set auto_index(::auto_mkindex_parser::commandInit) [list source [file join $dir auto.tcl]] -set auto_index(::auto_mkindex_parser::fullname) [list source [file join $dir auto.tcl]] -set auto_index(history) [list source [file join $dir history.tcl]] -set auto_index(::tcl::HistAdd) [list source [file join $dir history.tcl]] -set auto_index(::tcl::HistKeep) [list source [file join $dir history.tcl]] -set auto_index(::tcl::HistClear) [list source [file join $dir history.tcl]] -set auto_index(::tcl::HistInfo) [list source [file join $dir history.tcl]] -set auto_index(::tcl::HistRedo) [list source [file join $dir history.tcl]] -set auto_index(::tcl::HistIndex) [list source [file join $dir history.tcl]] -set auto_index(::tcl::HistEvent) [list source [file join $dir history.tcl]] -set auto_index(::tcl::HistChange) [list source [file join $dir history.tcl]] -set auto_index(tclLdAout) [list source [file join $dir ldAout.tcl]] -set auto_index(pkg_compareExtension) [list source [file join $dir package.tcl]] -set auto_index(pkg_mkIndex) [list source [file join $dir package.tcl]] -set auto_index(tclPkgSetup) [list source [file join $dir package.tcl]] -set auto_index(tclMacPkgSearch) [list source [file join $dir package.tcl]] -set auto_index(tclPkgUnknown) [list source [file join $dir package.tcl]] -set auto_index(parray) [list source [file join $dir parray.tcl]] -set auto_index(::safe::InterpStatics) [list source [file join $dir safe.tcl]] -set auto_index(::safe::InterpNested) [list source [file join $dir safe.tcl]] -set auto_index(::safe::interpCreate) [list source [file join $dir safe.tcl]] -set auto_index(::safe::interpInit) [list source [file join $dir safe.tcl]] -set auto_index(::safe::CheckInterp) [list source [file join $dir safe.tcl]] -set auto_index(::safe::interpConfigure) [list source [file join $dir safe.tcl]] -set auto_index(::safe::InterpCreate) [list source [file join $dir safe.tcl]] -set auto_index(::safe::InterpSetConfig) [list source [file join $dir safe.tcl]] -set auto_index(::safe::interpFindInAccessPath) [list source [file join $dir safe.tcl]] -set auto_index(::safe::interpAddToAccessPath) [list source [file join $dir safe.tcl]] -set auto_index(::safe::InterpInit) [list source [file join $dir safe.tcl]] -set auto_index(::safe::AddSubDirs) [list source [file join $dir safe.tcl]] -set auto_index(::safe::interpDelete) [list source [file join $dir safe.tcl]] -set auto_index(::safe::setLogCmd) [list source [file join $dir safe.tcl]] -set auto_index(::safe::SyncAccessPath) [list source [file join $dir safe.tcl]] -set auto_index(::safe::InterpStateName) [list source [file join $dir safe.tcl]] -set auto_index(::safe::IsInterp) [list source [file join $dir safe.tcl]] -set auto_index(::safe::PathToken) [list source [file join $dir safe.tcl]] -set auto_index(::safe::PathListName) [list source [file join $dir safe.tcl]] -set auto_index(::safe::VirtualPathListName) [list source [file join $dir safe.tcl]] -set auto_index(::safe::PathNumberName) [list source [file join $dir safe.tcl]] -set auto_index(::safe::StaticsOkName) [list source [file join $dir safe.tcl]] -set auto_index(::safe::NestedOkName) [list source [file join $dir safe.tcl]] -set auto_index(::safe::Toplevel) [list source [file join $dir safe.tcl]] -set auto_index(::safe::Set) [list source [file join $dir safe.tcl]] -set auto_index(::safe::Lappend) [list source [file join $dir safe.tcl]] -set auto_index(::safe::Unset) [list source [file join $dir safe.tcl]] -set auto_index(::safe::Exists) [list source [file join $dir safe.tcl]] -set auto_index(::safe::GetAccessPath) [list source [file join $dir safe.tcl]] -set auto_index(::safe::StaticsOk) [list source [file join $dir safe.tcl]] -set auto_index(::safe::NestedOk) [list source [file join $dir safe.tcl]] -set auto_index(::safe::DeleteHookName) [list source [file join $dir safe.tcl]] -set auto_index(::safe::TranslatePath) [list source [file join $dir safe.tcl]] -set auto_index(::safe::Log) [list source [file join $dir safe.tcl]] -set auto_index(::safe::CheckFileName) [list source [file join $dir safe.tcl]] -set auto_index(::safe::AliasSource) [list source [file join $dir safe.tcl]] -set auto_index(::safe::AliasLoad) [list source [file join $dir safe.tcl]] -set auto_index(::safe::FileInAccessPath) [list source [file join $dir safe.tcl]] -set auto_index(::safe::Subset) [list source [file join $dir safe.tcl]] -set auto_index(::safe::AliasSubset) [list source [file join $dir safe.tcl]] -set auto_index(tcl_wordBreakAfter) [list source [file join $dir word.tcl]] -set auto_index(tcl_wordBreakBefore) [list source [file join $dir word.tcl]] -set auto_index(tcl_endOfWord) [list source [file join $dir word.tcl]] -set auto_index(tcl_startOfNextWord) [list source [file join $dir word.tcl]] -set auto_index(tcl_startOfPreviousWord) [list source [file join $dir word.tcl]] diff --git a/library/word.tcl b/library/word.tcl deleted file mode 100644 index 0c8d576..0000000 --- a/library/word.tcl +++ /dev/null @@ -1,132 +0,0 @@ -# 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 (c) 1996 by Sun Microsystems, Inc. -# Copyright (c) 1998 by Scritpics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: word.tcl,v 1.4 1999/04/16 00:46:57 stanton Exp $ - -# The following variables are used to determine which characters are -# interpreted as white space. - -if {$tcl_platform(platform) == "windows"} { - # Windows style - any but space, tab, or newline - set tcl_wordchars "\[^ \t\n\]" - set tcl_nonwordchars "\[ \t\n\]" -} else { - # Motif style - any number, letter, or underscore - set tcl_wordchars {[a-zA-Z0-9_]} - set tcl_nonwordchars {[^a-zA-Z0-9_]} -} - -# 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} { - global tcl_nonwordchars tcl_wordchars - set str [string range $str $start end] - if {[regexp -indices "$tcl_wordchars$tcl_nonwordchars|$tcl_nonwordchars$tcl_wordchars" $str result]} { - return [expr {[lindex $result 1] + $start}] - } - return -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} { - global tcl_nonwordchars tcl_wordchars - if {[string compare $start end] == 0} { - set start [string length $str] - } - if {[regexp -indices "^.*($tcl_wordchars$tcl_nonwordchars|$tcl_nonwordchars$tcl_wordchars)" [string range $str 0 $start] result]} { - return [lindex $result 1] - } - return -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} { - global tcl_nonwordchars tcl_wordchars - if {[regexp -indices "$tcl_nonwordchars*$tcl_wordchars+$tcl_nonwordchars" \ - [string range $str $start end] result]} { - return [expr {[lindex $result 1] + $start}] - } - return -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} { - global tcl_nonwordchars tcl_wordchars - if {[regexp -indices "$tcl_wordchars*$tcl_nonwordchars+$tcl_wordchars" \ - [string range $str $start end] result]} { - return [expr {[lindex $result 1] + $start}] - } - return -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} { - global tcl_nonwordchars tcl_wordchars - if {[string compare $start end] == 0} { - set start [string length $str] - } - if {[regexp -indices \ - "$tcl_nonwordchars*($tcl_wordchars+)$tcl_nonwordchars*\$" \ - [string range $str 0 [expr {$start - 1}]] result word]} { - return [lindex $word 0] - } - return -1 -} diff --git a/license.terms b/license.terms deleted file mode 100644 index 9df3e60..0000000 --- a/license.terms +++ /dev/null @@ -1,39 +0,0 @@ -This software is copyrighted by the Regents of the University of -California, Sun Microsystems, Inc., Scriptics 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-7013 (c) (1) 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. diff --git a/mac/AppleScript.html b/mac/AppleScript.html deleted file mode 100644 index 4a73fbb..0000000 --- a/mac/AppleScript.html +++ /dev/null @@ -1,298 +0,0 @@ - - - - -tclOSAScript -- OSA - - - - - -

TclAppleScript Extension Command

- -

NAME

-
-
-AppleScript - Communicate with the AppleScript OSA component to run - AppleScripts from Tcl. -
-

SYNOPSIS

-
-AppleScript compile ?-flag value? scriptData1 - ?ScriptData2 ...?componentName -
-AppleScript decompile scriptName -
-AppleScript delete scriptName -
-AppleScript execute ?flags value? scriptData1 - ?scriptData2 ...? -
-AppleScript info what -
-AppleScript load ?flag value? fileName -
-AppleScript run ?flag value? - scriptName -
-AppleScript store ?flag value? scriptName fileName -
-
- -

DESCRIPTION

-
-
- - -This command is used to communicate with the AppleScript OSA component. -You can compile scripts, run compiled scripts, execute script data (i.e. compile and run at a -blow). You can get script data from a compiled script (decompile it), and you can load a compiled script from the scpt resource of a -file, or store one to a scpt resource. You can -also get info on the currently available scripts -and contexts. It has the general form - -
-
-

-AppleScript option ?arg arg ...? -

-

-The possible sub-commands are: -

-

-
- AppleScript compile ?-flag value? scriptData1 - ?ScriptData2 ...? -
- -
- The scriptData - elements are concatenated (with a space between each), and - sent to AppleScript - for compilation. There is no limitation on the size of - the scriptData, beyond the available memory of the Wish interpreter. -

- If the compilation is successful, then the command will return a token - that you can pass to the "run" subcommand. If the - compilation fails, then the return value will be the error message from - AppleScript, and the pertinent line of code, with an "_" to indicate - the place where it thinks the error occured. -

- The - compilation is controlled by flag value pairs. The available flags - are: -

-

-
- -augment Boolean -
- To be used in concert with the -context flag. - If augment is yes, - then the scriptData augments the handlers and data already in the - script context. If augment is no, then the scriptData replaces the - data and handlers already in the context. The default is yes. -

- - -

- -context Boolean -
- This flag causes the code given in the scriptData to be compiled - into a "context". In AppleScript, this is the equivalent of creating an Tcl - Namespace. The command in this case returns the name of the context as - the its result, rather than a compiled script name. -

- You can store data and procedures (aka - handlers) in a script context. Then later, you can - run other scripts in this context, and they will see all the data and - handlers that were set up with this command. You do this by passing the - name of this context to the -context flag of the run or execute subcommands. -

- Unlike the straight compile command, the code compiled into a - script context is run immediatly, when it is compiled, to set up the context. -

-

- -name string -

- Use string as the name of the script or script context. If there is - already a script - of this name, it will be discarded. The same is true with script - contexts, unless the -augment flag is true. If no name is provided, then a - unique name will be created for you. -
-

- -parent contextName -

- This flag is also to be used in conjunction with the -context flag. - contextName must be the name of a compiled script context. Then - the new script context will inherit the data and handlers from the - parent context. -
-

-

- AppleScript decompile scriptName -
-
- This decompiles the script data compiled into the script scriptName, - and returns the source code. -

-

- AppleScript delete scriptName -
-
- This deletes the script data compiled into the script scriptName, - and frees up all the resources associated with it. -

-

- AppleScript execute ?flags value? scriptData1 - ?scriptData2 ...? -
-
- This compiles and runs the script in scriptData (concatenating first), and - returns the results of the script execution. It is the same as doing - compile and then run, except that the compiled script is - immediately discarded. -

-

- AppleScript info what -
- This gives info on the connection. The allowed values for "what" are: -

-

-
-

- contexts ?pattern? -

- This gives the list of the script contexts that have been. - If pattern is given, it only reports the contexts - that match this pattern. -
- -

- scripts ?pattern? -

- This returns a list of the scripts that have been compiled in the - current connection. If pattern is given, it only reports the - script names that match this pattern. -
-

-

- AppleScript load ?flag value? fileName -
- This loads compiled script data from a resource of type 'scpt' in the - file fileName, and returns a token for the script data. As with the - compile command, the script is not actually executed. Note that all - scripts compiled with Apple's "Script Editor" are stored as script - contexts. However, unlike with the "compile -context" command, the load - command does not run these scripts automatically. If you want to set up - the handlers contained in the loaded script, you must run it manually. -

- load takes the following flags: -

-

-
- -rsrcname string -
- load a named resource of type 'scpt' using the rsrcname - flag. -
-

- -rsrcid integer -

- load a resource by number with the rsrcid flag. -
-
-

- If neither the rsrcname nor the rsrcid flag is provided, then the load - command defaults to -rsrcid = 128. This is the resource in which - Apple's Script Editor puts the script data when it writes out a - compiled script. -

-

- AppleScript run ?flag value? scriptName -
- This runs the script which was previously compiled into scriptName. If the script - runs successfully, the command returns the return value for this command, - coerced to a text string. - If there is an error in - the script execution, then it returns the error result from the - scripting component. It accepts the following flag: - -
-
-

- -context contextName -

- contextName must be a context created by a previous call to compile with - the -context flag set. This flag causes the code given in the - scriptData to be run in this "context". It will see all the data and - handlers that were set up previously. - -
-

-

- AppleScript store ?flag value? scriptName fileName -
- This stores a compiled script or script context into a resource of type 'scpt' in the - file fileName. -

- store takes the following flags: -

-

-
- -rsrcname string -
- store to a named resource of type 'scpt' using the rsrcname - flag. -
-

- -rsrcid integer -

- store to a numbered resource with the rsrcid flag. -
-

-

- If neither the rsrcname nor the rsrcid flag is provided, then the load - command defaults to -rsrcid = 128. Apple's Script Editor can read in files written by - tclOSAScript with this setting of the -rsrcid flag. -
-
-

Notes:

- -The AppleScript command is a stopgap command to fill the place of exec - on the Mac. It is not a supported command, and will likely change - as we broaden it to allow communication with other OSA languages. -

See Also:

- - - - - diff --git a/mac/Background.doc b/mac/Background.doc deleted file mode 100644 index d23235a..0000000 --- a/mac/Background.doc +++ /dev/null @@ -1,92 +0,0 @@ -Notes about the Background Only application template -==================================================== - -RCS: @(#) $Id: Background.doc,v 1.2 1998/09/14 18:40:03 stanton Exp $ - -We have included sample code and project files for making a Background-Only - application (BOA) in Tcl. This could be used for server processes (like the -Tcl Web-Server). - -Files: ------- - -* BOA_TclShells.¼ - This is the project file. -* tclMacBOAAppInit.c - This is the AppInit file for the BOA App. -* tclMacBOAMain - This is a replacement for the Tcl_Main for BOA's. - -Caveat: -------- - -This is an unsupported addition to MacTcl. The main feature that will certainly -change is how we handle AppleEvents. Currently, all the AppleEvent handling is -done on the Tk side, which is not really right. Also, there is no way to -register your own AppleEvent handlers, which is obviously something that would be -useful in a BOA App. We will address these issues in Tcl8.1. If you need to -register your own AppleEvent Handlers in the meantime, be aware that your code -will probably break in Tcl8.1. - -I will also improve the basic code here based on feedback that I recieve. This -is to be considered a first cut only at writing a BOA in Tcl. - -Introduction: -------------- - -This project makes a double-clickable BOA application. It obviously needs -some Tcl code to get it started. It will look for this code first in a -'TEXT' resource in the application shell whose name is "bgScript.tcl". If -it does not find any such resource, it will look for a file called -bgScript.tcl in the application's folder. Otherwise it will quit with an -error. - -It creates three files in the application folder to store stdin, stdout & -stderr. They are imaginatively called temp.in, temp.out & temp.err. They -will be opened append, so you do not need to erase them after each use of -the BOA. - -The app does understand the "quit", and the "doScript" AppleEvents, so you can -kill it with the former, and instruct it with the latter. It also has an -aete, so you can target it with Apple's "Script Editor". - -For more information on Macintosh BOA's, see the Apple TechNote: 1070. - -Notifications: --------------- - -BOA's are not supposed to have direct contact with the outside world. They -are, however, allowed to go through the Notification Manager to post -alerts. To this end, I have added a Tcl command called "bgnotify" to the -shell, that simply posts a notification through the notification manager. - -To use it, say: - -bgnotify "Hi, there little buddy" - -It will make the system beep, and pop up an annoying message box with the -text of the first argument to the command. While the message is up, Tcl -is yielding processor time, but not processing any events. - -Errors: -------- - -Usually a Tcl background application will have some startup code, opening -up a server socket, or whatever, and at the end of this, will use the -vwait command to kick off the event loop. If an error occurs in the -startup code, it will kill the application, and a notification of the error -will be posted through the Notification Manager. - -If an error occurs in the event handling code after the -vwait, the error message will be written to the file temp.err. However, -if you would like to have these errors post a notification as well, just -define a proc called bgerror that takes one argument, the error message, -and passes that off to "bgnotify", thusly: - -proc bgerror {mssg} { - bgnotify "A background error has occured\n $mssg" -} - -Support: --------- - -If you have any questions, contact me at: - -jim.ingham@eng.sun.com diff --git a/mac/MW_TclAppleScriptHeader.pch b/mac/MW_TclAppleScriptHeader.pch deleted file mode 100644 index bf130ab..0000000 --- a/mac/MW_TclAppleScriptHeader.pch +++ /dev/null @@ -1,47 +0,0 @@ -/* - * MW_TclAppleScriptHeader.pch -- - * - * This file is the source for a pre-compilied header that gets used - * for TclAppleScript. This make compilies go a bit - * faster. This file is only intended to be used in the MetroWerks - * CodeWarrior environment. It essentially acts as a place to set - * compiler flags. See MetroWerks documention for more details. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: MW_TclAppleScriptHeader.pch,v 1.3 1998/11/10 16:30:35 rjohnson Exp $ - */ - -/* - * To use the compilied header you need to set the "Prefix file" in - * the "C/C++ Language" preference panel to point to the created - * compilied header. The name of the header depends on the - * architecture we are compiling for (see the code below). For - * example, for a 68k app the prefix file should be: MW_TclHeader68K. - */ - -#if __POWERPC__ -#pragma precompile_target "MW_TclAppleScriptHeaderPPC" -#include "MW_TclHeaderPPC" -#elif __CFM68K__ -#pragma precompile_target "MW_TclAppleScriptHeaderCFM68K" -#include "MW_TclHeaderCFM68K" -#else -#pragma precompile_target "MW_TclAppleScriptHeader68K" -#include "MW_TclHeader68K" -#endif - - -#define TCL_REGISTER_LIBRARY 1 -/* - * Place any includes below that will are needed by the majority of the - * and is OK to be in any file in the system. The pragma's are used - * to control what functions are exported in the Tcl shared library. - */ - -#pragma export on -#pragma export off - diff --git a/mac/MW_TclHeader.pch b/mac/MW_TclHeader.pch deleted file mode 100644 index 4982c3b..0000000 --- a/mac/MW_TclHeader.pch +++ /dev/null @@ -1,47 +0,0 @@ -/* - * MW_TclHeader.pch -- - * - * This file is the source for a pre-compilied header that gets used - * for all files in the Tcl projects. This make compilies go a bit - * faster. This file is only intended to be used in the MetroWerks - * CodeWarrior environment. It essentially acts as a place to set - * compiler flags. See MetroWerks documention for more details. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: MW_TclHeader.pch,v 1.6 1999/04/16 00:47:19 stanton Exp $ - */ - -/* - * To use the compilied header you need to set the "Prefix file" in - * the "C/C++ Language" preference panel to point to the created - * compilied header. The name of the header depends on the - * architecture we are compiling for (see the code below). For - * example, for a 68k app the prefix file should be: MW_TclHeader68K. - */ -#if __POWERPC__ -#pragma precompile_target "MW_TclHeaderPPC" -#elif __CFM68K__ -#pragma precompile_target "MW_TclHeaderCFM68K" -#else -#pragma precompile_target "MW_TclHeader68K" -#endif - -#include "tclMacCommonPch.h" - -/* - * Place any includes below that will are needed by the majority of the - * and is OK to be in any file in the system. The pragma's are used - * to control what functions are exported in the Tcl shared library. - */ - -#pragma export on -#include "tcl.h" -#include "tclMac.h" -#include "tclInt.h" - -#pragma export reset - diff --git a/mac/README b/mac/README deleted file mode 100644 index 8f05bbc..0000000 --- a/mac/README +++ /dev/null @@ -1,176 +0,0 @@ -Tcl 8.1b2 for Macintosh - -by Ray Johnson -Scriptics Corporation -rjohnson@scriptics.com -with major help from -Jim Ingham -Cygnus Solutions -jingham@cygnus.com - -RCS: @(#) $Id: README,v 1.6 1999/04/16 00:47:19 stanton Exp $ - -1. Introduction ---------------- - -This is the README file for the Macintosh version of the Tcl -scripting language. The file consists of information specific -to the Macintosh version of Tcl. For more general information -please read the README file in the main Tcl directory. - -2. What's new? --------------- - -Internationalization! This is the first Tcl release that features -can handle international characters. - -On the Macintosh, the System Encoding is taken from the script of the -Finder Font as set in the Views control panel, or in the Finder -Preferences in OS8.0. - -See the main Tcl README for other features new to Tcl 8. - -3. Mac specific features ------------------------- - -There are several features or enhancements in Tcl that are unique to -the Macintosh version of Tcl. Here is a list of those features and -pointers to where you can find more information about the feature. - -* The "resource" command allows you manipulate Macintosh resources. - A complete man page is available for this command. - -* The Mac version of the "source" command has an option to source from - a Macintosh resource. Check the man page from the source command - for details. - -* The only command NOT available on the Mac is the exec command. - However, we include a Mac only package called Tclapplescript that - provides access to Mac's AppleScript system. This command is still - under design & construction. Documentatin can be found in the "HTML - Docs:tcl8.1" folder in a file called "AppleScript.html". - -* The env variable on the Macintosh works rather differently than on - Windows or UNIX platforms. Check out the tclvars man page for - details. - -* The command "file volumes" returns the available volumes on your - Macintosh. Check out the file command for details. - -* The command "file attributes" has the Mac specific options of - -creator and -type which allow you to query and set the Macintosh - creator and type codes for Mac files. See file man page for details. - -* We have added a template for creating a Background-only Tcl application. - So you can use Tcl as a faceless server process. For more details, see - the file background.doc. - -If you are writing cross platform code but would still like to use -some of these Mac specific commands, please remember to use the -tcl_platform variable to special case your code. - - -4. The Distribution -------------------- - -Macintosh Tcl is distributed in three different forms. This -should make it easier to only download what you need. The -packages are as follows: - -mactk8.1b2.sea.hqx - - This distribution is a "binary" only release. It contains an - installer program that will install a 68k, PowerPC, or Fat - version of the "Tcl Shell" and "Wish" applications. In addition, - it installs the Tcl & Tk libraries in the Extensions folder inside - your System Folder. - -mactcltk-full-8.1b2.sea.hqx - - This release contains the full release of Tcl and Tk for the - Macintosh plus the More Files packages which Macintosh Tcl and Tk - rely on. - -mactcl-source-8.1b2.sea.hqx - - This release contains the complete source for Tcl 8.1. In - addition, Metrowerks CodeWarrior libraries and project files - are included. However, you must already have the More Files - package to compile this code. - -5. Documentation ----------------- - -The "html" subdirectory contains reference documentation in -in the HTML format. You may also find these pages at: - - http://www.scriptics.com/man/tcl8.1/contents.html - -Other documentation and sample Tcl scripts can be found at -the Tcl archive site: - - ftp://ftp.neosoft.com/tcl/ - -and the Tcl resource center: - - http://www.scriptics.com/resource/ - -The internet news group comp.lang.tcl is also a valuable -source of information about Tcl. A mailing list is also -available (see below). - -6. Compiling Tcl ----------------- - -In order to compile Macintosh Tcl you must have the -following items: - - CodeWarrior Pro 2 or 3 - Mac Tcl 8.1 (source) - More Files 1.4.3 - -There are two sets of project files included with the package. The ones -we use for the release are for CodeWarrior Pro 3, and are not compatible -with CodeWarrior Gold release 11 and earlier. We have included the files -for earlier versions of CodeWarrior in the folder tcl8.1:mac:CW11 Projects, -but they are unsupported, and a little out of date. - -As of Tcl8.0p2, the code will also build under CW Pro 2. The only -change that needs to be made is that float.mac.c should be replaced by -float.c in the MacTcl MSL project file. - -However, there seems to be a bug in the CFM68K Linker in CW Pro 2, -which renders the CFM68K Version under CW Pro 2 very unstable. I am -working with MetroWerks to resolve this issue. The PPC version is -fine, as is the Traditional 68K Shell. But if you need to use the -CFM68K, then you must stay with CW Pro 1 for now. - -The project files included with the Mac Tcl source should work -fine. The only thing you may need to update are the access paths. -Unfortunantly, it's somewhat common for the project files to become -slightly corrupted. The most common problem is that the "Prefix file" -found in the "C/C++ Preference" panel is incorrect. This should be -set to MW_TclHeaderPPC, MW_TclHeader68K or MW_TclHeaderCFM68K. - -To build the fat version of TclShell, open the project file "TclShells.¼", -select the "TclShell" target, and build. All of the associated binaries will -be built automoatically. There are also targets for building static 68K -and Power PC builds, for building a CFM 68K build, and for building a -shared library Power PC only build. - -Special notes: - -* There is a small bug in More Files 1.4.3. Also you should not use - MoreFiles 1.4.4 - 1.4.6. Look in the file named morefiles.doc for - more details. - -* You may not have the libmoto library which will cause a compile - error. You don't REALLY need it - it can be removed. Look at the - file libmoto.doc for more details. - -* Check out the file bugs.doc for information about known bugs. - -If you have comments or Bug reports send them to: -Jim Ingham -jingham@cygnus.com - diff --git a/mac/bugs.doc b/mac/bugs.doc deleted file mode 100644 index 3e1efb9..0000000 --- a/mac/bugs.doc +++ /dev/null @@ -1,32 +0,0 @@ -Known bug list for Tcl 8.0 for Macintosh - -by Ray Johnson -Sun Microsystems Laboratories -rjohnson@eng.sun.com - -RCS: @(#) $Id: bugs.doc,v 1.2 1998/09/14 18:40:04 stanton Exp $ - -This was a new feature as of Tcl7.6b1 and as such I'll started with -a clean slate. I currently know of no reproducable bugs. I often -get vague reports - but nothing I've been able to confirm. Let -me know what bugs you find! - -The Macintosh version of Tcl passes most all tests in the Tcl -test suite. Slower Macs may fail some tests in event.test whose -timing constraints are too tight. If other tests fail please report -them. - -Ray - -Known bugs in the current release. - -* With the socket code you can't use the "localhost" host name. This - is actually a known bug in Apple's MacTcp stack. However, you can - use [info hostname] whereever you would have used "localhost" to - achive the same effect. - -* Most socket bugs have been fixed. We do have a couple of test cases - that will hang the Mac, however, and we are still working on them. - If you find additional test cases that show crashes please let us - know! - diff --git a/mac/libmoto.doc b/mac/libmoto.doc deleted file mode 100644 index 2183651..0000000 --- a/mac/libmoto.doc +++ /dev/null @@ -1,39 +0,0 @@ -Notes about the use of libmoto ------------------------------- - -RCS: @(#) $Id: libmoto.doc,v 1.2 1998/09/14 18:40:04 stanton Exp $ - -First of all, libmoto is not required! If you don't have it, you -can simply remove the library reference from the project file and -everything should compile just fine. - -The libmoto library replaces certain functions in the MathLib and -ANSI libraries. Motorola has optimized the functions in the library -to run very fast on the PowerPC. As I said above, you don't need -this library, but it does make things faster. - -Obtaining Libmoto: - - For more information about Libmoto and how to doanload - it, visit the following URL: - - http://www.mot.com/SPS/PowerPC/library/fact_sheet/libmoto.html - - You will need to register for the library. However, the - library is free and you can use it in any commercial product - you might have. - -Installing Libmoto: - - Just follow the instructions provided by the Motorola - README file. You need to make sure that the Libmoto - library is before the ANSI and MathLib libraries in - link order. Also, you will get several warnings stateing - that certain functions have already been defined in - Libmoto. (These can safely be ignored.) - -Finally, you can thank Kate Stewart of Motorola for twisting my -arm at the Tcl/Tk Conference to provide some support for Libmoto. - -Ray Johnson - diff --git a/mac/morefiles.doc b/mac/morefiles.doc deleted file mode 100644 index 58f0929..0000000 --- a/mac/morefiles.doc +++ /dev/null @@ -1,74 +0,0 @@ -Notes about MoreFiles, dnr.c & other non-Tcl source files ---------------------------------------------------------- - -RCS: @(#) $Id: morefiles.doc,v 1.2 1998/09/14 18:40:04 stanton Exp $ - -The Macintosh distribution uses several source files that don't -actually ship with Tcl. This sometimes causes problems or confusion -to developers. This document should help clear up a few things. - -dnr.c ------ - -We have found a way to work around some bugs in dnr.c that -Apple has never fixed even though we sent in numerous bug reports. -The file tclMacDNR.c simply set's some #pragma's and the includes -the Apple dnr.c file. This should work the problems that many of -you have reported with dnr.c. - -More Files ----------- - -Macintosh Tcl/Tk also uses Jim Luther's very useful package called -More Files. More Files fixes many of the broken or underfunctional -parts of the file system. - -More Files can be found on the MetroWerks CD and Developer CD from -Apple. You can also down load the latest version from: - - ftp://members.aol.com/JumpLong/ - -The package can also be found at the home of Tcl/Tk for the mac: - - ftp://ftp.sunlabs.com/pub/tcl/mac/ - -I used to just link the More Files library in the Tcl projects. -However, this caused problems when libraries wern't matched correctly. -I'm now including the files in the Tcl project directly. This -solves the problem of missmatched libraries - but may not always -compile. - -If you get a compiliation error in MoreFiles you need to contact -Jim Luther. His email address: - - JumpLong@aol.com - -The version of More Files that we use with Tcl/Tk is 1.4.3. Early -version may work as well.. - -Unfortunantly, there is one bug in his library (in 1.4.3). The bug is -in the function FSpGetFullPath found in the file FullPath.c. After -the call to PBGetCatInfoSync you need to change the line: - - if ( result == noErr ) - - to: - - if ( (result == noErr) || (result == fnfErr) ) - - -The latest version of More Files is 1.4.6. Unfortunantly, this -version has a bug that keeps it from working with shared libraries -right out of the box. If you want to use 1.4.6 you can but you will -need to make the following fix: - - In the file "Opimization.h" in the More Files package you - need to remove the line "#pragma internal on". And in the - file "OptimazationEnd.h" you need to remove the line - "#pragma internal reset". - -Note: the version of MoreFile downloaded from the Sun Tcl/Tk site -will have the fix included. (If you want you can send email to -Jim Luther suggesting that he use Tcl for regression testing!) - -Ray Johnson diff --git a/mac/porting.notes b/mac/porting.notes deleted file mode 100644 index 5e71969..0000000 --- a/mac/porting.notes +++ /dev/null @@ -1,23 +0,0 @@ -Porting Notes -------------- - -RCS: @(#) $Id: porting.notes,v 1.2 1998/09/14 18:40:04 stanton Exp $ - -Currently, the Macintosh version Tcl only compilies with the -CodeWarrior C compilier from MetroWerks. It should be straight -forward to port the Tcl source to MPW. - -Tcl on the Mac no longer requires the use of GUSI. It should now -be easier to port Tcl/Tk to other compiliers such as Symantic C -and MPW C. - -If you attempt to port Tcl to other Macintosh compiliers please -let me know. I would be glad to help with advice and encouragement. -If your efforts are succesfull I wold also be interested in puting -those changes into the core distribution. Furthermore, please feel -free to send me any notes you might make about your porting -experience so I may include them in this file for others to reference. - -Ray Johnson -ray.johnson@eng.sun.com - diff --git a/mac/tclMac.h b/mac/tclMac.h deleted file mode 100644 index a051cc8..0000000 --- a/mac/tclMac.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * tclMac.h -- - * - * Declarations of Macintosh specific public variables and procedures. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMac.h,v 1.4 1999/03/10 05:52:51 stanton Exp $ - */ - -#ifndef _TCLMAC -#define _TCLMAC - -#ifndef _TCL -# include "tcl.h" -#endif -#include -#include -#include - -/* - * "export" is a MetroWerks specific pragma. It flags the linker that - * any symbols that are defined when this pragma is on will be exported - * to shared libraries that link with this library. - */ - -#pragma export on - -typedef int (*Tcl_MacConvertEventPtr) _ANSI_ARGS_((EventRecord *eventPtr)); - -#include "tclPlatDecls.h" - -#pragma export reset - -#endif /* _TCLMAC */ diff --git a/mac/tclMacAETE.r b/mac/tclMacAETE.r deleted file mode 100644 index be9dd11..0000000 --- a/mac/tclMacAETE.r +++ /dev/null @@ -1,58 +0,0 @@ -/* - * tclMacAETE.r -- - * - * This file creates the Apple Event Terminology resources - * for use Tcl and Tk. It is not used in the Simple Tcl shell - * since SIOUX does not support AppleEvents. An example of its - * use in Tcl is the TclBGOnly project. And it is used in all the - * Tk Shells. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacAETE.r,v 1.2 1998/09/14 18:40:04 stanton Exp $ - */ - -#define SystemSevenOrLater 1 - -#include -#include -#include - -/* - * The following resources defines the Apple Events that Tk can be - * sent from Apple Script. - */ - -resource 'aete' (0, "Wish Suite") { - 0x01, 0x00, english, roman, - { - "Required Suite", - "Events that every application should support", - 'reqd', 1, 1, - {}, - {}, - {}, - {}, - - "Wish Suite", "Events for the Wish application", 'WIsH', 1, 1, - { - "do script", "Execute a Tcl script", 'misc', 'dosc', - 'TEXT', "Result", replyOptional, singleItem, - notEnumerated, reserved, reserved, reserved, reserved, - reserved, reserved, reserved, reserved, reserved, - reserved, reserved, reserved, reserved, - 'TEXT', "Script to execute", directParamRequired, - singleItem, notEnumerated, changesState, reserved, - reserved, reserved, reserved, reserved, reserved, - reserved, reserved, reserved, reserved, reserved, - reserved, - {}, - }, - {}, - {}, - {}, - } -}; diff --git a/mac/tclMacAlloc.c b/mac/tclMacAlloc.c deleted file mode 100644 index 7a8efc4..0000000 --- a/mac/tclMacAlloc.c +++ /dev/null @@ -1,348 +0,0 @@ -/* - * tclMacAlloc.c -- - * - * This is a very fast storage allocator. It allocates blocks of a - * small number of different sizes, and keeps free lists of each size. - * Blocks that don't exactly fit are passed up to the next larger size. - * Blocks over a certain size are directly allocated by calling NewPtr. - * - * Copyright (c) 1983 Regents of the University of California. - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * - * Portions contributed by Chris Kingsley, Jack Jansen and Ray Johnson - *. - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacAlloc.c,v 1.3 1998/09/14 18:40:04 stanton Exp $ - */ - -#include "tclMacInt.h" -#include "tclInt.h" -#include -#include -#include - - -/* - * Flags that are used by ConfigureMemory to define how the allocator - * should work. They can be or'd together. - */ -#define MEMORY_ALL_SYS 1 /* All memory should come from the system -heap. */ - -/* - * Amount of space to leave in the application heap for the Toolbox to work. - */ - -#define TOOLBOX_SPACE (32 * 1024) - -static int memoryFlags = 0; -static Handle toolGuardHandle = NULL; - /* This handle must be around so that we don't - * have NewGWorld failures. This handle is - * purgeable. Before we allocate any blocks, - * we see if this handle is still around. - * If it is not, then we try to get it again. - * If we can get it, we lock it and try - * to do the normal allocation, unlocking on - * the way out. If we can't, we go to the - * system heap directly. */ - - -/* - * The following typedef and variable are used to keep track of memory - * blocks that are allocated directly from the System Heap. These chunks - * of memory must always be freed - even if we crash. - */ - -typedef struct listEl { - Handle memoryHandle; - struct listEl * next; -} ListEl; - -ListEl * systemMemory = NULL; -ListEl * appMemory = NULL; - -/* - * Prototypes for functions used only in this file. - */ - -static pascal void CleanUpExitProc _ANSI_ARGS_((void)); -void ConfigureMemory _ANSI_ARGS_((int flags)); -void FreeAllMemory _ANSI_ARGS_((void)); - -/* - *---------------------------------------------------------------------- - * - * TclpSysRealloc -- - * - * This function reallocates a chunk of system memory. If the - * chunk is already big enough to hold the new block, then no - * allocation happens. - * - * Results: - * Returns a pointer to the newly allocated block. - * - * Side effects: - * May copy the contents of the original block to the new block - * and deallocate the original block. - * - *---------------------------------------------------------------------- - */ - -VOID * -TclpSysRealloc( - VOID *oldPtr, /* Original block */ - unsigned int size) /* New size of block. */ -{ - Handle hand; - void *newPtr; - int maxsize; - - hand = * (Handle *) ((Ptr) oldPtr - sizeof(Handle)); - maxsize = GetHandleSize(hand) - sizeof(Handle); - if (maxsize < size) { - newPtr = TclpSysAlloc(size, 1); - memcpy(newPtr, oldPtr, maxsize); - TclpSysFree(oldPtr); - } else { - newPtr = oldPtr; - } - return newPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclpSysAlloc -- - * - * Allocate a new block of memory free from the System. - * - * Results: - * Returns a pointer to a new block of memory. - * - * Side effects: - * May obtain memory from app or sys space. Info is added to - * overhead lists etc. - * - *---------------------------------------------------------------------- - */ - -VOID * -TclpSysAlloc( - long size, /* Size of block to allocate. */ - int isBin) /* Is this a bin allocation? */ -{ - Handle hand = NULL; - ListEl * newMemoryRecord; - - if (!(memoryFlags & MEMORY_ALL_SYS)) { - - /* - * If the guard handle has been purged, throw it away and try - * to allocate it again. - */ - - if ((toolGuardHandle != NULL) && (*toolGuardHandle == NULL)) { - DisposeHandle(toolGuardHandle); - toolGuardHandle = NULL; - } - - /* - * If we have never allocated the guard handle, or it was purged - * and thrown away, then try to allocate it again. - */ - - if (toolGuardHandle == NULL) { - toolGuardHandle = NewHandle(TOOLBOX_SPACE); - if (toolGuardHandle != NULL) { - HPurge(toolGuardHandle); - } - } - - /* - * If we got the handle, lock it and do our allocation. - */ - - if (toolGuardHandle != NULL) { - HLock(toolGuardHandle); - hand = NewHandle(size + sizeof(Handle)); - HUnlock(toolGuardHandle); - } - } - if (hand != NULL) { - newMemoryRecord = (ListEl *) NewPtr(sizeof(ListEl)); - if (newMemoryRecord == NULL) { - DisposeHandle(hand); - return NULL; - } - newMemoryRecord->memoryHandle = hand; - newMemoryRecord->next = appMemory; - appMemory = newMemoryRecord; - } else { - /* - * Ran out of memory in application space. Lets try to get - * more memory from system. Otherwise, we return NULL to - * denote failure. - */ - isBin = 0; - hand = NewHandleSys(size + sizeof(Handle)); - if (hand == NULL) { - return NULL; - } - if (systemMemory == NULL) { - /* - * This is the first time we've attempted to allocate memory - * directly from the system heap. We need to now install the - * exit handle to ensure the memory is cleaned up. - */ - TclMacInstallExitToShellPatch(CleanUpExitProc); - } - newMemoryRecord = (ListEl *) NewPtrSys(sizeof(ListEl)); - if (newMemoryRecord == NULL) { - DisposeHandle(hand); - return NULL; - } - newMemoryRecord->memoryHandle = hand; - newMemoryRecord->next = systemMemory; - systemMemory = newMemoryRecord; - } - if (isBin) { - HLockHi(hand); - } else { - HLock(hand); - } - (** (Handle **) hand) = hand; - - return (*hand + sizeof(Handle)); -} - -/* - *---------------------------------------------------------------------- - * - * TclpSysFree -- - * - * Free memory that we allocated back to the system. - * - * Results: - * None. - * - * Side effects: - * Memory is freed. - * - *---------------------------------------------------------------------- - */ - -void -TclpSysFree( - void * ptr) /* Free this system memory. */ -{ - Handle hand; - OSErr err; - - hand = * (Handle *) ((Ptr) ptr - sizeof(Handle)); - DisposeHandle(hand); - *hand = NULL; - err = MemError(); -} - -/* - *---------------------------------------------------------------------- - * - * CleanUpExitProc -- - * - * This procedure is invoked as an exit handler when ExitToShell - * is called. It removes any memory that was allocated directly - * from the system heap. This must be called when the application - * quits or the memory will never be freed. - * - * Results: - * None. - * - * Side effects: - * May free memory in the system heap. - * - *---------------------------------------------------------------------- - */ - -static pascal void -CleanUpExitProc() -{ - ListEl * memRecord; - - while (systemMemory != NULL) { - memRecord = systemMemory; - systemMemory = memRecord->next; - if (*(memRecord->memoryHandle) != NULL) { - DisposeHandle(memRecord->memoryHandle); - } - DisposePtr((void *) memRecord); - } -} - -/* - *---------------------------------------------------------------------- - * - * FreeAllMemory -- - * - * This procedure frees all memory blocks allocated by the memory - * sub-system. Make sure you don't have any code that references - * any malloced data! - * - * Results: - * None. - * - * Side effects: - * Frees all memory allocated by TclpAlloc. - * - *---------------------------------------------------------------------- - */ - -void -FreeAllMemory() -{ - ListEl * memRecord; - - while (systemMemory != NULL) { - memRecord = systemMemory; - systemMemory = memRecord->next; - if (*(memRecord->memoryHandle) != NULL) { - DisposeHandle(memRecord->memoryHandle); - } - DisposePtr((void *) memRecord); - } - while (appMemory != NULL) { - memRecord = appMemory; - appMemory = memRecord->next; - if (*(memRecord->memoryHandle) != NULL) { - DisposeHandle(memRecord->memoryHandle); - } - DisposePtr((void *) memRecord); - } -} - -/* - *---------------------------------------------------------------------- - * - * ConfigureMemory -- - * - * This procedure sets certain flags in this file that control - * how memory is allocated and managed. This call must be made - * before any call to TclpAlloc is made. - * - * Results: - * None. - * - * Side effects: - * Certain state will be changed. - * - *---------------------------------------------------------------------- - */ - -void -ConfigureMemory( - int flags) /* Flags that control memory alloc scheme. */ -{ - memoryFlags = flags; -} diff --git a/mac/tclMacAppInit.c b/mac/tclMacAppInit.c deleted file mode 100644 index c4e4746..0000000 --- a/mac/tclMacAppInit.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - * tclMacAppInit.c -- - * - * Provides a version of the Tcl_AppInit procedure for the example shell. - * - * Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacAppInit.c,v 1.5 1999/04/16 00:47:19 stanton Exp $ - */ - -#include "tcl.h" -#include "tclInt.h" -#include "tclPort.h" -#include "tclMac.h" -#include "tclMacInt.h" - -#if defined(THINK_C) -# include -#elif defined(__MWERKS__) -# include -short InstallConsole _ANSI_ARGS_((short fd)); -#endif - -#ifdef TCL_TEST -extern int Procbodytest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -extern int Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); -extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -#endif /* TCL_TEST */ - -/* - * Forward declarations for procedures defined later in this file: - */ - -static int MacintoshInit _ANSI_ARGS_((void)); - -/* - *---------------------------------------------------------------------- - * - * main -- - * - * Main program for tclsh. This file can be used as a prototype - * for other applications using the Tcl library. - * - * Results: - * None. This procedure never returns (it exits the process when - * it's done. - * - * Side effects: - * This procedure initializes the Macintosh world and then - * calls Tcl_Main. Tcl_Main will never return except to exit. - * - *---------------------------------------------------------------------- - */ - -void -main( - int argc, /* Number of arguments. */ - char **argv) /* Array of argument strings. */ -{ - char *newArgv[2]; - - if (MacintoshInit() != TCL_OK) { - Tcl_Exit(1); - } - - argc = 1; - newArgv[0] = "tclsh"; - newArgv[1] = NULL; - Tcl_Main(argc, newArgv, Tcl_AppInit); -} - -/* - *---------------------------------------------------------------------- - * - * 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_TEST - if (Tcltest_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init, - (Tcl_PackageInitProc *) NULL); - if (TclObjTest_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - if (Procbodytest_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - Tcl_StaticPackage(interp, "procbodytest", Procbodytest_Init, - Procbodytest_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. - */ - - /* - * Call Tcl_CreateCommand for application-specific commands, if - * they weren't already created by the init procedures called above. - * Each call would loo like this: - * - * Tcl_CreateCommand(interp, "tclName", CFuncCmd, NULL, NULL); - */ - - /* - * Specify a user-specific startup script to invoke if the application - * is run interactively. On the Mac we can specifiy either a TEXT resource - * which contains the script or the more UNIX like file location - * may also used. (I highly recommend using the resource method.) - */ - - Tcl_SetVar(interp, "tcl_rcRsrcName", "tclshrc", TCL_GLOBAL_ONLY); - /* Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); */ - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * MacintoshInit -- - * - * This procedure calls initalization routines to set up a simple - * console on a Macintosh. This is necessary as the Mac doesn't - * have a stdout & stderr by default. - * - * Results: - * Returns TCL_OK if everything went fine. If it didn't the - * application should probably fail. - * - * Side effects: - * Inits the appropiate console package. - * - *---------------------------------------------------------------------- - */ - -static int -MacintoshInit() -{ -#if GENERATING68K && !GENERATINGCFM - SetApplLimit(GetApplLimit() - (TCL_MAC_68K_STACK_GROWTH)); -#endif - MaxApplZone(); - -#if defined(THINK_C) - - /* Set options for Think C console package */ - /* The console package calls the Mac init calls */ - console_options.pause_atexit = 0; - console_options.title = "\pTcl Interpreter"; - -#elif defined(__MWERKS__) - - /* Set options for CodeWarrior SIOUX package */ - SIOUXSettings.autocloseonquit = true; - SIOUXSettings.showstatusline = true; - SIOUXSettings.asktosaveonclose = false; - InstallConsole(0); - SIOUXSetTitle("\pTcl Interpreter"); - -#elif defined(applec) - - /* Init packages used by MPW SIOW package */ - InitGraf((Ptr)&qd.thePort); - InitFonts(); - InitWindows(); - InitMenus(); - TEInit(); - InitDialogs(nil); - InitCursor(); - -#endif - - Tcl_MacSetEventProc((Tcl_MacConvertEventPtr) SIOUXHandleOneEvent); - - /* No problems with initialization */ - return TCL_OK; -} diff --git a/mac/tclMacApplication.r b/mac/tclMacApplication.r deleted file mode 100644 index 21e013e..0000000 --- a/mac/tclMacApplication.r +++ /dev/null @@ -1,75 +0,0 @@ -/* - * tclMacApplication.r -- - * - * This file creates resources for use Tcl Shell application. - * It should be viewed as an example of how to create a new - * Tcl application using the shared Tcl libraries. - * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacApplication.r,v 1.2 1998/09/14 18:40:04 stanton Exp $ - */ - -#include -#include - -/* - * The folowing include and defines help construct - * the version string for Tcl. - */ - -#define RESOURCE_INCLUDED -#include "tcl.h" - -#if (TCL_RELEASE_LEVEL == 0) -# define RELEASE_LEVEL alpha -#elif (TCL_RELEASE_LEVEL == 1) -# define RELEASE_LEVEL beta -#elif (TCL_RELEASE_LEVEL == 2) -# define RELEASE_LEVEL final -#endif - -#if (TCL_RELEASE_LEVEL == 2) -# define MINOR_VERSION (TCL_MINOR_VERSION * 16) + TCL_RELEASE_SERIAL -#else -# define MINOR_VERSION TCL_MINOR_VERSION * 16 -#endif - -resource 'vers' (1) { - TCL_MAJOR_VERSION, MINOR_VERSION, - RELEASE_LEVEL, 0x00, verUS, - TCL_PATCH_LEVEL, - TCL_PATCH_LEVEL ", by Ray Johnson © Sun Microsystems" -}; - -resource 'vers' (2) { - TCL_MAJOR_VERSION, MINOR_VERSION, - RELEASE_LEVEL, 0x00, verUS, - TCL_PATCH_LEVEL, - "Tcl Shell " TCL_PATCH_LEVEL " © 1996" -}; - -#define TCL_APP_CREATOR 'Tcl ' - -type TCL_APP_CREATOR as 'STR '; -resource TCL_APP_CREATOR (0, purgeable) { - "Tcl Shell " TCL_PATCH_LEVEL " © 1996" -}; - -/* - * The 'kind' resource works with a 'BNDL' in Macintosh Easy Open - * to affect the text the Finder displays in the "kind" column and - * file info dialog. This information will be applied to all files - * with the listed creator and type. - */ - -resource 'kind' (128, "Tcl kind", purgeable) { - TCL_APP_CREATOR, - 0, /* region = USA */ - { - 'APPL', "Tcl Shell", - } -}; diff --git a/mac/tclMacBOAAppInit.c b/mac/tclMacBOAAppInit.c deleted file mode 100644 index 4fc34e8..0000000 --- a/mac/tclMacBOAAppInit.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * tclMacBOAAppInit.c -- - * - * Provides a version of the Tcl_AppInit procedure for a - * Macintosh Background Only Application. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacBOAAppInit.c,v 1.3 1999/04/16 00:47:19 stanton Exp $ - */ - -#include "tcl.h" -#include "tclInt.h" -#include "tclPort.h" -#include "tclMac.h" -#include "tclMacInt.h" -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#if defined(THINK_C) -# include -#elif defined(__MWERKS__) -# include -short InstallConsole _ANSI_ARGS_((short fd)); -#endif - -void TkMacInitAppleEvents(Tcl_Interp *interp); -int HandleHighLevelEvents(EventRecord *eventPtr); - -#ifdef TCL_TEST -EXTERN int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -#endif /* TCL_TEST */ - -/* - * Forward declarations for procedures defined later in this file: - */ - -static int MacintoshInit _ANSI_ARGS_((void)); - -/* - *---------------------------------------------------------------------- - * - * main -- - * - * Main program for tclsh. This file can be used as a prototype - * for other applications using the Tcl library. - * - * Results: - * None. This procedure never returns (it exits the process when - * it's done. - * - * Side effects: - * This procedure initializes the Macintosh world and then - * calls Tcl_Main. Tcl_Main will never return except to exit. - * - *---------------------------------------------------------------------- - */ - -void -main( - int argc, /* Number of arguments. */ - char **argv) /* Array of argument strings. */ -{ - char *newArgv[3]; - - if (MacintoshInit() != TCL_OK) { - Tcl_Exit(1); - } - - argc = 2; - newArgv[0] = "tclsh"; - newArgv[1] = "bgScript.tcl"; - newArgv[2] = NULL; - Tcl_Main(argc, newArgv, Tcl_AppInit); -} - -/* - *---------------------------------------------------------------------- - * - * 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. */ -{ - Tcl_Channel tempChan; - - if (Tcl_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - -#ifdef TCL_TEST - if (Tcltest_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init, - (Tcl_PackageInitProc *) NULL); - if (TclObjTest_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } -#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. - */ - - /* - * Call Tcl_CreateCommand for application-specific commands, if - * they weren't already created by the init procedures called above. - * Each call would loo like this: - * - * Tcl_CreateCommand(interp, "tclName", CFuncCmd, NULL, NULL); - */ - - /* - * Specify a user-specific startup script to invoke if the application - * is run interactively. On the Mac we can specifiy either a TEXT resource - * which contains the script or the more UNIX like file location - * may also used. (I highly recommend using the resource method.) - */ - - Tcl_SetVar(interp, "tcl_rcRsrcName", "tclshrc", TCL_GLOBAL_ONLY); - - /* Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); */ - - /* - * We have to support at least the quit Apple Event. - */ - - TkMacInitAppleEvents(interp); - - /* - * Open a file channel to put stderr, stdin, stdout... - */ - - tempChan = Tcl_OpenFileChannel(interp, ":temp.in", "a+", 0); - Tcl_SetStdChannel(tempChan,TCL_STDIN); - Tcl_RegisterChannel(interp, tempChan); - Tcl_SetChannelOption(NULL, tempChan, "-translation", "cr"); - Tcl_SetChannelOption(NULL, tempChan, "-buffering", "line"); - - tempChan = Tcl_OpenFileChannel(interp, ":temp.out", "a+", 0); - Tcl_SetStdChannel(tempChan,TCL_STDOUT); - Tcl_RegisterChannel(interp, tempChan); - Tcl_SetChannelOption(NULL, tempChan, "-translation", "cr"); - Tcl_SetChannelOption(NULL, tempChan, "-buffering", "line"); - - tempChan = Tcl_OpenFileChannel(interp, ":temp.err", "a+", 0); - Tcl_SetStdChannel(tempChan,TCL_STDERR); - Tcl_RegisterChannel(interp, tempChan); - Tcl_SetChannelOption(NULL, tempChan, "-translation", "cr"); - Tcl_SetChannelOption(NULL, tempChan, "-buffering", "none"); - - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * MacintoshInit -- - * - * This procedure calls initalization routines to set up a simple - * console on a Macintosh. This is necessary as the Mac doesn't - * have a stdout & stderr by default. - * - * Results: - * Returns TCL_OK if everything went fine. If it didn't the - * application should probably fail. - * - * Side effects: - * Inits the appropiate console package. - * - *---------------------------------------------------------------------- - */ - -static int -MacintoshInit() -{ - THz theZone = GetZone(); - SysEnvRec sys; - - - /* - * There is a bug in systems earlier that 7.5.5, where a second BOA will - * get a corrupted heap. This is the fix from TechNote 1070 - */ - - SysEnvirons(1, &sys); - - if (sys.systemVersion < 0x0755) - { - if ( LMGetHeapEnd() != theZone->bkLim) { - LMSetHeapEnd(theZone->bkLim); - } - } - -#if GENERATING68K && !GENERATINGCFM - SetApplLimit(GetApplLimit() - (TCL_MAC_68K_STACK_GROWTH)); -#endif - MaxApplZone(); - - InitGraf((Ptr)&qd.thePort); - - /* No problems with initialization */ - Tcl_MacSetEventProc(HandleHighLevelEvents); - - return TCL_OK; -} - -int -HandleHighLevelEvents( - EventRecord *eventPtr) -{ - int eventFound = false; - - if (eventPtr->what == kHighLevelEvent) { - AEProcessAppleEvent(eventPtr); - eventFound = true; - } else if (eventPtr->what == nullEvent) { - eventFound = true; - } - return eventFound; -} diff --git a/mac/tclMacBOAMain.c b/mac/tclMacBOAMain.c deleted file mode 100644 index d863e9c..0000000 --- a/mac/tclMacBOAMain.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * tclMacBGMain.c -- - * - * Main program for Macintosh Background Only Application shells. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacBOAMain.c,v 1.3 1999/04/16 00:47:19 stanton Exp $ - */ - -#include "tcl.h" -#include "tclInt.h" -#include "tclMacInt.h" -#include -#include -#include - -/* - * This variable is used to get out of the modal loop of the - * notification manager. - */ - -int NotificationIsDone = 0; - -/* - * The following code ensures that tclLink.c is linked whenever - * Tcl is linked. Without this code there's no reference to the - * code in that file from anywhere in Tcl, so it may not be - * linked into the application. - */ - -EXTERN int Tcl_LinkVar(); -int (*tclDummyLinkVarPtr)() = Tcl_LinkVar; - -/* - * Declarations for various library procedures and variables (don't want - * to include tclPort.h here, because people might copy this file out of - * the Tcl source directory to make their own modified versions). - * Note: "exit" should really be declared here, but there's no way to - * declare it without causing conflicts with other definitions elsewher - * on some systems, so it's better just to leave it out. - */ - -extern int isatty _ANSI_ARGS_((int fd)); -extern char * strcpy _ANSI_ARGS_((char *dst, CONST char *src)); - -static Tcl_Interp *interp; /* Interpreter for application. */ - -#ifdef TCL_MEM_DEBUG -static char dumpFile[100]; /* Records where to dump memory allocation - * information. */ -static int quitFlag = 0; /* 1 means "checkmem" command was called, - * so the application should quit and dump - * memory allocation information. */ -#endif - -/* - * Forward references for procedures defined later in this file: - */ - -#ifdef TCL_MEM_DEBUG -static int CheckmemCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char *argv[])); -#endif -void TclMacDoNotification(char *mssg); -void TclMacNotificationResponse(NMRecPtr nmRec); -int Tcl_MacBGNotifyObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); - - -/* - *---------------------------------------------------------------------- - * - * Tcl_Main -- - * - * Main program for tclsh and most other Tcl-based applications. - * - * Results: - * None. This procedure never returns (it exits the process when - * it's done. - * - * Side effects: - * This procedure initializes the Tk world and then starts - * interpreting commands; almost anything could happen, depending - * on the script being interpreted. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_Main(argc, argv, appInitProc) - int argc; /* Number of arguments. */ - char **argv; /* Array of argument strings. */ - Tcl_AppInitProc *appInitProc; - /* Application-specific initialization - * procedure to call after most - * initialization but before starting to - * execute commands. */ -{ - Tcl_Obj *prompt1NamePtr = NULL; - Tcl_Obj *prompt2NamePtr = NULL; - Tcl_Obj *commandPtr = NULL; - char buffer[1000], *args, *fileName; - int code, tty; - int exitCode = 0; - - Tcl_FindExecutable(argv[0]); - interp = Tcl_CreateInterp(); -#ifdef TCL_MEM_DEBUG - Tcl_InitMemory(interp); - Tcl_CreateCommand(interp, "checkmem", CheckmemCmd, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); -#endif - - /* - * Make command-line arguments available in the Tcl variables "argc" - * and "argv". If the first argument doesn't start with a "-" then - * strip it off and use it as the name of a script file to process. - */ - - fileName = NULL; - if ((argc > 1) && (argv[1][0] != '-')) { - fileName = argv[1]; - argc--; - argv++; - } - args = Tcl_Merge(argc-1, argv+1); - Tcl_SetVar(interp, "argv", args, TCL_GLOBAL_ONLY); - ckfree(args); - TclFormatInt(buffer, argc-1); - Tcl_SetVar(interp, "argc", buffer, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "argv0", (fileName != NULL) ? fileName : argv[0], - TCL_GLOBAL_ONLY); - - /* - * Set the "tcl_interactive" variable. - */ - - tty = isatty(0); - Tcl_SetVar(interp, "tcl_interactive", - ((fileName == NULL) && tty) ? "1" : "0", TCL_GLOBAL_ONLY); - - /* - * Invoke application-specific initialization. - */ - - if ((*appInitProc)(interp) != TCL_OK) { - Tcl_DString errStr; - - Tcl_DStringInit(&errStr); - Tcl_DStringAppend(&errStr, - "application-specific initialization failed: \n", -1); - Tcl_DStringAppend(&errStr, Tcl_GetStringResult(interp), -1); - Tcl_DStringAppend(&errStr, "\n", 1); - TclMacDoNotification(Tcl_DStringValue(&errStr)); - Tcl_DStringFree(&errStr); - goto done; - } - - /* - * Install the BGNotify command: - */ - - if ( Tcl_CreateObjCommand(interp, "bgnotify", Tcl_MacBGNotifyObjCmd, NULL, - (Tcl_CmdDeleteProc *) NULL) == NULL) { - goto done; - } - - /* - * If a script file was specified then just source that file - * and quit. In this Mac BG Application version, we will try the - * resource fork first, then the file system second... - */ - - if (fileName != NULL) { - Str255 resName; - Handle resource; - - strcpy((char *) resName + 1, fileName); - resName[0] = strlen(fileName); - resource = GetNamedResource('TEXT',resName); - if (resource != NULL) { - code = Tcl_MacEvalResource(interp, fileName, -1, NULL); - } else { - code = Tcl_EvalFile(interp, fileName); - } - - if (code != TCL_OK) { - Tcl_DString errStr; - - Tcl_DStringInit(&errStr); - Tcl_DStringAppend(&errStr, " Error sourcing resource or file: ", -1); - Tcl_DStringAppend(&errStr, fileName, -1); - Tcl_DStringAppend(&errStr, "\n\nError was: ", -1); - Tcl_DStringAppend(&errStr, Tcl_GetStringResult(interp), -1); - TclMacDoNotification(Tcl_DStringValue(&errStr)); - Tcl_DStringFree(&errStr); - } - goto done; - } - - - /* - * Rather than calling exit, invoke the "exit" command so that - * users can replace "exit" with some other command to do additional - * cleanup on exit. The Tcl_Eval call should never return. - */ - - done: - if (commandPtr != NULL) { - Tcl_DecrRefCount(commandPtr); - } - if (prompt1NamePtr != NULL) { - Tcl_DecrRefCount(prompt1NamePtr); - } - if (prompt2NamePtr != NULL) { - Tcl_DecrRefCount(prompt2NamePtr); - } - sprintf(buffer, "exit %d", exitCode); - Tcl_Eval(interp, buffer); -} - -/*---------------------------------------------------------------------- - * - * TclMacDoNotification -- - * - * This posts an error message using the Notification manager. - * - * Results: - * Post a Notification Manager dialog. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -void -TclMacDoNotification(mssg) - char *mssg; -{ - NMRec errorNot; - EventRecord *theEvent = NULL; - OSErr err; - char *ptr; - - errorNot.qType = nmType; - errorNot.nmMark = 0; - errorNot.nmIcon = 0; - errorNot.nmSound = (Handle) -1; - - for ( ptr = mssg; *ptr != '\0'; ptr++) { - if (*ptr == '\n') { - *ptr = '\r'; - } - } - - c2pstr(mssg); - errorNot.nmStr = (StringPtr) mssg; - - errorNot.nmResp = NewNMProc(TclMacNotificationResponse); - errorNot.nmRefCon = SetCurrentA5(); - - NotificationIsDone = 0; - - /* - * Cycle while waiting for the user to click on the - * notification box. Don't take any events off the event queue, - * since we want Tcl to do this but we want to block till the notification - * has been handled... - */ - - err = NMInstall(&errorNot); - if (err == noErr) { - while (!NotificationIsDone) { - WaitNextEvent(0, theEvent, 20, NULL); - } - NMRemove(&errorNot); - } - - p2cstr((unsigned char *) mssg); -} - -void -TclMacNotificationResponse(nmRec) - NMRecPtr nmRec; -{ - int curA5; - - curA5 = SetCurrentA5(); - SetA5(nmRec->nmRefCon); - - NotificationIsDone = 1; - - SetA5(curA5); - -} - -int -Tcl_MacBGNotifyObjCmd(clientData, interp, objc, objv) - ClientData clientData; - Tcl_Interp *interp; - int objc; - Tcl_Obj **objv; -{ - Tcl_Obj *resultPtr; - - resultPtr = Tcl_GetObjResult(interp); - - if ( objc != 2 ) { - Tcl_WrongNumArgs(interp, 1, objv, "message"); - return TCL_ERROR; - } - - TclMacDoNotification(Tcl_GetString(objv[1])); - return TCL_OK; - -} - - -/* - *---------------------------------------------------------------------- - * - * CheckmemCmd -- - * - * This is the command procedure for the "checkmem" command, which - * causes the application to exit after printing information about - * memory usage to the file passed to this command as its first - * argument. - * - * Results: - * Returns a standard Tcl completion code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -#ifdef TCL_MEM_DEBUG - - /* ARGSUSED */ -static int -CheckmemCmd(clientData, interp, argc, argv) - ClientData clientData; /* Not used. */ - Tcl_Interp *interp; /* Interpreter for evaluation. */ - int argc; /* Number of arguments. */ - char *argv[]; /* String values of arguments. */ -{ - extern char *tclMemDumpFileName; - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " fileName\"", (char *) NULL); - return TCL_ERROR; - } - strcpy(dumpFile, argv[1]); - tclMemDumpFileName = dumpFile; - quitFlag = 1; - return TCL_OK; -} -#endif diff --git a/mac/tclMacChan.c b/mac/tclMacChan.c deleted file mode 100644 index 2fbac8f..0000000 --- a/mac/tclMacChan.c +++ /dev/null @@ -1,1394 +0,0 @@ -/* - * tclMacChan.c - * - * Channel drivers for Macintosh channels for the - * console fds. - * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacChan.c,v 1.6 1999/04/16 00:47:19 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclMacInt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * The following are flags returned by GetOpenMode. They - * are or'd together to determine how opening and handling - * a file should occur. - */ - -#define TCL_RDONLY (1<<0) -#define TCL_WRONLY (1<<1) -#define TCL_RDWR (1<<2) -#define TCL_CREAT (1<<3) -#define TCL_TRUNC (1<<4) -#define TCL_APPEND (1<<5) -#define TCL_ALWAYS_APPEND (1<<6) -#define TCL_EXCL (1<<7) -#define TCL_NOCTTY (1<<8) -#define TCL_NONBLOCK (1<<9) -#define TCL_RW_MODES (TCL_RDONLY|TCL_WRONLY|TCL_RDWR) - -/* - * This structure describes per-instance state of a - * macintosh file based channel. - */ - -typedef struct FileState { - short fileRef; /* Macintosh file reference number. */ - Tcl_Channel fileChan; /* Pointer to the channel for this file. */ - int watchMask; /* OR'ed set of flags indicating which events - * are being watched. */ - int appendMode; /* Flag to tell if in O_APPEND mode or not. */ - int volumeRef; /* Flag to tell if in O_APPEND mode or not. */ - int pending; /* 1 if message is pending on queue. */ - struct FileState *nextPtr; /* Pointer to next registered file. */ -} FileState; - -typedef struct ThreadSpecificData { - int initialized; /* True after the thread initializes */ - FileState *firstFilePtr; /* the head of the list of files managed - * that are being watched for file events. */ - Tcl_Channel stdinChannel; - Tcl_Channel stdoutChannel; /* Note - these seem unused */ - Tcl_Channel stderrChannel; -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - -/* - * The following structure is what is added to the Tcl event queue when - * file events are generated. - */ - -typedef struct FileEvent { - Tcl_Event header; /* Information that is standard for - * all events. */ - FileState *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 CommonGetHandle _ANSI_ARGS_((ClientData instanceData, - int direction, ClientData *handlePtr)); -static void CommonWatch _ANSI_ARGS_((ClientData instanceData, - int mask)); -static int FileBlockMode _ANSI_ARGS_((ClientData instanceData, - int mode)); -static void FileChannelExitHandler _ANSI_ARGS_(( - ClientData clientData)); -static void FileCheckProc _ANSI_ARGS_((ClientData clientData, - int flags)); -static int FileClose _ANSI_ARGS_((ClientData instanceData, - Tcl_Interp *interp)); -static int FileEventProc _ANSI_ARGS_((Tcl_Event *evPtr, - int flags)); -static ThreadSpecificData *FileInit _ANSI_ARGS_((void)); -static int FileInput _ANSI_ARGS_((ClientData instanceData, - char *buf, int toRead, int *errorCode)); -static int FileOutput _ANSI_ARGS_((ClientData instanceData, - char *buf, int toWrite, int *errorCode)); -static int FileSeek _ANSI_ARGS_((ClientData instanceData, - long offset, int mode, int *errorCode)); -static void FileSetupProc _ANSI_ARGS_((ClientData clientData, - int flags)); -static int GetOpenMode _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *string)); -static Tcl_Channel OpenFileChannel _ANSI_ARGS_((CONST char *fileName, - int mode, int permissions, int *errorCodePtr)); -static int StdIOBlockMode _ANSI_ARGS_((ClientData instanceData, - int mode)); -static int StdIOClose _ANSI_ARGS_((ClientData instanceData, - Tcl_Interp *interp)); -static int StdIOInput _ANSI_ARGS_((ClientData instanceData, - char *buf, int toRead, int *errorCode)); -static int StdIOOutput _ANSI_ARGS_((ClientData instanceData, - char *buf, int toWrite, int *errorCode)); -static int StdIOSeek _ANSI_ARGS_((ClientData instanceData, - long offset, int mode, int *errorCode)); -static int StdReady _ANSI_ARGS_((ClientData instanceData, - int mask)); - -/* - * This structure describes the channel type structure for file based IO: - */ - -static Tcl_ChannelType consoleChannelType = { - "file", /* Type name. */ - StdIOBlockMode, /* Set blocking/nonblocking mode.*/ - StdIOClose, /* Close proc. */ - StdIOInput, /* Input proc. */ - StdIOOutput, /* Output proc. */ - StdIOSeek, /* Seek proc. */ - NULL, /* Set option proc. */ - NULL, /* Get option proc. */ - CommonWatch, /* Initialize notifier. */ - CommonGetHandle /* Get OS handles out of channel. */ -}; - -/* - * This variable describes the channel type structure for file based IO. - */ - -static Tcl_ChannelType fileChannelType = { - "file", /* Type name. */ - FileBlockMode, /* Set blocking or - * non-blocking mode.*/ - FileClose, /* Close proc. */ - FileInput, /* Input proc. */ - FileOutput, /* Output proc. */ - FileSeek, /* Seek proc. */ - NULL, /* Set option proc. */ - NULL, /* Get option proc. */ - CommonWatch, /* Initialize notifier. */ - CommonGetHandle /* Get OS handles out of channel. */ -}; - - -/* - * Hack to allow Mac Tk to override the TclGetStdChannels function. - */ - -typedef void (*TclGetStdChannelsProc) _ANSI_ARGS_((Tcl_Channel *stdinPtr, - Tcl_Channel *stdoutPtr, Tcl_Channel *stderrPtr)); - -TclGetStdChannelsProc getStdChannelsProc = NULL; - - -/* - *---------------------------------------------------------------------- - * - * FileInit -- - * - * This function initializes the file channel event source. - * - * Results: - * None. - * - * Side effects: - * Creates a new event source. - * - *---------------------------------------------------------------------- - */ - -static ThreadSpecificData * -FileInit() -{ - 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( - ClientData clientData) /* Old window proc */ -{ - Tcl_DeleteEventSource(FileSetupProc, FileCheckProc, NULL); -} - -/* - *---------------------------------------------------------------------- - * - * FileSetupProc -- - * - * This procedure is invoked before Tcl_DoOneEvent blocks waiting - * for an event. - * - * Results: - * None. - * - * Side effects: - * Adjusts the block time if needed. - * - *---------------------------------------------------------------------- - */ - -void -FileSetupProc( - ClientData data, /* Not used. */ - int flags) /* Event flags as passed to Tcl_DoOneEvent. */ -{ - FileState *infoPtr; - Tcl_Time blockTime = { 0, 0 }; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (!(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 procedure is called by Tcl_DoOneEvent to check the file - * event source for events. - * - * Results: - * None. - * - * Side effects: - * May queue an event. - * - *---------------------------------------------------------------------- - */ - -static void -FileCheckProc( - ClientData data, /* Not used. */ - int flags) /* Event flags as passed to Tcl_DoOneEvent. */ -{ - FileEvent *evPtr; - FileState *infoPtr; - int sentMsg = 0; - Tcl_Time blockTime = { 0, 0 }; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (!(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 && !infoPtr->pending) { - infoPtr->pending = 1; - evPtr = (FileEvent *) ckalloc(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 procedure 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; - FileState *infoPtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (!(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) { - infoPtr->pending = 0; - Tcl_NotifyChannel(infoPtr->fileChan, infoPtr->watchMask); - break; - } - } - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * StdIOBlockMode -- - * - * 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 -StdIOBlockMode( - ClientData instanceData, /* Unused. */ - int mode) /* The mode to set. */ -{ - /* - * Do not allow putting stdin, stdout or stderr into nonblocking mode. - */ - - if (mode == TCL_MODE_NONBLOCKING) { - return EFAULT; - } - - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * StdIOClose -- - * - * Closes the IO channel. - * - * Results: - * 0 if successful, the value of errno if failed. - * - * Side effects: - * Closes the physical channel - * - *---------------------------------------------------------------------- - */ - -static int -StdIOClose( - ClientData instanceData, /* Unused. */ - Tcl_Interp *interp) /* Unused. */ -{ - int fd, errorCode = 0; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * Invalidate the stdio cache if necessary. Note that we assume that - * the stdio file and channel pointers will become invalid at the same - * time. - * Do not close standard channels while in thread-exit. - */ - - fd = (int) ((FileState*)instanceData)->fileRef; - if (!TclInExit()) { - if (fd == 0) { - tsdPtr->stdinChannel = NULL; - } else if (fd == 1) { - tsdPtr->stdoutChannel = NULL; - } else if (fd == 2) { - tsdPtr->stderrChannel = NULL; - } else { - panic("recieved invalid std file"); - } - - if (close(fd) < 0) { - errorCode = errno; - } - } - return errorCode; -} - -/* - *---------------------------------------------------------------------- - * - * CommonGetHandle -- - * - * Called from Tcl_GetChannelHandle to retrieve OS handles from inside - * a file based channel. - * - * Results: - * The appropriate handle or NULL if not present. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -CommonGetHandle( - ClientData instanceData, /* The file state. */ - int direction, /* Which handle to retrieve? */ - ClientData *handlePtr) -{ - if ((direction == TCL_READABLE) || (direction == TCL_WRITABLE)) { - *handlePtr = (ClientData) ((FileState*)instanceData)->fileRef; - return TCL_OK; - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * StdIOInput -- - * - * 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. - * - *---------------------------------------------------------------------- - */ - -int -StdIOInput( - ClientData instanceData, /* Unused. */ - char *buf, /* Where to store data read. */ - int bufSize, /* How much space is available - * in the buffer? */ - int *errorCode) /* Where to store error code. */ -{ - int fd; - int bytesRead; /* How many bytes were read? */ - - *errorCode = 0; - errno = 0; - fd = (int) ((FileState*)instanceData)->fileRef; - bytesRead = read(fd, buf, (size_t) bufSize); - if (bytesRead > -1) { - return bytesRead; - } - *errorCode = errno; - return -1; -} - -/* - *---------------------------------------------------------------------- - * - * StdIOOutput-- - * - * 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 -StdIOOutput( - ClientData instanceData, /* Unused. */ - char *buf, /* The data buffer. */ - int toWrite, /* How many bytes to write? */ - int *errorCode) /* Where to store error code. */ -{ - int written; - int fd; - - *errorCode = 0; - errno = 0; - fd = (int) ((FileState*)instanceData)->fileRef; - written = write(fd, buf, (size_t) toWrite); - if (written > -1) { - return written; - } - *errorCode = errno; - return -1; -} - -/* - *---------------------------------------------------------------------- - * - * StdIOSeek -- - * - * Seeks on an IO 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 int -StdIOSeek( - ClientData instanceData, /* Unused. */ - long offset, /* Offset to seek to. */ - int mode, /* Relative to where - * should we seek? */ - int *errorCodePtr) /* To store error code. */ -{ - int newLoc; - int fd; - - *errorCodePtr = 0; - fd = (int) ((FileState*)instanceData)->fileRef; - newLoc = lseek(fd, offset, mode); - if (newLoc > -1) { - return newLoc; - } - *errorCodePtr = errno; - return -1; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_PidObjCmd -- - * - * This procedure 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. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tcl_PidObjCmd(dummy, interp, objc, objv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST *objv; /* Argument strings. */ -{ - ProcessSerialNumber psn; - char buf[20]; - Tcl_Channel chan; - Tcl_Obj *resultPtr; - - if (objc > 2) { - Tcl_WrongNumArgs(interp, 1, objv, "?channelId?"); - return TCL_ERROR; - } - if (objc == 1) { - resultPtr = Tcl_GetObjResult(interp); - GetCurrentProcess(&psn); - sprintf(buf, "0x%08x%08x", psn.highLongOfPSN, psn.lowLongOfPSN); - Tcl_SetStringObj(resultPtr, buf, -1); - } else { - chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), - NULL); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - /* - * We can't create pipelines on the Mac so - * this will always return an empty list. - */ - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * 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, TCL_STDERR. */ -{ - Tcl_Channel channel = NULL; - int fd = 0; /* Initializations needed to prevent */ - int mode = 0; /* compiler warning (used before set). */ - char *bufMode = NULL; - char channelName[16 + TCL_INTEGER_SPACE]; - int channelPermissions; - FileState *fileState; - - /* - * If the channels were not created yet, create them now and - * store them in the static variables. - */ - - switch (type) { - case TCL_STDIN: - fd = 0; - channelPermissions = TCL_READABLE; - bufMode = "line"; - break; - case TCL_STDOUT: - fd = 1; - channelPermissions = TCL_WRITABLE; - bufMode = "line"; - break; - case TCL_STDERR: - fd = 2; - channelPermissions = TCL_WRITABLE; - bufMode = "none"; - break; - default: - panic("TclGetDefaultStdChannel: Unexpected channel type"); - break; - } - - sprintf(channelName, "console%d", (int) fd); - fileState = (FileState *) ckalloc((unsigned) sizeof(FileState)); - channel = Tcl_CreateChannel(&consoleChannelType, channelName, - (ClientData) fileState, channelPermissions); - fileState->fileChan = channel; - fileState->fileRef = fd; - - /* - * Set up the normal channel options for stdio handles. - */ - - Tcl_SetChannelOption(NULL, channel, "-translation", "cr"); - Tcl_SetChannelOption(NULL, channel, "-buffering", bufMode); - - return channel; -} - -/* - *---------------------------------------------------------------------- - * - * 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. */ - char *fileName, /* Name of file to open. */ - char *modeString, /* A list of POSIX open modes or - * a string such as "rw". */ - int permissions) /* If the open involves creating a - * file, with what modes to create - * it? */ -{ - Tcl_Channel chan; - int mode; - char *native; - Tcl_DString ds, buffer; - int errorCode; - - mode = GetOpenMode(interp, modeString); - if (mode == -1) { - return NULL; - } - - if (Tcl_TranslateFileName(interp, fileName, &buffer) == NULL) { - return NULL; - } - native = Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&buffer), - Tcl_DStringLength(&buffer), &ds); - chan = OpenFileChannel(native, mode, permissions, &errorCode); - Tcl_DStringFree(&ds); - Tcl_DStringFree(&buffer); - - if (chan == NULL) { - Tcl_SetErrno(errorCode); - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "couldn't open \"", fileName, "\": ", - Tcl_PosixError(interp), (char *) NULL); - } - return NULL; - } - - return chan; -} - -/* - *---------------------------------------------------------------------- - * - * OpenFileChannel-- - * - * Opens a Macintosh file and creates a Tcl channel to control it. - * - * Results: - * A Tcl channel. - * - * Side effects: - * Will open a Macintosh file. - * - *---------------------------------------------------------------------- - */ - -static Tcl_Channel -OpenFileChannel( - CONST char *fileName, /* Name of file to open (native). */ - int mode, /* Mode for opening file. */ - int permissions, /* If the open involves creating a - * file, with what modes to create - * it? */ - int *errorCodePtr) /* Where to store error code. */ -{ - int channelPermissions; - Tcl_Channel chan; - char macPermision; - FSSpec fileSpec; - OSErr err; - short fileRef; - FileState *fileState; - char channelName[16 + TCL_INTEGER_SPACE]; - - /* - * Note we use fsRdWrShPerm instead of fsRdWrPerm which allows shared - * writes on a file. This isn't common on a mac but is common with - * Windows and UNIX and the feature is used by Tcl. - */ - - switch (mode & (TCL_RDONLY | TCL_WRONLY | TCL_RDWR)) { - case TCL_RDWR: - channelPermissions = (TCL_READABLE | TCL_WRITABLE); - macPermision = fsRdWrShPerm; - break; - case TCL_WRONLY: - /* - * Mac's fsRdPerm permission actually defaults to fsRdWrPerm because - * the Mac OS doesn't realy support write only access. We explicitly - * set the permission fsRdWrShPerm so that we can have shared write - * access. - */ - channelPermissions = TCL_WRITABLE; - macPermision = fsRdWrShPerm; - break; - case TCL_RDONLY: - default: - channelPermissions = TCL_READABLE; - macPermision = fsRdPerm; - break; - } - - err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); - if ((err != noErr) && (err != fnfErr)) { - *errorCodePtr = errno = TclMacOSErrorToPosixError(err); - Tcl_SetErrno(errno); - return NULL; - } - - if ((err == fnfErr) && (mode & TCL_CREAT)) { - err = HCreate(fileSpec.vRefNum, fileSpec.parID, fileSpec.name, 'MPW ', 'TEXT'); - if (err != noErr) { - *errorCodePtr = errno = TclMacOSErrorToPosixError(err); - Tcl_SetErrno(errno); - return NULL; - } - } else if ((mode & TCL_CREAT) && (mode & TCL_EXCL)) { - *errorCodePtr = errno = EEXIST; - Tcl_SetErrno(errno); - return NULL; - } - - err = HOpenDF(fileSpec.vRefNum, fileSpec.parID, fileSpec.name, macPermision, &fileRef); - if (err != noErr) { - *errorCodePtr = errno = TclMacOSErrorToPosixError(err); - Tcl_SetErrno(errno); - return NULL; - } - - if (mode & TCL_TRUNC) { - SetEOF(fileRef, 0); - } - - sprintf(channelName, "file%d", (int) fileRef); - fileState = (FileState *) ckalloc((unsigned) sizeof(FileState)); - chan = Tcl_CreateChannel(&fileChannelType, channelName, - (ClientData) fileState, channelPermissions); - if (chan == (Tcl_Channel) NULL) { - *errorCodePtr = errno = EFAULT; - Tcl_SetErrno(errno); - FSClose(fileRef); - ckfree((char *) fileState); - return NULL; - } - - fileState->fileChan = chan; - fileState->volumeRef = fileSpec.vRefNum; - fileState->fileRef = fileRef; - fileState->pending = 0; - fileState->watchMask = 0; - if (mode & TCL_ALWAYS_APPEND) { - fileState->appendMode = true; - } else { - fileState->appendMode = false; - } - - if ((mode & TCL_ALWAYS_APPEND) || (mode & TCL_APPEND)) { - if (Tcl_Seek(chan, 0, SEEK_END) < 0) { - *errorCodePtr = errno = EFAULT; - Tcl_SetErrno(errno); - Tcl_Close(NULL, chan); - FSClose(fileRef); - ckfree((char *) fileState); - return NULL; - } - } - - return chan; -} - -/* - *---------------------------------------------------------------------- - * - * 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(handle, mode) - ClientData handle; /* OS level handle. */ - int mode; /* ORed combination of TCL_READABLE and - * TCL_WRITABLE to indicate file mode. */ -{ - /* - * Not implemented yet. - */ - - return NULL; -} - -/* - *---------------------------------------------------------------------- - * - * FileBlockMode -- - * - * Set blocking or non-blocking mode on channel. Macintosh files - * can never really be set to blocking or non-blocking modes. - * However, we don't generate an error - we just return success. - * - * Results: - * 0 if successful, errno when failed. - * - * Side effects: - * Sets the device into blocking or non-blocking mode. - * - *---------------------------------------------------------------------- - */ - -static int -FileBlockMode( - ClientData instanceData, /* Unused. */ - int mode) /* The mode to set. */ -{ - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * FileClose -- - * - * Closes the IO channel. - * - * Results: - * 0 if successful, the value of errno if failed. - * - * Side effects: - * Closes the physical channel - * - *---------------------------------------------------------------------- - */ - -static int -FileClose( - ClientData instanceData, /* Unused. */ - Tcl_Interp *interp) /* Unused. */ -{ - FileState *fileState = (FileState *) instanceData; - int errorCode = 0; - OSErr err; - - err = FSClose(fileState->fileRef); - FlushVol(NULL, fileState->volumeRef); - if (err != noErr) { - errorCode = errno = TclMacOSErrorToPosixError(err); - panic("error during file close"); - } - - ckfree((char *) fileState); - Tcl_SetErrno(errorCode); - return errorCode; -} - -/* - *---------------------------------------------------------------------- - * - * FileInput -- - * - * 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. - * - *---------------------------------------------------------------------- - */ - -int -FileInput( - ClientData instanceData, /* Unused. */ - char *buffer, /* Where to store data read. */ - int bufSize, /* How much space is available - * in the buffer? */ - int *errorCodePtr) /* Where to store error code. */ -{ - FileState *fileState = (FileState *) instanceData; - OSErr err; - long length = bufSize; - - *errorCodePtr = 0; - errno = 0; - err = FSRead(fileState->fileRef, &length, buffer); - if ((err == noErr) || (err == eofErr)) { - return length; - } else { - switch (err) { - case ioErr: - *errorCodePtr = errno = EIO; - case afpAccessDenied: - *errorCodePtr = errno = EACCES; - default: - *errorCodePtr = errno = EINVAL; - } - return -1; - } - *errorCodePtr = errno; - return -1; -} - -/* - *---------------------------------------------------------------------- - * - * FileOutput-- - * - * 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 -FileOutput( - ClientData instanceData, /* Unused. */ - char *buffer, /* The data buffer. */ - int toWrite, /* How many bytes to write? */ - int *errorCodePtr) /* Where to store error code. */ -{ - FileState *fileState = (FileState *) instanceData; - long length = toWrite; - OSErr err; - - *errorCodePtr = 0; - errno = 0; - - if (fileState->appendMode == true) { - FileSeek(instanceData, 0, SEEK_END, errorCodePtr); - *errorCodePtr = 0; - } - - err = FSWrite(fileState->fileRef, &length, buffer); - if (err == noErr) { - err = FlushFile(fileState->fileRef); - } else { - *errorCodePtr = errno = TclMacOSErrorToPosixError(err); - return -1; - } - return length; -} - -/* - *---------------------------------------------------------------------- - * - * FileSeek -- - * - * Seeks on an IO 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 int -FileSeek( - ClientData instanceData, /* Unused. */ - long offset, /* Offset to seek to. */ - int mode, /* Relative to where - * should we seek? */ - int *errorCodePtr) /* To store error code. */ -{ - FileState *fileState = (FileState *) instanceData; - IOParam pb; - OSErr err; - - *errorCodePtr = 0; - pb.ioCompletion = NULL; - pb.ioRefNum = fileState->fileRef; - if (mode == SEEK_SET) { - pb.ioPosMode = fsFromStart; - } else if (mode == SEEK_END) { - pb.ioPosMode = fsFromLEOF; - } else if (mode == SEEK_CUR) { - err = PBGetFPosSync((ParmBlkPtr) &pb); - if (pb.ioResult == noErr) { - if (offset == 0) { - return pb.ioPosOffset; - } - offset += pb.ioPosOffset; - } - pb.ioPosMode = fsFromStart; - } - pb.ioPosOffset = offset; - err = PBSetFPosSync((ParmBlkPtr) &pb); - if (pb.ioResult == noErr){ - return pb.ioPosOffset; - } else if (pb.ioResult == eofErr) { - long currentEOF, newEOF; - long buffer, i, length; - - err = PBGetEOFSync((ParmBlkPtr) &pb); - currentEOF = (long) pb.ioMisc; - if (mode == SEEK_SET) { - newEOF = offset; - } else if (mode == SEEK_END) { - newEOF = offset + currentEOF; - } else if (mode == SEEK_CUR) { - err = PBGetFPosSync((ParmBlkPtr) &pb); - newEOF = offset + pb.ioPosOffset; - } - - /* - * Write 0's to the new EOF. - */ - pb.ioPosOffset = 0; - pb.ioPosMode = fsFromLEOF; - err = PBGetFPosSync((ParmBlkPtr) &pb); - length = 1; - buffer = 0; - for (i = 0; i < (newEOF - currentEOF); i++) { - err = FSWrite(fileState->fileRef, &length, &buffer); - } - err = PBGetFPosSync((ParmBlkPtr) &pb); - if (pb.ioResult == noErr){ - return pb.ioPosOffset; - } - } - *errorCodePtr = errno = TclMacOSErrorToPosixError(err); - return -1; -} - -/* - *---------------------------------------------------------------------- - * - * CommonWatch -- - * - * Initialize the notifier to watch handles from this channel. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -CommonWatch( - ClientData instanceData, /* The file state. */ - int mask) /* Events of interest; an OR-ed - * combination of TCL_READABLE, - * TCL_WRITABLE and TCL_EXCEPTION. */ -{ - FileState **nextPtrPtr, *ptr; - FileState *infoPtr = (FileState *) instanceData; - int oldMask = infoPtr->watchMask; - ThreadSpecificData *tsdPtr; - - tsdPtr = FileInit(); - - infoPtr->watchMask = mask; - if (infoPtr->watchMask) { - if (!oldMask) { - infoPtr->nextPtr = tsdPtr->firstFilePtr; - tsdPtr->firstFilePtr = infoPtr; - } - } else { - if (oldMask) { - /* - * Remove the file from the list of watched files. - */ - - for (nextPtrPtr = &(tsdPtr->firstFilePtr), ptr = *nextPtrPtr; - ptr != NULL; - nextPtrPtr = &ptr->nextPtr, ptr = *nextPtrPtr) { - if (infoPtr == ptr) { - *nextPtrPtr = ptr->nextPtr; - break; - } - } - } - } -} - -/* - *---------------------------------------------------------------------- - * - * GetOpenMode -- - * - * Description: - * Computes a POSIX mode mask from a given string and also sets - * a flag to indicate whether the caller should seek to EOF during - * opening of the file. - * - * Results: - * On success, returns mode to pass to "open". If an error occurs, the - * returns -1 and if interp is not NULL, sets the interp's result to an - * error message. - * - * Side effects: - * Sets the integer referenced by seekFlagPtr to 1 if the caller - * should seek to EOF during opening the file. - * - * Special note: - * This code is based on a prototype implementation contributed - * by Mark Diekhans. - * - *---------------------------------------------------------------------- - */ - -static int -GetOpenMode( - Tcl_Interp *interp, /* Interpreter to use for error - * reporting - may be NULL. */ - CONST char *string) /* Mode string, e.g. "r+" or - * "RDONLY CREAT". */ -{ - int mode, modeArgc, c, i, gotRW; - char **modeArgv, *flag; - - /* - * Check for the simpler fopen-like access modes (e.g. "r"). They - * are distinguished from the POSIX access modes by the presence - * of a lower-case first letter. - */ - - mode = 0; - /* - * Guard against international characters before using byte oriented - * routines. - */ - - if (!(string[0] & 0x80) - && islower(UCHAR(string[0]))) { /* INTL: ISO only. */ - switch (string[0]) { - case 'r': - mode = TCL_RDONLY; - break; - case 'w': - mode = TCL_WRONLY|TCL_CREAT|TCL_TRUNC; - break; - case 'a': - mode = TCL_WRONLY|TCL_CREAT|TCL_APPEND; - break; - default: - error: - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, - "illegal access mode \"", string, "\"", - (char *) NULL); - } - return -1; - } - if (string[1] == '+') { - mode &= ~(TCL_RDONLY|TCL_WRONLY); - mode |= TCL_RDWR; - if (string[2] != 0) { - goto error; - } - } else if (string[1] != 0) { - goto error; - } - return mode; - } - - /* - * The access modes are specified using a list of POSIX modes - * such as TCL_CREAT. - */ - - if (Tcl_SplitList(interp, string, &modeArgc, &modeArgv) != TCL_OK) { - if (interp != (Tcl_Interp *) NULL) { - Tcl_AddErrorInfo(interp, - "\n while processing open access modes \""); - Tcl_AddErrorInfo(interp, string); - Tcl_AddErrorInfo(interp, "\""); - } - return -1; - } - - gotRW = 0; - for (i = 0; i < modeArgc; i++) { - flag = modeArgv[i]; - c = flag[0]; - if ((c == 'R') && (strcmp(flag, "RDONLY") == 0)) { - mode = (mode & ~TCL_RW_MODES) | TCL_RDONLY; - gotRW = 1; - } else if ((c == 'W') && (strcmp(flag, "WRONLY") == 0)) { - mode = (mode & ~TCL_RW_MODES) | TCL_WRONLY; - gotRW = 1; - } else if ((c == 'R') && (strcmp(flag, "RDWR") == 0)) { - mode = (mode & ~TCL_RW_MODES) | TCL_RDWR; - gotRW = 1; - } else if ((c == 'A') && (strcmp(flag, "APPEND") == 0)) { - mode |= TCL_ALWAYS_APPEND; - } else if ((c == 'C') && (strcmp(flag, "CREAT") == 0)) { - mode |= TCL_CREAT; - } else if ((c == 'E') && (strcmp(flag, "EXCL") == 0)) { - mode |= TCL_EXCL; - } else if ((c == 'N') && (strcmp(flag, "NOCTTY") == 0)) { - mode |= TCL_NOCTTY; - } else if ((c == 'N') && (strcmp(flag, "NONBLOCK") == 0)) { - mode |= TCL_NONBLOCK; - } else if ((c == 'T') && (strcmp(flag, "TRUNC") == 0)) { - mode |= TCL_TRUNC; - } else { - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "invalid access mode \"", flag, - "\": must be RDONLY, WRONLY, RDWR, APPEND, CREAT", - " EXCL, NOCTTY, NONBLOCK, or TRUNC", (char *) NULL); - } - ckfree((char *) modeArgv); - return -1; - } - } - ckfree((char *) modeArgv); - if (!gotRW) { - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "access mode must include either", - " RDONLY, WRONLY, or RDWR", (char *) NULL); - } - return -1; - } - return mode; -} diff --git a/mac/tclMacCommonPch.h b/mac/tclMacCommonPch.h deleted file mode 100755 index b06a494..0000000 --- a/mac/tclMacCommonPch.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * tclMacCommonPch.h -- - * - * Macintosh Tcl must be compiled with certain compiler options to - * ensure that it will work correctly. The following pragmas are - * used to ensure that those options are set correctly. An error - * will occur at compile time if they are not set correctly. - * - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacCommonPch.h,v 1.2 1998/11/11 07:46:04 jingham Exp $ - */ - -#if !__option(enumsalwaysint) -#error Tcl requires the Metrowerks setting "Enums always ints". -#endif - - -#if !defined(__POWERPC__) -#if !__option(far_data) -#error Tcl requires the Metrowerks setting "Far data". -#endif -#endif - - -#if !defined(__POWERPC__) -#if !__option(fourbyteints) -#error Tcl requires the Metrowerks setting "4 byte ints". -#endif -#endif - - -#if !defined(__POWERPC__) -#if !__option(IEEEdoubles) -#error Tcl requires the Metrowerks setting "8 byte doubles". -#endif -#endif - - -/* -* The define is used most everywhere to tell Tcl (or any Tcl -* extensions) that we are compiling for the Macintosh platform. -*/ - - -#define MAC_TCL - - -/* -* The following defines control the behavior of the Macintosh -* Universial Headers. -*/ - - -#define SystemSevenOrLater 1 -#define STRICT_CONTROLS 1 -#define STRICT_WINDOWS 1 - - -/* -* Define the following symbol if you want -* comprehensive debugging turned on. -*/ - - -/* #define TCL_DEBUG */ - - -#ifdef TCL_DEBUG -# define TCL_MEM_DEBUG -# define TCL_TEST -#endif - - - -/* -* For a while, we will continue to use the old routine names, so that -* people with older versions of CodeWarrior will still be able to compile -* the source (albeit they will have to update the project files themselves). -* -* At some point, we will convert over to the new routine names. -*/ - - -#define OLDROUTINENAMES 1 diff --git a/mac/tclMacDNR.c b/mac/tclMacDNR.c deleted file mode 100644 index fa7058b..0000000 --- a/mac/tclMacDNR.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * tclMacDNR.c - * - * This file actually just includes the file "dnr.c" provided by - * Apple Computer and redistributed by MetroWerks (and other compiler - * vendors.) Unfortunantly, despite various bug reports, dnr.c uses - * C++ style comments and will not compile under the "ANSI Strict" - * mode that the rest of Tcl compiles under. Furthermore, the Apple - * license prohibits me from redistributing a corrected version of - * dnr.c. This file uses a pragma to turn off the Strict ANSI option - * and then includes the dnr.c file. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacDNR.c,v 1.2 1998/09/14 18:40:04 stanton Exp $ - */ - -#pragma ANSI_strict off -#include -#pragma ANSI_strict reset diff --git a/mac/tclMacEnv.c b/mac/tclMacEnv.c deleted file mode 100644 index 8f6b58f..0000000 --- a/mac/tclMacEnv.c +++ /dev/null @@ -1,536 +0,0 @@ -/* - * tclMacEnv.c -- - * - * Implements the "environment" on a Macintosh. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacEnv.c,v 1.2 1998/09/14 18:40:04 stanton Exp $ - */ - -#include -#include -#include -#include -#include - -#include "tcl.h" -#include "tclInt.h" -#include "tclMacInt.h" -#include "tclPort.h" - -#define kMaxEnvStringSize 255 -#define kMaxEnvVarSize 100 -#define kLoginnameTag "LOGIN=" -#define kUsernameTag "USER=" -#define kDefaultDirTag "HOME=" - -/* - * The following specifies a text file where additional environment variables - * can be set. The file must reside in the preferences folder. If the file - * doesn't exist NO error will occur. Commet out the difinition if you do - * NOT want to use an environment variables file. - */ -#define kPrefsFile "Tcl Environment Variables" - -/* - * The following specifies the Name of a 'STR#' resource in the application - * where additional environment variables may be set. If the resource doesn't - * exist no errors will occur. Commet it out if you don't want it. - */ -#define REZ_ENV "\pTcl Environment Variables" - -/* Globals */ -char **environ = NULL; - -/* - * Declarations for local procedures defined in this file: - */ -static char ** RezRCVariables _ANSI_ARGS_((void)); -static char ** FileRCVariables _ANSI_ARGS_((void)); -static char ** PathVariables _ANSI_ARGS_((void)); -static char ** SystemVariables _ANSI_ARGS_((void)); -static char * MakeFolderEnvVar _ANSI_ARGS_((char * prefixTag, - long whichFolder)); -static char * GetUserName _ANSI_ARGS_((void)); - -/* - *---------------------------------------------------------------------- - * - * RezRCVariables -- - * - * Creates environment variables from the applications resource fork. - * The function looks for the 'STR#' resource with the name defined - * in the #define REZ_ENV. If the define is not defined this code - * will not be included. If the resource doesn't exist or no strings - * reside in the resource nothing will happen. - * - * Results: - * ptr to value on success, NULL if error. - * - * Side effects: - * Memory is allocated and returned to the caller. - * - *---------------------------------------------------------------------- - */ - -#ifdef REZ_ENV -static char ** -RezRCVariables() -{ - Handle envStrs = NULL; - char** rezEnv = NULL; - short int numStrs; - - envStrs = GetNamedResource('STR#', REZ_ENV); - if (envStrs == NULL) return NULL; - numStrs = *((short *) (*envStrs)); - - rezEnv = (char **) ckalloc((numStrs + 1) * sizeof(char *)); - - if (envStrs != NULL) { - ResType theType; - Str255 theName; - short theID, index = 1; - int i = 0; - char* string; - - GetResInfo(envStrs, &theID, &theType, theName); - for(;;) { - GetIndString(theName, theID, index++); - if (theName[0] == '\0') break; - string = (char *) ckalloc(theName[0] + 2); - strncpy(string, (char *) theName + 1, theName[0]); - string[theName[0]] = '\0'; - rezEnv[i++] = string; - } - ReleaseResource(envStrs); - - rezEnv[i] = NULL; - return rezEnv; - } - - return NULL; -} -#endif - -/* - *---------------------------------------------------------------------- - * - * FileRCVariables -- - * - * Creates environment variables from a file in the system preferences - * folder. The function looks for a file in the preferences folder - * a name defined in the #define kPrefsFile. If the define is not - * defined this code will not be included. If the resource doesn't exist or - * no strings reside in the resource nothing will happen. - * - * Results: - * ptr to value on success, NULL if error. - * - * Side effects: - * Memory is allocated and returned to the caller. - * - *---------------------------------------------------------------------- - */ - -#ifdef kPrefsFile -static char ** -FileRCVariables() -{ - char *prefsFolder = NULL; - char *tempPtr = NULL; - char **fileEnv = NULL; - FILE *thePrefsFile = NULL; - int i; - FSSpec prefDir; - OSErr err; - Handle theString = NULL; - Tcl_Channel chan; - int size; - Tcl_DString lineRead; - - err = FSpFindFolder(kOnSystemDisk, kPreferencesFolderType, - kDontCreateFolder, &prefDir); - if (err != noErr) { - return NULL; - } - err = FSpPathFromLocation(&prefDir, &size, &theString); - if (err != noErr) { - return NULL; - } - (void) Munger(theString, size, NULL, 0, kPrefsFile, strlen(kPrefsFile)); - - HLock(theString); - chan = Tcl_OpenFileChannel(NULL, *theString, "r", 0); - HUnlock(theString); - DisposeHandle(theString); - if (chan == NULL) { - return NULL; - } - - /* - * We found a env file. Let start parsing it. - */ - fileEnv = (char **) ckalloc((kMaxEnvVarSize + 1) * sizeof(char *)); - - i = 0; - Tcl_DStringInit(&lineRead); - while (Tcl_Gets(chan, &lineRead) != -1) { - /* - * First strip off new line char - */ - if (lineRead.string[lineRead.length-1] == '\n') { - lineRead.string[lineRead.length-1] = '\0'; - } - if (lineRead.string[0] == '\0' || lineRead.string[0] == '#') { - /* - * skip empty lines or commented lines - */ - Tcl_DStringSetLength(&lineRead, 0); - continue; - } - - tempPtr = (char *) ckalloc(lineRead.length + 1); - strcpy(tempPtr, lineRead.string); - fileEnv[i++] = tempPtr; - Tcl_DStringSetLength(&lineRead, 0); - } - - fileEnv[i] = NULL; - Tcl_Close(NULL, chan); - Tcl_DStringFree(&lineRead); - - return fileEnv; -} -#endif - -/* - *---------------------------------------------------------------------- - * - * MakeFolderEnvVar -- - * - * This function creates "environment" variable by taking a prefix and - * appending a folder path to a directory. The directory is specified - * by a integer value acceptable by the FindFolder function. - * - * Results: - * The function returns an *allocated* string. If the folder doesn't - * exist the return string is still allocated and just contains the - * given prefix. - * - * Side effects: - * Memory is allocated and returned to the caller. - * - *---------------------------------------------------------------------- - */ - -static char * -MakeFolderEnvVar( - char * prefixTag, /* Prefix added before result. */ - long whichFolder) /* Constant for FSpFindFolder. */ -{ - char * thePath = NULL; - char * result = NULL; - OSErr theErr = noErr; - Handle theString = NULL; - FSSpec theFolder; - int size; - Tcl_DString pathStr; - Tcl_DString tagPathStr; - - Tcl_DStringInit(&pathStr); - theErr = FSpFindFolder(kOnSystemDisk, whichFolder, - kDontCreateFolder, &theFolder); - if (theErr == noErr) { - theErr = FSpPathFromLocation(&theFolder, &size, &theString); - - HLock(theString); - tclPlatform = TCL_PLATFORM_MAC; - Tcl_DStringAppend(&pathStr, *theString, -1); - HUnlock(theString); - DisposeHandle(theString); - - Tcl_DStringInit(&tagPathStr); - Tcl_DStringAppend(&tagPathStr, prefixTag, strlen(prefixTag)); - Tcl_DStringAppend(&tagPathStr, pathStr.string, pathStr.length); - Tcl_DStringFree(&pathStr); - - /* - * Make sure the path ends with a ':' - */ - if (tagPathStr.string[tagPathStr.length - 1] != ':') { - Tcl_DStringAppend(&tagPathStr, ":", 1); - } - - /* - * Don't free tagPathStr - rather make sure it's allocated - * and return it as the result. - */ - if (tagPathStr.string == tagPathStr.staticSpace) { - result = (char *) ckalloc(tagPathStr.length + 1); - strcpy(result, tagPathStr.string); - } else { - result = tagPathStr.string; - } - } else { - result = (char *) ckalloc(strlen(prefixTag) + 1); - strcpy(result, prefixTag); - } - - return result; -} - -/* - *---------------------------------------------------------------------- - * - * PathVariables -- - * - * Creates environment variables from the system call FSpFindFolder. - * The function generates environment variables for many of the - * commonly used paths on the Macintosh. - * - * Results: - * ptr to value on success, NULL if error. - * - * Side effects: - * Memory is allocated and returned to the caller. - * - *---------------------------------------------------------------------- - */ - -static char ** -PathVariables() -{ - int i = 0; - char **sysEnv; - char *thePath = NULL; - - sysEnv = (char **) ckalloc((12) * sizeof(char *)); - - sysEnv[i++] = MakeFolderEnvVar("PREF_FOLDER=", kPreferencesFolderType); - sysEnv[i++] = MakeFolderEnvVar("SYS_FOLDER=", kSystemFolderType); - sysEnv[i++] = MakeFolderEnvVar("TEMP=", kTemporaryFolderType); - sysEnv[i++] = MakeFolderEnvVar("APPLE_M_FOLDER=", kAppleMenuFolderType); - sysEnv[i++] = MakeFolderEnvVar("CP_FOLDER=", kControlPanelFolderType); - sysEnv[i++] = MakeFolderEnvVar("DESK_FOLDER=", kDesktopFolderType); - sysEnv[i++] = MakeFolderEnvVar("EXT_FOLDER=", kExtensionFolderType); - sysEnv[i++] = MakeFolderEnvVar("PRINT_MON_FOLDER=", - kPrintMonitorDocsFolderType); - sysEnv[i++] = MakeFolderEnvVar("SHARED_TRASH_FOLDER=", - kWhereToEmptyTrashFolderType); - sysEnv[i++] = MakeFolderEnvVar("TRASH_FOLDER=", kTrashFolderType); - sysEnv[i++] = MakeFolderEnvVar("START_UP_FOLDER=", kStartupFolderType); - sysEnv[i++] = NULL; - - return sysEnv; -} - -/* - *---------------------------------------------------------------------- - * - * SystemVariables -- - * - * Creates environment variables from various Mac system calls. - * - * Results: - * ptr to value on success, NULL if error. - * - * Side effects: - * Memory is allocated and returned to the caller. - * - *---------------------------------------------------------------------- - */ - -static char ** -SystemVariables() -{ - int i = 0; - char ** sysEnv; - char * thePath = NULL; - Handle theString = NULL; - FSSpec currentDir; - int size; - - sysEnv = (char **) ckalloc((4) * sizeof(char *)); - - /* - * Get user name from chooser. It will be assigned to both - * the USER and LOGIN environment variables. - */ - thePath = GetUserName(); - if (thePath != NULL) { - sysEnv[i] = (char *) ckalloc(strlen(kLoginnameTag) + strlen(thePath) + 1); - strcpy(sysEnv[i], kLoginnameTag); - strcpy(sysEnv[i]+strlen(kLoginnameTag), thePath); - i++; - sysEnv[i] = (char *) ckalloc(strlen(kUsernameTag) + strlen(thePath) + 1); - strcpy(sysEnv[i], kUsernameTag); - strcpy(sysEnv[i]+strlen(kUsernameTag), thePath); - i++; - } - - /* - * Get 'home' directory - */ -#ifdef kDefaultDirTag - FSpGetDefaultDir(¤tDir); - FSpPathFromLocation(¤tDir, &size, &theString); - HLock(theString); - sysEnv[i] = (char *) ckalloc(strlen(kDefaultDirTag) + size + 4); - strcpy(sysEnv[i], kDefaultDirTag); - strncpy(sysEnv[i]+strlen(kDefaultDirTag) , *theString, size); - if (sysEnv[i][strlen(kDefaultDirTag) + size - 1] != ':') { - sysEnv[i][strlen(kDefaultDirTag) + size] = ':'; - sysEnv[i][strlen(kDefaultDirTag) + size + 1] = '\0'; - } else { - sysEnv[i][strlen(kDefaultDirTag) + size] = '\0'; - } - HUnlock(theString); - DisposeHandle(theString); - i++; -#endif - - sysEnv[i++] = NULL; - return sysEnv; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacCreateEnv -- - * - * This function allocates and populates the global "environ" - * variable. Entries are in traditional Unix format but variables - * are, hopefully, a bit more relevant for the Macintosh. - * - * Results: - * The number of elements in the newly created environ array. - * - * Side effects: - * Memory is allocated and pointed too by the environ variable. - * - *---------------------------------------------------------------------- - */ - -int -TclMacCreateEnv() -{ - char ** sysEnv = NULL; - char ** pathEnv = NULL; - char ** fileEnv = NULL; - char ** rezEnv = NULL; - int count = 0; - int i, j; - - sysEnv = SystemVariables(); - if (sysEnv != NULL) { - for (i = 0; sysEnv[i] != NULL; count++, i++) { - /* Empty Loop */ - } - } - - pathEnv = PathVariables(); - if (pathEnv != NULL) { - for (i = 0; pathEnv[i] != NULL; count++, i++) { - /* Empty Loop */ - } - } - -#ifdef kPrefsFile - fileEnv = FileRCVariables(); - if (fileEnv != NULL) { - for (i = 0; fileEnv[i] != NULL; count++, i++) { - /* Empty Loop */ - } - } -#endif - -#ifdef REZ_ENV - rezEnv = RezRCVariables(); - if (rezEnv != NULL) { - for (i = 0; rezEnv[i] != NULL; count++, i++) { - /* Empty Loop */ - } - } -#endif - - /* - * Create environ variable - */ - environ = (char **) ckalloc((count + 1) * sizeof(char *)); - j = 0; - - if (sysEnv != NULL) { - for (i = 0; sysEnv[i] != NULL;) - environ[j++] = sysEnv[i++]; - ckfree((char *) sysEnv); - } - - if (pathEnv != NULL) { - for (i = 0; pathEnv[i] != NULL;) - environ[j++] = pathEnv[i++]; - ckfree((char *) pathEnv); - } - -#ifdef kPrefsFile - if (fileEnv != NULL) { - for (i = 0; fileEnv[i] != NULL;) - environ[j++] = fileEnv[i++]; - ckfree((char *) fileEnv); - } -#endif - -#ifdef REZ_ENV - if (rezEnv != NULL) { - for (i = 0; rezEnv[i] != NULL;) - environ[j++] = rezEnv[i++]; - ckfree((char *) rezEnv); - } -#endif - - environ[j] = NULL; - return j; -} - -/* - *---------------------------------------------------------------------- - * - * GetUserName -- - * - * Get the user login name. - * - * Results: - * ptr to static string, NULL if error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static char * -GetUserName() -{ - static char buf[33]; - short refnum; - Handle h; - - refnum = CurResFile(); - UseResFile(0); - h = GetResource('STR ', -16096); - UseResFile(refnum); - if (h == NULL) { - return NULL; - } - - HLock(h); - strncpy(buf, (*h)+1, **h); - buf[**h] = '\0'; - HUnlock(h); - ReleaseResource(h); - return(buf[0] ? buf : NULL); -} diff --git a/mac/tclMacExit.c b/mac/tclMacExit.c deleted file mode 100644 index 347ff4e..0000000 --- a/mac/tclMacExit.c +++ /dev/null @@ -1,333 +0,0 @@ -/* - * tclMacExit.c -- - * - * This file contains routines that deal with cleaning up various state - * when Tcl/Tk applications quit. Unfortunantly, not all state is cleaned - * up by the process when an application quites or crashes. Also you - * need to do different things depending on wether you are running as - * 68k code, PowerPC, or a code resource. The Exit handler code was - * adapted from code posted on alt.sources.mac by Dave Nebinger. - * - * Copyright (c) 1995 Dave Nebinger. - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacExit.c,v 1.4 1999/04/16 00:47:19 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclMacInt.h" -#include -#include -#include - -/* - * Various typedefs and defines needed to patch ExitToShell. - */ - -enum { - uppExitToShellProcInfo = kPascalStackBased -}; - -#if GENERATINGCFM -typedef UniversalProcPtr ExitToShellUPP; - -#define CallExitToShellProc(userRoutine) \ - CallUniversalProc((UniversalProcPtr)(userRoutine),uppExitToShellProcInfo) -#define NewExitToShellProc(userRoutine) \ - (ExitToShellUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), \ - uppExitToShellProcInfo, GetCurrentArchitecture()) - -#else -typedef ExitToShellProcPtr ExitToShellUPP; - -#define CallExitToShellProc(userRoutine) \ - (*(userRoutine))() -#define NewExitToShellProc(userRoutine) \ - (ExitToShellUPP)(userRoutine) -#endif - -#define DisposeExitToShellProc(userRoutine) \ - DisposeRoutineDescriptor(userRoutine) - -#if defined(powerc)||defined(__powerc) -#pragma options align=mac68k -#endif -struct ExitToShellUPPList{ - struct ExitToShellUPPList* nextProc; - ExitToShellUPP userProc; -}; -#if defined(powerc)||defined(__powerc) -#pragma options align=reset -#endif - -typedef struct ExitToShellDataStruct ExitToShellDataRec,* ExitToShellDataPtr,** ExitToShellDataHdl; - -typedef struct ExitToShellUPPList ExitToShellUPPList,* ExitToShellUPPListPtr,** ExitToShellUPPHdl; - -#if defined(powerc)||defined(__powerc) -#pragma options align=mac68k -#endif -struct ExitToShellDataStruct{ - unsigned long a5; - ExitToShellUPPList* userProcs; - ExitToShellUPP oldProc; -}; -#if defined(powerc)||defined(__powerc) -#pragma options align=reset -#endif - -/* - * Static globals used within this file. - */ -static ExitToShellDataPtr gExitToShellData = (ExitToShellDataPtr) NULL; - - -/* - *---------------------------------------------------------------------- - * - * TclPlatformExit -- - * - * This procedure implements the Macintosh specific exit routine. - * We explicitly callthe ExitHandler function to do various clean - * up. - * - * Results: - * None. - * - * Side effects: - * We exit the process. - * - *---------------------------------------------------------------------- - */ - -void -TclpExit( - int status) /* Ignored. */ -{ - TclMacExitHandler(); - -/* - * If we are using the Metrowerks Standard Library, then we will call its exit so that it - * will get a chance to clean up temp files, and so forth. It always calls the standard - * ExitToShell, so the Tcl handlers will also get called. - * - * If you have another exit, make sure that it does not patch ExitToShell, and does - * call it. If so, it will probably work as well. - * - */ - -#ifdef __MSL__ - exit(status); -#else - ExitToShell(); -#endif - -} - -/* - *---------------------------------------------------------------------- - * - * TclMacExitHandler -- - * - * This procedure is invoked after Tcl at the last possible moment - * to clean up any state Tcl has left around that may cause other - * applications to crash. For example, this function can be used - * as the termination routine for CFM applications. - * - * Results: - * None. - * - * Side effects: - * Various cleanup occurs. - * - *---------------------------------------------------------------------- - */ - -void -TclMacExitHandler() -{ - ExitToShellUPPListPtr curProc; - - /* - * Loop through all installed Exit handlers - * and call them. Always make sure we are in - * a clean state in case we are recursivly called. - */ - if ((gExitToShellData) != NULL && (gExitToShellData->userProcs != NULL)){ - - /* - * Call the installed exit to shell routines. - */ - curProc = gExitToShellData->userProcs; - do { - gExitToShellData->userProcs = curProc->nextProc; - CallExitToShellProc(curProc->userProc); - DisposeExitToShellProc(curProc->userProc); - DisposePtr((Ptr) curProc); - curProc = gExitToShellData->userProcs; - } while (curProc != (ExitToShellUPPListPtr) NULL); - } - - return; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacInstallExitToShellPatch -- - * - * This procedure installs a way to clean up state at the latest - * possible moment before we exit. These are things that must - * be cleaned up or the system will crash. The exact way in which - * this is implemented depends on the architecture in which we are - * running. For 68k applications we patch the ExitToShell call. - * For PowerPC applications we just create a list of procs to call. - * The function ExitHandler should be installed in the Code - * Fragments terminiation routine. - * - * Results: - * None. - * - * Side effects: - * Installs the new routine. - * - *---------------------------------------------------------------------- - */ - -OSErr -TclMacInstallExitToShellPatch( - ExitToShellProcPtr newProc) /* Function pointer. */ -{ - ExitToShellUPP exitHandler; - ExitToShellUPPListPtr listPtr; - - if (gExitToShellData == (ExitToShellDataPtr) NULL){ - TclMacInitExitToShell(true); - } - - /* - * Add the passed in function pointer to the list of functions - * to be called when ExitToShell is called. - */ - exitHandler = NewExitToShellProc(newProc); - listPtr = (ExitToShellUPPListPtr) NewPtrClear(sizeof(ExitToShellUPPList)); - listPtr->userProc = exitHandler; - listPtr->nextProc = gExitToShellData->userProcs; - gExitToShellData->userProcs = listPtr; - - return noErr; -} - -/* - *---------------------------------------------------------------------- - * - * ExitToShellPatchRoutine -- - * - * This procedure is invoked when someone calls ExitToShell for - * this application. This function performs some last miniute - * clean up and then calls the real ExitToShell routine. - * - * Results: - * None. - * - * Side effects: - * Various cleanup occurs. - * - *---------------------------------------------------------------------- - */ - -static pascal void -ExitToShellPatchRoutine() -{ - ExitToShellUPP oldETS; - long oldA5; - - /* - * Set up our A5 world. This allows us to have - * access to our global variables in the 68k world. - */ - oldA5 = SetCurrentA5(); - SetA5(gExitToShellData->a5); - - /* - * Call the function that invokes all - * of the handlers. - */ - TclMacExitHandler(); - - /* - * Call the origional ExitToShell routine. - */ - oldETS = gExitToShellData->oldProc; - DisposePtr((Ptr) gExitToShellData); - SetA5(oldA5); - CallExitToShellProc(oldETS); - return; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacInitExitToShell -- - * - * This procedure initializes the ExitToShell clean up machanism. - * Generally, this is handled automatically when users make a call - * to InstallExitToShellPatch. However, it can be called - * explicitly at startup time to turn off the patching mechanism. - * This can be used by code resources which could be removed from - * the application before ExitToShell is called. - * - * Note, if we are running from CFM code we never install the - * patch. Instead, the function ExitHandler should be installed - * as the terminiation routine for the code fragment. - * - * Results: - * None. - * - * Side effects: - * Creates global state. - * - *---------------------------------------------------------------------- - */ - -void -TclMacInitExitToShell( - int usePatch) /* True if on 68k. */ -{ - if (gExitToShellData == (ExitToShellDataPtr) NULL){ -#if GENERATINGCFM - gExitToShellData = (ExitToShellDataPtr) - NewPtr(sizeof(ExitToShellDataRec)); - gExitToShellData->a5 = SetCurrentA5(); - gExitToShellData->userProcs = (ExitToShellUPPList*) NULL; -#else - ExitToShellUPP oldExitToShell, newExitToShellPatch; - short exitToShellTrap; - - /* - * Initialize patch mechanism. - */ - - gExitToShellData = (ExitToShellDataPtr) NewPtr(sizeof(ExitToShellDataRec)); - gExitToShellData->a5 = SetCurrentA5(); - gExitToShellData->userProcs = (ExitToShellUPPList*) NULL; - - /* - * Save state needed to call origional ExitToShell routine. Install - * the new ExitToShell code in it's place. - */ - if (usePatch) { - exitToShellTrap = _ExitToShell & 0x3ff; - newExitToShellPatch = NewExitToShellProc(ExitToShellPatchRoutine); - oldExitToShell = (ExitToShellUPP) - NGetTrapAddress(exitToShellTrap, ToolTrap); - NSetTrapAddress((UniversalProcPtr) newExitToShellPatch, - exitToShellTrap, ToolTrap); - gExitToShellData->oldProc = oldExitToShell; - } -#endif - } -} diff --git a/mac/tclMacFCmd.c b/mac/tclMacFCmd.c deleted file mode 100644 index 716237e..0000000 --- a/mac/tclMacFCmd.c +++ /dev/null @@ -1,1535 +0,0 @@ -/* - * tclMacFCmd.c -- - * - * Implements the Macintosh specific portions of the file manipulation - * subcommands of the "file" command. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacFCmd.c,v 1.4 1999/04/16 00:47:20 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclMac.h" -#include "tclMacInt.h" -#include "tclPort.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Callback for the file attributes code. - */ - -static int GetFileFinderAttributes _ANSI_ARGS_((Tcl_Interp *interp, - int objIndex, CONST char *fileName, - Tcl_Obj **attributePtrPtr)); -static int GetFileReadOnly _ANSI_ARGS_((Tcl_Interp *interp, - int objIndex, CONST char *fileName, - Tcl_Obj **readOnlyPtrPtr)); -static int SetFileFinderAttributes _ANSI_ARGS_((Tcl_Interp *interp, - int objIndex, CONST char *fileName, - Tcl_Obj *attributePtr)); -static int SetFileReadOnly _ANSI_ARGS_((Tcl_Interp *interp, - int objIndex, CONST char *fileName, - Tcl_Obj *readOnlyPtr)); - -/* - * These are indeces into the tclpFileAttrsStrings table below. - */ - -#define MAC_CREATOR_ATTRIBUTE 0 -#define MAC_HIDDEN_ATTRIBUTE 1 -#define MAC_READONLY_ATTRIBUTE 2 -#define MAC_TYPE_ATTRIBUTE 3 - -/* - * Global variables for the file attributes code. - */ - -char *tclpFileAttrStrings[] = {"-creator", "-hidden", "-readonly", - "-type", (char *) NULL}; -CONST TclFileAttrProcs tclpFileAttrProcs[] = { - {GetFileFinderAttributes, SetFileFinderAttributes}, - {GetFileFinderAttributes, SetFileFinderAttributes}, - {GetFileReadOnly, SetFileReadOnly}, - {GetFileFinderAttributes, SetFileFinderAttributes}}; - - -/* - * Prototypes for procedure only used in this file - */ - -static pascal Boolean CopyErrHandler _ANSI_ARGS_((OSErr error, - short failedOperation, - short srcVRefNum, long srcDirID, - StringPtr srcName, short dstVRefNum, - long dstDirID,StringPtr dstName)); -static int DoCopyDirectory _ANSI_ARGS_((CONST char *src, - CONST char *dst, Tcl_DString *errorPtr)); -static int DoCopyFile _ANSI_ARGS_((CONST char *src, - CONST char *dst)); -static int DoCreateDirectory _ANSI_ARGS_((CONST char *path)); -static int DoDeleteFile _ANSI_ARGS_((CONST char *path)); -static int DoRemoveDirectory _ANSI_ARGS_((CONST char *path, - int recursive, Tcl_DString *errorPtr)); -static int DoRenameFile _ANSI_ARGS_((CONST char *src, - CONST char *dst)); -OSErr FSpGetFLockCompat _ANSI_ARGS_((const FSSpec *specPtr, - Boolean *lockedPtr)); -static OSErr GenerateUniqueName _ANSI_ARGS_((short vRefNum, - long dirID1, long dirID2, Str31 uniqueName)); -static OSErr GetFileSpecs _ANSI_ARGS_((CONST char *path, - FSSpec *pathSpecPtr, FSSpec *dirSpecPtr, - Boolean *pathExistsPtr, - Boolean *pathIsDirectoryPtr)); -static OSErr MoveRename _ANSI_ARGS_((const FSSpec *srcSpecPtr, - const FSSpec *dstSpecPtr, StringPtr copyName)); -static int Pstrequal _ANSI_ARGS_((ConstStr255Param stringA, - ConstStr255Param stringB)); - -/* - *--------------------------------------------------------------------------- - * - * TclpRenameFile, 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. 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 -TclpRenameFile( - CONST char *src, /* Pathname of file or dir to be renamed - * (UTF-8). */ - CONST char *dst) /* New pathname of file or directory - * (UTF-8). */ -{ - int result; - Tcl_DString srcString, dstString; - - Tcl_UtfToExternalDString(NULL, src, -1, &srcString); - Tcl_UtfToExternalDString(NULL, dst, -1, &dstString); - result = DoRenameFile(Tcl_DStringValue(&srcString), - Tcl_DStringValue(&dstString)); - Tcl_DStringFree(&srcString); - Tcl_DStringFree(&dstString); - return result; -} - -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). */ -{ - FSSpec srcFileSpec, dstFileSpec, dstDirSpec; - OSErr err; - long srcID, dummy; - Boolean srcIsDirectory, dstIsDirectory, dstExists, dstLocked; - - err = FSpLocationFromPath(strlen(src), src, &srcFileSpec); - if (err == noErr) { - FSpGetDirectoryID(&srcFileSpec, &srcID, &srcIsDirectory); - } - if (err == noErr) { - err = GetFileSpecs(dst, &dstFileSpec, &dstDirSpec, &dstExists, - &dstIsDirectory); - } - if (err == noErr) { - if (dstExists == 0) { - err = MoveRename(&srcFileSpec, &dstDirSpec, dstFileSpec.name); - goto end; - } - err = FSpGetFLockCompat(&dstFileSpec, &dstLocked); - if (dstLocked) { - FSpRstFLockCompat(&dstFileSpec); - } - } - if (err == noErr) { - if (srcIsDirectory) { - if (dstIsDirectory) { - /* - * The following call will remove an empty directory. If it - * fails, it's because it wasn't empty. - */ - - if (DoRemoveDirectory(dst, 0, NULL) != TCL_OK) { - return TCL_ERROR; - } - - /* - * Now that that empty directory is gone, we can try - * renaming src. If that fails, we'll put this empty - * directory back, for completeness. - */ - - err = MoveRename(&srcFileSpec, &dstDirSpec, dstFileSpec.name); - if (err != noErr) { - FSpDirCreateCompat(&dstFileSpec, smSystemScript, &dummy); - if (dstLocked) { - FSpSetFLockCompat(&dstFileSpec); - } - } - } else { - errno = ENOTDIR; - return TCL_ERROR; - } - } else { - if (dstIsDirectory) { - errno = EISDIR; - return TCL_ERROR; - } 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. - */ - - Str31 tmpName; - FSSpec tmpFileSpec; - - err = GenerateUniqueName(dstFileSpec.vRefNum, - dstFileSpec.parID, dstFileSpec.parID, tmpName); - if (err == noErr) { - err = FSpRenameCompat(&dstFileSpec, tmpName); - } - if (err == noErr) { - err = FSMakeFSSpecCompat(dstFileSpec.vRefNum, - dstFileSpec.parID, tmpName, &tmpFileSpec); - } - if (err == noErr) { - err = MoveRename(&srcFileSpec, &dstDirSpec, - dstFileSpec.name); - } - if (err == noErr) { - FSpDeleteCompat(&tmpFileSpec); - } else { - FSpDeleteCompat(&dstFileSpec); - FSpRenameCompat(&tmpFileSpec, dstFileSpec.name); - if (dstLocked) { - FSpSetFLockCompat(&dstFileSpec); - } - } - } - } - } - - end: - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *-------------------------------------------------------------------------- - * - * MoveRename -- - * - * Helper function for TclpRenameFile. Renames a file or directory - * into the same directory or another directory. The target name - * must not already exist in the destination directory. - * - * Don't use FSpMoveRenameCompat because it doesn't work with - * directories or with locked files. - * - * Results: - * Returns a mac error indicating the cause of the failure. - * - * Side effects: - * Creates a temp file in the target directory to handle a rename - * between directories. - * - *-------------------------------------------------------------------------- - */ - -static OSErr -MoveRename( - const FSSpec *srcFileSpecPtr, /* Source object. */ - const FSSpec *dstDirSpecPtr, /* Destination directory. */ - StringPtr copyName) /* New name for object in destination - * directory. */ -{ - OSErr err; - long srcID, dstID; - Boolean srcIsDir, dstIsDir; - Str31 tmpName; - FSSpec dstFileSpec, srcDirSpec, tmpSrcFileSpec, tmpDstFileSpec; - Boolean locked; - - if (srcFileSpecPtr->parID == 1) { - /* - * Trying to rename a volume. - */ - - return badMovErr; - } - if (srcFileSpecPtr->vRefNum != dstDirSpecPtr->vRefNum) { - /* - * Renaming across volumes. - */ - - return diffVolErr; - } - err = FSpGetFLockCompat(srcFileSpecPtr, &locked); - if (locked) { - FSpRstFLockCompat(srcFileSpecPtr); - } - if (err == noErr) { - err = FSpGetDirectoryID(dstDirSpecPtr, &dstID, &dstIsDir); - } - if (err == noErr) { - if (srcFileSpecPtr->parID == dstID) { - /* - * Renaming object within directory. - */ - - err = FSpRenameCompat(srcFileSpecPtr, copyName); - goto done; - } - if (Pstrequal(srcFileSpecPtr->name, copyName)) { - /* - * Moving object to another directory (under same name). - */ - - err = FSpCatMoveCompat(srcFileSpecPtr, dstDirSpecPtr); - goto done; - } - err = FSpGetDirectoryID(srcFileSpecPtr, &srcID, &srcIsDir); - } - if (err == noErr) { - /* - * Fullblown: rename source object to temp name, move temp to - * dest directory, and rename temp to target. - */ - - err = GenerateUniqueName(srcFileSpecPtr->vRefNum, - srcFileSpecPtr->parID, dstID, tmpName); - FSMakeFSSpecCompat(srcFileSpecPtr->vRefNum, srcFileSpecPtr->parID, - tmpName, &tmpSrcFileSpec); - FSMakeFSSpecCompat(dstDirSpecPtr->vRefNum, dstID, tmpName, - &tmpDstFileSpec); - } - if (err == noErr) { - err = FSpRenameCompat(srcFileSpecPtr, tmpName); - } - if (err == noErr) { - err = FSpCatMoveCompat(&tmpSrcFileSpec, dstDirSpecPtr); - if (err == noErr) { - err = FSpRenameCompat(&tmpDstFileSpec, copyName); - if (err == noErr) { - goto done; - } - FSMakeFSSpecCompat(srcFileSpecPtr->vRefNum, srcFileSpecPtr->parID, - NULL, &srcDirSpec); - FSpCatMoveCompat(&tmpDstFileSpec, &srcDirSpec); - } - FSpRenameCompat(&tmpSrcFileSpec, srcFileSpecPtr->name); - } - - done: - if (locked != false) { - if (err == noErr) { - FSMakeFSSpecCompat(dstDirSpecPtr->vRefNum, - dstID, copyName, &dstFileSpec); - FSpSetFLockCompat(&dstFileSpec); - } else { - FSpSetFLockCompat(srcFileSpecPtr); - } - } - return err; -} - -/* - *--------------------------------------------------------------------------- - * - * TclpCopyFile, 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 -TclpCopyFile( - CONST char *src, /* Pathname of file to be copied (UTF-8). */ - CONST char *dst) /* Pathname of file to copy to (UTF-8). */ -{ - int result; - Tcl_DString srcString, dstString; - - Tcl_UtfToExternalDString(NULL, src, -1, &srcString); - Tcl_UtfToExternalDString(NULL, dst, -1, &dstString); - result = DoCopyFile(Tcl_DStringValue(&srcString), - Tcl_DStringValue(&dstString)); - Tcl_DStringFree(&srcString); - Tcl_DStringFree(&dstString); - return result; -} - -static int -DoCopyFile( - CONST char *src, /* Pathname of file to be copied (native). */ - CONST char *dst) /* Pathname of file to copy to (native). */ -{ - OSErr err, dstErr; - Boolean dstExists, dstIsDirectory, dstLocked; - FSSpec srcFileSpec, dstFileSpec, dstDirSpec, tmpFileSpec; - Str31 tmpName; - - err = FSpLocationFromPath(strlen(src), src, &srcFileSpec); - if (err == noErr) { - err = GetFileSpecs(dst, &dstFileSpec, &dstDirSpec, &dstExists, - &dstIsDirectory); - } - if (dstExists) { - if (dstIsDirectory) { - errno = EISDIR; - return TCL_ERROR; - } - err = FSpGetFLockCompat(&dstFileSpec, &dstLocked); - if (dstLocked) { - FSpRstFLockCompat(&dstFileSpec); - } - - /* - * Backup dest file. - */ - - dstErr = GenerateUniqueName(dstFileSpec.vRefNum, dstFileSpec.parID, - dstFileSpec.parID, tmpName); - if (dstErr == noErr) { - dstErr = FSpRenameCompat(&dstFileSpec, tmpName); - } - } - if (err == noErr) { - err = FSpFileCopy(&srcFileSpec, &dstDirSpec, - (StringPtr) dstFileSpec.name, NULL, 0, true); - } - if ((dstExists != false) && (dstErr == noErr)) { - FSMakeFSSpecCompat(dstFileSpec.vRefNum, dstFileSpec.parID, - tmpName, &tmpFileSpec); - if (err == noErr) { - /* - * Delete backup file. - */ - - FSpDeleteCompat(&tmpFileSpec); - } else { - - /* - * Restore backup file. - */ - - FSpDeleteCompat(&dstFileSpec); - FSpRenameCompat(&tmpFileSpec, dstFileSpec.name); - if (dstLocked) { - FSpSetFLockCompat(&dstFileSpec); - } - } - } - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * TclpDeleteFile, DoDeleteFile -- - * - * 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 -TclpDeleteFile( - CONST char *path) /* Pathname of file to be removed (UTF-8). */ -{ - int result; - Tcl_DString pathString; - - Tcl_UtfToExternalDString(NULL, path, -1, &pathString); - result = DoDeleteFile(Tcl_DStringValue(&pathString)); - Tcl_DStringFree(&pathString); - return result; -} - -static int -DoDeleteFile( - CONST char *path) /* Pathname of file to be removed (native). */ -{ - OSErr err; - FSSpec fileSpec; - Boolean isDirectory; - long dirID; - - err = FSpLocationFromPath(strlen(path), path, &fileSpec); - if (err == noErr) { - /* - * Since FSpDeleteCompat will delete an empty directory, make sure - * that this isn't a directory first. - */ - - FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); - if (isDirectory == true) { - errno = EISDIR; - return TCL_ERROR; - } - } - err = FSpDeleteCompat(&fileSpec); - if (err == fLckdErr) { - FSpRstFLockCompat(&fileSpec); - err = FSpDeleteCompat(&fileSpec); - if (err != noErr) { - FSpSetFLockCompat(&fileSpec); - } - } - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - 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 -TclpCreateDirectory( - CONST char *path) /* Pathname of directory to create (UTF-8). */ -{ - int result; - Tcl_DString pathString; - - Tcl_UtfToExternalDString(NULL, path, -1, &pathString); - result = DoCreateDirectory(Tcl_DStringValue(&pathString)); - Tcl_DStringFree(&pathString); - return result; -} - -static int -DoCreateDirectory( - CONST char *path) /* Pathname of directory to create (native). */ -{ - OSErr err; - FSSpec dirSpec; - long outDirID; - - err = FSpLocationFromPath(strlen(path), path, &dirSpec); - if (err == noErr) { - err = dupFNErr; /* EEXIST. */ - } else if (err == fnfErr) { - err = FSpDirCreateCompat(&dirSpec, smSystemScript, &outDirID); - } - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * TclpCopyDirectory, DoCopyDirectory -- - * - * 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 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 -TclpCopyDirectory( - CONST char *src, /* Pathname of directory to be copied - * (UTF-8). */ - CONST char *dst, /* Pathname of target directory (UTF-8). */ - Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free - * DString filled with UTF-8 name of file - * causing error. */ -{ - int result; - Tcl_DString srcString, dstString; - - Tcl_UtfToExternalDString(NULL, src, -1, &srcString); - Tcl_UtfToExternalDString(NULL, dst, -1, &dstString); - result = DoCopyDirectory(Tcl_DStringValue(&srcString), - Tcl_DStringValue(&dstString), errorPtr); - Tcl_DStringFree(&srcString); - Tcl_DStringFree(&dstString); - return result; -} - -static int -DoCopyDirectory( - CONST char *src, /* Pathname of directory to be copied - * (UTF-8). */ - CONST char *dst, /* Pathname of target directory (UTF-8). */ - Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free - * DString filled with UTF-8 name of file - * causing error. */ -{ - OSErr err, saveErr; - long srcID, tmpDirID; - FSSpec srcFileSpec, dstFileSpec, dstDirSpec, tmpDirSpec, tmpFileSpec; - Boolean srcIsDirectory, srcLocked; - Boolean dstIsDirectory, dstExists; - Str31 tmpName; - - err = FSpLocationFromPath(strlen(src), src, &srcFileSpec); - if (err == noErr) { - err = FSpGetDirectoryID(&srcFileSpec, &srcID, &srcIsDirectory); - } - if (err == noErr) { - if (srcIsDirectory == false) { - err = afpObjectTypeErr; /* ENOTDIR. */ - } - } - if (err == noErr) { - err = GetFileSpecs(dst, &dstFileSpec, &dstDirSpec, &dstExists, - &dstIsDirectory); - } - if (dstExists) { - if (dstIsDirectory == false) { - err = afpObjectTypeErr; /* ENOTDIR. */ - } else { - err = dupFNErr; /* EEXIST. */ - } - } - if (err != noErr) { - goto done; - } - if ((srcFileSpec.vRefNum == dstFileSpec.vRefNum) && - (srcFileSpec.parID == dstFileSpec.parID) && - (Pstrequal(srcFileSpec.name, dstFileSpec.name) != 0)) { - /* - * Copying on top of self. No-op. - */ - - goto done; - } - - /* - * This algorthm will work making a copy of the source directory in - * the current directory with a new name, in a new directory with the - * same name, and in a new directory with a new name: - * - * 1. Make dstDir/tmpDir. - * 2. Copy srcDir/src to dstDir/tmpDir/src - * 3. Rename dstDir/tmpDir/src to dstDir/tmpDir/dst (if necessary). - * 4. CatMove dstDir/tmpDir/dst to dstDir/dst. - * 5. Remove dstDir/tmpDir. - */ - - err = FSpGetFLockCompat(&srcFileSpec, &srcLocked); - if (srcLocked) { - FSpRstFLockCompat(&srcFileSpec); - } - if (err == noErr) { - err = GenerateUniqueName(dstFileSpec.vRefNum, dstFileSpec.parID, - dstFileSpec.parID, tmpName); - } - if (err == noErr) { - FSMakeFSSpecCompat(dstFileSpec.vRefNum, dstFileSpec.parID, - tmpName, &tmpDirSpec); - err = FSpDirCreateCompat(&tmpDirSpec, smSystemScript, &tmpDirID); - } - if (err == noErr) { - err = FSpDirectoryCopy(&srcFileSpec, &tmpDirSpec, NULL, 0, true, - CopyErrHandler); - } - - /* - * Even if the Copy failed, Rename/Move whatever did get copied to the - * appropriate final destination, if possible. - */ - - saveErr = err; - err = noErr; - if (Pstrequal(srcFileSpec.name, dstFileSpec.name) == 0) { - err = FSMakeFSSpecCompat(tmpDirSpec.vRefNum, tmpDirID, - srcFileSpec.name, &tmpFileSpec); - if (err == noErr) { - err = FSpRenameCompat(&tmpFileSpec, dstFileSpec.name); - } - } - if (err == noErr) { - err = FSMakeFSSpecCompat(tmpDirSpec.vRefNum, tmpDirID, - dstFileSpec.name, &tmpFileSpec); - } - if (err == noErr) { - err = FSpCatMoveCompat(&tmpFileSpec, &dstDirSpec); - } - if (err == noErr) { - if (srcLocked) { - FSpSetFLockCompat(&dstFileSpec); - } - } - - FSpDeleteCompat(&tmpDirSpec); - - if (saveErr != noErr) { - err = saveErr; - } - - done: - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - if (errorPtr != NULL) { - Tcl_ExternalToUtfDString(NULL, dst, -1, errorPtr); - } - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * CopyErrHandler -- - * - * This procedure is called from the MoreFiles procedure - * FSpDirectoryCopy whenever an error occurs. - * - * Results: - * False if the condition should not be considered an error, true - * otherwise. - * - * Side effects: - * Since FSpDirectoryCopy() is called only after removing any - * existing target directories, there shouldn't be any errors. - * - *---------------------------------------------------------------------- - */ - -static pascal Boolean -CopyErrHandler( - OSErr error, /* Error that occured */ - short failedOperation, /* operation that caused the error */ - short srcVRefNum, /* volume ref number of source */ - long srcDirID, /* directory id of source */ - StringPtr srcName, /* name of source */ - short dstVRefNum, /* volume ref number of dst */ - long dstDirID, /* directory id of dst */ - StringPtr dstName) /* name of dst directory */ -{ - return true; -} - -/* - *--------------------------------------------------------------------------- - * - * 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 -TclpRemoveDirectory( - CONST char *path, /* Pathname of directory to be removed - * (UTF-8). */ - 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 result; - Tcl_DString pathString; - - Tcl_UtfToExternalDString(NULL, path, -1, &pathString); - result = DoRemoveDirectory(Tcl_DStringValue(&pathString), recursive, - errorPtr); - Tcl_DStringFree(&pathString); - - return result; -} - -static int -DoRemoveDirectory( - CONST char *path, /* 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. */ -{ - OSErr err; - FSSpec fileSpec; - long dirID; - int locked; - Boolean isDirectory; - CInfoPBRec pb; - Str255 fileName; - - - locked = 0; - err = FSpLocationFromPath(strlen(path), path, &fileSpec); - if (err != noErr) { - goto done; - } - - /* - * Since FSpDeleteCompat will delete a file, make sure this isn't - * a file first. - */ - - isDirectory = 1; - FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); - if (isDirectory == 0) { - errno = ENOTDIR; - return TCL_ERROR; - } - - err = FSpDeleteCompat(&fileSpec); - if (err == fLckdErr) { - locked = 1; - FSpRstFLockCompat(&fileSpec); - err = FSpDeleteCompat(&fileSpec); - } - if (err == noErr) { - return TCL_OK; - } - if (err != fBsyErr) { - goto done; - } - - if (recursive == 0) { - /* - * fBsyErr means one of three things: file busy, directory not empty, - * or working directory control block open. Determine if directory - * is empty. If directory is not empty, return EEXIST. - */ - - pb.hFileInfo.ioVRefNum = fileSpec.vRefNum; - pb.hFileInfo.ioDirID = dirID; - pb.hFileInfo.ioNamePtr = (StringPtr) fileName; - pb.hFileInfo.ioFDirIndex = 1; - if (PBGetCatInfoSync(&pb) == noErr) { - err = dupFNErr; /* EEXIST */ - goto done; - } - } - - /* - * DeleteDirectory removes a directory and all its contents, including - * any locked files. There is no interface to get the name of the - * file that caused the error, if an error occurs deleting this tree, - * unless we rewrite DeleteDirectory ourselves. - */ - - err = DeleteDirectory(fileSpec.vRefNum, dirID, NULL); - - done: - if (err != noErr) { - if (errorPtr != NULL) { - Tcl_UtfToExternalDString(NULL, path, -1, errorPtr); - } - if (locked) { - FSpSetFLockCompat(&fileSpec); - } - errno = TclMacOSErrorToPosixError(err); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * GenerateUniqueName -- - * - * Generate a filename that is not in either of the two specified - * directories (on the same volume). - * - * Results: - * Standard macintosh error. On success, uniqueName is filled with - * the name of the temporary file. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static OSErr -GenerateUniqueName( - short vRefNum, /* Volume on which the following directories - * are located. */ - long dirID1, /* ID of first directory. */ - long dirID2, /* ID of second directory. May be the same - * as the first. */ - Str31 uniqueName) /* Filled with filename for a file that is - * not located in either of the above two - * directories. */ -{ - OSErr err; - long i; - CInfoPBRec pb; - static unsigned char hexStr[16] = "0123456789ABCDEF"; - static long startSeed = 248923489; - - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioFDirIndex = 0; - pb.hFileInfo.ioNamePtr = uniqueName; - - while (1) { - startSeed++; - pb.hFileInfo.ioNamePtr[0] = 8; - for (i = 1; i <= 8; i++) { - pb.hFileInfo.ioNamePtr[i] = hexStr[((startSeed >> ((8-i)*4)) & 0xf)]; - } - pb.hFileInfo.ioDirID = dirID1; - err = PBGetCatInfoSync(&pb); - if (err == fnfErr) { - if (dirID1 != dirID2) { - pb.hFileInfo.ioDirID = dirID2; - err = PBGetCatInfoSync(&pb); - } - if (err == fnfErr) { - return noErr; - } - } - if (err == noErr) { - continue; - } - return err; - } -} - -/* - *--------------------------------------------------------------------------- - * - * GetFileSpecs -- - * - * Gets FSSpecs for the specified path and its parent directory. - * - * Results: - * The return value is noErr if there was no error getting FSSpecs, - * otherwise it is an error describing the problem. Fills buffers - * with information, as above. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -static OSErr -GetFileSpecs( - CONST char *path, /* The path to query. */ - FSSpec *pathSpecPtr, /* Filled with information about path. */ - FSSpec *dirSpecPtr, /* Filled with information about path's - * parent directory. */ - Boolean *pathExistsPtr, /* Set to true if path actually exists, - * false if it doesn't or there was an - * error reading the specified path. */ - Boolean *pathIsDirectoryPtr)/* Set to true if path is itself a directory, - * otherwise false. */ -{ - char *dirName; - OSErr err; - int argc; - char **argv; - long d; - Tcl_DString buffer; - - *pathExistsPtr = false; - *pathIsDirectoryPtr = false; - - Tcl_DStringInit(&buffer); - Tcl_SplitPath(path, &argc, &argv); - if (argc == 1) { - dirName = ":"; - } else { - dirName = Tcl_JoinPath(argc - 1, argv, &buffer); - } - err = FSpLocationFromPath(strlen(dirName), dirName, dirSpecPtr); - Tcl_DStringFree(&buffer); - ckfree((char *) argv); - - if (err == noErr) { - err = FSpLocationFromPath(strlen(path), path, pathSpecPtr); - if (err == noErr) { - *pathExistsPtr = true; - err = FSpGetDirectoryID(pathSpecPtr, &d, pathIsDirectoryPtr); - } else if (err == fnfErr) { - err = noErr; - } - } - return err; -} - -/* - *------------------------------------------------------------------------- - * - * FSpGetFLockCompat -- - * - * Determines if there exists a software lock on the specified - * file. The software lock could prevent the file from being - * renamed or moved. - * - * Results: - * Standard macintosh error code. - * - * Side effects: - * None. - * - * - *------------------------------------------------------------------------- - */ - -OSErr -FSpGetFLockCompat( - const FSSpec *specPtr, /* File to query. */ - Boolean *lockedPtr) /* Set to true if file is locked, false - * if it isn't or there was an error reading - * specified file. */ -{ - CInfoPBRec pb; - OSErr err; - - pb.hFileInfo.ioVRefNum = specPtr->vRefNum; - pb.hFileInfo.ioDirID = specPtr->parID; - pb.hFileInfo.ioNamePtr = (StringPtr) specPtr->name; - pb.hFileInfo.ioFDirIndex = 0; - - err = PBGetCatInfoSync(&pb); - if ((err == noErr) && (pb.hFileInfo.ioFlAttrib & 0x01)) { - *lockedPtr = true; - } else { - *lockedPtr = false; - } - return err; -} - -/* - *---------------------------------------------------------------------- - * - * Pstrequal -- - * - * Pascal string compare. - * - * Results: - * Returns 1 if strings equal, 0 otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -Pstrequal ( - ConstStr255Param stringA, /* Pascal string A */ - ConstStr255Param stringB) /* Pascal string B */ -{ - int i, len; - - len = *stringA; - for (i = 0; i <= len; i++) { - if (*stringA++ != *stringB++) { - return 0; - } - } - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * GetFileFinderAttributes -- - * - * Returns a Tcl_Obj containing the value of a file attribute - * which is part of the FInfo record. Which attribute is controlled - * by objIndex. - * - * Results: - * Returns a standard TCL error. If the return value is TCL_OK, - * the new creator or file type object is put into attributePtrPtr. - * The object will have ref count 0. If there is an error, - * attributePtrPtr is not touched. - * - * Side effects: - * A new object is allocated if the file is valid. - * - *---------------------------------------------------------------------- - */ - -static int -GetFileFinderAttributes( - Tcl_Interp *interp, /* The interp to report errors with. */ - int objIndex, /* The index of the attribute option. */ - CONST char *fileName, /* The name of the file. */ - Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ -{ - OSErr err; - FSSpec fileSpec; - FInfo finfo; - - err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); - - if (err == noErr) { - err = FSpGetFInfo(&fileSpec, &finfo); - } - - if (err == noErr) { - switch (objIndex) { - case MAC_CREATOR_ATTRIBUTE: - *attributePtrPtr = Tcl_NewOSTypeObj(finfo.fdCreator); - break; - case MAC_HIDDEN_ATTRIBUTE: - *attributePtrPtr = Tcl_NewBooleanObj(finfo.fdFlags - & kIsInvisible); - break; - case MAC_TYPE_ATTRIBUTE: - *attributePtrPtr = Tcl_NewOSTypeObj(finfo.fdType); - break; - } - } else if (err == fnfErr) { - long dirID; - Boolean isDirectory = 0; - - err = FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); - if ((err == noErr) && isDirectory) { - if (objIndex == MAC_HIDDEN_ATTRIBUTE) { - *attributePtrPtr = Tcl_NewBooleanObj(0); - } else { - *attributePtrPtr = Tcl_NewOSTypeObj('Fldr'); - } - } - } - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "could not read \"", fileName, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * GetFileReadOnly -- - * - * Returns a Tcl_Obj containing a Boolean value indicating whether - * or not the file is read-only. The object will have ref count 0. - * This procedure just checks the Finder attributes; it does not - * check AppleShare sharing attributes. - * - * Results: - * Returns a standard TCL error. If the return value is TCL_OK, - * the new creator type object is put into readOnlyPtrPtr. - * If there is an error, readOnlyPtrPtr is not touched. - * - * Side effects: - * A new object is allocated if the file is valid. - * - *---------------------------------------------------------------------- - */ - -static int -GetFileReadOnly( - Tcl_Interp *interp, /* The interp to report errors with. */ - int objIndex, /* The index of the attribute. */ - CONST char *fileName, /* The name of the file. */ - Tcl_Obj **readOnlyPtrPtr) /* A pointer to return the object with. */ -{ - OSErr err; - FSSpec fileSpec; - CInfoPBRec paramBlock; - - err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); - - if (err == noErr) { - if (err == noErr) { - paramBlock.hFileInfo.ioCompletion = NULL; - paramBlock.hFileInfo.ioNamePtr = fileSpec.name; - paramBlock.hFileInfo.ioVRefNum = fileSpec.vRefNum; - paramBlock.hFileInfo.ioFDirIndex = 0; - paramBlock.hFileInfo.ioDirID = fileSpec.parID; - err = PBGetCatInfo(¶mBlock, 0); - if (err == noErr) { - - /* - * For some unknown reason, the Mac does not give - * symbols for the bits in the ioFlAttrib field. - * 1 -> locked. - */ - - *readOnlyPtrPtr = Tcl_NewBooleanObj( - paramBlock.hFileInfo.ioFlAttrib & 1); - } - } - } - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "could not read \"", fileName, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * SetFileFinderAttributes -- - * - * Sets the file to the creator or file type given by attributePtr. - * objIndex determines whether the creator or file type is set. - * - * Results: - * Returns a standard TCL error. - * - * Side effects: - * The file's attribute is set. - * - *---------------------------------------------------------------------- - */ - -static int -SetFileFinderAttributes( - Tcl_Interp *interp, /* The interp to report errors with. */ - int objIndex, /* The index of the attribute. */ - CONST char *fileName, /* The name of the file. */ - Tcl_Obj *attributePtr) /* The command line object. */ -{ - OSErr err; - FSSpec fileSpec; - FInfo finfo; - - err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); - - if (err == noErr) { - err = FSpGetFInfo(&fileSpec, &finfo); - } - - if (err == noErr) { - switch (objIndex) { - case MAC_CREATOR_ATTRIBUTE: - if (Tcl_GetOSTypeFromObj(interp, attributePtr, - &finfo.fdCreator) != TCL_OK) { - return TCL_ERROR; - } - break; - case MAC_HIDDEN_ATTRIBUTE: { - int hidden; - - if (Tcl_GetBooleanFromObj(interp, attributePtr, &hidden) - != TCL_OK) { - return TCL_ERROR; - } - if (hidden) { - finfo.fdFlags |= kIsInvisible; - } else { - finfo.fdFlags &= ~kIsInvisible; - } - break; - } - case MAC_TYPE_ATTRIBUTE: - if (Tcl_GetOSTypeFromObj(interp, attributePtr, - &finfo.fdType) != TCL_OK) { - return TCL_ERROR; - } - break; - } - err = FSpSetFInfo(&fileSpec, &finfo); - } else if (err == fnfErr) { - long dirID; - Boolean isDirectory = 0; - - err = FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); - if ((err == noErr) && isDirectory) { - Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); - Tcl_AppendStringsToObj(resultPtr, "cannot set ", - tclpFileAttrStrings[objIndex], ": \"", - fileName, "\" is a directory", (char *) NULL); - return TCL_ERROR; - } - } - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "could not read \"", fileName, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * SetFileReadOnly -- - * - * Sets the file to be read-only according to the Boolean value - * given by hiddenPtr. - * - * Results: - * Returns a standard TCL error. - * - * Side effects: - * The file's attribute is set. - * - *---------------------------------------------------------------------- - */ - -static int -SetFileReadOnly( - Tcl_Interp *interp, /* The interp to report errors with. */ - int objIndex, /* The index of the attribute. */ - CONST char *fileName, /* The name of the file. */ - Tcl_Obj *readOnlyPtr) /* The command line object. */ -{ - OSErr err; - FSSpec fileSpec; - HParamBlockRec paramBlock; - int hidden; - - err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); - - if (err == noErr) { - if (Tcl_GetBooleanFromObj(interp, readOnlyPtr, &hidden) != TCL_OK) { - return TCL_ERROR; - } - - paramBlock.fileParam.ioCompletion = NULL; - paramBlock.fileParam.ioNamePtr = fileSpec.name; - paramBlock.fileParam.ioVRefNum = fileSpec.vRefNum; - paramBlock.fileParam.ioDirID = fileSpec.parID; - if (hidden) { - err = PBHSetFLock(¶mBlock, 0); - } else { - err = PBHRstFLock(¶mBlock, 0); - } - } - - if (err == fnfErr) { - long dirID; - Boolean isDirectory = 0; - err = FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); - if ((err == noErr) && isDirectory) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "cannot set a directory to read-only when File Sharing is turned off", - (char *) NULL); - return TCL_ERROR; - } else { - err = fnfErr; - } - } - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "could not read \"", fileName, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *--------------------------------------------------------------------------- - * - * TclpListVolumes -- - * - * Lists the currently mounted volumes - * - * Results: - * A standard Tcl result. Will always be TCL_OK, since there is no way - * that this command can fail. Also, the interpreter's result is set to - * the list of volumes. - * - * Side effects: - * None - * - *--------------------------------------------------------------------------- - */ -int -TclpListVolumes( - Tcl_Interp *interp) /* Interpreter to which to pass the volume list */ -{ - HParamBlockRec pb; - Str255 name; - OSErr theError = noErr; - Tcl_Obj *resultPtr, *elemPtr; - short volIndex = 1; - Tcl_DString dstr; - - resultPtr = Tcl_NewObj(); - - /* - * We use two facts: - * 1) The Mac volumes are enumerated by the ioVolIndex parameter of - * the HParamBlockRec. They run through the integers contiguously, - * starting at 1. - * 2) PBHGetVInfoSync returns an error when you ask for a volume index - * that does not exist. - * - */ - - while ( 1 ) { - pb.volumeParam.ioNamePtr = (StringPtr) &name; - pb.volumeParam.ioVolIndex = volIndex; - - theError = PBHGetVInfoSync(&pb); - - if ( theError != noErr ) { - break; - } - - Tcl_ExternalToUtfDString(NULL, (char *) &name[1], name[0], &dstr); - elemPtr = Tcl_NewStringObj(Tcl_DStringValue(&dstr), - Tcl_DStringLength(&dstr)); - Tcl_AppendToObj(elemPtr, ":", 1); - Tcl_ListObjAppendElement(interp, resultPtr, elemPtr); - - Tcl_DStringFree(&dstr); - - volIndex++; - } - - Tcl_SetObjResult(interp, resultPtr); - return TCL_OK; -} - diff --git a/mac/tclMacFile.c b/mac/tclMacFile.c deleted file mode 100644 index 94582bd..0000000 --- a/mac/tclMacFile.c +++ /dev/null @@ -1,832 +0,0 @@ -/* - * tclMacFile.c -- - * - * This file implements the channel drivers for Macintosh - * files. It also comtains Macintosh version of other Tcl - * functions that deal with the file system. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacFile.c,v 1.6 1999/04/16 00:47:20 stanton Exp $ - */ - -/* - * Note: This code eventually needs to support async I/O. In doing this - * we will need to keep track of all current async I/O. If exit to shell - * is called - we shouldn't exit until all asyc I/O completes. - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclMacInt.h" -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Static variables used by the TclpStat function. - */ -static int initialized = false; -static long gmt_offset; -TCL_DECLARE_MUTEX(gmtMutex) - - -/* - *---------------------------------------------------------------------- - * - * Tcl_FindExecutable -- - * - * This procedure computes the absolute path name of the current - * application, given its argv[0] value. However, this - * implementation doesn't need the argv[0] value. NULL - * may be passed in its place. - * - * Results: - * None. - * - * Side effects: - * The variable tclExecutableName gets filled in with the file - * name for the application, if we figured it out. If we couldn't - * figure it out, Tcl_FindExecutable is set to NULL. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_FindExecutable( - CONST char *argv0) /* The value of the application's argv[0]. */ -{ - ProcessSerialNumber psn; - ProcessInfoRec info; - Str63 appName; - FSSpec fileSpec; - int pathLength; - Handle pathName = NULL; - OSErr err; - Tcl_DString ds; - - TclInitSubsystems(argv0); - - GetCurrentProcess(&psn); - info.processInfoLength = sizeof(ProcessInfoRec); - info.processName = appName; - info.processAppSpec = &fileSpec; - GetProcessInformation(&psn, &info); - - if (tclExecutableName != NULL) { - ckfree(tclExecutableName); - tclExecutableName = NULL; - } - - err = FSpPathFromLocation(&fileSpec, &pathLength, &pathName); - HLock(pathName); - Tcl_ExternalToUtfDString(NULL, *pathName, pathLength, &ds); - HUnlock(pathName); - DisposeHandle(pathName); - - tclExecutableName = (char *) ckalloc((unsigned) - (Tcl_DStringLength(&ds) + 1)); - strcpy(tclExecutableName, Tcl_DStringValue(&ds)); - Tcl_DStringFree(&ds); -} - -/* - *---------------------------------------------------------------------- - * - * TclpMatchFiles -- - * - * This routine is used by the globbing code to search a - * directory for all files which match a given pattern. - * - * Results: - * If the tail argument is NULL, then the matching files are - * added to the the interp's result. Otherwise, TclDoGlob is called - * recursively for each matching subdirectory. The return value - * is a standard Tcl result indicating whether an error occurred - * in globbing. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- */ - -int -TclpMatchFiles( - Tcl_Interp *interp, /* Interpreter to receive results. */ - char *separators, /* Directory separators to pass to TclDoGlob. */ - Tcl_DString *dirPtr, /* Contains path to directory to search. */ - char *pattern, /* Pattern to match against. */ - char *tail) /* Pointer to end of pattern. Tail must - * point to a location in pattern and must - * not be static.*/ -{ - char *dirName, *patternEnd = tail; - char savedChar; - int result = TCL_OK; - int baseLength = Tcl_DStringLength(dirPtr); - CInfoPBRec pb; - OSErr err; - FSSpec dirSpec; - Boolean isDirectory; - long dirID; - short itemIndex; - Str255 fileName; - Tcl_DString fileString; - - /* - * Make sure that the directory part of the name really is a - * directory. - */ - - dirName = dirPtr->string; - FSpLocationFromPath(strlen(dirName), dirName, &dirSpec); - err = FSpGetDirectoryID(&dirSpec, &dirID, &isDirectory); - if ((err != noErr) || !isDirectory) { - return TCL_OK; - } - - /* - * Now open the directory for reading and iterate over the contents. - */ - - pb.hFileInfo.ioVRefNum = dirSpec.vRefNum; - pb.hFileInfo.ioDirID = dirID; - pb.hFileInfo.ioNamePtr = (StringPtr) fileName; - pb.hFileInfo.ioFDirIndex = itemIndex = 1; - - /* - * Clean up the end of the pattern and the tail pointer. Leave - * the tail pointing to the first character after the path separator - * following the pattern, or NULL. Also, ensure that the pattern - * is null-terminated. - */ - - if (*tail == '\\') { - tail++; - } - if (*tail == '\0') { - tail = NULL; - } else { - tail++; - } - savedChar = *patternEnd; - *patternEnd = '\0'; - - while (1) { - pb.hFileInfo.ioFDirIndex = itemIndex; - pb.hFileInfo.ioDirID = dirID; - err = PBGetCatInfoSync(&pb); - if (err != noErr) { - break; - } - - /* - * Now check to see if the file matches. If there are more - * characters to be processed, then ensure matching files are - * directories before calling TclDoGlob. Otherwise, just add - * the file to the result. - */ - - Tcl_ExternalToUtfDString(NULL, (char *) fileName + 1, fileName[0], - &fileString); - if (Tcl_StringMatch(Tcl_DStringValue(&fileString), pattern)) { - Tcl_DStringSetLength(dirPtr, baseLength); - Tcl_DStringAppend(dirPtr, Tcl_DStringValue(&fileString), -1); - if (tail == NULL) { - if ((dirPtr->length > 1) && - (strchr(dirPtr->string+1, ':') == NULL)) { - Tcl_AppendElement(interp, dirPtr->string+1); - } else { - Tcl_AppendElement(interp, dirPtr->string); - } - } else if ((pb.hFileInfo.ioFlAttrib & ioDirMask) != 0) { - Tcl_DStringAppend(dirPtr, ":", 1); - result = TclDoGlob(interp, separators, dirPtr, tail); - if (result != TCL_OK) { - Tcl_DStringFree(&fileString); - break; - } - } - } - Tcl_DStringFree(&fileString); - - itemIndex++; - } - *patternEnd = savedChar; - - return result; -} - -/* - *---------------------------------------------------------------------- - * - * TclpAccess -- - * - * This function replaces the library version of access(). - * - * Results: - * See access documentation. - * - * Side effects: - * See access documentation. - * - *---------------------------------------------------------------------- - */ - -int -TclpAccess( - CONST char *path, /* Path of file to access (UTF-8). */ - int mode) /* Permission setting. */ -{ - HFileInfo fpb; - HVolumeParam vpb; - OSErr err; - FSSpec fileSpec; - Boolean isDirectory; - long dirID; - Tcl_DString ds; - char *native; - int full_mode = 0; - - native = Tcl_UtfToExternalDString(NULL, path, -1, &ds); - err = FSpLocationFromPath(Tcl_DStringLength(&ds), native, &fileSpec); - Tcl_DStringFree(&ds); - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - return -1; - } - - /* - * Fill the fpb & vpb struct up with info about file or directory. - */ - FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); - vpb.ioVRefNum = fpb.ioVRefNum = fileSpec.vRefNum; - vpb.ioNamePtr = fpb.ioNamePtr = fileSpec.name; - if (isDirectory) { - fpb.ioDirID = fileSpec.parID; - } else { - fpb.ioDirID = dirID; - } - - fpb.ioFDirIndex = 0; - err = PBGetCatInfoSync((CInfoPBPtr)&fpb); - if (err == noErr) { - vpb.ioVolIndex = 0; - err = PBHGetVInfoSync((HParmBlkPtr)&vpb); - if (err == noErr) { - /* - * Use the Volume Info & File Info to determine - * access information. If we have got this far - * we know the directory is searchable or the file - * exists. (We have F_OK) - */ - - /* - * Check to see if the volume is hardware or - * software locked. If so we arn't W_OK. - */ - if (mode & W_OK) { - if ((vpb.ioVAtrb & 0x0080) || (vpb.ioVAtrb & 0x8000)) { - errno = EROFS; - return -1; - } - if (fpb.ioFlAttrib & 0x01) { - errno = EACCES; - return -1; - } - } - - /* - * Directories are always searchable and executable. But only - * files of type 'APPL' are executable. - */ - if (!(fpb.ioFlAttrib & 0x10) && (mode & X_OK) - && (fpb.ioFlFndrInfo.fdType != 'APPL')) { - return -1; - } - } - } - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - return -1; - } - - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclpChdir -- - * - * This function replaces the library version of chdir(). - * - * Results: - * See chdir() documentation. - * - * Side effects: - * See chdir() documentation. Also the cache maintained used by - * TclGetCwd() is deallocated and set to NULL. - * - *---------------------------------------------------------------------- - */ - -int -TclpChdir( - CONST char *dirName) /* Path to new working directory (UTF-8). */ -{ - FSSpec spec; - OSErr err; - Boolean isFolder; - long dirID; - Tcl_DString ds; - char *native; - - native = Tcl_UtfToExternalDString(NULL, dirName, -1, &ds); - err = FSpLocationFromPath(Tcl_DStringLength(&ds), native, &spec); - Tcl_DStringFree(&ds); - - if (err != noErr) { - errno = ENOENT; - return -1; - } - - err = FSpGetDirectoryID(&spec, &dirID, &isFolder); - if (err != noErr) { - errno = ENOENT; - return -1; - } - - if (isFolder != true) { - errno = ENOTDIR; - return -1; - } - - err = FSpSetDefaultDir(&spec); - if (err != noErr) { - switch (err) { - case afpAccessDenied: - errno = EACCES; - break; - default: - errno = ENOENT; - } - return -1; - } - - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TclpGetCwd -- - * - * This function replaces the library version of getcwd(). - * - * 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. - * - *---------------------------------------------------------------------- - */ - -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. */ -{ - FSSpec theSpec; - int length; - Handle pathHandle = NULL; - - if (FSpGetDefaultDir(&theSpec) != noErr) { - if (interp != NULL) { - Tcl_SetResult(interp, "error getting working directory name", - TCL_STATIC); - } - return NULL; - } - if (FSpPathFromLocation(&theSpec, &length, &pathHandle) != noErr) { - if (interp != NULL) { - Tcl_SetResult(interp, "error getting working directory name", - TCL_STATIC); - } - return NULL; - } - HLock(pathHandle); - Tcl_ExternalToUtfDString(NULL, *pathHandle, length, bufferPtr); - HUnlock(pathHandle); - DisposeHandle(pathHandle); - - 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). */ -{ - HFileInfo fpb; - OSErr err; - FSSpec fileSpec; - Boolean isDirectory; - Boolean wasAlias; - long dirID; - char fileName[257]; - char *end; - Handle theString = NULL; - int pathSize; - Tcl_DString ds; - char *native; - - native = Tcl_UtfToExternalDString(NULL, path, -1, &ds); - - /* - * Remove ending colons if they exist. - */ - - while ((strlen(native) != 0) && (path[strlen(native) - 1] == ':')) { - native[strlen(native) - 1] = NULL; - } - - if (strchr(native, ':') == NULL) { - strcpy(fileName + 1, native); - native = NULL; - } else { - end = strrchr(native, ':') + 1; - strcpy(fileName + 1, end); - *end = NULL; - } - fileName[0] = (char) strlen(fileName + 1); - - /* - * Create the file spec for the directory of the file - * we want to look at. - */ - - if (native != NULL) { - err = FSpLocationFromPath(strlen(native), native, &fileSpec); - if (err != noErr) { - Tcl_DStringFree(&ds); - errno = EINVAL; - return NULL; - } - } else { - FSMakeFSSpecCompat(0, 0, NULL, &fileSpec); - } - Tcl_DStringFree(&ds); - - /* - * Fill the fpb struct up with info about file or directory. - */ - - FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); - fpb.ioVRefNum = fileSpec.vRefNum; - fpb.ioDirID = dirID; - fpb.ioNamePtr = (StringPtr) fileName; - - fpb.ioFDirIndex = 0; - err = PBGetCatInfoSync((CInfoPBPtr)&fpb); - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - return NULL; - } else { - if (fpb.ioFlAttrib & 0x10) { - errno = EINVAL; - return NULL; - } else { - if (fpb.ioFlFndrInfo.fdFlags & 0x8000) { - /* - * The file is a link! - */ - } else { - errno = EINVAL; - return NULL; - } - } - } - - /* - * If we are here it's really a link - now find out - * where it points to. - */ - err = FSMakeFSSpecCompat(fileSpec.vRefNum, dirID, (StringPtr) fileName, - &fileSpec); - if (err == noErr) { - err = ResolveAliasFile(&fileSpec, true, &isDirectory, &wasAlias); - } - if ((err == fnfErr) || wasAlias) { - err = FSpPathFromLocation(&fileSpec, &pathSize, &theString); - if (err != noErr) { - DisposeHandle(theString); - errno = ENAMETOOLONG; - return NULL; - } - } else { - errno = EINVAL; - return NULL; - } - - Tcl_ExternalToUtfDString(NULL, *theString, pathSize, linkPtr); - DisposeHandle(theString); - - return Tcl_DStringValue(linkPtr); -} - -/* - *---------------------------------------------------------------------- - * - * TclpStat -- - * - * This function replaces the library version of stat(). - * - * Results: - * See stat() documentation. - * - * Side effects: - * See stat() documentation. - * - *---------------------------------------------------------------------- - */ - -int -TclpStat( - CONST char *path, /* Path of file to stat (in UTF-8). */ - struct stat *bufPtr) /* Filled with results of stat call. */ -{ - HFileInfo fpb; - HVolumeParam vpb; - OSErr err; - FSSpec fileSpec; - Boolean isDirectory; - long dirID; - Tcl_DString ds; - - path = Tcl_UtfToExternalDString(NULL, path, -1, &ds); - err = FSpLocationFromPath(Tcl_DStringLength(&ds), path, &fileSpec); - Tcl_DStringFree(&ds); - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - return -1; - } - - /* - * Fill the fpb & vpb struct up with info about file or directory. - */ - - FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); - vpb.ioVRefNum = fpb.ioVRefNum = fileSpec.vRefNum; - vpb.ioNamePtr = fpb.ioNamePtr = fileSpec.name; - if (isDirectory) { - fpb.ioDirID = fileSpec.parID; - } else { - fpb.ioDirID = dirID; - } - - fpb.ioFDirIndex = 0; - err = PBGetCatInfoSync((CInfoPBPtr)&fpb); - if (err == noErr) { - vpb.ioVolIndex = 0; - err = PBHGetVInfoSync((HParmBlkPtr)&vpb); - if (err == noErr && bufPtr != NULL) { - /* - * Files are always readable by everyone. - */ - - bufPtr->st_mode = S_IRUSR | S_IRGRP | S_IROTH; - - /* - * Use the Volume Info & File Info to fill out stat buf. - */ - if (fpb.ioFlAttrib & 0x10) { - bufPtr->st_mode |= S_IFDIR; - bufPtr->st_nlink = 2; - } else { - bufPtr->st_nlink = 1; - if (fpb.ioFlFndrInfo.fdFlags & 0x8000) { - bufPtr->st_mode |= S_IFLNK; - } else { - bufPtr->st_mode |= S_IFREG; - } - } - if ((fpb.ioFlAttrib & 0x10) || (fpb.ioFlFndrInfo.fdType == 'APPL')) { - /* - * Directories and applications are executable by everyone. - */ - - bufPtr->st_mode |= S_IXUSR | S_IXGRP | S_IXOTH; - } - if ((fpb.ioFlAttrib & 0x01) == 0){ - /* - * If not locked, then everyone has write acces. - */ - - bufPtr->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH; - } - bufPtr->st_ino = fpb.ioDirID; - bufPtr->st_dev = fpb.ioVRefNum; - bufPtr->st_uid = -1; - bufPtr->st_gid = -1; - bufPtr->st_rdev = 0; - bufPtr->st_size = fpb.ioFlLgLen; - bufPtr->st_blksize = vpb.ioVAlBlkSiz; - bufPtr->st_blocks = (bufPtr->st_size + bufPtr->st_blksize - 1) - / bufPtr->st_blksize; - - /* - * The times returned by the Mac file system are in the - * local time zone. We convert them to GMT so that the - * epoch starts from GMT. This is also consistant with - * what is returned from "clock seconds". - */ - - Tcl_MutexLock(&gmtMutex); - if (initialized == false) { - MachineLocation loc; - - ReadLocation(&loc); - gmt_offset = loc.u.gmtDelta & 0x00ffffff; - if (gmt_offset & 0x00800000) { - gmt_offset = gmt_offset | 0xff000000; - } - initialized = true; - } - Tcl_MutexUnlock(&gmtMutex); - - bufPtr->st_atime = bufPtr->st_mtime = fpb.ioFlMdDat - gmt_offset; - bufPtr->st_ctime = fpb.ioFlCrDat - gmt_offset; - } - } - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - } - - return (err == noErr ? 0 : -1); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_WaitPid -- - * - * Fakes a call to wait pid. - * - * Results: - * Always returns -1. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Pid -Tcl_WaitPid( - Tcl_Pid pid, - int *statPtr, - int options) -{ - return (Tcl_Pid) -1; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacFOpenHack -- - * - * This function replaces fopen. It supports paths with alises. - * Note, remember to undefine the fopen macro! - * - * Results: - * See fopen documentation. - * - * Side effects: - * See fopen documentation. - * - *---------------------------------------------------------------------- - */ - -#undef fopen -FILE * -TclMacFOpenHack( - CONST char *path, - CONST char *mode) -{ - OSErr err; - FSSpec fileSpec; - Handle pathString = NULL; - int size; - FILE * f; - - err = FSpLocationFromPath(strlen(path), (char *) path, &fileSpec); - if ((err != noErr) && (err != fnfErr)) { - return NULL; - } - err = FSpPathFromLocation(&fileSpec, &size, &pathString); - if ((err != noErr) && (err != fnfErr)) { - return NULL; - } - - HLock(pathString); - f = fopen(*pathString, mode); - HUnlock(pathString); - DisposeHandle(pathString); - return f; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacOSErrorToPosixError -- - * - * Given a Macintosh OSErr return the appropiate POSIX error. - * - * Results: - * A Posix error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclMacOSErrorToPosixError( - int error) /* A Macintosh error. */ -{ - switch (error) { - case noErr: - return 0; - case bdNamErr: - return ENAMETOOLONG; - case afpObjectTypeErr: - return ENOTDIR; - case fnfErr: - case dirNFErr: - return ENOENT; - case dupFNErr: - return EEXIST; - case dirFulErr: - case dskFulErr: - return ENOSPC; - case fBsyErr: - return EBUSY; - case tmfoErr: - return ENFILE; - case fLckdErr: - case permErr: - case afpAccessDenied: - return EACCES; - case wPrErr: - case vLckdErr: - return EROFS; - case badMovErr: - return EINVAL; - case diffVolErr: - return EXDEV; - default: - return EINVAL; - } -} diff --git a/mac/tclMacInit.c b/mac/tclMacInit.c deleted file mode 100644 index 6bf6169..0000000 --- a/mac/tclMacInit.c +++ /dev/null @@ -1,694 +0,0 @@ -/* - * tclMacInit.c -- - * - * Contains the Mac-specific interpreter initialization functions. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacInit.c,v 1.3 1999/04/16 00:47:20 stanton Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "tclInt.h" -#include "tclMacInt.h" -#include "tclPort.h" - -/* - * The following string is the startup script executed in new - * interpreters. It looks on the library path and in the resource fork for - * a script "init.tcl" that is compatible with this version of Tcl. The - * init.tcl script does all of the real work of initialization. - */ - -static char initCmd[] = "\ -proc sourcePath {file} {\n\ - set dirs {}\n\ - foreach i $::auto_path {\n\ - set init [file join $i $file.tcl]\n\ - if {[catch {uplevel #0 [list source $init]}] == 0} {\n\ - return\n\ - }\n\ - }\n\ - if {[catch {uplevel #0 [list source -rsrc $file]}] == 0} {\n\ - return\n\ - }\n\ - rename sourcePath {}\n\ - set msg \"can't find $file resource or a usable $file.tcl file\n\"\n\ - append msg \"in the following directories:\n\"\n\ - append msg \" $::auto_path\n\"\n\ - append msg \" perhaps you need to install Tcl or set your \n\"\n\ - append msg \"TCL_LIBRARY environment variable?\"\n\ - error $msg\n\ -}\n\ -if {[info exists env(EXT_FOLDER)]} {\n\ - lappend tcl_pkgPath [file join $env(EXT_FOLDER) {:Tool Command Language}]\n\ -}\n\ -if {[info exists tcl_pkgPath] == 0} {\n\ - set tcl_pkgPath {no extension folder}\n\ -}\n\ -sourcePath Init\n\ -sourcePath Auto\n\ -sourcePath Package\n\ -sourcePath History\n\ -sourcePath Word\n\ -rename sourcePath {}"; - -/* - * The following structures are used to map the script/language codes of a - * font to the name that should be passed to Tcl_GetEncoding() to obtain - * the encoding for that font. The set of numeric constants is fixed and - * defined by Apple. - */ - -typedef struct Map { - int numKey; - char *strKey; -} Map; - -static Map scriptMap[] = { - {smRoman, "macRoman"}, - {smJapanese, "macJapan"}, - {smTradChinese, "macChinese"}, - {smKorean, "macKorean"}, - {smArabic, "macArabic"}, - {smHebrew, "macHebrew"}, - {smGreek, "macGreek"}, - {smCyrillic, "macCyrillic"}, - {smRSymbol, "macRSymbol"}, - {smDevanagari, "macDevanagari"}, - {smGurmukhi, "macGurmukhi"}, - {smGujarati, "macGujarati"}, - {smOriya, "macOriya"}, - {smBengali, "macBengali"}, - {smTamil, "macTamil"}, - {smTelugu, "macTelugu"}, - {smKannada, "macKannada"}, - {smMalayalam, "macMalayalam"}, - {smSinhalese, "macSinhalese"}, - {smBurmese, "macBurmese"}, - {smKhmer, "macKhmer"}, - {smThai, "macThailand"}, - {smLaotian, "macLaos"}, - {smGeorgian, "macGeorgia"}, - {smArmenian, "macArmenia"}, - {smSimpChinese, "macSimpChinese"}, - {smTibetan, "macTIbet"}, - {smMongolian, "macMongolia"}, - {smGeez, "macEthiopia"}, - {smEastEurRoman, "macCentEuro"}, - {smVietnamese, "macVietnam"}, - {smExtArabic, "macSindhi"}, - {NULL, NULL} -}; - -static Map romanMap[] = { - {langCroatian, "macCroatian"}, - {langSlovenian, "macCroatian"}, - {langIcelandic, "macIceland"}, - {langRomanian, "macRomania"}, - {langTurkish, "macTurkish"}, - {langGreek, "macGreek"}, - {NULL, NULL} -}; - -static Map cyrillicMap[] = { - {langUkrainian, "macUkraine"}, - {langBulgarian, "macBulgaria"}, - {NULL, NULL} -}; - -static int GetFinderFont(int *finderID); - - -/* - *---------------------------------------------------------------------- - * - * GetFinderFont -- - * - * Gets the "views" font of the Macintosh Finder - * - * Results: - * Standard Tcl result, and sets finderID to the font family - * id for the current finder font. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static int -GetFinderFont(int *finderID) -{ - OSErr err = noErr; - OSType finderPrefs, viewFont = 'vfnt'; - DescType returnType; - Size returnSize; - long result, sys8Mask = 0x0800; - static AppleEvent outgoingAevt = {typeNull, NULL}; - AppleEvent returnAevt; - AEAddressDesc fndrAddress; - AEDesc nullContainer = {typeNull, NULL}, - tempDesc = {typeNull, NULL}, - tempDesc2 = {typeNull, NULL}, - finalDesc = {typeNull, NULL}; - const OSType finderSignature = 'MACS'; - - - if (outgoingAevt.descriptorType == typeNull) { - if ((Gestalt(gestaltSystemVersion, &result) != noErr) - || (result >= sys8Mask)) { - finderPrefs = 'pfrp'; - } else { - finderPrefs = 'pvwp'; - } - - AECreateDesc(typeApplSignature, &finderSignature, - sizeof(finderSignature), &fndrAddress); - - err = AECreateAppleEvent(kAECoreSuite, kAEGetData, &fndrAddress, - kAutoGenerateReturnID, kAnyTransactionID, &outgoingAevt); - - AEDisposeDesc(&fndrAddress); - - /* - * The structure is: - * the property view font ('vfnt') - * of the property view preferences ('pvwp') - * of the Null Container (i.e. the Finder itself). - */ - - AECreateDesc(typeType, &finderPrefs, sizeof(finderPrefs), &tempDesc); - err = CreateObjSpecifier(typeType, &nullContainer, formPropertyID, - &tempDesc, true, &tempDesc2); - AECreateDesc(typeType, &viewFont, sizeof(viewFont), &tempDesc); - err = CreateObjSpecifier(typeType, &tempDesc2, formPropertyID, - &tempDesc, true, &finalDesc); - - AEPutKeyDesc(&outgoingAevt, keyDirectObject, &finalDesc); - AEDisposeDesc(&finalDesc); - } - - err = AESend(&outgoingAevt, &returnAevt, kAEWaitReply, kAEHighPriority, - kAEDefaultTimeout, NULL, NULL); - if (err == noErr) { - err = AEGetKeyPtr(&returnAevt, keyDirectObject, typeInteger, - &returnType, (void *) finderID, sizeof(int), &returnSize); - if (err == noErr) { - return TCL_OK; - } - } - return TCL_ERROR; -} - -/* - *--------------------------------------------------------------------------- - * - * TclMacGetFontEncoding -- - * - * Determine the encoding of the specified font. The encoding - * can be used to convert bytes from UTF-8 into the encoding of - * that font. - * - * Results: - * The return value is a string that specifies the font's encoding - * and that can be passed to Tcl_GetEncoding() to construct the - * encoding. If the font's encoding could not be identified, NULL - * is returned. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -char * -TclMacGetFontEncoding( - int fontId) -{ - int script, lang; - char *name; - Map *mapPtr; - - script = FontToScript(fontId); - lang = GetScriptVariable(script, smScriptLang); - name = NULL; - if (script == smRoman) { - for (mapPtr = romanMap; mapPtr->strKey != NULL; mapPtr++) { - if (mapPtr->numKey == lang) { - name = mapPtr->strKey; - break; - } - } - } else if (script == smCyrillic) { - for (mapPtr = cyrillicMap; mapPtr->strKey != NULL; mapPtr++) { - if (mapPtr->numKey == lang) { - name = mapPtr->strKey; - break; - } - } - } - if (name == NULL) { - for (mapPtr = scriptMap; mapPtr->strKey != NULL; mapPtr++) { - if (mapPtr->numKey == script) { - name = mapPtr->strKey; - break; - } - } - } - return name; -} - -/* - *--------------------------------------------------------------------------- - * - * TclpInitPlatform -- - * - * Initialize all the platform-dependant things like signals and - * floating-point error handling. - * - * Called at process initialization time. - * - * Results: - * None. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -void -TclpInitPlatform() -{ - tclPlatform = TCL_PLATFORM_MAC; -} - -/* - *--------------------------------------------------------------------------- - * - * TclpInitLibraryPath -- - * - * Initialize the library path at startup. We have a minor - * metacircular problem that we don't know the encoding of the - * operating system but we may need to talk to operating system - * to find the library directories so that we know how to talk to - * the operating system. - * - * We do not know the encoding of the operating system. - * We do know that the encoding is some multibyte encoding. - * In that multibyte encoding, the characters 0..127 are equivalent - * to ascii. - * - * So although we don't know the encoding, it's safe: - * to look for the last colon character in a path in the encoding. - * to append an ascii string to a path. - * to pass those strings back to the operating system. - * - * But any strings that we remembered before we knew the encoding of - * the operating system must be translated to UTF-8 once we know the - * encoding so that the rest of Tcl can use those strings. - * - * This call sets the library path to strings in the unknown native - * encoding. TclpSetInitialEncodings() will translate the library - * path from the native encoding to UTF-8 as soon as it determines - * what the native encoding actually is. - * - * Called at process initialization time. - * - * Results: - * None. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -void -TclpInitLibraryPath(argv0) - CONST char *argv0; /* Name of executable from argv[0] to main(). - * Not used because we can determine the name - * by querying the module handle. */ -{ - Tcl_Obj *objPtr, *pathPtr; - char *str; - Tcl_DString ds; - - TclMacCreateEnv(); - - pathPtr = Tcl_NewObj(); - - str = TclGetEnv("TCL_LIBRARY", &ds); - if ((str != NULL) && (str[0] != '\0')) { - /* - * If TCL_LIBRARY is set, search there. - */ - - objPtr = Tcl_NewStringObj(str, -1); - Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); - Tcl_DStringFree(&ds); - } - - objPtr = TclGetLibraryPath(); - if (objPtr != NULL) { - Tcl_ListObjAppendList(NULL, pathPtr, objPtr); - } - - /* - * lappend path [file join $env(EXT_FOLDER) \ - * ":Tool Command Language:tcl[info version]" - */ - - str = TclGetEnv("EXT_FOLDER", &ds); - if ((str != NULL) && (str[0] != '\0')) { - objPtr = Tcl_NewStringObj(str, -1); - if (str[strlen(str) - 1] != ':') { - Tcl_AppendToObj(objPtr, ":", 1); - } - Tcl_AppendToObj(objPtr, "Tool Command Language:tcl" TCL_VERSION, -1); - Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); - Tcl_DStringFree(&ds); - } - TclSetLibraryPath(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. - * - * Results: - * None. - * - * Side effects: - * The Tcl library path is converted from native encoding to UTF-8. - * - *--------------------------------------------------------------------------- - */ - -void -TclpSetInitialEncodings() -{ - CONST char *encoding; - Tcl_Obj *pathPtr; - int fontId; - - fontId = 0; - GetFinderFont(&fontId); - encoding = TclMacGetFontEncoding(fontId); - if (encoding == NULL) { - encoding = "macRoman"; - } - - Tcl_SetSystemEncoding(NULL, encoding); - - /* - * Until the system encoding was actually set, the library path was - * actually in the native multi-byte encoding, and not really UTF-8 - * as advertised. We cheated as follows: - * - * 1. It was safe to allow the Tcl_SetSystemEncoding() call to - * append the ASCII chars that make up the encoding's filename to - * the names (in the native encoding) of directories in the library - * path, since all Unix multi-byte encodings have ASCII in the - * beginning. - * - * 2. To open the encoding file, the native bytes in the file name - * were passed to the OS, without translating from UTF-8 to native, - * because the name was already in the native encoding. - * - * Now that the system encoding was actually successfully set, - * translate all the names in the library path to UTF-8. That way, - * next time we search the library path, we'll translate the names - * from UTF-8 to the system encoding which will be the native - * encoding. - */ - - pathPtr = TclGetLibraryPath(); - if (pathPtr != NULL) { - int i, objc; - Tcl_Obj **objv; - - objc = 0; - Tcl_ListObjGetElements(NULL, pathPtr, &objc, &objv); - for (i = 0; i < objc; i++) { - int length; - char *string; - Tcl_DString ds; - - string = Tcl_GetStringFromObj(objv[i], &length); - Tcl_ExternalToUtfDString(NULL, string, length, &ds); - Tcl_SetStringObj(objv[i], Tcl_DStringValue(&ds), - Tcl_DStringLength(&ds)); - Tcl_DStringFree(&ds); - } - } - - /* - * Keep the iso8859-1 encoding preloaded. The IO package uses it for - * gets on a binary channel. - */ - - Tcl_GetEncoding(NULL, "iso8859-1"); -} - -/* - *--------------------------------------------------------------------------- - * - * 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 "tcl_library" and "tcl_platform" Tcl variables. - * - *---------------------------------------------------------------------- - */ - -void -TclpSetVariables(interp) - Tcl_Interp *interp; -{ - long int gestaltResult; - int minor, major, objc; - Tcl_Obj **objv; - char versStr[2 * TCL_INTEGER_SPACE]; - char *str; - Tcl_Obj *pathPtr; - Tcl_DString ds; - - str = "no library"; - pathPtr = TclGetLibraryPath(); - if (pathPtr != NULL) { - objc = 0; - Tcl_ListObjGetElements(NULL, pathPtr, &objc, &objv); - if (objc > 0) { - str = Tcl_GetStringFromObj(objv[0], NULL); - } - } - Tcl_SetVar(interp, "tcl_library", str, TCL_GLOBAL_ONLY); - - if (pathPtr != NULL) { - Tcl_SetVar2Ex(interp, "tcl_pkgPath", NULL, pathPtr, TCL_GLOBAL_ONLY); - } - - Tcl_SetVar2(interp, "tcl_platform", "platform", "macintosh", - TCL_GLOBAL_ONLY); - Tcl_SetVar2(interp, "tcl_platform", "os", "MacOS", TCL_GLOBAL_ONLY); - Gestalt(gestaltSystemVersion, &gestaltResult); - major = (gestaltResult & 0x0000FF00) >> 8; - minor = (gestaltResult & 0x000000F0) >> 4; - sprintf(versStr, "%d.%d", major, minor); - Tcl_SetVar2(interp, "tcl_platform", "osVersion", versStr, TCL_GLOBAL_ONLY); -#if GENERATINGPOWERPC - Tcl_SetVar2(interp, "tcl_platform", "machine", "ppc", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp, "tcl_platform", "machine", "68k", TCL_GLOBAL_ONLY); -#endif - - /* - * Copy USER or LOGIN environment variable into tcl_platform(user) - * These are set by SystemVariables in tclMacEnv.c - */ - - Tcl_DStringInit(&ds); - str = TclGetEnv("USER", &ds); - if (str == NULL) { - str = TclGetEnv("LOGIN", &ds); - if (str == NULL) { - str = ""; - } - } - Tcl_SetVar2(interp, "tcl_platform", "user", str, TCL_GLOBAL_ONLY); - Tcl_DStringFree(&ds); -} - -/* - *---------------------------------------------------------------------- - * - * TclpCheckStackSpace -- - * - * On a 68K Mac, we can detect if we are about to blow the stack. - * Called before an evaluation can happen when nesting depth is - * checked. - * - * Results: - * 1 if there is enough stack space to continue; 0 if not. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclpCheckStackSpace() -{ - return StackSpace() > TCL_MAC_STACK_THRESHOLD; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Init -- - * - * This procedure is typically invoked by Tcl_AppInit procedures - * to perform additional initialization for a Tcl interpreter, - * such as sourcing the "init.tcl" script. - * - * Results: - * Returns a standard Tcl completion code and sets the interp's result - * if there is an error. - * - * Side effects: - * Depends on what's in the init.tcl script. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Init( - Tcl_Interp *interp) /* Interpreter to initialize. */ -{ - Tcl_Obj *pathPtr; - - /* - * For Macintosh applications the Init function may be contained in - * the application resources. If it exists we use it - otherwise we - * look in the tcl_library directory. Ditto for the history command. - */ - - pathPtr = TclGetLibraryPath(); - if (pathPtr == NULL) { - pathPtr = Tcl_NewObj(); - } - Tcl_SetVar2Ex(interp, "auto_path", NULL, pathPtr, TCL_GLOBAL_ONLY); - return Tcl_Eval(interp, initCmd); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SourceRCFile -- - * - * This procedure is typically invoked by Tcl_Main or Tk_Main - * procedure to source an application specific rc file into the - * interpreter at startup time. This will either source a file - * in the "tcl_rcFileName" variable or a TEXT resource in the - * "tcl_rcRsrcName" variable. - * - * Results: - * None. - * - * Side effects: - * Depends on what's in the rc script. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SourceRCFile( - Tcl_Interp *interp) /* Interpreter to source rc file into. */ -{ - Tcl_DString temp; - char *fileName; - Tcl_Channel errChannel; - Handle h; - - fileName = Tcl_GetVar(interp, "tcl_rcFileName", TCL_GLOBAL_ONLY); - - if (fileName != NULL) { - Tcl_Channel c; - char *fullName; - - Tcl_DStringInit(&temp); - fullName = Tcl_TranslateFileName(interp, fileName, &temp); - if (fullName == NULL) { - /* - * Couldn't translate the file name (e.g. it referred to a - * bogus user or there was no HOME environment variable). - * Just do nothing. - */ - } else { - - /* - * Test for the existence of the rc file before trying to read it. - */ - - c = Tcl_OpenFileChannel(NULL, fullName, "r", 0); - if (c != (Tcl_Channel) NULL) { - Tcl_Close(NULL, c); - if (Tcl_EvalFile(interp, fullName) != TCL_OK) { - errChannel = Tcl_GetStdChannel(TCL_STDERR); - if (errChannel) { - Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp)); - Tcl_WriteChars(errChannel, "\n", 1); - } - } - } - } - Tcl_DStringFree(&temp); - } - - fileName = Tcl_GetVar(interp, "tcl_rcRsrcName", TCL_GLOBAL_ONLY); - - if (fileName != NULL) { - c2pstr(fileName); - h = GetNamedResource('TEXT', (StringPtr) fileName); - p2cstr((StringPtr) fileName); - if (h != NULL) { - if (Tcl_MacEvalResource(interp, fileName, 0, NULL) != TCL_OK) { - errChannel = Tcl_GetStdChannel(TCL_STDERR); - if (errChannel) { - Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp)); - Tcl_WriteChars(errChannel, "\n", 1); - } - } - Tcl_ResetResult(interp); - ReleaseResource(h); - } - } -} diff --git a/mac/tclMacInt.h b/mac/tclMacInt.h deleted file mode 100644 index f721e0f..0000000 --- a/mac/tclMacInt.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * tclMacInt.h -- - * - * Declarations of Macintosh specific shared variables and procedures. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacInt.h,v 1.4 1999/04/16 00:47:20 stanton Exp $ - */ - -#ifndef _TCLMACINT -#define _TCLMACINT - -#ifndef _TCL -# include "tcl.h" -#endif -#ifndef _TCLMAC -# include "tclMac.h" -#endif - -#include -#include - -#pragma export on - -/* - * Defines to control stack behavior - */ - -#define TCL_MAC_68K_STACK_GROWTH (256*1024) -#define TCL_MAC_STACK_THRESHOLD 16384 - -/* - * This flag is passed to TclMacRegisterResourceFork - * by a file (usually a library) whose resource fork - * should not be closed by the resource command. - */ - -#define TCL_RESOURCE_DONT_CLOSE 2 - -/* - * Typedefs used by Macintosh parts of Tcl. - */ -typedef pascal void (*ExitToShellProcPtr)(void); - -/* - * Prototypes of Mac only internal functions. - */ - -EXTERN char * TclMacGetFontEncoding _ANSI_ARGS_((int fontId)); -EXTERN int TclMacHaveThreads(void); - -#include "tclIntPlatDecls.h" - -#pragma export reset - -#endif /* _TCLMACINT */ diff --git a/mac/tclMacInterupt.c b/mac/tclMacInterupt.c deleted file mode 100644 index 7f37d2f..0000000 --- a/mac/tclMacInterupt.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - * tclMacInterupt.c -- - * - * This file contains routines that deal with the Macintosh's low level - * time manager. This code provides a better resolution timer than what - * can be provided by WaitNextEvent. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacInterupt.c,v 1.2 1998/09/14 18:40:05 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclMacInt.h" -#include -#include -#include - -/* - * Data structure for timer tasks. - */ -typedef struct TMInfo { - TMTask tmTask; - ProcessSerialNumber psn; - Point lastPoint; - Point newPoint; - long currentA5; - long ourA5; - int installed; -} TMInfo; - -/* - * Globals used within this file. - */ - -static TimerUPP sleepTimerProc = NULL; -static int interuptsInited = false; -static ProcessSerialNumber applicationPSN; -#define MAX_TIMER_ARRAY_SIZE 16 -static TMInfo timerInfoArray[MAX_TIMER_ARRAY_SIZE]; -static int topTimerElement = 0; - -/* - * Prototypes for procedures that are referenced only in this file: - */ - -#if !GENERATINGCFM -static TMInfo * GetTMInfo(void) ONEWORDINLINE(0x2E89); /* MOVE.L A1,(SP) */ -#endif -static void SleepTimerProc _ANSI_ARGS_((void)); -static pascal void CleanUpExitProc _ANSI_ARGS_((void)); -static void InitInteruptSystem _ANSI_ARGS_((void)); - -/* - *---------------------------------------------------------------------- - * - * InitInteruptSystem -- - * - * Does various initialization for the functions used in this - * file. Sets up Universial Pricedure Pointers, installs a trap - * patch for ExitToShell, etc. - * - * Results: - * None. - * - * Side effects: - * Various initialization. - * - *---------------------------------------------------------------------- - */ - -void -InitInteruptSystem() -{ - int i; - - sleepTimerProc = NewTimerProc(SleepTimerProc); - GetCurrentProcess(&applicationPSN); - for (i = 0; i < MAX_TIMER_ARRAY_SIZE; i++) { - timerInfoArray[i].installed = false; - } - - /* - * Install the ExitToShell patch. We use this patch instead - * of the Tcl exit mechanism because we need to ensure that - * these routines are cleaned up even if we crash or are forced - * to quit. There are some circumstances when the Tcl exit - * handlers may not fire. - */ - - TclMacInstallExitToShellPatch(CleanUpExitProc); - interuptsInited = true; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacStartTimer -- - * - * Install a Time Manager task to wake our process up in the - * future. The process should get a NULL event after ms - * milliseconds. - * - * Results: - * None. - * - * Side effects: - * Schedules our process to wake up. - * - *---------------------------------------------------------------------- - */ - -void * -TclMacStartTimer( - long ms) /* Milliseconds. */ -{ - TMInfo *timerInfoPtr; - - if (!interuptsInited) { - InitInteruptSystem(); - } - - /* - * Obtain a pointer for the timer. We only allocate up - * to MAX_TIMER_ARRAY_SIZE timers. If we are past that - * max we return NULL. - */ - if (topTimerElement < MAX_TIMER_ARRAY_SIZE) { - timerInfoPtr = &timerInfoArray[topTimerElement]; - topTimerElement++; - } else { - return NULL; - } - - /* - * Install timer to wake process in ms milliseconds. - */ - timerInfoPtr->tmTask.tmAddr = sleepTimerProc; - timerInfoPtr->tmTask.tmWakeUp = 0; - timerInfoPtr->tmTask.tmReserved = 0; - timerInfoPtr->psn = applicationPSN; - timerInfoPtr->installed = true; - - InsTime((QElemPtr) timerInfoPtr); - PrimeTime((QElemPtr) timerInfoPtr, (long) ms); - - return (void *) timerInfoPtr; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacRemoveTimer -- - * - * Remove the timer event from the Time Manager. - * - * Results: - * None. - * - * Side effects: - * A scheduled timer would be removed. - * - *---------------------------------------------------------------------- - */ - -void -TclMacRemoveTimer( - void * timerToken) /* Token got from start timer. */ -{ - TMInfo *timerInfoPtr = (TMInfo *) timerToken; - - if (timerInfoPtr == NULL) { - return; - } - - RmvTime((QElemPtr) timerInfoPtr); - timerInfoPtr->installed = false; - topTimerElement--; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacTimerExpired -- - * - * Check to see if the installed timer has expired. - * - * Results: - * True if timer has expired, false otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclMacTimerExpired( - void * timerToken) /* Our token again. */ -{ - TMInfo *timerInfoPtr = (TMInfo *) timerToken; - - if ((timerInfoPtr == NULL) || - !(timerInfoPtr->tmTask.qType & kTMTaskActive)) { - return true; - } else { - return false; - } -} - -/* - *---------------------------------------------------------------------- - * - * SleepTimerProc -- - * - * Time proc is called by the is a callback routine placed in the - * system by Tcl_Sleep. The routine is called at interupt time - * and threrfor can not move or allocate memory. This call will - * schedule our process to wake up the next time the process gets - * around to consider running it. - * - * Results: - * None. - * - * Side effects: - * Schedules our process to wake up. - * - *---------------------------------------------------------------------- - */ - -static void -SleepTimerProc() -{ - /* - * In CFM code we can access our code directly. In 68k code that - * isn't based on CFM we must do a glorious hack. The function - * GetTMInfo is an inline assembler call that moves the pointer - * at A1 to the top of the stack. The Time Manager keeps the TMTask - * info record there before calling this call back. In order for - * this to work the infoPtr argument must be the *last* item on the - * stack. If we "piggyback" our data to the TMTask info record we - * can get access to the information we need. While this is really - * ugly - it's the way Apple recomends it be done - go figure... - */ - -#if GENERATINGCFM - WakeUpProcess(&applicationPSN); -#else - TMInfo * infoPtr; - - infoPtr = GetTMInfo(); - WakeUpProcess(&infoPtr->psn); -#endif -} - -/* - *---------------------------------------------------------------------- - * - * CleanUpExitProc -- - * - * This procedure is invoked as an exit handler when ExitToShell - * is called. It removes the system level timer handler if it - * is installed. This must be called or the Mac OS will more than - * likely crash. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static pascal void -CleanUpExitProc() -{ - int i; - - for (i = 0; i < MAX_TIMER_ARRAY_SIZE; i++) { - if (timerInfoArray[i].installed) { - RmvTime((QElemPtr) &timerInfoArray[i]); - timerInfoArray[i].installed = false; - } - } -} diff --git a/mac/tclMacLibrary.c b/mac/tclMacLibrary.c deleted file mode 100644 index ea84b9d..0000000 --- a/mac/tclMacLibrary.c +++ /dev/null @@ -1,241 +0,0 @@ -/* - * tclMacLibrary.c -- - * - * This file should be included in Tcl extensions that want to - * automatically oepn their resource forks when the code is linked. - * These routines should not be exported but should be compiled - * locally by each fragment. Many thanks to Jay Lieske - * who provide an initial version of this - * file. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacLibrary.c,v 1.2 1998/09/14 18:40:05 stanton Exp $ - */ - -/* - * Here is another place that we are using the old routine names... - */ - -#define OLDROUTINENAMES 1 - -#include -#include -#include -#include -#include "tclMacInt.h" - -/* - * These function are not currently defined in any header file. The - * only place they should be used is in the Initialization and - * Termination entry points for a code fragment. The prototypes - * are included here to avoid compile errors. - */ - -OSErr TclMacInitializeFragment _ANSI_ARGS_(( - struct CFragInitBlock* initBlkPtr)); -void TclMacTerminateFragment _ANSI_ARGS_((void)); - -/* - * Static functions in this file. - */ - -static OSErr OpenLibraryResource _ANSI_ARGS_(( - struct CFragInitBlock* initBlkPtr)); -static void CloseLibraryResource _ANSI_ARGS_((void)); - -/* - * The refnum of the opened resource fork. - */ -static short ourResFile = kResFileNotOpened; - -/* - * This is the resource token for the our resource file. - * It stores the name we registered with the resource facility. - * We only need to use this if we are actually registering ourselves. - */ - -#ifdef TCL_REGISTER_LIBRARY -static Tcl_Obj *ourResToken; -#endif - -/* - *---------------------------------------------------------------------- - * - * TclMacInitializeFragment -- - * - * Called by MacOS CFM when the shared library is loaded. All this - * function really does is give Tcl a chance to open and register - * the resource fork of the library. - * - * Results: - * MacOS error code if loading should be canceled. - * - * Side effects: - * Opens the resource fork of the shared library file. - * - *---------------------------------------------------------------------- - */ - -OSErr -TclMacInitializeFragment( - struct CFragInitBlock* initBlkPtr) /* Pointer to our library. */ -{ - OSErr err = noErr; - -#ifdef __MWERKS__ - { - extern OSErr __initialize( CFragInitBlock* initBlkPtr); - err = __initialize((CFragInitBlock *) initBlkPtr); - } -#endif - if (err == noErr) - err = OpenLibraryResource( initBlkPtr); - return err; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacTerminateFragment -- - * - * Called by MacOS CFM when the shared library is unloaded. - * - * Results: - * None. - * - * Side effects: - * The resource fork of the code fragment is closed. - * - *---------------------------------------------------------------------- - */ - -void -TclMacTerminateFragment() -{ - CloseLibraryResource(); - -#ifdef __MWERKS__ - { - extern void __terminate(void); - __terminate(); - } -#endif -} - -/* - *---------------------------------------------------------------------- - * - * OpenLibraryResource -- - * - * This routine can be called by a MacOS fragment's initialiation - * function to open the resource fork of the file. - * Call it with the same data passed to the initialization function. - * If the fragment loading should fail if the resource fork can't - * be opened, then the initialization function can pass on this - * return value. - * - * If you #define TCL_REGISTER_RESOURCE before compiling this resource, - * then your library will register its open resource fork with the - * resource command. - * - * Results: - * It returns noErr on success and a MacOS error code on failure. - * - * Side effects: - * The resource fork of the code fragment is opened read-only and - * is installed at the head of the resource chain. - * - *---------------------------------------------------------------------- - */ - -static OSErr -OpenLibraryResource( - struct CFragInitBlock* initBlkPtr) -{ - /* - * The 3.0 version of the Universal headers changed CFragInitBlock - * to an opaque pointer type. CFragSystem7InitBlock is now the - * real pointer. - */ - -#if !defined(UNIVERSAL_INTERFACES_VERSION) || (UNIVERSAL_INTERFACES_VERSION < 0x0300) - struct CFragInitBlock *realInitBlkPtr = initBlkPtr; -#else - CFragSystem7InitBlock *realInitBlkPtr = (CFragSystem7InitBlock *) initBlkPtr; -#endif - FSSpec* fileSpec = NULL; - OSErr err = noErr; - - - if (realInitBlkPtr->fragLocator.where == kOnDiskFlat) { - fileSpec = realInitBlkPtr->fragLocator.u.onDisk.fileSpec; - } else if (realInitBlkPtr->fragLocator.where == kOnDiskSegmented) { - fileSpec = realInitBlkPtr->fragLocator.u.inSegs.fileSpec; - } else { - err = resFNotFound; - } - - /* - * Open the resource fork for this library in read-only mode. - * This will make it the current res file, ahead of the - * application's own resources. - */ - - if (fileSpec != NULL) { - ourResFile = FSpOpenResFile(fileSpec, fsRdPerm); - if (ourResFile == kResFileNotOpened) { - err = ResError(); - } else { -#ifdef TCL_REGISTER_LIBRARY - ourResToken = Tcl_NewObj(); - Tcl_IncrRefCount(ourResToken); - p2cstr(realInitBlkPtr->libName); - Tcl_SetStringObj(ourResToken, (char *) realInitBlkPtr->libName, -1); - c2pstr((char *) realInitBlkPtr->libName); - TclMacRegisterResourceFork(ourResFile, ourResToken, - TCL_RESOURCE_DONT_CLOSE); -#endif - SetResFileAttrs(ourResFile, mapReadOnly); - } - } - - return err; -} - -/* - *---------------------------------------------------------------------- - * - * CloseLibraryResource -- - * - * This routine should be called by a MacOS fragment's termination - * function to close the resource fork of the file - * that was opened with OpenLibraryResource. - * - * Results: - * None. - * - * Side effects: - * The resource fork of the code fragment is closed. - * - *---------------------------------------------------------------------- - */ - -static void -CloseLibraryResource() -{ - if (ourResFile != kResFileNotOpened) { -#ifdef TCL_REGISTER_LIBRARY - int length; - TclMacUnRegisterResourceFork( - Tcl_GetStringFromObj(ourResToken, &length), - NULL); - Tcl_DecrRefCount(ourResToken); -#endif - CloseResFile(ourResFile); - ourResFile = kResFileNotOpened; - } -} diff --git a/mac/tclMacLibrary.r b/mac/tclMacLibrary.r deleted file mode 100644 index eda1f7f..0000000 --- a/mac/tclMacLibrary.r +++ /dev/null @@ -1,221 +0,0 @@ -/* - * tclMacLibrary.r -- - * - * This file creates resources used by the Tcl shared library. - * Many thanks go to "Jay Lieske, Jr." who - * wrote the initial version of this file. - * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacLibrary.r,v 1.3 1999/04/16 00:47:20 stanton Exp $ - */ - -#include -#include - -/* - * The folowing include and defines help construct - * the version string for Tcl. - */ - -#define RESOURCE_INCLUDED -#include "tcl.h" - -#if (TCL_RELEASE_LEVEL == 0) -# define RELEASE_LEVEL alpha -#elif (TCL_RELEASE_LEVEL == 1) -# define RELEASE_LEVEL beta -#elif (TCL_RELEASE_LEVEL == 2) -# define RELEASE_LEVEL final -#endif - -#if (TCL_RELEASE_LEVEL == 2) -# define MINOR_VERSION (TCL_MINOR_VERSION * 16) + TCL_RELEASE_SERIAL -#else -# define MINOR_VERSION TCL_MINOR_VERSION * 16 -#endif - -resource 'vers' (1) { - TCL_MAJOR_VERSION, MINOR_VERSION, - RELEASE_LEVEL, 0x00, verUS, - TCL_PATCH_LEVEL, - TCL_PATCH_LEVEL ", by Ray Johnson © Sun Microsystems" -}; - -resource 'vers' (2) { - TCL_MAJOR_VERSION, MINOR_VERSION, - RELEASE_LEVEL, 0x00, verUS, - TCL_PATCH_LEVEL, - "Tcl Library " TCL_PATCH_LEVEL " © 1996" -}; - -/* - * Currently the creator for all Tcl/Tk libraries and extensions - * should be 'TclL'. This will allow those extension and libraries - * to use the common icon for Tcl extensions. However, this signature - * still needs to be approved by the signature police at Apple and may - * change. - */ -#define TCL_CREATOR 'TclL' -#define TCL_LIBRARY_RESOURCES 2000 - -/* - * The 'BNDL' resource is the primary link between a file's - * creator/type and its icon. This resource acts for all Tcl shared - * libraries; other libraries will not need one and ought to use - * custom icons rather than new file types for a different appearance. - */ - -resource 'BNDL' (TCL_LIBRARY_RESOURCES, "Tcl bundle", purgeable) -{ - TCL_CREATOR, - 0, - { /* array TypeArray: 2 elements */ - /* [1] */ - 'FREF', - { /* array IDArray: 1 elements */ - /* [1] */ - 0, TCL_LIBRARY_RESOURCES - }, - /* [2] */ - 'ICN#', - { /* array IDArray: 1 elements */ - /* [1] */ - 0, TCL_LIBRARY_RESOURCES - } - } -}; - -resource 'FREF' (TCL_LIBRARY_RESOURCES, purgeable) -{ - 'shlb', 0, "" -}; - -type TCL_CREATOR as 'STR '; -resource TCL_CREATOR (0, purgeable) { - "Tcl Library " TCL_PATCH_LEVEL " © 1996" -}; - -/* - * The 'kind' resource works with a 'BNDL' in Macintosh Easy Open - * to affect the text the Finder displays in the "kind" column and - * file info dialog. This information will be applied to all files - * with the listed creator and type. - */ - -resource 'kind' (TCL_LIBRARY_RESOURCES, "Tcl kind", purgeable) { - TCL_CREATOR, - 0, /* region = USA */ - { - 'shlb', "Tcl Library" - } -}; - - -/* - * The -16397 string will be displayed by Finder when a user - * tries to open the shared library. The string should - * give the user a little detail about the library's capabilities - * and enough information to install the library in the correct location. - * A similar string should be placed in all shared libraries. - */ -resource 'STR ' (-16397, purgeable) { - "Tcl Library\n\n" - "This is the core library needed to run Tool Command Language programs. " - "To work properly, it should be placed in the ÔTool Command LanguageÕ folder " - "within the Extensions folder." -}; - -/* - * The mechanisim below loads Tcl source into the resource fork of the - * application. The example below creates a TEXT resource named - * "Init" from the file "init.tcl". This allows applications to use - * Tcl to define the behavior of the application without having to - * require some predetermined file structure - all needed Tcl "files" - * are located within the application. To source a file for the - * resource fork the source command has been modified to support - * sourcing from resources. In the below case "source -rsrc {Init}" - * will load the TEXT resource named "Init". - */ - -#include "tclMacTclCode.r" - -/* - * The following are icons for the shared library. - */ - -data 'icl4' (2000, "Tcl Shared Library", purgeable) { - $"0FFF FFFF FFFF FFFF FFFF FFFF FFFF 0000" - $"F000 0000 0000 0000 0000 0000 000C F000" - $"F0CC CFFF CCCC CCC6 66CC CCCC CCCC F000" - $"F0CC CFFF FFFF FF66 F6CC CCCC CCCC F000" - $"F0CC CFFF 2000 0D66 6CCC CCCC CCCC F000" - $"F0CC CFFF 0202 056F 6E5C CCCC CCCC F000" - $"F0CC CFFF 2020 C666 F66F CCCC CCCC F000" - $"F0CC CFFF 0200 B66F 666B FCCC CCCC F000" - $"F0FC CFFF B020 55F6 6F52 BFCC CCCC F000" - $"FF0F 0CCC FB02 5665 66D0 2FCC CCCC F0F0" - $"F00F 0CCC CFB0 BF55 F6CF FFCC CCCC FFCF" - $"000F 0CCC CCFB 06C9 66CC CCCC CCCC F0CF" - $"000F 0CCC CCCF 56C6 6CCC CCCC CCCC CCCF" - $"000F 0CCC CCCC 6FC6 FCCC CCCC CCCC CCCF" - $"000F 0CCC CCCC 65C5 65CC CCCC CCCC CCCF" - $"000F 0CCC CCCC 55D6 57CC CCCC CCCC CCCF" - $"000F 0CCC CCCC 65CF 6CCC CCCC CCCC CCCF" - $"000F 0CCC CCCC 5AC6 6CFF CCCC CCCC CCCF" - $"000F 0CCC CCCC 65C5 6CF0 FCCC CCCC CCCF" - $"000F 0CCC CCCC CECF CCF0 0FCC CCCC CCCF" - $"000F 0CCC CCCC C5C6 CCCF 20FC CCCC FCCF" - $"F00F 0CCC CCCF FFD5 CCCC F20F CCCC FFCF" - $"FF0F 0CCC CCCF 20CF CCCC F020 FCCC F0F0" - $"F0F0 CCCC CCCF B2C2 FFFF 0002 0FFC F000" - $"F00C CCCC CCCC FBC0 2000 0020 2FFC F000" - $"F0CC CCCC CCCC CFCB 0202 0202 0FFC F000" - $"F0CC CCCC CCCC CCCF B020 2020 2FFC F000" - $"F0CC CCCC CCCC CCDC FBBB BBBB BFFC F000" - $"F0CC CCCC CCCC CCCC CFFF FFFF FFFC F000" - $"F0CC CCCC CCCC CCCC CCCC CCCC CFFC F000" - $"FCCC CCCC CCCC CCCC CCCC CCCC CCCC F000" - $"0FFF FFFF FFFF FFFF FFFF FFFF FFFF 0000" -}; - -data 'ICN#' (2000, "Tcl Shared Library", purgeable) { - $"7FFF FFF0 8000 0008 8701 C008 87FF C008" - $"8703 8008 8707 E008 8707 F008 870F F808" - $"A78F EC08 D0CF C40A 906F DC0D 1035 C009" - $"101D 8001 100D 8001 100D C001 100D C001" - $"100D 8001 100D B001 100D A801 1005 2401" - $"1005 1209 901D 090D D011 088A A018 F068" - $"800C 0068 8005 0068 8001 8068 8000 FFE8" - $"8000 7FE8 8000 0068 8000 0008 7FFF FFF0" - $"7FFF FFF0 FFFF FFF8 FFFF FFF8 FFFF FFF8" - $"FFFF FFF8 FFFF FFF8 FFFF FFF8 FFFF FFF8" - $"FFFF FFF8 DFFF FFFA 9FFF FFFF 1FFF FFFF" - $"1FFF FFFF 1FFF FFFF 1FFF FFFF 1FFF FFFF" - $"1FFF FFFF 1FFF FFFF 1FFF FFFF 1FFF FFFF" - $"1FFF FFFF 9FFF FFFF DFFF FFFA FFFF FFF8" - $"FFFF FFF8 FFFF FFF8 FFFF FFF8 FFFF FFF8" - $"FFFF FFF8 FFFF FFF8 FFFF FFF8 7FFF FFF0" -}; - -data 'ics#' (2000, "Tcl Shared Library", purgeable) { - $"FFFE B582 BB82 B3C2 BFA2 43C3 4381 4381" - $"4381 4763 4392 856E 838E 81AE 811E FFFE" - $"FFFE FFFE FFFE FFFE FFFE FFFF 7FFF 7FFF" - $"7FFF 7FFF 7FFF FFFE FFFE FFFE FFFE FFFE" -}; - -data 'ics4' (2000, "Tcl Shared Library", purgeable) { - $"FFFF FFFF FFFF FFF0 FCFF DED5 6CCC CCF0" - $"FCFF C0D6 ECCC CCF0 FCFF 2056 65DC CCF0" - $"FDFE D256 6DAC CCFF FFCC DDDE 5DDC CCEF" - $"0FCC CD67 5CCC CCCF 0FCC CC5D 6CCC CCCF" - $"0FCC CC5D 5CCC CCCF 0FCC CCD5 5CCC CCCF" - $"FFCC CFFD CCFF CCFF FCCC CF2D DF20 FCFC" - $"FCCC CCFD D202 FEF0 FCCC CC0D 2020 FEF0" - $"FCCC CCCD FBBB FEF0 FFFF FFFF FFFF FFE0" -}; - diff --git a/mac/tclMacLoad.c b/mac/tclMacLoad.c deleted file mode 100644 index 622eb65..0000000 --- a/mac/tclMacLoad.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * tclMacLoad.c -- - * - * This procedure provides a version of the TclLoadFile for use - * on the Macintosh. This procedure will only work with systems - * that use the Code Fragment Manager. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacLoad.c,v 1.3 1999/04/16 00:47:20 stanton Exp $ - */ - -#include -#include -#include -#include -#include - -/* - * Seems that the 3.0.1 Universal headers leave this define out. So we - * define it here... - */ - -#ifndef fragNoErr - #define fragNoErr noErr -#endif - -#include "tclPort.h" -#include "tclInt.h" -#include "tclMacInt.h" - -#if GENERATINGPOWERPC - #define OUR_ARCH_TYPE kPowerPCCFragArch -#else - #define OUR_ARCH_TYPE kMotorola68KCFragArch -#endif - -/* - * The following data structure defines the structure of a code fragment - * resource. We can cast the resource to be of this type to access - * any fields we need to see. - */ -struct CfrgHeader { - long res1; - long res2; - long version; - long res3; - long res4; - long filler1; - long filler2; - long itemCount; - char arrayStart; /* Array of externalItems begins here. */ -}; -typedef struct CfrgHeader CfrgHeader, *CfrgHeaderPtr, **CfrgHeaderPtrHand; - -/* - * The below structure defines a cfrag item within the cfrag resource. - */ -struct CfrgItem { - OSType archType; - long updateLevel; - long currVersion; - long oldDefVersion; - long appStackSize; - short appSubFolder; - char usage; - char location; - long codeOffset; - long codeLength; - long res1; - long res2; - short itemSize; - Str255 name; /* This is actually variable sized. */ -}; -typedef struct CfrgItem CfrgItem; - -/* - *---------------------------------------------------------------------- - * - * TclLoadFile -- - * - * This procedure is called to carry out dynamic loading of binary - * code for the Macintosh. This implementation is based on the - * Code Fragment Manager & will not work on other systems. - * - * Results: - * The result is TCL_ERROR, and an error message is left in - * the interp's result. - * - * Side effects: - * New binary code is loaded. - * - *---------------------------------------------------------------------- - */ - -int -TclpLoadFile( - Tcl_Interp *interp, /* Used for error reporting. */ - char *fileName, /* Name of the file containing the desired - * code. */ - char *sym1, char *sym2, /* Names of two procedures to look up in - * the file's symbol table. */ - Tcl_PackageInitProc **proc1Ptr, - Tcl_PackageInitProc **proc2Ptr, - /* Where to return the addresses corresponding - * to sym1 and sym2. */ - ClientData *clientDataPtr) /* Filled with token for dynamically loaded - * file which will be passed back to - * TclpUnloadFile() to unload the file. */ -{ - CFragConnectionID connID; - Ptr dummy; - OSErr err; - CFragSymbolClass symClass; - FSSpec fileSpec; - short fragFileRef, saveFileRef; - Handle fragResource; - UInt32 offset = 0; - UInt32 length = kCFragGoesToEOF; - char packageName[255]; - Str255 errName; - Tcl_DString ds; - char *native; - - /* - * First thing we must do is infer the package name from the sym1 - * variable. This is kind of dumb since the caller actually knows - * this value, it just doesn't give it to us. - */ - strcpy(packageName, sym1); - Tcl_UtfToLower(packageName); - *(Tcl_UtfAtIndex(packageName, Tcl_NumUtfChars(packageName, -1) - 5)) = 0; - - native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds); - err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); - Tcl_DStringFree(&ds); - - if (err != noErr) { - Tcl_SetResult(interp, "could not locate shared library", TCL_STATIC); - return TCL_ERROR; - } - - /* - * See if this fragment has a 'cfrg' resource. It will tell us where - * to look for the fragment in the file. If it doesn't exist we will - * assume we have a ppc frag using the whole data fork. If it does - * exist we find the frag that matches the one we are looking for and - * get the offset and size from the resource. - */ - - saveFileRef = CurResFile(); - SetResLoad(false); - fragFileRef = FSpOpenResFile(&fileSpec, fsRdPerm); - SetResLoad(true); - if (fragFileRef != -1) { - UseResFile(fragFileRef); - fragResource = Get1Resource(kCFragResourceType, kCFragResourceID); - HLock(fragResource); - if (ResError() == noErr) { - CfrgItem* srcItem; - long itemCount, index; - Ptr itemStart; - - itemCount = (*(CfrgHeaderPtrHand)fragResource)->itemCount; - itemStart = &(*(CfrgHeaderPtrHand)fragResource)->arrayStart; - for (index = 0; index < itemCount; - index++, itemStart += srcItem->itemSize) { - srcItem = (CfrgItem*)itemStart; - if (srcItem->archType != OUR_ARCH_TYPE) continue; - if (!strncasecmp(packageName, (char *) srcItem->name + 1, - srcItem->name[0])) { - offset = srcItem->codeOffset; - length = srcItem->codeLength; - } - } - } - /* - * Close the resource file. If the extension wants to reopen the - * resource fork it should use the tclMacLibrary.c file during it's - * construction. - */ - HUnlock(fragResource); - ReleaseResource(fragResource); - CloseResFile(fragFileRef); - UseResFile(saveFileRef); - } - - /* - * Now we can attempt to load the fragement using the offset & length - * obtained from the resource. We don't worry about the main entry point - * as we are going to search for specific entry points passed to us. - */ - - c2pstr(packageName); - err = GetDiskFragment(&fileSpec, offset, length, (StringPtr) packageName, - kLoadCFrag, &connID, &dummy, errName); - if (err != fragNoErr) { - p2cstr(errName); - Tcl_AppendResult(interp, "couldn't load file \"", fileName, - "\": ", errName, (char *) NULL); - return TCL_ERROR; - } - - c2pstr(sym1); - err = FindSymbol(connID, (StringPtr) sym1, (Ptr *) proc1Ptr, &symClass); - p2cstr((StringPtr) sym1); - if (err != fragNoErr || symClass == kDataCFragSymbol) { - Tcl_SetResult(interp, - "could not find Initialization routine in library", - TCL_STATIC); - return TCL_ERROR; - } - - c2pstr(sym2); - err = FindSymbol(connID, (StringPtr) sym2, (Ptr *) proc2Ptr, &symClass); - p2cstr((StringPtr) sym2); - if (err != fragNoErr || symClass == kDataCFragSymbol) { - *proc2Ptr = NULL; - } - - *clientDataPtr = (ClientData) connID; - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclpUnloadFile -- - * - * 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? - * - *---------------------------------------------------------------------- - */ - -void -TclpUnloadFile(clientData) - ClientData clientData; /* ClientData returned by a previous call - * to TclpLoadFile(). The clientData is - * a token that represents the loaded - * file. */ -{ -} - -/* - *---------------------------------------------------------------------- - * - * TclGuessPackageName -- - * - * If the "load" command is invoked without providing a package - * name, this procedure is invoked to try to figure it out. - * - * Results: - * Always returns 0 to indicate that we couldn't figure out a - * package name; generic code will then try to guess the package - * from the file name. A return value of 1 would have meant that - * we figured out the package name and put it in bufPtr. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclGuessPackageName( - char *fileName, /* Name of file containing package (already - * translated to local form if needed). */ - Tcl_DString *bufPtr) /* Initialized empty dstring. Append - * package name to this if possible. */ -{ - return 0; -} diff --git a/mac/tclMacMSLPrefix.h b/mac/tclMacMSLPrefix.h deleted file mode 100644 index 1d11099..0000000 --- a/mac/tclMacMSLPrefix.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * tclMacMSLPrefix.h -- - * - * A wrapper for the MSL ansi_prefix.mac.h file. This just turns export on - * after including the MSL prefix file, so we can export symbols from the MSL - * and through the Tcl shared libraries - * - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacMSLPrefix.h,v 1.2 1998/09/14 18:40:05 stanton Exp $ - */ - -#include -/* - * "export" is a MetroWerks specific pragma. It flags the linker that - * any symbols that are defined when this pragma is on will be exported - * to shared libraries that link with this library. - */ - -#pragma export on diff --git a/mac/tclMacMath.h b/mac/tclMacMath.h deleted file mode 100644 index 14af9a8..0000000 --- a/mac/tclMacMath.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * tclMacMath.h -- - * - * This file is necessary because of Metrowerks CodeWarrior Pro 1 - * on the Macintosh. With 8-byte doubles turned on, the definitions of - * sin, cos, acos, etc., are screwed up. They are fine as long as - * they are used as function calls, but if the function pointers - * are passed around and used, they will crash hard on the 68K. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacMath.h,v 1.2 1998/09/14 18:40:05 stanton Exp $ - */ - -#ifndef _TCLMACMATH -#define _TCLMACMATH - -#include - -#if defined(__MWERKS__) && !defined(__POWERPC__) -#if __option(IEEEdoubles) - -# ifdef cos -# undef cos -# define cos cosd -# endif - -# ifdef sin -# undef sin -# define sin sind -# endif - -# ifdef tan -# undef tan -# define tan tand -# endif - -# ifdef acos -# undef acos -# define acos acosd -# endif - -# ifdef asin -# undef asin -# define asin asind -# endif - -# ifdef atan -# undef atan -# define atan atand -# endif - -# ifdef cosh -# undef cosh -# define cosh coshd -# endif - -# ifdef sinh -# undef sinh -# define sinh sinhd -# endif - -# ifdef tanh -# undef tanh -# define tanh tanhd -# endif - -# ifdef exp -# undef exp -# define exp expd -# endif - -# ifdef ldexp -# undef ldexp -# define ldexp ldexpd -# endif - -# ifdef log -# undef log -# define log logd -# endif - -# ifdef log10 -# undef log10 -# define log10 log10d -# endif - -# ifdef fabs -# undef fabs -# define fabs fabsd -# endif - -# ifdef sqrt -# undef sqrt -# define sqrt sqrtd -# endif - -# ifdef fmod -# undef fmod -# define fmod fmodd -# endif - -# ifdef atan2 -# undef atan2 -# define atan2 atan2d -# endif - -# ifdef frexp -# undef frexp -# define frexp frexpd -# endif - -# ifdef modf -# undef modf -# define modf modfd -# endif - -# ifdef pow -# undef pow -# define pow powd -# endif - -# ifdef ceil -# undef ceil -# define ceil ceild -# endif - -# ifdef floor -# undef floor -# define floor floord -# endif -#endif -#endif - -#if (defined(THINK_C) || defined(__MWERKS__)) -#pragma export on -double hypotd(double x, double y); -#define hypot hypotd -#pragma export reset -#endif - -#endif /* _TCLMACMATH */ diff --git a/mac/tclMacNotify.c b/mac/tclMacNotify.c deleted file mode 100644 index 773490f..0000000 --- a/mac/tclMacNotify.c +++ /dev/null @@ -1,554 +0,0 @@ -/* - * tclMacNotify.c -- - * - * This file contains Macintosh-specific procedures for the notifier, - * which is the lowest-level part of the Tcl event loop. This file - * works together with ../generic/tclNotify.c. - * - * The Mac notifier only polls for system and OS events, so it is process - * wide, rather than thread specific. However, this means that the convert - * event proc will have to arbitrate which events go to which threads. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacNotify.c,v 1.3 1999/04/16 00:47:20 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclMac.h" -#include "tclMacInt.h" -#include -#include -#include -#include -#include -#include - - -/* - * This is necessary to work around a bug in Apple's Universal header files - * for the CFM68K libraries. - */ - -#ifdef __CFM68K__ -#undef GetEventQueue -extern pascal QHdrPtr GetEventQueue(void) - THREEWORDINLINE(0x2EBC, 0x0000, 0x014A); -#pragma import list GetEventQueue -#define GetEvQHdr() GetEventQueue() -#endif - -/* - * The follwing static indicates whether this module has been initialized. - */ - -static int initialized = 0; - -/* - * The following structure contains the state information for the - * notifier module. - */ - -static struct { - int timerActive; /* 1 if timer is running. */ - Tcl_Time timer; /* Time when next timer event is expected. */ - int flags; /* OR'ed set of flags defined below. */ - Point lastMousePosition; /* Last known mouse location. */ - RgnHandle utilityRgn; /* Region used as the mouse region for - * WaitNextEvent and the update region when - * checking for events. */ - Tcl_MacConvertEventPtr eventProcPtr; - /* This pointer holds the address of the - * function that will handle all incoming - * Macintosh events. */ -} notifier; - -/* - * The following defines are used in the flags field of the notifier struct. - */ - -#define NOTIFY_IDLE (1<<1) /* Tcl_ServiceIdle should be called. */ -#define NOTIFY_TIMER (1<<2) /* Tcl_ServiceTimer should be called. */ - -/* - * Prototypes for procedures that are referenced only in this file: - */ - -static int HandleMacEvents _ANSI_ARGS_((void)); -static void InitNotifier _ANSI_ARGS_((void)); -static void NotifierExitHandler _ANSI_ARGS_(( - ClientData clientData)); - -/* - *---------------------------------------------------------------------- - * - * Tcl_InitNotifier -- - * - * Initializes the platform specific notifier state. There is no thread - * specific platform notifier on the Mac, so this really doesn't do - * anything. However, we need to return the ThreadID, since the generic - * notifier hands this back to us in AlertThread. - * - * Results: - * Returns the threadID for this thread. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -ClientData -Tcl_InitNotifier() -{ - -#ifdef TCL_THREADS - ThreadID curThread; - if (TclMacHaveThreads()) { - GetCurrentThread(&curThread); - return (ClientData) curThread; - } else { - return NULL; - } -#else - return NULL; -#endif - -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_FinalizeNotifier -- - * - * This function is called to cleanup the notifier state before - * a thread is terminated. There is no platform thread specific - * notifier, so this does nothing. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_FinalizeNotifier(clientData) - ClientData clientData; /* Pointer to notifier data. */ -{ - /* Nothing to do on the Mac */ -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_AlertNotifier -- - * - * 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: - * Calls YieldToThread from this thread. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_AlertNotifier(clientData) - ClientData clientData; /* Pointer to thread data. */ -{ - -#ifdef TCL_THREADS - if (TclMacHaveThreads()) { - YieldToThread((ThreadID) clientData); - } -#endif - -} - -/* - *---------------------------------------------------------------------- - * - * InitNotifier -- - * - * Initializes the notifier structure. Note - this function is never - * used. - * - * Results: - * None. - * - * Side effects: - * Creates a new exit handler. - * - *---------------------------------------------------------------------- - */ - -static void -InitNotifier(void) -{ - initialized = 1; - memset(¬ifier, 0, sizeof(notifier)); - Tcl_CreateExitHandler(NotifierExitHandler, NULL); -} - -/* - *---------------------------------------------------------------------- - * - * NotifierExitHandler -- - * - * This function is called to cleanup the notifier state before - * Tcl is unloaded. This function is never used, since InitNotifier - * isn't either. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -NotifierExitHandler( - ClientData clientData) /* Not used. */ -{ - initialized = 0; -} - -/* - *---------------------------------------------------------------------- - * - * HandleMacEvents -- - * - * This function checks for events from the Macintosh event queue. - * - * Results: - * Returns 1 if event found, 0 otherwise. - * - * Side effects: - * Pulls events off of the Mac event queue and then calls - * convertEventProc. - * - *---------------------------------------------------------------------- - */ - -static int -HandleMacEvents(void) -{ - EventRecord theEvent; - int eventFound = 0, needsUpdate = 0; - Point currentMouse; - WindowRef windowRef; - Rect mouseRect; - - /* - * Check for mouse moved events. These events aren't placed on the - * system event queue unless we call WaitNextEvent. - */ - - GetGlobalMouse(¤tMouse); - if ((notifier.eventProcPtr != NULL) && - !EqualPt(currentMouse, notifier.lastMousePosition)) { - notifier.lastMousePosition = currentMouse; - theEvent.what = nullEvent; - if ((*notifier.eventProcPtr)(&theEvent) == true) { - eventFound = 1; - } - } - - /* - * Check for update events. Since update events aren't generated - * until we call GetNextEvent, we may need to force a call to - * GetNextEvent, even if the queue is empty. - */ - - for (windowRef = FrontWindow(); windowRef != NULL; - windowRef = GetNextWindow(windowRef)) { - GetWindowUpdateRgn(windowRef, notifier.utilityRgn); - if (!EmptyRgn(notifier.utilityRgn)) { - needsUpdate = 1; - break; - } - } - - /* - * Process events from the OS event queue. - */ - - while (needsUpdate || (GetEvQHdr()->qHead != NULL)) { - GetGlobalMouse(¤tMouse); - SetRect(&mouseRect, currentMouse.h, currentMouse.v, - currentMouse.h + 1, currentMouse.v + 1); - RectRgn(notifier.utilityRgn, &mouseRect); - - WaitNextEvent(everyEvent, &theEvent, 5, notifier.utilityRgn); - needsUpdate = 0; - if ((notifier.eventProcPtr != NULL) - && ((*notifier.eventProcPtr)(&theEvent) == true)) { - eventFound = 1; - } - } - - return eventFound; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetTimer -- - * - * 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 -Tcl_SetTimer( - Tcl_Time *timePtr) /* New value for interval timer. */ -{ - if (!timePtr) { - notifier.timerActive = 0; - } else { - /* - * Compute when the timer should fire. - */ - - TclpGetTime(¬ifier.timer); - notifier.timer.sec += timePtr->sec; - notifier.timer.usec += timePtr->usec; - if (notifier.timer.usec >= 1000000) { - notifier.timer.usec -= 1000000; - notifier.timer.sec += 1; - } - notifier.timerActive = 1; - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ServiceModeHook -- - * - * This function is invoked whenever the service mode changes. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_ServiceModeHook(mode) - int mode; /* Either TCL_SERVICE_ALL, or - * TCL_SERVICE_NONE. */ -{ -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_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 the event queue without blocking. - * - * Results: - * Always returns 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_WaitForEvent( - Tcl_Time *timePtr) /* Maximum block time. */ -{ - int found; - EventRecord macEvent; - long sleepTime = 5; - long ms; - Point currentMouse; - void * timerToken; - Rect mouseRect; - - /* - * Compute the next timeout value. - */ - - if (!timePtr) { - ms = INT_MAX; - } else { - ms = (timePtr->sec * 1000) + (timePtr->usec / 1000); - } - timerToken = TclMacStartTimer((long) ms); - - /* - * Poll the Mac event sources. This loop repeats until something - * happens: a timeout, a socket event, mouse motion, or some other - * window event. Note that we don't call WaitNextEvent if another - * event is found to avoid context switches. This effectively gives - * events coming in via WaitNextEvent a slightly lower priority. - */ - - found = 0; - if (notifier.utilityRgn == NULL) { - notifier.utilityRgn = NewRgn(); - } - - while (!found) { - /* - * Check for generated and queued events. - */ - - if (HandleMacEvents()) { - found = 1; - } - - /* - * Check for time out. - */ - - if (!found && TclMacTimerExpired(timerToken)) { - found = 1; - } - - /* - * Check for window events. We may receive a NULL event for - * various reasons. 1) the timer has expired, 2) a mouse moved - * event is occuring or 3) the os is giving us time for idle - * events. Note that we aren't sharing the processor very - * well here. We really ought to do a better job of calling - * WaitNextEvent for time slicing purposes. - */ - - if (!found) { - /* - * Set up mouse region so we will wake if the mouse is moved. - * We do this by defining the smallest possible region around - * the current mouse position. - */ - - GetGlobalMouse(¤tMouse); - SetRect(&mouseRect, currentMouse.h, currentMouse.v, - currentMouse.h + 1, currentMouse.v + 1); - RectRgn(notifier.utilityRgn, &mouseRect); - - WaitNextEvent(everyEvent, &macEvent, sleepTime, - notifier.utilityRgn); - - if (notifier.eventProcPtr != NULL) { - if ((*notifier.eventProcPtr)(&macEvent) == true) { - found = 1; - } - } - } - } - TclMacRemoveTimer(timerToken); - - /* - * Yield time to nay other thread at this point. If we find that the - * apps thrash too switching between threads, we can put a timer here, - * and only yield when the timer fires. - */ - - if (TclMacHaveThreads()) { - YieldToAnyThread(); - } - - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Sleep -- - * - * Delay execution for the specified number of milliseconds. This - * is not a very good call to make. It will block the system - - * you will not even be able to switch applications. - * - * Results: - * None. - * - * Side effects: - * Time passes. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_Sleep( - int ms) /* Number of milliseconds to sleep. */ -{ - EventRecord dummy; - void *timerToken; - - if (ms <= 0) { - return; - } - - timerToken = TclMacStartTimer((long) ms); - while (1) { - WaitNextEvent(0, &dummy, (ms / 16.66) + 1, NULL); - if (TclMacHaveThreads()) { - YieldToAnyThread(); - } - if (TclMacTimerExpired(timerToken)) { - break; - } - } - TclMacRemoveTimer(timerToken); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_MacSetEventProc -- - * - * This function sets the event handling procedure for the - * application. This function will be passed all incoming Mac - * events. This function usually controls the console or some - * other entity like Tk. - * - * Results: - * None. - * - * Side effects: - * Changes the event handling function. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_MacSetEventProc( - Tcl_MacConvertEventPtr procPtr) -{ - notifier.eventProcPtr = procPtr; -} diff --git a/mac/tclMacOSA.c b/mac/tclMacOSA.c deleted file mode 100644 index b09cb59..0000000 --- a/mac/tclMacOSA.c +++ /dev/null @@ -1,2937 +0,0 @@ -/* - * tclMacOSA.c -- - * - * This contains the initialization routines, and the implementation of - * the OSA and Component commands. These commands allow you to connect - * with the AppleScript or any other OSA component to compile and execute - * scripts. - * - * Copyright (c) 1996 Lucent Technologies and Jim Ingham - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "License Terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacOSA.c,v 1.3 1999/04/16 00:47:20 stanton Exp $ - */ - -#define MAC_TCL - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -/* - * The following two Includes are from the More Files package. - */ -#include -#include - -#include "tcl.h" -#include "tclInt.h" - -/* - * I need this only for the call to FspGetFullPath, - * I'm really not poking my nose where it does not belong! - */ -#include "tclMacInt.h" - -/* - * Data structures used by the OSA code. - */ -typedef struct tclOSAScript { - OSAID scriptID; - OSType languageID; - long modeFlags; -} tclOSAScript; - -typedef struct tclOSAContext { - OSAID contextID; -} tclOSAContext; - -typedef struct tclOSAComponent { - char *theName; - ComponentInstance theComponent; /* The OSA Component represented */ - long componentFlags; - OSType languageID; - char *languageName; - Tcl_HashTable contextTable; /* Hash Table linking the context names & ID's */ - Tcl_HashTable scriptTable; - Tcl_Interp *theInterp; - OSAActiveUPP defActiveProc; - long defRefCon; -} tclOSAComponent; - -/* - * Prototypes for static procedures. - */ - -static pascal OSErr TclOSAActiveProc _ANSI_ARGS_((long refCon)); -static int TclOSACompileCmd _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *OSAComponent, int argc, - char **argv)); -static int tclOSADecompileCmd _ANSI_ARGS_((Tcl_Interp * Interp, - tclOSAComponent *OSAComponent, int argc, - char **argv)); -static int tclOSADeleteCmd _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *OSAComponent, int argc, - char **argv)); -static int tclOSAExecuteCmd _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *OSAComponent, int argc, - char **argv)); -static int tclOSAInfoCmd _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *OSAComponent, int argc, - char **argv)); -static int tclOSALoadCmd _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *OSAComponent, int argc, - char **argv)); -static int tclOSARunCmd _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *OSAComponent, int argc, - char **argv)); -static int tclOSAStoreCmd _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *OSAComponent, int argc, char - **argv)); -static void GetRawDataFromDescriptor _ANSI_ARGS_((AEDesc *theDesc, - Ptr destPtr, Size destMaxSize, Size *actSize)); -static OSErr GetCStringFromDescriptor _ANSI_ARGS_(( - AEDesc *sourceDesc, char *resultStr, - Size resultMaxSize,Size *resultSize)); -static int Tcl_OSAComponentCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -static void getSortedHashKeys _ANSI_ARGS_((Tcl_HashTable *theTable, - char *pattern, Tcl_DString *theResult)); -static int ASCIICompareProc _ANSI_ARGS_((const void *first, - const void *second)); -static int Tcl_OSACmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, char **argv)); -static void tclOSAClose _ANSI_ARGS_((ClientData clientData)); -static void tclOSACloseAll _ANSI_ARGS_((ClientData clientData)); -static tclOSAComponent *tclOSAMakeNewComponent _ANSI_ARGS_((Tcl_Interp *interp, - char *cmdName, char *languageName, - OSType scriptSubtype, long componentFlags)); -static int prepareScriptData _ANSI_ARGS_((int argc, char **argv, - Tcl_DString *scrptData ,AEDesc *scrptDesc)); -static void tclOSAResultFromID _ANSI_ARGS_((Tcl_Interp *interp, - ComponentInstance theComponent, OSAID resultID)); -static void tclOSAASError _ANSI_ARGS_((Tcl_Interp * interp, - ComponentInstance theComponent, char *scriptSource)); -static int tclOSAGetContextID _ANSI_ARGS_((tclOSAComponent *theComponent, - char *contextName, OSAID *theContext)); -static void tclOSAAddContext _ANSI_ARGS_((tclOSAComponent *theComponent, - char *contextName, const OSAID theContext)); -static int tclOSAMakeContext _ANSI_ARGS_((tclOSAComponent *theComponent, - char *contextName, OSAID *theContext)); -static int tclOSADeleteContext _ANSI_ARGS_((tclOSAComponent *theComponent, - char *contextName)); -static int tclOSALoad _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *theComponent, char *resourceName, - int resourceNumber, char *fileName,OSAID *resultID)); -static int tclOSAStore _ANSI_ARGS_((Tcl_Interp *interp, - tclOSAComponent *theComponent, char *resourceName, - int resourceNumber, char *fileName,char *scriptName)); -static int tclOSAAddScript _ANSI_ARGS_((tclOSAComponent *theComponent, - char *scriptName, long modeFlags, OSAID scriptID)); -static int tclOSAGetScriptID _ANSI_ARGS_((tclOSAComponent *theComponent, - char *scriptName, OSAID *scriptID)); -static tclOSAScript * tclOSAGetScript _ANSI_ARGS_((tclOSAComponent *theComponent, - char *scriptName)); -static int tclOSADeleteScript _ANSI_ARGS_((tclOSAComponent *theComponent, - char *scriptName,char *errMsg)); - -/* - * "export" is a MetroWerks specific pragma. It flags the linker that - * any symbols that are defined when this pragma is on will be exported - * to shared libraries that link with this library. - */ - - -#pragma export on -int Tclapplescript_Init( Tcl_Interp *interp ); -#pragma export reset - -/* - *---------------------------------------------------------------------- - * - * Tclapplescript_Init -- - * - * Initializes the the OSA command which opens connections to - * OSA components, creates the AppleScript command, which opens an - * instance of the AppleScript component,and constructs the table of - * available languages. - * - * Results: - * A standard Tcl result. - * - * Side Effects: - * Opens one connection to the AppleScript component, if - * available. Also builds up a table of available OSA languages, - * and creates the OSA command. - * - *---------------------------------------------------------------------- - */ - -int -Tclapplescript_Init( - Tcl_Interp *interp) /* Tcl interpreter. */ -{ - char *errMsg = NULL; - OSErr myErr = noErr; - Boolean gotAppleScript = false; - Boolean GotOneOSALanguage = false; - ComponentDescription compDescr = { - kOSAComponentType, - (OSType) 0, - (OSType) 0, - (long) 0, - (long) 0 - }, *foundComp; - Component curComponent = (Component) 0; - ComponentInstance curOpenComponent; - Tcl_HashTable *ComponentTable; - Tcl_HashTable *LanguagesTable; - Tcl_HashEntry *hashEntry; - int newPtr; - AEDesc componentName = { typeNull, NULL }; - char nameStr[32]; - Size nameLen; - long appleScriptFlags; - - /* - * Here We Will Get The Available Osa Languages, Since They Can Only Be - * Registered At Startup... If You Dynamically Load Components, This - * Will Fail, But This Is Not A Common Thing To Do. - */ - - LanguagesTable = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - - if (LanguagesTable == NULL) { - panic("Memory Error Allocating Languages Hash Table"); - } - - Tcl_SetAssocData(interp, "OSAScript_LangTable", NULL, LanguagesTable); - Tcl_InitHashTable(LanguagesTable, TCL_STRING_KEYS); - - - while ((curComponent = FindNextComponent(curComponent, &compDescr)) != 0) { - int nbytes = sizeof(ComponentDescription); - foundComp = (ComponentDescription *) - ckalloc(sizeof(ComponentDescription)); - myErr = GetComponentInfo(curComponent, foundComp, NULL, NULL, NULL); - if (foundComp->componentSubType == - kOSAGenericScriptingComponentSubtype) { - /* Skip the generic component */ - ckfree((char *) foundComp); - } else { - GotOneOSALanguage = true; - - /* - * This is gross: looks like I have to open the component just - * to get its name!!! GetComponentInfo is supposed to return - * the name, but AppleScript always returns an empty string. - */ - - curOpenComponent = OpenComponent(curComponent); - if (curOpenComponent == NULL) { - Tcl_AppendResult(interp,"Error opening component", - (char *) NULL); - return TCL_ERROR; - } - - myErr = OSAScriptingComponentName(curOpenComponent,&componentName); - if (myErr == noErr) { - myErr = GetCStringFromDescriptor(&componentName, - nameStr, 31, &nameLen); - AEDisposeDesc(&componentName); - } - CloseComponent(curOpenComponent); - - if (myErr == noErr) { - hashEntry = Tcl_CreateHashEntry(LanguagesTable, - nameStr, &newPtr); - Tcl_SetHashValue(hashEntry, (ClientData) foundComp); - } else { - Tcl_AppendResult(interp,"Error getting componentName.", - (char *) NULL); - return TCL_ERROR; - } - - /* - * Make sure AppleScript is loaded, otherwise we will - * not bother to make the AppleScript command. - */ - if (foundComp->componentSubType == kAppleScriptSubtype) { - appleScriptFlags = foundComp->componentFlags; - gotAppleScript = true; - } - } - } - - /* - * Create the OSA command. - */ - - if (!GotOneOSALanguage) { - Tcl_AppendResult(interp,"Could not find any OSA languages", - (char *) NULL); - return TCL_ERROR; - } - - /* - * Create the Component Assoc Data & put it in the interpreter. - */ - - ComponentTable = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - - if (ComponentTable == NULL) { - panic("Memory Error Allocating Hash Table"); - } - - Tcl_SetAssocData(interp, "OSAScript_CompTable", NULL, ComponentTable); - - Tcl_InitHashTable(ComponentTable, TCL_STRING_KEYS); - - /* - * The OSA command is not currently supported. - Tcl_CreateCommand(interp, "OSA", Tcl_OSACmd, (ClientData) NULL, - (Tcl_CmdDeleteProc *) NULL); - */ - - /* - * Open up one AppleScript component, with a default context - * and tie it to the AppleScript command. - * If the user just wants single-threaded AppleScript execution - * this should be enough. - * - */ - - if (gotAppleScript) { - if (tclOSAMakeNewComponent(interp, "AppleScript", - "AppleScript English", kAppleScriptSubtype, - appleScriptFlags) == NULL ) { - return TCL_ERROR; - } - } - - return Tcl_PkgProvide(interp, "OSAConnect", "1.0"); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_OSACmd -- - * - * This is the command that provides the interface to the OSA - * component manager. The subcommands are: close: close a component, - * info: get info on components open, and open: get a new connection - * with the Scripting Component - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Depends on the subcommand, see the user documentation - * for more details. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_OSACmd( - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv) -{ - static unsigned short componentCmdIndex = 0; - char autoName[32]; - char c; - int length; - Tcl_HashTable *ComponentTable = NULL; - - - if (argc == 1) { - Tcl_AppendResult(interp, "Wrong # of arguments, should be \"", - argv[0], " option\"", (char *) NULL); - return TCL_ERROR; - } - - c = *argv[1]; - length = strlen(argv[1]); - - /* - * Query out the Component Table, since most of these commands use it... - */ - - ComponentTable = (Tcl_HashTable *) Tcl_GetAssocData(interp, - "OSAScript_CompTable", (Tcl_InterpDeleteProc **) NULL); - - if (ComponentTable == NULL) { - Tcl_AppendResult(interp, "Error, could not get the Component Table", - " from the Associated data.", (char *) NULL); - return TCL_ERROR; - } - - if (c == 'c' && strncmp(argv[1],"close",length) == 0) { - Tcl_HashEntry *hashEntry; - if (argc != 3) { - Tcl_AppendResult(interp, "Wrong # of arguments, should be \"", - argv[0], " ",argv[1], " componentName\"", - (char *) NULL); - return TCL_ERROR; - } - - if ((hashEntry = Tcl_FindHashEntry(ComponentTable,argv[2])) == NULL) { - Tcl_AppendResult(interp, "Component \"", argv[2], "\" not found", - (char *) NULL); - return TCL_ERROR; - } else { - Tcl_DeleteCommand(interp,argv[2]); - return TCL_OK; - } - } else if (c == 'o' && strncmp(argv[1],"open",length) == 0) { - /* - * Default language is AppleScript. - */ - OSType scriptSubtype = kAppleScriptSubtype; - char *languageName = "AppleScript English"; - char *errMsg = NULL; - ComponentDescription *theCD; - - argv += 2; - argc -= 2; - - while (argc > 0 ) { - if (*argv[0] == '-') { - c = *(argv[0] + 1); - if (c == 'l' && strcmp(argv[0] + 1, "language") == 0) { - if (argc == 1) { - Tcl_AppendResult(interp, - "Error - no language provided for the -language switch", - (char *) NULL); - return TCL_ERROR; - } else { - Tcl_HashEntry *hashEntry; - Tcl_HashSearch search; - Boolean gotIt = false; - Tcl_HashTable *LanguagesTable; - - /* - * Look up the language in the languages table - * Do a simple strstr match, so AppleScript - * will match "AppleScript English"... - */ - - LanguagesTable = Tcl_GetAssocData(interp, - "OSAScript_LangTable", - (Tcl_InterpDeleteProc **) NULL); - - for (hashEntry = - Tcl_FirstHashEntry(LanguagesTable, &search); - hashEntry != NULL; - hashEntry = Tcl_NextHashEntry(&search)) { - languageName = Tcl_GetHashKey(LanguagesTable, - hashEntry); - if (strstr(languageName,argv[1]) != NULL) { - theCD = (ComponentDescription *) - Tcl_GetHashValue(hashEntry); - gotIt = true; - break; - } - } - if (!gotIt) { - Tcl_AppendResult(interp, - "Error, could not find the language \"", - argv[1], - "\" in the list of known languages.", - (char *) NULL); - return TCL_ERROR; - } - } - } - argc -= 2; - argv += 2; - } else { - Tcl_AppendResult(interp, "Expected a flag, but got ", - argv[0], (char *) NULL); - return TCL_ERROR; - } - } - - sprintf(autoName, "OSAComponent%-d", componentCmdIndex++); - if (tclOSAMakeNewComponent(interp, autoName, languageName, - theCD->componentSubType, theCD->componentFlags) == NULL ) { - return TCL_ERROR; - } else { - Tcl_SetResult(interp,autoName,TCL_VOLATILE); - return TCL_OK; - } - - } else if (c == 'i' && strncmp(argv[1],"info",length) == 0) { - if (argc == 2) { - Tcl_AppendResult(interp, "Wrong # of arguments, should be \"", - argv[0], " ", argv[1], " what\"", - (char *) NULL); - return TCL_ERROR; - } - - c = *argv[2]; - length = strlen(argv[2]); - - if (c == 'c' && strncmp(argv[2], "components", length) == 0) { - Tcl_DString theResult; - - Tcl_DStringInit(&theResult); - - if (argc == 3) { - getSortedHashKeys(ComponentTable,(char *) NULL, &theResult); - } else if (argc == 4) { - getSortedHashKeys(ComponentTable, argv[3], &theResult); - } else { - Tcl_AppendResult(interp, "Error: wrong # of arguments", - ", should be \"", argv[0], " ", argv[1], " ", - argv[2], " ?pattern?\".", (char *) NULL); - return TCL_ERROR; - } - Tcl_DStringResult(interp, &theResult); - return TCL_OK; - } else if (c == 'l' && strncmp(argv[2],"languages",length) == 0) { - Tcl_DString theResult; - Tcl_HashTable *LanguagesTable; - - Tcl_DStringInit(&theResult); - LanguagesTable = Tcl_GetAssocData(interp, - "OSAScript_LangTable", (Tcl_InterpDeleteProc **) NULL); - - if (argc == 3) { - getSortedHashKeys(LanguagesTable, (char *) NULL, &theResult); - } else if (argc == 4) { - getSortedHashKeys(LanguagesTable, argv[3], &theResult); - } else { - Tcl_AppendResult(interp, "Error: wrong # of arguments", - ", should be \"", argv[0], " ", argv[1], " ", - argv[2], " ?pattern?\".", (char *) NULL); - return TCL_ERROR; - } - Tcl_DStringResult(interp,&theResult); - return TCL_OK; - } else { - Tcl_AppendResult(interp, "Unknown option: ", argv[2], - " for OSA info, should be one of", - " \"components\" or \"languages\"", - (char *) NULL); - return TCL_ERROR; - } - } else { - Tcl_AppendResult(interp, "Unknown option: ", argv[1], - ", should be one of \"open\", \"close\" or \"info\".", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_OSAComponentCmd -- - * - * This is the command that provides the interface with an OSA - * component. The sub commands are: - * - compile ? -context context? scriptData - * compiles the script data, returns the ScriptID - * - decompile ? -context context? scriptData - * decompiles the script data, source code - * - execute ?-context context? scriptData - * compiles and runs script data - * - info what: get component info - * - load ?-flags values? fileName - * loads & compiles script data from fileName - * - run scriptId ?options? - * executes the compiled script - * - * Results: - * A standard Tcl result - * - * Side Effects: - * Depends on the subcommand, see the user documentation - * for more details. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_OSAComponentCmd( - ClientData clientData, - Tcl_Interp *interp, - int argc, - char **argv) -{ - int length; - char c; - - tclOSAComponent *OSAComponent = (tclOSAComponent *) clientData; - - if (argc == 1) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option ?arg ...?\"", - (char *) NULL); - return TCL_ERROR; - } - - c = *argv[1]; - length = strlen(argv[1]); - if (c == 'c' && strncmp(argv[1], "compile", length) == 0) { - return TclOSACompileCmd(interp, OSAComponent, argc, argv); - } else if (c == 'l' && strncmp(argv[1], "load", length) == 0) { - return tclOSALoadCmd(interp, OSAComponent, argc, argv); - } else if (c == 'e' && strncmp(argv[1], "execute", length) == 0) { - return tclOSAExecuteCmd(interp, OSAComponent, argc, argv); - } else if (c == 'i' && strncmp(argv[1], "info", length) == 0) { - return tclOSAInfoCmd(interp, OSAComponent, argc, argv); - } else if (c == 'd' && strncmp(argv[1], "decompile", length) == 0) { - return tclOSADecompileCmd(interp, OSAComponent, argc, argv); - } else if (c == 'd' && strncmp(argv[1], "delete", length) == 0) { - return tclOSADeleteCmd(interp, OSAComponent, argc, argv); - } else if (c == 'r' && strncmp(argv[1], "run", length) == 0) { - return tclOSARunCmd(interp, OSAComponent, argc, argv); - } else if (c == 's' && strncmp(argv[1], "store", length) == 0) { - return tclOSAStoreCmd(interp, OSAComponent, argc, argv); - } else { - Tcl_AppendResult(interp,"bad option \"", argv[1], - "\": should be compile, decompile, delete, ", - "execute, info, load, run or store", - (char *) NULL); - return TCL_ERROR; - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclOSACompileCmd -- - * - * This is the compile subcommand for the component command. - * - * Results: - * A standard Tcl result - * - * Side Effects: - * Compiles the script data either into a script or a script - * context. Adds the script to the component's script or context - * table. Sets interp's result to the name of the new script or - * context. - * - *---------------------------------------------------------------------- - */ - -static int -TclOSACompileCmd( - Tcl_Interp *interp, - tclOSAComponent *OSAComponent, - int argc, - char **argv) -{ - int tclError = TCL_OK; - int augment = 1; - int makeContext = 0; - char c; - char autoName[16]; - char buffer[32]; - char *resultName; - Boolean makeNewContext = false; - Tcl_DString scrptData; - AEDesc scrptDesc = { typeNull, NULL }; - long modeFlags = kOSAModeCanInteract; - OSAID resultID = kOSANullScript; - OSAID contextID = kOSANullScript; - OSAID parentID = kOSANullScript; - OSAError osaErr = noErr; - - if (!(OSAComponent->componentFlags && kOSASupportsCompiling)) { - Tcl_AppendResult(interp, - "OSA component does not support compiling", - (char *) NULL); - return TCL_ERROR; - } - - /* - * This signals that we should make up a name, which is the - * default behavior: - */ - - autoName[0] = '\0'; - resultName = NULL; - - if (argc == 2) { - numArgs: - Tcl_AppendResult(interp, - "wrong # args: should be \"", argv[0], " ", argv[1], - " ?options? code\"",(char *) NULL); - return TCL_ERROR; - } - - argv += 2; - argc -= 2; - - /* - * Do the argument parsing. - */ - - while (argc > 0) { - - if (*argv[0] == '-') { - c = *(argv[0] + 1); - - /* - * "--" is the only switch that has no value, stops processing - */ - - if (c == '-' && *(argv[0] + 2) == '\0') { - argv += 1; - argc--; - break; - } - - /* - * So we can check here a switch with no value. - */ - - if (argc == 1) { - Tcl_AppendResult(interp, - "no value given for switch: ", - argv[0], (char *) NULL); - return TCL_ERROR; - } - - if (c == 'c' && strcmp(argv[0] + 1, "context") == 0) { - if (Tcl_GetBoolean(interp, argv[1], &makeContext) != TCL_OK) { - return TCL_ERROR; - } - } else if (c == 'a' && strcmp(argv[0] + 1, "augment") == 0) { - /* - * Augment the current context which implies making a context. - */ - - if (Tcl_GetBoolean(interp, argv[1], &augment) != TCL_OK) { - return TCL_ERROR; - } - makeContext = 1; - } else if (c == 'n' && strcmp(argv[0] + 1, "name") == 0) { - resultName = argv[1]; - } else if (c == 'p' && strcmp(argv[0] + 1,"parent") == 0) { - /* - * Since this implies we are compiling into a context, - * set makeContext here - */ - if (tclOSAGetContextID(OSAComponent, - argv[1], &parentID) != TCL_OK) { - Tcl_AppendResult(interp, "context not found \"", - argv[1], "\"", (char *) NULL); - return TCL_ERROR; - } - makeContext = 1; - } else { - Tcl_AppendResult(interp, "bad option \"", argv[0], - "\": should be -augment, -context, -name or -parent", - (char *) NULL); - return TCL_ERROR; - } - argv += 2; - argc -= 2; - - } else { - break; - } - } - - /* - * Make sure we have some data left... - */ - if (argc == 0) { - goto numArgs; - } - - /* - * Now if we are making a context, see if it is a new one... - * There are three options here: - * 1) There was no name provided, so we autoName it - * 2) There was a name, then check and see if it already exists - * a) If yes, then makeNewContext is false - * b) Otherwise we are making a new context - */ - - if (makeContext) { - modeFlags |= kOSAModeCompileIntoContext; - if (resultName == NULL) { - /* - * Auto name the new context. - */ - resultName = autoName; - resultID = kOSANullScript; - makeNewContext = true; - } else if (tclOSAGetContextID(OSAComponent, - resultName, &resultID) == TCL_OK) { - makeNewContext = false; - } else { - makeNewContext = true; - resultID = kOSANullScript; - } - - /* - * Deal with the augment now... - */ - if (augment && !makeNewContext) { - modeFlags |= kOSAModeAugmentContext; - } - } - - /* - * Ok, now we have the options, so we can compile the script data. - */ - - if (prepareScriptData(argc, argv, &scrptData, &scrptDesc) == TCL_ERROR) { - Tcl_DStringResult(interp, &scrptData); - AEDisposeDesc(&scrptDesc); - return TCL_ERROR; - } - - /* - * If we want to use a parent context, we have to make the context - * by hand. Note, parentID is only specified when you make a new context. - */ - - if (parentID != kOSANullScript && makeNewContext) { - AEDesc contextDesc = { typeNull, NULL }; - - osaErr = OSAMakeContext(OSAComponent->theComponent, - &contextDesc, parentID, &resultID); - modeFlags |= kOSAModeAugmentContext; - } - - osaErr = OSACompile(OSAComponent->theComponent, &scrptDesc, - modeFlags, &resultID); - if (osaErr == noErr) { - - if (makeContext) { - /* - * For the compiled context to be active, you need to run - * the code that is in the context. - */ - OSAID activateID; - - osaErr = OSAExecute(OSAComponent->theComponent, resultID, - resultID, kOSAModeCanInteract, &activateID); - OSADispose(OSAComponent->theComponent, activateID); - - if (osaErr == noErr) { - if (makeNewContext) { - /* - * If we have compiled into a context, - * this is added to the context table - */ - - tclOSAAddContext(OSAComponent, resultName, resultID); - } - - Tcl_SetResult(interp, resultName, TCL_VOLATILE); - tclError = TCL_OK; - } - } else { - /* - * For a script, we return the script name. - */ - tclOSAAddScript(OSAComponent, resultName, modeFlags, resultID); - Tcl_SetResult(interp, resultName, TCL_VOLATILE); - tclError = TCL_OK; - } - } - - /* - * This catches the error either from the original compile, - * or from the execute in case makeContext == true - */ - - if (osaErr == errOSAScriptError) { - OSADispose(OSAComponent->theComponent, resultID); - tclOSAASError(interp, OSAComponent->theComponent, - Tcl_DStringValue(&scrptData)); - tclError = TCL_ERROR; - } else if (osaErr != noErr) { - sprintf(buffer, "Error #%-6d compiling script", osaErr); - Tcl_AppendResult(interp, buffer, (char *) NULL); - tclError = TCL_ERROR; - } - - Tcl_DStringFree(&scrptData); - AEDisposeDesc(&scrptDesc); - - return tclError; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSADecompileCmd -- - * - * This implements the Decompile subcommand of the component command - * - * Results: - * A standard Tcl result. - * - * Side Effects: - * Decompiles the script, and sets interp's result to the - * decompiled script data. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSADecompileCmd( - Tcl_Interp * interp, - tclOSAComponent *OSAComponent, - int argc, - char **argv) -{ - AEDesc resultingSourceData = { typeChar, NULL }; - OSAID scriptID; - Boolean isContext; - long result; - OSErr sysErr = noErr; - - if (argc == 2) { - Tcl_AppendResult(interp, "Wrong # of arguments, should be \"", - argv[0], " ",argv[1], " scriptName \"", (char *) NULL ); - return TCL_ERROR; - } - - if (!(OSAComponent->componentFlags && kOSASupportsGetSource)) { - Tcl_AppendResult(interp, - "Error, this component does not support get source", - (char *) NULL); - return TCL_ERROR; - } - - if (tclOSAGetScriptID(OSAComponent, argv[2], &scriptID) == TCL_OK) { - isContext = false; - } else if (tclOSAGetContextID(OSAComponent, argv[2], &scriptID) - == TCL_OK ) { - isContext = true; - } else { - Tcl_AppendResult(interp, "Could not find script \"", - argv[2], "\"", (char *) NULL); - return TCL_ERROR; - } - - OSAGetScriptInfo(OSAComponent->theComponent, scriptID, - kOSACanGetSource, &result); - - sysErr = OSAGetSource(OSAComponent->theComponent, - scriptID, typeChar, &resultingSourceData); - - if (sysErr == noErr) { - Tcl_DString theResult; - Tcl_DStringInit(&theResult); - - Tcl_DStringAppend(&theResult, *resultingSourceData.dataHandle, - GetHandleSize(resultingSourceData.dataHandle)); - Tcl_DStringResult(interp, &theResult); - AEDisposeDesc(&resultingSourceData); - return TCL_OK; - } else { - Tcl_AppendResult(interp, "Error getting source data", (char *) NULL); - AEDisposeDesc(&resultingSourceData); - return TCL_ERROR; - } -} - -/* - *---------------------------------------------------------------------- - * - * tclOSADeleteCmd -- - * - * This implements the Delete subcommand of the Component command. - * - * Results: - * A standard Tcl result. - * - * Side Effects: - * Deletes a script from the script list of the given component. - * Removes all references to the script, and frees the memory - * associated with it. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSADeleteCmd( - Tcl_Interp *interp, - tclOSAComponent *OSAComponent, - int argc, - char **argv) -{ - char c,*errMsg = NULL; - int length; - - if (argc < 4) { - Tcl_AppendResult(interp, "Wrong # of arguments, should be \"", - argv[0], " ", argv[1], " what scriptName", (char *) NULL); - return TCL_ERROR; - } - - c = *argv[2]; - length = strlen(argv[2]); - if (c == 'c' && strncmp(argv[2], "context", length) == 0) { - if (strcmp(argv[3], "global") == 0) { - Tcl_AppendResult(interp, "You cannot delete the global context", - (char *) NULL); - return TCL_ERROR; - } else if (tclOSADeleteContext(OSAComponent, argv[3]) != TCL_OK) { - Tcl_AppendResult(interp, "Error deleting script \"", argv[2], - "\": ", errMsg, (char *) NULL); - ckfree(errMsg); - return TCL_ERROR; - } - } else if (c == 's' && strncmp(argv[2], "script", length) == 0) { - if (tclOSADeleteScript(OSAComponent, argv[3], errMsg) != TCL_OK) { - Tcl_AppendResult(interp, "Error deleting script \"", argv[3], - "\": ", errMsg, (char *) NULL); - ckfree(errMsg); - return TCL_ERROR; - } - } else { - Tcl_AppendResult(interp,"Unknown value ", argv[2], - " should be one of ", - "\"context\" or \"script\".", - (char *) NULL ); - return TCL_ERROR; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAExecuteCmd -- - * - * This implements the execute subcommand of the component command. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Executes the given script data, and sets interp's result to - * the OSA component's return value. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSAExecuteCmd( - Tcl_Interp *interp, - tclOSAComponent *OSAComponent, - int argc, - char **argv) -{ - int tclError = TCL_OK, resID = 128; - char c,buffer[32], - *contextName = NULL,*scriptName = NULL, *resName = NULL; - Boolean makeNewContext = false,makeContext = false; - AEDesc scrptDesc = { typeNull, NULL }; - long modeFlags = kOSAModeCanInteract; - OSAID resultID = kOSANullScript, - contextID = kOSANullScript, - parentID = kOSANullScript; - Tcl_DString scrptData; - OSAError osaErr = noErr; - OSErr sysErr = noErr; - - if (argc == 2) { - Tcl_AppendResult(interp, - "Error, no script data for \"", argv[0], - " run\"", (char *) NULL); - return TCL_ERROR; - } - - argv += 2; - argc -= 2; - - /* - * Set the context to the global context by default. - * Then parse the argument list for switches - */ - tclOSAGetContextID(OSAComponent, "global", &contextID); - - while (argc > 0) { - - if (*argv[0] == '-') { - c = *(argv[0] + 1); - - /* - * "--" is the only switch that has no value. - */ - - if (c == '-' && *(argv[0] + 2) == '\0') { - argv += 1; - argc--; - break; - } - - /* - * So we can check here for a switch with no value. - */ - - if (argc == 1) { - Tcl_AppendResult(interp, - "Error, no value given for switch ", - argv[0], (char *) NULL); - return TCL_ERROR; - } - - if (c == 'c' && strcmp(argv[0] + 1, "context") == 0) { - if (tclOSAGetContextID(OSAComponent, - argv[1], &contextID) == TCL_OK) { - } else { - Tcl_AppendResult(interp, "Script context \"", - argv[1], "\" not found", (char *) NULL); - return TCL_ERROR; - } - } else { - Tcl_AppendResult(interp, "Error, invalid switch ", argv[0], - " should be \"-context\"", (char *) NULL); - return TCL_ERROR; - } - - argv += 2; - argc -= 2; - } else { - break; - } - } - - if (argc == 0) { - Tcl_AppendResult(interp, "Error, no script data", (char *) NULL); - return TCL_ERROR; - } - - if (prepareScriptData(argc, argv, &scrptData, &scrptDesc) == TCL_ERROR) { - Tcl_DStringResult(interp, &scrptData); - AEDisposeDesc(&scrptDesc); - return TCL_ERROR; - } - /* - * Now try to compile and run, but check to make sure the - * component supports the one shot deal - */ - if (OSAComponent->componentFlags && kOSASupportsConvenience) { - osaErr = OSACompileExecute(OSAComponent->theComponent, - &scrptDesc, contextID, modeFlags, &resultID); - } else { - /* - * If not, we have to do this ourselves - */ - if (OSAComponent->componentFlags && kOSASupportsCompiling) { - OSAID compiledID = kOSANullScript; - osaErr = OSACompile(OSAComponent->theComponent, &scrptDesc, - modeFlags, &compiledID); - if (osaErr == noErr) { - osaErr = OSAExecute(OSAComponent->theComponent, compiledID, - contextID, modeFlags, &resultID); - } - OSADispose(OSAComponent->theComponent, compiledID); - } else { - /* - * The scripting component had better be able to load text data... - */ - OSAID loadedID = kOSANullScript; - - scrptDesc.descriptorType = OSAComponent->languageID; - osaErr = OSALoad(OSAComponent->theComponent, &scrptDesc, - modeFlags, &loadedID); - if (osaErr == noErr) { - OSAExecute(OSAComponent->theComponent, loadedID, - contextID, modeFlags, &resultID); - } - OSADispose(OSAComponent->theComponent, loadedID); - } - } - if (osaErr == errOSAScriptError) { - tclOSAASError(interp, OSAComponent->theComponent, - Tcl_DStringValue(&scrptData)); - tclError = TCL_ERROR; - } else if (osaErr != noErr) { - sprintf(buffer, "Error #%-6d compiling script", osaErr); - Tcl_AppendResult(interp, buffer, (char *) NULL); - tclError = TCL_ERROR; - } else { - tclOSAResultFromID(interp, OSAComponent->theComponent, resultID); - osaErr = OSADispose(OSAComponent->theComponent, resultID); - tclError = TCL_OK; - } - - Tcl_DStringFree(&scrptData); - AEDisposeDesc(&scrptDesc); - - return tclError; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAInfoCmd -- - * - * This implements the Info subcommand of the component command - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Info on scripts and contexts. See the user documentation for details. - * - *---------------------------------------------------------------------- - */ -static int -tclOSAInfoCmd( - Tcl_Interp *interp, - tclOSAComponent *OSAComponent, - int argc, - char **argv) -{ - char c; - int length; - Tcl_DString theResult; - - if (argc == 2) { - Tcl_AppendResult(interp, "Wrong # of arguments, should be \"", - argv[0], " ", argv[1], " what \"", (char *) NULL ); - return TCL_ERROR; - } - - c = *argv[2]; - length = strlen(argv[2]); - if (c == 's' && strncmp(argv[2], "scripts", length) == 0) { - Tcl_DStringInit(&theResult); - if (argc == 3) { - getSortedHashKeys(&OSAComponent->scriptTable, (char *) NULL, - &theResult); - } else if (argc == 4) { - getSortedHashKeys(&OSAComponent->scriptTable, argv[3], &theResult); - } else { - Tcl_AppendResult(interp, "Error: wrong # of arguments,", - " should be \"", argv[0], " ", argv[1], " ", - argv[2], " ?pattern?", (char *) NULL); - return TCL_ERROR; - } - Tcl_DStringResult(interp, &theResult); - return TCL_OK; - } else if (c == 'c' && strncmp(argv[2], "contexts", length) == 0) { - Tcl_DStringInit(&theResult); - if (argc == 3) { - getSortedHashKeys(&OSAComponent->contextTable, (char *) NULL, - &theResult); - } else if (argc == 4) { - getSortedHashKeys(&OSAComponent->contextTable, - argv[3], &theResult); - } else { - Tcl_AppendResult(interp, "Error: wrong # of arguments for ,", - " should be \"", argv[0], " ", argv[1], " ", - argv[2], " ?pattern?", (char *) NULL); - return TCL_ERROR; - } - Tcl_DStringResult(interp, &theResult); - return TCL_OK; - } else if (c == 'l' && strncmp(argv[2], "language", length) == 0) { - Tcl_SetResult(interp, OSAComponent->languageName, TCL_STATIC); - return TCL_OK; - } else { - Tcl_AppendResult(interp, "Unknown argument \"", argv[2], - "\" for \"", argv[0], " info \", should be one of ", - "\"scripts\" \"language\", or \"contexts\"", - (char *) NULL); - return TCL_ERROR; - } -} - -/* - *---------------------------------------------------------------------- - * - * tclOSALoadCmd -- - * - * This is the load subcommand for the Component Command - * - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Loads script data from the given file, creates a new context - * for it, and sets interp's result to the name of the new context. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSALoadCmd( - Tcl_Interp *interp, - tclOSAComponent *OSAComponent, - int argc, - char **argv) -{ - int tclError = TCL_OK, resID = 128; - char c, autoName[24], - *contextName = NULL, *scriptName = NULL, *resName = NULL; - Boolean makeNewContext = false, makeContext = false; - AEDesc scrptDesc = { typeNull, NULL }; - long modeFlags = kOSAModeCanInteract; - OSAID resultID = kOSANullScript, - contextID = kOSANullScript, - parentID = kOSANullScript; - OSAError osaErr = noErr; - OSErr sysErr = noErr; - long scptInfo; - - autoName[0] = '\0'; - scriptName = autoName; - contextName = autoName; - - if (argc == 2) { - Tcl_AppendResult(interp, - "Error, no data for \"", argv[0], " ", argv[1], - "\"", (char *) NULL); - return TCL_ERROR; - } - - argv += 2; - argc -= 2; - - /* - * Do the argument parsing. - */ - - while (argc > 0) { - - if (*argv[0] == '-') { - c = *(argv[0] + 1); - - /* - * "--" is the only switch that has no value. - */ - - if (c == '-' && *(argv[0] + 2) == '\0') { - argv += 1; - argc--; - break; - } - - /* - * So we can check here a switch with no value. - */ - - if (argc == 1) { - Tcl_AppendResult(interp, "Error, no value given for switch ", - argv[0], (char *) NULL); - return TCL_ERROR; - } - - if (c == 'r' && strcmp(argv[0] + 1, "rsrcname") == 0) { - resName = argv[1]; - } else if (c == 'r' && strcmp(argv[0] + 1, "rsrcid") == 0) { - if (Tcl_GetInt(interp, argv[1], &resID) != TCL_OK) { - Tcl_AppendResult(interp, - "Error getting resource ID", (char *) NULL); - return TCL_ERROR; - } - } else { - Tcl_AppendResult(interp, "Error, invalid switch ", argv[0], - " should be \"--\", \"-rsrcname\" or \"-rsrcid\"", - (char *) NULL); - return TCL_ERROR; - } - - argv += 2; - argc -= 2; - } else { - break; - } - } - /* - * Ok, now we have the options, so we can load the resource, - */ - if (argc == 0) { - Tcl_AppendResult(interp, "Error, no filename given", (char *) NULL); - return TCL_ERROR; - } - - if (tclOSALoad(interp, OSAComponent, resName, resID, - argv[0], &resultID) != TCL_OK) { - Tcl_AppendResult(interp, "Error in load command", (char *) NULL); - return TCL_ERROR; - } - - /* - * Now find out whether we have a script, or a script context. - */ - - OSAGetScriptInfo(OSAComponent->theComponent, resultID, - kOSAScriptIsTypeScriptContext, &scptInfo); - - if (scptInfo) { - autoName[0] = '\0'; - tclOSAAddContext(OSAComponent, autoName, resultID); - - Tcl_SetResult(interp, autoName, TCL_VOLATILE); - } else { - /* - * For a script, we return the script name - */ - autoName[0] = '\0'; - tclOSAAddScript(OSAComponent, autoName, kOSAModeCanInteract, resultID); - Tcl_SetResult(interp, autoName, TCL_VOLATILE); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSARunCmd -- - * - * This implements the run subcommand of the component command - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Runs the given compiled script, and returns the OSA - * component's result. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSARunCmd( - Tcl_Interp *interp, - tclOSAComponent *OSAComponent, - int argc, - char **argv) -{ - int tclError = TCL_OK, - resID = 128; - char c, *contextName = NULL, - *scriptName = NULL, - *resName = NULL; - AEDesc scrptDesc = { typeNull, NULL }; - long modeFlags = kOSAModeCanInteract; - OSAID resultID = kOSANullScript, - contextID = kOSANullScript, - parentID = kOSANullScript; - OSAError osaErr = noErr; - OSErr sysErr = noErr; - char *componentName = argv[0]; - OSAID scriptID; - - if (argc == 2) { - Tcl_AppendResult(interp, "Wrong # of arguments, should be \"", - argv[0], " ", argv[1], " scriptName", (char *) NULL); - return TCL_ERROR; - } - - /* - * Set the context to the global context for this component, - * as a default - */ - if (tclOSAGetContextID(OSAComponent, "global", &contextID) != TCL_OK) { - Tcl_AppendResult(interp, - "Could not find the global context for component ", - OSAComponent->theName, (char *) NULL ); - return TCL_ERROR; - } - - /* - * Now parse the argument list for switches - */ - argv += 2; - argc -= 2; - - while (argc > 0) { - if (*argv[0] == '-') { - c = *(argv[0] + 1); - /* - * "--" is the only switch that has no value - */ - if (c == '-' && *(argv[0] + 2) == '\0') { - argv += 1; - argc--; - break; - } - - /* - * So we can check here for a switch with no value. - */ - if (argc == 1) { - Tcl_AppendResult(interp, "Error, no value given for switch ", - argv[0], (char *) NULL); - return TCL_ERROR; - } - - if (c == 'c' && strcmp(argv[0] + 1, "context") == 0) { - if (argc == 1) { - Tcl_AppendResult(interp, - "Error - no context provided for the -context switch", - (char *) NULL); - return TCL_ERROR; - } else if (tclOSAGetContextID(OSAComponent, - argv[1], &contextID) == TCL_OK) { - } else { - Tcl_AppendResult(interp, "Script context \"", argv[1], - "\" not found", (char *) NULL); - return TCL_ERROR; - } - } else { - Tcl_AppendResult(interp, "Error, invalid switch ", argv[0], - " for ", componentName, - " should be \"-context\"", (char *) NULL); - return TCL_ERROR; - } - argv += 2; - argc -= 2; - } else { - break; - } - } - - if (tclOSAGetScriptID(OSAComponent, argv[0], &scriptID) != TCL_OK) { - if (tclOSAGetContextID(OSAComponent, argv[0], &scriptID) != TCL_OK) { - Tcl_AppendResult(interp, "Could not find script \"", - argv[2], "\"", (char *) NULL); - return TCL_ERROR; - } - } - - sysErr = OSAExecute(OSAComponent->theComponent, - scriptID, contextID, modeFlags, &resultID); - - if (sysErr == errOSAScriptError) { - tclOSAASError(interp, OSAComponent->theComponent, (char *) NULL); - tclError = TCL_ERROR; - } else if (sysErr != noErr) { - char buffer[32]; - sprintf(buffer, "Error #%6.6d encountered in run", sysErr); - Tcl_SetResult(interp, buffer, TCL_VOLATILE); - tclError = TCL_ERROR; - } else { - tclOSAResultFromID(interp, OSAComponent->theComponent, resultID ); - } - OSADispose(OSAComponent->theComponent, resultID); - - return tclError; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAStoreCmd -- - * - * This implements the store subcommand of the component command - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Runs the given compiled script, and returns the OSA - * component's result. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSAStoreCmd( - Tcl_Interp *interp, - tclOSAComponent *OSAComponent, - int argc, - char **argv) -{ - int tclError = TCL_OK, resID = 128; - char c, *contextName = NULL, *scriptName = NULL, *resName = NULL; - Boolean makeNewContext = false, makeContext = false; - AEDesc scrptDesc = { typeNull, NULL }; - long modeFlags = kOSAModeCanInteract; - OSAID resultID = kOSANullScript, - contextID = kOSANullScript, - parentID = kOSANullScript; - OSAError osaErr = noErr; - OSErr sysErr = noErr; - - if (argc == 2) { - Tcl_AppendResult(interp, "Error, no data for \"", argv[0], - " ",argv[1], "\"", (char *) NULL); - return TCL_ERROR; - } - - argv += 2; - argc -= 2; - - /* - * Do the argument parsing - */ - - while (argc > 0) { - if (*argv[0] == '-') { - c = *(argv[0] + 1); - - /* - * "--" is the only switch that has no value - */ - if (c == '-' && *(argv[0] + 2) == '\0') { - argv += 1; - argc--; - break; - } - - /* - * So we can check here a switch with no value. - */ - if (argc == 1) { - Tcl_AppendResult(interp, - "Error, no value given for switch ", - argv[0], (char *) NULL); - return TCL_ERROR; - } - - if (c == 'r' && strcmp(argv[0] + 1, "rsrcname") == 0) { - resName = argv[1]; - } else if (c == 'r' && strcmp(argv[0] + 1, "rsrcid") == 0) { - if (Tcl_GetInt(interp, argv[1], &resID) != TCL_OK) { - Tcl_AppendResult(interp, - "Error getting resource ID", (char *) NULL); - return TCL_ERROR; - } - } else { - Tcl_AppendResult(interp, "Error, invalid switch ", argv[0], - " should be \"--\", \"-rsrcname\" or \"-rsrcid\"", - (char *) NULL); - return TCL_ERROR; - } - - argv += 2; - argc -= 2; - } else { - break; - } - } - /* - * Ok, now we have the options, so we can load the resource, - */ - if (argc != 2) { - Tcl_AppendResult(interp, "Error, wrong # of arguments, should be ", - argv[0], " ", argv[1], "?option flag? scriptName fileName", - (char *) NULL); - return TCL_ERROR; - } - - if (tclOSAStore(interp, OSAComponent, resName, resID, - argv[0], argv[1]) != TCL_OK) { - Tcl_AppendResult(interp, "Error in load command", (char *) NULL); - return TCL_ERROR; - } else { - Tcl_ResetResult(interp); - tclError = TCL_OK; - } - - return tclError; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAMakeNewComponent -- - * - * Makes a command cmdName to represent a new connection to the - * OSA component with componentSubType scriptSubtype. - * - * Results: - * Returns the tclOSAComponent structure for the connection. - * - * Side Effects: - * Adds a new element to the component table. If there is an - * error, then the result of the Tcl interpreter interp is set - * to an appropriate error message. - * - *---------------------------------------------------------------------- - */ - -tclOSAComponent * -tclOSAMakeNewComponent( - Tcl_Interp *interp, - char *cmdName, - char *languageName, - OSType scriptSubtype, - long componentFlags) -{ - char buffer[32]; - AEDesc resultingName = {typeNull, NULL}; - AEDesc nullDesc = {typeNull, NULL }; - OSAID globalContext; - char global[] = "global"; - int nbytes; - ComponentDescription requestedComponent = { - kOSAComponentType, - (OSType) 0, - (OSType) 0, - (long int) 0, - (long int) 0 - }; - Tcl_HashTable *ComponentTable; - Component foundComponent = NULL; - OSAActiveUPP myActiveProcUPP; - - tclOSAComponent *newComponent; - Tcl_HashEntry *hashEntry; - int newPtr; - - requestedComponent.componentSubType = scriptSubtype; - nbytes = sizeof(tclOSAComponent); - newComponent = (tclOSAComponent *) ckalloc(sizeof(tclOSAComponent)); - if (newComponent == NULL) { - goto CleanUp; - } - - foundComponent = FindNextComponent(0, &requestedComponent); - if (foundComponent == 0) { - Tcl_AppendResult(interp, - "Could not find component of requested type", (char *) NULL); - goto CleanUp; - } - - newComponent->theComponent = OpenComponent(foundComponent); - - if (newComponent->theComponent == NULL) { - Tcl_AppendResult(interp, - "Could not open component of the requested type", - (char *) NULL); - goto CleanUp; - } - - newComponent->languageName = (char *) ckalloc(strlen(languageName) + 1); - strcpy(newComponent->languageName,languageName); - - newComponent->componentFlags = componentFlags; - - newComponent->theInterp = interp; - - Tcl_InitHashTable(&newComponent->contextTable, TCL_STRING_KEYS); - Tcl_InitHashTable(&newComponent->scriptTable, TCL_STRING_KEYS); - - if (tclOSAMakeContext(newComponent, global, &globalContext) != TCL_OK) { - sprintf(buffer, "%-6.6d", globalContext); - Tcl_AppendResult(interp, "Error ", buffer, " making ", global, - " context.", (char *) NULL); - goto CleanUp; - } - - newComponent->languageID = scriptSubtype; - - newComponent->theName = (char *) ckalloc(strlen(cmdName) + 1 ); - strcpy(newComponent->theName, cmdName); - - Tcl_CreateCommand(interp, newComponent->theName, Tcl_OSAComponentCmd, - (ClientData) newComponent, tclOSAClose); - - /* - * Register the new component with the component table - */ - - ComponentTable = (Tcl_HashTable *) Tcl_GetAssocData(interp, - "OSAScript_CompTable", (Tcl_InterpDeleteProc **) NULL); - - if (ComponentTable == NULL) { - Tcl_AppendResult(interp, "Error, could not get the Component Table", - " from the Associated data.", (char *) NULL); - return (tclOSAComponent *) NULL; - } - - hashEntry = Tcl_CreateHashEntry(ComponentTable, - newComponent->theName, &newPtr); - Tcl_SetHashValue(hashEntry, (ClientData) newComponent); - - /* - * Set the active proc to call Tcl_DoOneEvent() while idle - */ - if (OSAGetActiveProc(newComponent->theComponent, - &newComponent->defActiveProc, &newComponent->defRefCon) != noErr ) { - /* TODO -- clean up here... */ - } - - myActiveProcUPP = NewOSAActiveProc(TclOSAActiveProc); - OSASetActiveProc(newComponent->theComponent, - myActiveProcUPP, (long) newComponent); - return newComponent; - - CleanUp: - - ckfree((char *) newComponent); - return (tclOSAComponent *) NULL; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAClose -- - * - * This procedure closes the connection to an OSA component, and - * deletes all the script and context data associated with it. - * It is the command deletion callback for the component's command. - * - * Results: - * None - * - * Side effects: - * Closes the connection, and releases all the script data. - * - *---------------------------------------------------------------------- - */ - -void -tclOSAClose( - ClientData clientData) -{ - tclOSAComponent *theComponent = (tclOSAComponent *) clientData; - Tcl_HashEntry *hashEntry; - Tcl_HashSearch search; - tclOSAScript *theScript; - Tcl_HashTable *ComponentTable; - - /* - * Delete the context and script tables - * the memory for the language name, and - * the hash entry. - */ - - for (hashEntry = Tcl_FirstHashEntry(&theComponent->scriptTable, &search); - hashEntry != NULL; - hashEntry = Tcl_NextHashEntry(&search)) { - - theScript = (tclOSAScript *) Tcl_GetHashValue(hashEntry); - OSADispose(theComponent->theComponent, theScript->scriptID); - ckfree((char *) theScript); - Tcl_DeleteHashEntry(hashEntry); - } - - for (hashEntry = Tcl_FirstHashEntry(&theComponent->contextTable, &search); - hashEntry != NULL; - hashEntry = Tcl_NextHashEntry(&search)) { - - Tcl_DeleteHashEntry(hashEntry); - } - - ckfree(theComponent->languageName); - ckfree(theComponent->theName); - - /* - * Finally close the component - */ - - CloseComponent(theComponent->theComponent); - - ComponentTable = (Tcl_HashTable *) - Tcl_GetAssocData(theComponent->theInterp, - "OSAScript_CompTable", (Tcl_InterpDeleteProc **) NULL); - - if (ComponentTable == NULL) { - panic("Error, could not get the Component Table from the Associated data."); - } - - hashEntry = Tcl_FindHashEntry(ComponentTable, theComponent->theName); - if (hashEntry != NULL) { - Tcl_DeleteHashEntry(hashEntry); - } - - ckfree((char *) theComponent); -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAGetContextID -- - * - * This returns the context ID, given the component name. - * - * Results: - * A context ID - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -static int -tclOSAGetContextID( - tclOSAComponent *theComponent, - char *contextName, - OSAID *theContext) -{ - Tcl_HashEntry *hashEntry; - tclOSAContext *contextStruct; - - if ((hashEntry = Tcl_FindHashEntry(&theComponent->contextTable, - contextName)) == NULL ) { - return TCL_ERROR; - } else { - contextStruct = (tclOSAContext *) Tcl_GetHashValue(hashEntry); - *theContext = contextStruct->contextID; - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAAddContext -- - * - * This adds the context ID, with the name contextName. If the - * name is passed in as a NULL string, space is malloc'ed for the - * string and a new name is made up, if the string is empty, you - * must have allocated enough space ( 24 characters is fine) for - * the name, which is made up and passed out. - * - * Results: - * Nothing - * - * Side effects: - * Adds the script context to the component's context table. - * - *---------------------------------------------------------------------- - */ - -static void -tclOSAAddContext( - tclOSAComponent *theComponent, - char *contextName, - const OSAID theContext) -{ - static unsigned short contextIndex = 0; - tclOSAContext *contextStruct; - Tcl_HashEntry *hashEntry; - int newPtr; - - if (contextName == NULL) { - contextName = ckalloc(16 + TCL_INTEGER_SPACE); - sprintf(contextName, "OSAContext%d", contextIndex++); - } else if (*contextName == '\0') { - sprintf(contextName, "OSAContext%d", contextIndex++); - } - - hashEntry = Tcl_CreateHashEntry(&theComponent->contextTable, - contextName, &newPtr); - - contextStruct = (tclOSAContext *) ckalloc(sizeof(tclOSAContext)); - contextStruct->contextID = theContext; - Tcl_SetHashValue(hashEntry,(ClientData) contextStruct); -} - -/* - *---------------------------------------------------------------------- - * - * tclOSADeleteContext -- - * - * This deletes the context struct, with the name contextName. - * - * Results: - * A normal Tcl result - * - * Side effects: - * Removes the script context to the component's context table, - * and deletes the data associated with it. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSADeleteContext( - tclOSAComponent *theComponent, - char *contextName) -{ - Tcl_HashEntry *hashEntry; - tclOSAContext *contextStruct; - - hashEntry = Tcl_FindHashEntry(&theComponent->contextTable, contextName); - if (hashEntry == NULL) { - return TCL_ERROR; - } - /* - * Dispose of the script context data - */ - contextStruct = (tclOSAContext *) Tcl_GetHashValue(hashEntry); - OSADispose(theComponent->theComponent,contextStruct->contextID); - /* - * Then the hash entry - */ - ckfree((char *) contextStruct); - Tcl_DeleteHashEntry(hashEntry); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAMakeContext -- - * - * This makes the context with name contextName, and returns the ID. - * - * Results: - * A standard Tcl result - * - * Side effects: - * Makes a new context, adds it to the context table, and returns - * the new contextID in the variable theContext. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSAMakeContext( - tclOSAComponent *theComponent, - char *contextName, - OSAID *theContext) -{ - AEDesc contextNameDesc = {typeNull, NULL}; - OSAError osaErr = noErr; - - AECreateDesc(typeChar, contextName, strlen(contextName), &contextNameDesc); - osaErr = OSAMakeContext(theComponent->theComponent, &contextNameDesc, - kOSANullScript, theContext); - - AEDisposeDesc(&contextNameDesc); - - if (osaErr == noErr) { - tclOSAAddContext(theComponent, contextName, *theContext); - } else { - *theContext = (OSAID) osaErr; - return TCL_ERROR; - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAStore -- - * - * This stores a script resource from the file named in fileName. - * - * Most of this routine is caged from the Tcl Source, from the - * Tcl_MacSourceCmd routine. This is good, since it ensures this - * follows the same convention for looking up files as Tcl. - * - * Returns - * A standard Tcl result. - * - * Side Effects: - * The given script data is stored in the file fileName. - * - *---------------------------------------------------------------------- - */ - -int -tclOSAStore( - Tcl_Interp *interp, - tclOSAComponent *theComponent, - char *resourceName, - int resourceNumber, - char *scriptName, - char *fileName) -{ - Handle resHandle; - Str255 rezName; - int result = TCL_OK; - short saveRef, fileRef = -1; - char idStr[16 + TCL_INTEGER_SPACE]; - FSSpec fileSpec; - Tcl_DString buffer; - char *nativeName; - OSErr myErr = noErr; - OSAID scriptID; - Size scriptSize; - AEDesc scriptData; - - /* - * First extract the script data - */ - - if (tclOSAGetScriptID(theComponent, scriptName, &scriptID) != TCL_OK ) { - if (tclOSAGetContextID(theComponent, scriptName, &scriptID) - != TCL_OK) { - Tcl_AppendResult(interp, "Error getting script ", - scriptName, (char *) NULL); - return TCL_ERROR; - } - } - - myErr = OSAStore(theComponent->theComponent, scriptID, - typeOSAGenericStorage, kOSAModeNull, &scriptData); - if (myErr != noErr) { - sprintf(idStr, "%d", myErr); - Tcl_AppendResult(interp, "Error #", idStr, - " storing script ", scriptName, (char *) NULL); - return TCL_ERROR; - } - - /* - * Now try to open the output file - */ - - saveRef = CurResFile(); - - if (fileName != NULL) { - OSErr err; - - Tcl_DStringInit(&buffer); - nativeName = Tcl_TranslateFileName(interp, fileName, &buffer); - if (nativeName == NULL) { - return TCL_ERROR; - } - err = FSpLocationFromPath(strlen(nativeName), nativeName, &fileSpec); - - Tcl_DStringFree(&buffer); - if ((err != noErr) && (err != fnfErr)) { - Tcl_AppendResult(interp, - "Error getting a location for the file: \"", - fileName, "\".", NULL); - return TCL_ERROR; - } - - FSpCreateResFileCompat(&fileSpec, - 'WiSH', 'osas', smSystemScript); - myErr = ResError(); - - if ((myErr != noErr) && (myErr != dupFNErr)) { - sprintf(idStr, "%d", myErr); - Tcl_AppendResult(interp, "Error #", idStr, - " creating new resource file ", fileName, (char *) NULL); - result = TCL_ERROR; - goto rezEvalCleanUp; - } - - fileRef = FSpOpenResFileCompat(&fileSpec, fsRdWrPerm); - if (fileRef == -1) { - Tcl_AppendResult(interp, "Error reading the file: \"", - fileName, "\".", NULL); - result = TCL_ERROR; - goto rezEvalCleanUp; - } - UseResFile(fileRef); - } else { - /* - * The default behavior will search through all open resource files. - * This may not be the behavior you desire. If you want the behavior - * of this call to *only* search the application resource fork, you - * must call UseResFile at this point to set it to the application - * file. This means you must have already obtained the application's - * fileRef when the application started up. - */ - } - - /* - * Load the resource by name - */ - if (resourceName != NULL) { - strcpy((char *) rezName + 1, resourceName); - rezName[0] = strlen(resourceName); - resHandle = Get1NamedResource('scpt', rezName); - myErr = ResError(); - if (resHandle == NULL) { - /* - * These signify either the resource or the resource - * type were not found - */ - if (myErr == resNotFound || myErr == noErr) { - short uniqueID; - while ((uniqueID = Unique1ID('scpt') ) < 128) {} - AddResource(scriptData.dataHandle, 'scpt', uniqueID, rezName); - WriteResource(resHandle); - result = TCL_OK; - goto rezEvalCleanUp; - } else { - /* - * This means there was some other error, for now - * I just bag out. - */ - sprintf(idStr, "%d", myErr); - Tcl_AppendResult(interp, "Error #", idStr, - " opening scpt resource named ", resourceName, - " in file ", fileName, (char *) NULL); - result = TCL_ERROR; - goto rezEvalCleanUp; - } - } - /* - * Or ID - */ - } else { - resHandle = Get1Resource('scpt', resourceNumber); - rezName[0] = 0; - rezName[1] = '\0'; - myErr = ResError(); - if (resHandle == NULL) { - /* - * These signify either the resource or the resource - * type were not found - */ - if (myErr == resNotFound || myErr == noErr) { - AddResource(scriptData.dataHandle, 'scpt', - resourceNumber, rezName); - WriteResource(resHandle); - result = TCL_OK; - goto rezEvalCleanUp; - } else { - /* - * This means there was some other error, for now - * I just bag out */ - sprintf(idStr, "%d", myErr); - Tcl_AppendResult(interp, "Error #", idStr, - " opening scpt resource named ", resourceName, - " in file ", fileName,(char *) NULL); - result = TCL_ERROR; - goto rezEvalCleanUp; - } - } - } - - /* - * We get to here if the resource exists - * we just copy into it... - */ - - scriptSize = GetHandleSize(scriptData.dataHandle); - SetHandleSize(resHandle, scriptSize); - HLock(scriptData.dataHandle); - HLock(resHandle); - BlockMove(*scriptData.dataHandle, *resHandle,scriptSize); - HUnlock(scriptData.dataHandle); - HUnlock(resHandle); - ChangedResource(resHandle); - WriteResource(resHandle); - result = TCL_OK; - goto rezEvalCleanUp; - - rezEvalError: - sprintf(idStr, "ID=%d", resourceNumber); - Tcl_AppendResult(interp, "The resource \"", - (resourceName != NULL ? resourceName : idStr), - "\" could not be loaded from ", - (fileName != NULL ? fileName : "application"), - ".", NULL); - - rezEvalCleanUp: - if (fileRef != -1) { - CloseResFile(fileRef); - } - - UseResFile(saveRef); - - return result; -} - -/*---------------------------------------------------------------------- - * - * tclOSALoad -- - * - * This loads a script resource from the file named in fileName. - * Most of this routine is caged from the Tcl Source, from the - * Tcl_MacSourceCmd routine. This is good, since it ensures this - * follows the same convention for looking up files as Tcl. - * - * Returns - * A standard Tcl result. - * - * Side Effects: - * A new script element is created from the data in the file. - * The script ID is passed out in the variable resultID. - * - *---------------------------------------------------------------------- - */ - -int -tclOSALoad( - Tcl_Interp *interp, - tclOSAComponent *theComponent, - char *resourceName, - int resourceNumber, - char *fileName, - OSAID *resultID) -{ - Handle sourceData; - Str255 rezName; - int result = TCL_OK; - short saveRef, fileRef = -1; - char idStr[16 + TCL_INTEGER_SPACE]; - FSSpec fileSpec; - Tcl_DString buffer; - char *nativeName; - - saveRef = CurResFile(); - - if (fileName != NULL) { - OSErr err; - - Tcl_DStringInit(&buffer); - nativeName = Tcl_TranslateFileName(interp, fileName, &buffer); - if (nativeName == NULL) { - return TCL_ERROR; - } - err = FSpLocationFromPath(strlen(nativeName), nativeName, &fileSpec); - Tcl_DStringFree(&buffer); - if (err != noErr) { - Tcl_AppendResult(interp, "Error finding the file: \"", - fileName, "\".", NULL); - return TCL_ERROR; - } - - fileRef = FSpOpenResFileCompat(&fileSpec, fsRdPerm); - if (fileRef == -1) { - Tcl_AppendResult(interp, "Error reading the file: \"", - fileName, "\".", NULL); - return TCL_ERROR; - } - UseResFile(fileRef); - } else { - /* - * The default behavior will search through all open resource files. - * This may not be the behavior you desire. If you want the behavior - * of this call to *only* search the application resource fork, you - * must call UseResFile at this point to set it to the application - * file. This means you must have already obtained the application's - * fileRef when the application started up. - */ - } - - /* - * Load the resource by name or ID - */ - if (resourceName != NULL) { - strcpy((char *) rezName + 1, resourceName); - rezName[0] = strlen(resourceName); - sourceData = GetNamedResource('scpt', rezName); - } else { - sourceData = GetResource('scpt', (short) resourceNumber); - } - - if (sourceData == NULL) { - result = TCL_ERROR; - } else { - AEDesc scriptDesc; - OSAError osaErr; - - scriptDesc.descriptorType = typeOSAGenericStorage; - scriptDesc.dataHandle = sourceData; - - osaErr = OSALoad(theComponent->theComponent, &scriptDesc, - kOSAModeNull, resultID); - - ReleaseResource(sourceData); - - if (osaErr != noErr) { - result = TCL_ERROR; - goto rezEvalError; - } - - goto rezEvalCleanUp; - } - - rezEvalError: - sprintf(idStr, "ID=%d", resourceNumber); - Tcl_AppendResult(interp, "The resource \"", - (resourceName != NULL ? resourceName : idStr), - "\" could not be loaded from ", - (fileName != NULL ? fileName : "application"), - ".", NULL); - - rezEvalCleanUp: - if (fileRef != -1) { - CloseResFile(fileRef); - } - - UseResFile(saveRef); - - return result; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAGetScriptID -- - * - * This returns the context ID, gibven the component name. - * - * Results: - * A standard Tcl result - * - * Side effects: - * Passes out the script ID in the variable scriptID. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSAGetScriptID( - tclOSAComponent *theComponent, - char *scriptName, - OSAID *scriptID) -{ - tclOSAScript *theScript; - - theScript = tclOSAGetScript(theComponent, scriptName); - if (theScript == NULL) { - return TCL_ERROR; - } - - *scriptID = theScript->scriptID; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAAddScript -- - * - * This adds a script to theComponent's script table, with the - * given name & ID. - * - * Results: - * A standard Tcl result - * - * Side effects: - * Adds an element to the component's script table. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSAAddScript( - tclOSAComponent *theComponent, - char *scriptName, - long modeFlags, - OSAID scriptID) -{ - Tcl_HashEntry *hashEntry; - int newPtr; - static int scriptIndex = 0; - tclOSAScript *theScript; - - if (*scriptName == '\0') { - sprintf(scriptName, "OSAScript%d", scriptIndex++); - } - - hashEntry = Tcl_CreateHashEntry(&theComponent->scriptTable, - scriptName, &newPtr); - if (newPtr == 0) { - theScript = (tclOSAScript *) Tcl_GetHashValue(hashEntry); - OSADispose(theComponent->theComponent, theScript->scriptID); - } else { - theScript = (tclOSAScript *) ckalloc(sizeof(tclOSAScript)); - if (theScript == NULL) { - return TCL_ERROR; - } - } - - theScript->scriptID = scriptID; - theScript->languageID = theComponent->languageID; - theScript->modeFlags = modeFlags; - - Tcl_SetHashValue(hashEntry,(ClientData) theScript); - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAGetScriptID -- - * - * This returns the script structure, given the component and script name. - * - * Results: - * A pointer to the script structure. - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -static tclOSAScript * -tclOSAGetScript( - tclOSAComponent *theComponent, - char *scriptName) -{ - Tcl_HashEntry *hashEntry; - - hashEntry = Tcl_FindHashEntry(&theComponent->scriptTable, scriptName); - if (hashEntry == NULL) { - return NULL; - } - - return (tclOSAScript *) Tcl_GetHashValue(hashEntry); -} - -/* - *---------------------------------------------------------------------- - * - * tclOSADeleteScript -- - * - * This deletes the script given by scriptName. - * - * Results: - * A standard Tcl result - * - * Side effects: - * Deletes the script from the script table, and frees up the - * resources associated with it. If there is an error, then - * space for the error message is malloc'ed, and passed out in - * the variable errMsg. - * - *---------------------------------------------------------------------- - */ - -static int -tclOSADeleteScript( - tclOSAComponent *theComponent, - char *scriptName, - char *errMsg) -{ - Tcl_HashEntry *hashEntry; - tclOSAScript *scriptPtr; - - hashEntry = Tcl_FindHashEntry(&theComponent->scriptTable, scriptName); - if (hashEntry == NULL) { - errMsg = ckalloc(17); - strcpy(errMsg,"Script not found"); - return TCL_ERROR; - } - - scriptPtr = (tclOSAScript *) Tcl_GetHashValue(hashEntry); - OSADispose(theComponent->theComponent, scriptPtr->scriptID); - ckfree((char *) scriptPtr); - Tcl_DeleteHashEntry(hashEntry); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclOSAActiveProc -- - * - * This is passed to each component. It is run periodically - * during script compilation and script execution. It in turn - * calls Tcl_DoOneEvent to process the event queue. We also call - * the default Active proc which will let the user cancel the script - * by hitting Command-. - * - * Results: - * A standard MacOS system error - * - * Side effects: - * Any Tcl code may run while calling Tcl_DoOneEvent. - * - *---------------------------------------------------------------------- - */ - -static pascal OSErr -TclOSAActiveProc( - long refCon) -{ - tclOSAComponent *theComponent = (tclOSAComponent *) refCon; - - Tcl_DoOneEvent(TCL_DONT_WAIT); - CallOSAActiveProc(theComponent->defActiveProc, theComponent->defRefCon); - - return noErr; -} - -/* - *---------------------------------------------------------------------- - * - * ASCIICompareProc -- - * - * Trivial ascii compare for use with qsort. - * - * Results: - * strcmp of the two input strings - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ -static int -ASCIICompareProc(const void *first,const void *second) -{ - int order; - - char *firstString = *((char **) first); - char *secondString = *((char **) second); - - order = strcmp(firstString, secondString); - - return order; -} - -#define REALLOC_INCR 30 -/* - *---------------------------------------------------------------------- - * - * getSortedHashKeys -- - * - * returns an alphabetically sorted list of the keys of the hash - * theTable which match the string "pattern" in the DString - * theResult. pattern == NULL matches all. - * - * Results: - * None - * - * Side effects: - * ReInitializes the DString theResult, then copies the names of - * the matching keys into the string as list elements. - * - *---------------------------------------------------------------------- - */ - -static void -getSortedHashKeys( - Tcl_HashTable *theTable, - char *pattern, - Tcl_DString *theResult) -{ - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - Boolean compare = true; - char *keyPtr; - static char **resultArgv = NULL; - static int totSize = 0; - int totElem = 0, i; - - if (pattern == NULL || *pattern == '\0' || - (*pattern == '*' && *(pattern + 1) == '\0')) { - compare = false; - } - - for (hPtr = Tcl_FirstHashEntry(theTable,&search), totElem = 0; - hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - - keyPtr = (char *) Tcl_GetHashKey(theTable, hPtr); - if (!compare || Tcl_StringMatch(keyPtr, pattern)) { - totElem++; - if (totElem >= totSize) { - totSize += REALLOC_INCR; - resultArgv = (char **) ckrealloc((char *) resultArgv, - totSize * sizeof(char *)); - } - resultArgv[totElem - 1] = keyPtr; - } - } - - Tcl_DStringInit(theResult); - if (totElem == 1) { - Tcl_DStringAppendElement(theResult, resultArgv[0]); - } else if (totElem > 1) { - qsort((VOID *) resultArgv, (size_t) totElem, sizeof (char *), - ASCIICompareProc); - - for (i = 0; i < totElem; i++) { - Tcl_DStringAppendElement(theResult, resultArgv[i]); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * prepareScriptData -- - * - * Massages the input data in the argv array, concating the - * elements, with a " " between each, and replacing \n with \r, - * and \\n with " ". Puts the result in the the DString scrptData, - * and copies the result to the AEdesc scrptDesc. - * - * Results: - * Standard Tcl result - * - * Side effects: - * Creates a new Handle (with AECreateDesc) for the script data. - * Stores the script in scrptData, or the error message if there - * is an error creating the descriptor. - * - *---------------------------------------------------------------------- - */ - -static int -prepareScriptData( - int argc, - char **argv, - Tcl_DString *scrptData, - AEDesc *scrptDesc) -{ - char * ptr; - int i; - char buffer[7]; - OSErr sysErr = noErr; - - Tcl_DStringInit(scrptData); - - for (i = 0; i < argc; i++) { - Tcl_DStringAppend(scrptData, argv[i], -1); - Tcl_DStringAppend(scrptData, " ", 1); - } - - /* - * First replace the \n's with \r's in the script argument - * Also replace "\\n" with " ". - */ - - for (ptr = scrptData->string; *ptr != '\0'; ptr++) { - if (*ptr == '\n') { - *ptr = '\r'; - } else if (*ptr == '\\') { - if (*(ptr + 1) == '\n') { - *ptr = ' '; - *(ptr + 1) = ' '; - } - } - } - - sysErr = AECreateDesc(typeChar, Tcl_DStringValue(scrptData), - Tcl_DStringLength(scrptData), scrptDesc); - - if (sysErr != noErr) { - sprintf(buffer, "%6d", sysErr); - Tcl_DStringFree(scrptData); - Tcl_DStringAppend(scrptData, "Error #", 7); - Tcl_DStringAppend(scrptData, buffer, -1); - Tcl_DStringAppend(scrptData, " creating Script Data Descriptor.", 33); - return TCL_ERROR; - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAResultFromID -- - * - * Gets a human readable version of the result from the script ID - * and returns it in the result of the interpreter interp - * - * Results: - * None - * - * Side effects: - * Sets the result of interp to the human readable version of resultID. - * - * - *---------------------------------------------------------------------- - */ - -void -tclOSAResultFromID( - Tcl_Interp *interp, - ComponentInstance theComponent, - OSAID resultID ) -{ - OSErr myErr = noErr; - AEDesc resultDesc; - Tcl_DString resultStr; - - Tcl_DStringInit(&resultStr); - - myErr = OSADisplay(theComponent, resultID, typeChar, - kOSAModeNull, &resultDesc); - Tcl_DStringAppend(&resultStr, (char *) *resultDesc.dataHandle, - GetHandleSize(resultDesc.dataHandle)); - Tcl_DStringResult(interp,&resultStr); -} - -/* - *---------------------------------------------------------------------- - * - * tclOSAASError -- - * - * Gets the error message from the AppleScript component, and adds - * it to interp's result. If the script data is known, will point - * out the offending bit of code. This MUST BE A NULL TERMINATED - * C-STRING, not a typeChar. - * - * Results: - * None - * - * Side effects: - * Sets the result of interp to error, plus the relevant portion - * of the script. - * - *---------------------------------------------------------------------- - */ - -void -tclOSAASError( - Tcl_Interp * interp, - ComponentInstance theComponent, - char *scriptData ) -{ - OSErr myErr = noErr; - AEDesc errResult,errLimits; - Tcl_DString errStr; - DescType returnType; - Size returnSize; - short srcStart,srcEnd; - char buffer[16]; - - Tcl_DStringInit(&errStr); - Tcl_DStringAppend(&errStr, "An AppleScript error was encountered.\n", -1); - - OSAScriptError(theComponent, kOSAErrorNumber, - typeShortInteger, &errResult); - - sprintf(buffer, "Error #%-6.6d\n", (short int) **errResult.dataHandle); - - AEDisposeDesc(&errResult); - - Tcl_DStringAppend(&errStr,buffer, 15); - - OSAScriptError(theComponent, kOSAErrorMessage, typeChar, &errResult); - Tcl_DStringAppend(&errStr, (char *) *errResult.dataHandle, - GetHandleSize(errResult.dataHandle)); - AEDisposeDesc(&errResult); - - if (scriptData != NULL) { - int lowerB, upperB; - - myErr = OSAScriptError(theComponent, kOSAErrorRange, - typeOSAErrorRange, &errResult); - - myErr = AECoerceDesc(&errResult, typeAERecord, &errLimits); - myErr = AEGetKeyPtr(&errLimits, keyOSASourceStart, - typeShortInteger, &returnType, &srcStart, - sizeof(short int), &returnSize); - myErr = AEGetKeyPtr(&errLimits, keyOSASourceEnd, typeShortInteger, - &returnType, &srcEnd, sizeof(short int), &returnSize); - AEDisposeDesc(&errResult); - AEDisposeDesc(&errLimits); - - Tcl_DStringAppend(&errStr, "\nThe offending bit of code was:\n\t", -1); - /* - * Get the full line on which the error occured: - */ - for (lowerB = srcStart; lowerB > 0; lowerB--) { - if (*(scriptData + lowerB ) == '\r') { - lowerB++; - break; - } - } - - for (upperB = srcEnd; *(scriptData + upperB) != '\0'; upperB++) { - if (*(scriptData + upperB) == '\r') { - break; - } - } - - Tcl_DStringAppend(&errStr, scriptData+lowerB, srcStart - lowerB); - Tcl_DStringAppend(&errStr, "_", 1); - Tcl_DStringAppend(&errStr, scriptData+srcStart, upperB - srcStart); - } - - Tcl_DStringResult(interp,&errStr); -} - -/* - *---------------------------------------------------------------------- - * - * GetRawDataFromDescriptor -- - * - * Get the data from a descriptor. - * - * Results: - * None - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -GetRawDataFromDescriptor( - AEDesc *theDesc, - Ptr destPtr, - Size destMaxSize, - Size *actSize) - { - Size copySize; - - if (theDesc->dataHandle) { - HLock((Handle)theDesc->dataHandle); - *actSize = GetHandleSize((Handle)theDesc->dataHandle); - copySize = *actSize < destMaxSize ? *actSize : destMaxSize; - BlockMove(*theDesc->dataHandle, destPtr, copySize); - HUnlock((Handle)theDesc->dataHandle); - } else { - *actSize = 0; - } - - } - -/* - *---------------------------------------------------------------------- - * - * GetRawDataFromDescriptor -- - * - * Get the data from a descriptor. Assume it's a C string. - * - * Results: - * None - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static OSErr -GetCStringFromDescriptor( - AEDesc *sourceDesc, - char *resultStr, - Size resultMaxSize, - Size *resultSize) -{ - OSErr err; - AEDesc resultDesc; - - resultDesc.dataHandle = nil; - - err = AECoerceDesc(sourceDesc, typeChar, &resultDesc); - - if (!err) { - GetRawDataFromDescriptor(&resultDesc, (Ptr) resultStr, - resultMaxSize - 1, resultSize); - resultStr[*resultSize] = 0; - } else { - err = errAECoercionFail; - } - - if (resultDesc.dataHandle) { - AEDisposeDesc(&resultDesc); - } - - return err; -} diff --git a/mac/tclMacOSA.exp b/mac/tclMacOSA.exp deleted file mode 100644 index 4cde512..0000000 --- a/mac/tclMacOSA.exp +++ /dev/null @@ -1 +0,0 @@ -Tclapplescript_Init diff --git a/mac/tclMacOSA.r b/mac/tclMacOSA.r deleted file mode 100644 index 6521ac8..0000000 --- a/mac/tclMacOSA.r +++ /dev/null @@ -1,76 +0,0 @@ -/* - * tkMacOSA.r -- - * - * This file creates resources used by the AppleScript package. - * - * Copyright (c) 1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacOSA.r,v 1.2 1998/09/14 18:40:05 stanton Exp $ - */ - -#include -#include - -/* - * The folowing include and defines help construct - * the version string for Tcl. - */ - -#define SCRIPT_MAJOR_VERSION 1 /* Major number */ -#define SCRIPT_MINOR_VERSION 0 /* Minor number */ -#define SCRIPT_RELEASE_SERIAL 2 /* Really minor number! */ -#define RELEASE_LEVEL alpha /* alpha, beta, or final */ -#define SCRIPT_VERSION "1.0" -#define SCRIPT_PATCH_LEVEL "1.0a2" -#define FINAL 0 /* Change to 1 if final version. */ - -#if FINAL -# define MINOR_VERSION (SCRIPT_MINOR_VERSION * 16) + SCRIPT_RELEASE_SERIAL -#else -# define MINOR_VERSION SCRIPT_MINOR_VERSION * 16 -#endif - -#define RELEASE_CODE 0x00 - -resource 'vers' (1) { - SCRIPT_MAJOR_VERSION, MINOR_VERSION, - RELEASE_LEVEL, 0x00, verUS, - SCRIPT_PATCH_LEVEL, - SCRIPT_PATCH_LEVEL ", by Jim Ingham & Ray Johnson © Sun Microsystems" -}; - -resource 'vers' (2) { - SCRIPT_MAJOR_VERSION, MINOR_VERSION, - RELEASE_LEVEL, 0x00, verUS, - SCRIPT_PATCH_LEVEL, - "Tclapplescript " SCRIPT_PATCH_LEVEL " © 1996-1997" -}; - -/* - * The -16397 string will be displayed by Finder when a user - * tries to open the shared library. The string should - * give the user a little detail about the library's capabilities - * and enough information to install the library in the correct location. - * A similar string should be placed in all shared libraries. - */ -resource 'STR ' (-16397, purgeable) { - "TclAppleScript Library\n\n" - "This library provides the ability to run AppleScript " - " commands from Tcl/Tk programs. To work properly, it " - "should be placed in the ÔTool Command LanguageÕ folder " - "within the Extensions folder." -}; - - -/* - * We now load the Tk library into the resource fork of the library. - */ - -data 'TEXT' (4000,"pkgIndex",purgeable, preload) { - "# Tcl package index file, version 1.0\n" - "package ifneeded Tclapplescript 1.0 [list tclPkgSetup $dir Tclapplescript 1.0 {{Tclapplescript" - ".shlb load AppleScript}}]\n" -}; diff --git a/mac/tclMacPanic.c b/mac/tclMacPanic.c deleted file mode 100644 index 081c856..0000000 --- a/mac/tclMacPanic.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * tclMacPanic.c -- - * - * Source code for the "panic" library procedure used in "Simple Shell"; - * other Mac applications will probably override this with a more robust - * application-specific panic procedure. - * - * Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacPanic.c,v 1.2 1998/09/14 18:40:05 stanton Exp $ - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tclInt.h" - -/* - * constants for panic dialog - */ -#define PANICHEIGHT 150 /* Height of dialog */ -#define PANICWIDTH 350 /* Width of dialog */ -#define PANIC_BUTTON_RECT {125, 260, 145, 335} /* Rect for button. */ -#define PANIC_ICON_RECT {10, 20, 42, 52} /* Rect for icon. */ -#define PANIC_TEXT_RECT {10, 65, 140, 330} /* Rect for text. */ -#define ENTERCODE (0x03) -#define RETURNCODE (0x0D) - -/* - * The panicProc variable contains a pointer to an application - * specific panic procedure. - */ - -void (*panicProc) _ANSI_ARGS_(TCL_VARARGS(char *,format)) = NULL; - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetPanicProc -- - * - * Replace the default panic behavior with the specified functiion. - * - * Results: - * None. - * - * Side effects: - * Sets the panicProc variable. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetPanicProc(proc) - void (*proc) _ANSI_ARGS_(TCL_VARARGS(char *,format)); -{ - panicProc = proc; -} - -/* - *---------------------------------------------------------------------- - * - * MacPanic -- - * - * Displays panic info.. - * - * Results: - * None. - * - * Side effects: - * Sets the panicProc variable. - * - *---------------------------------------------------------------------- - */ - -static void -MacPanic( - char *msg) /* Text to show in panic dialog. */ -{ - WindowRef macWinPtr, foundWinPtr; - Rect macRect; - Rect buttonRect = PANIC_BUTTON_RECT; - Rect iconRect = PANIC_ICON_RECT; - Rect textRect = PANIC_TEXT_RECT; - ControlHandle okButtonHandle; - EventRecord event; - Handle stopIconHandle; - int part; - Boolean done = false; - - - /* - * Put up an alert without using the Resource Manager (there may - * be no resources to load). Use the Window and Control Managers instead. - * We want the window centered on the main monitor. The following - * should be tested with multiple monitors. Look and see if there is a way - * not using qd.screenBits. - */ - - macRect.top = (qd.screenBits.bounds.top + qd.screenBits.bounds.bottom) - / 2 - (PANICHEIGHT / 2); - macRect.bottom = (qd.screenBits.bounds.top + qd.screenBits.bounds.bottom) - / 2 + (PANICHEIGHT / 2); - macRect.left = (qd.screenBits.bounds.left + qd.screenBits.bounds.right) - / 2 - (PANICWIDTH / 2); - macRect.right = (qd.screenBits.bounds.left + qd.screenBits.bounds.right) - / 2 + (PANICWIDTH / 2); - - macWinPtr = NewWindow(NULL, &macRect, "\p", true, dBoxProc, (WindowRef) -1, - false, 0); - if (macWinPtr == NULL) { - goto exitNow; - } - - okButtonHandle = NewControl(macWinPtr, &buttonRect, "\pOK", true, - 0, 0, 1, pushButProc, 0); - if (okButtonHandle == NULL) { - CloseWindow(macWinPtr); - goto exitNow; - } - - SelectWindow(macWinPtr); - SetCursor(&qd.arrow); - stopIconHandle = GetIcon(kStopIcon); - - while (!done) { - if (WaitNextEvent(mDownMask | keyDownMask | updateMask, - &event, 0, NULL)) { - switch(event.what) { - case mouseDown: - part = FindWindow(event.where, &foundWinPtr); - - if ((foundWinPtr != macWinPtr) || (part != inContent)) { - SysBeep(1); - } else { - SetPortWindowPort(macWinPtr); - GlobalToLocal(&event.where); - part = FindControl(event.where, macWinPtr, - &okButtonHandle); - - if ((inButton == part) && - (TrackControl(okButtonHandle, - event.where, NULL))) { - done = true; - } - } - break; - case keyDown: - switch (event.message & charCodeMask) { - case ENTERCODE: - case RETURNCODE: - HiliteControl(okButtonHandle, 1); - HiliteControl(okButtonHandle, 0); - done = true; - } - break; - case updateEvt: - SetPortWindowPort(macWinPtr); - TextFont(systemFont); - - BeginUpdate(macWinPtr); - if (stopIconHandle != NULL) { - PlotIcon(&iconRect, stopIconHandle); - } - TextBox(msg, strlen(msg), &textRect, teFlushDefault); - DrawControls(macWinPtr); - EndUpdate(macWinPtr); - } - } - } - - CloseWindow(macWinPtr); - - exitNow: -#ifdef TCL_DEBUG - Debugger(); -#else - abort(); -#endif -} - -/* - *---------------------------------------------------------------------- - * - * panic -- - * - * Print an error message and kill the process. - * - * Results: - * None. - * - * Side effects: - * The process dies, entering the debugger if possible. - * - *---------------------------------------------------------------------- - */ - -#pragma ignore_oldstyle on -void -panic(char * format, ...) -{ - va_list varg; - char errorText[256]; - - if (panicProc != NULL) { - va_start(varg, format); - - (void) (*panicProc)(format, varg); - - va_end(varg); - } else { - va_start(varg, format); - - vsprintf(errorText, format, varg); - - va_end(varg); - - MacPanic(errorText); - } - -} -#pragma ignore_oldstyle reset diff --git a/mac/tclMacPort.h b/mac/tclMacPort.h deleted file mode 100644 index 7be4938..0000000 --- a/mac/tclMacPort.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - * tclMacPort.h -- - * - * This header file handles porting issues that occur because of - * differences between the Mac and Unix. It should be the only - * file that contains #ifdefs to handle different flavors of OS. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacPort.h,v 1.8 1999/04/16 00:47:21 stanton Exp $ - */ - - -#ifndef _MACPORT -#define _MACPORT - -#ifndef _TCLINT -# include "tclInt.h" -#endif - -/* - *--------------------------------------------------------------------------- - * The following sets of #includes and #ifdefs are required to get Tcl to - * compile on the macintosh. - *--------------------------------------------------------------------------- - */ - -#include "tclErrno.h" -#include - -#ifdef THINK_C - /* - * The Symantic C code has not been tested - * and probably will not work. - */ -# include -# include -# include -# include -# include -# include -# include -# include -# include -#elif defined(__MWERKS__) -# include -# include - -/* - * The following definitions are usually found if fcntl.h. - * However, MetroWerks has screwed that file up a couple of times - * and all we need are the defines. - */ - -# define O_RDWR 0x0 /* open the file in read/write mode */ -# define O_RDONLY 0x1 /* open the file in read only mode */ -# define O_WRONLY 0x2 /* open the file in write only mode */ -# define O_APPEND 0x0100 /* open the file in append mode */ -# define O_CREAT 0x0200 /* create the file if it doesn't exist */ -# define O_EXCL 0x0400 /* if the file exists don't create it again */ -# define O_TRUNC 0x0800 /* truncate the file after opening it */ - -/* - * MetroWerks stat.h file is rather weak. The defines - * after the include are needed to fill in the missing - * defines. - */ - -# include -# ifndef S_IFIFO -# define S_IFIFO 0x0100 -# endif -# ifndef S_IFBLK -# define S_IFBLK 0x0600 -# endif -# ifndef S_ISLNK -# define S_ISLNK(m) (((m)&(S_IFMT)) == (S_IFLNK)) -# endif -# ifndef S_ISSOCK -# define S_ISSOCK(m) (((m)&(S_IFMT)) == (S_IFSOCK)) -# endif -# ifndef S_IRWXU -# define S_IRWXU 00007 /* read, write, execute: owner */ -# define S_IRUSR 00004 /* read permission: owner */ -# define S_IWUSR 00002 /* write permission: owner */ -# define S_IXUSR 00001 /* execute permission: owner */ -# define S_IRWXG 00007 /* read, write, execute: group */ -# define S_IRGRP 00004 /* read permission: group */ -# define S_IWGRP 00002 /* write permission: group */ -# define S_IXGRP 00001 /* execute permission: group */ -# define S_IRWXO 00007 /* read, write, execute: other */ -# define S_IROTH 00004 /* read permission: other */ -# define S_IWOTH 00002 /* write permission: other */ -# define S_IXOTH 00001 /* execute permission: other */ -# endif - -# define isatty(arg) 1 - -/* - * Defines used by access function. This function is provided - * by Mac Tcl as the function TclpAccess. - */ - -# define F_OK 0 /* test for existence of file */ -# define X_OK 0x01 /* test for execute or search permission */ -# define W_OK 0x02 /* test for write permission */ -# define R_OK 0x04 /* test for read permission */ - -#endif /* __MWERKS__ */ - -/* - * Many signals are not supported on the Mac and are thus not defined in - * . They are defined here so that Tcl will compile with less - * modification. - */ - -#ifndef SIGQUIT -#define SIGQUIT 300 -#endif - -#ifndef SIGPIPE -#define SIGPIPE 13 -#endif - -#ifndef SIGHUP -#define SIGHUP 100 -#endif - -/* - * waitpid doesn't work on a Mac - the following makes - * Tcl compile without errors. These would normally - * be defined in sys/wait.h on UNIX systems. - */ - -#define WAIT_STATUS_TYPE int -#define WNOHANG 1 -#define WIFSTOPPED(stat) (1) -#define WIFSIGNALED(stat) (1) -#define WIFEXITED(stat) (1) -#define WIFSTOPSIG(stat) (1) -#define WIFTERMSIG(stat) (1) -#define WIFEXITSTATUS(stat) (1) -#define WEXITSTATUS(stat) (1) -#define WTERMSIG(status) (1) -#define WSTOPSIG(status) (1) - -/* - * Make sure that MAXPATHLEN is defined. - */ - -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# else -# define MAXPATHLEN 2048 -# endif -#endif - -/* - * Define "NBBY" (number of bits per byte) if it's not already defined. - */ - -#ifndef NBBY -# define NBBY 8 -#endif - -/* - * These functions always return dummy values on Mac. - */ -#ifndef geteuid -# define geteuid() 1 -#endif -#ifndef getpid -# define getpid() -1 -#endif - -/* - * Variables provided by the C library. - */ - -extern char **environ; - -/* - *--------------------------------------------------------------------------- - * The following macros and declarations represent the interface between - * generic and mac-specific parts of Tcl. Some of the macros may override - * functions declared in tclInt.h. - *--------------------------------------------------------------------------- - */ - -/* - * The default platform eol translation on Mac is TCL_TRANSLATE_CR: - */ - -#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CR - -/* - * Declare dynamic loading extension macro. - */ - -#define TCL_SHLIB_EXT ".shlb" - -/* - * The following define is bogus and needs to be fixed. It claims that - * struct tm has the timezone string in it, which is not true. However, - * the code that works around this fact does not compile on the Mac, since - * it relies on the fact that time.h has a "timezone" variable, which the - * Metrowerks time.h does not have... - * - * The Mac timezone stuff never worked (clock format 0 -format %Z returns "Z") - * so this just keeps the status quo. The real answer is to not use the - * MSL strftime, and provide the needed compat functions... - * - */ - -#define HAVE_TM_ZONE - -/* - * The following macros have trivial definitions, allowing generic code to - * address platform-specific issues. - */ - -#define TclpAsyncMark(async) -#define TclpGetPid(pid) ((unsigned long) (pid)) -#define TclpGetUserHome(n, b) (NULL) -#define TclSetSystemEnv(a,b) -#define tzset() - -/* - * The following defines replace the Macintosh version of the POSIX - * functions "stat" and "access". The various compilier vendors - * don't implement this function well nor consistantly. - */ -#define lstat(path, bufPtr) TclStat(path, bufPtr) - -#define fopen(path, mode) TclMacFOpenHack(path, mode) -#define readlink(fileName, buffer, size) TclMacReadlink(fileName, buffer, size) -#ifdef TCL_TEST -#define chmod(path, mode) TclMacChmod(path, mode) -#endif - -/* - * Prototypes needed for compatability - */ - -EXTERN int strncasecmp _ANSI_ARGS_((CONST char *s1, - CONST char *s2, size_t n)); - -/* - * These definitions force putenv & company to use the version - * supplied with Tcl. - */ -#ifndef putenv -# define unsetenv TclUnsetEnv -# define putenv Tcl_PutEnv -# define setenv TclSetEnv -void TclSetEnv(CONST char *name, CONST char *value); -int Tcl_PutEnv(CONST char *string); -void TclUnsetEnv(CONST char *name); -#endif - -/* - * Platform specific mutex definition used by memory allocators. - * These are all no-ops on the Macintosh, since the threads are - * all cooperative. - */ - -#ifdef TCL_THREADS -typedef int TclpMutex; -#define TclpMutexInit(a) -#define TclpMutexLock(a) -#define TclpMutexUnlock(a) -#else -typedef int TclpMutex; -#define TclpMutexInit(a) -#define TclpMutexLock(a) -#define TclpMutexUnlock(a) -#endif /* TCL_THREADS */ - -#endif /* _MACPORT */ diff --git a/mac/tclMacProjects.sea.hqx b/mac/tclMacProjects.sea.hqx deleted file mode 100644 index a5d6f86..0000000 --- a/mac/tclMacProjects.sea.hqx +++ /dev/null @@ -1 +0,0 @@ -(This file must be converted with BinHex 4.0) :#d&bBfKTGQ8ZFf9K!%&38%aKGA0d)!#3!rB)!!"Cp#K08dP8)3!&!!$f#(*-BA8 #r`#3!aErr`!0$d*239p8Bfa6D'9XE(-ZZ3DE&S)!N!J'QaL%jTX!N"3f-`#3"2q 3"%e08(*$9dP&!3#[[Qr$XaYN+`#3"3)AYJ#3"M@Y!!$d0!#3"NDM"[L16aBq)C[ G`RrKj2NYr2"N1Ej`Zi8YI'AAB''%,DaERUpmCHBAPG2Mp%[j3QiKr2#pc-1c@pm irZ2Rp`Zh46q6F-)*@mKbI1%,rq8*AcMKYa`rYpGj5IEj5EDpPq6f%rk%EC2`,Ri ,@`LrCF$*3TB4ArJY!ll`KGp#XF*lE*AfG[h#[H@iYh!MP#aN)Fr*3KBb@BiXC,! -9Nl`dSPIj[(h'QK[0M+l[2eqlm+cH0,bZNcc0XYLqqf0p5jkRHGfNGeq'hQpNml 2[%E@`)(CC`0qLi2m(-3A-h2HHIDG[GG*&[2,JB1'!Q-""0akIJMS5krXc"C1q(G N%difJ4UA!,!&(r!+I2PqA`h$ZZ-iqcK1lJ3R[qqM6RkrPaeRpNCL2TM,jrJEIL[ #QVrFLk)JM0bK+&cT9j01V#IPkmKk`Gb"[G&a#SXFClle"eFlKk6"&c[lT[m[59p X6er026hklAUMdbZ%lGfYpl#d@2T(rjqF@jml-(rTG$A$fR6PR-R*c@%rR-cT`c9 Jr[*GFl2Mr25NIK,5YV8AGPDYiepIZIPV!k'kZ`6d-EA`#I642GeMR!2h,iG0VaV ZVP(D1F%j+2GBIPhRIlQ)aVNLpe,ZZAe1F1C4KKXFjdr+h5NkM8SCZA+BNFG&[d- (ACal),FTrmD@$XV@TS"cZ@Ti(kSQj%cXBT9(l*)Z")K@aCA!H4(l0HcAXAq&r62 XAf$r'[X0V($'i!AXRf2r"[Y0l0pL[iAp0[Blf,r$rMrXhf2r!IZ2f(r#IKIl2Ha A5Aij9[)fd#Tc-PEUDdl#(S)p&(XBGKKl-2D"f!GK(i`p(2Yc@'&NjR6XNGL(BRm HHa4@DQq+f"(X8R)p%hX@pXRBTf"r!IXN,&ci(1aQl#EX4Z`cXDGK,m*HM$dGH`R f8ZbTf#GLDHYcXEq)I4Tf#jCH2!2l@1c6XFr!RS*p(2Eaf#GJr`hllpMr`2iRpJI BImAqPf"&qrhlf(qa8#SYEm69TAh0IYJZE!UEaQD`JYcQB+a`8A-SYTHhrjRr&f+ PISEk'@TRqV!2ali5Hccf%GKMX-GL6m"+cjYcX#Z`Vm!q'lX++dKK"V&VXBr%VX1 HK&f224Rl+1`'l+Z`MmBq"L[e0p6G8(I6JhdepMABjf)&)mdYf&qL6Lr&ASPp'IB Ul%Z`9f#[aViF+h8)2Sfp(#Ye#mJa)*H!A!,b#-JM8"krM2d9l+pLAiGp2IB0f$G L,m0HLi@aAiGp-jBHkF2ZBl%9(Lqp%h`rGKTf1PCk+U$2JKp-86T`eQ#P*`*k,K" k5Ld$qM'J(i-MX!GJ$m3HK*f"lFFk9M861m[L0M!Zr@cKq$cX4l"rK2dSpQ2B$f( r%2Yal#H`Rm6q2[E$f%pK2ihp$"DpjR2Bcf2r'2XRf#pJ[iLp#IXPl*HaAm(q!DN ,Xc"ABPq)I4&@DQbSQk(I$,8ce-l3$iEk'fTSU+'KKSBq-I5I!4-0r@'SQD'HKRS DHX-FJjf$(F61aFl$cXG+Ej[MX!ZaLl"$UGi8j1Jh3mmEHYl38iDq0r5l8Em,aJG JI`!RJ)YBVJ0f)lN)0`MJ"!&F)##R!-`2b#Zi(2YmV13AA)'&38Rq!EN(m)F!rK$ !'`*i3`"[#1!0`V@%YiN9rK$!(`,U&e#rJ2S&e#qi"rZEf0r#ASpp+rEAXF+0J[Z aEmHq"IXfl$Z`lm5q#rXlf(GMhi0p,rChXHr$[Krl!H`(XEq(&58TZ*ZD#jm`i*X "p``iCH!F"UjK`$)$Mc$`%30R-(!5!emam"8$Mc&`#32Q'@T[i#+'qKZiMB(E',L 0JG-B1)f"daKiLS'R'(L+!4m0A-A!93aFaF"4$"c&`'N-Z'R!68-2'E$6J*e'Z#P F)B!V"(#%3,a3H%3!M`MJ#J'm))!A"(#)!0i3J2d"R#)!C`*`*J$l!l!QJ)X%F,% !,KE!)3)i4!#(#1!3!4`LJ%-%F)d!$KI!*3*i4!#A#q"b!9`Zj,&qKHrF9[A1ND$ 4U[ZMeEU$(4bCm1YeTa`QB46@2AFJU%4HY-BT,lHZXr`iI8F$"leQc4hfil!G9BR F@UfA[@UaeHT["NQK+[pk2lBHLF`jmDbTV-4jGP"TN!$ZmPVBm3ApcF529RK9Rc5 $NIl"C@1&SD&53Gl9AM+4rYp3'QihNk$KTf&(Rc25ljBkVdL*PXNR#@RUVNM,)bH HQ#VkfQVBD!Ae`+qjIEjAmk1d[Q%E4)81XL+[ARi"JH&Mbe[9#6ecH'&q)CkSEdj @1Z$XS1SP3GJNAr('T9Uph(TaVShmY`[JFKdmhPf`F*8VK6S`&4Y854B[@(MfL3k 4KGlP(ANb9bQk3*kaA5"9@615HX*qNKbbME2+1q'dB0l#fSQP6TLfQEJ(1p%fm)J YKC!!&KYfL"VXEl6#+((a"fGjpASB0LRQf5hKaSTjTEPcddKaV[ALUPG2[H[mY3l rMiiEcPKTF-Q5,6QXlGRU6R,H-R%5X$AX,1V!e5$GPhr$0NK8&r%(jD(P@pfZ-ZV 8bZ#0XVI"*`f!,0P11(9c*i4aS-`a!`1T0ppCZAMR,5#C4"5K38,8Am#lH[Vk9Ta ap$aP@E'N6(3%&0SRYNh#i1(T5S44fB4LZ!T$&I$d(3Yl0'1)QCAdUYdETN#9l2Y `!`QAI*FrV0JXf4"h,MB%!dK,p&lB*0NRU-m4+RRd"+M(U`l,U9D@(S#M5D"$6&k dCE@`9bJB'4D$L`f4*38@U8*-,Z*cRPD&kBKM)`4L8eb0JPCL'L)+b18F[q)5M@* X2CkbrD@i5[P)fefPN!!#Vi(CMI6#fq5KN9l6mc(fM[3D9R"kf)c$ZPq)NhBP&ZG l#ZmI0p"cXGp-8Mr2VrD#*MlhrNM[0T!!b"+eN9j"PpCJj@J2T+ViCS%6K5rU)pD C`k-%%q28XJ9alS6*%V'Qq%k)2TUVeTVL92+$Z![-T4KBV&hbIZKY9LqIUQh!08A 6J66SQU)Pp,!ri&2`C[-U2l)"X!S0@0'1Nl$KRZf[Z55-DV&6V)*3@k"&@bH!TSh 4Z*qi)hk5"-haf&N5N!$XDR$#HNID3EhQpUa1)Lpf&[Z9p[Li(lRQcF#3!+`9+FF P6HZ@HD[0*T(e3k5ifDmlrF2ZB!ZDFGCDAU&3X0PMr@EU1bD)[6Mf'a@P%&84Pl# em,r1ES@F8V-5NTR,R@UlV2!P@8@YJ-YPSicR!Hk!eaa[Hq0qeJ5('-)Yf@b+8US IR*S9pM#h@+X&LK*55@%&$QfCMUf(&4X5eTTX5d%qaBrC!Y&$-m`Cf$%rr+)XAlT arbXHEk(X'a6mIDAN-r8MdV1G$BVq-4[J!jM0mS"mUA38V"aM66M&C#HTiR%Vqdd R&TfqrRAQ#5qmDTfN%XfJK6-Bc'``cm(-"8&ZES2j$MlQ-CM,B-k$Q4!h(m*-5$M Mk5riFM@6H[3Yp5lf5R9aVbf&YB'QLj,[XIe$lY,LH9,5aEQY2kKeejli8kKq+ei %$rSKqQL(aHSEXBaN%$q%AB4GL*f,RBHGMjf06@(ha`jJ$m"fBrZ`[GKK1mC'Zp' #Y+GV5ddY1b*$Qp+1Y#qYl%Ce[!M)&IDRr8GTPQ#(XA6")$D&RBpGJ&f)(9*RL*f 0(F"fBaNX!DR''c&--&re'+$S%MU%kY-&9*pZT"2S$+ari3-NPkP!BQHq6i*L)#i KI+jd)9#I204ID%AqLN"M8BdQiCqK"8,Zd,GPj!#9V[&QSE%G3FK4NfbClN&K*Y6 Lb63hc8Bl-0('*"[6,N`B-P8))$$Y`Z3-dc4-(c+9b+3J%i0-16(9a236diK-R$' C5%X`2F-N&*-c60%`*F1d$"-d6"BbPFM8)T-d6%)"%Na"-BN'!$'4`b318ie-@c( "b&3EP@3DNLNUTR@BhQ(U%E"KkT'T+kDV(*0LiSVT0bDPQ!*L-SJT)B#*b5bQGJ! cTUqBk+%YhH39deC-#,QT(UCmQ-*LQSY*,DDl!%%QYU!))!66Fdc@-CR(&"I6B8a L-KR)*#"6Jdcj-5A)0")INd9-Nc&0b13G8ha-k%&GQ$TN#T4T65EqQ!4MUSNT*LE (!&DQb*J)Bj+6k6l((*P`BNS-!'65M`NRTU'Bm'3bP1P4*MfC0Q85P%P"TUHB1!A 8Q54P1T!!U9'3!-90MM+�JcHFM%+0J+m$1KbN4FrC0ZR*`"h[iGaAIdd*!!*N! ['0XaIAa[2PPRHGDB0[)#C&R%q%cC4e3G(2c[6XKf!F5JBr&!leKe99#6eVPK"&U 4PbK%H`KT5%)Z%Vj-C-r`i+"J+2YepJi[fia2jX"XU%`kIeAr3!mYhfErlfrrYp[ r(IErJIEr3IS2hB`bDTZeBcJYPe#RrGmep@$l)9Z(e`4[p"&AMBcphf[rlfZc(Y" rU,ckCeYrhe4b(BHU[VQ*MP`YTpTAACEp8kqQ$Yib@DCe4d630qIB0h[XrfNhhc` *p5cEF&Dq)''d[V`HT65`6Ae)cp'(p#"p4ql8N!#kd9Dd&"e$Yp!TG)P6PB`6H(9 %kjrJdDNAa)QArRRDIb(DUF`*"N(65ricr4$0lQLJ![VGY3BP$kka5P$9$[d#D`r m!3XDR"bahaBj3JFN5Sq9[R(e4(8*&KRX@KIcjYcMZEIbIljeP31%'[,1rr3$4pA Q6NjqfFJAd3IMp-"pi5+Mk22#6$"i!,kIm6K[`'G5-FP2miQUF1#ZH86p*1B%)j& 0BE&$1iYZ3-Ae@Z,J2HMD5%cVe'Df!KmH"HFimUFLZ`p"9J[,bBBET&E,2GafL1` XL&X6N3e!lAi-6`kJ'pJ!Yc!LI1%H!CqG1JMCGfBI"pMXa6NR,BG(CZK,e4q[K`) Q['#`+m9k0Gp%4IJbl"'U6f6[rQ+'0EdV!+rD-B3!LmZU[Ak!6j!!IpUlqacb94l FaL04+KrGEB&(PXXGMN*eD-pBH8+Vp$(iNS@4dBb,!6mPSIPdb-*PcI30JLBIEHD N+bD%($PMVX$TQNa(ZAP2TRqF)-*8&P00I%a(1@"NLSX*+$kQM0`F+$[%h!!LZjp FCGRca-39(lZlA+1`Ji[T(MlfjM&aa-IH0bDD+#peC2)((e0+6"cKBeS-2ciQPjL #`XGd&2A(al3A%dAii+j-Hq&MSS[*+Aa-PM%&KBmT-+DKm$'aa[362[CEN5mqpP9 "bI&45bDHm,(r$l+-Maer6%[KBemGNfDd*l9N#J`IY@#D$4r6B%b4i@0U5NFLfd5 [&5EE0$h&e"FqTYlXS+RiQ$CMQJXI!Va14,9T1SeT-(cd+&0cq0M0aD3F2QV*9"d qpUNacBC2GJrD#69ml#TNqJ`IZrRS,q!&M!"2m0'(6,(KSlj-Xq&c%fciN!$lQA$ $aa3B8fhiQ2jL%JiIdh1mL3q-B9S1(lZf&+6E962GHG@ZA@mUeVGV&b06J2MBSDJ $Mah#0DEUm0'hp"FqkJ8qi'0+M3NhI-JD6,cK!bH)aFHd)C0mq*LZdr'&$Ndh-Z@ ($raMU!!IHmqB!-6(rMUQ'['aIdjRHMU%%qJUq'3[BDL[#%5$ep3"(eLTSe+G`LC 8&RaJ!G15q1JVa"Cme0&+2Z*M3XmU-Z*M@Jir2LBJQD6$aa3J%hViU#@pL3qFB() 5(rM0""mqGZ["&r#"fH#5Sa*-@1)$ajRQ`dHGQ2E$4jqVj0#P1Y&Iq+J&pF%((M! KL!pLbJ3S2[!-ES+22BDmJimpG-b*iD016*2LSdlJ*$lfGHSN5jHiKFTH+A%ETJh a`4PdKdC+0@-Z#apiT#T,5Vd0Am"(Rc#CLSrrF#9m6&SUG8YTlb+c@[M!!c!%(hL JT$XPV!A$mE%M&!c%abj-TNlP5iYVdE2ii#dkD*-@6f!L&4qB#hr""kiaVBS2()' liD-RQA$&4kfCC-9($[3A2UC&Q5$&"fm!kr#a)j*T8RcXmq-GI&"dDSk2ZS)Rq0L jb$3T2RDP-[f,MjfRB$XqDX`NX(`CeCL*B(c`#DC`mF'TQ#6'"aGLSKJII3PHi30 Ei@[i`$MUKSqHYq0$iU-(`Md92S%22[Gd5,IMe%k#HXB$4pj+2ieB6Z4TqjkY1Fi #,Ma,Z2$$bCGfb1jHYHqjQTFYi-*c`!AKA#XYTr@bIF)85Z[@[+YIF4@LKq@6Q3i 9b(e[hhdER1jHlj'G%mVRiK0B*G('Y%-i-ZZ"'IkF2UFdZ,KRMMYRFA'db0qerD9 41rEM5rNU+a4dP-VVmhNL9LMF0Qjr5b6%aCfY%,l#,L2jRaY#Pi#Hc32ZZiE3X`( TMrEfq&8qEma`[JpKVm-1q*%AZXmC2+GBlLRdM0PTaH*hqaDRh0FNqZ(T,ek+cdH aAX!hTf6i!G#TT)Imp!Y"h%1`UZ"1VXbXfmCh9mViCMkhB!IE9rD6+,c%MeE&V[E b$)lmd,"lBQlqIAIPjUmiFpQJ1p`hi4cRMZMIb*aMcq!)(EQFCHk6XijGkSblbma %ZICkfl(2fURJYShj-qlj(HIDDkrGE-dIr0D&cUC0QlEDDeLX&r[IYQ($MMIZYY@ DeYiUjZjrX1plj*%Z#AQkcap4Gr#K'HXP`)IEFXp4'[Xalqji#$2Z6XCJ9i,M6fk $-"rcl@k[#AXMh!`ZG`+j[5EF!H6fQM"cVaS"Gb5j[5EFkq2fQR!cNpYV`[e'EUq *h4fLHdfifmHa+U1G",VAa1Kq)GeVBM3(lrDDF015lM9T8ieeVdQEGR2SAT-flC[ 3[5CYfS1JHdhD01H[HdhXEJrGDp+QfhYdVdQElL(5[5CY@UHMHdeBeqVfQV4VYPl hQV4V0i1+mHh55h@[5E[f)qKHNhEY!Y#p*Zfk(dRhQV6VEKrGDp+Z@kKdVdQllTT 5@3"Lk[DDG+JZZYHN3cfYHddk*0lUAT-1cHlVAK1lEd2hQR3SEpeVdU(G!lVAT%- h(HPHN`lG8U9l66V9YlVAT&-jkek66Zd2d,dQRGUMSAY01LAlk9k66Zded"Rq6Yh -T(Y01R@lN!$Z0HR8RJ-GfqV8EJ2GDp)P(0'p*PhU"peVBRGJk&k6,LRAZYHN5rf YHdfk*)$VAT-Zl863[5CGfN1MBd"GZRP*pjTdU3DU&(CT$iVZ0HRL6LUheb3PE0+ p*LReJHie55Prh@Z58[rTAT18GQhSAT18GLISAT18m%EhQU4d"j,Z08RT,LIGDf* h@ZKHNj6Zh0+p*QPKJ1ie53X$G+p*@RfVHdh5UV[Z08RV[qie5@XJ82HDT)9rZYF NV4ZRG+p*@[LRHdh5`MrGDj,@h9fkeb3MM0Hp*KPKSZiebDM2GDp*4VA3[5BCl3( 4[5BClFA3[5BCjDel66+kE8RhQQ4dEj6Z0FN)Kh5[5EHiK1iek4BQkPk6EY9EpjT d+hqG!Hr@hK!GJZc@,JcGDp+Y1jYdVdQhDUal6EV9pkUpG1Yq,YeV-N9m3'H*T`M [G+r*&2@m5Ya69%IGDc*&HdCdVmN8lF[3[5DXjA*l6DB)Eh5[b46G1UCl6AV5@AE eNEIZ0HN4&ZYHNalKJJjhp+M@ZYHN4aLM#ND2GRESAT-HjDel6ATdhjAZ0HR4h@@ kek4(pj,TAT1TiQ1kef5UH)AZ0CNUV05p*P1&&lVAC+TUThY0TUURGDr*90dSTAY 0TZT1,0eV-PAhL1PHNeja-peVdU[HdVdQ[F)Yh@[5Upl6[5DpHN[hQ[6UGLVGDp+ V28Dkek4Apk,TAT-qF9VGDp)R$UCl6IV%%h5[5Cp`82HDp+RIU#%qGXp`qaFqEU[ #Miqle,J&$"mhPV&,4ljpa#Hj$3`II!QqJ`pmKh2K!i2Je2MS%hE#i)1AX2X)(cY JZ#--(rH`X8G)[Rf&$Gb+K3rXPaZ[V)qqi9BXI14+,[M!5Ql0`JFZ`$A`d3r`Dhc X'+12m(%I'0L)Mhdrh++&Madcm!,jpK2IjNemF$*fmZ#$Ml(6"KrB$jlMSplFV)@ 2'S"&q1JPm!%I-I""I'!r1iM``6RB95AI0(&ZEYc#4qhT4ha`9lJc2MLEVVZE*Rk #AS%2,1EZ-AaJK0`VCRh8&`k)Mee(m#pmm#hZ*T0[ZM31p!GmF(9k%apB5,rJ)eI fQ1%$dpN$KSmqilibI23'A!-ImH!`2V!+l*+2HcEXh@Aid"Hi[``I[*Slc2#"Lr3 )2[J'2!)I1-KpC[MSCr3CI16'[Lamk$4`I2QX2-,Z1(c`$2!C(a`1I--(cd5,`!I R89hT!'%dGpRK!brBfiD2QS)Eq0M,K9BMhi(5Mq"@q0![i"hii1(J'cii*,Z`m-& Yi%6i`!Pk""pBBaFVLSrHS*lik&H`3Vk$T%141cl`RYeVq1KAhX%(9d0R`!IriAi mI'!hHJXqX!2ZLBmHi+imI2!NGU2*0d0k!(jmD#[XUF-(,f4(&Ml`MleNq1!rk!R ik"Yi%$jU#FEL)fGfa-RAVrcJSIM!H,J'2V3!Y#pmF&5p'l!IAZ3N[hl`aXd`p)- "E-'e2UQeh3FShd`d1+[AiH012YArCZU11pArCZV'-pArCZU@0YArCY+,h)GRIB* (h)PRI9*VlXAMQkAlhe6rQkAlqe6rQk9lle6rQkAld96rQk@lh96rQ`@'FFZEp3Q 'FKZFp8NrFd-FhfabjXiikq2q0pArCS-VGXmK2ZPeESqc2Qj28re[0Kb2'q5X6lJ (YmKCRf!LpmGCRf!"GmMa$9!llT'c2Zi&92e[3$IXUIihS&[D92mEd$edU[m0J#[ F,@Gp`NqiAmlk"&HiBFlkT,HjCBj[$MALTMRVSfp8rjZM+bT8rjZMHpa8rjZM'ra 8rjX$9l5l(2%*Rq'Z3HX621AZ36kZ5q%Z3ZZ6@R!ISI9adk$UIi1k&8le[d(GrkE khk$k4[@r3AJDpa0DRh!'ZcF5Rq!MGa6bcD@(ZDI3qX!BeIrQUTDUrmh9(A+Urmh 9cA+Urmh9$A1Urmf&Ah&rSI8*(q!13ljjB*!!eCEa5Ip`Pk(e5E`pD`!IY`+UrMG 20q'TrMG2G`1UrMG2Y96pEjlk8[8r@T8E"Ue2HTJl"kd2M&(pEljZUP2pEllUTrV II2@LkRrciC!!h%"SIF*9Z)@3!'q"F%Ae[`Ad0RF3@KmBV2VI![@kkRm,G-ZGkRm ,d!LiNp$k`%M9raB)Ye6r@kJlr&6r@dL[FN1KpA&(SHTr#h9cRqTr#h@ESHTr#iA aU[mYK&Yb&jle#EIKEMbq4EVC6r@r4H!1pq*CRr3-Gq9CRrcRpMcViqj$eIm@k5i reIm@#Hp9reX%plEl4I%*cq3Z2HX6[X4pHRa$UU[UId2#IYArKS4KU[m08@YZeE- qlY06r@p)GbZUrMH%&X-0HpBR1J+hl&NIH+Ekhj!!m%ce[m@kB9$e[mA+@r@ra@# @R@A!*rh*hA[@*rPcfk$eNEIUIi[4HVK2d2V)@r@raI"KEQ,N'pB0MUVr$H['3GA rKX@I92mETYEFe'Gph&qSqYq`lZY6r@pBrD6khl$@bk[qYd4h2kVqYd6BSrVI%M# )ZakY6qV)IBr@aff2U[mY3ArKYN$VSdG9reX#AqA@3,kPZ[93pEqP`Kl9rjD#8pa [D(hJJHTr5h8MS1Tr5j@IkRp,d5DiiG$kZ'&5pEq$G6qLkRm(kfj,eIm1&YkVrRF `pE9lD2'*rX@GN!$@*cS,Yd*D(hLTqYmbhD@SqYmbhB#TqYmbBBRUIm[SFfiGY$l *NpX'V8pd,QiFY$l4DlKcd2V!HpArPZZ@5YArPSY2U2lR(IUbZm#Lmm+mUereAMR 2bZH2f`AQKGd,'CqNk'Rjr(&Fd"GcdCM2l!bMl'8dHqVi2m88VVRD5rqFhV-k52U i9*Jl2qri[$DR*-8R`'6[6BfqC`Eaa0ZR*2N"6TlCrX8R`2MPGVajB6$!'r-aMhf qh6aeJH9i,l#ET9jSYe1pb'kJZY#LaN9fBp6&0Zl&p[p,E2`ep[pP0Sr,E9jAf(G HD[1kd[jrQAhR+[[ZDqhrUfhFbqe'UeGdlR&dRkGL9f(X,UCU+pU[SljXI(kGSFR Cl4cbMMek02H1@`fQ$qAHB9lrk*h[C*16GjMPIqM-1mcU6jPj"pcSRAQ(fIcpGY8 lHSHjr4Nlmp&j@IX1Fr`RC1r8ecK+&$2qkCQmQIp2cEc$`(PQjKef"@cGq8jF(rB )E*Pj"eTkjX`lk!eRclc$2S)RlAdR"dLba%+q5Gcc*lrMMp0YI()ii)2lGQ`bVae )S$Fm6@U4mNjHLqak6iZ8Gp$kMYRj6MBjH3HYEqA-1qc[@Y9j*r@H*LM[S!P1DSa km11NGLM[S290DSIb$M[#*V9$H3G0F&)lP(I3qLBe2(Q(A@16QU#mJbBiU6(+1fL #NjUP(J$ZmpB1[32[F#Zcr'ha(mF,j4elJ2!Ylc#(dq**d6Y-%AA2[#0QG*BPHJF H2$PV)qm`KG5DHBRHBEIQ[M[IHF(81da4YAKVp!ic2JrC1fYMEj!!P[hVYlc$RXj *(Lc[-![8j)pa2ZcaE2,4q"efI$CjC[`11cqE2$KqKhfJ6qVJ91-Gr`SZHjMImFC Tm&k#`iEmECr[BX,G*i"ehV4E9Ed(hplP`Rf4rUmGGH(XcchlU&jTrlr+rRqerIq DcVkUm0U4Lkd1GSQ0Zp6qIl(0eqf[ZQ0[9AL0LGYEeGTAjD%3GId%&lAPN[XUCHr Z!R8eff#I[4P)VfCc-bcbhel0&[QcYZLIL0XHAkhTC-j9Irb0ef'L9XeF*Z++HGf CacheqdPqcIV[I+qDGr1GHrVQcTiGcF-[YlR8Ar$Y45#`eA0E96Z-)8VV%6U1G9- eFFY"A*d1h4!dKdYZ+@bd!LeLc`HIYh!"S@Ii[AlcR8LGFLS(DVV&)Qb-Uejp9kS D[F',QN&c2*k1APN,NR$lNk[#j[BF,3&ST+mpX(*e%RREme[4MT1`iClYVlNNM'V ESiqZ9[diGSHmC'*lk%JlU0IHbiRMFZV03q3a3Hc&XGqS[0d+d98kjF"kF9I-+mf GZkZe`Z"'Ci@(`"4l4@EBkU8MFUaddI"E1A"Ycj*hSqVGZVC8M"Zdh'Dr2KfkcPq lUp,V25l,hHU1q%Rb6UPAmH*Jf@ZedYMXY&)*)*2)!MiQX6%mPJ+e$8TaVYljr![ B@!h10R!5V-LBa&KJ6#)5A+a9AL%XL5fLBK+FJ')5Q@"L%KP$BLN`JC95G,@GBMc -&bi2KjABHM-T'1BE*-,#8Z"Sc5)N,-8"K1@J@RI'-*K%*LLB4"C"-!m0#3C+K$h l*)prfDJ#pQAMBYa,JV6J5BbVDblA!YB9!l1YQ3e8M-[k,EjP[3QfP5UU-*50+f* D0M$"Xfa8JQACU"M(NU!%$j,)BQ[%f*8V6Kkh#R(PaP#mbK8p`USNU&kA#+15'2! T(e$UVKLAXP%**Q@MLRL8Dq-%LakdF08Z3TB2,D"52ML'TR+N&VXFk!TF+%)"U@V 4fDl-4bYQjB-XF19$%[5Upi#L6ckiL'2jk!6-mU%*SZ9$BeJV4bBB8Jk[p9D-FSA kjD'Z'YcS,!@p3Up%b&H1(#YGK)(P3)#`%PA[eKJ5mk%*,ZC$Lq"B`)X%)4dHf+J 6JRLlC[,`BAH`P350B1d1BF5LM&cFI5khc93L(e@HMJTA'B5(HPI)Cj*T@@M34-Z "NQF59%ic5`k5&20F6p2,"dPUfB"b@[Qf5R+V`,%Q@)Q8,204j956blUU5&ek)!( V8R34)8S2j%'L&*lJI5NkK[aDF!+GY4F82@Za$LV,6C'(rdCmPJ'8id-58)T,@VX 8(AGh2EK9-0IqTF"E%+$))jX2M*BlTMHei*[E0#)jY9Ki6Mf`f3i*fbP&*i5R&&d Jm+AiQ-2AJTZP,-K0)lhr*2Qid+,Siq)UQS8,,5PS,V!S&EQiJPJ8Ka9PQ6Jf*mc %8GAbPN5MI'3X'f8MXm+4LbMb,4GAB&a*@+8B%4Gc)6@5ji)VBQ!KY&UqJXi9Kc9 E+Upea9'UGL8KjF)@&5mA9pGK4hVhk1GKH&e"$f0E)QiBhKKP#)2VqRXB@e2JFk& e26XAAe5dFj%Pq9TES+(%ap&P,9kM#fTm'&AA(X,BQ[S3K6D+90)Q`V!a%54mS$@ eNB3hbeXE,-L&MVGLGEJJ&jQ-&d4KpH,A4`c#f)C`98HhBRa$JkcM@c'qU3eA%+i BA&Fa'aKAID!N"jC4VY3,66@cKR1Pm++L@8'kBR"GU+TJA5didE'DD&GmB931Vq0 G+EkQd6B3VrT!Sc(,5QdCp#Ua9E@f!R[j5aPVb&GjBP66Uq0IjBNaADq#JTAiPVE A`-,''e@eTBb)e6BCdrKUZ&KpSD,c9G#a%Yr5qLSBfB`[kRe0T+`mXNhcUq0PpBQ QlYG!cFBESbeF8rr+m&N2EbL!&4!YV)BE8dE#q)Bd%JD2DL0KI&-F#D-EkNJBA*G (FV%08TjlS-6+Fk&PrUfpd*4)i[#+L+$K4C%N$'ZS*'&`A5D*BTZP+JXPBGbi8K+ q-#U9*2'Y-YI&NPcXYXDXb5@jd,aH%X8eZU#KQ)6"6FQNMRZP"jUL54hj5JqdC*- +pT@L'm**!reU,j3CHKRrbNh4%NpU#&L1,mNR&3`X46F%P!S+eU2c%NS6"dY2M)N SG53X2e#A84TB@(ZKfDB9*D8-KpAJQTC5!F6+fE(EeC3+,&BIZ&P2UB*MpB8a4D8 -NFhi-8*H!XTQH*eheq"bp)Q'X*!!J'BeG%aC+80R+hkmK(9aTBQKe9GZPPIU5&T lSb@`02#dqFKB3pFePM+`0Z+E+NX&AU0,6QY66bkf02EN!UYc6bkf22MN)NZ66bk `12S8aj8'GH,JD&)R$S[RFV*e,Smrj816!D*XD'i!bS@8*U"FB(%%+SQVPL3HJR) ap5NS&edGJbV%eXTB()5+ieS09KL&LX2F,&358kP`D4V+"@j6rBla+qhaF6pb$Fb 8iPH0$Ze89CMX@lQkkY1I6fd+Z*T`@%baaJ1cD9DMDkR'*5kQQ'"N0V8iUTC5XF3 2F!HmjRME!apDbZBKDE-2dZfE)Nr*P&iip*mPY-2FBSfP"2+US!P)*l@SG8#e%Y9 hbY@S[K*9T"THUdVF209Ua2(P+X648ICa@#hV&PbYDcIK"C[q8G8pYKj@E!jeX48 )RAbNZ@8S`U5QqNRXC(l9K844k$J$,A9"8l-S&D(*GfppD(a)Z0)9cIKEFfh1&&F kT%B%A'F8k@STq5+ef[C!HIY13LLUY+p@mH)$&HSA9pJEpV%c[0h4(4AGl-%qS([ FE3,FN!"Mcb)"$iiB&fNqUpUe$4KBHUXh"A(ILq$"19lh0L`Si%'R`B-MNP8,#r1 lYp%%K`HL(dcELJH@*RMHm'$k9M`iVaj8ZV,aaJJ2pZFk"V0SDQ[p53QAR@q-DUM 0Td9HY'C4H@6!,DArC",UL*'`(9ApVQ1B%HN('B-(GZEYT(DV&8E*SMlIUrP4h%f 0+$Jm%,hC[)-()6-ibqqLKJJ4(V6p'emF#CVGc0!KdJqk2Y)2C#,ZR,#jD+KGU3G 9YlpCVEGVAF*)4)3(UIr3NhaNB*!!ai1ddCY2CaKfBp+pE83T`S1-R6pB(8DqpT* XF8mZR&BiYGXD-N4id!eIR$*Vl`''rHDbY2Zq*f+2EV@k!*bh4akVb`0RlAe(#1p JId1++C@Y[l&kD%"A2[S!mYK3@Y`GS+lV4SChCRKA(ZYlaNB,P3QR'XIcRGcIAH8 F-PcV2*!!lNX[J4cak[8`E,TpIVec0C2jUeG6RlRpKY[dhqE"[C0MhqVPVYNAe1S 1PmG5AD$Y"FMMjS,FNFI0ad,pGalE%YQGakE9,@IHfM00[elriX6NhjkCPhrkmpb Nr+al(&B%KIelE0V,'q09,[&K[hlRZI3f1T[(QIrEVj`,Cr1iZ6h)3cFXM4Bfc%1 @@hN#mMKp6f8RkXUjRbk2F56DRFIf1c9GZijr0SmYcX4ZR!jA4J8T8,[3)NirZM6 i)BrKM98I-*Nc`UUpc26rIr#2TmA4"kcKYMbf603VHpq4e9Z6r'a,dZi5N!!(hh+ Dj'GeABY9aKeYE#YmrJr',C@Y[h%hial0`a[!Z0HFY96hjfrl9JmYrl!HRJrQhUV UhFap-SpGc(dbMeh-I8FHYc(hL6`QQ,ZlNmdI`0`EpIJaFamYl&h-I5+2AFbpNFD 2Q2Y%(YZCZq3a5Gj$jVjTr2rlh[["Z'9VFIf0ZaPh+`mq6`$MPUe`KjlL6Zea+hb CIfG-NXFfC,LG-8hQXB[Tl-MM0UBcNFIY50l)idG)2T((GY#621`f`!Q%@-iLM[( i5*%Bka$*ikQ9PE[c@&0Cq@%HQI)(Gc#Rbq95hdI`erTZ46cCT%JRlXMMl(rKLT, (fDc9cHePE(6d'Ik+,J&ehF-CXPak1bIIRFF%FQl[XfarE0h6CVGq8p)pbf-BdjZ UMcFFrc5U8NZ&URij&HUeYhA84bp!(L[UFH`!-3)JV6`%kkPVX&XRYkUK&k!H9Zh c!Z6Ke,la2(DVI@FQMEScX0lNFI&'PJ@NmQ2i$lKSIRlfcfjdrMLri1VA"lkDGjp lN5IP8[0pALEqa[b#bkl+cljbILH2*kZ,4ZZaXmp8C6QVpAkr)V&B)"V,JhXe!jh eZDI[VFVL"HKAUl*i!I,J#q%Xq*qkfMbN2B,rkim6`kDrKc+BFRQS#m"GjZc2R+! H`HcZ%j-2+`D[IeqE#MrABq1Ij6"HJ$b1AaQY+'"r9PGBUEpLCR(mUh+KiTIM3[I e4ii,hGH[rS"C-FZ&pZ!(#2cBS2AK"-l1Z[SRP'Xqj96r@eHEarC,FRIQ-6(L&4c 9r@h'DrcEcA6m5M0HHcl2dScAZDdpl(5LVMk#+@qC&G[cH8"Qa4S!mU0CX4C5q`* QaD+68qU2T,T2-(G2"62e!L#RA`'TGRi6Lh)m)*U1af96c[MR)G"Lr%#EF[CmRU9 01EZeQ(SLAS+01pXqhELclI0[EGbC'2m2CR@VQ2rIaH$m'hX%EQGHM6aqc,a'#h) AmjV)`cZa(f%hmkSRiKIBXa$QX@P2Rj'%l#305F(B1hi!4Q$cm%VXIBJZ$dURPd( Xl6pF(V6IfjF(qGLqeL9+iH9"[VG,P(acP`ITj5"lUfUA"qe&B9`He2ea"H,b)-m E(P3[$r+`IHA,JrB#%#l0mDGG*TAj'%*aHC!!IRZe(K[*fLL,6'hBRrIPQckR0,L iCiilCh&aY-MIYIfPd6RG94V!#i-"RTM22i-#rPTFp0PpqqF-9[VRQ*2mam5J)%i I$8EiHCQQ2`-drApFb#I*TAfm+S8hl4,cil-ai[5'e&Hlm2*9Yk3q-r,FH[hh-'e cqHb$klEFp@[NMbma(`#epDjIXr'K@F6IN!$Eq2#&Z4X11kf6KqIV%[-b6YFZ-5r JY0rm%R-[!R2h!ehT1-lFqC5jQkX2[l!,!(2h5eeL[UI[pfSC,M(If(`89DQP3P@ rR!VeN!-GpG%,N!"(q4,cFKkeLl-,UTK9$Ed!pE"URaFJMq`PjQ0jl&Ell2A4[mh Z2(H*ZENQpehmFSQj@IpBbpQ3!,[hqBIZAjHllA5"L9aLhYFNrS,F[GpHR&[rKl` AAamp@SqGI9Dqa,bF4qd5md)Hj8[-lkf(99Qm!2eU94B[3"jmq8[-lkfVc51ja2c H22CZ95iahr(Y05cF24-m!REFhfR%b63lHFa91XaFiJU+B0Ga1S"4iMC[Lc1Rm'F aF@GYLj[+Hcdf[rBrbZ)1Be00DTh*,ikEXj6eS-4*IR&Fjp(mk@j&E'TSHqb(PA! BerC6r&PJiYiRrYaQkr'$l,ePbr#efrIS[DY0h1@rL8m1Y,0ahq22m5EZ`IqJK$9 [1ZIq*ZiPS[VFVNiFXl$kh[9I`CHar3&0Q'lLCKb1Mb[A541-eRTm3eYijYJkACV 9li%RiG1T-I-cfAYArMkqZ5DZrFQXITpl'YmmqakEIl3HQpr#4iq3!$G`U[@lmLj mLfcF$GPlRhd8Rjjidr&'9Vrcj"XfFIehU$ER*,(`3(Z-lb*`SZ[-4T)Uae(FV&l q50cCiEDi6Z@p$qq"%e&FQhT#khh`lq&lU+dVHbHe2ple5Acd1hRdCZqGmZ[iMM* a$a#$dIjiZ6$#(T3ZlhdNUrI(EmGhY1dRmY(qZ&Be8D@iAILQlped1Ek90Zip@Ar mKVJ(GDC1Ll0kI+%IhbNQET(QZ,9q[EIKHjcY-r"@hlZkJ1raYRiIb1Uh9EMb"*X (F9U2@HV[8fhIm%IV0dGpV0aLk)$X[HF*2j5l$,f3!0A[Df"YB-G0M[`aq[L%4M) qMFG$Id'1"cGD-Ed4amdR(l0ZD#"1R2aKkU&RQEJCi,hM!I&lrAr+RpI6ph#aU1p RITdr6l5iSTM,Gc8iQX@9+'l@TkEbL1-1RF+9+'lfMr2RF)Y$8Gc3JjfqE$rM1Rc J'hh'J+hfj3h#[ZY-h#2e4YLAlHF,Qq!1mMeFI%$ll,hL('qal1`+rUaYa0YalRl L!biZVK2FaH&V9aEh'QKMk[YX(d4aXjAI1fdI4(%$`MAA"e(F3[APNEB2SVM9fXA JkK(&cG"%5ApDer6XAk(Ai6AbI4XH-qX9%rFJ1)QCEH*'9[0m6aUAZ[Y0i[BcX*J HFja6Vc2[G4a"`$5ERr!RFi"jll[Rii-VN6*p%1*6HYNALC-h,9k#Jf&ITSq'XjN IX1qpJ$qp*ZjKMa"hS)QEqbemA5Dr,hi@Rq`HXIha)A')m,fPca!h`qCaC5H2e&Z [%YG[iTBFKHmVjMhc'AcLYh`#(UAe[JVZDm42SAAmAflH1qeca-dfF6HJ'R8BR%K YSXr--6B2H(1(LA[r-((+#qGT0mTT*Sm0B)Da[(!CH"`X0('VZ#c5@&iirccq6$9 aQBZ*8elB,h`0qbRemP2%+5rXrel@6bI#+Bh`!Ca!N!$pX)QE!Jmc2f,LP[keHLM -ia0I`kFmFYQKr(QVLAX(2-aB(VP!R#2XJp5EkRAi%AJT0@icIC2Z[j3ijCF$jfC iN`BAMH&KjR4Ui2$QF,L6X6aXXhLRpYqA`8CMP(%c4Nml["NJ"f2jfIhJB`j[rP3 ()qJf+pYZfKrIK1FCF6G+!3I9rPJ'9c2L5Z!Zp9@m@DNkk9cJ)B-G[%NI#DBB1j% eT,SUhMaBp9jYqj@qecb1q&AL6M4aM`$R&'p50`P(*5rE(mr-m1B,m&GMjD6PQc+ mf3mZCj5[I1m'Aa4[dUF,Kk6[,0k!IiShhi9cQK'E"h80m5Ee"&c(M*Ui`b5*+Gk F)Ia!5i%R%DpiXq3AL30rU#Ym@r(lJKZ*ff"jhZ9C2je!$3bm`&*Aq'U)0kR2`qd -A-$bNVrXi%hkA$LVe82N1e6jKhL6VX-pc'DH$AjT(ab#cQ%Xcei((MZmk4-r8*i p*,`2m5Eee*H)#hQfZCjh&@p5I`2(-TCREi8R+GkNMk5(M9RrB*lK2F@Ee$Hq3)! ZD$Map3a[[[4Rq*5A,lSl`j[h2d#Fm[)"k36D(fIqR08p`'2iPH,%3H**bYHI,Fa 3[$NH2F$Bh5c(JBX1EiE"5Q-RJ"GPr#EpNh"IBcAMj`K,&'pqMCSDUpmYqV8-Ell e(H*8DjcjbaQZAiGQBqbHQT-jEpAaQqqr4TcUKKfAGI!QIC4iQmkiV0'PcFT[6N% E-&C2("$2$[%QGD2U#Pq&hm-h3Va*E85(-eD&AdE2ZAjk)lQDLfardfID6rGARkQ qq6c93r(QmfL#aQV$c`Hh(0kF58f0PB,2&diT[rRHEa1Rf[Ca`P(YJb[313bFL`q jcH&00c8e`QhjARJ)FHNd,MJ)M$E`CI$M-cq+6R+)L9X(KKUVSbclCJHI!PpBU'0 'Pm(RA"l,d)3-R))mES5[ZMbHF!X"e"NF26c,idMa*l3XqDk!mlNmVP8I#1D3!-G (`!qAadh+ihbE"ra"mlK-q%'KL51qTm'dBNili,Y3I2kG$@pkSY3m!@m`4Um+lN1 V-1,[m)`qrU`hF@qL9mc2QlLeF2(JPdcF8H*jD)$bp`0S+QD@LI[@6q!$pq6[ai9 KQYm@mEQ,6"lV`IJ`[r-Rhd!l-0HBZ1[9KjVIG3m6KliNIcm"hV[mCSMRSG2+hdq LiERmMP3YAfcj[G6-eHm`G&NM(*1r(d2$F2PYr9d#,M0aRp+Z0-h[q,m8m3McZ2* CqM,%bm`mX-C)j`%2i01++aI$rF`0PJqK"@VFefmL$TbREq!Kmd`H$a%rdpeGalh 5`F[-*q#djKGXrm&$0)qEa$1ZYRd$E`peVr6ISbNDFV(jdBI+,kp9hlc#a,d1[06 kT41`am!",8k!!jVI*@#F%BmJ$q'8,Zj+X0Y33mXRd(I$qUA[K#XB0#MlRQ#`ijI AJ0(QCSXh(mhbq!jkUJ'lE*cdNpB[8i5MQ&Y0h"[%$l9qAd)E0[!T'bHkRU[ILk4 A`B2NZdMm5[0lZr3N0'ILi"8DGk%ifHY-h&A59l6r8Y*+dAk*bqRVkGHSQIN0%hI YKLb2'q(Z4KSeFH#(pYqRa91[0A&[NRi4eLpcJ(Lre5rr$`#3!`d,9'0X8fKPE'a c,VN'NUaF"TX@JJ#3#!DE')6JZ!#3%4B!!'mm!*!%rj!%68e3FN0A588"!+qqEm1 c(4"T!*!&!X05!*!'1*N!!-+q!*!'pGB'!-9R#hr#D3XrXLpbqpKQq)8[I1'd-PF QI`NM,$GEb-*X,3FYkh%US9EHFQ3a,Tjk-TAGHPi-rr%c0eZH46Dl6HMbaJJP1j2 F2V+3!)@`aBiXr'),ZqAB,@`K@fq4(&mBi4ICNB8XRJ[Gj$CK46MK&q(,HGEcj5A ,mH9-1aHM3)GAURAFkpa2HE([2,+5hq3@4MCCb)56@mL!%li!l0C"ITG01LmlVi9 lPYGETUAAL'jcS2AT`ZhFfL5[LmHbkc3[FqXeF-Fl[hLXDq3ep"V&,hpaiVR2lq* jjFM&NF@[ZEfhm-[5@lami6kima-!#b$JbN'$['C&V5JId19iV-(##9piC,11EQ" '!$UpI,m["d&0+A@48YCLPIRiL-VXfkl8Mhd"pJBVBm(91be"a9h[K+%AK(Ba$$D ljEMPUk5FZV3@%XqM1XaeA)p5EaGl)P*A*El,e-A*r859QAdq-PC2MNA)#3,0@E0 @rq"6pah205H&N!#('!+UJebBp*hh%4T2Qcja5m,Gr'h#XTDD6M`jIjLfH$#0eeF 18H`fcFqiH)@6VcjMccMCS(N'IRC2RT5,h!qb*UdV-ZqG,6L6%IZck4Z@T#HTVLQ X[hZdA"YdRBSE&SZjlqDkH$**'L@9L8Xb5EDGfA[9,`)bQZS!JN)!(-EMSHT,ULX Z,35q8`l1C+"H,9BrBMf5fGQkPb02UPqfrYSkIY&LY34T@+R82a5-&"J@9CXN*im p`fFGKk`V$Q8ESE[*frCImA",SKUYE@fbMlJlLThNFX,Va-Y!fQ`RZFaIXmf,"af r8R2$#`&dSEXl)r$I@Y"dJcR-pa+[1f$2#ZZ`p96QQfhXL5SpSJ)ZF3i2m[@IHE1 )eC!!%j-GUBJ8lP0HHG(@NqC3rkCZ4jDmHU2QfS$!TX@JG9ZHH19N,kVf&SYjTDi m!V$lX8lVSFF-#-@8r'NFX6h"3Bh,H[L2KQRdQ9T8"4LdaiLQD%+Eq-Q8iaidr"f q&qGZBrfX26[K,b`f-6)6ZMN,#6GLHaRq@E&GL(p1E*p-8-!lhm#r3@crKVm``b6 MD46E4&`mVFB8RkdkchDBj"2ELEM!Cl#GJmY)X9f+bhTLqb`Zki[Y*Pa'LHfrNJV d5SdFEb!fSaBPhL+f@EKX+,B&Z'`NYTIL-PCXEm&PR0Jq*2@#l6TFV1aNE!DR%JZ e,FhD'#qf6A'C),CGF'N5fk'iN!"rE#r%KAH`[4bA5@+l!*I*B[Xi,TZ*lAZiE#k frm"P#ffVB`d,fY3a,`+YGDcTTiMY)&bf%KY`rP5a%II@BL2ZU@)$G`eZ@*[4)K1 X(@`raf9EEFZ`EUH*MCLRLqdCZ'`RYS0af9jXi0d1BRX9,MZ+lHm&Il"p&*HGaIB eA*V&pP0FRUjY@H))0B@0HL"HE2MX+VB$F4&8cl+q,CiDfiYaf80XVm0PKYMHKi[ !I2C6Z-`8'cRB8f`hil+Af&!FppDf(,(TQ@+M$[B4'r'$-pLS[lm@fl'i'*jME@I L)VLF)plX*lB2i,+rf+l&CBlBEX6P@@,lGm&Ui"F-Q#Xf-)$mBk0ZL4dEHDFHXA% r4'cScq!50[$[f@*l+bjJ-ME`lh#aJAr2%GY2F(QZYM83irp'E'$L%@+McTmR0R) a6fa,F6P5E'IM-PpXa(f8f$k-bp&LqbSZcaFE123#E4Y#,R'-f-"%kKdEqDE@X"% rA!EEFPc)1EEAih+Ff!a(5[KL)mG#HiH`lTH)lAHiJ0[Q0*)2L),65,`MRpLSHH& fMF`MA!EEDELF*,EcF6PCE)E[*N6#DL6HN!!IE$r#aI3#F)D5X`Rc'mUi6a8E@!b QB3-AAL)fFNfmf-!BBH9$U5#G)6ELTYkaI4QA[a2E[q,#QpMZa!AHCmi`mV%9BS0 AR#8fX*,ka3CH`#Q`NEYAL)fDIUABVX)&r-If(9aH,EEIi2)DE4Y1EJE[`dCYR5X fF1ZeBU2f`("X[%8YBlX-PcH)l9p`HD2BEX2P6GSfJTcfc@+$Ji'pf1!*9Q8c0R# 3!$V&4Vf43fa[aq9YB[XRA,"MqbiZla$Elh&jTlD0**pmPpMJ5r!GE1!lR!XE'!5 RaNDG[&YXm*+,a2BjA#i@fbfiA+*YL!k*"m8'pVp(E060Hm9'V-5#$Dam[pM!"EJ '0ZS"IShYFPbS)fbIa`9Xa2C$A$iSY[r%"9jJc[VNflb*$8jfKGMJBeH+$H`(cl' 4liq)M4b!4GLS*I!"'cl`3@aJrp9LJh0FSffMb,Nr*MCb6ceLJl[#RE("f84('N9 qJPk"$5cqP0M!Ldq,MGU!!f)$2q"If1l!jCqeE65e%[3(E2"cDK-EqDCHX)((Aa! EA1+,BJ2[[L3fDKZZJBdB`'&XD#I%EXi'j&AAL`hF[8&XF-L[L!dq3ieJ!krK%GM !KDq,MEbJcf"$YrLQYPP*")k2$5cmYYMJVq!c0R!GI--'4d+,`!D1`dQaJ4hI&aY jr)(B`&e``j`0U3HKe@#M4Z&@f1#am!jXa!HqBD-ZEa8Eq!)R`NBHL3XE[)&mQV- 4-B$D`BCf!&CJJkrH,MBi%V@-$9b'4f-$Dp!CX&%22a2EVh""Ec&R,(%1lSN0[H- ABS1Ar&*Xm$Gi%cCi`[m6'pK%,0M)lkqeE4aV!Me"4cM8,I9+R9+IF!(i-MQ&+m- EiGK`Dc!&R+BHiH$8!(J'IiHl`Yh"02!'AJKrKa2#"H(qF'j`$qj-RF#Ei@c`C2J ah"KFJ4q$aHJ,e#RB5#fK+i$AB!HB!9D!%A"%q"je"5q%$m)c`9Ai)$`3h)#(8SI J+cJ&*X%&iB"`(6JIA!q1"lHM9Z%Ie#Jm$[i'2X$Ai'R`-MJDh!aXTRl"EcJCq!` ZJmIJ-$SQI"RX3Kp#Xd5R3$0$Xd5V"%[3XX!#1!Pk+VS*@LUm""b"3k1R`[hKS2" @1!qD*X!0(X+9d5rKQHL9VKX(R3!mG(d8m"X`%qi#Td"cJ#I!$m"6q!#k)(SJ')S @#%E$1G!1dC,3'q#`k&aJ,M`*rS-f"qq$+k&(J,&S-@J3m$Zd6640-"0H#LkM#k) (SJqKrk&KSTqLri(Gk+ISTR!ZX"[G&(i#2i1c`MIJU(!FZ#dF&@i+*i8E`hhK$(" 41#MF%mi*Vi4MJ[G`5VJN("*mKM2#&H(3F!#i%"`)lS1ZJiB(Ai"lSGZKqk(hSG[ "XG(Td!AK&r"$0%9d"$35q"hD#jS,QL*k#cS,1K8k*(`4(J3(3FY$`i-c`bhJX1L ED(CSG@LHMQ[#8q"USR(f(DIrJe&1r`FrR2j2E6[pRrTdqMqjGISrf1ldIhL$drr K"8lr*lF1Lm"TdImYlSVqEr&6p(pEUkl$LlS8rGpb$Y(rE6f+rQqa9I4rLpP1rbH 2S[mRLC'LrbH**k,r*iPRS[mRL81LrbGCCk,r*eQ,S[mRbBP%rlHp#D,r*eR,S[m Rb5P%rdm5Md6r6a*I42p2-THLrbI*[d6r6a,I42p2NYH)rTpL,NAr6c%AS[qRL+1 LrkH)*D,rTiJCS[qRb00%rdq4`iRqRb+2%2hIGZZ)rTmLGa2phrBqL2kI)TD+rTp L,NAr6j(lLIkI)UF8r6p&l"2p2r@#i$c`!ND)rTpQ(BVqRfCq4Ip2%pG%rdm6DdA r6j-,L[kI*NF9r6p0VL(kIjSB)rTrQMa0p2mdFbEBQ#C[%rdr66iTqRqDI&2drcV LQZMrGDaEdIrVQ#r4rqZ)qD,rea'V4Iq[)dk)rPp(lLEk[qfc%2frM[a6p2mkiTr SrhAN+D,rej%VL2jI4eiQqRmGF8,drcVb6p(r-m4VdImca%V4rc2%*Y(r-m3#dIm cV#[4rc2-SqMr'I*adImce!"%rmq3!-H*rTmKcaEp2m0FL[kI)8k)rTmKIS[qRb% h&[dr3m`@rGp5#G(rXm4adIqcc*2SrlDR3r6r,2-NqRq@Z4$p2dXm%2dr5jiXqRq @H#EkIjCi*[TrP[aGp2mXHD(SrePb9p(rXq6aS[rE[Jr4rl283%6rce,M&Idr4`i MqRq1h%$dra`a9r6r((&3p2mFF8IdraaVA[6r('Y'p(rE*b,kIijaL[kI)lF@r6p (68,dIpXr)[TrMYaAp2mFHDrSrcPb8Y(rFmbak2mjkN'LrqGBSk,rjkLYLIjI6ri QqRmpm9[drhVQ@26rHZ+Xk2rea"h4rp@BBjKaAqGIlk&EdHZ661lFm&+[j@2aq-C +Kk'*8afSJJaE93[GqD)P**ARe,cYJ[KVcPmkY"0hafM)AZ!lmH[KKkGe)S!4@ME "2iIr"[L2ahm-rN2`(i(rF2`RiVmTrT2`RbcpR2NHEL3CfLK6q+Ia(i8rY#q,I`l r%IJ2aEm4rj%Y28DI1IV!l!GcM$bf1Ij0q1I`Ri6rC2`h%lp0m"q2ra$m*l4d0Iq S-1hX#X"C#rTU`"%k)f"YT)d4DjelR&c0L5)hbQlh4$r)Rm1'L[EDhVZS46dqe8) 6k#2[QLh42J$(RNh1GVN(j@$#'i[r12bEm%IrG0Uhkae"ad)[4Cp#`d#l3%H!Hk* AS)@KNk%pSS'L68,6d&(3*Y'qd-A3XG#ed"l3SY#Gd*M3lG"jd*649Y&5b4eekAT 5U%Ad%$3Qp#&d(M3JkJ[Y!ad([42G&9dER4Y0#Cd'$3EG#6dA23Gp$qd2A3Kp%ed 50S&'LUD&eZMk(Y$Ld"ZGKZmd8241G&6dA2JNqK(D'(L"&SeqMHD0TSTZ+aUKeIl 3QG#Ad'8!%YG,JZj,jD04S3fLik$IS#HK`D&ISf@LYD&(Sp1MLD'$SJ@LT3-MP$8 k)E@-hSKqMNk+pSNfL)k&cSFfL*D(pNNI!4SIqMTk(6Sq["qY(Md234$HLUk%YLH kY%T`8UJ9Em+)!N1r4RIRK[[@G0[GIEfM[EM1'FU05Q1"PR,8Q*Nb@S`dUCR*-`E Q4mf1)&TD[DA4+-p0)6*qqaSJ4K$&Nl!X3988e+6`3-D(8(@`JNeKiT6hjZ14$Nl k)e%Pk[l#ZH6dfj5%+B"Hd,iADXU@j"MQ2rVX4,G#TY3!RDpFaV"ITqHi2*0(bYr pF`*+pZ'`kUa9%jJ5TP&-)k`Le3l,TC'[$kQmmSKU*Um5Yp881Z-8&UAjEki[U`E rT5jKZqZi$'pMr`I6%XQ8X)ZY4ke[CElDRK+Qer51Q'SF4ZiiYqV@D[EbV26%KUF ma3jN9KFSC&jjMrQ(Q3$i4bEC1e23R)PiSFHr$Z$9j4qcND"r`NfY0$IdE8YRE(1 mF4L+9qelVN2HEdp(mVHYUml"pFTl$UB@c1c0r8XfQ'C6h[1hr'$kTK*kM1"eNGE !$)h4@3V!%!XC++#p(C@frdH&'*'Z!Kc'6CL4AI9SbE36KV!I,m-&PSJ`DPS&`LI AD'+9qI6a5H)*ZLAcUT9$'8kEDQ@H($qMDm@UPGIc6fGQGcc'062cI+m+pRM24UA V)N`r[D**4%Mrk`1C,fA+'#FNZG42'p,UrlY23eNjfN3AN!"AUe&XTY1'l[XR@)j c-,(3F@mlaaKAB%GQC54JCKIB@9RZD3BCf#&C1-"'eh"AD2#mElqKc4aA-Ia(&0` i$1je`bf4c8*V+PdrBYpNp4amd1VCY'VGX$db@&8hf#AHCR3[@UQX1c&CFZ*RZKD Y9H-fqUX#r%JYqVb``p48CZAq*pA%N!2-2rRP"cDUTjjkDZjr(YUq3[YlpqelkBd (rj@F9YmUaUirr+rqj#F0#A'kSdIN(AcSm&8*m1(Hf*8jrGceb+irfb2EdPpiZ8f fJK@9VQRRU6faeDC"QIN[E282XMZ+Z9Zf'YMpIp&Hmq[eVl,9@X`9HhKkmP$,98F X0EpLA!r%m9$q(Sf[)rrpleALlRMRSETjS'BliiLl([d'lN3KL)-`U$PS"MibG-, l9''pQ"Di8I+11$CK9jqQ%6F+QQ%CRXZ5*AlfD$5'I#r1PQNrd)h%BMcc4LclMff 'FC%h9NHi8bY"bjBBmM&[m[P1f8@BLG,3m,S0@E3Q6k9eYK0ANrXKZC'Q(hYe0h( Eiml5N!#GDleL8V3eE5BJ#GdPD@USSQSlkA2+3EhKe6bhBQYqC[2VP8'3!1K%QZ5 3!-a0EC5VI-Cd[%q0UV@CB%d&,2,+6Z`&2Z)eeM"9XpH,&H1Fd(dj!5l@TK[YCFZ hf0a[+c%lS-A`abd92!Zebc[QbAbQU!,cM+d#fq"Y,9ipQ4Mm`YR,@Ec8@l+mFP1 Zj5CPCXa0,@rVf2c5XMV'UfQShJM#Q2hMLG91V4B%2T+jU%(FD&Q5ZrRQa0-BjcK 4fDNPeJ2Fl3Vh2D+kfT!!'ql[RieKcTSjFa5cQdl6r1+mJHJ0@b""AL$FXi[Vjm` Z-f+8c'!0SVI1Fr0!&Vm5MTLT"-m2P*QCcbI@Z,,brXjD3$,M8B3'ib,f!YkeK5p [K4%(cj-@6fd)J%,Ua*D*jlcPL8aiARj!)9ajVJ*imSk&2BV4`mc@m#V9ki9!PZc lF!2MEZ+GHT5q2YN`jVb["`D3!*EJ2Dp)r#I)6c06(M`"k['U`h+bjG-$F$4bG)M *LcDY&[B+#52#SR1a)(a5B*(+`q3L2XHdbJ[('1D"3"`GP81[%HZ##"cb-BH[Z%! $(jZ2K5GI#V-8HpVU+VN8H!h-EXB!H*YjD-D!V[N3HfF-D&B`2r#MS1CQSlJj&T( c,F6lcmb[ZFIeim4Z!pUre!YEDIL%jc$E$FGGXB&riYc5M1+JE[q-Hpqp39L*9'm CYE38!,kXLL+DKcHAf58hMMer2&,p([)b'aQeeKP0VeDaefb,3bG5IHjBFhcF$@h pCN,6JCD%M4'Q0CZpiKEV3!iX)X6&ENd0MGM$$3#LQF9m!KQ-j9elZhjLQqP&l$F jES`K""R&C(L&GjFGj6cf)e%C1T522FLrZ*0r&bHf+-kJ1$#jq!5YYlAcMMrHG"# ,AaE60&Ndd4`G*M3eFAZDkZhXhNV&SjFK4+6DP,,Ml#DfqDZ$bRfDZj20[@["Q,c MP33T+$QTe8H&RI`6UF%kbp(M*[pS-Y1HSiAmV)5pjS66FR@!!BHVKf[BFBUk`0( -KQ[S)01-Y+!92L`)m&K1PUQ9iGTjpk6XT'Dmk%@Zll`$F@MS[!2E(0*jKbR,MHN lEK'RdM[d4!qGIbI4ISI0*)ChiQ&'eRVcljc4IXGZVA9h(TNZpI4AiJi-E''a5qF G0S6BYI-18f,h6GpT``ECc6,l5Ki$!eY1R(hZRA`"f)E6FKIUZLI#1iD0eLEUK42 c[,r1-,rF%&L[,A$rrjhqjqH4SUMVb`pX+'ra+Z`C2+5%"Y"qm3#bk6EL@k3A@*@ M3%dQNB8Ih@35MNamm#H6V*dq%YVGkCp-8Rbr&[HMq3RcdI(ZrA%26QGC96Gk32d pqSjqm1qT`8UYYQ0)BYS`0dI,Bja-VH4HIhKK&hBN@LjlMZD2@m"3H6YGE1%Z(U% r+4F6EjFp#)1CDMh+K3l!RJ[f9FT&[pT3[$r+RL[fMVJ(mrfRI1J(F6mkckbR*M[ HUmeL+mC61D8i9!50eMM9c`aFqVm)r4E9cJJeK"aU#%Uf'V!Ed11FdQlhCUllT2e 589qY2a(I[-2@EFrX[-0mlEjq,TQGrGc11hD,cikqZH!GYPRESr-1r@YlY2SYf[[ 5M"HEX6fMm`lpDihQJ(HLHBI0-LHTUH"&j41ZKhMq#!Flb6bQf2Q8jFYDXjM+RM* &TH`Si4D6i-fGD`p9[2h46,(hRTM5G2c**rF+r*-a@R,H(Vl8J-c%LTf,NlCLlfM Z9Z`DcGQ+AF0"9QA2D+a9fEeD@q()Ud,qiSPH&HIfbT,4@B9D#@CpP6fl8aF-ebN l-K@XeDZY@X1*BE&V0$mXGLh14#[J463K,Cb'%J0Nj&R!amJhK-H5Sj4"bFrP1ik rJ)d9Clq!)fG"aXM(!Q2N%H&L0I-#BC&[%48Mj`J8)mm)%b22%"*,MK'XP,`Vj46 LBCbi'!jEIGZ+5F!`,T!!!!Y,MPdj#j!!X13(%*DGUY8C`Q$N'D&Jj&N%`4JD)Ja ddNU-IljA!IYm[a$h)LG*H16MmTU2YB"e48Hr0(e(`6MIE[(0YdEB9XUS`*!!leI %00ma(UlS[#)Xmle#()ZF)Mb)2)ZP%@*A2MNaEKAmbS@4Re)U53q`+R*UbdZ!8C% 2q"3lP+SVa#AI+m)NhkZ)4rNbMV!SQ[)E!e,X@N#Pf$Q%TV+R2cUbk1J5A%K#!DQ UhRj9aYk#@E'6"DlB*8+[YKS3p)QGLcJ@HdGJ&VY'L"DlaU-hLjk&3Ca&pfTYK5K Ab&m-G4ARpXS5d#[85S"mCFrZe!8B@(B%#&ZpfUSeK-6B0F,&f,8)MJ@mL"$5iB( efYH,6QSQdEM@9Ph-b-p,S"'hHKjF11&9(XXDXFJSdV,3))'@(8fFN9-j6*mF4#( 'A%r#Lje-D,j$CDKX@&C4E+e`,!'fHTSSBkpbU-8je#@N,Md3JAA*ZiJ3T3GLN!! SZ8GiAr)1)ErU(%&Rp38hV,ML'`rSlB,rGRqI!C6p24*3mSY+Zq3G9RHEFfI#A2Q A(1p'J#+2l(LJ+pdK[DNkhe@Q!FQTqX*cfK`lbL&L1bA[L2#8[!X%[Z3IF[LUFdF U#h+6$1fZ5$l1Y5Mk1,p@cF+jPK3djeL8LTaI35`+hBUb61LE&fC#VdTk5k*4l"R +4VkR,a`jMb,IFRi&aK@jY5BMi',1T8VbR(1V'&K`VD5[S(1&EKdP&@YGSCHSAC& ,1E&&aF[jGAFM&-HZaplj-H[P"TSpYj9G2Bfm`Vk,F8A1qE"+R3HPU(c#A)c)Gma (%fQkT8KL8P`-*rE1ae6@i8U"P6#q'&ZC$[[K9IP"+F+iqLSMj1-AbJ2PBrpJ[(c X@"df(a9T*IMSJA,XNAX3HZ4AMG`[k%V8[R-jBYmeL0EhU8BDPhNPh2L&FXbaIa" il&L0[S3#P358(LRRS24%N!#'NQme%qhX3*D1D1he+Zd@81kHkRd#a#Xpd8BQA"T +(6Ch[9p03SPkP&iS8`mAIp3KdI9Z0Hk)T,5ZDe!P+5l`XR,G'd(l6JK&6P0kSS[ 6Z&48YE69F9368Q9"'YV@#SV-M1[NMjjDe15"ScI-Z2BfDP)#6ZZ-DlVKYCqM6Fb iAZ$8316qP-Heb6`#+``P20q*A`rrrU%6IlDCN4!-26),%SYRqr"Lm`kMYcU'+pH ehf()FFH3!!Jr12-13b+HdAQ(BF1G`jq$GeM9[R1SFr!1Dpeh$QX1hQ&iaYMjH&L jhld$AHJEaQ'm'*l4-6`lI)F9)6Z'FBI[X&*Naj!!lI!Ge[R['1SF[X-DrKe$RF[ `SmS29rEhKr&f0G*CpiIa0pr5@iiHYcq-AV1eDk#QcFR"L-k@aVm1rk(i$m1I[9D cq*[0pa0Ai$m#rq(iViIrk'6V#PBH55Ip+eRd,B`dak%Z!SdGBJNH0)qc-A0"fGJ '$"!0%HcB&0MJ`A'1Z3d,#RL3!!%h6mV-LER0"RGEE*CY)c8eJ("iB2KLmK3Hq*X SkQQ)%1!"5b-C2-M2[TmEBl26H@&PC[r4jQ5Ec@E&fr(eHZ#[8-dal$MD015ADmf +)3`d("iBIA'%eJpB6A9HE'k6%!)m-!-$`)2Q3K#k(2@ee,ieZc4la`SeXl1XMSB 4!4i-!epXl$Uh1Z3i25$LbF0D'1c6U`2%-EZ3!&pplTh#1V[9-lZBlcF%a(&)VXm -N!$A!dSMma'ZLH2!04Y'Xf099BkL(Q9pBjHkDQdkr+"qAf+,p[Yeb2#QMbDfC1R i*1mf$VZ1IGH*9J0Z2eiF@peX#SMMVS6mGaahVBMb2h'X#Q3JMU1h0G683cYe[9l fG(AkkkXXfNFrJIkLjIZ64B[(SjQhIU#5e1Me4lVJ[p+D1VV4fR2YdPBFCUHDYIP JS3FEaehP8GJ#Z6Z[5c!`8JQ)`kcSr1HmXRb&Lk-(L3ELk1f3!+CFDmI'X949cq# dl0CXJGUj&R'DaCYVXCD@FfipCRIV%mmRVII!2dk)`YGB`leaf*@&HdpKaqMUBAP K(5!1MPe`qmpR$[l#Z)0"U)@MIc$ZmQEdFKjNh&eaU!'-Hrr9Dmr2LLTXR&dpbJG clmcUJmbp,illQ(YI(2Fapp9ah-[FDh(8Q$Y(Q(Ybph8E$3$-[6dIMc$hVX5ZBHk e11jMlZeK2-cFDh(d-RF64apjpjMldH2r9rIU"q0Q,r(UHC!!FAI'`9%#',FCbcl p0VXpAle`'Rl!Q%`FUj!!iAl'e"I(I8aRG4ch-TeD(2FMHAXF$b0j,BjHd$0af(( m0B5`Hm*hRd#4k+i3%mIaBpbRX21BEF[liQJS[,E"GAfKN!!E[!"rRHFHa$1Mk+R %eA%XHT8VQMJ@BA4pITTmHd8Ij@ib"14eN!!cq&bkPj-2a&&$cYikmqYMfGNbZqF d*QX-G'2-m%4pR1Fr$&@T8i@UR,`+GI0N5he8!H*SU8@4!X3B!1Q-`f!pHD@6V9- RYkUK#T!!$k[fU3"a1,@[*ii"YHqBZ&j6Kl"Y)A'XQ),h#ZYaf-GXlE%Q(fQSIGD "*iiFfQRYI6I"C#-dKbk'rqR@JFre@C22i$f*ieK@89FqqZY-9*B&MG2eLX4LJDJ l$VD85h#CZm'kYbU,#P#[9Q94!H,JH(#@H#1[0Jj6(SNhkf1r`(peZQfb8#JD!#B #-YqQ4Md5#m`6R3mY`amiV8ejap9Bcl%F4J@)BpEQF&-@rl9jKCAU&6f,2DI#KBS Rci@HV)mm&hUbA[@!AM(,K3Ea!`3qc'ZFlm$TckXqS9acK&-pN9FE4qrqN!$pFG4 D["*[-lreH2@F!DDM+r9i$4jPUFGV5H-X1khP952SmMDpBS0(!HN9D`H3!)Gla6U 4@J[S&3XRS9G2cMc"h*8+CUS#)+HZJ&6pTcBS4`(4G"5A56Np4b(3BR5J56Q$4eQ DP$1JaE3&SK*-h&PeC1,1UU0[6GbTYImRZN`9rIrh-6KpBil!rFbV2Bj(Q&GA3YB `VeSFkX4mK!(Qe4D),M"R`B[Mk,0e4K"Q*UP(#VVId3%BJBe$PCMlS-0Xb+r%("d 1"H)Y3BErm%Da*FJ#V!HLRq'"h3*#cGX54'h$Jk''qGkNlK0a"Uq(LG98ke103C( V@FNBjhT@XQDj(NI$&aYrD%$SBCTK61YKbRiI$qa00Yr6cI!JG`%2$+[8bMK#J!I e"[`H4c0YD96*UcGUVSeGX*X@4p9E'Shb6E2[iHG0H'imJZDQ(m2&5&'((M-K*'S h(,'P-,k1IN`9TLGcG(GZZ'p0YphGec[DLqZFSGaSYeQP!*MmmjH63TIH%%0!0XK &Q)m1'fLE5'*Z`,mabD2hJTeiC[jd$A,55AkmH@M$$"q95NERRGXV4)-jE,NbUrH ZA[j(Y08lZcI1h1Y(l*ZXRS-2@MfE9UdEYNF'UqS'Zm6EM1j&+j9eje'PI[`cAB[ @UR&lhI!XlU6X`B0LZ6kcF[q6T(h@E1l*,cq`FGEZri[fQPq[Ib@RI6&Al1(Tb8- Y9afae2b+F6d3ad2jHc5qM[ch[eH*Zq1GKqVQJCVYLN00fpMdJ'6,6h[U"cr%Dh8 6V$ZI5fc*MqhCbl[#Y)I#0YYAcHlrPk)ph0M8eUqhXHQmD)X0IkpHlcK1c8-&fpL dM029M8d,1+fEEfbU)M"h(@LETalQlR4M2B#jke)EQ`l@r6SY`mDQ+fpm$+T5T`T 91AN9k[bp,I94"BLM[,&T1BlUCTS&9FbUKLT!2UcDT`,%i@pXfKh(J0TRYj6FGc, Gf$4e@@B$l'CMdp5#pdbTCc2,GMqI2jDaMcq0*mh'TL1r![p2C*EYf*9CF(p2+`k lT@4A2[VVV,baD6Q1kXDQK6M+'jXqPJqVXUJ!p@T9&K8J$NkmXHPMHE9a4"ZE2KE (1U,0aUE+h#41Idl3M@p**JdV9*-iae[@c&`RihXpkc@eC)GYAT[%@F4T$Ai5ja2 -A81Da*QBBHl*,chHB`"JlTV@*-kqZPqRCCM%qC-rr#,BkKmR$ZC9U%d2YY4(&5# 1abGa&P8aUaUU!2Q`DTm+%)G6qhVL'&$l9NrLh2(@EdrLh((aU8QFAIRSVl2(*h% @ihKm%QFa$UZbU!$eDP8@&5!1cU161)YjYA(mlb61BKcVL$D610N20ThFXKJ0-cc ClAKYNY@`)l[#Xp@EfIAj"Dl[KTkaE0A[[Z0fI6CAYLBfH(#FZ@cYmiI`)+0hKEF 0+R1E$A,0jN(AUEKKC&)$#)F(KLmQ6q'"YcAq!YHJKJJ"(U41iB'aDQX8)F#$Y-D $r#EAFf2(VcKK"3d5X)6P+`UP[*eEXGVc6@EJ%1b1RrXq(YMEmI9ki+mS0XGUAYN HmXZeCX834LS$2+LrJ!H'4kTNB"$M3B2@QqGMI1Hmf0`Q13Gi-%6M3A-K#0eq$(4 GDYqDACUp`l5'$!%H$)1#X(VQQATkc"MlLdTH[9&c4mX'J2%Y1XG4ihT@cFRJEeC I-(f+lY#aQ&$GKpmkF$8kTQmbZ8&$iYU-aSF3&jjfH1%eGbNeq*M4$4FfZ1KPA0M lm&[lh1RTEh3EhA#K#5653%1%#p1!#bGKUXKEM'ki-!0N`DM1%5kd(&jiqI,Tk3p qa1#'#LTX(d*,I`(JTlUd)ZKaI3JS!N0(KSG(Cjfb!b2VCLE!*Dm!2$D9UQk0)*R T(mU[JDL`ZG`Rbhd5ldDdhNcXQl8M5(89JMJ)JaVh'V'Gd6MaN!!*hJCN(YkJr@$ k+Sc,mdHa')IK%Y83H@`-ldEbDT6l8!R'[Q2Z)q5qR[L2P2I(brXZRNh%EYmclq6 N2U+GM,UVQAmcG1riCPK1XQ&6Cej[NRZZr9VZ5Vk@6h0@)R*TYKN`Edk3!!cCc"R lTV`E"@pm1jBKec%@jP`[+$ZaKrR+,8'&!pGY!XaMBq8q,RPZpdYrrZKH06'3!r0 2,Elai+bpqMGKQMmcpG#*'J34R-CX-QCe4AT8XNB`Y1mkKJmUCr9prp(RF5"r0X6 r11Nb@T`S"JN95(I*NN3T5+LYSKbF)1La&&-21-[%lf5jRb,q,jIlFSRM44,AhmS lTdTF,jEl5q5pdq5pdmAq#VQI)Ai[6C5-K(TISPcSFdLQMab$EdR,ZKJ3DDjpVc% DASi(U[HHrJRG"Qb*2jI4@6!F-Nj(mK1YG`LpSI-1I+1qm`jmBG2@1kQd'G+F-pV [S'+ZRli6aC0X[`12Q04k*cdA6aKh)kilcErM"fIH'BTVFqHG%EMZeRQ(+Ykpmml kZ1kEeNpEaCYh4Z'DIDA1JRG'ilU!lRDUELrFq1r8!%cIIdH(8h6@,4F`3-Xj'iK FUmNKjXEi2p66GDEFAbEh&A)rUpAc4Dm$29rHC--6aHmNZCmXmESHX%Gk[la1G0I leGRcT4,da(MGE"k#KVhaC)bXN!!*XNJQk+ZR1i4U''lB3!@bjNU"6*0K-Yf4CDr HGB9$G5XBCE3EMYefcNljR*NIf&$HiP@+BE"jI5RCjZS`*((+k3$U8'dprSHM%M[ pCI,AZ2QH(VrAbEaMDpKr*c[A5e6AIQF6A'I1[q-(CpiCMqZHRAFQi,TAkjhFh$Y RY0pK0memceBKMm%lQq,DeqYNhTP%r+Ve1TPh*K2VlRjR-e`lHpQ#GcE(YDr(bVf c$SM3Bk9I6!C+U5ZlcUdE1FlFY@hNr0DqeV250GIUpb@fbVD4b3pr0,%P5mFRH9H BYSfmrL(SXG6VC8pATlqqbU*pp"23PCE[6aiD$lj42j!!l0kGR$V5"Iq9eY64MGD HDjHfiY#6YShXRICUiZKE&&+fK$cQ$%l,PT!!&ULGDa'RpDdY)B9aG`d1eMmBY`+ dXl@b`0aeS*fYlf2ZbGhAE63!-(IpCfGVA@$AkX'k9d"fV9lih6FHhV@k23k1%X# iDiZj0TJUpR*9*rCTe5If6P8"pN@e#+0+l'ID82MHeYIHU5m8FS-Ai+rch)0i,ES 59mHak&@ZD1*Bj%34GhTEJM@ZLXRe+rSSGj-K)+q$R-(RdVfFI##1'R,feTPI(mY H@bVjlY1ieVQ(3q3l-@CiSMl1maq'UY5T3P91AS@kHE+P2US!FE68SNJ"BJb!G-C KX*km*XlSj&Be9!(bBG8q&5!1TrEea$'JpKd6ef[U8&((X@)+hLZXaf%IXlA(QRb NSGjT(HKHIQLRYIIG"*10-#4a-Ia2Y`kmie2@j$0i6q)iPPA8PBrq1K19C8(MG,f LXPJJkSlMX+'LVE,EcmE4R`qVXUJ!p@T9&K8J$Si(CiNhmQVM-1@4H,-qpJ[mq4A dhB1c#d8$`(BME*GESak*"HD*cSH@i3qFeUDmifUXjeJ1S`,%-@YcZ#Q,rpUm`NU 9N`hT,4GkXMlbA1M*HY8$&'I,K3Ea!`3qc'ZFlm$TckXqS9acK&-pN9FE"jaUX$l kGX2Cf2c@ip9c"TL1VY6M0AL8T4k[JBhNf`*4#RV&"Sm#dL[@$L!2piTe)V8@d#[ Q-IICEMJq,iVQc"2-ADPJTLS!FZS+509rDS0b&""04h'CP00c&!)Y4JHDP$0iP+9 *130D6&XJ'S%@FpFE-R&ReG'h*Zl8f[m6ADD+r[rl'*bq-8IJIZE9(XFMc+XV)@Z B9bd1G@)q`J$cDJY%&jLci-9K9hrV2!4K0Vcf5%(h1cS!)l"aU"*c(qb-d(3b*65 El$QYaZd@b(4CqMBY(M52ZliEHQ9M'c#i2FM0P5e8$4iFKjAiY6BX+1"""T1FNbY dJmVFCS0FXhR3G5TZ'*R8!-,KJH',CLZ[%Klibf$UDBJ3i%&+im(4F4MFkiCE)VX 81hlXcDhBf&dTj1lGLYHHEc0$"iB(Gi1eH2,#hiq[e`&p4E)jKKp+Q)EpFDeB -B53L`)2F"6``V&)P!i-B$qUe[MJIiaVRaHBfL6(!J`D0"mf&)(6l-F"cUAeVGQR f$Y-D-J4i-03SYrp8rH#(H+e1QVcc16eTmS)pHhQhrFiVEh`-IM+amS"NQid`MXV *ah(qhPDrX`S3"bHHa&Q1Scq[0SjS%ZGMFD`MfNcLe(PhiGEL-(2G@B-jHFIFqB8 !DS`D$ClU-a@KmZ#(3P%81L#Q*Df,-mQelcADK1@B&hYLdLY`3C@Tqk"@e`8BF$+ PVZ`k0maYR,PVPY[mdp2`UhY0&kEK+dbch,EC[QTfQrd8l@kEI6I8bfbcch9HY-@ '[eH[Gac(5K$UdL`h6@!'fc&RF&TQX&QJGUj&R0DhCV!*iqiDLDpr-'i&D#+qXX$ FGD#*q$h-hDQ1HJ"cehmQi[FbGa0((hRh*pN2eVd#-XQqI518KbICGfq@SJ3`lYV Bd`C6aG46G@*DU6iae9-&Q-CT%8D9Q(lC82MH6(h[e"F+ZF%,m0GjlN'm&Pf*Uq0 Bp#TA0('`N3UlV#h"qP,&j2S9IC6laMihIMi'1B22TAXjq8!F0H6XV61r2TDGAjf Rlc5H@ceSH+)qUJ$E(9Re83@)`fi-j+ddmm4f4eBe9!(bBG8q&5!1TrEea$'JpYP 0IrDGe('XQ%*V9bkc!IBa@hXb#picTCl0,0[pI2jBaMlq0*lF#0Md)rKr)V0Xakl -J[Yl@R(B6AqkmY&ICk+b,'LFVPFN&JY%hA(B6ApB3@H`lYH4FEDH5Var4+QhUhS 8Rf!R3k!%$U9I34%F!hXGr4Drk*Hm$CFTm&[`SYp"b,@0`m5ArV[8EacLb1h8mB9 q8ri02H6iQIK#[pce6-U5%*-D8Srm"!1@Z1P`f&6lA8hq,+0KNlq#bfMYYr8kf0, Lpiqi[%ll[HVhBE-6FFbc+h'CTIefr%rB-YS[mbjFGY*qKe0&c%SFKq%b62Z0''@ #2,pkeZ66Y0mV+!h8LprjDAbAr4PX$GT[&YkV%lmcri)jP[Sl0-hIf1YJDj3mc@, aH(lAI!kfSGV[5Ya(6QUrec2QB9)h*Rr*bl6IFhi"$X-PIfp2icYS#@`M*$jkZDA 12[)SE$*e0r90[ZhjAI8EX+fRr5Eq)f,*DVp2rMSFeYGqDHCJ9qdhNrNE*AiS'", (jc%[)%&IFcEl+Z,iM[Dlp!rJX)'m4fe*RYl(q-D)(ja(mM6Qil"Y+29+rMkMr4V [Kmh-(1"-[J[aED6p2[4j1)b9ZV`&Phr3IVGYC@e*I1$K91fAr&[B0YCq@i%LT+l 5IZ1"R3BmlGNCqFL+hrmRTQbLrDlp,D9ZreAYYmRli$"HiUB1QZTa4(`0jJ-I"lc -A9k2%b8qm,Z#1GZT(YH#&rfbR-Sb%Zq"Zi&ITSfAYbk&EB,NPGjl`F[YEf%1a1p 6DCfGmb8@YZGAYb2&baXHipZHAm0c+CiYrKCXB$,i$Ii+ASjqNS8Rq3"h"#q[fm1 #Pr`&H(R1Jl"Y,Ri"APlr-'aED,pRSCiGAYj1UMK&hU11*AqR%+Zf&$rm"5q[r%[ BRU,pIJqqi[$b3YDD-0qY%C2$bj2*pm"rkZ-EDA`R6I!KL3qFPMVEmcq)'B+lm!I "Z4mr!"XBLrYC+9kqm5[-[G66Ue+mI!qaH9["LHPT(&mMAX+c#-GJSF2,",'"GbK 2kP,bG!1aLGSR4A5)1$`!#lEAIT2)C`3[,bl"*NaaK`qQH(RV(m&K4qfh,IQ@i1A EISUe,[J0(a5m[)*[lDcpGQ[Mj@h$F*!!jH(R!HFFALlq'KbHVQR*0RHQH$Q+@,+ ,e-GAfRJCM2qqj'l%XE[JCH!hLGaa1m(,`'m)ih&i'ILPb!@P2Tlk0l#4@r*Um0[ KjCA%ledP2QT1kZc`hfDL2ErYbGm%,ep22+Ep(CJLli*EArJBE(YS[fPrQZ,Pa&q #66TRXXqRH,PL(fbLFk6"NaaHAXJF5QG,(AQ&a2I0Ai4Y6qehiKqRH2PAa'p4N!$ Vb*mNIqpRE(Y,RXj-mA*pjY@EqT4Fm1piEUAJ,TaX(rhH(QfmA%iXJCm5"fp,I#h %*1QIQda-NMSlLEJLR8[6b$m&jmiQ&jqYrIB%hMZm[14hi'$``Ej(6)+Aej',Jbh iAC6'F5jjJmJZHk%q(&iZ*0Bq5rY0*rj+RTBr""ZF$VVaZ642biJ0B#2PDI$EiH@ AbDHT"FV(e+[$bjh*Ep!FJ%eU9r"b(UIc'4jUiciPaFZ0JE@*pGT[[cp*mI)kmJ$ iK6NI!'Bi[2`B1I1cG9dHqB88,hFj$!pUJIT$jh"i+GS(jdc`[15Ni'AJ0iAmbH# LaF[!EpT[Y[%bm%Z59dPpI*eBF,MNP9S4["a1V[NFmD1HT-jH4ildA1fh$r8&`FY Pe%@S+D!ERZP`#hjTF0lQJhS@[(cAVm%QBaLQNC-*ATllpb3BJZZSYB+A%iJ(SVe YGbb0lmANZk,Y[B6kP[KY34e6CY[X3'b@r0e%M*-fcHRNQS+A1j%EH$05NKp'R'1 1DEmINJG,*qi,`*-FA[k#'STSYp[pAKVIHBa9G,3TU'pACkHq!*YSIY-CNq$FeF$ QK-b,13BjFhMj9Sb%6)KqYcejM1$PiG4LT0GN1rT,(*H6diUZYq#p+9jqqY0`!"H )JjJN6krKV"p4`lFR,j%mEF`D4NXK,H#Ji1A6'+[SM)ZJ[cLm2*Fi)4VY-ZCAm2* %DMSLbHj!RL"iq@R@J@M-bm'j(9lq(&T8iKjGIam!IMLm(%mF29Rlr46jFRKj+$8 iF"K)3@piRZ#PD)+mpaABXPA"blaIiJEU#%m9[!cmTMrEaXXJMXZ"H80fe12a%hV RUG$*8ZqU0b+m&rJP(rd%kHQFI"5$"i-Vbl9M#hQ8k+cKHlH3!,0HJELTSl`1P(` RmI9GiKI`hHfSkd`4[cbZ*jmK6VpEr-+m`J1pHXS9b'@Pl@N,mQ#[,ZXAIK%fJaZ F$2@b1[hH(G3EL*Hb44mm8[[G6Ui#9b8qH*6%GaUj,"J)VX-$[2KbRbAA28hi-EM Xa9Ir0QT2D%(Q["4eiq+lJ*S)'L$a`4-N[SA%TjGU[eR8!b5qle,MJH06#)D(ZIa pQ*J1,mBG29(LZikjHCR%"cjimG9I`YK@#+lJ*r8aQI8%Ic3R4je4i[[GRm-'Ib% qkNVLZj2m!"hET1-fmP5(6k*0@lpcfrT(i(FYkm$9IGi[XBakXF1R`'mcBVc"!iY RiA[SJ"kr56[%mPGS@M84[%IdJ26lQ5HiQ)RlBq#lJV[T@mK4iGVQ[C2q1FAG9c0 'Y&ac,J$IGRcSDq4fF'Ii"2U(ac252F6DFk5Hi1FHcdM[)[kCr&XrH+E`Q'p4DhZ YpVX314!qP"iMpiCVQc1(r-rM3qQ0V'NdEH))G1lINp2)I,9hJhm+(dU2Ne[#Lm& 4p'M*pa*biMF*6S0(`PFZ*FGlXkk2VB!"`Lr6%rm%MlISpqUTqhKiN!$k0,A5m`3 2i(NH(U3[I4`fH)Sj-mR62"kF(L5Z[&AL[V6&Jp2[q#[Bi(fm"bmAhRB4-4&1C-l 1e1Q&YhfF@K5kM6NA8lrcH&ZkcYk'GfUrba'IifdhrLiaaX[VjSa2H0Y[L4pS0G" -G%b[$Y*CBMcDPhP[#qJi`Y[5%p-X91%(m$e22dL[*0E!LkPAHM)NIbZTlD,cQ$L f*)I`p)2dce+c)`r!0Ca*H2a9j-GSX15E@Tp6MdlUj5h8aTaI`*0QNSXi[i!2c54 2FRiKARVkiY+B[$M35rCKAEj5hJ[mIJ1p1h9jNUI%8HTKk2!Q-pm(,dhIT[d1BKh 3L`%Y3Xrem$LaQhAc'IhH-,cViVL'@(+YaYf$`&YF(*qKaJE1%`FkQX6aEFB0"c& aI"BDLBYM"6'#2"ZA`q$RiMLEqLkp+Y3C[%AL1),FiJXkMXmM6KI(qiMTD1r'j3M JZSYM-6RLPb31F%(LZ)Rp&YIT1,k)ZR4aI*4B5*dDPk1KJlXi2XLk"1XSIl3LLH2 ja#`dFh!&A"jC4eGp[[D)lcTbeQ[UcSR*"kNUq'95kdEVr4be'hTYM-X0j'F(DVm [8DG%PcCq2q,lEp"q9e&MqUU1B`(i3l*,qcfEq!eI0Rl(!YGFI#mL$ReGah%,DdA Lfihk"*c8[,H3!1p+I0qKCN%XaQm4Z)@,lf$@%RU4m6X1ElMi$UDfp@hYYjJp&K, IcG44d(2`ShG"iYZ)GIaGlAFmq*@,Ea4j#69Sr*B!peemdiK00fUr&l,H*,j[r3Y Xe*Ia1i&p)&jm)lr'RT-IL*r4+9emqj%6-LI8q#d&lVMihN&-[%Rl,5-[P2KfTTk (lQ(m6U3q*2QE6SdC63mr%ir%0r*Ib3R41Fhj,I5BP1CEfF[)-@i9(J"IpRK**U+ Q5Bm'IPHhr,*AXeF"M))(`*RN[E-38d*V-XPVJ)-5AqB&kJeSN[!!F%lL1)$F#ld )I)+hL0mfl)'jAIYG3Je-i[X9miI'CDPS2ViEU(R"*AN2,86H1i9F!3k,(jaBr+i J2[e-r-LPq"e,V$%mRILqali0LHq9V$&UQIIS%j!!pdiR6d+(a`ppA2bqb2GqUIf Z)0q3!,cZ32hEp2F4hdh3#9amCj-hd`-#Rb1r%XG#iJ6F$6rUhZ@9RSTIDlqR%2X P[JR%H0j*r$m!N!30%&4ME'&`F'aPFf0bDA"d,VQE&S)!N!J'QaL%6Y`!N"!f-`! !LqN!N!6rN!4069"b3eG*43%!VpMr&l-G%'N!N!8",,%!N!BF23!!PT`!N!Cm``l i"Q9RdaadREpZ'fLaEZ9qEQ1j(5LRf8AEp$Lpc5aYfm"@jXQpPD[IAVqYek*jMEa mbl0[dMRTICFchdkb*le$bd(1HLml6[B%lKGZVr-@[T`c1i'am)UrV!(h((#ec%Y Z6rDPej0I"Q6E!)![!"h`c!H`eQbfhA'FL11%&MLKJ`pd3SG81mkd$SPjH5JF%Y1 FQQaEXL@4bk@bZ9K6,RY@XVAJaeT9MMF3KmSrV,l(QIPacqRbMkV[E2PAU1m+q8p 3hj[NAkQq6mTrS[TZN!$r*#f6HUV8pc!a*U[[*$'QU1md-DDUlqPL6&2I*@*-9pr 9BXa3hh[&Q+Qq,iXa5hfhLc(Eq-+(L('!qSi6BilkRLM'A2APaCLR[S[%Q+qqeiT aS2VH,mC"kVYHM)FBAi6jHDMk$K2MB2@Y%S2Dm@h@qF,h3M&Lk[X,-CJ&I-`0qI& p@ib('eq8HAL%qKD*m8Me0B[a+29Pa$KFI5m5Bi(khLc'%HVlY"L29Yp0BL`d[JT QjNMe(5['8HTMlZ2U1dH-SpAh+M(S!llhL,&BI9m8BiRkIL6'-FBhJ6PCUVlMaAL -qK*L8#qqjiVa@28ahm[8ph%aQ&Pmc-4bikX%&m!SI04'AIM@LA'#qMV&1&&p,a- $R-(hEM&@U1qIa4"Zi2Tq,-E*aMH4HDj4(c@X90q6a+K9hh2%B-Ea[9k-eHVlHc& 184mpUc1q5H$4'[8a'ipAAj-BpHS$maV8"lkHUVkhLG'S[Xq,38jmha2M#FCA"@D Y94rc!clJDa'$ZF$(6)#aq&iUaRVe84pjm(e1M!hUq`ma`%RJ'Y`%%r#"#m`#2[V eC29Y%H-TkJ0(RkUq2aIM$29p4)bRUHpEBS!$8!!i`%EeJ91YkU1q0[@G*8C5IFm 6idcerDNBQp3(6S1hq1!%+IAG+JEjS4MJ2Vh#"hl!&r(4Zl6kQ'p`&GpVa-LU$db #5q*M[TPCU!Sm*kFqm"&1JBpC8Q)jl9PL-)2iAL('-p6hB6(J9[KZ&Q1Vm8fR6p[ 8"eD#`rLBRcp5h`[%H+EkrP+-FpAhGf*3,ll[L('HmFd!KmjA(lMjE28a9r3Fhi9 LJ-Ri`'0Q$GpRa(LqqQi4JpVPc)52AD!qqN4qI23*[S-221#2$ljiXISq*3Em$Ym 2aGKZI,2JACHU$pb(eq"M4Lp6(hfjA(e[%'1(qX"Jm"-I'(1PmFf'+ekP2M$XaFC RF6MJ&(`D(JerKMI$*q(Ei!Pm@AQbbmI"52JJr!Fqc0c48cJFF`h2"DI"$IJXR)! jJYH$0@!-f!+Q`+ZB+qB@,Z9a-lJ$(!VH!fF#(jPc-"+1"Ml#Rq"0m#9i%[`)AJ3 IJJI"Im!!Z!qF"ki$a`(,`3F`!5`!Am%"jTqj"pr!0I!-()2$`&fBIAJ,I!8H"-q "Vi#Ym"0i%PJ"4X1(`'Hi#K`&EJ*Q`%AJ)'!5R!1Z!Bl!-q!Ai"pm!Ki"[`*A`"2 `(5`"3m!1-"jX"p2"FRJpI"jmKF[$iH'mF(mi20`GcSjf!"l$4p!)i#,`GhJlI"f H$Zq"Pm2(iH&J&&J0piC6`,AKf2"(1#VB$@E$CF"Vm&$aHIm"reiYd#'ck8SNq'Y 9%9UPLSlb@PmR!RFmRBJqHMS4IICd)[VMk84JK+F6-EZH6X4FHMS4Xk!kNBX*UK1 j'1$K(hLL1T(c*iU$R,FS(R)qU2hK`'09*h+qT$M*Z9(aNS01S6T4L,kS6K5L"Y@ *3XbckN3Km%peSK!BS6T4#-a3R5M%2+T1&!*$9#F+[9*R&YpIkHcJZeDa!Yq(&%r `d6r9L8*I9@c""jG6R5L%CU%k8CMqU8i8TSqU%iA*UcT4'2a3R5J-[UY1&!Bc95F +Jj@U%i@C5p@*`[49GD)`h&9eS[#l&+I``Be9*`UM"kP1&+CrUK1&Ee--!cUB2G@ *)[4#GD))[9'G+!*QU%i8!Hp9*iU![kS64F")eBNLc*cU4"&d!G@*)Qp9MS-2h9" eSJMm8h@L#,UHkN34H+2U4"&`3R@L+"LR1P%8A&#G+-SFUNi8C3C8*iT5JqT%8AL 3!1*T&2kL1P%8hU%k8441S6T4&"kN1P%8cU3k843HSMT4p(9LU%i8"3Y9*iSbPkS 64Dm63h@Lk'I&8*dSqJda9#H+rN!-eBNU`(69L5V!10@*+TKjeBNX#iIHd612$i* rB*V(2HQ9acrK*[!(jK(X!pI!22!3h!(2`$G`!8i!6f(q2Gl+())Ii!!B!HpKKZ% -c#@c!GBciq!2H!3fJ$rJ'CJ!6S)6F!@2Nc0(m##i!9J0,`$Ai$hJ2eJ2IRYFQCP MaTPYCKVZ`$c$QF!I6rF%0cfZb!&2i8PJ,a`*h)9$`5Y+ZJ(iUKaNl(KmVhKj`VC ``P+jFUIq`dc'D)lmQ@F`5RKqKFb*5c%0CXdjpRf9$j14UT)d8CPpbASH0`9f@M+ IGl3k*"(b0jr13UAih*rVRUT*Tc3N@Np**YU5ZAaFPFMH@[TLr!,9TmIMd6eGd,' F,2qTmTmQrqRbRb(r+I+I+2p+q9I*2aV8TSR$"%3L@",YK'D[Dfe2G(5d*r1YZ94 ()ClIh+jDl0e(dYHl1Gf+9YD[hY#k*GA'VCU@jUBDdm0LqGl-$NfIDE3l+)+CdpF NRT'SD8rNmmPmr*b8UUr&FhTG8fa0pAT3Q+`H@QN"&E5%GVYYX$G!Q&ALP$!N*-- #!h'9'dqqmM((dkrm!%L8+`ji!Djk"3j9Q)&PGQ&IRV)$ir&Q%T5Q6R*lDSq&S,G 5j#rl+5QVY(fq'ZGP@,UAH6a'1UXU5[q"HF9S2YMFK8bZ-p`G8Mk'DVK)lN1B)4` Kjq#'PM-%JDX"m'BA`!hpU&R9F1`b9crS3lhlJ,@V6c)Y"N-86hVB5Jr5Gl1ND3S mVP9e@P0G[#1A2$1P9alZQ'HeX,dEC0J6VceiKLLT*k+BG4e2MV5m(A12`Z8G)Yf J(S48%V5i(F$JGMQZT#Z)B*A$Ja#XY5)4chD@,i#I*+HkU8Q8fC!!h$EJMbUmiAd fK%C4HH!Id8*rTCC0DNMQ0L9MMF1p(clqA!`SIrr$pZm64lVd#&%!S[,R%X0Nq9I *Ii,m+q8r8Il6j$p$rY2P2l0EpR4@TA,j3U`jZ5QGc"5Fj3B5kP-EBhATMQbZ%%0 0D@KU+EP26V5hCl1Cf#R*pJkRS59@Fh60`S8Q88ZX+C&[6E5lhVA*FjbQfP@Pe-Z ,SpIGKqE08R02M+[PE1N*DT)*+l5fLpiX#A1*h,CiUrSEQkZlI$NR8)HSVLj651E 16,3QF6BN#Ql*$FheXE@GQ8)URC65iL[Vkpd3YamD&`rb540MUa),PUE1@0CfK!Q 8E!dYQNS#9)(U,F+%Z4Q$kD+ErJ5T8bF)VrbVmfPR3dhM+Rq-h,ML91&'LRD()5A `pbkRSk2eY6SFcR+*2BV'YN[K-NhGJ4,J"T*4r'B)L9`@Ad459pq@YYd4V0edidf %m@PidGNpZIeaT9TdbNa)ck$G@EPIPh3bR5eNqe#NQ(#m)AfjBXhCcPaVdQRHPLm Ndc&rh%KM*Q03N!#-Gl4ZPVB+)X9Fl&-IlDe2CEBNFaSJcI!#DMVcK@`kp[MNYV1 cZEDm8phDQXcR"4F+QkAHK"3"B"F+UFbQ[1"hHc,@)*eb[5GhTYVEBV9E#lP%hPQ Ch0LjD9-b&c-jR9AVQU5)6,+pe!q0%+b1e@66(9*0MSNACeYbG6,MqPDQmP#Vp%B [@"Z&beXMBL$-,m'iCGG)aZf,JQ,GfPKMKk"KkKa*3FHp+[&e94Q-!bi"2'0VY3B BYAH,Br@*c+E1K$66(iXPEQNaU5fC5a45fBac6,%E5f29E@dTSJ4RD8JfNhHEZES pZe&$LMfk)mJ#HYalpDJ(IJ3hSZ3HhEAcUN@QD03lTTDf`mfkSJCPF1&)ZANLGpH A[m2UKJYSL,emBD(J`TVEElp0pp"BfBlF1abp46"k5VF-0ZL@RJG1epf"dd+AK5D &G@q3!(IFQ`afJ@2AZ%X"F-2r&qYD3,Pjd(9rd*m0pjkdl!mBcm-0b*R&2#2hM3R R&XTBiakm)154qrUPqaMZ(32VkZQlHfGC19Difr(ZmEEhqFF+Xb[(!R$11#0I513 X$j[&3l+"a9pCpGXqfKfDk@d8XXmFDma5UrZ@Z9@i1f'k0KIK0)Z+F))fl'lbpP6 elE$bY[DbNmME6'S,12qp0D&Eb9MHHh@k*lcl*R9hE1r&kTl`lR[@2F&GekjlBNZ AUAH&GYekhK@[Pk"h4AThSAY(S2XLGRqdIa1k0pTFdqk*kVUeh42,iJh@1A6FXG( "K!ifbBeGhp!EY[0HHNm#hBe`ChFer-lfPQkFl`SG(XAJ2[UZ5+kRpi800,rVmRT 2E0Fpr&dbh9k%-cR+-'F5M'#Gb6%-H#C$'I9-JL(S+mDAKkkBT(rbLZ%$FkEc-Jb (T45$S+%TqS$4K*E4d53BJXJJIVL&!f"TBNF4df3CJFfZ((['B!K!Lr&M!ldE5S[ K1r%dL#e25KPC6B)b[*TY-h[a9C18!9BcM##X*KQ'@%e4aPM0-!5b3B,b8!CCqUF bL"mB2@p`KS'f+mFJa(JjqU"@BmYBUaQ'`,D8B%mM"q"@JdIa9Y1-!'jhNT&a'), F)-'qmGi0ZN(m6Y3Y"3q26"Ph08-CH#AjAY3P3aPb#4r"@c)-JbhaCD3PI!KQ[HM b%(STqLI3#akB-(FkKU'eQ'!350`%ID"+B"P4#4q#8cpkU'd$3%VN+)U5B`4#J`c PYJq"TaHpGfKh`kBA["-crFMGFe&'5m+lS&+VL,RS9Cr+$r$HhNe2I6Q+fjrkSVF Z1eD`Vc9TPL%0)rP)V4kc(5a@`mHVC4*'5R9"IE"1BXH,0,h[far9PfIR6UQq,-' HUEl`rYe6r81bVbfDD,3[QQChBc4q[$1-eEkfN!"PY#INf0d3JXHldB0pZQK[YdT iaak[1a@QrBPD8TQeN!#,XU)'!!fVCF6[Vj9%CF@-m$hdI1q)"!V2hRB%HX$GQIC -58!'pLJFih-5C"T@1BBQTBYZ$)b*ap2hYX,MIq0TpNb(4f''q1[iA(KTGR2BdN4 B1NjBAJJ42&("lR)11,bQF@AYiE($9eD[UaDcUDjQR6jpa*CbZ-%@GZqTm334hMa KQpZ"$KiXhi3NN@UeYJ'$K`GL4Lad1r("!h-eSEQcJqhDbr90+cBeP!M``2#$KQ3 KPcdlQGZ5Mc8A%TQf4+j0Yhp[@mk1GlR-JT90Tl1Cj8fG'pY6VE'k6'YlCe[5$JB E!4j%Iii(`L+XC'$3M3F94NpDhT!!c5@jRT@2,Bi[M4pR@e-8!MbBG2m,,Q4(NGd -'Hiq$FeeY62GKfPNj2TblGD1GQ%6pqqMV%ZDY2(N9RdTSRhY6(+L"`kpHQ2rmCq cC3diqpC`Qf-9Z,89lAd*8dKHQ0EchTA&FAfJR6hP52Y&M+V,b&AD4,[F%&b95jL R[YalIVrrcY5r,TP,Tc+*`Ur,GmIBLVV-ch[Bf%'$liMKR6IQl"i@&[,&S%$bReQ HU9*Ni(X`JD"(Z3m`P1G$qNq##(F*-clRN!!m8)ljihPJc`H1jf&jDFc2`e2r"[V $!Y1MaZYK)@Tmm!N8qSaF0`rFDrCi26a2F[VS8bNN$mq@((Y5KH6KDC12(Fr$mbG R@*5ID1%r-5*BqQCG2Ie2HE1V(([F%b2XFJZUI&dJf#YUA6dlAr0SA6Rf1&h!&[0 d-T[C!faX#!pYeHZU[!(PIkqi-bR1lfqh2h$&I@,IkjhY,cX,A2ciGD5A),MGYQm A6k8rJ-@XT4*$!8-TaBe9TXqUS6VH8mPEkCHc-fVZi#08!dLa$#cLq0R)"I5[*&U E&pA+U`4@bRYX-[,#f)%([YY,MJ9'Y$C[qRqFiZ6aZXML"+9I*bS5RU624eqK+(Q bfM8D[e,ce@VFHV9ADGaUIAI3+Hi9@EP%V[@X8BQJA[d0QVG&l9-eIk2fT8Rc2%' hF6P9TcDH@Ye3'krG8$[3AAFeX&ZN''V[&$rkH)+qfplfGQb"'lc#cS46XjQ4i3m e0$4C!1i,`AEFKjN-AcqDD96PhjfRbCme0RD!1QSD,aQl25T2TkDaHh,8Y1IcGS! keTb91c-Zr`IkbNU'KTDDPAD!q9ME[0B#F*''1YE9EPJAhcJLm(3prh[`Z(9X,U3 I'(lQ`khMV*&T['YHh6VfBLI2&4mp2#6p$rJ"!TqHkPMeKcSiEGR@6M[!h1IbZ9B l3"fFZ1LE`bKl9erG1RBpj2fAGBaYBAL)IB,T0$68RcbDTqGjlJ1GEkSI3jMpG9J $'%VMb@[f)@Ih1q2lMk@#kHc&cUihdZqTBq&#@d!G)`hj@4el!2JrkaK&mV[V%*R X$l0[Q1R[jY9RTRZldIdFrR)r1Z6*8CD!1Z5YmErT+jIl[$U'NHKRGA6XBDHMIIA VX!)`GlH1I0)#m&4Tq`6M[ZZUN!!m8QU-9q8,RCD!1MKa'C)(qYS%0J42Y1drPIB *jQkTB+C@!15d+b$9A@GXJiEp3p2C[46KINeRU!klLHTmVaC6AMha#beQV)jlY*L a1Zl4B[E9FEF@-eU(I8','Hc(Vl@BSFEHTm@-eR'2&M0BaUqdQ,%klY9L"JUa%@J a)cR-)qP'FQbSD4cM3q6`9B["'E&qD$UlJHKq6@I2-KilJ+BMladlCNNXH)pBljR k#`BRKHa"Q(XCh&JGpc#iX6VZBA$lkVLE`Bh@dCEmlIde[ijl'GaJ2iS-lKl'0&M (VaM6D"el`9cUF"r`0MSMGJ$NG1YS(hQPGk$mP#GIkXKZ2'ZiMXD0CqfV``UccG! 5F`EINY#e0U9rGB+%G1q)lpkYlQH5+"Bk&(HV$qAKFFS(M1GKDF1Fm6`XP*JlRQI rcRR*`mlj)dChb8X81qFAMGI0M[LaAI+5KahaBl[N*3p%E'bA[2ZfL2&GmT+(44j ,r&hCJhhd!qbV1q)II00XI1KqA2[N"rd2MfZIm+"liA(Y9DicXVDaF9dT3f6efY- mY6`bShPE[T!!6#YM5#@jEc4a99ep,Hq49AX+0V[Le+j8fm[MqXAfr&9"JH'$j'e 1(Kq*#6f*0@m@K9liD4XhPLXdj@3YU8TYebpa8p@H&*38QLSP06CAar,CcPbVAiA d1U,CTUNp3qhT'Kqpm-),(If(&ccU'Xqhqaqe!QaX$1pmVpP[CYXHYd0bhb1pqR$ #$SFG0JT1Ba0iF0CrSH*ST(hfc0(eYADkIGDffe0N6[DlBq2P9(B6ACXcm&K,+92 HEKS99qN*ThFHPXMiV4jZRB@#I[cQ*KZ[TP$E[5KQCEM**VCl*dhXRppN%pYVf%b eh4YY%KIGFG@+,5%!ikHh91kiq(`0Qi0GZH-U4rhce*l[A(rpp9erEm$0V(G"Kcl #e6Ccl$-6BHA"$iX+6l21c(d`UcCER(c`6I1b%d[FIUB92j,(XcVTI+'(bB8@L$a r[X6eU+F6VjD,cX4PZZ-Q5cjRJF5PZZ0L4dT1V5pb3j!!6b!aU[@9iUCr@QVAqNT aLk51#LGGF0AF!,PQ!UhR5aaD4#P1kR"Lk8+q0pmYBXb3!(cd+BJlJ&HV6NNAfV2 GFE-`Y+qPIXcl*jQ$)p-GqCki"G+R#IAT`UDH[XjL2JlUb!PIUjM%UemIBZ)1BNR p)MFZHLjDb800h'1SBiV*9mA,5JifF9HpAh*HBq,129i#$Y(q(5KYUc4affk@J%1 eEP6V!dap(k5CHS0[eRSaUNbqTrbEq"kQFI#+D5EIGrp-I)HCZ2K@U@q#bAIB64, `F-dRFFk**ZldDm6h#)hlC,'1FjmZ[NHDZ-FYNcUqD2)G"HpkP1El!20RiKC`AH4 `%cHE1Z+QMZd[BX"-h195Gl41medT!8GS[Y[%L'UqeiM[d4Uh5)b0*ZjV2a@IXXX 9e,h-a&hh&[(*h,RcK$(9a,e)CXXj5Z[BiFp6aI(d0DlpHlXr6p(h[%&m4jZi%jL j$jPmQei&N!"TR1"(D,l*pc``DE'*1f5*'&HEI20jF5eq1A0Ilmp"aE)EaAH-L9X Rq"h@Z9Rb#3PBDZ)+-LXqAJD,*HBJlAPi'F60AF-`+&k@iLi+m$+)Qr8Y&aF0AJC aXepAa,Q(9`0N*Uj&AZNllAc6lhF5S+adQr6*`lQ6'L6JX5EZ(GF@FDk5Qb##'j` 6[e2%ZFGr4!+1dclpBa(RVRb*q26*%,2qY6LA9h`A!0)q[Dq)6cGr5(aJUCb8B+f (FjZBN41d[[r[iecdeVAiP!I!jddG&BHb)1dN%lG&0Taj1(I)jjJYcBIZBrSG[HQ (iQ0'L!2[&1Gq`TBd[@f5&&caF#lcAJP3V@)f2-(JA%AiSq,6fb#(JRF'jbUUi65 kY'hH+iXiGj2-N!#MUZZmdhbFUeMk-['YeVKR&R%Zqc(aRD*eJfI+'pBcHh8QV[e ,2Xj&Vf(Q`4-jDH%3LR-9Tp-R[A0fp,1+1,IaUH,6fck(-SZ+Fj@[&KqB)1Hm2rC a,RS*f(UULAZVi)52Fm&6JeF`2al1"A'(J!FH,`cL1["j1"I%ZA6T5-@j)1iNX-6 JA240l,PV0('I&Ce)FDjL25mr9ZRRfB,ILR24Ve2l%pb`8'Kl%HF5cj!!#,"&6ZC [I*b,IKibdUapj9A(LR-IJ*rT0VNj0%TalK*LQ'[Qq,)L2NAJE2!q14I)h(Ji9ip Jh@,LX[!KjA02Hl(i0ZKFhPUXBmhPiRZLLE[`A6l14Dq&rjeZiVC2+I+jiliK[LI Tr-(2G,kIbG`m@HG2m%Ka,[Uk-b6J+BVIk*Z+Fa14'F%+14GG8H4cE`6Eb%QI,LR Lh'[QLNpA'XapHC(2r3ZekG+"&Fb%cY0Ai"kUckh!TcKA!6p@rHmLjPljA1JUmE@ CZ)ZC!q9cRk!'[I+iAI35aERS9liZ2Y9VNbmSi[h,H8QdhQUp92$#`lPrJ+ZSR[V PVdPp+jVUm`8RqRhd#G9CjS$h6HPm,cqE)lc3M`Y`DcBi-82d$(K)S(0F)e`f20' YfhN$A&hea4X%Eb*,60`VH%'elR$TQ1hMRh2e+b!!*Zj'i60H(9H!ChVrip[#%l` khL(Fee(pk*,2&1[i'R`DR*AceEF9kh$R8[Ab@k9@VikYm#Gb8JHF@1[i`MI&ThV @pTHkrCDECm9HFbi$GrifRHLp(IL$RmKBZ(V-HEIrm')*d$XZhlX1V$AeYD0"&%c Fpp%'VM4aDpiX2Vf&mL24#d)c60b,iII-JT`I#jmdp6R1Fm$,XdhFEFb*eMIPMH* $9b&1p"k[[Lf#fFif%rF6`AH[[XPIP3#pX[06`4f[[T8IP`$G`ANl@+AeI3Vp!hj ((,a@khXcR2aF`dZ`[ITbk%R`06RrlppP,K@22`DfR+GiJ$kLH2pk0"%NH1,JL"V hcLp!K(3ZjiYaQ)Qli2RLHil'`GX0(Nmi(TlhA)f$ljNk*Ta'lZHCZ'pmAi`GTSj ,d6kS4FlPj&KMiQk#Ui#hdY+(b[cjr82$Z%$VJlGSRcE#Qbr812"Difk'(lp3im! AlGp(`3Pd%ZS'ql9ram)9L)@R-VGDap[4+Z!Ti"cm3r[hHA",q#$RQp5TrIX1-h# TLEY&jYRVhlB25`#D'2A4Gjf2fA!HH"paF$@Yqkqr6B0dMYpGl0peF#Gd,I+"jFV lA`*f`,2)"lrA1Vk#VSRQ*ZHlRbVfl`Ci&6J$AX+[62mQ6!0Vi*,1r`%!N!-0$P4 ME%aTBR*KFQPPFbkjA!DE&S)!N!J'QaL%%3#3%@mm!!$-$J#3"2q3"%e08(*$9dP &!3#[[Qq5Xad3G!#3"3*,e!#3"Mqe!!#ai3#3"J)l"[L1hGEYHFY*)`XM2-R#Rr" eQiYD2Z9dZh$))GYXImFZbSebEe1C4qKeHFZ)(jkY*r0NYdlikY%flBSFGc%p`TI M4cDK#q'AbfQppRPa`KG1&Mh#Lpr#&h),Ar5@)`[CHGEab-)AeR)H@Ci[C"1qm'Z 3!"lCD5jm16Z+&9lAXrVYj@NYl(X*!2Q&r%)f@Cl-0q(,5TE9[[1lhSDGPaHYma- C0[+XMrCfFNHGIClj[Cf6r#lG3TlIQ8%[KG[&bjNj@25bFlJF[k#@CpHHG-+6ped +6`HP$rFP*%XElJJNN!!F*$1i!E!!!Qle'r3f`62lP4fN22C`&pZ3!0mL@FlDE$- AJ)AJ$lMcdqZXe'K8Jb"B%!5jj8(qr'U3!2rr0`6"XPAir&NZRq2SIZP'1GS8YPU 94UX`fQTXLdT*apH5mX@c@SKmQ@T4af'r'!3Rf(hN3m'5e2I4B'&kILc)(mdTSEV Mmh1,cehqr4FPViSH!Lq[hV%Xl'p-(5jim-*pH(@3!21Qh%cZf2`9h5LmE(NZQ*e Y1ra`0UH2Ue(Zb2H"$`6"MmrU9bj1F1`aa8Bp,$81[e%b@"iFPlXr[lYccRmkNjG cMqHA,$JR1)GRH#%)[PS-IV$l-T(M0SkZl@qfSUf9kF1j1[cCfPC&c*0&JL[6Kr9 2#F8UK1FTY"rHfZMmblL4@ah&K&&R&e(iqUEj1-(VLTXZh9#UAKb&jDJe1MVir#Z eI'9jPj&ADVUkP6f*99kdec(0Hr*cp5CeBR9!N!"694m*KV!ll,h@lLe&*lJd[c# rCX(*A4"bFF!Yrk!q1*!!XPIqLFcaCppePmC*Q"i1p'TJF)Nf)Q44chh5XRDpCm% MJalk#mXr%r*[bcrZbjrAX3'3!$-,b(H@-4$,SDL1C'-2B*FH6Q3Ia`PDZA[cTq@ rN8(ZrQETBm19,Df`YA1PG61ULj@i&-`jEUR8a`B,JieDXe+0@RYGleaa2SilSU' SrUcIQNTpqhI$QDC*i,HmA%NDqd+YD06ha@J+ie*B2I!-iU[k-RXVpBPiVqqUF%I i3Y,Q[CG2*ke`Amcd9*`dDS9h4M[Ie@L9prR@PNT4("G'`f4bRf2G9+9DIMkEZ5[ Hq8+4i&GILF-iMQTE[[1N1,G@%'l&adbI-hMQQ3H+`h9YUihd4885bP9&NdUpjE( `khSXR&XI#lHQ04Fpje1XaUE"eA'0XYSE9IFkVSpf(AMAM@&V)NS+ie'522Z`+iK @A3bEcG4clSVY"e!ZF-bMA1!DS&c"6jkpi'DH12!6P!YF0-TPRbH2FUfqQ8S1I,- S9ha[`DA!YB"bJ@m@j3,(,-S&MJ(+&Ibb`&&`EUfJ!1@b,jC$Z4EAYYS3P-Y@KBp b"EqZar*4VZ!'bMAl&+Xa3,R!-BYbJ@-"jE,SN88jm%qe`MC-iYj#jM+HV@`ZieZ JFeP((q#cIJ'DHrQhXV@#FjD5C*ap,TMabC!!`Ba(-kYVIRQIL'9mLl`Zipa-l$+ HcF`ZieQJGPR(CVU8p5k@8i(GH3rA3Zrb[Zh&j"-mVd$b$#rV',jCRZ0Pr3c*bcQ e9@H"jQ8mQhPHaV0)p$aSb'+J+AlYYDB5lq1B$@1&N@C5U99flDH5'Nh@6590ZLr 0ITZ,HhdD`p,)H+%Bm5E&Cfc1-3GCIT)j4mNbip55CS$mf5bEHD!NfHbRFJamLLQ ZrRH`c$VRqD([f8*BI1F#,rGGmm65pm`ablaMRUhP[60d,HrRFE2J`3[XXYRATjH "Vq'A[Nqq3(h2A)8@(0XHaLYHhqPipEBd%PUFfjmcaihcMQ'jCGPahXqPa`@RiP2 R#E,[Q@I)[QGcjmEhcE9ZmSl&j`SBVA+Dhcr3(dp@Rd2$`$F,KS&M!3X$ha`8"Tj C*!`F!b!Xq'8,Xq!X$ee`Dh[R(!LfZ'C!)q[U3Q$JNNA!`$%!`'DriT-Bq!Ym@Y! [m#k!AkY[fc-'d&I`kbS`(rJ+EZ"HXdrV#fG4,h$-JPlJQ-Hm`$@![)*Ikc[P!Dq GqlAc[Ll1em(hfVPH'mm,19k4hl9aZdjHemRT#RbZRFZemEKf$YI-hij`YblHeXA Cf[KDb0@+2+fCSlAaXhCZ&[CY6(ZK2YSb06%4Y3S1(E+q+cD-IVI9$a3YRbj&&0Z qZN#Qd2BST"6iHLN9H[(0+@8E,F9Rm[!VqdjCNYMk8$k0E(NThcPiUMceE(XVmjJ c#X0KI@)U"$ADTKjQTMK3$4$XE)9+)ZXpkm!-b1c#kM)Y9a90S3XiTh,2PP!akm# r*H[!fmmkF'[,1PYMRBqG#G$qfKRhr(0Rr$VHfkr$pJIh!a4Ih(I22VR[erAQcI# fIUS1hpMjl162bQTMLm9ZD@+#f8F$J#r0!GVJeH4IQ-Ni'VdYr`)@Yce3#fS'"C! !*AI(iRH93"CM@aqTL0aH%H5EKmILGj4"(ZHE)eJF[PH`Am4q#IYPl'6X&1ar`Nl &UPR"b*ZaNl$6X61`-l%6X(q1rAhXTGL&f$(BIi2GMYf"[3bl%hXMGLaf((B@GME f,l"cX(1aml$cX8a(MX)Z`0CJ,mC@Bcq0r5Cf02B5l&H`r`(l(l&rKN@jB3rf,l& lX8bihSbp&EXIHaZ@%VX*qehXjl'hB2m!Ha$,c1AYf$Z`Em3bKRdBqbBXNjAI`ri cl0hB0f2[`6)BZ`Yl(rBYf$r%rKIX@l(hBlq!rEIBIiIp)b`6heABVf(lB`GJ88V SLaf)(B3GM+h%IKAlZeJ'E8GLbl'I`Pk0[3DE`Pk,I31@-H)NGJKf+2EVf'&B""N Za!l('Jf%%GL,dNP3Gc6dpl$I`$+TcMMT(f2r"2[[XAq+AB9GMIdfGJff%AXjYJ' l&VX1fi4Pc2YEf-pJ'F'r#PZ2r5cf1Zcef1ABEGJEX,AB1Z`9f2ABricGJ0f)hB6 GM&f"AB6GJVd5ZaLl"2Xjl(H`5fdHGLY@k8p%VXAq#[BGf!H`[i6pPpKhBKr%[Jh lcl'rLRdApYeBTI!4H6rf[GMhBGq2CC6pJpJ2B4r#IKMl-2EYf%H`Mf)I`rikpQ2 BMf1I`Mk0I4cl*2BCl,2Bjl!I`Ai8qca@cGa'lX$q"[BhX5pKAmCq![Z[X,q&r56 fYl(r'[Xlf#Gk(Z"ri9fSEE!1r$0[bc[a[V`VY8-Y8&2J+4J%pS+9B"re3le5mp3 2Y82G8!rJ,$9'6B%"B!Ke"KC3Xf!(p39fJ%R80V8'PS-Mi!9i!(C4Vp3Y1%a0Jp[ 81YK0hB19B$1B!)D"*f!F1!4ZJ&RJ0r`!cJ#'Jqe`"6J"'!q2J#H!@q!8I!,m!R[ "CX-Ci"p`($ii!MJ*2P$le$Qi3"f$!r!L-!+m!PqeJ)T`*[!%6!AM`9!i#rJ%jS* *B#eB"bF")`fQJA9J@B$jF"#$ph!)H"9m#Ji&Ti*(`G[JE)DE`GIJB(!l`rN-(i3 (`JF$$JJRJ*[!3H!Nm""i$R`$(J1hJH-BA)HI`)%-r`(l`2f!rm"M$%FXm%-iTZ' 'B#XB$NF`h!"1!2l$1ArdU9Fl-A9rr&[+9cXk5LdiZcFr+jI`GrPN,PZQqi%-+d# @fDqS95)1[N4+8F4&*$jF+35&"cNTPiaNK8S[LSeKbl$Pf"4f(,B#1aBl'$X`H%f UBL&Cqd)'C!!kNDLQ(VqUX#UDIJ2$jecGM,2D+Qi'C'QM8"cb#`#FVG)J3EUUT[l "rPd9-CIXYhAYD'(GkN[%V0VdFCKUk(Mr`LZ@[L1L,r*Jk%6&1L)qQEbX!4SA43@ I)fq5JD-i6j!!$GVa`9"1&X0C"4"Am-9rM"c+kJFp@qAjc+&FIB6N'Lbc#HVNYcf IMQhQ-m@&V5T'5D[aVULe25kN)c`E6KdVR*%EZ2f@h-$@94Y(#Q-A6`DR&FCeUM[ pP,F(ZI8dEdBrd(I+ZQ#LX&&%r[Jh4CbNAbeTUK'4"DA&d0[S$pH5#9S,-E89-pp 5'Sh4XfV0Q*JjcpT[LLFe$62e((eFV6cS[[lURZB`r[NhMDYPH[LQhF(1*m5U)VN c2pUAZfHp'J5I&fZ+j(rc`m(1VccC5C+@jRcRqBVD-jPA"PNM5jcRJfT@dUc3hle JM[-&jhQVfM'dFGbB8,A"c[1`'Q!d@I5h6+f3!!VRH8KY%pS%VLG0UXmkcbqUq84 c3Ap[SChL(1mm&kJ&4-Y"Ifp9-qUhRHFf0E&SRVJe3rY'mm0)rN6450T,qVZI*NV 8h[-90DaSDZR[!E9+ER#H[kZ@"DdDee-eBbiiaRNZ8Z1(#Y(I`hU21fY*E#+$h[F )N!$[2!)'0([@UQdd[CC8eBE+HG+F0EL4pG6Y'kQEVkL94a[-r@MBM('HrG4NSmR NIP5$[0Ule1+K[H9qa(M3UT!!CM(ejUP`b@H&NB+b!(af"b'b6"R6[V26I'A"JX8 d8DB`fM1e@P%$Z2QMDCGYh&N8UYE2fME4`(,I3[GIY2UFGH)c(E,6$eRiQ0P3Xdq TElX@YljAhH[K!i[Hm1%"5SKqiS$R*3dc28kjG58G@hZVrkmAe'4T@'$if1$6"dF ZA(0kiI3,9fpBcE&TlH!'0BmY+Tme4U!aCEa0$D&fmVE5CarJG5H(1b`%AharKdJ K!qdpfmpRLHMA+*J[M9-%`dQZCF$L5JhY@JpHTiLDUimSS0,+M"la"mUkrGHNmVA KalcKE[8[PEeVli#%k3B-R*ZA%5'3!%,CYAcKr*3YDZbLMKj,'PZ26[)2HbrBiT[ D'Gl"XQ(jIKVcTh&rPZqjZ+rPN@FI62QDk5mQC3h&Cb,A$'J`8D`()Y9(Ni&*A6j '8I3XQ[UBc$CYIbE1QH,P3eR"Y)%CrQ'dM23jZrXG4(*UU6(Kbae6Hc*hk@JFKLP IlTLQPPNk4hNcpFXGdp"-rA+(dJ(6[pbKjX")$AIrJ`26`$`eEmId-(G--M-ac4d 6`AVe"(A(m""e`4h6f%a"FmG80j23h$%ecN3dGdbp-aR0(3S0j-8G)e%b1K99h8Q h*+CmQ*lQMQ%D*ULjBmb'5@VZQ"4RSTSlD$Q6eG`aUFhB%(G-Y%Xl-UDh&mBDNk) &NpIFrAF16'"6cY3BNpMFN3-6fGa"VjR-jSka*8ChZ#0[TV@jBmUFL@hZQ%CRFTX l"V4i3qj3Qf$LQV[['ji!(H!)%pMFmHj-BR2(*$B6fGb"0pacaf3ldpRF-3A2P$C h61P6Tp`a[-A%0RI8(*2Eh&&c6(!$8q#DY!l+9EGk)P6Gm8CdZVNMEe3$Z'-)5KB r+*H+!1S"h$%acl3rG`apS3$!(HSI6#ecKl)&drAF8H[8-[!)MM#Gcaej5aFJSEb ah+%-`+3rGkJ(d&hJ$N8$BD%*$EA*)&a#UKSbqTD3!++)$,YTq*AaYU3`5!EDNUS h'@&,+RmC@NZUcQ4-,5PXNm'dT*39C"3YUFPk'6j,5Y9&aX#5HQmCr%Vq#`FCp8S *IaRZiJjX3Qf"1qU(i6RZm!(IZ'0`84UU+8hF`c@iSmji(qj3kT!!5Ib8P'*%)5% PE%-j!SS"6d$GJ6Y`M9VQMPUP[VJM0j3AZ11p'C6MM[G'HB)le#Y3FH!1*4[CFD" #G5Dp&deKi#2F`3&%G+G5q)AL!hI8YV66+[9H+$a`KaS%Si,F-@1-fJ4hU"$)B(Q PP(43cH$ZVcLJL+'q2Z*DdZ6Y)bk"ZJChi"dib4fecGYbaeZ6,hHS1-LdIamTDD" S`4e+)@!1G``$SVc"hArM3%cep4AhJhG`"kk!MGb"bbKiF!IZS#$"(6@$NJ4hR&' Di!iP#hJ%GbL6--,*(4b4fZIZ"acJGqVV*kk'%JGhm!Bp@+VZ`(f81VJ$(aQhj)l kep2lkSkh4XQ#1qS-p3[Z8!q"4h#(SJimMM[U'aa3Aj8i-$'jJcH!rpa4hf!bGq5 0+JPhi!U$RGa4Rp3AGq32,qD1["Q@j!k&(lJEGkJ484IF-9`,Ye*IIq%CBj[F`HY %[D@rDTda9Zl!EK4!Z!1c'(APMVT&FB8lhK(P&HiB*%9pK6X8Lm"BlP$ZiAfi8k1 r@K&$I32%ce&ei3kFJqGb"pm$*lQ$rm$&Z)-$N!!MGl`(DLrFJ3(`#1jiDhI#+E* 8I3*i$AG`#l#)1c!2p4VZrKF(X%*p!e86a131ESbU$AIJ%2bA1cJ5R*3lm*eK8ql !1'P@$e50S5l&(IkS3R'('K6+3pcp6`kS$UP[N!!i$4b%1lJd[)ml-*ikiJkq39e c"rDJfX3GlmfS-hIN#HC`4ph$@lQMlX&mp3e@$`)9,Hl!'cJ)Gq!k0F)GA)@aE1l !5T5@Z+0@iBEFN30icKfFQ,G9ha#442S$h0%M!(ZjJl[5-q%1RJDAjikk3@Q+1l! -95MZU#9`JcX8Qq"PkKXUcShL&hId2P$RiJlZcCYc"rFM*RIN"jIN$Ra%`BNlDJ9 e*ZiiSlDP[Q(L",`RGf!!Z-dG2%q'f)H*"l""M+hQ8bc5P3he"6bYUjm[CQPV+3! efbY09G[EPqLXMI-2R`9Lr4heH#QRJ+e%Y2mZKFa`)q83[h"iD(0THk8XhHSYikb #G,`meKdC4R6QC%l16Z,r[IjB`'kD@P%TeG6H&C8,EKMaS1Kr0E1*N94hH*HlDfb d)SQX(c`V&H(HPK6HK0rqB'k-F@Uc0"NNT5VaDk[94UQrC,ITbE$HZ9aHhp'jUem reVPE-9JVCjFUeFaP3cf*@P20T1Z`+lYF2YfpA0Y)+PYhGUk9Y2@Zl"R@4h&MUPA +%Y[3+'h[A'j%JcGcZDPHQFiZ$e@URFXeM9$2G##DL+DEcUXfhPQh,1[#Z*e`AD9 1KEPhkHeK9K"TEL4YpH5e&hHZ'SBl9idrD9Hk119GZ&`qh@bjfrS`-Ep-45hI%G@ Y&TC24k@TGJ#[Y+LVY@(lS9G'&Zhb-*kd'lA,aVlfXcA8bp(db*CYl9Y9K[,N$52 YXeFF$51G0'NEQCZ$55F$U4eG5,X-%AL0JjC98,fCS%eK+lEhDYSqB4F(SMKUl@L l(@LA9P-MVNb2*eBKkN+*BfF5SF$&dhZdcD&FpS"Z0`VGTTBETH$##UK)&D3E6Ed '4@1Z0M3Gr(&hHjA(1D6#bD#Mh09(mIDNd5a1+,Q-XlZ(J2)iQ,6UT6#15M8p[#p GAF4M(9m['P,!AUQSYBfk#L'3!*q1!"2l@SRE6%4l9*HN*$kZ31&S$05krXVI69Z *&ZaT*!h3A&af%8!`NZK6`6U$Ifj)$`rPAU[mCj4V*#&G6VAVapF@"[[PbY0X!$1 Zl0aU8,Na,%@kE+5DG!K1)SZYSc4ZXPXZDqB5j@NEDZPM+jI)"F,CIA9+ClHi5E9 E[3"2G5QE$A#VPJQ)Z$8$)TX(4bkkD#i(YD"!F+h60FS1IVT-E$H1EYTlE4+@5dQ B@cmTVNR+E-B3+Bi2GqZ$feb0H2le`m2TV95$FGQ3!*3(1k%,YE-GpIGp8)L$bG5 @&*m1&rBRI&AUN!$2@4%L"4$j5*j6,PSJ1flHeKeUGemi+#&LHBPS&k$,Gc&2'95 pQdhc#dZ5mMMVaY0d"%CFhqVPje8ZA9%qSjZ9kaM8L$`CcfRH5k+l6aT8kiT++pB +%MI9)&Z4P8iASHh*maP9MkI)kf'm$r(C&eX4cVhCSHel8GD[Ndr1&D5'UQ)KH5% dm,5@AkCbiE,#8a9&Z6%Y$`8BK@N!em&ILk+`a89ZHB[mcKDj95fb'eS8PPR),e5 4hk2#ffiKZcK&X+C%mhB5rLZDA55#&55bQdF8&N%*pMYThNr&hr%NNieJPUSU1Jq l8lTDh2QJCFd$Il1$YQ811VAr@jb%a+NqcMBaAQ[FCbEkk3NbL@pdqCRN0$VE6)) aQCrmcmh6cZQFYA[5(Q8'eY0MjX+S$@JpCK9KA#V3E,14&A3N6j9KX+fIFPpcd0G bm1ANHpckraF[UrGX!+1krAm&r!Vp,98#aF'Akp5eIa[AE0k3!)iE(-[$DrpP[q+ ErM32pf1F9lr(JD"41Z'a9F'#mZ2"XU(,mRYQ2jIMhY&`UbH0G[M'YXj(GE$VLVj J39qR`B,[kq1@9@PAUfR6S(@dQZ2EMQDj$'GP'Yi`CG3)6-8c4@eQI&!j-G`943q MP'2fkq"M+Yd`@FB2M9)1#JY'+3F5,%Sj@Ne!P(,dp,iSjHMTGc-Ka,5j+1ASk@k M1Xr8Y#MP4+5#Bj4bH#qMP)1r8FT"h8'8FK`TaBK5MU0*G&(+FD6N)8SjMT4+4#P (Ur@)8SiMj3j4bR(%`d3Taj&+K5MP1&+,%+8F4kS0ST6Mk,d&34fT')K5ML29!&( +F65C,dSjMLEG45R(d65l+18iQLSAT4cR#3kLP1-m`d(BBe3e+8Sj8G@-+19%pBk LP"09A&(+LDUq45NRUJNY8FU*5Ze&P(+L8PS4TCbS*ZP&+5FU&4*4bSQUib&+19% TFBK56P6U'++8Sa@'4#NR+X8#8FU*5V9"P(+L8Nm3TCbS*[+&#%49%k+8%p98[bM PD%8L8FU*2X9"P()dP!P,M`Q$4#NR*S`3TCbBkP#8FQ*k8q&+-H8Q5MNaU3L)8Nj -LL#LP"16iSXSjF5%"k+8%p2d[bMPa06m%D@FQ*3e4#NR*Y8*8FU*#HG%+5HQ@KH PR*J8!S5&aU3b*8SjFG@h+1A%pCDLP"-A0SP56PaB)%SjFG@9+1A%p8DLP"1A-Si SjF5&ED+8%pGELP*1A%SVST36PjU*+1A%T4iL5MPaU8')8NjF5KQLP"0AlBT56Pa +%++8%jI#JM$AZ"30T(m6PcU&0(ZeZT)SjC5*9iK56TRiJ#MPP!P245QR6$JP[,T -Y5Y+1@@U0e(++G-lLP*1QH++8NkC9'a%+DG-+L1LP&-Q[L*+1@95LC!!hNZC9%* %+DG-5KY#AFZN@#&+1@95Pj!!ZFdbiE3SjC4*48Q8FXU&cD+88bjmPa()FZ'GM(# AUjj&+DGFp50+1HA+8j4bbP@MST46VYkL+1@85ee&P(,+aDY%+DGF'#0+1H95V"# PR()T(SP56N+i)NSj#A%58FV4DNqLP*-3YST56N,i*8Sj#H'1+18N9+ZLP*03$BK 56N*[)8Sj#I%N8FT*51e$P()58M`4TCb%&%C%+5HKfK+PR)58G83T*r'[(%3T*bR q*dSj5I%H8FT*UXj%+5FT2L0+18Ra!9(+53T245NR+@`5TCbNX%#8FT+U+e(+5HV Y4#NRU9LLP*183SdSj55Pr#*+1FQZ8Nj5Q#&+18QTLSK56[+V(%3T*iQ'YP(+53R l45NR*5`8TCb8X&q8FP,#IP(+5BPhL9*15QmX5MNT[E%SjD5%hD+8Na*ZLP*15RJ R5MNTiBXSjD48Hk+8Np*lL9*15R&&+5FPa4P4bNQ*UiP56NS+6++8Bfhi,,9+i(D B0@pX#*),CaGLmB%T@`eQ[D2hCk*(rLLIGI8,C!JX,Cmp6[6)CVChM'ac(QAD995 %e&5m'T0Id3UGQN223kTh02-)Ir[Te0hm0dDY'KT"KlkA[KS0bfpC`9I1Q,mDll@ ki)XY3HE,KY$9XJHXCYjG*qfIJKAkBC[b(D'`E#JR(E"cii"!QhdFQX,VXcKCi!V L-!CjTFq(8FLVjr0a"`$G1)bSAH2cCYca`-%iIPd`rRM)af%NjXhcF@4-5-GKl(# ,ciF*JRGQFGVER5S1)j1hU@c8"JFr2*L22DC&heBEf6Yh4l+)#Sr&dPJ`V3bVpZ" RcCl)Dd8%P+h!9Q,lB2YKUl$pX31`!l'$X)1a3l"$XF1`&f![a!l(MX"HK"f*CCI qLl(9f0(B5l#ABXGJaf,(B5r$MXG1`%l%6X*1aNl"6X91`dl(cX$1a-l#cXE1`Fl &cX21abl!eQ!ABKGK&f1AB*GLPf&VXAAB0,BHZa+l'VX'fjL1*NHG@)Jk9+9GXjS *Ta4SE@ZI!CfDH8"'0"lX#AZhB8%H$q*`"FI@%0i`eC6qABh*M0V8!-,JJ@TG13i 221Q9$8PB,iHYFPZ+XLC9(+`*1#R8U"QGfP*&JEDKAUT1PD1HBCKKm%$e$rSj[SJ HiVDNGaYPp2'!GGB8(Y4d0(1Vhp*rA[pE9`CYF@Sl'NEiH1#Z5a8iqKmVGLUl(0Z !AB9GMBeLBeJ@K@6T1IDm5@#6f"5f!PZ*lB2YLkh#pXF1`!l%$X)1aJl"XUr'-1` &f!Za`l%MX"GK4f*(B5r'9Q0(Bbr"ASSGJaf,(BHp$$XH1`%l%6X*1aNl"6X91`d l(6X$1a-l#cXE1`Fl&cX21aql!&Z$ABKGK&f-AB*GLPf'VF9k#dLPJS9,Re1PrEq II8!8m241DPD")3@lR%5&1lI%E"$Rj*dRpb@cXdqBE*Rh'Adf+paReYIZP-GP(Xf XS)b8Q9QcfkcJEGC2,UbGM'aHBAAZiJV0b(+C9F6rCS9QXdjjX%*cjkV,CXePj1! ++bicDfK@k%E1$4Nhj0Y%UXfQm+RL1ibp%cX$qbEX(ZaHl$lXIZaYf!2BJpK$f0Z apGMPf"ABPGM,X3hB9GM9f$AB4ZaDl$TX%rB+l(VX"Za'l#EXCZ`@l*ABUl"EX9G MVm&HLhd$pMVXpGKYf"Z`fl%lX$Za0f*[`Yk-hB@p"AXVPKAaCQ*RB@GMjf$RBZG Kjf-AB'Z`#l',X%Z`5l(,X,AB1Q`8'm01`dl(hS%GKjfdGl1-)[[Yl+bFZh-rJjR J*Bp3@0hDB#Ci#@lD&6!6[!3hHpE10RJ*GKBaXi#AB#@B#9k#Te5'j3%hl6"p$d[ 2"k()3)Hl9@Yf,$YB-p8LmePM0fI+V*0KCrRXF5*5X1-qBb-MRDA"qC*$Ba[EfiS lbelB[8JjVPJl[%Cmf`m@AG6Hb8JeaX3rDZHBRF[X(,GcKCh,lCb`FmV156ZEI#V Yh-I1MAEZCqFU1rHhm`#G'EIbhbQfH'jR*09JNeL$l,c5cS2Y2-613qdmc-iAf2P #1`qhm`JlMl6c4ABHCHH,l9aYjp&f[X61PpTjM*h(fRQFR5qcmhJl6l#cHFH*GTj XjbPfRQVRDADHEZFCGTjTjePfRQhRHADHBqHjGPjMjrPfAQ$R'MX[l0CFr28(Gh2 b-'#4R4IEHBQGPpTjQCeVl9aRjl5G9pZj[TYhm[MjaB)%QY!6NR1X'cDP963bL`F *h+NBilSa+KEKVaF5mR,3m+E1jGdiP8[f,L`Nlkf#k,T@CieekQcm00DTXmBIGGE e6X0FcVTZeIN11p-8ARE-6ppcFh$00GHdEA6jZLIRlYYXfc,%pKHCVR1kDrVV&C% lTlZ@+@1c%jQG6%616V(BZRqV&NPQU$RB*lRc-aYHk!ITcY"#N!#62@2E'0[FD($ VC`PJLrB-0(6ji11'K8rB0LSIY8e8RV5Tk)mCm(rFcNrC"LY2@paR,1kcYVA+FbD QkhVE+0K90&LFE9r6-E)ch)RaRrpB1+1ffE3p1FlRd9JFYMe,`Lqr&P[EecJkE2Z Ap1DaCG$f1cRrVZ[(aqBc2*Z(hXARKXQJ&-F$V20bIl"NA3EDb9[6ZqbHF!B3hRY 6HZH-ldRhip"j(&qCUl3EN!#Aab6E&qBImcMf)2mRMf2V,rdiMk1*R-Q$"I1qI2G Z9kr22c)jqr5UR1i(Xk*)RjfhT3[E)C+C(%Th@A%Hr0dqr&r)2AM2CERhr9#k(ih 1iqK'5#IIJaD(cZ0BHIai4b@eeTSP))qIlEVNITNGP93Hh8MdiefA5[9"a4lpG"i (JmR$1#dlqQQJ0Ui&R'D"[f1CZM'b@rfeIQTA3GNYj[prm)m$FDX(`+*Yj0(6%mM [+YMfXILI(5!22Vh3iFmr*MH%FBHE9YJr'(I,,[rbrB4aKhPB!aMhZJ[@f5C0iCG IFE(YXh``pkjAr3Pc2j((+HCq)Sp6c2eN(MpLlU8m5XbG6jLlFp@bbhS!-2H1phL GZBF2HjDjPr)iaG`ldRL0ZCIbX!J`pjd6re[heJr'V6BQDBra%mEGP3HI*B"aEkR 8Ir6F`[5+mqFCGqTlM%RPF43C6M1Q%hQFBMSRmrJ4dbRPF4V*1r*i$FP,H4`(2C@ (U[Z6c&c[!(VNmcX54bT%jE&[Lqd(e[kT4@a2j*%U[UbFNL`@"fdlY22IUiLR0JQ P%NrQXIXPVUMbB+0MEjh3MSVH%GP'CVh[fXXC-Pck1#FrNdF*1BrA@DBq$KdTXeH rbR5"a5-BdbrY2QkVhdYAUDX,9Ibm,Y5hCcVG4bY!(ZPU(!G!M!+3!+im&0EcVXJ NGrA*GGI3#[!HZYYR"FM$G2ZkmcM6lEXjU9@$1jMS*)m(f)6IZ6Vh-2G$,ar)cGc IC1'*ChCHI-IZh-e[%jJS%EQU1[lhjQkV2j5EH66GR&rRFBZU+(b2RMU6,XZZjU& kTF@LJHK)(QaJ'G'LQVeeVlXX9S"ke9d@+d!HI#kF+E'pRlqVcN194q69qQ"rjU1 8`5N@4hX!+(QK#eLL(T'P[5FQ(p)MeahU6EQIUE(Z6h-B+d!HUlDeY[CMcldVV04 H-E2Br4@j81(cZ0$jq[#id2PklHNiRfJhUdpcS9lm!)'h9TT(*h"khY8qdERQ%dl eLhI9H4cIMEBRMa2,Y)hSr6EMeIfGB6TfT4Q[hXqb011e[hQ%RCEHpI5X@!pccmb +pAi@N!"CX3i!H@e@V!ZTE3'cBLjcehZ1Y3G*p*jJlTB+CQS&3%kl!P,eI#HdVHd I24f,Le*1pfFKk-ABJC4bHMr,NP,1Q9j-Hb)fJPl-X4LLZ(2dXfmTlT6'rb0p[5V Qrdma12Z'MX"TjY@4aq[-+hb3!,2-Uj5(G8)Ii3ccDNr%,U#ci1DK0FUl2T*3#fq jT1")($X!)p"j@#9d(baELY5XB[-"UpF2QN,XKdcjp5&6K[f`+FBqE$%I5CHmBA0 ceqmMGMD+XbrpMr+X'mFScllmXJ)Y(jlEATPZY-&mc0UZ@Rh*DYQUlUTqHRTp`kP MK60b!lIINK[BZQVM5'(XiXRJY-+i6R@RRr,f),HHrGa(2p"hbVTJSV$4GZirrGN 3HRc&0reT(ZlRpqEfP8jiE&@`S2aiX'cSX[bHfFrPZ(H1CqEBic@(El4*c&JKf(9 &Al!Jdal'pr9eBDUd,+%DhNb26G@65Zfjq0DLA86FKAM8BR((9jC9AV#9K)m$5L4 p(0K-bXH"09Ai11Kh9rSiF+Fq2JkXVDq2!c[Vjq2!@kYm(0D*kZrMX(,8!"q(GD3 'q6LX,$ABak&T0m6(BI@TS6i1ke%0mh&BSHS#(iFeUbldF9M&DVL23ipJK)r$5PF Aq6LXI6A5af%eV&%q$ZYMAHcMX'*@YBr$'PUMI4a@eEV%af'GV8Yp(&EH'Z2M`$c (qMLXcMA1af'pVXYm(&E`'ZrMX+EA""q(9EiQqMLXqcA*af(0KFNq$LZ$6I&a@#p XUSr$qQ(6I"cki00p(0BBQq(MX1VB6"q(9FKQq6KXb$,Eak'*1mI(BI@bZ6i1kjR 0mh&Bh@bqMi-Hk3)IKhA3DR`FqY`,I4a@5P[Nil"ffQ)IKpA8P[Ji0)D@qMLXXEE -af%9YYVj1*R9V*8Akl,9qAaBU5hYil#r4,f2JrM2FKq(&Gj@q$M-&DrdFHJEAZl M-"IFi11`3Yal$XEa,e!*H+q2`lcfmcj1)mH"2XjDMTpi*BlhX*P&JBpq&[iiYVk P"qdXhj!!$NA[A'bdFkP4h4&3eLkbf#LU"R4BM-)iYF&N$P-mCJ(8"Z`U,"d@ZLG d2'`LRifA1GRM9Lbemc)R#`9SXJQG1RC1GQFQQ93FC5,&6KbjD)e$rmLE!!rMd&r b*X$$1,R*lM!1r6a[8Mb-3mr2Q`!2ip!Ap#E!`cLjbHi`$[e&Ee)mM%-2dTX!$q2 3Tr3Q`--ip$+p#I!`$Ve1E`)mM%-re*X!$q23-r8Q`--ip&5p#I!`6Qkb1rCLR0a NGaJR0pNGaXP0GSGaFT2GBCcFC(FB*cIC(FE*6AD(FA+6h@'Fh'4h'#Fhf4h'b8e fKh&bNpeKR0aNGaJR0pNGaXP0GSGaFT2GBCcFC(FB*cIC(FE*6AD(FA+6h@'Fh'4 h'#Fhf4h'B@E"QpJ1ic$Ai%f!Kh&bNpeKR0aNGaJR0pNGaXP0GSGaQ-A`*VE$1-a VH"2JBCcFC(FB*cIC(FE*6AD(FCJIm5Da`cM-Q(J6i'%FjP#m#I!`6Qkb1ib6Qq` 1iq3QZm-iZFRZ-%jZXM[qBKcQDl`*jM!1-cMH"(JBKcNGE`)mM--XMcF"(XCKhXH E!!rMj#Dl`cM-$AQ6iQ%FCSZm#I!`$[0(RC2GQ8r&BIkSFl)lL-1-8ZGNGa#(1DE 1bHiJ$V01RC2GcGmrB4!QZqP#4p-HH"N0mmTdhqkD#EGdY,9Ym@kBU'"'c1("RV" h'aENm5!19h"@1TA0$900D4$Af+EP0M@!-(LJ'S9URJBmm24I0b4K[4bfbZf&a'Z NU*TfThfe@U2HN``Q$"kSrS(`JeIa3,%)@aPRm2&!EHY-rk#QXe&pp9[kcqYrkdV YMfC4Bidq(P3i20LHEY9[EfXTqAL3!1`TTrB"$MMMBEddf@"VJEfl3[8C0fi[D0A c15[GjK+k%lfK8QY@S`*VRPF[MbI2EMC,'L@eM''"PI$c@5G66KNR6!!ikY*'Jcr fQBU`mZ#(KD)Sl$@BCX2pM0jD0&LFE4aM,GQphZ+b`jePB@Gk1p!1GpflXl2-fbK 3@qh1VQ[d(hHQYrrXF'F4f*Nq-RNBTfAh1Jh8aV@!drDYhHZ%FBHVm0Sr',F&D"0 Hb`*cY`0Y`Y[0h2Q%Z6YA,EZX"`"cYrpX`QX4B1jUJphHZVH!E,$EX3RkDa[X(YN Sh4,!Z%[V6UCk9@`lDChB8Y)qXFfM&@!,4id`9SQY&e2&&hITGEpNX6MBhNAN&pq VL*GfPAJbMpd[F8@9"jZSSk#d(a'9`Z0Q+RT(p2dplM2[dFXC-Pck1#FrNdF*1Br A@DBq$KeGQIr%9jNZEAJ%BrUPhFGYpA[T+R9eSBUIeiAkpNbRqfJ&b#0GCBGjGjA jVMc-"[,GIA,G0E3#[)IZpPN"mM$G[ZimcR6lp)Er,ikk2"ji%1m(FJpc2r6bJGc -rFhJe0bYc8rIX6YhmpX%*NTK[kU1rlfj@mX2j@BH*9k`iAri(Mee*Pf@AFe$p8U ,4324N6cdK[mXCpPEplV,BJ@S9pePX3,N`HI#Q9*+rrQlkMa8H84HVBqeMIVmBYm QB'0ap,mAN@cq%18Z8Br)dYi6N`rTNHX1pDEFcp4BpkFjM"8JMeAE@P[lXHIH&9C U1GNl@h1KmrAKFD(cp@S2f00CFk&Hr!#"YeDD4bG`HYl92Y'jjK01pBYheANFh`H f*ir5L*F&C$0f#p#-9rGR)GL`h3idipAl@CCQ[-lXHGfHL)eJ`hBe+pEl@8"Qa6S !j,9CX5kNYJA-LVR-[6&U6F`h441p*jLlTB+C@J'3!01ZJ&3pAdNSa`,5dl'i+19 dIaD#AS`G5#QRpl-X+H@FkF@d*f)Mk-8FLb'+1dFrqjEL6QRm2p,AUf,qra5$Xfr S#*aQAKej[-km`JFjbla+H9JRp"(1-+rf41`#1JYZ(MZ2e"P*U2dUA&*`*)iGJ"( S2+`5ZJpkLk'BflC9kA[h5lH-12I)eV"2YYC*p*cEDNQf8V()EE98hUYZUk8X(VM l#qf+HUJKJSm(dIrBDUQZdTYX[DNm(UMqS[$&[pPkUfPU5l95+UbYPkT6j4jK*-, (Jm4rEEeP)`1$("lSVCDXFPY1bGCE&VNYb0LB@4hehMLFh5qHKVMZcT0IpeQ@Neh I%`d51Vp9YVefJ!XhhhR5,ZDUjfPlA([EYjE9apR80-#&[I#&ll$%lY-phA$K6@N 2-SF,Gi%,Mmr1IZ)c2Ga3`Cf*KLq8J`p9[H9QSY'bYGl24&[V0[fem-e%4hUQc85 lQNYfqjP(1paqNGDj(6-YG2cJe+I`iM$f6Z`-,212Gf(hB2GLpf(hBfr$(X!Ha"l #hSkYabl(VX#Za&k1EF#Z`Ul'VX%fBYGLef'EX&GJef-hB$GL0f%hBlGJVm4HKGf +[4Tl$ICDl"Z`ef'[afl$hS$GMYf"hBQp%AX6pQEX,Z`Yf&ZaZl%cXE1`Xl&cX(1 aml$cX3Z`0GL&f%AB*GLPf'AB@Q`G0SU0BDGKTf2[`)l$6ZSCKl'VX1b"B3(BYZ% I2M[0lVepaNC'0X`j*BI'0VE9PTePSke)cI9Ge8T8E[G3F9baGRJ0iCeZX1JLjR6 BMecG$66rU*eMGLkcFpc1&ABZYh2#cLNl*qeXmUQdFaml0pUjRjfVl0cIcJ0d9VS @dHila4B2ZI&6HDY*&QZ3!*eAfRQ`RBIBHDLGKpRj!MYID1IKGKjKjj&f[XM1Sqa mXCfVl6cDcTIBq9)lMl(c@$Z2Xr0PGKj[j`Pf0ZmidFk6l6c&cP2Y2-h1dqdm`mi cl6c,cV2Y2-r1Fq`memjVl$cIcJ[XA'2RKGfDLlqqdj'IR#i8YbdT[)Rk3`hHB-! L1bqfma)l,lAc-M[AfVR1cQNlVlCcI6I[j2(MNj)%hpiS4b5Xa-ch6E9+UD5jKLB PE@(1X@lBe'+J`B`8'EK6-FCeBe3X`Rp2)fPdFp(`TXlPh6L95p"DcmbXQIG@3A4 GUl2'1R8fIKVVe&RMMcVVHSG,beRA,IaDcY0b2`*`[[ZUe-ShIG%0flif&bparFm r'H3AR"'m*[F,lAL@1&kZ&$a1l$eP2Id8mMd"hp0-dG*5!"BjMCC5"+3$4DR"PK$ (cV2a[T0E5-G6(8p%BbN6q96%lTbX&1pXPrQB[P((6APA&`SCF`ALh0@*SaU+N8[ QicMG11-ihYf*8kk`QHqqEYlX[(,eI*a-FLV10)lhq$M61GlVimcJ@0k*NcJ!##V 16)k*JhAKajR&-HRMX!0`bXHC`l(#af'hP%SICal(2Ml1I)jpIC`&(2[j1$3'URb FK4clqcJSL3l`FCC`(16M,18if-G"I'b)Me2,FDL2`ijH`h`FGZHk`-GCc[&#(iF GPSEl1#XjM["af%[h)KqRJH0)(iFTVe%q$T0J&rXi6)Y9qcL0(%Il1'XjAZ,MV10 iUBr$Q-FB(qF+MQ0p("5BarNi'cKHjZ-`fcAHapR%FB+2XjRM4"pR#mG*2Xk9(#I l1&GaR1,ME18ieFHjQZ-d(qFDMY0pR'Xjc["ahX"aTSpc(FGC2JiVB-hfF9KpFik 23`GmVSr$0NIcI*`G(1Il1#cZYm$(BB[@'Kq(h3dAqMKXrl6)apR&FE'2`eC*5h` F0T4GkZ-`SEM-af(lX9SICbr(1Kq(XEDdMm-%Alf2Fa[(j6i1ddFVI"`Qk9Ek1#` PGEQ2`pC9$6l1(4cIiIY6Eq6icNkFa)(qUSTc*mIhq$i@BiM[pA&BU'fJMh-Aadq m%LIcX2D&[Vqe2SkGi[29K#TlkkN*@9qq)GCLXG0-mGPC2RXF$UMT+f8rN!$1+8D #Qp*p)L,""fh6M)GX82A$YT()`iBDM`4,d[1MYX(+BqEhkhEqL1AcZ0drBIPme2* ld[,jQ1AhF6XraGC9I%pEh'FXlV2"XHRjZHl',$fIbU*LrFMkeF8er@XfDq5VpG0 V-ZLde%(1Qh)cZ@2ckYQD,aSXlRYPZGhK[EYffpdHalF(Z@IH'baCUINCpdXf[kP MFEGGjhIZI6)pErqTG'pb#p0ZZp0fVA,eq[`MNl02VmVVI[!AQ0JpI&Zkj1`SZKh *SE5@PHqAXI[cjlblN!$lfTi8i#e,ZqhD"(E5[IN`6XY1ZKUSM@X"TqeE1qN+i`k PXZ`IM$[Fl2mXi`lcX!B`lR8AV%X4Y2YV(0edp$dX(mcpa#EpTjMlL6a1-IF6HCa LlLIcq"&c,q94BZjm`YbG,cdmd!1!ZAHmaq[-[E6CrfRQAXVM&(-rXGRr+HCHbZ- iFeGjR#$[QFhqHq[HqX'ijkl3r(RVpa2'hC8(Rb@!FCI@`%leUYJ#fcUa[E9pBXY T+m"fdKTKV",E3+H+"mF`j%X@Li05fl%!I+mLAYT9iXNmGVr%&98HZm-i6N@EPAa ciA%c&EdMNM+($H"GHcP$KNXIjq4RmLJKjr%kbp6(SCGAQ2rIAq@kF%Gi''2kTGh (rIqiRUj59aHUq(PGU*X+RHkM&5#2G$@1!b"'!8KA(JVVH9FfG1RUNqZZS4AJ2A5 hc`U3!)ITpRARFDEEGh05U`E$-bk2"ak8N!"qG$2h3bmIb#rpQ3G4qjVcaHA$RmS ApMa#b![!TVr%rrIcrqrcRm`[r6RTjEPjh+)U#YqMTmkNbl+VHDKHDE&S)$U5apD eSi@JIpH42(VH3hGCV!$eUVXX9S!mq&`iLhcrAA8HUM`LVpE(fNCGZNRKja5,Scd !p,`C5#a4MmM5hK16$qQ4k`leTYc2e&MhTcQ-&5#29GYD@rZajpi99QU[Q&RXrST FU2"jA1KmIAKFk(bpfJ0Qa63AkX82%(KVTAPd!UIRAHd6R@Xqi95rH&HG"jbUYcj 1E%-`S[IEM&IhGiETf*9Q[(Srbp+-erlQ%ACDHPFE`C5hQKAVr5`JXf)G!2,DV&J A8YX#CX9FjYiBY5EQQk+*hK2-h9,"6+d!b'PA3+UHVb58B`(Tk9KFP(+k2`Y",mB 1T*66qeQ@P(,1p',D%l%5+1iFr84ajqKRhe,F+Bhr4rTk9FcrRf*`pJdGJG2-Ub1 2ejPAq#"RQ9FT$qZ%2X)CjY@HL&e!Cm(03fmZe[@4K0Uee#8&4q,B!4L"cX-USI[ `6dSc*Fl)DlqPXH`pFE+IRG6GM*`-I[Q1B$Aai[*M+flrFmlP-"irY[lf[mh[X6a 8IV((-lpGRd&e3[),r-D3!&r-mJ[mbMl+SD,C3UNKHYI[+f(*Qqh9,h&q,fM68&N EfhNhKm(1Er36h-RDfFi-KhFj[rXdQLMEL%C2jE$+q8hq&5AXqTAI`@'kme[h0h) 3[fpPm@*IjmlGFM55rcF1mjhI2FY8B+jI6"ABerNpVXhFh@e))fIp,8mJH4`@[P4 BAAilHlqq[meGTH8"hJehILpU4YMGiM4bp4p`YGrj[IdMbYAe5i$ScL,Rer42125 c20LqAI*Vq"2ZUXb2VF1PcTj4$'J2IQa5fXrj2AFfG`1FhfA8Uh1-eH9P1!bdH,c C%ZFhAhH$c1qAXM`q*IbL4Y3hi`cbq*VcqiM@2"eLmEkI[G1MbSpG9r&lArC1PHV Z$M1FH*E$CjeIj#6ZP1B!hbcUhcR"q6fT6Fd[G(kc6q6`-HIh$GA5F1HRB@&UkZG m#`b,+)lkjRk+'ZrMiJhm"ac)8AeV`FYbmr[qKh!BkIaH[SlFIpRLMF)"5hh6q+L Z*E(`eGrMpUrrL&*mY*DNRAMIlfhJRh05,DRUlAbr-Qfehjpii+l[&rZ0V$kqqM" h&pZl6Xh`FJ*k$4'E8Sb,RNLGhAmeGk1Ghd6KUH$Pji80i#6["dd6h0V1fdIHD(R m4SDAU5X&k1)(RNQm6lq&Zl(Q"im3[,aI-cEMl&dRChMj13fp8[Y!LYUQhq$P0jA cH)Y(AFMllINelK5HD,m&'9iqT9`R1KS`mXH!SAZGhrZ&IF*mjcq3!1(PEQ%pld! HEmhbZe@a`%$H$qd$UE-De6he"6qJ9J6RrR`GGp1Fhi)rcr$bPi@&@J0$2FXA-la m@,b%'L%2DNMbq)*i,$a,I69reF&,jbPYcMl,iVdMHkI2`3NLjjRIBedmq$4hFjc I4LQ'#9jq%#b2'&2F$UmbH2Qe-4cQ1Ep&GfCiqD!d2HBE([!Z,Pj'Ed'+,++k8pm "H*l"bkpr3`rRqVhar4PHEKII@ZMUXSCfUX(,a-H8X"Y[X6Mc[BDAhQV`cJrmHKF [2Er)p@"*"Lpp[`PkAi1A[TmM(*(k'(f0%REp*SN6#&iqT4J+0rM'IcZV-pe(A'T miM-CAVlpipa4bq3"6JKZrGi3GlAf(USq$2i0&Cl*j%cb,c,mZd[B,(f1U,T2JUp rT(Jbf4)9"NYq!p6'N!"9HAH#d`B[(rdb$Y*"MRiPHlq%FZ"0H#I`5r$b,rkC1eI ebDP$L!EIE[J+CM5iH)IfC(JjAh8-e['Zm!5$PjZiNrQjT0jEkZaZX$aLNdX6p#k #F`rT,4UGhqerRH%PX"9ClrcQ5%Y%m2*YUUeePJIF4I+iATJNECHl`6r$,rH+eej Kl`dhPAIDTEF!kmKMBrC1Ra%CK'HTlalaB-(,UF*@iJ"0U[i0AQj@$VbjqRDSVb* if9pBbCY$+iJYH2PTeIB@jrFHCJ!-AVliHcKFkI`H!e-0AXj3r`#V8[ibp@h`mJZ IaB0q#1R6mc$mdPqjrbdI)1Jh$5pp[`Nr+e!6[26p*YrAa8[2chR2*kRP(E9NBRr rjReXh4mpUpD-L4Ii2IRhiY40`h&#[`4X[GVi0(JMID-JhJI!IQH'[1%m2Upp5(K Jr(cm[N%FIEVj"Hp+[d$UjU2LK0GBhZr+kUrK5pb"#D4%AF5Ghqh#IZU#HJ*hEh" qApV"hA9@(rLjqF919Yp&C#%Q#SrGr',(AFZG#$I%K6H5haq,(dJ[m!kpJH6hIMK La(U0NcrIbDpmd6-#&0G[XrS1ERlPHe3I-MBD[l@6ArP2L%1+CXYp`KFh[r)hh-+ G6!E[&2qrhR$#fmcCZHYpP,h"#Gm[HL1(&kc12,r)1m6[$8liIKq#CcVR'DliIT- %jLl2U,Y2R0$YB6[A5L2U3HIh6[%*YjrSh2ET$[l9c3TchGjRG#(p-X'rZV[9aa, GR2[")H%PG4rr+Jl5aj`Vr(Aa2RhfhGc*c-h%'cTiArIB,h%RrFh*UNqA6p6pXRT R[+2kIShk%9j5phHUHjN+@+cqRmY,dLH+6p!()'rH5r+J24'aIZ[6i+,`NVVle$1 5A[9LF@9jlfm*jk3e29RmaUhlZNmm*),Nq[eAH,2`[235p62!+2@9IE#$"qPhL22 6+`!22YR"JlT(p@Ch'Ul!he`q@[G&p9P9(HQm&Gi,(khl8h%Y'AZDUlK56e0rP6[ CZ(UbqUp56mqpPc[ZeIFXr62K6h@cbZ0ZjdF-i8rT0iSM[YRj[D!HJmZId[hLS[4 $H%EiV9X(kHA##IT4kRX4lLlmUHjfmBclM"r3Ph*jI0fIU5EJ#j3Ur39j[b(LYI4 je2HmhY,PmHNhrl%!4IJ6I8#hcZTZ&NGrQq9(EhK-kPGrQc!,r!IRi*pZ(G4I+Ij "(dCp,iPEZrR9rk%`'!b"cp'IN!!krP0K0(e[H!c[-E8@lqGKNC,k8mB[`&GiB!@ m#PcbicdXITP-miZX9UrS8bl[HG4@l&cR0eZp$(T(m*irkH"dj1[#$ZSAD%AV6I* iR"jR4$a4I6q%RjJmPUQhT8QlHLF`62+i@fp&Rd6P-BAD-RQmSRk2kRrL&kH[Br* iZl$UFeCrm"c*Skr`MpT8m5EaMLD23qSpr)(c5rePPXF2K,Q+4qJm`"'GacfcckJ A!hF!9qM*pDNaIH[9$0pIkGeIUSAIQC!!IK5qjEKqc)"B[AZ`LrS$YcBk[pqL4a) 40eII(2(2Ah0qip3r9[e'hZN*m0ATFhkrSlGiaIR0T%mJq3eFq$3Hp!R"4AS*NTq HY[k5LpGAEb$jI8mFPak[mTY&ACVm(K%2J&G#c45[-1rhS,#%HLFrDPVbfbJZ"#G 9SHDSVbcj0BTI8S2+Ebl[BI,lVM!,E&3Z[dRGQIG,#J1S"HAb%Mc5j2IAHP0ke2M 4Pj,m[L)-8r@,hm[`!C2IH2AZ9Im6[`r"CD11hj6G)Sj%la(H!hm@hMcmYlMlZ[% EZ*(V9rB4eH)h$*rJda)[mK4hUXp!INq"4bDrVi[cJ22!2TaHi[89aeCc(0U2Z36 *lcja$h"!I3qPZ1,'UaB[C(j%jIGK1)I*lk[L%["SF!JH+(PFUaN-qJ2UHlIkb1, hFA'HljJIr92aqi&Q9llVmTY'2C[mAP626[&0r4jJX-4lrRVZ[QGqm%RaZdj[,6f CKqMAQ[G,+cpkLC(r!`!0$3a0B@08Bf`J690-,VQ5V&`'QaD#!*!)"TXBK-,Z!*! 3LqN!N!MrN!4069"b3eG*43%!VjH"CE-G%)3!!!%H!!&@@`#3!fN!!#NKhAR-6!# 3"SEZ%3!)XY&i2U8!iY1-0Q5dTqCS5Pq!I(k5%NT*arjJ*prjf$-VplrHR@26m`+ +hp"Tl31SGm@FIK8YjfVhcp'@0TbVh69(@eCVVRCdMRCfjEQD2NHVa(1e@l-eHhm bR9hMDq-S90r#*!!!"J$&YRj(11'aIB594hKHC#AE)j[G*La#0cPqC%XBZB9XNlB bMamY+P0#"jee55M(8hc5YpEh0[jMjr'1l@0NHf4,0Z[)2XRaMac[b@dMfmXN[*2 XCd8if@3IZAeq*pPNX%eb2,,*lI-*Ed!fZAf%5fk2b'ebfb-,"6Um31Z!qdd)RjL p")$F*L018-!lFTZ5@fh!"PkMR+H0FQ5$(&P[4UpVN!#8RjX0XXmh"jEA1dMV+(I hZ[KQ&rpkl6UrZ@3IfB2XM2GfpZNYAYSJ[5CjkD*GTVqFPbkkR'G'&R+,!&J!!EF q`2V5Yl2@Nllapr[5iVFFqB8XE1XY!$[mHBlmVL#+kXDB&FCikidhp,$a,SDYFK) qqlf#Kk[re8E9F,ZI*,8S+9D5D$i-XSk[)q@,'drIc@DPCjD@fSirA++60KhIlCF hhQ6-MT[i+ar2(,qb($Ap)(Se`kKCEdl`lLhXlGacRmk%ZmGD"0iETp,-6plUbUJ aarPp8HYS#R&H6NAbI@`Yr,+Bf[3Vqm&&S9m0Nl4[lS8%2%414LARb)UeGjX6j&f a+[D$RIjXq&,qPI+[6KFEcr[h(eY-Xl"4U[YT'UE2q[IDe'T@kbqRTj'3!'m3rKq qrP%rQK5EZHImY8m++C)f6cDk`0VLXY&QeYB4,pUZ3bkr3ICkhG,3m1L8r!Dp88p h`8HY"-aXl3`+D!b3!$SRf++TC[b"M6!Q0ZCdf516jX6Fp`+,4C&,F*k-Xcl[MBJ j(pIp1&A'[9B4Tm5qcX#U[[@f@5,EF*l%Z*M9ZCa&!,CTQpbY0a%Ai&Ah**!!D3I X1LmIN!$9K4,Q)#m0eSN#BQ6a@eRQic`a,i-(m1riG&#GXPr"m%Y9afqa-#qrZVS LkPaJ35B0KK@2hQD,P[ll+mVJ,+J$p1[(KLY*1&0EH"EfQiQ+Y(c896(C03Ik59R kPX0N0Lb1[%CFLYpbI#XUPH'm!q+EKbqF$(E@UL5j'mBU*A5h8)*8dYT23$GGLAQ &Xm`G+pE4'$rEH*1+Q`amA#rQT#l9L*`Mm1-lXeGY@)S"`jpRRiVY9h$k*#TLEXI C9lD2X&I&pL$15U92cMjQ4VchN!!ML@d4,J0NUmGPS'aEZ`6#@m"PX'b[83fa[4Q A)E*p!*HKXRd@Pf'bI3ZAi@TiDMT#0U"mT'bJhLMCcX&PY'aE#2YL!lder#[E,EL -NqeYZ&"2E04J['arM8Z9E0r"CB+eaGK,%fA$Kal%4Kp-PZd-A+E)GJNZ8f@l'KI GfFTf-bk#TV'[i6*G0QS`3cCU-&1fKh#CC@fkc@I,4NfVC3-$jXK@KmYFf6EK-Nq fRa0@B(X$,[31YMr$CB&XIiA,3YNH`)AD!LNN[PJfmPiL'l'@b[C#A'TNJe`[Nqf PZ-#8X2dQ,V!YE,IL!Y[#pQN#UGMq(TG6VDdAX@H&E26RDE+4$aL+E6dZe"`EP(f PE$IKXNUfhm2PG0RHK`YpLZec`NaXhmEP,'[V68amJ@cdr0Qb89q`$YYDA-!FE14 pVQbrLXYUfIi%&rS#'c9H)a[B4RbJ'&aH*aZi3$fa89pB*VD0T!eLH`NZ#'cBIKZ A#f5MRf#cf$k$biYNSkiA@9YIi[[&XP&A-!SEr811f-$[5f@l(KF`""XpY&Qf1h! "Bl(p,5l%a2CGm3kS""aJQfaJeQ@bd@0#mbTUZ("LH`8ZPmY'VPI)"LiL-Q,l#Li Lh&3mJFXZDkXN*SNk9NRF8BaIfqL0Uf5l"THpXS&r)Zp8XQq%qe@bEm"UE!rM3Nc ep51(DC)0[)EAB!06i"IBk)%AbrBbA-"EE'!Hr![EKh$j"GQqLJZpV$j0UDk6$Ai LHNGrBL,iLBeq*LpXe1[PXX'Vk&0Xlm5&2X)'PYmJ'aM`5QXE3!aiP@c`Neq5$Eb j86Ek&[c%4Jj`&Qc`a9I,pJPFIPQfEq)#Ve6I3')R')L0[UFqf-"6q"Ffq[beXT( Ekf6lBeaq6EDlF2PefIi"PpGEfb$L*If,$8kP04GPJa[mKQaJ$Af(MCVqPQc[`!A -a2BTA(j(0RMHleVEB(*Dm!FE[IllXX%CrN!fm1X2CD1ArNLfYq,b*YNqMJ[m$KY m'XkV[Z2))pmL'eb4RX)'cb%q0[!AISS0[(LlE05D'Q)$YqJAE*r(KGl("Pq%GkK [#([a6f@M9piP'a`*hSF0A#%AE'$FZf@M9pmM'hQq9lD2iR+EE("%q*6kKT+M[em fq2$YXS&KB$Jf1-B(C3-h`80Xi-@IbdEG2bcEah#"Df#$&pjTEF1SLIb&E'!rfJ8 fq#Ve`3E[qN[Ci!2NJJfm!9Z`N5YpLJdI-!hE0h$jT'`SH'#&qSD6Ji+Vf1#pF$T Xm,HlCB0Mh#-EGB96B!-,d$H`88Hi*cBi$If,$BAb#pBfJ[`*(3!E(2k,XX%Y[b3 ER1G[C!2R[L`E1(+[E23'(!dE2Z5,l4&FlV1fNG4Pi#2Bd"5q*KZmpqpN!e1r,KZ FK(l%"VE5,pMSqIYPSkEJ!lC(F3%$e6H+1JjiMJfGiKpPSiIJ%GM!)6Jb0V$qRf3 $[q!bf1J0X!iEII22eMDD'K"iMJeG!ak($Flm,l,"hrj90ZS(Em8'lRa20QT+MkK [$2@2lmX'4kHHf1J2FRF9I%Vp'!4eY'TNV<P)UP$j3fE1J62*Y2+b9D&e)AZDr hV[11,iKrkUqS6D[21d[5NG2PJmK#B!&X##YJ#Y'&"%&8)DJ3CFJ$""9L#L%&R'J XL#H%%c#"B%)X)C3353JNa"&#$@Q%,%)5)35!'5!'H!&D%$d)(X!$kB,834BK+T! !1XJF)!LC"+J!@-!HF)A33H4!#)JEK!fL"N'$Q!(1J"KN$")'qB*d!AU3!&#)&X3 %F!EJ)&L3!!I)%b)+a!E4"$%'iS%)J9L#5)*BJaJ$F!1ZN!!la""!#2%$%S[BJFL "Z!'"3-a!a%#m304"Z%"X3+L!9%--)!33!3J!j!a5"SK$b#"L%$`)(%3-!JEaJJ! #qK!85"e!$JQ$I%'k)#D3!#`)"+3+-J@*JK"!S#"*%#D)%J3*iJJjJK4"EL!,N!! Lb""N!$%D%4VL)B+e&UX4S#'R#$U)fT!!9J4H4%d8(m34a!B)&`)[C"ea"Z%G-6f BDN(i3)K([%HiKS`L9#0')qBK5%1m%483e"&h)2f)'*!!583XL"l#1m3)m4E#M,! ,%8-34YL&f#*d`JS3M"(8%&`4EK&X)I63$J3,4"H%)`4%4!8%9d3aa"*)+q)UJKr L$f3*84X4&2%6`SIBLBJ+@8IX415%U#'b3R34m"!e%5N3-4%[%5d4%K"*%#F4*4% M%H!3(a'[%'-KV!Je#)`L,,CrD[bNUY3(LKAThcSf9#`9Kf[6LCmXQSPQED%ieSV M#*0aQkCafaJZe,+q`2MeHK6`[LZY6Fh8kQ&+ipjD0XHl'KlEbbLEdp"2!VTXEXh -K-P8,B*Y5a!e'Rkc5Y0f[qfdZjP'pC!!aTdq-pZ#C(B%IRdU#@GVF$CZqaEM%2H YY34$P(lXKL4TmNiGI!pMm@0Ukjk)*GT@MrbXlBCYBm22jUCQkkf3!!fJ[&4G0p@ CiFlT0%YUc9QD'KVfYR'Qe3bBamjD'YK8pb$qr*Q86RX`$EUah4PTSjrZ(L5cE`D 'Ue)dNVV[Y6h3'2K0ZMA@CTYqR3D6YQr`de5fI9%pMiIPkMc3rM4XlS*KAkh"LZQ Ve(C,-k[,TJBE6FQ[EYE5V0SeAYXfT80IRD902mqRTJ--e8#%#-kUS3Da!$SHfF6 LlQi@,`VVX5P[Yr4FHbVMDKpP[6+hVJQ[-,L[5"YQXM3b12K8$UX($TTVbS[&3cR AlqJk4$V$8Q+[JA9G8(mkC-iT-MBd-M'*FZVlkI9SfUqc@l@j2Qbf1XE9l0#'T'h H8'Y@Sphd6UHdD12&IA%bIc"hI+imP,PbXIf#ZEkbrD$CG)`BT@1`TVX#FddF"lG fF`Z+V$Y"aE%KU%CMQ-dhiMi@4eG39*5cDmfGB5)(j@`FDPYT&M@+&iH,Zk1NQTV q)!M6&'AC0jHDF4mcB[Z+Bf'@!C%Dc5!3YDVXah&Z2De9UeH,!`YCiUGQFcMGQTd 0Nk+0'E&&VSdD-@+U0,9Cc8,[XSQXUb$&A@(G$)d@4f,!d)iV%%A,2@TQq[5`QG[ UDLP*aFjTTT!!VL)Qe5hqAHDUIDb4V"6iT(+RfLBVE*QXdUf!b@461eKQ$rUmJ6i #dGGRY4a#QVVmT5P!qfKmeKD0cdd"1N)a&fhaD8Z6T4*0(6,3e)ErTJlX0`R1ja@ (rHCX#q1kUFDERaH`#K9X52`-[#KbEVHC&K6lUe@`*M8VI@AH6)SfkGE`35rGAe5 ifFRppTP"5c3B-fL*VQ-',G&6c+!P@SNCY%3I-B1@k"jQd",p`JaDSQ1B38Zd#M0 SLBiQJjCD,j0"5kf*bD#PeKYPd&,VJc*SUE8q'E68'Ti-@QV05`BYYHBPJjCD[j* "5kfTbD#PeJ4&Yr+BX`aDH[5438Z2'T--@RV8P'63dQ-Ib+#P4he)"LdppS%-@RV 8H'63dU-f)i1@(QX[JjBHG8-CY25S%mUJT8Fp8!BY2HUc-QMT8AH938Z2HUS-@RV 86'A3dU2f+B1@(V90'E6df"mbD1P4$j4"5imDR`aDHY3GCG$5Bhr)S'@8Z#"UHC3 p+B1@8ID*$&T'QEm-@NDTVmQJCC3kQ3aD4SN0-QJCTCiPJjC4DPNbD"QPEL@$PP& LJ`aD4UP$bk"PP*Uc$&T'U42,S'@8YCG"bbLe84QdM,,'-QJCT@BXJjC4kXdbD"N MhXQJCB`i)S1@HZK9"LeMV+--@ZUK9aQdM&'rNd(,'(YG"Lhe!+`-@XDSqmUJCBa kZ`aDaULAbk"PM&Uf$&V'U%R,S+8HM*9"baMeA4QdM&'6P8(,1(&C"LhMa$JCY)` 68f638Jr-bU"PR$dJJjCajLb$PR&UM6*S'DIQ,B1@HT!!9JBYip5XCG!bcPN"'E5 -8rqA3FXi0A`CY)a6KjG"bcMV+S1@FIDS$&V'U6r,S'@F@V`-@XCCBaQd6,$'-QL Ck!eDkZ&F'E4-%$GPd$*"M*0"b`4a4263"2YC"Ld6l$%CY%b`lM*SQ@!YC0!b`9J bD*NJBjC"b`3eIKQd6,!RK%dRL0NbD*RJ[)3-@LBicb#$PJR1)XLJCB,B,)1@#HV [-QLCS1B[JjD1JSmDfAN'SbQ6[p'9`3Ek"B`&pqNMX!Zm"'rdTJf+T8kMei-cF%# i(hKMp'hi(cd,pi2c`E[J%dB(Kq24er!8--YUpr3h2!jX-rSiq![rJ,1"L@!Nq!a f``2!9E!!EQIR&35V08l$8m"SX"eq!Dm$Tq%JCSl"k2$dU0ALi5pJQCe,J0q!DI! 'X!AmcFm2J%efGX(-,B$EF"Xi(0`0EJErJTI"aq"K4YX(Pm!Z-!ZX!U2Xh)T`U[E 2AhB4iEkL'-iicJ41YDH(j4D4e6MliUc!@BQc(mlq1!IJ()Kc%-l"1)IJ()U6kF6 K1%IJ()Pc&-l41-IJ()Yc(%jfrBc(@B9c!Xk*1#IKR)ac#XkT1%r!13hRG*`cF-l %13[RE*c911IJR)YcARX&L$SAi&b)Fa(1a6LAi&b+X`ER-T`Ri6`jAh1L0K)j!&! c#Z`c5SB,i%XZ+0(V-IJ8LJlFiZrbYBqRqSUDq%EUZh#S8Yc5[ieB`L+5`0eS+$p D0*,1)C11UNTQC8IV,KC64qAf61PdiEfh)Eq@G&Sq)rS)(RDdNp'UG1Q-J(5SkId Sh)bBGH66Uk8F!2ZPMJ'96iY%)P$Irr4$!JZRfXBZ8KmEBIJF$&AfHPQhlTf4E6j al@@6R6dTpjLQH+\Va116Bbm8"LRUl1&$R2Li1p,U[L`0k9EJi824+&`FDhmr &J46eGh'Jr`0F(#5#J5i1G'H3!)X$qJefFC!!)BjcF@!N3e`FC)bK,Jibah!A"aP NK)Z$9$,5a8%q'HAL)+1-GR'3!&V'Z$M)-@0G(#5EF5i1dXha,JkbcRJA"qQRbX9 "rTRJiL!46A4aN!#4*VNi5%b6A4`NU#NZ$R,89"F(bHS%&`GCDjU,Jr3ehF9"(T[ KiL#GcA4aY,cfH"cNb0NZ$T*HYBZ$T$I(a8(bQq[L)!XZIc&1+U![(ClUiL$cVR" aN!"H6h0aN!#$DedFT0MY,Jj5l3iA"bRfFKF('IF+&`Fjp8SA"qPiTiZ$P,l,a8' @hZhLk"e3MmG"bVr+a8&#hq[L)'mh[K%R'8qjf`@I6X8ik(YX2%h*arii`0Rl6l[ qYU@Pal3Vc0(fV3)S",K`c[j65Y"LVY*SU+2Y3qY(eqEHCrmCDkjD@[V$-e-d6br PGD"p(FZjQFN`)j&QhC%GJ65MMhENdB`lSXm()iafc9*j,C)C,63MKHLCD*ASN!" fV"$G$dd2[3iY,PLAC0FNQI9)4cm'$Pd!!hPZ%0"`%!c#pF8BHqYqQ2rih!-MACP F@YEefAC`"hbTDF"NEV*m`HRcZ4kQ'U@0A3K,l2pciEk&,@X$eYA*&SdB6Q"H6G( U0GqpFIE"f4GR"Fj+R2e`pXFj!1G!R)0`$XBj&1F`R-0aMX!j%ZFSR+0aMX%j&ZF iR-IM()qc#ZF%R"0a6X)j'HF8R&0aRS"c'XlT1'IJR)Pc&XlC1+YacX%j&qFmR20 a,X#j%1FLR)Ya,X'j&'F0cQ8i6m*j-Xj6mMFKQ28[lTN[LQPFmaB%jmXhG&eTC22 !ZZ+kcIhMrELZ(LU0Di10+q9caLJIMl%VPm!ki(5lTC8)*d8I*NIXDcBP@%A)hVk NadUXHY[pP-1UU*Rec29$PE(1ZVZFQlrS6RENjAc0jVZdfpl5TA&m@I%jPpEma$1 jP5lYZQQf&K4,IPc-Yd+N&[2P3jJpKDfZa3S&"FdX&8bjXCJLRd8YYJMQ-P",)0G `&f&cTDlGH0jceFHVZA)iY@3V(QC[BXSaf-5BmXcXC%aMJpfrQ(*VAR'BG@dZNee lQ+j'GRpMi0MDjV)b-9eTIl9PD`lLfCU%h3#Cp5U8e1kfc$La(c,RdG+,GQGNbLf c26,PYMCU*8%ijXq%5+9KjR!,Y93Yf*kCKZc-(Nf$#0VVE'aUcD!IqcTpQ5XSNiB cTAhYJIb9mcU[I(#&DJZf@1FX[&M2jJTDjf`4-kjCC,+HQ8i*(,-Y(RLE,JrmNQf G+AJ1[PTm8q#6m483XcjC0Q%p-ahBl0K@Q,EfE1ebkpi-T+h1lHA-`'RJ@'`h#kU "RmE9CUGmUE2SDMfc!'Xp!pjPI628+h$-PmX5X0`5i@C%$2`cS"Ji"lJBq'HK-I$ 1S'2JE!%bljYTfR`!DB5mki&Hb)*PZhX5B*VGIFJ-h$+S'6KEi'ccl5L9JFr!V`9 "J`J"L"Em$j6C3QRHYl-adi#DG`96fr`+AC!!3GE!131ZJA-1A`0h#l&jhd)0-dT (ENY8#rF-!Q6jCq$Gc%'$!$NH'VKRZ@MJRH'MHHFX5FT(5'h@E[%Y0N@1RlElTdK GXlr`e-![be8$l`aIEA-q8,!NE`dF@lPV%++C[aB#&-ZGiE&jjkifc5j!Er(9R,E 0XD-GXY`fm-lbfm!li,L"IiERjTdl5PQ!BGPG(`+a#G%"aFDr"-BQa!%i0J%k!0R i&b$CZRGdZih4dL6@1fb6!p#FMC!!4kYNK'Ci0TiG!'hm#a#GF5m9Va@QM@XR8*X J*DM1K3M,Ai"VkejZiAE)YYijd-ki&KZN!lL0I`Gd'rmLH*X)"ILflXA#&L'm'lj $k1k'l8l)$Z'k"09PQ#j#G!QHZk#j#jEE)6Q%ia)8Kc"FJ1!Hq1f'hQlB,8&Z'@k ,8&Z!f4,%K[!D3QXAV*BJY3LR(9$D,8Q&JP5h(08T4S959%Q)+XY344'U*%&e#9" GmP1lq"4+6bAK+C5G#U*6Mq68,6KebddPXDNX04@&TS,-9"+C3SNT&*Lkj+@5Z&5 8PNV#%Ul"Zcm#2%`qp+-eTC8,3@LIUp&1'%UjDGUDcmdJIjJEqHGIfC%,dI,SMPb !p"XmFTjY6r,)9DQl!S6SV!!"fLZ!ClN#QGjGdfVbm5&jqY$mA*!!9J!Vak!I`aL CAQqYK9%&bMQ8Df'``BAa"")(aCCk9PK3PiiPMfBCU5a4keLLEH1%5l4YR(#*YSd 6,Y'fFF)PfMC1Z%6EaJQAD0Xii4*Y'bGFSQhMK%ZdECa`LED0%bl4YR(#*GSf6VK %fmB*PfME11%5E4XRA)jYii6,X@fFF$QfM4-ZalCa`ZAB0Nki(0['#CGMfcMKFQ` E*eb1EH1%bl&YR(!jYSd6,XHfFF,Pf$C1Z"cEaJQABpXiiA*X'bGFMQhMK-ZaECa `1ED0%bl(YR(#jGJf6VJFfmB*Pf2E11&bE"XRA)jYii6,X@fFJmZa9Cb$bl&9R)2 ,X9@FJmZa9Cb$bl&9(*Eap5c(9R&Bf0Hc(&[&BDPIch*X&BI&Ich,X98FPJ2f,-G @F9JJf,-F@m9Kb@$2FQ`9Kd@%2FZa94b@&IBXaeCa@(VGXaaEa@(TGFpbE,d1bj@ j(2Y3(+9L0@pM+LH9qj*Epp3$KmprjVh1chf2EC8d$bR@RcbfmIR2$I)mP#)4q@p 2Cd"09Q+69ba[Vdh2[ah'0I1CPp4`$Lb('AD&053ldb,(TY3lL06MVqVZ-9Fp9$4 l(MaV,CrC1,D`bj`b9khc+89hMSf2RSPHqh4jB1Z%'YZcr4HpiDrY"elG8lMKLB2 l8U2A,qRa8Dk$VlfQlT*2[cCC[9"D4Y[NlB8eHK@i(QaC'iG"EDB@k!PFcTb24ba jGJHhQL2T"CZhh%i$Z8JqU)j)(!QqmEZQac,@CRLFikDNfRi+TIm84YFCBU6aJ'A 2#JrD1"J$L+iH$ZEX`!1p5ED)"qU4T0IJVZC)MBIc$!q8-TER"cj6h"%ZBpEr(AL Jq)(S"aNm8&ER'5%Si)'HA-!B'adCdB-Er5pfiHK%@c6h6MVmf&ie!,KUD(J!J6h GSlV(G)rVRY#pPqkpGHqMHerG+h5[e,fIl[ee(k$l30d(k6jBpa0e(k,l80dAk$j -pq'kMp"pT1kMG"qYqaMGaqSq6[IMG4q[HjAZ%h5IU2XNh5IV2NAhUEUIS2Y#h4I T[PMh*ES[eEe'pf@kRk6lbEUIdQ[Ak)N((d1FDVjTZNrAIBEZ-h@ITI[XAM+aeFe `Grl'A'8dh9bYqacGjqSq6hGj8UFUaE4blq%IKFpGmr)'2JEjeqKpH'[9+HXdbV9 H$a%i6mpEhD#*Q22eP-),j(H4lKI,reVG,e%H'jAATBUc5APYeRf,iQa9h2fk0mK [Qjl,HPRRi5,fGAXZPLFMr#b"-!QQQ%6cikHGUerZSH)ZPXm*0rfT[kJjL8XXXNp MchfMlBU+Sap[!ei4ahTHmY%mkX[$HTjdmFZpeElYUkm-kpR5ar,B80+cU)r@GFh Bk)XC2T2(ZS(*mElT141Nk9q-pf69V2Q*RJfY[X5lFP[QmIVbH9H2j"TAp-$2QBD IKc`qZZ2,[(Zrm2PjG'e(H6U2VS)mR8HAN!$kSc`k%hNUMiB&QiH4YEd,pYl6IU0 Bc0Z$Kb'rFXY2MIIik4IXrF)*hYl#3l"rZah2bppVU20SIT(G-r9JX%,RdDdcTal XAbbXRiIDm1`)b'2,dFU@kmVH'j0(L%42jE(AX!rAl[Y"hSmAE,c2'hplCeQ3!,F $HiNMhPC[krkk9lk(Mh51`2rI%HG1-qlGreiqjpc2Sp(-[BV6rZlM5!l8bHab1(e qDH3BMb('UYHCc0BSd*1mrrHM)([6j(A@F#L2aVRkX9HkU8h52IbX-@XY%j!!"em eQZ5RG@933"Kh8AjeIc$Z!jVD6aKh-3pR!1-qGp1@BfqJUkpX2eB2a`Gc,bQJ2fE Z2ANFCZipH4aQlSrPFBLjPr23c2f4Dh%Uc)lGJYfC2R2A%l!qFhrKTh[-I5hXbIH 9rKGc,p6M1HCH,1`cc,fFaf(QANMM@HCHcL2(h*HIr'rQ[RcYdmbpBGBF`HN)%Y( 20QKMl[IQ11hmB0b,0[,CpDhI6aMhJ6ci(!'-@cd&iF4cLVeh(H5qrQmbT[-hFQ9 X%I'HC%`pH4aQ1SrPFBMTP22BBk+JI[0eTR$hHR2bp,IJYY(E$IZ`dfk'lISZ)e# 0TKa@M3$aQQlq8Hjrq6HqhXe$-3Y(3"k(Q8@KVXmbLh)Hh5#XmY"2NJKMq(NdT'E $KTHC"8NdT!*2C3I1!J8JLCbP2#b&`jc0ipl,fd1YjGGbTK8E[f%lN!"mpr6mUhQ F1cer,)r+R&+9TKB(j0VCQ[HIj&fppCA+YhkfmNRYc!Q3!%GY28e0Am!(hah)3c@ L(ZB099kYH6N"kU'e+LG!(NDV#[0i5U[DRMAUjK9'S&El[q*p&iN"$0eabb&'F$X ATIYjA-iZ+YEML6i6M@"(I+4Id3L+h0l2JdRd#!IfMr@peJLF!2fU03)R3"iDb6@ F4IjE9jd(q`b1p8IImNZ$Dr)G9aUH'!-CDTKjUr+mUe'Vi*!!UP)HHI@k'FP4`Cd !H@Me@V9Lij%m![8kca9&qqM+)kHZ&I0360S4N!#(SUk1J$bZ6)r@3fhZcVl&-CY (NYXV,FB98!qPaEJ"mP"`&ZC4aV08(NSM1**(8RAHEY,ri'Zb(RX-aCL`2c+Umi( q3'0b"15K0+BMrCV6Q&`!HHa,cIrkV,,h"-kfJ"9L"!pj"rEpaK6ZQM3R2ha9ah[ iTqik@$'b8ABZhS&VmRQDk2qG5YkHBJ51J$`8)h!%j+'3!0`9N!$(RQ8#kVVGa2& EHD6Q2K45(FNMKe62jm&AlEq'(bZIQNL8A&*jE(k`NmIZj3$bU1`pP+N0mAVRUQ( p!hHZq-V8"EN+0ID$I'D'riepj1@(#DKiZP$aJFQXSaSk!I,3+Td6)!qMdS9jj&@ k9"jRFNZ58F8kki%U9Ub(RiG@SC`!GG@6+XIbi$j`G-k2dkLkq")I'QQ4iHlcP`Y !"KG!(NN9UT4(IQY"d)P*&HVrmN#AGJ,8e8Fm&d!H"[%8LAN+m5KY'q*Y`F4,U4l jDI(f2"5MFJ6NS6L`)b!2aB&G!ARX@5DJVXa3(N2b**Fq8Sm-Pck54ij,Z`$bf*Z VBTh-5kd*d%$Gf@H0Vq8Kf`Bkmp$E"Y5S8jK(IYY!N!#(RQZJmBrK[@D86S!m0+2 d'lEB(keE!S+kkYP(*d!HI&UG29*A*VM1LCS[D"lQmmVPbM)!'q$dI%4jUpbBjGr f'S4IAS8+2KI6AS1MRf0TVm'Hq1JZJA*GdeT$jjGAHG[kJrd)aci(b(k%!S!mZaq KY+25$E!IS6`H)I-46S!1FJF`GdF&-h8#)+GE!DQHq-V,)4dJQSl$C6YNq$N)Y"K hd(E))jpMD6[N8eT-Hb)Z!LfQ+iE-IA4qlUdYNq@99j%eEc+idQDI(c1iRM`1-lL H2!icZ-Ib1-6JbRNmbE`+H6c([)S&HBCjPI-ic,`+D6c,[(VbH**jY5IL+0MP9IU #A9iGRaZ!%HJmR"+l[-UV[#,[@(j#@k`GZIE)TX)N-[3mc%2["(-#j((@I$,6Kr1 RGB9C1%id5VeEl'KrT(D,(HeAGi#QShH,(F-2*MB[V-A(0*dRkZUHd(6iC%ICmhA 9HA5rZHCJ([lVqhM*6L*r64R[VkKTq-ZG[CqYkdZrYNjHeqE)HhfIbqIG1mi12&! mAEf#b)(hqMlAff[VNQpk+NhU1Nqrp*ZH1QIV(#EIcek+EhVL08qCckcjGrYm'kI 5c$r+QKd)RfH1-b[H'FI"VGdRK95$3fH#,0IRBUL1Sb&VGmlR"U)!VV4[Q'Ha-[N f$[q`!+U-,KSmGG2dK*[PFr%b6I8'%h@Z`@Zjq0DDeIPp(Gr1TEleH$F4hhP3rrJ f#'(hkAkelYIShU6lqHE%r(k"p1!,jIFLh5p5[KI,ISRbhDMm,e@qQj6rCYfhQ*A jID[L0LMZ0R0mIVpXfBCmqBK!9$,&Lib)6N5b*')&cNUFG%GrR!0`$X6*k-9JR-I K()*c+$Y8RF0aMX!j%ZFSpHSBR'0aMX0j2-la1*Q4Q)"c)Xj*1#IMR)*c+Xi6F%l $14hR$*c-RV&(IME1DTacF,)eGal1q6K2a-RqVB8iQ@GDM(-*cU8iH8V9XQ8#m#H +35eBZa1'Z3pG9aVC2,#ZZ'jcrhJrVUZ(5Z0X@RI+GqE`!$"JpS@M%qhC[GMUCVK lE'KNBK,'a+!08+hl(0hRkMj2prN!h5YSkleRF1qU2GZ)UHVVE9EG-(mJ(-6+mmD cmqARq$YSP!)AMq,SZZX(PbX'11-dq,-aRMc@00,Xm"4ilmXSIbUrh+Mkd2XTQbU rABImiPr%C4VmGKcb'iPiIC4Il)pG[bVip9*qeQmUr+,+crTje%Ela3PHQ6(ShZr 33Ic331GD[iZS`IU+F-6Mkb21XRjc(iA09jBMhTfip,&qLajJiF6[2ELXXhi,"f$ cPHC)J9V`)ZZhrpZ`q8TcT-"ap@VVGaheAepaMK6B&j,IlG5(IH8k8YM9pG[f#'b q-KdTI))em2e@E)@0I2&l@GI[eXr$KKk0h`fih'Mp9[k52H(laD#MHGGB[f@2`3( GQR+K2iqfIMHbaihHGLDEfIIc1++1MUfq)6p'(P(e"mXAk6[Di5BflFiX*4kNZF2 XEk)%I4TC[XmLl6F0I4cj4b1V4iImi[Ha"LSH1*(f@rTGq#jSC,1(mH$N2k(QXaT aLRM@leA3fD0l+m0TKQbSXAjcMFVKFedFX[&14Adpj,H(%rMT["1rlp99X)0[qpp kG8hjH4rkFbq2G,ci%lfkT[e@8EIrM[SJlCGJ2rYp@AI'Cf$6VdL+Q)rG6TM6IV@ l*Z#Jl(b[fBpHp['[pX18RGpUr9lr3fc[f'lphX!ph@qcIL[3hpiUkrG[(%PrZr* QhX$[qpVI23bEkPrYapa!KI9lQ'qD!#IaBhr'!1ZhRrMk6ZYh'Yi9jUfdpC[r16M `4Kl`KMQ%8fbmQiPRB#Cj[,#EalZRB!2$e9H,1RUrYRjh%f08RA8Hh+AHhrmqE2T Y&@SdiT)1lYCqNPLSF)1[#6R&,GlAhXKh#),Rj%(0I"bY1j0BpPljUEk*6&ZrQPr "GT[eQr8pA*EB20l(13[Xj2d3-GAhHqfABAZrkNTI5crGF3!fDS8II5Mpp)[FCI) "kcIcYlKma1BG)criS28l(I-KhUNfA[eRiI!KeH0KBS2[p`lf+(@MIZbhm(P2lCH f`2CKkhF'qLqU[[NU0q,FSAV3*a1YheIq(lBla31B4j(kED@1$ckVEcVVHi[eHj! !H5YHS2Q"iSA#UfVc9jam9(j[lZ,CD-krJ2rUZaGB9A'jp9Yq*4`qC[hZac[6"-r UcQ@Yll*qhlUqLfF['BA$akhI@F!KJfGhF@lQ%qT,pFieU9rG!$(PNkVh&c[p9eI NA-bRe$I`3-'Kfi$PNCpC[hhrkZ"Cl5q)@A"$mZ0G*$kHe9A)Uqj@(QrUj[%S-I) Hb`qU`3-%cqSZ)DIkM1V"(K(TbqXCll2#!qD&"-rH4Cb'[kM[eH!4"XqfI481ReI Hc"hjH&Cl*IR"&kcI5Q+fMfHe)IX$ENKqm!I"X`CL&Ae"hc-I*(Mf&YEb5kSh2%E kD6jl(Qc%Mle(dNp,b(HrE2fJYB*RY4%Aj-!TS+K[l1"ChEE(i3$R95jc@5r"XeZ )@h"ck[G!&mrfliEY2KY[1HDN$*lG`6kQ"pAh!XB@2,Z"2Idem9'9YkRI@R#i#2% @2JI(&6cE5qcmZ[+!hdQIhABME2""PIFCk)1SjHZ4Ma0A[Q(p6X3F@1`FkrGbDJr hU`rS&4rr)RIXJiekURL,2pV0B`0llN(VYh5aQmH,Z@"(Z1SeV,[NF3XjRZ+rQJI 3SrdDf$'8iT!!I$H4*phDm!r[Nr,1kfHck6`Ueh+RcMH&"kIMiZXF&HZ*3r3QI3! q[XlkEH+!$ea'TE!#f11YXAlhF3i0EU9F6N2HNPr&TGI"!hi%,b5fj2F!F`"MeAF cHpV2Vh)P1BrrTJ5[K(k6r#Spe#a#[U0Fk[k1[[&aVYHlUFI3bq!3rH(M3DrEL@F UMUiVqT2i6DEfmehaEl"+r&lk%GLqCr0EpFpZIJ1i,1F4a@-f6q,923QELU2l!ci TIYAN*BqUAlQ,hdR%jKr3krm"!*!$#4S!!!%!N!0AHJ!!9RS!!!*kEf`l$3N*CR- ZF'&b583J25!UC'Pb1`d*#8jKE@9$Eh!50#i`)&0PE'BY4AKdFQ&MG'pbFJ)!N!0 "8&"-2j!%!!""8&"-2j!%)!$rN!3!N"+Xp[d9!*!'@I3*#3d*#5TfEf`J25"QFbj f8Q9Q6R9Y1`d*#5TNDA)J25"QFbj`BA**4$X0#3P1B@eP3fp`H5KQFbjZB@eP,'j KE@8T1`d*#3d*#5ThBA0'EfaNCA*"E'PKFb!p)'Pc4QpXC'9b1`d*#3d*#A*PG(9 bEL"bCA0eE(3l$3Pp$3N0#5Th!!!#L%&%3e)$!!-S$9d,iCE!0Qd2b6Z[IH9Ehp5 Ue9CEkEAkC*9FPqJ9+UeD(CpNDpA*@5)i3-Q)R'5k55HY1-"hcYF,r!1f#E,M5[U MC@C+a!jlH+aC@B3V[%icXLX@fR,DNr0`SMITBMNC8cDC6Z*'D,'pk"KZJpfp@@Y N0fce%Me#6X-#1je1j30JAcZ3!!lQ+MM%ppFL13@,l3`kNiq#Xra)29V1aZ2p8$e -6X$$l9JkMKI#GRp!ljGYH)IYT+em*paYXfN1h`AcrADp66EM8cD0CR)dR2%&qSc -`1RqK$iT8r%HQd[cZ"kHY4l823UZ0RLjRL2VFBIRp%(CJ[IC4YV%pd*IreFIPcl iY(@PE[`Sl'hl8'rq(IEcAE4D$X)KIUZ@bRMmhLE5"2iFIVC40*TrJM&HU6r)*&a MlDNGr`LGr#[p@MVJ5&qYUk3cVV@a0)lA34GE5X[i1hM(rpDrj$emhrr6A[)FrQm Id,[m$hcUYIUPI),If"+DaGp#2rZB2Z-'k1NVp3[TL1IC#r3+A`5[qX9kSEb-Jra '[88'i`hf%Ah)em-)[dU[PQ&iV8fKSA`Gh'3$D6KI!rhpCLf6!ILDAk+AbZYiZEe *Er%9F,kp5-rcZI#5Ak#Ab4Y4q[3RrF'2`GYqT6iN[q#[rV!q)VmK'T-`3"4Cj"V @eLC8PNBMkcLAbb96p2B`aCDaP&9&U@-[5hXk6QI5UA49HN(DD[*0fCDk4QmZA"b hC9*QKDeY8Bq9e54!3"2#XdXQSE`ZSEJ`S5P3&#J)Y)Ab`R#S$SIkd&B5D'e1lV3 f*HZ5PSJk56D-!bP*#TP!2[bb3,EL8QK,"6+"jSS2"5`IY[4X3MD3!)N6iRa#69) '!*!$,d&%3e)$!!"@$8X$RHJ'ApX&YA!,!-!YrkSA!!$3@iYDH!'Kj[m$@)8Habq AC[SF!*!'*lp"4%05!`!rmJp9$AC'!4!aiqGMIjYcMV()-TE9'U0IM"@MlZFhK%X 0M$Q(cV&kM"'6f&`D[K#b%A#b!`R2br85Na)aK#$0iD9FNLE'pSA*#4a,Z66Aaq2 4A%Sje-FeP%XTKkD%BiLe3#RJ!((Ipr[[lr[QCJkplE[hrI`('k5R+%%3*%%52*% "I!+Dpk1@k$81XCK2KMmBkh)ImdEZFT0$AjL%ESQ#Q[A"f+5lUd1X8%03`%TJXZ0 G8#P3K%U%iPa9heDKjeeZFCT8f%RNL[a%6Xl(Kq@H#NEkblD+H`kJd#!9&R6m19E #N!"@#`8L1LLBQkT*bA,EbTI8INfUkU#1afYrX(Z[U%d8m(MZKZ%5'MEBDhm3C0i JK)p5BU8akQ"S@![63Pml6kiTHVpAihr2j32Lf+fkG@ZlZ2qbbrfRcfYiFSC,bG5 Y8d[GbakZ`C*!PqQbISC,9cUh[kq,Qp3XJ@&0&dqqhqhq(hIamEjq6RGIeV6GIBq pj1,qPhCcdd[G20RajrS$`9R3X$UYkqliY"IALYEQ6KjA1h*[iHHed5N0*R[[V!i NhcQ&U81EjPqfE9TdZ9HB2YR2ihfK63fRECZq21eb,hd!JqT8iV&%8@1[1[8Q"(U mB&C#-Z4L!dNfeDUT$R9UF**EDh0$am8D%VjcI3Bl(HC)AEh(&bT[R-U`MaT@Jph SYKeETNk06r)iPN6GqD*Sf))1(1bLli`H9iDUf$lE2P[YrafP#h@UQh(Y)eAQU!L "dYE4-rA'5f-6,@jF-Qe%FM+L3VJ20NjCD2[LY!M#e4HMHX0pp*'1e"CVaQ'`l%a NBCU5(l-J1fM"hCpL`8$3JXIql3+aM&$4Hci))BmbK)3b8IXe[G)kX8DXmGE#9&M +5leI#B-maQ2H"K3Xh1,p5L*fe2eSD8VFMHJJ,'U-N9kHY$IM&A@14GXKc1b`Hlk a#dE#'"h5B*,%,2(+4)Bb"DC5Ha+[)UFl$+3fh58MPq2TKVX`,*Ffh(9Z5fmH6'* kV36NJGU[XHe(eBR)*"IjkhBV*CH*BS&Sc6Z#@4$*j$*aR`5JE-J6C6Ipj21m0$X JhJ(&3pi1JdT0KrXQ%UFk2KPJ`VB,"cZ,'"TZmZ(lPR9cGr$a4m0KCXk*TNYKFSp YHhhhRQ0,4l28MU&5Yd'*'I5aqTrc4RhL6FjhV[TCfdHr%IGq0&dXBm`2Mikc4%, +@0*N,QQb[)%-qeJ+-%*D`qVDc`fVFC523&LG+9bj#Y#X0$9Ui43UG*CT1*UeZ$- F$A'rYYPZ6BHdUY$*Y4Tq)8-aGJ&aY'VER[)M13EffUT"Na`H$cDX3T@*GS,X08Z "CB0,'qRUekSEZVA*YMhDbLkheN3,(9Yc&$4Q-14,NpdlLXR5TB0q3RQIrN+'IDR `b5[G0QfPm0'CPb*#")P`%e"+4ZV'kRakDTVYa6dZ0+%Prkm&#-&!I"N-DG'NMce bMIHiTM)8,Si3q[-$J5YPmE@i8MYGLDH6Jc$mLKi'SNEij!B')[YiVD9UbRj-DG0 1[I'i'*K'!T*0Y$1`(BE&`Z(N'&8F"N6`Z(-S%G,''V#KcX`0"D*)KeKq*2GM*E+ K9rK`Q(+8`"Df2d,Ej0`Af*!!0%-d""9Lh'Vi%L%'#LqX9cXFhmY4*SpAS4&M)`E +)JL)i2AD"&H4I)(XkdYI1mk(IPL!6"35#,a@i(MZe8,H"d,$!8*94Z-S*BVF#+$ U[H0)p#,f2X1rJ$J5[Le6M#a%jGIcYS$XYr,iXcbdKC(G3Q$fUGmKST5B)N(k2K) L(V39,*!!!15+8"J+5V)4'G%bL'$'UYdM6b%m8d5NaGX18lL%KTpj[R"peE$L++d DlUXDpMRmUH(c!4,V(899``%5BijNeA#!4"5Ek8#QP,C5hSp-d"F@e2PQ3jiX'qD ,qILjGK$!Liqdl4Ah)l"e`f'%dRF5Ri@14)kbKYZ6L9))T%24-2H,C441`DF(`TL d-03V[S2N*jXYf4TBBMN+BHf'I'!b,*l%0$(mH0L56,$k(DU3!0%X,G3*FKi3'3Y eLhfXH`X4!ZReSrjd*&f+T!hCc,b%e"8,AcdFFXZ($0qUr8TU),,5NA%NbL0eeYP pif-VZ+Af+erhKBa,h(,6B%rV$#2G(GkR$akADkj4Q'm00Aid1*MPE@CS`#dU)B% MfRKL9"rjGpSdTkGcXpSrh,rlMcbZ3rM#[Icq1h-I8)cYQeAAX)Z'ep,`RqlrHXB $1-bMIrd04*+P40V9dqmDI19Qe$XqG&b0fa&98hY#%r*H3eMH!pBbA*JI[-RpFS8 b1T3Rm[kM!mQ%Y5&2VR!f2iY`XlcRi"PZN[FVaKk`$i"Gl8q%j6)NSrj,XhdJBqq NL3M-`E#mAjV)3arTX,bhkVLF3)"Q&8-0mq8$GM@5ar@bA&L[jXQ(3&"f,lXrZr( NX(ji[V`A8mRi16V`ZHT#je%f'4HhTG#pThGPRPacLF[,-F@Ke"3e6fSZePkQT*Q )jMk&N!#XP$c*9`MCd*!!NY(FBc"5`c`)0GZbPa)STi*0K@%EQaHR`18J"F$U,1q Yj3MD%YV'R(d4&`*2fha'CjJYeSN)I&NDf2,@l5jAeR+@H"9KLbGad1mj6#'p21q J5clY"[$8i&X!3R0,fekj"JKd!S9(@(+I*hpLKb#T0"ZfJ$8A@EI)qi2-FF0mq33 Y*mEFMk('RY#0'lB!kHb'e835a#CUrkSC*p5Vr@S`UrBd8kSQ*MV!R-X#[jbIa-F rq)kM35QQJ1l3fGXFE'MQRilk2V6I&$iL03Xrc,ZJ@LN`j25icj!!bJ0NAS6NcUS ZiRiS'4Ui"85MIXkG-2A'r(-JVXF`e(Kp50pIaZ11q*`5CGjfZVBkYU,V0#P2&!l f&6Rp!2AbB,,f0!AS@`m%+3FHk9KM`V(bq$K,[19Y8R*mQTRf&l&-h)"AXcJ23h% 44bUHTLc,$!N3mk"dH+9&FD"l+eZLJZdL%TK1PX#%m4QR")BP+pP1[d08aX!XN!# IcdLUM'3m-9pX##,C(#VijlEGCm@5N!"02#V'S#l24!EH54Rpr$2f2+",#EE3Md) P3UlImhS-pb&6MR6hT(@f5lHIS!j#*pT%m9"#YpRSp@#k'`"YP%hHb5l9I4$0QTK !Pj'3!)4e&50"baHc$IHaaF@%Q!k6pbNb,80KjjCZTXUr4U!m9rM-HIU%`m8%a') N&46J&&Y5)!QUD!Kr`R!bj[@`j8m4HI`$&F@j#9e@dZY*63k`XL&FhA#3!),AR"2 qFB$`q6m4N!#C3B$-C@3`P0`D!%)!d(RqL8)"%!+`DYKfr[QdV["5(SNX-6VXK#k q)m8!FQMk)-lNPeE394+kTlmPG@)5NcmeVI!aPF%%RjBQRj9"M)H%$fRc#p0C%)$ c,BQfLL-m0j6l[0Y@2HE0mmVN$##+kRMZYPTVED+f"HVPIr&1j+l*A@1`-j%'dir 8*9YIc"0r8Gj)+1%mVkSBVKLTbh)JJdD"L"EaGdi@,RGBAY5A[dX(k-blG8jLmff AEGC)AH[bK'iVhk![hi@I-P+(b[FDE18l0a6`52QqNESM2Q6hJS!5YF'QM4fZJ!U Q(LkMB6M$',[e'r6DT-'QM6#Q,'a@5$X'pBf!G!cU*TYVIiGX3pY4+!hjDhm(Yje EdQHdpRFrq&Yh&TCj62U5%V[TQL9!''Lm#kTIc'(XdQZ0KXAP0EiXTj@TD3R@$&Z "2&Tlj-dDEM%C(5Di5m#4JlF,kKUIj*b5#--@8ZSTF8MVB&Q!FKTe)V'49$Va"T* mZ&)B`Z,AKY$KbLk%BEE'S'lD$PH3!-*jZ%bViVU4&p(%D6I$D(!%kZBK8MVAjIV d!aP1AUT9EFHmEpUd8AkGLQd9@jB3f$L@9SH(3'G+TQN38kmVp1QRD0%l)h9KE'f XPCC%ER,,PKCR+j3i*hjZN[VVYXN3K*i+Al-J'B9"q4TR`rPEBaLZMj!!NPmjNI' m!9F*D5ZK*$r8Z!cCl,F1IfiBcE%IcN@f6@iFma`NKG8qr85'diUK%@QSJSEXrQp L-5ArCkGke%'Gb8)L0E'3!"Jp2%mJ$M-E('YH(Mr4YJ#,#Z11F4L9jlbS"cKj0)f f%Nh"`SQ-)%+F#1hHFeJ@&"pe+LHFJ-&"-(3Np@)2`NF($KE`E@5@`Bq4b#!,fJl )K2DeCEl3!GNCTd-rA!Qe,FpY1h`%2hX(3j[3J+[c-29#A!I*r(!%Qh6N-,Nq[8r $)h8[9!0ajM#4!8Z#d60L-h4V%fKZ-qdH*X4K'hqp8jJ'`KJNi0Ym68JElS5iN!$ 2frhNR)1IDA$QmU@,e*!!20#i@*jUI1`X'8`AFpqd%J`U',``Y`4ESXS@Cc-fe8" Eh6`'iHFc#'0*fHHX'f4UAR-FJr0pa8Kd6bqmH'ZYkMrj"`5YLN$-N!$Q`P%QFe, ('K!fr9Mmkli!S*DhI,h1YqLkkG$K)i1K`h$kDVh'",@i8fhDmFZEK+ba3e)hYic 4J3P#P#1CSa#`X6N#@PT-,(X$aCXI6d2TH0S4AVcaHZh`50hQkHN3LNqKDcU&BA! NR$IkN!"KS#)XmIADNiD3!&P@M-,'%1UU,a2!CRNL!iX+KR&3Xh"3XdT#EH)RdQ& jQS*U,#-3P625SH(i)f90@9km,&eMY'R(NB[XNM'Kfak9%'HE`p')F!pY%'XqJTE %YT'5#H6l"0HX(#!aG46Al-6R!XU5'flbkpSSblJir+j1GY8)3jUl)h9l)aFb)+! %LE5P6*!!JQ1$XG8BcB)"*KTTKhKAk&cMbcUe$80qChXNbE2XSc$**,P&BMMMp2M DZH98$-0qER(5F"B+ULpNVT%QK!PhMqj#"LAEKbYIe*YV*$2,Rf2,#!"I[ZR1UH' %MTrm[Q[BMF+(UedrAf+2NBNk-ClHQRYb%!DpN9I95p6JFFZ`@dQ@VYX-MdKma[E TcqS0!amY%@ZfVB!4-0mdrj8#8BBE&4PiYYS02TMPmP3-LYc%TNUm3SkPq0JmI'B )(bCZ8PS0cl!P*M$(l&%-qc'F4+%84T0RZ$r5adf@G&imeQG*pqMAkAN@)pBFlH2 qcF2fj$SL'ShN$iUQ1eH&ckfa2Y-Bh%6rfcBGpcHSprd($2&YVl6aZ+r2p2Y6pGB qbdEFB8F%aM"R()$2AAF64rId+rQQ''rfjCGUEGfBZKR,G3El4eLZI[TQIRb!ecZ L1BTck-fEI$hhj'3j-eqibGrLL4F+qRY@IBHh1LcS6VjbNhYB+15+ZQViq)9205[ +,Skm5eZY-QI$eDid1ARah-AIGrhXchB)+ccb`@*bpKc19NCKBPq6d*9p0)cKHDI Y5GpTZeA4lUlQkUmDBI`RYK)$JZNm0[+NHK`CT"(X2FVHfdqF1irf5E%ppra0&'k GrkrREk13!1diG`N44Ik*dr'ULX*lrh4,T8,&UDZh8,"N2[Gbi5N8$$BE-9KZRA[ 14SAX3T5S`+8r)-iM`pKLKcrb$(m9,X$@b$0)mD*1IipH5FEk)Mqr8)+-S+!4Ka- LL[HL!@"EKJmI0Y&[5G[lT%eEVhjk&1EjBeX5h`Ul)rVaHVXRSKqXYmI`kS2j86r H"mGD##HB0Zi!1MK+#@e"LJXERGHDd0&4$V'Mr*I5e5kKX9L3!1e-BJPANM3!Gd3 ZcaD3!)&lKYh@HMZACmhM6Zh[rd10SR-H3qCNPVmSZK@K))BHRLES%5AdL%hb,," I&&$4jU'V4Ai@`Bcf#&kP0[pC[3#JV!3$jXd!B(f@k)*XHjbF&VR(Qk'1JfhY6`i ")FY&KLq43h'XhUf2rG#(%)bp'DqNhImMR4,,e5N4iI0Y(3*%ZMM!'3GDU-I*r@@ N%FV*E+!Y%!D1SA!YiR&#Q+N-eV9-rI3&U0EFbKJmZ4q$SARN5D"V"S%63qM*kFr j@$'pr6%5am#3!"&$aU#KT#-V4e(mMUbhP5D-F6$'Q`a&-"5K)8T++*3%%A%[%2M 6N8BFaMJ3)fQkidcQ2KJ'%cPjKe2-%l82i5$m`pP)LU,K$b9Re%qCZ[!8#@beZFJ @%F2VkVKp''lT%iPk"$5MGXmmr98%CFqffC1aqRHA+GTBV%HI'djP'aa$5cS,!NC -I2c"$&,((C`F5N8MM1iJ#!&X(h2(K)#"d+BaM2!j,4D1pkklYhrUhNml5%N8@d) N&MjqN!$F4ID&5(#T#5BT0a`mcUh5iMJY2KYBA*c1`N+2q!i@@X@&M04TU*1jca+ j$eMJ-SH4+jE)[F-!M!,!p`"B23"l4#)H)q+I6[52p,L#L"XCm4JM(K')`qM8P1K E!P'SJ'qVIa(q3G`64,ajT2%"ZV4VeBMV8q(D%[Pp),HI!GVN)-f2-k)a!,U,$T3 18MV3#SRiNL$LS(eIGaAa#R)#V!qc`%3F"XCQ'&@XNAbdI@rCeP-@qm!&dE@#13* R#Sl!05X3EUeSq0"ZI$"MN!!C!mIphN`F[4%+F#-6E(F&ZJ4AGlP%-qk-B$K-Rc@ c0H034U*`r[eI8%`qH6#$`XYJ28)"$&`*$-iVM2f)&0Bi))5[j+2S8S3&0!@Bbc# 8q@#''XPpN!$#e)0mh&qlp1"a!U,f(c6M$K-F%Jii2G)LFQB2XdRQpBdVXF!``1V T!eK1NmErjYrL%-R&AGc)A"CR"Y$aT,$Yr@GGUcVkHcXHl1I-p0qRdd9QU%Rh-JT Z9Jp2ZNR*RMMra-ZN[0EQKXG(1kj`YAGS)YqL&2VmpQM-kLkTd#[q@+Dlj2D1jGc R[fpTYppA#TAL$GfS#V(M-[Im5@"4`T&5[Q2lE$-#E&((TXC5'S!,RU[`6PG(GGq UACBf&(453EpU&ip"K0aFh8fL9+PBlF+`6qSHN3Sp%Y[6eIF5ffDaHJ$$&k4Z45V FNYLDUfm5fcUaqJb'mk6ZFe,KGY@89k3T#c"F)R9IP!VCM1@'a(+(QC!!"&0p&Sb Vj1`GSDDjjh8Nekr$058kV,I#FELRPlS`''[S,Cb"KMiD&*UaEE`MK)XqcJi%(5L ,D')8K(0DQG)-pCRI%04RT4iG1j`80SY')Clb)JTP34aI,T!!K8%BM0lcETYjP[I lJb%%Q'SDEHBjU*!!mHqDN!"jfRXfmdbB'M#apmE+ii@Gp'(Hllhah['JiH6Cd-B lbPjdPG%J%X6-L3c@I4(6`-(!dS2"p`'@MKe"039Zl5`X[ZL(%($,&N%FUdjk[mh #P$RiD2CqQc%P'C-a&EUV!RBk!lD&!6ZEJ2ACc!XZ654XjRRTU#$@E'UKJ[FL#qa 3#"-+qkCUB4#-#kSBIp5%dF3BC`Q$!$P*Nd2GjX,N[XAQKCF+ZQcQcmUAi,@m[!A (Y!6(Y$5b'+%2MZj%SKI%mbeBBUk$S28@%pd-l9`DA#J-3Ya"SCdVQE4!BJBEXD3 k%k(bkBdZ'%YQNqX!1F`-3!cJbl"a$"bfb4r$K,)%2p-hf-b9j5eil4-@H,m2BLY C85XJ#aaJSZrLmR5T(Kb@-)b!B"4J93@5Q""`6qf+VZ2QP8$L([0RH'de,m9,-5r I8'!aQCIJ)f5HMYHRjKDm$TTRSi1E'r'K0mpL(62a'M(2B4h69*YjTF28H(*5MbS 6bC1&h,4"Epkh$8,)*e-EfXb9kb'XRi"c`!Qpql2(),*[-*42aq"m$#ikdFB'NdN $0k*M550G&SFb#eIEd&EH`P"PQ)4AZLc3BbrE5*i+lLrUlcUqmEUL"V%FDFT5Zij BK%-e!*N01"cm,$!X0YIKCq&JU(bRpbjHqlcAT9"ChE2Cl2L0`L&54RdAl05TdQB 'MTB0JXa4bQiNk[PZ`[4#KM'$3fa!"rYBik0LR"LkEQkCCMk+c6Y+VM4NmV'6dGF BaP#A69i$aU4$l0+EMkTC,)-4!&8Lj1ip-ZpDTD8%bJ*cN!#$c%%%L(BXB"5b$*! !q-h)5X&N3[&V[$dNDdJ-&qF,dbDbP'faN!"X1G8+HrS,GZXCB`mr&32E'M$0IPb [c!*,6"+I66fpe+@X&"&K5b'-S+#UZS[Uih3U6Cj5-Mb4FQV8NB!SX")+P[Ur !iKX&FLJDZ*-NJj`&KU0G5,b-U#,6aD1Q%R)D1"G'&B%i-piXJFT[TF9`1NMDNk0 ReFh1P55`eJZ11%H`aDqLZY&Lmi&E-F1@3Gh$6e)6AIY2[R&lM$SGHBdIiN!2T$) m,F)90F5m854Q)0Pb(0JB(9K#RdCie+YJHC`kiIUE2j!!N8UNf-ATD(8q#[V5jQk $)H'Y"$N,5)P1H5*PEUN+lMmf8[H,*B)CJE+T41i,#TKUT0!e"50(kM)253I13Kq EbJD3!06+f04IPl&0XkB-416NCRE#%4JQKZT-r#cVkS#"#N(R,TF8d)i5-SJG$"Q D,Jc$0(88`D2N)+T@aGr[+TKilYc,fPKA`GP98bm!S9)NR[E"2%8U+Z6&*C,4dU6 Gr'qQLY08mVke)5e$#CQ-`$1!c"GN"ej6mXZ'qk`KqDEli8'Ul"#5E9)K,48+T3) IY+6!-Ph!346*&-Vbf'%fP8IPPjR4**k18"JrqID&$!6`*C-+NY*T$6EjPPeP6*Q 8c$9eVCKl"FGj,i5CZQSVVM@!+af5c%flYRme`65lp5db"FP*ZP`J'`VC$aR2+Q@ mERCaLh4aK9em3(jCJa!X,[C-eG925B@`9$JM&5b"UeZZXUYEF29kG[91q@8!Ib( iqNAHl9cIqH1[rim&)h8("ZMkQi`-KHY6drhL-Ph32-T-CCc2&G"YlYbe2(a$B)R H0YP%@IE"K'4QaV*Y+-VfGPqrIC+51&PM9`'Q4TZ*E$6,RQQbbFJR5G[2GQTEf5Y 653U$'fbb6eX2CJ13!-dQZi"U0VP$fiIAK&BA3$Yf!$kl"J6Rf$YTBZI3`9j82(# *+j!!*CG4eSJi`iZC`Pf(Mp1Np#V0U8[Y(#0!!@$%&j+(cM!hM*`fU-JlUi*R-J) B5El1(Yd!JD@m8['MLC@U1U(D+"b!+$YHXd5-I2ajIrd+2SkTGY,%QrI#I(kekR0 R*-aI&(I#F*k%N4a&9VeKjl-VH*Jre)-LUf##*!9,CX"i5L'fIa5BGQ[j3k`i)bF Fk5epp"*9JQbRJAHT+J008H8fNM`UQ5+,dk4BlF686R+-LT8%9dBCTdT59BN*a,S l!SUEMK#`jHrKjdJ)4bkHa'Y#2#&Xl%&XLhJDVfla-MTFiN*m1-9jH0d5&`J)-D2 &`hfP-2"(fCDl8S'ICr9LKUr8RSNX0HT-iY9TE`D486LN!h(&q3VX3B3Z6Mr!b@! Ej#H"9ET1`#!r`V*HGb"4)9-bQFd&jjrUBX'JE"V&G*e-Q5XL8NNZ12"dSH+*YYZ (+c-8C4R$%Fp4N!#m1H(ZU6@%4&N6NK-!5b0H&`c*-(XhrVL'&35[DmH%jMA3X&C cbDbG#d*Va1[5iD!CKQQLl[!dAbr#0dQ3!(p"YV#'&Dl-V'P9cm#XKXD9@iaRHmQ F,B![qi4XCh%(VP38EJpTTqJB!-4*C)immB4@Y`&1qpSa[%jVkhfi$$Zq*,Ij13C +l4'`,8+Q3M8FV4((N!!")b%GHj38#FU!k&U)$)S$#Kb1$aR)ILXG%V9)jPBLJ*) 0XEhi2lI!H,e0YBRDiBjI03*Gka`ap5pNd%hmK@@qX,J#BLLbh82A#)`H,),!"'F *XEJ"cLqfT3,*U0D`@$MiJ3a-9@drFl"Eb-*JU"BbEK3C4qNjfrX'!hNpMQ!XB,3 [KcTbE&rJf'UH9*28P)9,!S-(&J!B)@RMFR[!P#iH*4@L+Pb(N!$q50e[@aRk0GZ Mj'3#B`#3!*-E!k)c*3qNVUcD`kpSG+89bM"6*&G6dM*cfUJqr,RhI2J'Z4M@rKk Z"(rSkCh+U(+FcI+1qcjdcJjbcMa%$RF`9V$Q3c2*Vb1TQ8Z"369dl-XZrE%[m,0 LJfYMYX'fXG9JUmj"H1N+IMLDT8r`8lmY9$l$e#EZX-GJPDhfYr'R%GVHMm4kEfG )GU#`-[)BjrFFX%8RG9436*0&%,)3L$!0851@KU0$1R5X!8h,LXXA"@CFe@U,MNS ,4V&J)j))bb%JiKNimY'#"4LiFIN2)hADph`ADF'P#ck!P9FYC%RY)CBCh$39$"a qDBT'harSF#mP`(b&-D2Ke5jKc+dd$CK,*I)r)PCKdd50!$)H2##!FJDSdCN18G- A[3+8(+2%X%Qc9ScYZ*d+B@h!SCC2DqS8@-U4)$RbS%cMN!"+)-$KXV+M-+R5X6& Mm$d(`P``3%&B*b4mKT!!N!$#V&fpD*`QY$%KmiG$f[VfV'q$(&#[UTV)50fK'Yr G2%r%*[j&LbUC`X'8cjh+`*60T'JI@iiNrdF$'D5XmQ@TTJFErdA$iQ-Vk%#1)6X Fqa+&,mM4M5&QK+QA%D$,&cf,Mhe"TS)Q6S"@##20$A5e1"9rMb*3'+qAb%@[(Lk #%8-KEiFEB$-pm!$'A,Kdr3J"Y%-MkABq",!5!![9D!29q1N3I$Gj,%p,46K1)jZ 8'`11iD`jY$*MBBf[%)c9QRBHSkQ%#GK$&)CH+N#9arDAb%@`(P1@![RQ5YN16GK -V`D"VN-V@D0998NH6IblpMK0kmL%fCK9pFLTFLH%JY@-CS(%Qk6JeTS+[C)VbSp RBikBriD4A#E`F)US[CiF'[*H,5aN,Z-!6h!#dB`(h'5C'8GJ(`-lBb,h#c)(1U8 VL9pUq%"'X'XY1mL66PBC(qBm90Hh5`fP4(Bq((Zdq+Pfk+K#*BS,m92'R$fd31S qE`DF+`U%!DT-LF'eE("ZC$kjlSLI1@G&jM1hRqA1*A!5LpKeM(d[@,r,@0Z&!BQ %L)k$V)-D"Y(1(R4J1!RA"J6aP'E*r+Tp!BBBlKFH+'*1+8NcbE(f'JH)j%Uq#`e @(6QPS%$KFP59P"F*lL4b$VNDNT-+'BFB'K[46)i+3r,q9Zj,3RL*UNphjQreGh, D!-Ij2*8pB!3L)j&2EB,6PA)h`HY9"lPel+Tb8jSVZ#Q"6C9!ZTFf`@NP9c6DPT3 ,%0XScYmK9b!NPbHfj`L8qceQbUfXQYV*MQjZP6Y5TH$ZJki1iH,Q#MDG4Q#Nbc- (-B3pK5BLjH4$KPlKD-`,fC+)F'"Q,hdbB$Tp#01S4ArrQS'B&0b0T%@251aAT'R 2#CFeRi%lmPkqNicNJXU(V6R0R+,)l63ARcNS[)e'ZjL#-*,,f0X`3cB2!pA34,m IP"NX%(6L3VBK!5MPPN0,i3J6F("1`T8QU54lHTAC$Tj#GMP1e345&9LZm3)%!aZ q4*8!M`HSm0dTMXI)E0%M@0[&a)S'Z!R'hB@FUKG4*LL%+f%Fj[Tc)CJ$a*-(Tm6 E!,d!S#Z8C6AFe`[hNRcQ%RI0EN`4h3+95#*k!@5QiHGa,0iABX&@XB+4U`'C&JU l%KRRHVJp'C(`Q@Kk(16%50hqDXdiN33j9#Ak,Ki9Jkj62!9Jmd3'Ueba,0KP1RA 9dEP0rNqNR*mGr)0K04T)"R+IHS0,0!i*lV9*5P+J20p4ZJ8AkmT)H"aC`)9(R-$ pSjeIFFfiUaE"fA4)J`F$)I4!4TTkaN*'3d2ML@'pJe8PJ!0-9X#P'C@,9J[*dVr @898DYS6F38'f+RN#XX,4&5#NT3S3+A-)!l12h-+TfJ-fl*h*l`ceYUjc&b[eQ8E hBjGG[[km0EjqCj`HL0+!#N#h*JGZV,aaGCqLCPS&"PXV'+b*6S(K,+Y3iG2R*Ep jr4[6RjMa[eZHMlBE*cmC+PDmhjMZp!pmVUaTAcH+!69qm[0+226KQ`prFVd5MmH i&%[(@B@5-lePc1'c1Cd&4e#UG$!3MNpNU&NR2rpQb98Z2JQ6qmlYEC*UR2c9k,+ Uelq2PJ5lU,0!'Djj9Rq1UhpAr`l9YTSk"r&3'ULQb(JNU%A[3&L@QVmX5Zch96A E3*)$DjXfd%!e`C5`6jG9iA)QVd5RSi,H&@lUj9R*AJ6ik[b'39f-*TK*9@8d+pK NU&3ZjKPX)J`3BUA2aC4kPm2kpq@VpP520YkBe+H0JcT,Ql!-XYfAh%m$8-jRZQr UbHeX#!ea""e48YQ)B04+"K0P#X,[8'"a8I8`&ZhqSjkj'q#&cj``((r8)+BjQKA "a)Z@%d!T`N9IN!$aJ-H$8Bl#5E5!+Y$4Bk"'m3%EFL,iU!l(QKk9HjNe*1lj9fm *VJc"V()#eirBH,fiblCNE8MFEqVI)G+M&S#SR`rT8D89#"ATjj%mDap-@'*P@5i Yq`V,P!%D1"ICaiEm0LJRZpCDKi[FIhrdJ9Q,aCfME3T9NZ(LSh$#4q8e0'fS'VH @UdAZCBpQ0a+,RNMX+b%#C`Q3!,0S)&[keN@k88Pq9%hf&)1Y!T@8,dD+bDR5&LH P,RQS!)NiA4DZ"bj*`(i,9CjVX&"c5j2``af0hkYI3iqb@"&m'&Vr6hmB4-cCZSD 1C(HTb+iDVlTU(0I[")[H+B"d&5,NY$@kHm6P0R%rBpj4aEa$h*AFcGZDEN[jPIr [E9NX6[XrfjLKi)hTC"[6fA4MKYki-6eXBkaA1#TkAh@)MGdDIXAbDe[65aekqkH rP2V2MApVr&YL8Vkf$%GfR8fiP`(m)GKkqK2p+l),Qbql%[f6c*hfG,D5a%IbG(C LGbFEZTaGGr'5[kii$bjh24F&4%QK$!*p*i04a[mCS8cN)KXbjI1cZjh6&@k1NaJ V9Z#kILSJG,*lEVCa,VUV&9kcLbh&idCD$b"4HP)`S*0a3Lk!)D1!URJqQMfT9cb M(ErG)qidR-*MTC!!m+jC)BSp[4-h)VeCIPYPbN3ZK(l*+-3U58H%"f&XfN80pa@ Hcrrk'b5dlXH,eBjhIq1*ZIm`p*hre&+hffjF@aVT&d@R(pPk&"ArL`SX$mhhp9r +(-5@$4E4BlRiF,K%DNa1N!$`dY-pm2NA5)5IQ"IX8ZrJ3f"Ufb1rBc992'*UicX D%kMY*(hm8Ip6I"VBCmP2qM3CK+)D9#9T"f[D*R&aQ0STN!!DbCXXX2`k$a8G2)P q((mf*6H6qVljh2V$AQkDiBVdalJ0CLPHTr1EA$[%6VmMXR0arU&Tl+%DpfH[1KB e#89+TXK)D)q4NC!!YUE(*KHX[kXi09EPDV5)FhYBf#`NP6[a'!Lrm,RU506[Fk& jKfY53PV@9k,K5RX6GP-9ZfPll&89cYmA'#RlU2S%,S,M2a*Fe4M9ijLD0QQ6me( T$Jri#mim[cbcrFccm1+UM"0$aQQKM%,KQ4dL5`VQMZVleYhQ(UTbM+lp,![p&3Z fq@'Q')qdmD+VR"rGA@eC2kYYeLpMI14GHMJ!&YmBeIHi2(Mi#+m-$*d9KQB&KU# QNI#q6%S`QP-2#VVrJ4m@#`mZN!!BLjXQ'9Kd)cpV#6,h9$F$MAAG4ee[)"*8BEq +Q$+52dL,NpfScS2PZpMb(rbdbf1"6iHPdHmT)8@UTlHZpbUA[lJQ2AVXrZbAlNC 0E2J)QI5&6&4c,kUk(K!H##"Abh2N#M%LkX8#SEUl`Klq"A6B)hp*kX&J9J`"9RI *)%mE"GA&('1CX"G)rVdRCU8UUV-+VAh#eU0bPT'bprm%SP2P#50c54MiI#9Pf[e TUZ`LLEFETb2a+4%$&D@4h5Y23%'-GYR%LZTjAEh9#j%JUG8V0pJfCPF[-LbZIUp Y6r8R9B)rJYj8A@"T!`(PJf',c%(915"6*i3RBI$+&J3+CY$aerlhVZ0i"*!!6Gb ,kSeiT@2HMdCHp8k-[!S!!!*#!*!$#J#3!h)!N!4#H!T+RFj1ZJ!d6VS!*%*R5(N !!2rr5'm!"%KA5(J!!5)krpC1Y4!!)'d!E%k3!+Rd)MVrbQF%6V83!%je@Bm[2&T &8Np#CkQJ*&GCMbmm4%&838*RUD!J9b"3)RJ*##45B!ibf'B+-KTJ!N)C8FRrr,[ *CZkTSkQM@Bm[2%4548a#CkQJ)&HJ*5"3iN!N$@!'-KM9Y4!!8FMrq+QM6R8JAc) B0"L`@&I*rrT+3QIq6[!Jr#"I-KJd',#B9mRrqNT#Crj1m#$k)&mb'$3BX%*Z#T! !3@d'd%""m!!#-""RrNl`!!!J,`!%,d%!"#)[!!J[A`!%51Fm!#3!*J&)3X6$+!! U!8K&b-A84%K#N!2!`G##60m!2#)I6R8J,`!%,d%!"#)[!!J[A`!%51Fa!%kk!*a -h`#-)Kp1G5![!!3[33!%)Lm!##pI!!4)jc%!6VS!I#!"60m!M#)I6R8J,`!%,d% !"#)[!!J[A`!%51Fa!%kk!#a-h`#-)Kp1G5![!!3[33!%)Lm!##pI!!4)jc%!6VS !$#!"60m!M#)I6R9+J'SF5S&U$%5!4)&1ZJ!J4)&1G85!6VS!&N5!4)&1G8U"DJT %J8kk!!C%J%je,M`!!2rrXS"M"L)!F!"1GE#(BJb!`8K!-J"#3%K!6R@bKf)D,J" #3%K!J-&)3%K(2J")4il"-!G)4c)(6R8N!#B"iSMLLE+(B[L!`F#(-J2#`#i$5%I 1`%K(dSGP#*+#BJ4%J8je8d"Jj%je!*!$A!#3!i!!!!aB!*!$B!#3!b!!!$mm!!1 Tm%&%3e)$!!"B$9-$R1S'YiZ&ElRP&ZjU#kJ&,-#Y&VE`,r!YGe&Vp9i!!4lq2r+ 65hNQLaM%"%SP-R')#kJ$EAISXa!"!*!$#PM!!!`!N!--!*!&I!!"!*!&D3"M!(d !R`3#6dX!N!Fp!'!!miKF9'KPFQ8JDA-JEQpd)'9ZEh9RD#"bEfpY)'pZ)0*H-0- JG'mJBfpZG'PZG@8J9@j6G(9QCQPZCbiJ)%&Z)'&NC'PdD@pZB@`JAM%JBRPdCA- JBA*P)'jPC@4PC#i!N!05!!%!N!9Y!'B!J3#L"!*25`#3"33!5!"R!31)-P0[FR* j,#"LGA3JB5"NDA0V)(*PE'&dC@3JCA*bEh)J+&i`+5"SBA-JEf0MGA*bC@3Z!*! $6!!#!*!&-3"R!%8!V33%8A9TG!#3"3S!8!!F!4#)'P9Z8h4eCQCTEQFJGf&c)(0 eBf0PFh0QG@`K!*!&#!!1!#J!,U!#!!%!N!0q!!%!N!96!(-!C`#["!*25`#3"33 !53"&!5k)A8&Z)'PdC@dJGf&c)'0[EA"bCA0cC@3JGfPdD#"K)'ePG'K[C#"dD'& d)(4SDA-JGQ9bFfP[EL"[CL"dD'8JFf9XCLePH(4bB@0dEh)JC'pPFb"ZEh3JD'& ZC'aP,J#3"&S!!3#3"9d!F!"a!+`%!Np,!*!(5J"9!41)1P0[FR*j,L!J5@jcG'& XE'&dD@pZ)'0KEL"[EQaj)'*P)("PFQC[FQePC#"[EL")4P-JGQpXG@ePFbi!N!0 Z!!%!N!9S!(S!I!#f"!*25`#3"dJ!AJ%PL%j6EfeP)'PdC@ec)(GPFQ8JFfYTF(" PC#"LC@0KGA0P)(4SCANJBA*P)'j[G#"cGA"`Eh*dC@3JBRNJG'KTFb"cC@aQ,@9 iG(*KBh4[FLi!N!0D!!%!N!9G!(!!F3#X"!*25`#3"dS!93%6L$T8D'8JCQPXC5$ 5AM$6)'eKH5"LC5"NB@eKCf9N,L!J8'aPBA0P)(9cC5"TG#"hDA4S)'0KGA4TEfi Z!*!$+!!"!*!&c!#1!1!!dJ3)3fpZG'PZG@8!N!8%!!3!``&L`!)$k!#3!``!+!! S!,B"(!3"998!N!--!#!!#!#L!4`!JP99!*!$$!"L!*)!m!'B!)9993#3!``!+!! S!(8"2!#(998!N!--!%B!TJ#k!GB!KP99!*!$$!!J!!J!SJ%F!)"993#3!``!+!! S!+i"6J#e998!N!-2!!)%)'pQ)!FJDA4PEA-Z!*!$-33!J!#3!`-d,M!Q0#i`,#! !U5!a16N`,6Nf,#""E'&NC'PZ)&0jFh4PEA-X)%PZBbi!N!-D"!#!!*!$!c3Z-!p 6G(9QCNPd)&0&35!d,M!!N!--#e9Z8h4eCQBJBA-k!*!$#!FJCQpXC'9b!!!%-d& %3e)$!!Ch$9803b)5%HCHEK"N,4P%D[*%*!X3@DZQ*LHh2BZ-i(ERb%Qh-e2bQAp h[qrELM`EhmbhY8#5eFlXbH4*f,ilNa'5j9ENLDc)laq42j1IbEcCeRB454B6XMF Yb5)S31)(rdjCKT&84$LS#cYiiLGf)5c5J1e3aD%@GK*H(mq1D3bR6lpC+R)6)mR Y[@4[%r6@hmf'R%[)+8FIZEr5&V,ejRAjaL3*5bPTf0kN&a@6NPGC,a$mi-RK`KF HI%V$*QM4BN6+hFfqTX2b,*5j55k)jb(*(2h&i)XDJqim&Fee*9$cG*JIMZ6*i#S GjViNe#Xq)@+3!*h[`af,NK")heX@$ED[(5XhPA-`LA1fRcbNbSE0RBqrZ,m'l)Y Vm[NQUD!A@)"Ck2@aqNDT+'b%UlJKdF4%D4j'8D8QKLJRXm5(8JQR40@4X8N6+L, JmB-'82KL!,85ECR3J#8d%@TbLdfC`eLTT"qR$+aeU)[Di0J#T6DMFe4B`aLflrd NJ-)Z!m3jBTLiESAmcl%RFHbLl9fAJNh,JDRU`pD$+ZFdM(GdeX@!G"Z$#pDfYBX aSNc2)HBbh"2bA1lEQ20L2d(0f,[Q&#I)A'ZQ2(KBb@@qIDUNT-rSkShVZbh3b(2 j4EE#Hi"%aD`5%YXK48JPi!JpjfESS#*')G-lpU&Zma9#N6ZP%AF+hP-PhjBJ16h DlDNc*qDmR%1jlK@TB-cEfPh+FK[jplG1#3aZ,GrmP`rLNbG@J3Mpl)N"@`NmD#E 1Ye,'NV,SJ&0-'N"4lGDH(L15jV)kGQArf*KLjXEBBNT+ilSFVqIQ2L6S6,2!-qd r5A,SM5rZ8%e+qrrFIEa)TAK+(ePf3"KU9mH96KeiJM&J8-CCH2(UplHlTpQ8&pI V!mfS&!eYS22Y"H59K,,GX(5'$iDUN!!D1!1%4[Dm+R'd+EK+q$Ll6eBP[SHY1Jm &+*f0f9@c1LPl$U`!LB0EA#,N"l-#h9`&eEjM4RfXIVf`GZf$Y!rlJeGII3NEUUX [JA!5-Xp,Z*!!K9k#PFalib#6LH[)jR!53fYB8Y@+#cA4e!fZkRA5eL(bC5reTB0 Nq+`1N!#ULm1*SfpKL@KA(V8&MK(J'6fDpK)ZJ-$X$'lTUd'pQXb1L-Hl60lqhlJ 2YkIbbBfVNkBAI5lbXT26-1CCQI@i%dADZX@J'V("P$45$f-VG@mlh@!+D@pipZK GMr,CUC9ZcXXMqF'dI'XXGU%XA8IkajQ+#fPh$2Aj@FVRjqVrINKT#[0r9hl1a'B ar[EhjGLF9@FZ6fPZ&[UQ90aX9RVbi))fT0[hNY60m9Pip++5qIc2PqqBK`c8pE9 GaLXRlhFHm(""&mY9YB2CTqfiUkZ$G385RX(1bd[ERX3qk'4JZaVPpDGj!R%'T[" 3[!PH+Gc$PhJ`"hHqIVA3@F0Eeq31!!!",d&%3e)$!!&Z$98,Sa,3(`,[MX0G"i1 VS')4Q(4+"CeP@S'Clmb(SM82Ip(I(*K(D4A2I'$q&[0K9K8c&"2&r$@V5EkTU*K 9439&phSP6c(*!"1aC5A+J0LHE33'eM"R5Q-Af($455FbMP!J*%5L5"VfFJe#ABT bVcRA4B@a96dp+RHhD`rFF&F@))QYk$RCaCMM3iY@r'%I9"NNRi3H&+6Nb+Ekq,R [CKIQhmVFF$J`VdQ5m'YemhE`p&D5E6j5(VmrPl$l$k3rXTPHl)!0@&jc$0ZABIP &mp&"JI!#DaENdTMml81I`#icTcGeq@6Upd1K&[m+1ImYiqD1UMI2ikh!"rA+h@G FD3IbmLC@e9$jp9!k6JUl9a2!KP1+'B$U)Bc230$[U!%J"*%91SCK"!!!#4G"4%0 5!`!1K3jG#k55),ibhjhrq-jHjTcIRm3X@FlH1F3CSh%X80,b[R0QLXqEJ*aX40@ UcFUD#%5Rl(e8JllrGqBa*dc)b``NKG+`*T5N3Y"1UPMIThV[djD9N!!b0-6@8G9 SS`-*3XV@EJZ,ppfG(@H&VG9l$HjZ05)#-d3M(d0&9JkT3rK[IJhrMG+c8Cl(B+4 U`aFMihF0N!#jkkJ(bAf)aK,IG)P[ca,IG-NC,*)9Q2S@4ApLIjK&+S'Id[Z4`Ve !C&F!hk33*VJjb0NB50)-%!X)p`RCp6"I8pTh4UI[+E8`dFID4ZkGr@lA$AQDlbl dTY[ZH@,hr!+XiD9#H+cpQa8c%jVX(JTT(9@GRD&+8bJflXSeSl4`5cY$Y5BUZhI &Y(p9rDdY9MhmA'a'S26RfD0D,'"MJPS)PR+'Y$*IGS48-42MQe(`[2"&@fPYS(Z $2,ZVS#hMPle6m-bhq8GG`NZPN!#-)R+V%99PNPlh36fhm*9bM*6G5(DLl6*[`RR N%1kYe0apJX"08h9pBpI"UeK@ZP%fDY[@f0f"j$FB'16,"hmb'lqqr(ZIF,[qqr( 8P4F2LPmU8Y6lJ@,C*HD'0C[m5%SlDaYhr0f9c5@RlpTrl%Ba0h%pIrF&([T)hhC PQkhZV!V"p*ICGPYr00)ATYFTIIZZ+Zh!F'lqJ+RpekRmf5JSrZ#`Jfc9YhilkVT Hh9L([6AGJPqp[j5#5'i#SGl@1!l!f0$([Z4B9)JpbTMr8K%pV8&b'lM9+a*8%hV &U'bb498Z@DQS*MRZ&3U9S9IX$jNN*bhPP@UI8TA)Arc+eR608jlGh#RG(Y%mCIV ZHjY0eR5&1qC1dXc90emD5,Ej@(eFD1XV&rqi5CRVdF[i&43@eN[fU#"2lpYa(Vl C*ZUUNZp0XGNQB,2*LUI#aR9CrBK0&Sp+b8*6C1J9E63Tqf"5i25flDL4ELQ!0#R 1JdB29[1P&-F&`EQV34i-5ZXME9iP2CJ#Sq!JM5UKU,HpAUd@9Ujj,Ce3erhrA2Y 0)fVEk2m'%q('2UUC%2HLD&+GqD$mXUXk4$HdCk9'VaEk0mH(e6-fT4pmjRa9e3I 09fm)JH',*UjGkCYBVDUp[eRI+)5dJF4`UL@ija2YP0UeSHUUm2!Y1A!N#i,p%r+ mraE)KC!!h)mYI"M-*-j`h-92m%VhR)6A)GbRK)!S@)q!m3bE39ZF$L3#NlajP54 K$2XaQX4Q&+bEm4`j1AMiN!!D$8bLH48j)NdQ4ZlPFU1$$j(RK3$Nj8cC#bja3Z9 @VceajE1aV$3CP1@85*e1e)0Q)jGcLA5!ibD49*QcdSUIb6+I1lrc$,UNCTa,i@! (l&NX8Z!UXl)Fc@N10p%$TmlaarF12*%VqVQP+IbmGAC[Z(*i4%i0ElMdXHT++-Z e+['9N53H0#4Y9,3%Ib#8d),3L422HK!GJGBFY,LYf`X9ljIeI"9HZ54kVCUF308 $Ta+%AGi0FXiSpX5"dhYD$!,RQ3U0(P3fjfdBeq`NrZ'e,erl6RVGI#'mVR"`phb T-2,3[')Sd$cb3&!%V`adK&KR!aa2Y%%,Z,h0rNH#iVJi,$5IJe1*KV4GN8AeTLJ dhii*%jh+4+0lL-6G`Gb!1(p'+l"R#Xqlj[FAI)G0QQ+9i'Uh+QCdXfkhYb)Q$Qa ("&X5L'&#mPXXm@0)Ucd%5eJUcINKX48pJ6d%PbS*K&[ci9Z%V*(I3hJPL`MrdJS I3`D53``T(FqmS[EkqkCA(rKLZIm!-KZ&[1GiTPFGl*ZpSH[blmr0kANl3fU1pr3 DII1R0R@Yr)*!qJH3!1C*GFpaYEH[Hmh&ZN*A@%M6!%pD0diEiCSl$VHQjr`k#`[ 26@IZ9DI$daI6KAA2pN(q9D3Y+FMIp2MMdq%6Qblq,Td1hibPQPH&k,ZJH0C&,1f SJfdU0CD1i33[B404!YdjT'r8eK+UMqe@Db3GV(dcl%e2@"m1dpJq%Rh(6 H,q %2[!CM`9RLm[r%li9iPZYi6IUKXJLDiC`*LQ1j@0C1-R3A,AUd"L@,!$X'#)f9Q` GU4qjDTIlE$mqA(M5%LlfVkUm(4R$6f-Y*2qH0D6p36il*,[YSYC3Ef@,rIqX9*l !Ebf0'B$Bc0CR("AbR`1@-IY,[Y#8e9pF9R&@mL*83(aXZ8)Z"La%VB`"J[[p584 Bj!eI5+Z3!-m'FQle8ke"Xl)9E+f!P-EiV3U5Rr1e(UmFZASXGdNpP#jSPS%Mep0 4%N&XLQ8J!kB+PhfShJLZT1Hk&EZ'!AIMZcc23,,Q+,p414k9S,B6,'a82bfhAaY ETNrA%56ja02ZG*T5j4lME!"-qUA2Y$MMJiY4T!6X@Z)k)D`B8d'!AjJ-cVeXTE3 (16-(E(Pb4Q#Tj'@9#%5hl5$Glld`DH2L9KVmeH*EFa9hpIDl1`$QYF(BlY&bTX2 dqBA$reLmd2TDRl(Y0,(GBIAPhAX"rrC*9qj6Dcd$H#M1@jc&$Y'NGA48bXlAXh* S@kH!Zkfbli`-Z2M"q(b&pHX4I'G4%de6YE9A(RA@qh)a&f[!UpMFMmNq0q"eB[p iVX)kEUcG1DPY3V0$`62A6#EC@@pc!%i&h!kia8UMBYEe3)A945F$!Zi8m+KTci2 1HV%pT#rHl4bkG*dEl!9mF@EmL(@Qr)X@N!!HQJGM-lYP`%2C`r@*QVC6V('0%[" TN!#F,[k0%(eX#hU3!0aHNqRj@JSe6JF*I04KqTHADUE2Tc,B-J[*j9f1hMkq&-B !U*!!KfX`AB-8B"Ah@IS[4f&li'IQ$1CAe9if%aiqGN!&Q%S4&CiQhDIf@FS1cNU jaA2YaBpQiQbY3i'CP4mCLmX+L8rILUK3`8dZHmjaV0YkRM[jP2ccRlVip*4Me-q APMjP-@A,$9P,I85&#Ulqe@iaGfcqU-aPXh*qlF1-@ZZSlH5C1mA0TJqUQTkf2j& 8)5`qd`4i3-FVSVN)cQ3YT[jL52V`9&+&J$mj!EMGASjQX`p@2&,*6%A`c5D4[Tl 00DT3H*AkL5leI''P)l9im[YlhCrhTp2DG*J[E4#Y4L*[6e`je+K#q,'4%64@!PY K&Z!k%mV9AKd1kGd&SBA5Q+kqLIFl@5H@2&IJeq44!*!$'!!d!!!"(!&S!!%"!!% !N!8$k!#3!j3!N!-)!#!J!3!#!*!&('&eFh3!N!-"4P*&4J#3"B"*3diM!*!&J!# 3!`G"8&"-!*!&!3!!!3#3!`+!!!!%3!!!#5!!!"13!!!!*mJ!!%%%!!#"!J!"!!% !!JI!J!32i%!)''!J%"[m%#3DP!K-'[3NRc)%-N`ek2NN05Jb%$Ii*!J`i!J%(q! 3!J$!)!%$m%!!J!#!!%#"!!!JJJ!!%q3!!!R)!!!%N!!!!!)J!!!"3!#3!i!!!!% !N!-$J!!!"m!!!!rJ!!!Im!!!2rJ!!(rm!!$rrJ!"rrm!!rrrJ!Irrm!2rrrJ(rr rm$rrrrKrrrrmrj!$rRrrN!-rrrrq(rrrr!rrrrJ(rrr`!rrri!(rrm!!rrq!!(r r!!!rrJ!!(r`!!!ri!!!(m!!!!q!!!!(!!*!$J!#3"#!IU5!a16N`,6Nf)%&XB@4 ND@iJ8hPcG'9YFb`J5@jM,J!!&8J!N!-"GJ"1F8U$CKT"l3!J-,`!#$&m2c`!!M& m!!%!"$&mUI!!"Lm$,c`!!"5Q3IVrd0$m!+)[#%+RB3!#*Ylm!""R%NU$C`4`!8j e6Ud!)Q%!!pDTp%ja5S0Q!URdF!"1G@"b38a"4%4$69!!!`#30&"b3@e)jf$`G$+ I`Lp)!#!J6b*8-@N!&!!B)8!!*$&m!!%!,0+4)8%!,U!#hm*-h`m'6R9+1!THC`` J+J!)C``J3#!3C`B[1[q%6R9)jam'3IVrRR!-)LS!"-+i!aTKT'B!!4*)H[q16VS %i&K2X(Vr@QB!!1bK'Li)##S!"J!%C`BJH!+QS"XX+J!%+LS!#"JU!!5Ae*A8)$V r9U%HCJ!!c#a))$Vr5L)'`VJ$'PK"B3$r8L!krd,!Z!-D3IVr2L#!5S9Q"+%LB!3 J4D!RCJ!!Q#T),cVr!Lmkr[S[1[lb,cVr!Lmkr[T)H[m5,a!J1[m!8B""q[lf))! J$P#!3IVqk##!5(S!HQ%!#L6Hr!!J5N"R!URr)%kJ(b"(S"Yb!")%j`RM'H34!!% !)!)"!1!J6D"T!J!!(i!")%fJDYA8ep4"q[kB5T!!C`K`!D'BF!1KQ#"0*8J!#(! !60pJq%je60pJq'!!rZ!J6U!IeG6Ae#"(S"X`1!)J-F!+B*()B1"19J!!51F!1#K Z!!a(q[jD4IVq@L!8X**Y"#!5+)"+J'm5)&-LEJ!)SLiJ&0'6NC*`!'!%-$crf8c I(!"1ANje6PEreNMR%aJX,J!35IVpmN)(S4SY52rQ5Li!#fF')(J#TU!E,c`!!+$ m6VS#RLe!rqTB6fF!!Ai[,[rU6VS"q%S!@%pR"R!"B!!"FNKZrrK)E[rd5'lrlNk k!j)J,[rdS4iY52r`6qm!$'F!!8JJ,[riS4iY52rmC`!"1LmZrrJ[#%kk!qC+VJ! 88%pQ!!#8@Bm[2%024%9`!$m!U"mQAb!,ChiJ%h)Bd)%[!%kk!Y`-3!!$@%pQDL! 0FLM3J5e!rpSJ%h3Bd))Y32rH,`"1ZJ,`5-!Y32rL)%ZJ+5!Zrpj3J#P!!#KCMbm ,6VS3d#!IFL#3!)%T3!!X,blrr#mZrr3[,[r`,`B[,J!-5'lriLmZrpT)H[kX6VS )9Lm,UD02l`!N+@lrkJ!-+@lrm!!3+@lrp!!8+@lrr!!B,c`!!+'B6VS"L#e!rpB [2!!!U*p1ZJ&k)LlreV#"9X0%!dL$5--T3`!F+8B!)#PZ!!`!*%Kkr*!!2cbJr#m m!!#Jr%kk!54BMam!6VS3@#mm!!#KQ%kk!6T+J%r[!!aR"%kk%&B`1!&Di%!-3!! 'CJK"qJ!D)FJ$2(i")'lrjU!E%!G-lKM)rm*1ANje6PB!!%MR!4K#"bmm!!#Jr%k k!2)S3#!-@%pR5#m-6VS!8%S!@%pR2#C-,bX!$$mmS2`[2!!!S2a1ZJ#L@)mI!%k k$pBJD`!3S"mJD`!BS"m`1!&Di%!-3!!'CJC`!#(!!caq!4!(61iBJ2rd6Pj1G8j @!!")ja!)+'i!#(B!$+a"6%&%!!*Q&!bX4%008!!'CJT`!l"X!!TQ!RB"%!0-lK! )rrK1ANje6PB!!&Q22cbSER!"(`"1ZJp-@Bmr2+TZF!%I!%kk$ciJ(l#ICJB`2!) !B!3`2!3!6Pj1G8j@!!![!c!m#!$!EJ!+FJ!b!%U"8X0%!fF%F!&J!R!!*Llrr%j H6R919J!!51FI!$iZ!!T)abm(6VVraKS!F!!3"3a!!!&B6fB3!NF(rdkkrhb`4fi %F!"J+PQ22cbSRh!"(`"1ZJl#+"pCMcm((`91ZJkf,"qiKPI$4!0R"(!!B!)J"Nc Z!2Mrl%jH6R919J!!51F4#$iZ!!iJEJ!)+&"f!(!!-"3-J!!!384Q,R!!-#`!!Jb !!!"$8QBJ$%IrrfFB)#`!"%*!5%$J5#)m!*!$rm+!5-HqJ@B#GJ%3!dcZ%)Mrp%j H6R919J!!F2m[!%KZ!!K1Z[qB5J"36fFD)'i!##!S!!4#3%K!i%JL2!#3!rr#J$! "B!*`rdjH6R919J!!F2m[!%KZ!!K1Z[pL5J"36fF3)'i!##!m!2q3!m#S!!4J!R$ r6Pj1G8j@!!")j`!B*Qi!%#KZ!!`JEJ!)-,`$!A!!+)!'P!!!!53'P!!!!NJ'P!# 3!b!'P!#3!i!'P!#3!i!'P!!!"*!!"T3!!!%N"T3!!!53!!D8!*!$I!D8!!#!!#D !"T-!N!-N"T-!N!-J"T-!N!0)"T-!N!-qF!"-lKJ!rrK1ANje6PErp%MR%aJQEJ! ),8[rp!DZ!*!$*2rd+'lrp!DZ!*!$)2rd,@lrp2ri"Ui!N!0)rr3YE[rdrr`'VJ# 3!clrp#!Zrr53!+i!#,#Z!!aM"R"PB!!!X%*(3NCJ4R!!-!F-3!!%9F0%!fF%F!" J$(!!-!GCJ()%6VS0)R)!-JFAJ"J!F!!`"b"ZrrM3J$''#!"`!$!(%$-)!()"iDR F36!(8NG`!$!($%!!*'@`3NGm!@"'F!!`"`a!!!&9`d3$C`4`!'!-F!!`"e1!FJ* 1ZJc-FJ!b"aQ!'!"`!$!()'lrr0#!-BB)!(!!-!F30!J!FJ(KUGa"-!G54h!!-!F -3!!ICE"`!%cZ'-Mri%jH6R919[rm51F2'#CZ!!`SEJ!83NCJ$R!!-!E3J%*d#!! `"P*'F!!`"R)!-Li!%Y+"XS"ZiN*'H!*J!!#D3N9#4h!!-!BJEJ!)jB!YF!J!rra JE(!"`+lrr0j!F!!`"A)!-JCd!"3c'!"63NM#Y)"[+(!!-!I3J()!-M3)!%U"CJa `!$!(d)!jK!J!9%4`!$!(d)!q0!J!B"K`!$!'FJ!b,J!5dS(5J(!!-!I3J$Q"#!! `"9*&)#lrr1+),8$rr(!!-!9b!$)'G!!8-aJ!Y%"LJM!'8NDmEJ!5C3$rBNcZ'2$ rj%jH6R919J!!51F2'$iZ!!iQEJ!3+'i!#$JZ!"Bk"qC0F!!`"h`(c%"q!(!!-!8 30!J!l#Kb!")!F!(!!A)!%J$HJ5!(d)"b!$)c#!!Z!9*'F!!`"R))XS"Q"N*'-!9 54A!!-!63J,#(BX"`!$!%d)!L"j+!%!&-lKM`rqK1ANje6PB!!%MR$`Ji,J!52Li !$LKZ!!Jm"qC1F!!`"hS(bN"`!$!'IJ!H0!J!F!!`"A)!-J65J1D*CbT6J@F@8i& Q)R!!-!C8J()!%M3)!%K"3N'1JA!!-!C5J()!%M3)!1'*MS&`!$!&i+p`)*!!"(, ri+R#Kc!"61i3m2rX6Pj1G8j@rqT)j`mB*Qi!##KZ!"!'VJ!!!53!&!DZ!!!#5!! 8,@i!&2rd"Ui!N!-J!"3YEJ!8rrJ'VJ#3!i!!&#eZ!"6rr"!6jJKb!")!F!I!!A) !%J"536e"rqS3%q))FJ!5!(!$`!&b!")!1!&84(!"kDJp32rbF!!3%h*!`J"`!"! "28$rm(!"kDK6J$e!rqj`!"!6FJ(#!'F+F!!`,[rZ8i"J!R$r28$rl(S)5Qlrm'G @,bi!&#mZrr4`!$!Zrr)[!#!,8S![!%kkrcKb!$)!ji(D35mZ!"3[,[riF!!`,[r b,`![,[rd6VS)I#mZrra`!$!Zrr)[!#mZrr3[,[ri6VVp)Nr[!$"#4f!!!2C+E[r `Cc*`!$!Zrr)[!#mZrra`!$!&,`![#dkkrGjm!"`!F!!`"L"Zrr4b!")`#!$D38r [!""J'R!!-!3[!(!!-!8[!#m,6VVq,M`!fN42l`!-['lrl'B3-!G54h)!-J"#0"J !B!!!MVaZrqjQG%TZrr"R-R!!-#lrmLm!,blrr(!!-!8[!#m,6VVpF(`!(!"`!$! ')'lrp()!%M!)!0T"6qm!%'!DF!!`"#m!F!!`"5m!,`Y1Z[h!2!$D4%r[!!a@4Q! 8F!!`"e1!FJ!b"aQd#!!B!$!(8NF`"P0'5N"Qj'!5%!E3,[rV-JG54h3!0!%CJ#J ![Qi!$Q8!r`C`!$!&AS$QL%cZ'2$rdNjH6R919[q'51F2'#eZ!#6rj!DZ!*!$*!! N,@i!*2rd"Ui!N!-J!#3YEJ!NrqJ'VJ#3!dJ!*#eZ!#6rq#CZ!"c@r!%Ne[`#50E m!#$@r!#!e[`!J#e,rpM@r!53!#e,rpc@r!%N,8[ri0Em"*!!,8[rm0Em!(`Y5rr )er`!!)!!)!Z3!+i!(,#Z!#"M"R"PB!!&8RS!3NFJ,[r)d,`!!)!!,8$rc#KZrmJ YI!!!J!$rr%KZrr`[,[r))'i!#%k3!%UZrra36fB'F'GJ!!8B)!a5J,#ZrmaMC#e -rlSYE[r-rliJ$&+!N!#ZrliY32qf)#lrZT!!V[r),8$rXL!Zrlk3!+lrZLe!rkj R$#"-)Qlrb#!ZrkkL,LKZrklCl[r)5'lrXLmZrmJJEJ!)6T!!)#lrXV#ZrlC36f3 'F'GJ!!5U(9crah!!%#lradM!d)"63$e!rqa`!$!Zrqc3J$e!rqiJEJ!3)"$3VJ! -,8$re#mZ!"`[,[rF5(J"*#m-6VVmG()!-J"+JGR",bi!(#mZrpK)H!%N,blrh%k k"E`[,[rJ5(J"*#mZrp`[,[rB6VVkCLmZ!"`[,[rFF!!`,[rX,`![$%kkr#jb!$) !5S(C`5mZ!"`[,[rBF!!`,[rX,`![,[rF6VS&FLmZrr"`!$!Zrq`[!#mZrp`[,[r B6VVk'(S!3NFYEJ!-rp"2l`"JB!!$X%*'B!!!Q(!!-!G+J'Cd)!a5J,#ZrmaMC#e -rkBYE[r-rkSJ$&+!N!#ZrkSY32qL)#lrTT!!V[r),8$rRL!ZrkU3!+lrTLe!rjT R$#"-)Qlrb#!ZrjUL,LKZrjVCl[r)5'lrRLmZrmJJEJ!)6T!!)#lrRV#Zrk*36f3 'F'GJ!!0HHJ!D((i)F!(!KGa!F!!`"L"Zrq$3J$``#!$LM6!(8dG`!$!'$%!#5'8 !rf!%4J*)F!!`"Ja!!3"N%#!Zrp"5V[r3)%!3KQ!!!ZS%4J%!F!!`"L"ZrqM3J$J `#!"`!$!')'lrj()!%M!)!$e"rm*`!$!Zrm*+J'-!!+*JH#!-8S#`V[r-Bf3Y62q Q,@lrc2qU)!a5J*!!V[qU,8$rSL!ZrkD3!+lrb#e!rjiJ,[qUN!#ZrkBY32qDC`` J6#*ZrmJJ,[qDSLiSE[qDfHlrb%KZrji[,[r))'i!#%k3!#!Zrjk`V[qL8%pN"R" RB!!#G(!!%"c[U)U!8%G`!$!($%!!''-!rhj`)*!!,[r$F[rJUF+&f%&`!$!Zrm, JVCjZrm*#4Q!!!*K`!$!(5S"QG#!-8S#`V[r-Bf3Y62q5,@lrc2q@)!a5J*!!V[q @,8$rML!Zrj+3!+lrb#e!riSJ,[q@N!#Zrj)Y32q'C``J6#*ZrmJJ,[q'SLiSE[q 'fHlrb%KZriS[,[r))'i!#%k3!#!ZriU`V[q18%pN"R"RB!!"b(S!'Kaq#(!"`)A F3(!!-!BJE[r`d)!m-!J!iSd`"e0(['lrlQ8!rf5FE[rZF!!`"L"ZrrM3J$e`#!$ ra(!!-!BJE[rdFJ!5-!J!28(r`R!!-#lr`NU!B`!!T'"i)!a5J,#ZrmaMC#e-rkB YE[r-rkSJ$&+!N!#ZrkSY32qL)#lrTT!!V[r),8$rRL!ZrkU3!+lrTLe!rjTR$#" -)Qlrb#!ZrjUL,LKZrjVCl[r)5'lrRLmZrmJJEJ!)6T!!)#lrRV#Zrk*36f3'F'G J!!$qF!!3(1qSLS"34h!!-!F-3!!BB`$rIR!JN!!Zrm0brq#T`SA6E[r%F!!`,[r #i+fHE[r#F!!`,[r%5S!QE[r3Pm#hlJ!-C6BJE[r38Ulrd"#E)'lrd&+Zrp!3Qb! Zrp"5V[r3)%!3Qf!+)'lrd&+Zrp!3Qc!%8d4+3'EZB&C@4#!Z!"M3VJ!8FJ!b,[r %*#lrd*5Z!!b5JLC!Pm&J$L"Zrp"5V[r3%*X`"&0%5N4R$#!Z!"M3VJ!8X)YLiLC Z!!aJ#L"Zrp"5V[r3%*X`"&0%5N"QlL!Zrp#`V[r8C3$m5#!Zrp#`V[r8C`4`Cf! 3)#lrd*!!VJ!-)'i!%##!F!"-lKM`rfj1ANje6PB!!%MR$aJQEJ!81#i!#LKZ!"" J!!%`2!3q,J!18NDmEJ!1C"*`!$!'FJ!b""!d#!#`0"J!CHC64lK(C"*`!$!(FJ! b""!d#!#`0"J!BZLq4Q0)F!!`"RS!'M3)!(!!-!Gb!$)''E3)!"J!F!!`"aQ&#!" `!$!'d)!k-`J!F!!`"p#!FJ!b"Y+"0l-)!"J!F!!`"p#!0i8)!'##Z%GQ"P*%B!! !SR!!-!4k!"Sd#!"`!$!(FJ!b""Qd#!!B!(!!-!FCK3J!F!!`"0#!1M-)!(!!-!I 3J()!-J65J6Hc#!!B!(!!-!I3J$H&#!"`!$!(FJ!b"*!!JA)!-Li!$R3!0!G5JT+ #XS"M(Lm,,`a`!$!(,`"`!$!%,`"1Z[lQ1!G54%r[!""J)#m,,`a`!$!Z!!i[!(! !-!G5J#m!6VVqa$e(!!j2l`!3F!!`,J!1FJ!b"*!!JA)"XS"Y!2l!61iBm2rS6Pj 1G8j@rra)j`mB+'i!&!DZ!!!"*!!8*Qi!&%*'B#"`!$!')'i!#()!-JBCX!J!'!" `!$!'d)!hKJJ!-!C54VaZ!!jPfLm,,`a`!$!Z!!i[!(!!,`"1Z[j)3NC2l`!3B!3 `"P*'['i!$Q31F!!`"R)!%M3)!%U"CqK`!#e!rraJGR!!-!C+J'-NF!!`"R)!%M3 )!(!!-!C6J(3!&$3)!**#5-%J,[rmikJY32rmF!!`"RJ!'$3)!#SZrraq!'!1)!I ML()"`S@#J#i"iSd`"&0%5N"QkR!!-!E3J()!-M-)!#"Z!"$PJ5'('!!`"P*')#l rr&+ZrrbmEJ!1CB4-lKM`rq41ANje)PmJAk!P,S"U!N+A6Y%LAa)I-"p+!@F%TdC J!U0',SK1d5*I%Km`(b"I5J&R"+C(B!+L4dl4)Pp`!D'B6Y%L,`!%)#m!#%(k!!S bI!!#6[#5rQ!'6%%)!8je6VS!*#!"6R8L,`!%)#m!#%(k!!SbI!!#6[#5rQ!)6%% )!F0!6R9+J'X85S&V"Nkk!%C1G85"6VS!2N5"6R9%J%U"D`T1ZJ!`4)"%J8je4)& 1ZJ!N4)"1G5)[!!3J,`!)3IS!#M*m!!*1m*,qB!K-33!"`d"1G6m"5%&+3@BF)J" #38K"C`U#edK"5%!`!8K!J0mb!%*!5%"1G8K"2S)[!c3!*J&b!8*!5%"Q$%K!-!* b!'!@dN&P%Y4#dB#`JfAdN!#$dN%)`3!!C1iQ(c3I6R8!!!%!N!0AHJ!!9RS!!!* k!3,f[$J`!*!$(!*U!"&%394"!*!$NPT&8Nm!N!1H4&*&6!#3!kT$6d4&!!-!YP0 *@N8!N!2Q4%P86!!(!2*"6&*8!!B"8P088L-!!!'QGQ9bF`!"!E*69&)J!!%"bP" cCA3!!!(L8%P$9!!"!Hj%6%p(!!!#"NCPBA3!!!)53Nj%6!!!!Kj'8N9'!!!#+NP $6L-!!!)fBA9cG!!!!N)!!2rr+!#3#Irr#!!#M!#3"[rr+!!#[`#3"3,rrcJ!!X- "![DF!!(rra`!+SB"![D!!!$rrbJ!,-`"![A-!!2rr`!!35i"![A3rj!%!!!Y,!# 3"!3"rrmJ!#dk!*!&KIrr*!!YZJ%#pR3!Krrr!!!Z%!#3"BErrb3!,Q!"![C-!)$ rr`!!,Z)!N!@errmJ!#p!!*!&J[rr!!![XJ#3"!2SrrmJ!$!3!*!%"!(rrb!!-$` !N!@#rrmJ!$"-!*!&KIrr*!!`A!%#pP`!Krrr)!!`E!#3"BErrb3!-(`"![CB!)$ rrb!!-)`!N!@"rrmJ!$#F!*!&J2rr!!!`V!#3"3(rrb!!-,m!N!8#rrmJ!$$d!*! %!J#3!b!!-4)!N!3#!3!()!!a)J#3"B$rr`!!-5i!N!9rrrm!!$9P!*!%!qMrr`! !0TJ!N!3$k2rr)!!rX`#3"[rr)!!rc`#3"B$rr`!!2pX!N!@!rrm!!$rl!*!&J2r r)!"!"J#3"[rr!!""#J#3"!C`FQpYF(3)a#"cG@CQDAM(93: \ No newline at end of file diff --git a/mac/tclMacResource.c b/mac/tclMacResource.c deleted file mode 100644 index 312ef42..0000000 --- a/mac/tclMacResource.c +++ /dev/null @@ -1,2209 +0,0 @@ -/* - * tclMacResource.c -- - * - * This file contains several commands that manipulate or use - * Macintosh resources. Included are extensions to the "source" - * command, the mac specific "beep" and "resource" commands, and - * administration for open resource file references. - * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacResource.c,v 1.5 1999/04/16 00:47:21 stanton Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "FullPath.h" -#include "tcl.h" -#include "tclInt.h" -#include "tclMac.h" -#include "tclMacInt.h" -#include "tclMacPort.h" - -/* - * This flag tells the RegisterResource function to insert the - * resource into the tail of the resource fork list. Needed only - * Resource_Init. - */ - -#define TCL_RESOURCE_INSERT_TAIL 1 -/* - * 2 is taken by TCL_RESOURCE_DONT_CLOSE - * which is the only public flag to TclMacRegisterResourceFork. - */ - -#define TCL_RESOURCE_CHECK_IF_OPEN 4 - -/* - * Pass this in the mode parameter of SetSoundVolume to determine - * which volume to set. - */ - -enum WhichVolume { - SYS_BEEP_VOLUME, /* This sets the volume for SysBeep calls */ - DEFAULT_SND_VOLUME, /* This one for SndPlay calls */ - RESET_VOLUME /* And this undoes the last call to SetSoundVolume */ -}; - -/* - * Hash table to track open resource files. - */ - -typedef struct OpenResourceFork { - short fileRef; - int flags; -} OpenResourceFork; - - - -static Tcl_HashTable nameTable; /* Id to process number mapping. */ -static Tcl_HashTable resourceTable; /* Process number to id mapping. */ -static Tcl_Obj *resourceForkList; /* Ordered list of resource forks */ -static int appResourceIndex; /* This is the index of the application* - * in the list of resource forks */ -static int newId = 0; /* Id source. */ -static int initialized = 0; /* 0 means static structures haven't - * been initialized yet. */ -static int osTypeInit = 0; /* 0 means Tcl object of osType hasn't - * been initialized yet. */ -/* - * Prototypes for procedures defined later in this file: - */ - -static void DupOSTypeInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr, - Tcl_Obj *copyPtr)); -static void ResourceInit _ANSI_ARGS_((void)); -static void BuildResourceForkList _ANSI_ARGS_((void)); -static int SetOSTypeFromAny _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *objPtr)); -static void UpdateStringOfOSType _ANSI_ARGS_((Tcl_Obj *objPtr)); -static OpenResourceFork* GetRsrcRefFromObj _ANSI_ARGS_((Tcl_Obj *objPtr, - int okayOnReadOnly, const char *operation, - Tcl_Obj *resultPtr)); - -static void SetSoundVolume(int volume, enum WhichVolume mode); - -/* - * The structures below defines the Tcl object type defined in this file by - * means of procedures that can be invoked by generic object code. - */ - -static Tcl_ObjType osType = { - "ostype", /* name */ - (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */ - DupOSTypeInternalRep, /* dupIntRepProc */ - UpdateStringOfOSType, /* updateStringProc */ - SetOSTypeFromAny /* setFromAnyProc */ -}; - -/* - *---------------------------------------------------------------------- - * - * Tcl_ResourceObjCmd -- - * - * This procedure is invoked to process the "resource" 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_ResourceObjCmd( - ClientData clientData, /* Not used. */ - Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ -{ - Tcl_Obj *resultPtr, *objPtr; - int index, result; - long fileRef, rsrcId; - FSSpec fileSpec; - char *stringPtr; - char errbuf[16]; - OpenResourceFork *resourceRef; - Handle resource = NULL; - OSErr err; - int count, i, limitSearch = false, length; - short id, saveRef, resInfo; - Str255 theName; - OSType rezType; - int gotInt, releaseIt = 0, force; - char *resourceId = NULL; - long size; - char macPermision; - int mode; - - static char *switches[] = {"close", "delete" ,"files", "list", - "open", "read", "types", "write", (char *) NULL - }; - - enum { - RESOURCE_CLOSE, RESOURCE_DELETE, RESOURCE_FILES, RESOURCE_LIST, - RESOURCE_OPEN, RESOURCE_READ, RESOURCE_TYPES, RESOURCE_WRITE - }; - - static char *writeSwitches[] = { - "-id", "-name", "-file", "-force", (char *) NULL - }; - - enum { - RESOURCE_WRITE_ID, RESOURCE_WRITE_NAME, - RESOURCE_WRITE_FILE, RESOURCE_FORCE - }; - - static char *deleteSwitches[] = {"-id", "-name", "-file", (char *) NULL}; - - enum {RESOURCE_DELETE_ID, RESOURCE_DELETE_NAME, RESOURCE_DELETE_FILE}; - - resultPtr = Tcl_GetObjResult(interp); - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], switches, "option", 0, &index) - != TCL_OK) { - return TCL_ERROR; - } - if (!initialized) { - ResourceInit(); - } - result = TCL_OK; - - switch (index) { - case RESOURCE_CLOSE: - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "resourceRef"); - return TCL_ERROR; - } - stringPtr = Tcl_GetStringFromObj(objv[2], &length); - fileRef = TclMacUnRegisterResourceFork(stringPtr, resultPtr); - - if (fileRef >= 0) { - CloseResFile((short) fileRef); - return TCL_OK; - } else { - return TCL_ERROR; - } - case RESOURCE_DELETE: - if (!((objc >= 3) && (objc <= 9) && ((objc % 2) == 1))) { - Tcl_WrongNumArgs(interp, 2, objv, - "?-id resourceId? ?-name resourceName? ?-file \ -resourceRef? resourceType"); - return TCL_ERROR; - } - - i = 2; - fileRef = -1; - gotInt = false; - resourceId = NULL; - limitSearch = false; - - while (i < (objc - 2)) { - if (Tcl_GetIndexFromObj(interp, objv[i], deleteSwitches, - "option", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - - switch (index) { - case RESOURCE_DELETE_ID: - if (Tcl_GetLongFromObj(interp, objv[i+1], &rsrcId) - != TCL_OK) { - return TCL_ERROR; - } - gotInt = true; - break; - case RESOURCE_DELETE_NAME: - resourceId = Tcl_GetStringFromObj(objv[i+1], &length); - if (length > 255) { - Tcl_AppendStringsToObj(resultPtr,"-name argument ", - "too long, must be < 255 characters", - (char *) NULL); - return TCL_ERROR; - } - strcpy((char *) theName, resourceId); - resourceId = (char *) theName; - c2pstr(resourceId); - break; - case RESOURCE_DELETE_FILE: - resourceRef = GetRsrcRefFromObj(objv[i+1], 0, - "delete from", resultPtr); - if (resourceRef == NULL) { - return TCL_ERROR; - } - limitSearch = true; - break; - } - i += 2; - } - - if ((resourceId == NULL) && !gotInt) { - Tcl_AppendStringsToObj(resultPtr,"you must specify either ", - "\"-id\" or \"-name\" or both ", - "to \"resource delete\"", - (char *) NULL); - return TCL_ERROR; - } - - if (Tcl_GetOSTypeFromObj(interp, objv[i], &rezType) != TCL_OK) { - return TCL_ERROR; - } - - if (limitSearch) { - saveRef = CurResFile(); - UseResFile((short) resourceRef->fileRef); - } - - SetResLoad(false); - - if (gotInt == true) { - if (limitSearch) { - resource = Get1Resource(rezType, rsrcId); - } else { - resource = GetResource(rezType, rsrcId); - } - err = ResError(); - - if (err == resNotFound || resource == NULL) { - Tcl_AppendStringsToObj(resultPtr, "resource not found", - (char *) NULL); - result = TCL_ERROR; - goto deleteDone; - } else if (err != noErr) { - char buffer[16]; - - sprintf(buffer, "%12d", err); - Tcl_AppendStringsToObj(resultPtr, "resource error #", - buffer, "occured while trying to find resource", - (char *) NULL); - result = TCL_ERROR; - goto deleteDone; - } - } - - if (resourceId != NULL) { - Handle tmpResource; - if (limitSearch) { - tmpResource = Get1NamedResource(rezType, - (StringPtr) resourceId); - } else { - tmpResource = GetNamedResource(rezType, - (StringPtr) resourceId); - } - err = ResError(); - - if (err == resNotFound || tmpResource == NULL) { - Tcl_AppendStringsToObj(resultPtr, "resource not found", - (char *) NULL); - result = TCL_ERROR; - goto deleteDone; - } else if (err != noErr) { - char buffer[16]; - - sprintf(buffer, "%12d", err); - Tcl_AppendStringsToObj(resultPtr, "resource error #", - buffer, "occured while trying to find resource", - (char *) NULL); - result = TCL_ERROR; - goto deleteDone; - } - - if (gotInt) { - if (resource != tmpResource) { - Tcl_AppendStringsToObj(resultPtr, - "\"-id\" and \"-name\" ", - "values do not point to the same resource", - (char *) NULL); - result = TCL_ERROR; - goto deleteDone; - } - } else { - resource = tmpResource; - } - } - - resInfo = GetResAttrs(resource); - - if ((resInfo & resProtected) == resProtected) { - Tcl_AppendStringsToObj(resultPtr, "resource ", - "cannot be deleted: it is protected.", - (char *) NULL); - result = TCL_ERROR; - goto deleteDone; - } else if ((resInfo & resSysHeap) == resSysHeap) { - Tcl_AppendStringsToObj(resultPtr, "resource", - "cannot be deleted: it is in the system heap.", - (char *) NULL); - result = TCL_ERROR; - goto deleteDone; - } - - /* - * Find the resource file, if it was not specified, - * so we can flush the changes now. Perhaps this is - * a little paranoid, but better safe than sorry. - */ - - RemoveResource(resource); - - if (!limitSearch) { - UpdateResFile(HomeResFile(resource)); - } else { - UpdateResFile(resourceRef->fileRef); - } - - - deleteDone: - - SetResLoad(true); - if (limitSearch) { - UseResFile(saveRef); - } - return result; - - case RESOURCE_FILES: - if ((objc < 2) || (objc > 3)) { - Tcl_SetStringObj(resultPtr, - "wrong # args: should be \"resource files \ -?resourceId?\"", -1); - return TCL_ERROR; - } - - if (objc == 2) { - stringPtr = Tcl_GetStringFromObj(resourceForkList, &length); - Tcl_SetStringObj(resultPtr, stringPtr, length); - } else { - FCBPBRec fileRec; - Handle pathHandle; - short pathLength; - Str255 fileName; - Tcl_DString dstr; - - if (strcmp(Tcl_GetString(objv[2]), "ROM Map") == 0) { - Tcl_SetStringObj(resultPtr,"no file path for ROM Map", -1); - return TCL_ERROR; - } - - resourceRef = GetRsrcRefFromObj(objv[2], 1, "files", resultPtr); - if (resourceRef == NULL) { - return TCL_ERROR; - } - - fileRec.ioCompletion = NULL; - fileRec.ioFCBIndx = 0; - fileRec.ioNamePtr = fileName; - fileRec.ioVRefNum = 0; - fileRec.ioRefNum = resourceRef->fileRef; - err = PBGetFCBInfo(&fileRec, false); - if (err != noErr) { - Tcl_SetStringObj(resultPtr, - "could not get FCB for resource file", -1); - return TCL_ERROR; - } - - err = GetFullPath(fileRec.ioFCBVRefNum, fileRec.ioFCBParID, - fileRec.ioNamePtr, &pathLength, &pathHandle); - if ( err != noErr) { - Tcl_SetStringObj(resultPtr, - "could not get file path from token", -1); - return TCL_ERROR; - } - - HLock(pathHandle); - Tcl_ExternalToUtfDString(NULL, *pathHandle, pathLength, &dstr); - - Tcl_SetStringObj(resultPtr, Tcl_DStringValue(&dstr), Tcl_DStringLength(&dstr)); - HUnlock(pathHandle); - DisposeHandle(pathHandle); - Tcl_DStringFree(&dstr); - } - return TCL_OK; - case RESOURCE_LIST: - if (!((objc == 3) || (objc == 4))) { - Tcl_WrongNumArgs(interp, 2, objv, "resourceType ?resourceRef?"); - return TCL_ERROR; - } - if (Tcl_GetOSTypeFromObj(interp, objv[2], &rezType) != TCL_OK) { - return TCL_ERROR; - } - - if (objc == 4) { - resourceRef = GetRsrcRefFromObj(objv[3], 1, - "list", resultPtr); - if (resourceRef == NULL) { - return TCL_ERROR; - } - - saveRef = CurResFile(); - UseResFile((short) resourceRef->fileRef); - limitSearch = true; - } - - Tcl_ResetResult(interp); - if (limitSearch) { - count = Count1Resources(rezType); - } else { - count = CountResources(rezType); - } - SetResLoad(false); - for (i = 1; i <= count; i++) { - if (limitSearch) { - resource = Get1IndResource(rezType, i); - } else { - resource = GetIndResource(rezType, i); - } - if (resource != NULL) { - GetResInfo(resource, &id, (ResType *) &rezType, theName); - if (theName[0] != 0) { - - objPtr = Tcl_NewStringObj((char *) theName + 1, - theName[0]); - } else { - objPtr = Tcl_NewIntObj(id); - } - ReleaseResource(resource); - result = Tcl_ListObjAppendElement(interp, resultPtr, - objPtr); - if (result != TCL_OK) { - Tcl_DecrRefCount(objPtr); - break; - } - } - } - SetResLoad(true); - - if (limitSearch) { - UseResFile(saveRef); - } - - return TCL_OK; - case RESOURCE_OPEN: { - Tcl_DString ds, buffer; - char *str, *native; - int length; - - if (!((objc == 3) || (objc == 4))) { - Tcl_WrongNumArgs(interp, 2, objv, "fileName ?permissions?"); - return TCL_ERROR; - } - str = Tcl_GetStringFromObj(objv[2], &length); - if (Tcl_TranslateFileName(interp, str, &buffer) == NULL) { - return TCL_ERROR; - } - native = Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&buffer), - Tcl_DStringLength(&buffer), &ds); - err = FSpLocationFromPath(Tcl_DStringLength(&ds), native, &fileSpec); - Tcl_DStringFree(&ds); - Tcl_DStringFree(&buffer); - - if (!((err == noErr) || (err == fnfErr))) { - Tcl_AppendStringsToObj(resultPtr, "invalid path", (char *) NULL); - return TCL_ERROR; - } - - /* - * Get permissions for the file. We really only understand - * read-only and shared-read-write. If no permissions are - * given we default to read only. - */ - - if (objc == 4) { - stringPtr = Tcl_GetStringFromObj(objv[3], &length); - mode = TclGetOpenMode(interp, stringPtr, &index); - if (mode == -1) { - /* TODO: TclGetOpenMode doesn't work with Obj commands. */ - return TCL_ERROR; - } - switch (mode & (O_RDONLY | O_WRONLY | O_RDWR)) { - case O_RDONLY: - macPermision = fsRdPerm; - break; - case O_WRONLY: - case O_RDWR: - macPermision = fsRdWrPerm; - break; - default: - panic("Tcl_ResourceObjCmd: invalid mode value"); - break; - } - } else { - macPermision = fsRdPerm; - } - - /* - * Don't load in any of the resources in the file, this could - * cause problems if you open a file that has CODE resources... - */ - - SetResLoad(false); - fileRef = (long) FSpOpenResFileCompat(&fileSpec, macPermision); - SetResLoad(true); - - if (fileRef == -1) { - err = ResError(); - if (((err == fnfErr) || (err == eofErr)) && - (macPermision == fsRdWrPerm)) { - /* - * No resource fork existed for this file. Since we are - * opening it for writing we will create the resource fork - * now. - */ - - HCreateResFile(fileSpec.vRefNum, fileSpec.parID, - fileSpec.name); - fileRef = (long) FSpOpenResFileCompat(&fileSpec, - macPermision); - if (fileRef == -1) { - goto openError; - } - } else if (err == fnfErr) { - Tcl_AppendStringsToObj(resultPtr, - "file does not exist", (char *) NULL); - return TCL_ERROR; - } else if (err == eofErr) { - Tcl_AppendStringsToObj(resultPtr, - "file does not contain resource fork", (char *) NULL); - return TCL_ERROR; - } else { - openError: - Tcl_AppendStringsToObj(resultPtr, - "error opening resource file", (char *) NULL); - return TCL_ERROR; - } - } - - /* - * The FspOpenResFile function does not set the ResFileAttrs. - * Even if you open the file read only, the mapReadOnly - * attribute is not set. This means we can't detect writes to a - * read only resource fork until the write fails, which is bogus. - * So set it here... - */ - - if (macPermision == fsRdPerm) { - SetResFileAttrs(fileRef, mapReadOnly); - } - - Tcl_SetStringObj(resultPtr, "", 0); - if (TclMacRegisterResourceFork(fileRef, resultPtr, - TCL_RESOURCE_CHECK_IF_OPEN) != TCL_OK) { - CloseResFile(fileRef); - return TCL_ERROR; - } - return TCL_OK; - } - case RESOURCE_READ: - if (!((objc == 4) || (objc == 5))) { - Tcl_WrongNumArgs(interp, 2, objv, - "resourceType resourceId ?resourceRef?"); - return TCL_ERROR; - } - - if (Tcl_GetOSTypeFromObj(interp, objv[2], &rezType) != TCL_OK) { - return TCL_ERROR; - } - - if (Tcl_GetLongFromObj((Tcl_Interp *) NULL, objv[3], &rsrcId) - != TCL_OK) { - resourceId = Tcl_GetStringFromObj(objv[3], &length); - } - - if (objc == 5) { - stringPtr = Tcl_GetStringFromObj(objv[4], &length); - } else { - stringPtr = NULL; - } - - resource = Tcl_MacFindResource(interp, rezType, resourceId, - rsrcId, stringPtr, &releaseIt); - - if (resource != NULL) { - size = GetResourceSizeOnDisk(resource); - Tcl_SetByteArrayObj(resultPtr, (unsigned char *) *resource, size); - - /* - * Don't release the resource unless WE loaded it... - */ - - if (releaseIt) { - ReleaseResource(resource); - } - return TCL_OK; - } else { - Tcl_AppendStringsToObj(resultPtr, "could not load resource", - (char *) NULL); - return TCL_ERROR; - } - case RESOURCE_TYPES: - if (!((objc == 2) || (objc == 3))) { - Tcl_WrongNumArgs(interp, 2, objv, "?resourceRef?"); - return TCL_ERROR; - } - - if (objc == 3) { - resourceRef = GetRsrcRefFromObj(objv[2], 1, - "get types of", resultPtr); - if (resourceRef == NULL) { - return TCL_ERROR; - } - - saveRef = CurResFile(); - UseResFile((short) resourceRef->fileRef); - limitSearch = true; - } - - if (limitSearch) { - count = Count1Types(); - } else { - count = CountTypes(); - } - for (i = 1; i <= count; i++) { - if (limitSearch) { - Get1IndType((ResType *) &rezType, i); - } else { - GetIndType((ResType *) &rezType, i); - } - objPtr = Tcl_NewOSTypeObj(rezType); - result = Tcl_ListObjAppendElement(interp, resultPtr, objPtr); - if (result != TCL_OK) { - Tcl_DecrRefCount(objPtr); - break; - } - } - - if (limitSearch) { - UseResFile(saveRef); - } - - return result; - case RESOURCE_WRITE: - if ((objc < 4) || (objc > 11)) { - Tcl_WrongNumArgs(interp, 2, objv, - "?-id resourceId? ?-name resourceName? ?-file resourceRef?\ - ?-force? resourceType data"); - return TCL_ERROR; - } - - i = 2; - gotInt = false; - resourceId = NULL; - limitSearch = false; - force = 0; - - while (i < (objc - 2)) { - if (Tcl_GetIndexFromObj(interp, objv[i], writeSwitches, - "switch", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - - switch (index) { - case RESOURCE_WRITE_ID: - if (Tcl_GetLongFromObj(interp, objv[i+1], &rsrcId) - != TCL_OK) { - return TCL_ERROR; - } - gotInt = true; - i += 2; - break; - case RESOURCE_WRITE_NAME: - resourceId = Tcl_GetStringFromObj(objv[i+1], &length); - strcpy((char *) theName, resourceId); - resourceId = (char *) theName; - c2pstr(resourceId); - i += 2; - break; - case RESOURCE_WRITE_FILE: - resourceRef = GetRsrcRefFromObj(objv[i+1], 0, - "write to", resultPtr); - if (resourceRef == NULL) { - return TCL_ERROR; - } - limitSearch = true; - i += 2; - break; - case RESOURCE_FORCE: - force = 1; - i += 1; - break; - } - } - if (Tcl_GetOSTypeFromObj(interp, objv[i], &rezType) != TCL_OK) { - return TCL_ERROR; - } - stringPtr = (char *) Tcl_GetByteArrayFromObj(objv[i+1], &length); - - if (gotInt == false) { - rsrcId = UniqueID(rezType); - } - if (resourceId == NULL) { - resourceId = (char *) "\p"; - } - if (limitSearch) { - saveRef = CurResFile(); - UseResFile((short) resourceRef->fileRef); - } - - /* - * If we are adding the resource by number, then we must make sure - * there is not already a resource of that number. We are not going - * load it here, since we want to detect whether we loaded it or - * not. Remember that releasing some resources in particular menu - * related ones, can be fatal. - */ - - if (gotInt == true) { - SetResLoad(false); - resource = Get1Resource(rezType,rsrcId); - SetResLoad(true); - } - - if (resource == NULL) { - /* - * We get into this branch either if there was not already a - * resource of this type & id, or the id was not specified. - */ - - resource = NewHandle(length); - if (resource == NULL) { - resource = NewHandleSys(length); - if (resource == NULL) { - panic("could not allocate memory to write resource"); - } - } - HLock(resource); - memcpy(*resource, stringPtr, length); - HUnlock(resource); - AddResource(resource, rezType, (short) rsrcId, - (StringPtr) resourceId); - releaseIt = 1; - } else { - /* - * We got here because there was a resource of this type - * & ID in the file. - */ - - if (*resource == NULL) { - releaseIt = 1; - } else { - releaseIt = 0; - } - - if (!force) { - /* - *We only overwrite extant resources - * when the -force flag has been set. - */ - - sprintf(errbuf,"%d", rsrcId); - - Tcl_AppendStringsToObj(resultPtr, "the resource ", - errbuf, " already exists, use \"-force\"", - " to overwrite it.", (char *) NULL); - - result = TCL_ERROR; - goto writeDone; - } else if (GetResAttrs(resource) & resProtected) { - /* - * - * Next, check to see if it is protected... - */ - - sprintf(errbuf,"%d", rsrcId); - Tcl_AppendStringsToObj(resultPtr, - "could not write resource id ", - errbuf, " of type ", - Tcl_GetStringFromObj(objv[i],&length), - ", it was protected.",(char *) NULL); - result = TCL_ERROR; - goto writeDone; - } else { - /* - * Be careful, the resource might already be in memory - * if something else loaded it. - */ - - if (*resource == 0) { - LoadResource(resource); - err = ResError(); - if (err != noErr) { - sprintf(errbuf,"%d", rsrcId); - Tcl_AppendStringsToObj(resultPtr, - "error loading resource ", - errbuf, " of type ", - Tcl_GetStringFromObj(objv[i],&length), - " to overwrite it", (char *) NULL); - goto writeDone; - } - } - - SetHandleSize(resource, length); - if ( MemError() != noErr ) { - panic("could not allocate memory to write resource"); - } - - HLock(resource); - memcpy(*resource, stringPtr, length); - HUnlock(resource); - - ChangedResource(resource); - - /* - * We also may have changed the name... - */ - - SetResInfo(resource, rsrcId, (StringPtr) resourceId); - } - } - - err = ResError(); - if (err != noErr) { - Tcl_AppendStringsToObj(resultPtr, - "error adding resource to resource map", - (char *) NULL); - result = TCL_ERROR; - goto writeDone; - } - - WriteResource(resource); - err = ResError(); - if (err != noErr) { - Tcl_AppendStringsToObj(resultPtr, - "error writing resource to disk", - (char *) NULL); - result = TCL_ERROR; - } - - writeDone: - - if (releaseIt) { - ReleaseResource(resource); - err = ResError(); - if (err != noErr) { - Tcl_AppendStringsToObj(resultPtr, - "error releasing resource", - (char *) NULL); - result = TCL_ERROR; - } - } - - if (limitSearch) { - UseResFile(saveRef); - } - - return result; - default: - panic("Tcl_GetIndexFromObj returned unrecognized option"); - return TCL_ERROR; /* Should never be reached. */ - } -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_MacSourceObjCmd -- - * - * This procedure is invoked to process the "source" Tcl command. - * See the user documentation for details on what it does. In - * addition, it supports sourceing from the resource fork of - * type 'TEXT'. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_MacSourceObjCmd( - ClientData dummy, /* Not used. */ - Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ -{ - char *errNum = "wrong # args: "; - char *errBad = "bad argument: "; - char *errStr; - char *fileName = NULL, *rsrcName = NULL; - long rsrcID = -1; - char *string; - int length; - - if (objc < 2 || objc > 4) { - errStr = errNum; - goto sourceFmtErr; - } - - if (objc == 2) { - string = Tcl_GetStringFromObj(objv[1], &length); - return Tcl_EvalFile(interp, string); - } - - /* - * The following code supports a few older forms of this command - * for backward compatability. - */ - string = Tcl_GetStringFromObj(objv[1], &length); - if (!strcmp(string, "-rsrc") || !strcmp(string, "-rsrcname")) { - rsrcName = Tcl_GetStringFromObj(objv[2], &length); - } else if (!strcmp(string, "-rsrcid")) { - if (Tcl_GetLongFromObj(interp, objv[2], &rsrcID) != TCL_OK) { - return TCL_ERROR; - } - } else { - errStr = errBad; - goto sourceFmtErr; - } - - if (objc == 4) { - fileName = Tcl_GetStringFromObj(objv[3], &length); - } - return Tcl_MacEvalResource(interp, rsrcName, rsrcID, fileName); - - sourceFmtErr: - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), errStr, "should be \"", - Tcl_GetString(objv[0]), " fileName\" or \"", - Tcl_GetString(objv[0]), " -rsrc name ?fileName?\" or \"", - Tcl_GetString(objv[0]), " -rsrcid id ?fileName?\"", - (char *) NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_BeepObjCmd -- - * - * This procedure makes the beep sound. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * Makes a beep. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_BeepObjCmd( - ClientData dummy, /* Not used. */ - Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ -{ - Tcl_Obj *resultPtr, *objPtr; - Handle sound; - Str255 sndName; - int volume = -1, length; - char * sndArg = NULL; - - resultPtr = Tcl_GetObjResult(interp); - if (objc == 1) { - SysBeep(1); - return TCL_OK; - } else if (objc == 2) { - if (!strcmp(Tcl_GetStringFromObj(objv[1], &length), "-list")) { - int count, i; - short id; - Str255 theName; - ResType rezType; - - count = CountResources('snd '); - for (i = 1; i <= count; i++) { - sound = GetIndResource('snd ', i); - if (sound != NULL) { - GetResInfo(sound, &id, &rezType, theName); - if (theName[0] == 0) { - continue; - } - objPtr = Tcl_NewStringObj((char *) theName + 1, - theName[0]); - Tcl_ListObjAppendElement(interp, resultPtr, objPtr); - } - } - return TCL_OK; - } else { - sndArg = Tcl_GetStringFromObj(objv[1], &length); - } - } else if (objc == 3) { - if (!strcmp(Tcl_GetStringFromObj(objv[1], &length), "-volume")) { - Tcl_GetIntFromObj(interp, objv[2], &volume); - } else { - goto beepUsage; - } - } else if (objc == 4) { - if (!strcmp(Tcl_GetStringFromObj(objv[1], &length), "-volume")) { - Tcl_GetIntFromObj(interp, objv[2], &volume); - sndArg = Tcl_GetStringFromObj(objv[3], &length); - } else { - goto beepUsage; - } - } else { - goto beepUsage; - } - - /* - * Play the sound - */ - if (sndArg == NULL) { - /* - * Set Volume for SysBeep - */ - - if (volume >= 0) { - SetSoundVolume(volume, SYS_BEEP_VOLUME); - } - SysBeep(1); - - /* - * Reset Volume - */ - - if (volume >= 0) { - SetSoundVolume(0, RESET_VOLUME); - } - } else { - strcpy((char *) sndName + 1, sndArg); - sndName[0] = length; - sound = GetNamedResource('snd ', sndName); - if (sound != NULL) { - /* - * Set Volume for Default Output device - */ - - if (volume >= 0) { - SetSoundVolume(volume, DEFAULT_SND_VOLUME); - } - - SndPlay(NULL, (SndListHandle) sound, false); - - /* - * Reset Volume - */ - - if (volume >= 0) { - SetSoundVolume(0, RESET_VOLUME); - } - } else { - Tcl_AppendStringsToObj(resultPtr, " \"", sndArg, - "\" is not a valid sound. (Try ", - Tcl_GetString(objv[0]), " -list)", NULL); - return TCL_ERROR; - } - } - - return TCL_OK; - - beepUsage: - Tcl_WrongNumArgs(interp, 1, objv, "[-volume num] [-list | sndName]?"); - return TCL_ERROR; -} - -/* - *----------------------------------------------------------------------------- - * - * SetSoundVolume -- - * - * Set the volume for either the SysBeep or the SndPlay call depending - * on the value of mode (SYS_BEEP_VOLUME or DEFAULT_SND_VOLUME - * respectively. - * - * It also stores the last channel set, and the old value of its - * VOLUME. If you call SetSoundVolume with a mode of RESET_VOLUME, - * it will undo the last setting. The volume parameter is - * ignored in this case. - * - * Side Effects: - * Sets the System Volume - * - * Results: - * None - * - *----------------------------------------------------------------------------- - */ - -void -SetSoundVolume( - int volume, /* This is the new volume */ - enum WhichVolume mode) /* This flag says which volume to - * set: SysBeep, SndPlay, or instructs us - * to reset the volume */ -{ - static int hasSM3 = -1; - static enum WhichVolume oldMode; - static long oldVolume = -1; - - /* - * The volume setting calls only work if we have SoundManager - * 3.0 or higher. So we check that here. - */ - - if (hasSM3 == -1) { - if (GetToolboxTrapAddress(_SoundDispatch) - != GetToolboxTrapAddress(_Unimplemented)) { - NumVersion SMVers = SndSoundManagerVersion(); - if (SMVers.majorRev > 2) { - hasSM3 = 1; - } else { - hasSM3 = 0; - } - } else { - /* - * If the SoundDispatch trap is not present, then - * we don't have the SoundManager at all. - */ - - hasSM3 = 0; - } - } - - /* - * If we don't have Sound Manager 3.0, we can't set the sound volume. - * We will just ignore the request rather than raising an error. - */ - - if (!hasSM3) { - return; - } - - switch (mode) { - case SYS_BEEP_VOLUME: - GetSysBeepVolume(&oldVolume); - SetSysBeepVolume(volume); - oldMode = SYS_BEEP_VOLUME; - break; - case DEFAULT_SND_VOLUME: - GetDefaultOutputVolume(&oldVolume); - SetDefaultOutputVolume(volume); - oldMode = DEFAULT_SND_VOLUME; - break; - case RESET_VOLUME: - /* - * If oldVolume is -1 someone has made a programming error - * and called reset before setting the volume. This is benign - * however, so we will just exit. - */ - - if (oldVolume != -1) { - if (oldMode == SYS_BEEP_VOLUME) { - SetSysBeepVolume(oldVolume); - } else if (oldMode == DEFAULT_SND_VOLUME) { - SetDefaultOutputVolume(oldVolume); - } - } - oldVolume = -1; - } -} - -/* - *----------------------------------------------------------------------------- - * - * Tcl_MacEvalResource -- - * - * Used to extend the source command. Sources Tcl code from a Text - * resource. Currently only sources the resouce by name file ID may be - * supported at a later date. - * - * Side Effects: - * Depends on the Tcl code in the resource. - * - * Results: - * Returns a Tcl result. - * - *----------------------------------------------------------------------------- - */ - -int -Tcl_MacEvalResource( - Tcl_Interp *interp, /* Interpreter in which to process file. */ - char *resourceName, /* Name of TEXT resource to source, - NULL if number should be used. */ - int resourceNumber, /* Resource id of source. */ - char *fileName) /* Name of file to process. - NULL if application resource. */ -{ - Handle sourceText; - Str255 rezName; - char msg[200]; - int result, iOpenedResFile = false; - short saveRef, fileRef = -1; - char idStr[64]; - FSSpec fileSpec; - Tcl_DString buffer; - char *nativeName; - - saveRef = CurResFile(); - - if (fileName != NULL) { - OSErr err; - - nativeName = Tcl_TranslateFileName(interp, fileName, &buffer); - if (nativeName == NULL) { - return TCL_ERROR; - } - err = FSpLocationFromPath(strlen(nativeName), nativeName, - &fileSpec); - Tcl_DStringFree(&buffer); - if (err != noErr) { - Tcl_AppendResult(interp, "Error finding the file: \"", - fileName, "\".", NULL); - return TCL_ERROR; - } - - fileRef = FSpOpenResFileCompat(&fileSpec, fsRdPerm); - if (fileRef == -1) { - Tcl_AppendResult(interp, "Error reading the file: \"", - fileName, "\".", NULL); - return TCL_ERROR; - } - - UseResFile(fileRef); - iOpenedResFile = true; - } else { - /* - * The default behavior will search through all open resource files. - * This may not be the behavior you desire. If you want the behavior - * of this call to *only* search the application resource fork, you - * must call UseResFile at this point to set it to the application - * file. This means you must have already obtained the application's - * fileRef when the application started up. - */ - } - - /* - * Load the resource by name or ID - */ - if (resourceName != NULL) { - strcpy((char *) rezName + 1, resourceName); - rezName[0] = strlen(resourceName); - sourceText = GetNamedResource('TEXT', rezName); - } else { - sourceText = GetResource('TEXT', (short) resourceNumber); - } - - if (sourceText == NULL) { - result = TCL_ERROR; - } else { - char *sourceStr = NULL; - - HLock(sourceText); - sourceStr = Tcl_MacConvertTextResource(sourceText); - HUnlock(sourceText); - ReleaseResource(sourceText); - - /* - * We now evaluate the Tcl source - */ - result = Tcl_Eval(interp, sourceStr); - ckfree(sourceStr); - if (result == TCL_RETURN) { - result = TCL_OK; - } else if (result == TCL_ERROR) { - sprintf(msg, "\n (rsrc \"%.150s\" line %d)", - resourceName, - interp->errorLine); - Tcl_AddErrorInfo(interp, msg); - } - - goto rezEvalCleanUp; - } - - rezEvalError: - sprintf(idStr, "ID=%d", resourceNumber); - Tcl_AppendResult(interp, "The resource \"", - (resourceName != NULL ? resourceName : idStr), - "\" could not be loaded from ", - (fileName != NULL ? fileName : "application"), - ".", NULL); - - rezEvalCleanUp: - - /* - * TRICKY POINT: The code that you are sourcing here could load a - * shared library. This will go AHEAD of the resource we stored away - * in saveRef on the resource path. - * If you restore the saveRef in this case, you will never be able - * to get to the resources in the shared library, since you are now - * pointing too far down on the resource list. - * So, we only reset the current resource file if WE opened a resource - * explicitly, and then only if the CurResFile is still the - * one we opened... - */ - - if (iOpenedResFile && (CurResFile() == fileRef)) { - UseResFile(saveRef); - } - - if (fileRef != -1) { - CloseResFile(fileRef); - } - - return result; -} - -/* - *----------------------------------------------------------------------------- - * - * Tcl_MacConvertTextResource -- - * - * Converts a TEXT resource into a Tcl suitable string. - * - * Side Effects: - * Mallocs the returned memory, converts '\r' to '\n', and appends a NULL. - * - * Results: - * A new malloced string. - * - *----------------------------------------------------------------------------- - */ - -char * -Tcl_MacConvertTextResource( - Handle resource) /* Handle to TEXT resource. */ -{ - int i, size; - char *resultStr; - - size = GetResourceSizeOnDisk(resource); - - resultStr = ckalloc(size + 1); - - for (i=0; ifileRef); - limitSearch = true; - } - - /* - * Some system resources (for example system resources) should not - * be released. So we set autoload to false, and try to get the resource. - * If the Master Pointer of the returned handle is null, then resource was - * not in memory, and it is safe to release it. Otherwise, it is not. - */ - - SetResLoad(false); - - if (resourceName == NULL) { - if (limitSearch) { - resource = Get1Resource(resourceType, resourceNumber); - } else { - resource = GetResource(resourceType, resourceNumber); - } - } else { - c2pstr(resourceName); - if (limitSearch) { - resource = Get1NamedResource(resourceType, - (StringPtr) resourceName); - } else { - resource = GetNamedResource(resourceType, - (StringPtr) resourceName); - } - p2cstr((StringPtr) resourceName); - } - - if (*resource == NULL) { - *releaseIt = 1; - LoadResource(resource); - } else { - *releaseIt = 0; - } - - SetResLoad(true); - - - if (limitSearch) { - UseResFile(saveRef); - } - - return resource; -} - -/* - *---------------------------------------------------------------------- - * - * ResourceInit -- - * - * Initialize the structures used for resource management. - * - * Results: - * None. - * - * Side effects: - * Read the code. - * - *---------------------------------------------------------------------- - */ - -static void -ResourceInit() -{ - - initialized = 1; - Tcl_InitHashTable(&nameTable, TCL_STRING_KEYS); - Tcl_InitHashTable(&resourceTable, TCL_ONE_WORD_KEYS); - resourceForkList = Tcl_NewObj(); - Tcl_IncrRefCount(resourceForkList); - - BuildResourceForkList(); - -} -/***/ - -/*Tcl_RegisterObjType(typePtr) */ - -/* - *---------------------------------------------------------------------- - * - * Tcl_NewOSTypeObj -- - * - * This procedure is used to create a new resource name type object. - * - * Results: - * The newly created object is returned. This object will have a NULL - * string representation. The returned object has ref count 0. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_Obj * -Tcl_NewOSTypeObj( - OSType newOSType) /* Int used to initialize the new object. */ -{ - register Tcl_Obj *objPtr; - - if (!osTypeInit) { - osTypeInit = 1; - Tcl_RegisterObjType(&osType); - } - - objPtr = Tcl_NewObj(); - objPtr->bytes = NULL; - objPtr->internalRep.longValue = newOSType; - objPtr->typePtr = &osType; - return objPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_SetOSTypeObj -- - * - * Modify an object to be a resource type and to have the - * specified long value. - * - * Results: - * None. - * - * Side effects: - * The object's old string rep, if any, is freed. Also, any old - * internal rep is freed. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_SetOSTypeObj( - Tcl_Obj *objPtr, /* Object whose internal rep to init. */ - OSType newOSType) /* Integer used to set object's value. */ -{ - register Tcl_ObjType *oldTypePtr = objPtr->typePtr; - - if (!osTypeInit) { - osTypeInit = 1; - Tcl_RegisterObjType(&osType); - } - - Tcl_InvalidateStringRep(objPtr); - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.longValue = newOSType; - objPtr->typePtr = &osType; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetOSTypeFromObj -- - * - * Attempt to return an int from the Tcl object "objPtr". If the object - * is not already an int, an attempt will be made to convert it to one. - * - * Results: - * The return value is a standard Tcl object result. If an error occurs - * during conversion, an error message is left in interp->objResult - * unless "interp" is NULL. - * - * Side effects: - * If the object is not already an int, the conversion will free - * any old internal representation. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_GetOSTypeFromObj( - Tcl_Interp *interp, /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr, /* The object from which to get a int. */ - OSType *osTypePtr) /* Place to store resulting int. */ -{ - register int result; - - if (!osTypeInit) { - osTypeInit = 1; - Tcl_RegisterObjType(&osType); - } - - if (objPtr->typePtr == &osType) { - *osTypePtr = objPtr->internalRep.longValue; - return TCL_OK; - } - - result = SetOSTypeFromAny(interp, objPtr); - if (result == TCL_OK) { - *osTypePtr = objPtr->internalRep.longValue; - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * DupOSTypeInternalRep -- - * - * Initialize the internal representation of an int Tcl_Obj to a - * copy of the internal representation of an existing int object. - * - * Results: - * None. - * - * Side effects: - * "copyPtr"s internal rep is set to the integer corresponding to - * "srcPtr"s internal rep. - * - *---------------------------------------------------------------------- - */ - -static void -DupOSTypeInternalRep( - Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ - Tcl_Obj *copyPtr) /* Object with internal rep to set. */ -{ - copyPtr->internalRep.longValue = srcPtr->internalRep.longValue; - copyPtr->typePtr = &osType; -} - -/* - *---------------------------------------------------------------------- - * - * SetOSTypeFromAny -- - * - * Attempt to generate an integer internal form for the Tcl object - * "objPtr". - * - * Results: - * The return value is a standard object Tcl result. If an error occurs - * during conversion, an error message is left in interp->objResult - * unless "interp" is NULL. - * - * Side effects: - * If no error occurs, an int is stored as "objPtr"s internal - * representation. - * - *---------------------------------------------------------------------- - */ - -static int -SetOSTypeFromAny( - Tcl_Interp *interp, /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr) /* The object to convert. */ -{ - Tcl_ObjType *oldTypePtr = objPtr->typePtr; - char *string; - int length; - long newOSType; - - /* - * Get the string representation. Make it up-to-date if necessary. - */ - - string = Tcl_GetStringFromObj(objPtr, &length); - - if (length != 4) { - if (interp != NULL) { - Tcl_ResetResult(interp); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "expected Macintosh OS type but got \"", string, "\"", - (char *) NULL); - } - return TCL_ERROR; - } - newOSType = *((long *) string); - - /* - * The conversion to resource type succeeded. Free the old internalRep - * before setting the new one. - */ - - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); - } - - objPtr->internalRep.longValue = newOSType; - objPtr->typePtr = &osType; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateStringOfOSType -- - * - * Update the string representation for an resource type object. - * Note: This procedure 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 int-to-string conversion. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateStringOfOSType( - register Tcl_Obj *objPtr) /* Int object whose string rep to update. */ -{ - objPtr->bytes = ckalloc(5); - sprintf(objPtr->bytes, "%-4.4s", &(objPtr->internalRep.longValue)); - objPtr->length = 4; -} - -/* - *---------------------------------------------------------------------- - * - * GetRsrcRefFromObj -- - * - * Given a String object containing a resource file token, return - * the OpenResourceFork structure that it represents, or NULL if - * the token cannot be found. If okayOnReadOnly is false, it will - * also check whether the token corresponds to a read-only file, - * and return NULL if it is. - * - * Results: - * A pointer to an OpenResourceFork structure, or NULL. - * - * Side effects: - * An error message may be left in resultPtr. - * - *---------------------------------------------------------------------- - */ - -static OpenResourceFork * -GetRsrcRefFromObj( - register Tcl_Obj *objPtr, /* String obj containing file token */ - int okayOnReadOnly, /* Whether this operation is okay for a * - * read only file. */ - const char *operation, /* String containing the operation we * - * were trying to perform, used for errors */ - Tcl_Obj *resultPtr) /* Tcl_Obj to contain error message */ -{ - char *stringPtr; - Tcl_HashEntry *nameHashPtr; - OpenResourceFork *resourceRef; - int length; - OSErr err; - - stringPtr = Tcl_GetStringFromObj(objPtr, &length); - nameHashPtr = Tcl_FindHashEntry(&nameTable, stringPtr); - if (nameHashPtr == NULL) { - Tcl_AppendStringsToObj(resultPtr, - "invalid resource file reference \"", - stringPtr, "\"", (char *) NULL); - return NULL; - } - - resourceRef = (OpenResourceFork *) Tcl_GetHashValue(nameHashPtr); - - if (!okayOnReadOnly) { - err = GetResFileAttrs((short) resourceRef->fileRef); - if (err & mapReadOnly) { - Tcl_AppendStringsToObj(resultPtr, "cannot ", operation, - " resource file \"", - stringPtr, "\", it was opened read only", - (char *) NULL); - return NULL; - } - } - return resourceRef; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacRegisterResourceFork -- - * - * Register an open resource fork in the table of open resources - * managed by the procedures in this file. If the resource file - * is already registered with the table, then no new token is made. - * - * The behavior is controlled by the value of tokenPtr, and of the - * flags variable. For tokenPtr, the possibilities are: - * - NULL: The new token is auto-generated, but not returned. - * - The string value of tokenPtr is the empty string: Then - * the new token is auto-generated, and returned in tokenPtr - * - tokenPtr has a value: The string value will be used for the token, - * unless it is already in use, in which case a new token will - * be generated, and returned in tokenPtr. - * - * For the flags variable: it can be one of: - * - TCL_RESOURCE__INSERT_TAIL: The element is inserted at the - * end of the list of open resources. Used only in Resource_Init. - * - TCL_RESOURCE_DONT_CLOSE: The resource close command will not close - * this resource. - * - TCL_RESOURCE_CHECK_IF_OPEN: This will check to see if this file's - * resource fork is already opened by this Tcl shell, and return - * an error without registering the resource fork. - * - * Results: - * Standard Tcl Result - * - * Side effects: - * An entry may be added to the resource name table. - * - *---------------------------------------------------------------------- - */ - -int -TclMacRegisterResourceFork( - short fileRef, /* File ref for an open resource fork. */ - Tcl_Obj *tokenPtr, /* A Tcl Object to which to write the * - * new token */ - int flags) /* 1 means insert at the head of the resource - * fork list, 0 means at the tail */ - -{ - Tcl_HashEntry *resourceHashPtr; - Tcl_HashEntry *nameHashPtr; - OpenResourceFork *resourceRef; - int new; - char *resourceId = NULL; - - if (!initialized) { - ResourceInit(); - } - - /* - * If we were asked to, check that this file has not been opened - * already with a different permission. It it has, then return an error. - */ - - new = 1; - - if (flags & TCL_RESOURCE_CHECK_IF_OPEN) { - Tcl_HashSearch search; - short oldFileRef, filePermissionFlag; - FCBPBRec newFileRec, oldFileRec; - OSErr err; - - oldFileRec.ioCompletion = NULL; - oldFileRec.ioFCBIndx = 0; - oldFileRec.ioNamePtr = NULL; - - newFileRec.ioCompletion = NULL; - newFileRec.ioFCBIndx = 0; - newFileRec.ioNamePtr = NULL; - newFileRec.ioVRefNum = 0; - newFileRec.ioRefNum = fileRef; - err = PBGetFCBInfo(&newFileRec, false); - filePermissionFlag = ( newFileRec.ioFCBFlags >> 12 ) & 0x1; - - - resourceHashPtr = Tcl_FirstHashEntry(&resourceTable, &search); - while (resourceHashPtr != NULL) { - oldFileRef = (short) Tcl_GetHashKey(&resourceTable, - resourceHashPtr); - if (oldFileRef == fileRef) { - new = 0; - break; - } - oldFileRec.ioVRefNum = 0; - oldFileRec.ioRefNum = oldFileRef; - err = PBGetFCBInfo(&oldFileRec, false); - - /* - * err might not be noErr either because the file has closed - * out from under us somehow, which is bad but we're not going - * to fix it here, OR because it is the ROM MAP, which has a - * fileRef, but can't be gotten to by PBGetFCBInfo. - */ - if ((err == noErr) - && (newFileRec.ioFCBVRefNum == oldFileRec.ioFCBVRefNum) - && (newFileRec.ioFCBFlNm == oldFileRec.ioFCBFlNm)) { - /* - * In MacOS 8.1 it seems like we get different file refs even - * though we pass the same file & permissions. This is not - * what Inside Mac says should happen, but it does, so if it - * does, then close the new res file and return the original - * one... - */ - - if (filePermissionFlag == ((oldFileRec.ioFCBFlags >> 12) & 0x1)) { - CloseResFile(fileRef); - new = 0; - break; - } else { - if (tokenPtr != NULL) { - Tcl_SetStringObj(tokenPtr, "Resource already open with different permissions.", -1); - } - return TCL_ERROR; - } - } - resourceHashPtr = Tcl_NextHashEntry(&search); - } - } - - - /* - * If the file has already been opened with these same permissions, then it - * will be in our list and we will have set new to 0 above. - * So we will just return the token (if tokenPtr is non-null) - */ - - if (new) { - resourceHashPtr = Tcl_CreateHashEntry(&resourceTable, - (char *) fileRef, &new); - } - - if (!new) { - if (tokenPtr != NULL) { - resourceId = (char *) Tcl_GetHashValue(resourceHashPtr); - Tcl_SetStringObj(tokenPtr, resourceId, -1); - } - return TCL_OK; - } - - /* - * If we were passed in a result pointer which is not an empty - * string, attempt to use that as the key. If the key already - * exists, silently fall back on resource%d... - */ - - if (tokenPtr != NULL) { - char *tokenVal; - int length; - tokenVal = (char *) Tcl_GetStringFromObj(tokenPtr, &length); - if (length > 0) { - nameHashPtr = Tcl_FindHashEntry(&nameTable, tokenVal); - if (nameHashPtr == NULL) { - resourceId = ckalloc(length + 1); - memcpy(resourceId, tokenVal, length); - resourceId[length] = '\0'; - } - } - } - - if (resourceId == NULL) { - resourceId = (char *) ckalloc(15); - sprintf(resourceId, "resource%d", newId); - } - - Tcl_SetHashValue(resourceHashPtr, resourceId); - newId++; - - nameHashPtr = Tcl_CreateHashEntry(&nameTable, resourceId, &new); - if (!new) { - panic("resource id has repeated itself"); - } - - resourceRef = (OpenResourceFork *) ckalloc(sizeof(OpenResourceFork)); - resourceRef->fileRef = fileRef; - resourceRef->flags = flags; - - Tcl_SetHashValue(nameHashPtr, (ClientData) resourceRef); - if (tokenPtr != NULL) { - Tcl_SetStringObj(tokenPtr, resourceId, -1); - } - - if (flags & TCL_RESOURCE_INSERT_TAIL) { - Tcl_ListObjAppendElement(NULL, resourceForkList, tokenPtr); - } else { - Tcl_ListObjReplace(NULL, resourceForkList, 0, 0, 1, &tokenPtr); - } - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TclMacUnRegisterResourceFork -- - * - * Removes the entry for an open resource fork from the table of - * open resources managed by the procedures in this file. - * If resultPtr is not NULL, it will be used for error reporting. - * - * Results: - * The fileRef for this token, or -1 if an error occured. - * - * Side effects: - * An entry is removed from the resource name table. - * - *---------------------------------------------------------------------- - */ - -short -TclMacUnRegisterResourceFork( - char *tokenPtr, - Tcl_Obj *resultPtr) - -{ - Tcl_HashEntry *resourceHashPtr; - Tcl_HashEntry *nameHashPtr; - OpenResourceFork *resourceRef; - char *resourceId = NULL; - short fileRef; - char *bytes; - int i, match, index, listLen, length, elemLen; - Tcl_Obj **elemPtrs; - - - nameHashPtr = Tcl_FindHashEntry(&nameTable, tokenPtr); - if (nameHashPtr == NULL) { - if (resultPtr != NULL) { - Tcl_AppendStringsToObj(resultPtr, - "invalid resource file reference \"", - tokenPtr, "\"", (char *) NULL); - } - return -1; - } - - resourceRef = (OpenResourceFork *) Tcl_GetHashValue(nameHashPtr); - fileRef = resourceRef->fileRef; - - if ( resourceRef->flags & TCL_RESOURCE_DONT_CLOSE ) { - if (resultPtr != NULL) { - Tcl_AppendStringsToObj(resultPtr, - "can't close \"", tokenPtr, "\" resource file", - (char *) NULL); - } - return -1; - } - - Tcl_DeleteHashEntry(nameHashPtr); - ckfree((char *) resourceRef); - - - /* - * Now remove the resource from the resourceForkList object - */ - - Tcl_ListObjGetElements(NULL, resourceForkList, &listLen, &elemPtrs); - - - index = -1; - length = strlen(tokenPtr); - - for (i = 0; i < listLen; i++) { - match = 0; - bytes = Tcl_GetStringFromObj(elemPtrs[i], &elemLen); - if (length == elemLen) { - match = (memcmp(bytes, tokenPtr, - (size_t) length) == 0); - } - if (match) { - index = i; - break; - } - } - if (!match) { - panic("the resource Fork List is out of synch!"); - } - - Tcl_ListObjReplace(NULL, resourceForkList, index, 1, 0, NULL); - - resourceHashPtr = Tcl_FindHashEntry(&resourceTable, (char *) fileRef); - - if (resourceHashPtr == NULL) { - panic("Resource & Name tables are out of synch in resource command."); - } - ckfree(Tcl_GetHashValue(resourceHashPtr)); - Tcl_DeleteHashEntry(resourceHashPtr); - - return fileRef; - -} - - -/* - *---------------------------------------------------------------------- - * - * BuildResourceForkList -- - * - * Traverses the list of open resource forks, and builds the - * list of resources forks. Also creates a resource token for any that - * are opened but not registered with our resource system. - * This is based on code from Apple DTS. - * - * Results: - * None. - * - * Side effects: - * The list of resource forks is updated. - * The resource name table may be augmented. - * - *---------------------------------------------------------------------- - */ - -void -BuildResourceForkList() -{ - Handle currentMapHandle, mSysMapHandle; - Ptr tempPtr; - FCBPBRec fileRec; - char fileName[256]; - char appName[62]; - Tcl_Obj *nameObj; - OSErr err; - ProcessSerialNumber psn; - ProcessInfoRec info; - FSSpec fileSpec; - - /* - * Get the application name, so we can substitute - * the token "application" for the application's resource. - */ - - GetCurrentProcess(&psn); - info.processInfoLength = sizeof(ProcessInfoRec); - info.processName = (StringPtr) &appName; - info.processAppSpec = &fileSpec; - GetProcessInformation(&psn, &info); - p2cstr((StringPtr) appName); - - - fileRec.ioCompletion = NULL; - fileRec.ioVRefNum = 0; - fileRec.ioFCBIndx = 0; - fileRec.ioNamePtr = (StringPtr) &fileName; - - - currentMapHandle = LMGetTopMapHndl(); - mSysMapHandle = LMGetSysMapHndl(); - - while (1) { - /* - * Now do the ones opened after the application. - */ - - nameObj = Tcl_NewObj(); - - tempPtr = *currentMapHandle; - - fileRec.ioRefNum = *((short *) (tempPtr + 20)); - err = PBGetFCBInfo(&fileRec, false); - - if (err != noErr) { - /* - * The ROM resource map does not correspond to an opened file... - */ - Tcl_SetStringObj(nameObj, "ROM Map", -1); - } else { - p2cstr((StringPtr) fileName); - if (strcmp(fileName,(char *) appName) == 0) { - Tcl_SetStringObj(nameObj, "application", -1); - } else { - Tcl_SetStringObj(nameObj, fileName, -1); - } - c2pstr(fileName); - } - - TclMacRegisterResourceFork(fileRec.ioRefNum, nameObj, - TCL_RESOURCE_DONT_CLOSE | TCL_RESOURCE_INSERT_TAIL); - - if (currentMapHandle == mSysMapHandle) { - break; - } - - currentMapHandle = *((Handle *) (tempPtr + 16)); - } -} diff --git a/mac/tclMacResource.r b/mac/tclMacResource.r deleted file mode 100644 index f9376db..0000000 --- a/mac/tclMacResource.r +++ /dev/null @@ -1,90 +0,0 @@ -/* - * tclMacResource.r -- - * - * This file creates resources for use in a simple shell. - * This is designed to be an example of using the Tcl libraries - * statically in a Macintosh Application. For an example of - * of using the dynamic libraries look at tclMacApplication.r. - * - * Copyright (c) 1993-94 Lockheed Missle & Space Company - * Copyright (c) 1994-97 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacResource.r,v 1.3 1999/04/16 00:47:21 stanton Exp $ - */ - -#include -#include - -/* - * The folowing include and defines help construct - * the version string for Tcl. - */ - -#define RESOURCE_INCLUDED -#include "tcl.h" - -#if (TCL_RELEASE_LEVEL == 0) -# define RELEASE_LEVEL alpha -#elif (TCL_RELEASE_LEVEL == 1) -# define RELEASE_LEVEL beta -#elif (TCL_RELEASE_LEVEL == 2) -# define RELEASE_LEVEL final -#endif - -#if (TCL_RELEASE_LEVEL == 2) -# define MINOR_VERSION (TCL_MINOR_VERSION * 16) + TCL_RELEASE_SERIAL -#else -# define MINOR_VERSION TCL_MINOR_VERSION * 16 -#endif - -resource 'vers' (1) { - TCL_MAJOR_VERSION, MINOR_VERSION, - RELEASE_LEVEL, 0x00, verUS, - TCL_PATCH_LEVEL, - TCL_PATCH_LEVEL ", by Ray Johnson © Sun Microsystems" -}; - -resource 'vers' (2) { - TCL_MAJOR_VERSION, MINOR_VERSION, - RELEASE_LEVEL, 0x00, verUS, - TCL_PATCH_LEVEL, - "Simple Tcl Shell " TCL_PATCH_LEVEL " © 1996" -}; - - -/* - * The mechanisim below loads Tcl source into the resource fork of the - * application. The example below creates a TEXT resource named - * "Init" from the file "init.tcl". This allows applications to use - * Tcl to define the behavior of the application without having to - * require some predetermined file structure - all needed Tcl "files" - * are located within the application. To source a file for the - * resource fork the source command has been modified to support - * sourcing from resources. In the below case "source -rsrc {Init}" - * will load the TEXT resource named "Init". - */ - -#include "tclMacTclCode.r" - -/* - * The following resource is used when creating the 'env' variable in - * the Macintosh environment. The creation mechanisim looks for the - * 'STR#' resource named "Tcl Environment Variables" rather than a - * specific resource number. (In other words, feel free to change the - * resource id if it conflicts with your application.) Each string in - * the resource must be of the form "KEYWORD=SOME STRING". See Tcl - * documentation for futher information about the env variable. - * - * A good example of something you may want to set is: "TCL_LIBRARY=My - * disk:etc." - */ - -resource 'STR#' (128, "Tcl Environment Variables") { - { "SCHEDULE_NAME=Agent Controller Schedule", - "SCHEDULE_PATH=Lozoya:System Folder:Tcl Lib:Tcl-Scheduler" - }; -}; - diff --git a/mac/tclMacShLib.exp b/mac/tclMacShLib.exp deleted file mode 100644 index 020380f..0000000 --- a/mac/tclMacShLib.exp +++ /dev/null @@ -1,1066 +0,0 @@ -AddrToName -AddrToStr -BuildAFPVolMountInfo -BumpDate -ChangeCreatorType -ChangeFDFlags -CheckObjectLock -CheckVolLock -ClearHasBeenInited -ClearHasCustomIcon -ClearIsInvisible -ClearIsStationery -ClearNameLocked -CloseResolver -ConfigureMemory -CopyDirectoryAccess -CopyFileMgrAttributes -CopyFork -CreateFileIDRef -DTCopyComment -DTGetIcon -DTOpen -DTSetComment -DeleteDirectory -DeleteDirectoryContents -DeleteFileIDRef -DetermineVRefNum -DirectoryCopy -EnumCache -##EnvStr -ExchangeFiles -FSMakeFSSpecCompat -FSReadNoCache -FSWriteNoCache -FSWriteVerify -FSpBumpDate -FSpCatMoveCompat -FSpChangeCreatorType -FSpChangeFDFlags -FSpCheckObjectLock -FSpClearHasBeenInited -FSpClearHasCustomIcon -FSpClearIsInvisible -FSpClearIsStationery -FSpClearNameLocked -FSpCopyDirectoryAccess -FSpCopyFile -FSpCopyFileMgrAttributes -FSpCreateCompat -FSpCreateFileIDRef -FSpCreateMinimum -FSpCreateResFileCompat -FSpDTCopyComment -FSpDTSetComment -FSpDeleteCompat -FSpDirCreateCompat -FSpDirectoryCopy -FSpExchangeFilesCompat -FSpFileCopy -FSpFilteredDirectoryCopy -FSpFindFolder -FSpGetDInfo -FSpGetDefaultDir -FSpGetDirAccess -FSpGetDirectoryID -FSpGetFInfoCompat -FSpGetFLockCompat -FSpGetFileLocation -FSpGetFileSize -FSpGetForeignPrivs -FSpGetFullPath -FSpGetIOACUser -FSpLocationFromFullPath -FSpLocationFromPath -FSpMoveRename -FSpMoveRenameCompat -FSpOpenAware -FSpOpenDFCompat -FSpOpenRFAware -FSpOpenRFCompat -FSpOpenResFileCompat -FSpPathFromLocation -FSpRenameCompat -FSpResolveFileIDRef -FSpRstFLockCompat -FSpSetDInfo -FSpSetDefaultDir -FSpSetDirAccess -FSpSetFInfoCompat -FSpSetFLockCompat -FSpSetForeignPrivs -FSpSetHasCustomIcon -FSpSetIsInvisible -FSpSetIsStationery -FSpSetNameLocked -FSpShare -FSpUnshare -FileCopy -FilteredDirectoryCopy -FindDrive -FlushFile -FreeAllMemory -GetCPanelFolder -GetCatInfoNoName -GetDInfo -GetDirItems -GetDirName -GetDirectoryID -GetDiskBlocks -GetDriverName -GetFileLocation -GetFileSize -GetFilenameFromPathname -GetForeignPrivs -GetFullPath -GetGlobalMouse -GetIOACUser -GetObjectLocation -GetParentID -GetSystemFolder -GetTempBuffer -GetTrapType -GetUGEntries -GetUGEntry -GetVolMountInfo -GetVolMountInfoSize -GetVolumeInfoNoName -HCopyFile -HCreateMinimum -HGetDirAccess -HGetLogInInfo -HGetVInfo -HGetVolParms -HInfo -HMapID -HMapName -HMoveRename -HMoveRenameCompat -HOpenAware -HOpenRFAware -hypotd -HSetDirAccess -InstallConsole -LocationFromFullPath -LockRange -MXInfo -NumToolboxTraps -OnLine -OpenOurRF -OpenResolver -PBXGetVolInfoSync -ReadCharsFromConsole -RemoveConsole -ResolveFileIDRef -RestoreDefault -RetrieveAFPVolMountInfo -SIOUXBigRect -SIOUXCantSaveAlert -SIOUXDoAboutBox -SIOUXDoContentClick -SIOUXDoEditClear -SIOUXDoEditCopy -SIOUXDoEditCut -SIOUXDoEditPaste -SIOUXDoEditSelectAll -SIOUXDoMenuChoice -SIOUXDoPageSetup -SIOUXDoPrintText -SIOUXDoSaveText -SIOUXDragRect -SIOUXDrawGrowBox -SIOUXHandleOneEvent -SIOUXIsAppWindow -SIOUXMyGrowWindow -SIOUXQuitting -SIOUXSetTitle -SIOUXSettings -SIOUXSetupMenus -SIOUXSetupTextWindow -SIOUXState -SIOUXTextWindow -SIOUXUpdateMenuItems -SIOUXUpdateScrollbar -SIOUXUpdateStatusLine -SIOUXUpdateWindow -SIOUXUseWaitNextEvent -SIOUXYesNoCancelAlert -SIOUXisinrange -SIOUXselstart -SearchFolderForDNRP -SetDInfo -SetDefault -SetForeignPrivs -SetHasCustomIcon -SetIsInvisible -SetIsStationery -SetNameLocked -Share -StrToAddr -TclAccess -TclAllocateFreeObjects -TclChdir -TclCleanupByteCode -TclCleanupCommand -TclCompileBreakCmd -TclCompileCatchCmd -TclCompileContinueCmd -TclCompileDollarVar -TclCompileExpr -TclCompileExprCmd -TclCompileForCmd -TclCompileForeachCmd -TclCompileIfCmd -TclCompileIncrCmd -TclCompileQuotes -TclCompileSetCmd -TclCompileString -TclCompileWhileCmd -TclCopyAndCollapse -TclCopyChannel -TclCreateAuxData -TclCreateExecEnv -TclDate_TclDates -TclDate_TclDatev -TclDateact -TclDatechar -TclDatechk -TclDatedebug -TclDatedef -TclDateerrflag -TclDateexca -TclDatelval -TclDatenerrs -TclDatepact -TclDateparse -TclDatepgo -TclDateps -TclDatepv -TclDater1 -TclDater2 -TclDates -TclDatestate -TclDatetmp -TclDatev -TclDateval -TclDeleteCompiledLocalVars -TclDeleteExecEnv -TclDeleteVars -TclDoGlob -TclEmitForwardJump -TclExecuteByteCode -TclExpandCodeArray -TclExpandJumpFixupArray -TclExprFloatError -TclFileAttrsCmd -TclFileCopyCmd -TclFileDeleteCmd -TclFileMakeDirsCmd -TclFileRenameCmd -TclFindElement -TclFindProc -TclFixupForwardJump -TclFormatInt -TclFreeCompileEnv -TclFreeJumpFixupArray -TclFreeObj -TclFreePackageInfo -TclGetCwd -TclGetDate -TclGetDefaultStdChannel -TclGetElementOfIndexedArray -TclGetEnv -TclGetExceptionRangeForPc -TclGetExtension -TclGetFrame -TclGetIndexedScalar -TclGetIntForIndex -TclGetLoadedPackages -TclGetLong -TclGetNamespaceForQualName -TclGetOpenMode -TclGetOriginalCommand -TclGetRegError -TclGetSrcInfoForPc -TclGetUserHome -TclGlobalInvoke -TclGuessPackageName -TclHasSockets -TclHideUnsafeCommands -TclInExit -TclIncrElementOfIndexedArray -TclIncrIndexedScalar -TclIncrVar2 -TclInitByteCodeObj -TclInitCompileEnv -TclInitJumpFixupArray -TclInitNamespaces -TclInterpInit -TclInvoke -TclInvokeObjectCommand -TclInvokeStringCommand -TclIsProc -TclLoadFile -TclLooksLikeInt -TclLookupVar -TclpAccess -TclMacCreateEnv -TclMacExitHandler -TclMacFOpenHack -TclMacInitExitToShell -TclMacInstallExitToShellPatch -TclMacOSErrorToPosixError -TclMacReadlink -TclMacRemoveTimer -TclMacStartTimer -TclpStat -TclMacTimerExpired -TclMatchFiles -TclNeedSpace -TclObjIndexForString -TclObjInterpProc -TclObjInvoke -TclObjInvokeGlobal -TclPlatformExit -TclPlatformInit -TclPreventAliasLoop -TclPrintByteCodeObj -TclPrintInstruction -TclPrintSource -TclRegComp -TclRegError -TclRegExec -TclRenameCommand -TclResetShadowedCmdRefs -TclServiceIdle -TclSetElementOfIndexedArray -TclSetEnv -TclSetIndexedScalar -TclSetupEnv -TclSockGetPort -TclStat -TclTeardownNamespace -TclTestChannelCmd -TclTestChannelEventCmd -TclUnsetEnv -TclUpdateReturnInfo -TclWordEnd -Tcl_AddErrorInfo -Tcl_AddObjErrorInfo -Tcl_AfterCmd -Tcl_Alloc -Tcl_AllowExceptions -Tcl_AppendAllObjTypes -Tcl_AppendElement -Tcl_AppendObjCmd -Tcl_AppendResult -Tcl_AppendStringsToObj -Tcl_AppendToObj -Tcl_ArrayObjCmd -Tcl_AsyncCreate -Tcl_AsyncDelete -Tcl_AsyncInvoke -Tcl_AsyncMark -Tcl_AsyncReady -Tcl_BackgroundError -Tcl_Backslash -Tcl_BeepObjCmd -Tcl_BinaryObjCmd -Tcl_BreakCmd -Tcl_CallWhenDeleted -Tcl_CancelIdleCall -Tcl_CaseObjCmd -Tcl_CatchObjCmd -Tcl_ClockObjCmd -Tcl_Close -Tcl_CommandComplete -Tcl_Concat -Tcl_ConcatObj -Tcl_ConcatObjCmd -Tcl_ContinueCmd -Tcl_ConvertCountedElement -Tcl_ConvertElement -Tcl_ConvertToType -Tcl_CreateAlias -Tcl_CreateAliasObj -Tcl_CreateChannel -Tcl_CreateChannelHandler -Tcl_CreateCloseHandler -Tcl_CreateCommand -Tcl_CreateEventSource -Tcl_CreateExitHandler -Tcl_CreateInterp -Tcl_CreateMathFunc -Tcl_CreateNamespace -Tcl_CreateObjCommand -Tcl_CreateSlave -Tcl_CreateTimerHandler -Tcl_CreateTrace -Tcl_DStringAppend -Tcl_DStringAppendElement -Tcl_DStringEndSublist -Tcl_DStringFree -Tcl_DStringGetResult -Tcl_DStringInit -Tcl_DStringResult -Tcl_DStringSetLength -Tcl_DStringStartSublist -Tcl_DbCkalloc -Tcl_DbCkfree -Tcl_DbCkrealloc -Tcl_DbDecrRefCount -Tcl_DbIsShared -Tcl_DbIncrRefCount -Tcl_DbNewBooleanObj -Tcl_DbNewDoubleObj -Tcl_DbNewListObj -Tcl_DbNewLongObj -Tcl_DbNewObj -Tcl_DbNewStringObj -Tcl_DeleteAssocData -Tcl_DeleteChannelHandler -Tcl_DeleteCloseHandler -Tcl_DeleteCommand -Tcl_DeleteCommandFromToken -Tcl_DeleteEventSource -Tcl_DeleteEvents -Tcl_DeleteExitHandler -Tcl_DeleteHashEntry -Tcl_DeleteHashTable -Tcl_DeleteInterp -Tcl_DeleteNamespace -Tcl_DeleteTimerHandler -Tcl_DeleteTrace -Tcl_DoOneEvent -Tcl_DoWhenIdle -Tcl_DontCallWhenDeleted -Tcl_DumpActiveMemory -Tcl_DuplicateObj -Tcl_EchoCmd -Tcl_Eof -Tcl_ErrnoId -Tcl_ErrnoMsg -Tcl_ErrorObjCmd -Tcl_Eval -Tcl_EvalFile -Tcl_EvalObj -Tcl_EvalObjCmd -Tcl_EventuallyFree -Tcl_ExecCmd -Tcl_Exit -Tcl_ExitObjCmd -Tcl_ExposeCommand -Tcl_ExprBoolean -Tcl_ExprBooleanObj -Tcl_ExprDouble -Tcl_ExprDoubleObj -Tcl_ExprLong -Tcl_ExprLongObj -Tcl_ExprObjCmd -Tcl_ExprString -Tcl_FconfigureCmd -Tcl_FcopyObjCmd -Tcl_FileEventCmd -Tcl_FileObjCmd -Tcl_Finalize -Tcl_FindCommand -Tcl_FindExecutable -Tcl_FindNamespace -Tcl_FindNamespaceVar -Tcl_FirstHashEntry -Tcl_Flush -Tcl_FlushObjCmd -Tcl_ForCmd -Tcl_ForeachObjCmd -Tcl_ForgetImport -Tcl_FormatCmd -Tcl_Free -Tcl_FreeResult -Tcl_GetAlias -Tcl_GetAliasObj -Tcl_GetAssocData -Tcl_GetBoolean -Tcl_GetBooleanFromObj -Tcl_GetChannel -Tcl_GetChannelBufferSize -Tcl_GetChannelHandle -Tcl_GetChannelInstanceData -Tcl_GetChannelMode -Tcl_GetChannelName -Tcl_GetChannelOption -Tcl_GetChannelType -Tcl_GetCommandFromObj -Tcl_GetCommandFullName -Tcl_GetCommandInfo -Tcl_GetCommandName -Tcl_GetCurrentNamespace -Tcl_GetDouble -Tcl_GetDoubleFromObj -Tcl_GetErrno -Tcl_GetGlobalNamespace -Tcl_GetHostName -Tcl_GetIndexFromObj -Tcl_GetInt -Tcl_GetIntFromObj -Tcl_GetInterpPath -Tcl_GetLongFromObj -Tcl_GetMaster -Tcl_GetOSTypeFromObj -Tcl_GetObjResult -Tcl_GetObjType -Tcl_GetPathType -Tcl_GetServiceMode -Tcl_GetSlave -Tcl_GetStdChannel -Tcl_GetStringFromObj -Tcl_GetStringResult -Tcl_GetVar -Tcl_GetVar2 -Tcl_GetVariableFullName -Tcl_Gets -Tcl_GetsObj -Tcl_GetsObjCmd -Tcl_GlobCmd -Tcl_GlobalEval -Tcl_GlobalEvalObj -Tcl_GlobalObjCmd -Tcl_HashStats -Tcl_HideCommand -Tcl_IfCmd -Tcl_Import -Tcl_IncrCmd -Tcl_InfoObjCmd -Tcl_Init -Tcl_InitHashTable -Tcl_InitMemory -Tcl_InputBlocked -Tcl_InputBuffered -Tcl_InterpDeleted -Tcl_InterpObjCmd -Tcl_IsSafe -Tcl_JoinObjCmd -Tcl_JoinPath -Tcl_LappendObjCmd -Tcl_LindexObjCmd -Tcl_LinkVar -Tcl_LinsertObjCmd -Tcl_ListObjAppendElement -Tcl_ListObjAppendList -Tcl_ListObjCmd -Tcl_ListObjGetElements -Tcl_ListObjIndex -Tcl_ListObjLength -Tcl_ListObjReplace -Tcl_LlengthObjCmd -Tcl_LoadCmd -Tcl_LrangeObjCmd -Tcl_LreplaceObjCmd -Tcl_LsCmd -Tcl_LsearchObjCmd -Tcl_LsortObjCmd -Tcl_MacConvertTextResource -Tcl_MacEvalResource -Tcl_MacFindResource -Tcl_MacSetEventProc -Tcl_MacSourceObjCmd -Tcl_Main -Tcl_MakeSafe -Tcl_MakeTcpClientChannel -Tcl_Merge -Tcl_NamespaceObjCmd -Tcl_NewBooleanObj -Tcl_NewDoubleObj -Tcl_NewIntObj -Tcl_NewListObj -Tcl_NewLongObj -Tcl_NewOSTypeObj -Tcl_NewObj -Tcl_NewStringObj -Tcl_NextHashEntry -Tcl_NotifyChannel -Tcl_ObjGetVar2 -Tcl_ObjSetVar2 -Tcl_OpenCmd -Tcl_OpenFileChannel -Tcl_OpenTcpClient -Tcl_OpenTcpServer -Tcl_PackageCmd -Tcl_ParseVar -Tcl_PidObjCmd -Tcl_PkgProvide -Tcl_PkgRequire -Tcl_PopCallFrame -Tcl_PosixError -Tcl_Preserve -Tcl_PrintDouble -Tcl_ProcObjCmd -Tcl_PushCallFrame -Tcl_PutEnv -Tcl_PutsObjCmd -Tcl_PwdCmd -Tcl_QueueEvent -Tcl_Read -Tcl_ReadObjCmd -Tcl_Realloc -Tcl_RecordAndEval -Tcl_RegExpCompile -Tcl_RegExpExec -Tcl_RegExpMatch -Tcl_RegExpRange -Tcl_RegexpCmd -Tcl_RegisterChannel -Tcl_RegisterObjType -Tcl_RegsubCmd -Tcl_Release -Tcl_RenameObjCmd -Tcl_ResetResult -Tcl_ResourceObjCmd -Tcl_ReturnObjCmd -Tcl_ScanCmd -Tcl_ScanCountedElement -Tcl_ScanElement -Tcl_Seek -Tcl_SeekCmd -Tcl_ServiceAll -Tcl_ServiceEvent -Tcl_SetAssocData -Tcl_SetBooleanObj -Tcl_SetChannelBufferSize -Tcl_SetChannelOption -Tcl_SetCmd -Tcl_SetCommandInfo -Tcl_SetDoubleObj -Tcl_SetErrno -Tcl_SetErrorCode -Tcl_SetIntObj -Tcl_SetListObj -Tcl_SetLongObj -Tcl_SetMaxBlockTime -Tcl_SetOSTypeObj -Tcl_SetObjErrorCode -Tcl_SetObjLength -Tcl_SetObjResult -Tcl_SetPanicProc -Tcl_SetRecursionLimit -Tcl_SetResult -Tcl_SetServiceMode -Tcl_SetStdChannel -Tcl_SetStringObj -Tcl_SetTimer -Tcl_SetVar -Tcl_SetVar2 -Tcl_SignalId -Tcl_SignalMsg -Tcl_Sleep -Tcl_SocketCmd -Tcl_SourceObjCmd -Tcl_SourceRCFile -Tcl_SplitList -Tcl_SplitPath -Tcl_StaticPackage -Tcl_StringMatch -Tcl_StringObjCmd -Tcl_SubstCmd -Tcl_SwitchObjCmd -Tcl_Tell -Tcl_TellCmd -Tcl_TimeObjCmd -Tcl_TraceCmd -Tcl_TraceVar -Tcl_TraceVar2 -Tcl_TranslateFileName -Tcl_Ungets -Tcl_UnlinkVar -Tcl_UnregisterChannel -Tcl_UnsetObjCmd -Tcl_UnsetVar -Tcl_UnsetVar2 -Tcl_UntraceVar -Tcl_UntraceVar2 -Tcl_UpVar -Tcl_UpVar2 -Tcl_UpdateCmd -Tcl_UpdateLinkedVar -Tcl_UplevelObjCmd -Tcl_UpvarObjCmd -Tcl_ValidateAllMemory -Tcl_VarEval -Tcl_VarTraceInfo -Tcl_VarTraceInfo2 -Tcl_VariableObjCmd -Tcl_VwaitCmd -Tcl_WaitForEvent -Tcl_WaitPid -Tcl_WhileCmd -Tcl_Write -Tcl_WrongNumArgs -TclpAlloc -TclpCopyDirectory -TclpCopyFile -TclpCreateDirectory -TclpDeleteFile -TclpFree -TclpGetClicks -TclpGetDate -TclpGetSeconds -TclpGetTime -TclpGetTimeZone -TclpListVolumes -TclpRealloc -TclpRemoveDirectory -TclpRenameFile -TrapExists -TruncPString -UnlockRange -UnmountAndEject -Unshare -VolumeMount -WriteCharsToConsole -XGetVInfo -_Ctype -_Stderr -_Stoul -abort -abs -acosf -appMemory -asctime -asinf -atan -atan2 -atan2_d_dd -atan2_d_pdpd -atan2_r_prpr -atan2_r_rr -atan2f -atan_d_d -atan_d_pd -atan_r_pr -atan_r_r -atanf -atexit -atof -atoi -atol -bsearch -builtinFuncTable -calloc -ccommand -ceilf -chdir -clearerr -clock -close -closeUPP -completeUPP -cos -cos_d_d -cos_d_pd -cos_r_pr -cos_r_r -cosf -coshf -creat -ctime -cuserid -difftime -div -environ -errno -exec -exit -exp -exp_d_d -exp_d_pd -exp_r_pr -exp_r_r -expf -fabsf -fclose -fcntl -fdopen -feof -ferror -fflush -fgetc -fgetpos -fgets -fileno -floorf -fmodf -fopen -fprintf -fputc -fputs -fread -free -freopen -frexpf -fscanf -fseek -fsetpos -fstat -ftell -fwrite -getStdChannelsProc -getc -getchar -getcwd -getenv -getlogin -gets -gmtime -instructionTable -isalnum -isalpha -isatty -iscntrl -isdigit -isgraph -islower -isprint -ispunct -isspace -isupper -isxdigit -labs -ldexpf -ldiv -localeconv -localtime -log -log10 -log10_d_d -log10_d_pd -log10f -log_d_d -log_d_pd -logf -longjmp -lseek -malloc -mblen -mbstowcs -mbtowc -memchr -memcmp -memcpy -memmove -memset -mkdir -mktime -open -panic -panicProc -perror -pow -power_d_dd -powf -printf -putc -putchar -puts -qsort -raise -rand -read -realloc -remove -rename -resultUPP -rewind -rmdir -scanf -setbuf -setlocale -setvbuf -signal -sin -sin_d_d -sin_d_pd -sin_r_pr -sin_r_r -sinf -sinhf -sleep -sprintf -sqrt -sqrt_d_d -sqrt_d_pd -sqrt_r_pr -sqrt_r_r -sqrtf -srand -sscanf -stat -strcasecmp -strcat -strchr -strcmp -strcoll -strcpy -strcspn -strerror -strftime -strlen -strncasecmp -strncat -strncmp -strncpy -strpbrk -strrchr -strspn -strstr -strtod -strtok -strtol -strtoul -strxfrm -system -systemMemory -tanf -tanhf -tclBooleanType -tclByteCodeType -tclCmdNameType -tclDoubleType -tclDummyLinkVarPtr -tclExecutableName -tclFreeObjList -tclIndexType -tclIntType -tclListType -tclMemDumpFileName -tclNsNameType -tclPlatform -tclStringType -tclTraceCompile -tclTraceExec -tclTypeTable -tcl_MathInProgress -tclpFileAttrProcs -tclpFileAttrStrings -tell -time -tmpfile -tmpnam -tolower -toupper -ttyname -uname -ungetc -unlink -utime -utimes -vfprintf -vprintf -vsprintf -wcstombs -wctob -wctomb -write -#DTGetAPPL -#DTGetComment -#FSpDTGetAPPL -#FSpDTGetComment -#TclMacInitializeFragment -#TclMacTerminateFragment -#_Aldata -#_Assert -#_Atcount -#_Atfuns -#_Clocale -#_Closreg -#_Costate -#_Daysto -#_Dbl -#_Defloc -#_Environ -#_Environ1 -#_Fgpos -#_Files -#_Flt -#_Fopen -#_Foprep -#_Fread -#_Freeloc -#_Frprep -#_Fspos -#_Fwprep -#_Fwrite -#_Genld -#_Gentime -#_Getdst -#_Getfld -#_Getfloat -#_Getint -#_Getloc -#_Getmem -#_Getstr -#_Gettime -#_Getzone -#_Isdst -#_Ldbl -#_Ldtob -#_Litob -#_Locale -#_Locsum -#_Loctab -#_Locterm -#_Locvar -#_MWERKS_Atcount -#_MWERKS_Atfuns -#_Makeloc -#_Makestab -#_Makewct -#_Mbcurmax -#_Mbstate -#_Mbtowc -#_Nnl -#_PJP_C_Copyright -#_Printf -#_Putfld -#_Putstr -#_Puttxt -#_Randseed -#_Readloc -#_Scanf -#_Setloc -#_Skip -#_Stdin -#_Stdout -#_Stod -#_Stof -#_Stoflt -#_Stold -#_Strerror -#_Strftime -#_Strxfrm -#_Times -#_Tolower -#_Toupper -#_Ttotm -#_WCostate -#_Wcstate -#_Wctob -#_Wctomb -#_Wctrans -#_Wctype -#__CheckForSystem7 -#__RemoveConsoleHandler__ -#__aborting -#__ctopstring -#__cvt_fp2unsigned -#__getcreator -#__gettype -#__initialize -#__myraise -#__ptmf_null -#__ptr_glue -#__system7present -#__terminate -#__ttyname -#_atexit -#_exit -#_fcreator -#_ftype diff --git a/mac/tclMacSock.c b/mac/tclMacSock.c deleted file mode 100644 index d387cb5..0000000 --- a/mac/tclMacSock.c +++ /dev/null @@ -1,2637 +0,0 @@ -/* - * tclMacSock.c - * - * Channel drivers for Macintosh sockets. - * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclMacSock.c,v 1.4 1999/04/16 00:47:21 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclMacInt.h" -#include -#include -#undef Status -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * The following variable is used to tell whether this module has been - * initialized. - */ - -static int initialized = 0; - -/* - * If debugging is on we may drop into the debugger to handle certain cases - * that are not supposed to happen. Otherwise, we change ignore the error - * and most code should handle such errors ok. - */ - -#ifndef TCL_DEBUG - #define Debugger() -#endif - -/* - * The preferred buffer size for Macintosh channels. - */ - -#define CHANNEL_BUF_SIZE 8192 - -/* - * Port information structure. Used to match service names - * to a Tcp/Ip port number. - */ - -typedef struct { - char *name; /* Name of service. */ - int port; /* Port number. */ -} PortInfo; - -/* - * This structure describes per-instance state of a tcp based channel. - */ - -typedef struct TcpState { - TCPiopb pb; /* Parameter block used by this stream. - * This must be in the first position. */ - ProcessSerialNumber psn; /* PSN used to wake up process. */ - StreamPtr tcpStream; /* Macintosh tcp stream pointer. */ - int port; /* The port we are connected to. */ - int flags; /* Bit field comprised of the flags - * described below. */ - int checkMask; /* OR'ed combination of TCL_READABLE and - * TCL_WRITABLE as set by an asynchronous - * event handler. */ - int watchMask; /* OR'ed combination of TCL_READABLE and - * TCL_WRITABLE as set by Tcl_WatchFile. */ - Tcl_TcpAcceptProc *acceptProc; /* Proc to call on accept. */ - ClientData acceptProcData; /* The data for the accept proc. */ - wdsEntry dataSegment[2]; /* List of buffers to be written async. */ - rdsEntry rdsarray[5+1]; /* Array used when cleaning out recieve - * buffers on a closing socket. */ - Tcl_Channel channel; /* Channel associated with this socket. */ - struct TcpState *nextPtr; /* The next socket on the global socket - * list. */ -} TcpState; - -/* - * This structure is used by domain name resolver callback. - */ - -typedef struct DNRState { - struct hostInfo hostInfo; /* Data structure used by DNR functions. */ - int done; /* Flag to determine when we are done. */ - ProcessSerialNumber psn; /* Process to wake up when we are done. */ -} DNRState; - -/* - * The following macros may be used to set the flags field of - * a TcpState structure. - */ - -#define TCP_ASYNC_SOCKET (1<<0) /* The socket is in async mode. */ -#define TCP_ASYNC_CONNECT (1<<1) /* The socket is trying to connect. */ -#define TCP_CONNECTED (1<<2) /* The socket is connected. */ -#define TCP_PENDING (1<<3) /* A SocketEvent is on the queue. */ -#define TCP_LISTENING (1<<4) /* This socket is listening for - * a connection. */ -#define TCP_LISTEN_CONNECT (1<<5) /* Someone has connect to the - * listening port. */ -#define TCP_REMOTE_CLOSED (1<<6) /* The remote side has closed - * the connection. */ -#define TCP_RELEASE (1<<7) /* The socket may now be released. */ -#define TCP_WRITING (1<<8) /* A background write is in progress. */ -#define TCP_SERVER_ZOMBIE (1<<9) /* The server can no longer accept connects. */ - -/* - * The following structure is what is added to the Tcl event queue when - * a socket event occurs. - */ - -typedef struct SocketEvent { - Tcl_Event header; /* Information that is standard for - * all events. */ - TcpState *statePtr; /* Socket descriptor that is ready. */ - StreamPtr tcpStream; /* Low level Macintosh stream. */ -} SocketEvent; - -/* - * Static routines for this file: - */ - -static pascal void CleanUpExitProc _ANSI_ARGS_((void)); -static void ClearZombieSockets _ANSI_ARGS_((void)); -static void CloseCompletionRoutine _ANSI_ARGS_((TCPiopb *pb)); -static TcpState * CreateSocket _ANSI_ARGS_((Tcl_Interp *interp, - int port, char *host, char *myAddr, int myPort, - int server, int async)); -static pascal void DNRCompletionRoutine _ANSI_ARGS_(( - struct hostInfo *hostinfoPtr, - DNRState *dnrStatePtr)); -static void FreeSocketInfo _ANSI_ARGS_((TcpState *statePtr)); -static long GetBufferSize _ANSI_ARGS_((void)); -static OSErr GetHostFromString _ANSI_ARGS_((char *name, - ip_addr *address)); -static OSErr GetLocalAddress _ANSI_ARGS_((unsigned long *addr)); -static void IOCompletionRoutine _ANSI_ARGS_((TCPiopb *pb)); -static void InitMacTCPParamBlock _ANSI_ARGS_((TCPiopb *pBlock, - int csCode)); -static void InitSockets _ANSI_ARGS_((void)); -static TcpState * NewSocketInfo _ANSI_ARGS_((StreamPtr stream)); -static OSErr ResolveAddress _ANSI_ARGS_((ip_addr tcpAddress, - Tcl_DString *dsPtr)); -static void SocketCheckProc _ANSI_ARGS_((ClientData clientData, - int flags)); -static int SocketEventProc _ANSI_ARGS_((Tcl_Event *evPtr, - int flags)); -static void SocketExitHandler _ANSI_ARGS_((ClientData clientData)); -static void SocketFreeProc _ANSI_ARGS_((ClientData clientData)); -static int SocketReady _ANSI_ARGS_((TcpState *statePtr)); -static void SocketSetupProc _ANSI_ARGS_((ClientData clientData, - int flags)); -static void TcpAccept _ANSI_ARGS_((TcpState *statePtr)); -static int TcpBlockMode _ANSI_ARGS_((ClientData instanceData, int mode)); -static int TcpClose _ANSI_ARGS_((ClientData instanceData, - Tcl_Interp *interp)); -static int TcpGetHandle _ANSI_ARGS_((ClientData instanceData, - int direction, ClientData *handlePtr)); -static int TcpGetOptionProc _ANSI_ARGS_((ClientData instanceData, - Tcl_Interp *interp, char *optionName, - Tcl_DString *dsPtr)); -static int TcpInput _ANSI_ARGS_((ClientData instanceData, - char *buf, int toRead, int *errorCodePtr)); -static int TcpOutput _ANSI_ARGS_((ClientData instanceData, - char *buf, int toWrite, int *errorCodePtr)); -static void TcpWatch _ANSI_ARGS_((ClientData instanceData, - int mask)); -static int WaitForSocketEvent _ANSI_ARGS_((TcpState *infoPtr, - int mask, int *errorCodePtr)); - -/* - * This structure describes the channel type structure for TCP socket - * based IO: - */ - -static Tcl_ChannelType tcpChannelType = { - "tcp", /* Type name. */ - TcpBlockMode, /* Set blocking or - * non-blocking mode.*/ - TcpClose, /* Close proc. */ - TcpInput, /* Input proc. */ - TcpOutput, /* Output proc. */ - NULL, /* Seek proc. */ - NULL, /* Set option proc. */ - TcpGetOptionProc, /* Get option proc. */ - TcpWatch, /* Initialize notifier. */ - TcpGetHandle /* Get handles out of channel. */ -}; - -/* - * Universal Procedure Pointers (UPP) for various callback - * routines used by MacTcp code. - */ - -ResultUPP resultUPP = NULL; -TCPIOCompletionUPP completeUPP = NULL; -TCPIOCompletionUPP closeUPP = NULL; - -/* - * Built-in commands, and the procedures associated with them: - */ - -static PortInfo portServices[] = { - {"echo", 7}, - {"discard", 9}, - {"systat", 11}, - {"daytime", 13}, - {"netstat", 15}, - {"chargen", 19}, - {"ftp-data", 20}, - {"ftp", 21}, - {"telnet", 23}, - {"telneto", 24}, - {"smtp", 25}, - {"time", 37}, - {"whois", 43}, - {"domain", 53}, - {"gopher", 70}, - {"finger", 79}, - {"hostnames", 101}, - {"sunrpc", 111}, - {"nntp", 119}, - {"exec", 512}, - {"login", 513}, - {"shell", 514}, - {"printer", 515}, - {"courier", 530}, - {"uucp", 540}, - {NULL, 0}, -}; - -typedef struct ThreadSpecificData { - /* - * Every open socket has an entry on the following list. - */ - - TcpState *socketList; -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - -/* - * Globals for holding information about OS support for sockets. - */ - -static int socketsTestInited = false; -static int hasSockets = false; -static short driverRefNum = 0; -static int socketNumber = 0; -static int socketBufferSize = CHANNEL_BUF_SIZE; -static ProcessSerialNumber applicationPSN; - -/* - *---------------------------------------------------------------------- - * - * InitSockets -- - * - * Load the MacTCP driver and open the name resolver. We also - * create several UPP's used by our code. Lastly, we install - * a patch to ExitToShell to clean up socket connections if - * we are about to exit. - * - * Results: - * 1 if successful, 0 on failure. - * - * Side effects: - * Creates a new event source, loads the MacTCP driver, - * registers an exit to shell callback. - * - *---------------------------------------------------------------------- - */ - -#define gestaltMacTCPVersion 'mtcp' -static void -InitSockets() -{ - ParamBlockRec pb; - OSErr err; - long response; - ThreadSpecificData *tsdPtr; - - if (! initialized) { - /* - * Do process wide initialization. - */ - - initialized = 1; - - if (Gestalt(gestaltMacTCPVersion, &response) == noErr) { - hasSockets = true; - } else { - hasSockets = false; - } - - if (!hasSockets) { - return; - } - - /* - * Load MacTcp driver and name server resolver. - */ - - - pb.ioParam.ioCompletion = 0L; - pb.ioParam.ioNamePtr = "\p.IPP"; - pb.ioParam.ioPermssn = fsCurPerm; - err = PBOpenSync(&pb); - if (err != noErr) { - hasSockets = 0; - return; - } - driverRefNum = pb.ioParam.ioRefNum; - - socketBufferSize = GetBufferSize(); - err = OpenResolver(NULL); - if (err != noErr) { - hasSockets = 0; - return; - } - - GetCurrentProcess(&applicationPSN); - /* - * Create UPP's for various callback routines. - */ - - resultUPP = NewResultProc(DNRCompletionRoutine); - completeUPP = NewTCPIOCompletionProc(IOCompletionRoutine); - closeUPP = NewTCPIOCompletionProc(CloseCompletionRoutine); - - /* - * Install an ExitToShell patch. We use this patch instead - * of the Tcl exit mechanism because we need to ensure that - * these routines are cleaned up even if we crash or are forced - * to quit. There are some circumstances when the Tcl exit - * handlers may not fire. - */ - - TclMacInstallExitToShellPatch(CleanUpExitProc); - } - - /* - * Do per-thread initialization. - */ - - tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); - if (tsdPtr == NULL) { - tsdPtr->socketList = NULL; - Tcl_CreateEventSource(SocketSetupProc, SocketCheckProc, NULL); - Tcl_CreateThreadExitHandler(SocketExitHandler, (ClientData) NULL); - } -} - -/* - *---------------------------------------------------------------------- - * - * SocketExitHandler -- - * - * Callback invoked during exit clean up to deinitialize the - * socket module. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -SocketExitHandler( - ClientData clientData) /* Not used. */ -{ - if (hasSockets) { - Tcl_DeleteEventSource(SocketSetupProc, SocketCheckProc, NULL); - /* CleanUpExitProc(); - TclMacDeleteExitToShellPatch(CleanUpExitProc); */ - } -} - -/* - *---------------------------------------------------------------------- - * - * TclpHasSockets -- - * - * This function determines whether sockets are available on the - * current system and returns an error in interp if they are not. - * Note that interp may be NULL. - * - * Results: - * Returns TCL_OK if the system supports sockets, or TCL_ERROR with - * an error in interp. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclpHasSockets( - Tcl_Interp *interp) /* Interp for error messages. */ -{ - InitSockets(); - - if (hasSockets) { - return TCL_OK; - } - if (interp != NULL) { - Tcl_AppendResult(interp, "sockets are not available on this system", - NULL); - } - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * SocketSetupProc -- - * - * This procedure is invoked before Tcl_DoOneEvent blocks waiting - * for an event. - * - * Results: - * None. - * - * Side effects: - * Adjusts the block time if needed. - * - *---------------------------------------------------------------------- - */ - -static void -SocketSetupProc( - ClientData data, /* Not used. */ - int flags) /* Event flags as passed to Tcl_DoOneEvent. */ -{ - TcpState *statePtr; - Tcl_Time blockTime = { 0, 0 }; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (!(flags & TCL_FILE_EVENTS)) { - return; - } - - /* - * Check to see if there is a ready socket. If so, poll. - */ - - for (statePtr = tsdPtr->socketList; statePtr != NULL; - statePtr = statePtr->nextPtr) { - if (statePtr->flags & TCP_RELEASE) { - continue; - } - if (SocketReady(statePtr)) { - Tcl_SetMaxBlockTime(&blockTime); - break; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * SocketCheckProc -- - * - * This procedure is called by Tcl_DoOneEvent to check the socket - * event source for events. - * - * Results: - * None. - * - * Side effects: - * May queue an event. - * - *---------------------------------------------------------------------- - */ - -static void -SocketCheckProc( - ClientData data, /* Not used. */ - int flags) /* Event flags as passed to Tcl_DoOneEvent. */ -{ - TcpState *statePtr; - SocketEvent *evPtr; - TcpState dummyState; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (!(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). - */ - - for (statePtr = tsdPtr->socketList; statePtr != NULL; - statePtr = statePtr->nextPtr) { - /* - * Check to see if this socket is dead and needs to be cleaned - * up. We use a dummy statePtr whose only valid field is the - * nextPtr to allow the loop to continue even if the element - * is deleted. - */ - - if (statePtr->flags & TCP_RELEASE) { - if (!(statePtr->flags & TCP_PENDING)) { - dummyState.nextPtr = statePtr->nextPtr; - SocketFreeProc(statePtr); - statePtr = &dummyState; - } - continue; - } - - if (!(statePtr->flags & TCP_PENDING) && SocketReady(statePtr)) { - statePtr->flags |= TCP_PENDING; - evPtr = (SocketEvent *) ckalloc(sizeof(SocketEvent)); - evPtr->header.proc = SocketEventProc; - evPtr->statePtr = statePtr; - evPtr->tcpStream = statePtr->tcpStream; - Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * SocketReady -- - * - * This function checks the current state of a socket to see - * if any interesting conditions are present. - * - * Results: - * Returns 1 if an event that someone is watching is present, else - * returns 0. - * - * Side effects: - * Updates the checkMask for the socket to reflect any newly - * detected events. - * - *---------------------------------------------------------------------- - */ - -static int -SocketReady( - TcpState *statePtr) -{ - TCPiopb statusPB; - int foundSomething = 0; - int didStatus = 0; - int amount; - OSErr err; - - if (statePtr->flags & TCP_LISTEN_CONNECT) { - foundSomething = 1; - statePtr->checkMask |= TCL_READABLE; - } - if (statePtr->watchMask & TCL_READABLE) { - if (statePtr->checkMask & TCL_READABLE) { - foundSomething = 1; - } else if (statePtr->flags & TCP_CONNECTED) { - statusPB.ioCRefNum = driverRefNum; - statusPB.tcpStream = statePtr->tcpStream; - statusPB.csCode = TCPStatus; - err = PBControlSync((ParmBlkPtr) &statusPB); - didStatus = 1; - - /* - * We make the fchannel readable if 1) we get an error, - * 2) there is more data available, or 3) we detect - * that a close from the remote connection has arrived. - */ - - if ((err != noErr) || - (statusPB.csParam.status.amtUnreadData > 0) || - (statusPB.csParam.status.connectionState == 14)) { - statePtr->checkMask |= TCL_READABLE; - foundSomething = 1; - } - } - } - if (statePtr->watchMask & TCL_WRITABLE) { - if (statePtr->checkMask & TCL_WRITABLE) { - foundSomething = 1; - } else if (statePtr->flags & TCP_CONNECTED) { - if (!didStatus) { - statusPB.ioCRefNum = driverRefNum; - statusPB.tcpStream = statePtr->tcpStream; - statusPB.csCode = TCPStatus; - err = PBControlSync((ParmBlkPtr) &statusPB); - } - - /* - * If there is an error or there if there is room to - * send more data we make the channel writeable. - */ - - amount = statusPB.csParam.status.sendWindow - - statusPB.csParam.status.amtUnackedData; - if ((err != noErr) || (amount > 0)) { - statePtr->checkMask |= TCL_WRITABLE; - foundSomething = 1; - } - } - } - return foundSomething; -} - -/* - *---------------------------------------------------------------------- - * - * InitMacTCPParamBlock-- - * - * Initialize a MacTCP parameter block. - * - * Results: - * None. - * - * Side effects: - * Initializes the parameter block. - * - *---------------------------------------------------------------------- - */ - -static void -InitMacTCPParamBlock( - TCPiopb *pBlock, /* Tcp parmeter block. */ - int csCode) /* Tcp operation code. */ -{ - memset(pBlock, 0, sizeof(TCPiopb)); - pBlock->ioResult = 1; - pBlock->ioCRefNum = driverRefNum; - pBlock->csCode = (short) csCode; -} - -/* - *---------------------------------------------------------------------- - * - * TcpBlockMode -- - * - * 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 -TcpBlockMode( - ClientData instanceData, /* Channel state. */ - int mode) /* The mode to set. */ -{ - TcpState *statePtr = (TcpState *) instanceData; - - if (mode == TCL_MODE_BLOCKING) { - statePtr->flags &= ~TCP_ASYNC_SOCKET; - } else { - statePtr->flags |= TCP_ASYNC_SOCKET; - } - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TcpClose -- - * - * Close the socket. - * - * Results: - * 0 if successful, the value of errno if failed. - * - * Side effects: - * Closes the socket. - * - *---------------------------------------------------------------------- - */ - -static int -TcpClose( - ClientData instanceData, /* The socket to close. */ - Tcl_Interp *interp) /* Interp for error messages. */ -{ - TcpState *statePtr = (TcpState *) instanceData; - StreamPtr tcpStream; - TCPiopb closePB; - OSErr err; - - tcpStream = statePtr->tcpStream; - statePtr->flags &= ~TCP_CONNECTED; - - /* - * If this is a server socket we can't use the statePtr - * param block because it is in use. However, we can - * close syncronously. - */ - - if ((statePtr->flags & TCP_LISTENING) || - (statePtr->flags & TCP_LISTEN_CONNECT)) { - InitMacTCPParamBlock(&closePB, TCPClose); - closePB.tcpStream = tcpStream; - closePB.ioCompletion = NULL; - err = PBControlSync((ParmBlkPtr) &closePB); - if (err != noErr) { - Debugger(); - panic("error closing server socket"); - } - statePtr->flags |= TCP_RELEASE; - - /* - * Server sockets are closed sync. Therefor, we know it is OK to - * release the socket now. - */ - - InitMacTCPParamBlock(&statePtr->pb, TCPRelease); - statePtr->pb.tcpStream = statePtr->tcpStream; - err = PBControlSync((ParmBlkPtr) &statePtr->pb); - if (err != noErr) { - panic("error releasing server socket"); - } - - /* - * Free the buffer space used by the socket and the - * actual socket state data structure. - */ - - ckfree((char *) statePtr->pb.csParam.create.rcvBuff); - FreeSocketInfo(statePtr); - return 0; - } - - /* - * If this socket is in the midddle on async connect we can just - * abort the connect and release the stream right now. - */ - - if (statePtr->flags & TCP_ASYNC_CONNECT) { - InitMacTCPParamBlock(&closePB, TCPClose); - closePB.tcpStream = tcpStream; - closePB.ioCompletion = NULL; - err = PBControlSync((ParmBlkPtr) &closePB); - if (err != noErr) { - panic("error closing async connect socket"); - } - statePtr->flags |= TCP_RELEASE; - - InitMacTCPParamBlock(&statePtr->pb, TCPRelease); - statePtr->pb.tcpStream = statePtr->tcpStream; - err = PBControlSync((ParmBlkPtr) &statePtr->pb); - if (err != noErr) { - panic("error releasing async connect socket"); - } - - /* - * Free the buffer space used by the socket and the - * actual socket state data structure. - */ - - ckfree((char *) statePtr->pb.csParam.create.rcvBuff); - FreeSocketInfo(statePtr); - return 0; - } - - /* - * Client sockets: - * If a background write is in progress, don't close - * the socket yet. The completion routine for the - * write will take care of it. - */ - - if (!(statePtr->flags & TCP_WRITING)) { - InitMacTCPParamBlock(&statePtr->pb, TCPClose); - statePtr->pb.tcpStream = tcpStream; - statePtr->pb.ioCompletion = closeUPP; - statePtr->pb.csParam.close.userDataPtr = (Ptr) statePtr; - err = PBControlAsync((ParmBlkPtr) &statePtr->pb); - if (err != noErr) { - Debugger(); - statePtr->flags |= TCP_RELEASE; - /* return 0; */ - } - } - - SocketFreeProc(instanceData); - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * CloseCompletionRoutine -- - * - * Handles the close protocol for a Tcp socket. This will do - * a series of calls to release all data currently buffered for - * the socket. This is important to do to as it allows the remote - * connection to recieve and issue it's own close on the socket. - * Note that this function is running at interupt time and can't - * allocate memory or do much else except set state. - * - * Results: - * None. - * - * Side effects: - * The buffers for the socket are flushed. - * - *---------------------------------------------------------------------- - */ - -static void -CloseCompletionRoutine( - TCPiopb *pbPtr) /* Tcp parameter block. */ -{ - TcpState *statePtr; - OSErr err; - - if (pbPtr->csCode == TCPClose) { - statePtr = (TcpState *) (pbPtr->csParam.close.userDataPtr); - } else { - statePtr = (TcpState *) (pbPtr->csParam.receive.userDataPtr); - } - - /* - * It's very bad if the statePtr is nNULL - we should probably panic... - */ - - if (statePtr == NULL) { - Debugger(); - return; - } - - WakeUpProcess(&statePtr->psn); - - /* - * If there is an error we assume the remote side has already - * close. We are done closing as soon as we decide that the - * remote connection has closed. - */ - - if (pbPtr->ioResult != noErr) { - statePtr->flags |= TCP_RELEASE; - return; - } - if (statePtr->flags & TCP_REMOTE_CLOSED) { - statePtr->flags |= TCP_RELEASE; - return; - } - - /* - * If we just did a recieve we need to return the buffers. - * Otherwise, attempt to recieve more data until we recieve an - * error (usually because we have no more data). - */ - - if (statePtr->pb.csCode == TCPNoCopyRcv) { - InitMacTCPParamBlock(&statePtr->pb, TCPRcvBfrReturn); - statePtr->pb.tcpStream = statePtr->tcpStream; - statePtr->pb.ioCompletion = closeUPP; - statePtr->pb.csParam.receive.rdsPtr = (Ptr) statePtr->rdsarray; - statePtr->pb.csParam.receive.userDataPtr = (Ptr) statePtr; - err = PBControlAsync((ParmBlkPtr) &statePtr->pb); - } else { - InitMacTCPParamBlock(&statePtr->pb, TCPNoCopyRcv); - statePtr->pb.tcpStream = statePtr->tcpStream; - statePtr->pb.ioCompletion = closeUPP; - statePtr->pb.csParam.receive.commandTimeoutValue = 1; - statePtr->pb.csParam.receive.rdsPtr = (Ptr) statePtr->rdsarray; - statePtr->pb.csParam.receive.rdsLength = 5; - statePtr->pb.csParam.receive.userDataPtr = (Ptr) statePtr; - err = PBControlAsync((ParmBlkPtr) &statePtr->pb); - } - - if (err != noErr) { - statePtr->flags |= TCP_RELEASE; - } -} -/* - *---------------------------------------------------------------------- - * - * SocketFreeProc -- - * - * This callback is invoked in order to delete - * the notifier data associated with a file handle. - * - * Results: - * None. - * - * Side effects: - * Removes the SocketInfo from the global socket list. - * - *---------------------------------------------------------------------- - */ - -static void -SocketFreeProc( - ClientData clientData) /* Channel state. */ -{ - TcpState *statePtr = (TcpState *) clientData; - OSErr err; - TCPiopb statusPB; - - /* - * Get the status of this connection. We need to do a - * few tests to see if it's OK to release the stream now. - */ - - if (!(statePtr->flags & TCP_RELEASE)) { - return; - } - statusPB.ioCRefNum = driverRefNum; - statusPB.tcpStream = statePtr->tcpStream; - statusPB.csCode = TCPStatus; - err = PBControlSync((ParmBlkPtr) &statusPB); - if ((statusPB.csParam.status.connectionState == 0) || - (statusPB.csParam.status.connectionState == 2)) { - /* - * If the conection state is 0 then this was a client - * connection and it's closed. If it is 2 then this a - * server client and we may release it. If it isn't - * one of those values then we return and we'll try to - * clean up later. - */ - - } else { - return; - } - - /* - * The Close request is made async. We know it's - * OK to release the socket when the TCP_RELEASE flag - * gets set. - */ - - InitMacTCPParamBlock(&statePtr->pb, TCPRelease); - statePtr->pb.tcpStream = statePtr->tcpStream; - err = PBControlSync((ParmBlkPtr) &statePtr->pb); - if (err != noErr) { - Debugger(); /* Ignoreing leaves stranded stream. Is there an - alternative? */ - } - - /* - * Free the buffer space used by the socket and the - * actual socket state data structure. - */ - - ckfree((char *) statePtr->pb.csParam.create.rcvBuff); - FreeSocketInfo(statePtr); -} - -/* - *---------------------------------------------------------------------- - * - * TcpInput -- - * - * 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. A value of -1 - * implies an error occured. A value of zero means we have reached - * the end of data (EOF). - * - * Side effects: - * Reads input from the actual channel. - * - *---------------------------------------------------------------------- - */ - -int -TcpInput( - ClientData instanceData, /* Channel 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; - StreamPtr tcpStream; - OSErr err; - TCPiopb statusPB; - int toRead, dataAvail; - - *errorCodePtr = 0; - errno = 0; - tcpStream = statePtr->tcpStream; - - if (bufSize == 0) { - return 0; - } - toRead = bufSize; - - /* - * First check to see if EOF was already detected, to prevent - * calling the socket stack after the first time EOF is detected. - */ - - if (statePtr->flags & TCP_REMOTE_CLOSED) { - return 0; - } - - /* - * If an asynchronous connect is in progress, attempt to wait for it - * to complete before reading. - */ - - if ((statePtr->flags & TCP_ASYNC_CONNECT) - && ! WaitForSocketEvent(statePtr, TCL_READABLE, errorCodePtr)) { - return -1; - } - - /* - * No EOF, and it is connected, so try to read more from the socket. - * If the socket is blocking, we keep trying until there is data - * available or the socket is closed. - */ - - while (1) { - - statusPB.ioCRefNum = driverRefNum; - statusPB.tcpStream = tcpStream; - statusPB.csCode = TCPStatus; - err = PBControlSync((ParmBlkPtr) &statusPB); - if (err != noErr) { - Debugger(); - statePtr->flags |= TCP_REMOTE_CLOSED; - return 0; /* EOF */ - } - dataAvail = statusPB.csParam.status.amtUnreadData; - if (dataAvail < bufSize) { - toRead = dataAvail; - } else { - toRead = bufSize; - } - if (toRead != 0) { - /* - * Try to read the data. - */ - - InitMacTCPParamBlock(&statusPB, TCPRcv); - statusPB.tcpStream = tcpStream; - statusPB.csParam.receive.rcvBuff = buf; - statusPB.csParam.receive.rcvBuffLen = toRead; - err = PBControlSync((ParmBlkPtr) &statusPB); - - statePtr->checkMask &= ~TCL_READABLE; - switch (err) { - case noErr: - /* - * The channel remains readable only if this read succeds - * and we had more data then the size of the buffer we were - * trying to fill. Use the info from the call to status to - * determine this. - */ - - if (dataAvail > bufSize) { - statePtr->checkMask |= TCL_READABLE; - } - return statusPB.csParam.receive.rcvBuffLen; - case connectionClosing: - *errorCodePtr = errno = ESHUTDOWN; - statePtr->flags |= TCP_REMOTE_CLOSED; - return 0; - case connectionDoesntExist: - case connectionTerminated: - *errorCodePtr = errno = ENOTCONN; - statePtr->flags |= TCP_REMOTE_CLOSED; - return 0; - case invalidStreamPtr: - default: - *errorCodePtr = EINVAL; - return -1; - } - } - - /* - * No data is available, so check the connection state to - * see why this is the case. - */ - - if (statusPB.csParam.status.connectionState == 14) { - statePtr->flags |= TCP_REMOTE_CLOSED; - return 0; - } - if (statusPB.csParam.status.connectionState != 8) { - Debugger(); - } - statePtr->checkMask &= ~TCL_READABLE; - if (statePtr->flags & TCP_ASYNC_SOCKET) { - *errorCodePtr = EWOULDBLOCK; - return -1; - } - - /* - * In the blocking case, wait until the file becomes readable - * or closed and try again. - */ - - if (!WaitForSocketEvent(statePtr, TCL_READABLE, errorCodePtr)) { - return -1; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * TcpGetHandle -- - * - * Called from Tcl_GetChannelHandle to retrieve handles from inside - * a file based channel. - * - * Results: - * The appropriate handle or NULL if not present. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TcpGetHandle( - ClientData instanceData, /* The file state. */ - int direction, /* Which handle to retrieve? */ - ClientData *handlePtr) -{ - TcpState *statePtr = (TcpState *) instanceData; - - *handlePtr = (ClientData) statePtr->tcpStream; - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TcpOutput-- - * - * 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 -TcpOutput( - ClientData instanceData, /* Channel state. */ - char *buf, /* The data buffer. */ - int toWrite, /* How many bytes to write? */ - int *errorCodePtr) /* Where to store error code. */ -{ - TcpState *statePtr = (TcpState *) instanceData; - StreamPtr tcpStream; - OSErr err; - int amount; - TCPiopb statusPB; - - *errorCodePtr = 0; - tcpStream = statePtr->tcpStream; - - /* - * If an asynchronous connect is in progress, attempt to wait for it - * to complete before writing. - */ - - if ((statePtr->flags & TCP_ASYNC_CONNECT) - && ! WaitForSocketEvent(statePtr, TCL_WRITABLE, errorCodePtr)) { - return -1; - } - - /* - * Loop until we have written some data, or an error occurs. - */ - - while (1) { - statusPB.ioCRefNum = driverRefNum; - statusPB.tcpStream = tcpStream; - statusPB.csCode = TCPStatus; - err = PBControlSync((ParmBlkPtr) &statusPB); - if ((err == connectionDoesntExist) || ((err == noErr) && - (statusPB.csParam.status.connectionState == 14))) { - /* - * The remote connection is gone away. Report an error - * and don't write anything. - */ - - *errorCodePtr = errno = EPIPE; - return -1; - } else if (err != noErr) { - return -1; - } - amount = statusPB.csParam.status.sendWindow - - statusPB.csParam.status.amtUnackedData; - - /* - * Attempt to write the data to the socket if a background - * write isn't in progress and there is room in the output buffers. - */ - - if (!(statePtr->flags & TCP_WRITING) && amount > 0) { - if (toWrite < amount) { - amount = toWrite; - } - statePtr->dataSegment[0].length = amount; - statePtr->dataSegment[0].ptr = buf; - statePtr->dataSegment[1].length = 0; - InitMacTCPParamBlock(&statePtr->pb, TCPSend); - statePtr->pb.ioCompletion = completeUPP; - statePtr->pb.tcpStream = tcpStream; - statePtr->pb.csParam.send.wdsPtr = (Ptr) statePtr->dataSegment; - statePtr->pb.csParam.send.pushFlag = 1; - statePtr->pb.csParam.send.userDataPtr = (Ptr) statePtr; - statePtr->flags |= TCP_WRITING; - err = PBControlAsync((ParmBlkPtr) &(statePtr->pb)); - switch (err) { - case noErr: - return amount; - case connectionClosing: - *errorCodePtr = errno = ESHUTDOWN; - statePtr->flags |= TCP_REMOTE_CLOSED; - return -1; - case connectionDoesntExist: - case connectionTerminated: - *errorCodePtr = errno = ENOTCONN; - statePtr->flags |= TCP_REMOTE_CLOSED; - return -1; - case invalidStreamPtr: - default: - return -1; - } - - } - - /* - * The socket wasn't writable. In the non-blocking case, return - * immediately, otherwise wait until the file becomes writable - * or closed and try again. - */ - - if (statePtr->flags & TCP_ASYNC_SOCKET) { - statePtr->checkMask &= ~TCL_WRITABLE; - *errorCodePtr = EWOULDBLOCK; - return -1; - } else if (!WaitForSocketEvent(statePtr, TCL_WRITABLE, errorCodePtr)) { - return -1; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * 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. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -TcpGetOptionProc( - ClientData instanceData, /* Socket state. */ - Tcl_Interp *interp, /* For error reporting - can be NULL.*/ - 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; - int doPeerName = false, doSockName = false, doAll = false; - ip_addr tcpAddress; - char buffer[128]; - OSErr err; - Tcl_DString dString; - TCPiopb statusPB; - int errorCode; - - /* - * If an asynchronous connect is in progress, attempt to wait for it - * to complete before accessing the socket state. - */ - - if ((statePtr->flags & TCP_ASYNC_CONNECT) - && ! WaitForSocketEvent(statePtr, TCL_WRITABLE, &errorCode)) { - if (interp) { - /* - * fix the error message. - */ - - Tcl_AppendResult(interp, "connect is in progress and can't wait", - NULL); - } - return TCL_ERROR; - } - - /* - * Determine which options we need to do. Do all of them - * if optionName is NULL. - */ - - if (optionName == (char *) NULL || optionName[0] == '\0') { - doAll = true; - } else { - if (!strcmp(optionName, "-peername")) { - doPeerName = true; - } else if (!strcmp(optionName, "-sockname")) { - doSockName = true; - } else { - return Tcl_BadChannelOption(interp, optionName, - "peername sockname"); - } - } - - /* - * Get status on the stream. Make sure to use a new pb struct because - * the struct in the statePtr may be part of an asyncronous call. - */ - - statusPB.ioCRefNum = driverRefNum; - statusPB.tcpStream = statePtr->tcpStream; - statusPB.csCode = TCPStatus; - err = PBControlSync((ParmBlkPtr) &statusPB); - if ((err == connectionDoesntExist) || - ((err == noErr) && (statusPB.csParam.status.connectionState == 14))) { - /* - * The socket was probably closed on the other side of the connection. - */ - - if (interp) { - Tcl_AppendResult(interp, "can't access socket info: ", - "connection reset by peer", NULL); - } - return TCL_ERROR; - } else if (err != noErr) { - if (interp) { - Tcl_AppendResult(interp, "unknown socket error", NULL); - } - Debugger(); - return TCL_ERROR; - } - - - /* - * Get the sockname for the socket. - */ - - Tcl_DStringInit(&dString); - if (doAll || doSockName) { - if (doAll) { - Tcl_DStringAppendElement(dsPtr, "-sockname"); - Tcl_DStringStartSublist(dsPtr); - } - tcpAddress = statusPB.csParam.status.localHost; - sprintf(buffer, "%d.%d.%d.%d", tcpAddress>>24, - tcpAddress>>16 & 0xff, tcpAddress>>8 & 0xff, - tcpAddress & 0xff); - Tcl_DStringAppendElement(dsPtr, buffer); - if (ResolveAddress(tcpAddress, &dString) == noErr) { - Tcl_DStringAppendElement(dsPtr, dString.string); - } else { - Tcl_DStringAppendElement(dsPtr, ""); - } - sprintf(buffer, "%d", statusPB.csParam.status.localPort); - Tcl_DStringAppendElement(dsPtr, buffer); - if (doAll) { - Tcl_DStringEndSublist(dsPtr); - } - } - - /* - * Get the peername for the socket. - */ - - if ((doAll || doPeerName) && (statePtr->flags & TCP_CONNECTED)) { - if (doAll) { - Tcl_DStringAppendElement(dsPtr, "-peername"); - Tcl_DStringStartSublist(dsPtr); - } - tcpAddress = statusPB.csParam.status.remoteHost; - sprintf(buffer, "%d.%d.%d.%d", tcpAddress>>24, - tcpAddress>>16 & 0xff, tcpAddress>>8 & 0xff, - tcpAddress & 0xff); - Tcl_DStringAppendElement(dsPtr, buffer); - Tcl_DStringSetLength(&dString, 0); - if (ResolveAddress(tcpAddress, &dString) == noErr) { - Tcl_DStringAppendElement(dsPtr, dString.string); - } else { - Tcl_DStringAppendElement(dsPtr, ""); - } - sprintf(buffer, "%d", statusPB.csParam.status.remotePort); - Tcl_DStringAppendElement(dsPtr, buffer); - if (doAll) { - Tcl_DStringEndSublist(dsPtr); - } - } - - Tcl_DStringFree(&dString); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * TcpWatch -- - * - * Initialize the notifier to watch this channel. - * - * Results: - * None. - * - * Side effects: - * Sets the watchMask for the channel. - * - *---------------------------------------------------------------------- - */ - -static void -TcpWatch(instanceData, mask) - ClientData instanceData; /* The file state. */ - int mask; /* Events of interest; an OR-ed - * combination of TCL_READABLE, - * TCL_WRITABLE and TCL_EXCEPTION. */ -{ - TcpState *statePtr = (TcpState *) instanceData; - - statePtr->watchMask = mask; -} - -/* - *---------------------------------------------------------------------- - * - * NewSocketInfo -- - * - * This function allocates and initializes a new SocketInfo - * structure. - * - * Results: - * Returns a newly allocated SocketInfo. - * - * Side effects: - * Adds the socket to the global socket list, allocates memory. - * - *---------------------------------------------------------------------- - */ - -static TcpState * -NewSocketInfo( - StreamPtr tcpStream) -{ - TcpState *statePtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - statePtr = (TcpState *) ckalloc((unsigned) sizeof(TcpState)); - statePtr->tcpStream = tcpStream; - statePtr->psn = applicationPSN; - statePtr->flags = 0; - statePtr->checkMask = 0; - statePtr->watchMask = 0; - statePtr->acceptProc = (Tcl_TcpAcceptProc *) NULL; - statePtr->acceptProcData = (ClientData) NULL; - statePtr->nextPtr = tsdPtr->socketList; - tsdPtr->socketList = statePtr; - return statePtr; -} - -/* - *---------------------------------------------------------------------- - * - * FreeSocketInfo -- - * - * This function deallocates a SocketInfo structure that is no - * longer needed. - * - * Results: - * None. - * - * Side effects: - * Removes the socket from the global socket list, frees memory. - * - *---------------------------------------------------------------------- - */ - -static void -FreeSocketInfo( - TcpState *statePtr) /* The state pointer to free. */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (statePtr == tsdPtr->socketList) { - tsdPtr->socketList = statePtr->nextPtr; - } else { - TcpState *p; - for (p = tsdPtr->socketList; p != NULL; p = p->nextPtr) { - if (p->nextPtr == statePtr) { - p->nextPtr = statePtr->nextPtr; - break; - } - } - } - ckfree((char *) statePtr); -} - -/* - *---------------------------------------------------------------------- - * - * 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( - ClientData sock) /* The socket to wrap up into a channel. */ -{ - TcpState *statePtr; - char channelName[20]; - - if (TclpHasSockets(NULL) != TCL_OK) { - return NULL; - } - - statePtr = NewSocketInfo((StreamPtr) sock); - /* TODO: do we need to set the port??? */ - - sprintf(channelName, "sock%d", socketNumber++); - - statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, - (ClientData) statePtr, (TCL_READABLE | TCL_WRITABLE)); - Tcl_SetChannelBufferSize(statePtr->channel, socketBufferSize); - Tcl_SetChannelOption(NULL, statePtr->channel, "-translation", "auto crlf"); - return statePtr->channel; -} - -/* - *---------------------------------------------------------------------- - * - * CreateSocket -- - * - * This function opens a new socket and initializes the - * SocketInfo structure. - * - * Results: - * Returns a new SocketInfo, or NULL with an error in interp. - * - * Side effects: - * Adds a new socket to the socketList. - * - *---------------------------------------------------------------------- - */ - -static TcpState * -CreateSocket( - Tcl_Interp *interp, /* For error reporting; can be NULL. */ - int port, /* Port number to open. */ - char *host, /* Name of host on which to open port. */ - char *myaddr, /* Optional client-side address */ - int myport, /* Optional client-side port */ - int server, /* 1 if socket should be a server socket, - * else 0 for a client socket. */ - int async) /* 1 create async, 0 do sync. */ -{ - ip_addr macAddr; - OSErr err; - TCPiopb pb; - StreamPtr tcpStream; - TcpState *statePtr; - char * buffer; - - /* - * Figure out the ip address from the host string. - */ - - if (host == NULL) { - err = GetLocalAddress(&macAddr); - } else { - err = GetHostFromString(host, &macAddr); - } - if (err != noErr) { - Tcl_SetErrno(EHOSTUNREACH); - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "couldn't open socket: ", - Tcl_PosixError(interp), (char *) NULL); - } - return (TcpState *) NULL; - } - - /* - * Create a MacTCP stream and create the state used for socket - * transactions from here on out. - */ - - ClearZombieSockets(); - buffer = ckalloc(socketBufferSize); - InitMacTCPParamBlock(&pb, TCPCreate); - pb.csParam.create.rcvBuff = buffer; - pb.csParam.create.rcvBuffLen = socketBufferSize; - err = PBControlSync((ParmBlkPtr) &pb); - if (err != noErr) { - Tcl_SetErrno(0); /* TODO: set to ENOSR - maybe?*/ - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "couldn't open socket: ", - Tcl_PosixError(interp), (char *) NULL); - } - return (TcpState *) NULL; - } - - tcpStream = pb.tcpStream; - statePtr = NewSocketInfo(tcpStream); - statePtr->port = port; - - if (server) { - /* - * Set up server connection. - */ - - InitMacTCPParamBlock(&statePtr->pb, TCPPassiveOpen); - statePtr->pb.tcpStream = tcpStream; - statePtr->pb.csParam.open.localPort = statePtr->port; - statePtr->pb.ioCompletion = completeUPP; - statePtr->pb.csParam.open.userDataPtr = (Ptr) statePtr; - statePtr->flags |= TCP_LISTENING; - err = PBControlAsync((ParmBlkPtr) &(statePtr->pb)); - - /* - * If this is a server on port 0 then we need to wait until - * the dynamic port allocation is made by the MacTcp driver. - */ - - if (statePtr->port == 0) { - EventRecord dummy; - - while (statePtr->pb.csParam.open.localPort == 0) { - WaitNextEvent(0, &dummy, 1, NULL); - if (statePtr->pb.ioResult != 0) { - break; - } - } - statePtr->port = statePtr->pb.csParam.open.localPort; - } - Tcl_SetErrno(EINPROGRESS); - } else { - /* - * 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. - */ - - InitMacTCPParamBlock(&statePtr->pb, TCPActiveOpen); - statePtr->pb.tcpStream = tcpStream; - statePtr->pb.csParam.open.remoteHost = macAddr; - statePtr->pb.csParam.open.remotePort = port; - statePtr->pb.csParam.open.localHost = 0; - statePtr->pb.csParam.open.localPort = myport; - statePtr->pb.csParam.open.userDataPtr = (Ptr) statePtr; - statePtr->pb.ioCompletion = completeUPP; - if (async) { - statePtr->flags |= TCP_ASYNC_CONNECT; - err = PBControlAsync((ParmBlkPtr) &(statePtr->pb)); - Tcl_SetErrno(EINPROGRESS); - } else { - err = PBControlSync((ParmBlkPtr) &(statePtr->pb)); - } - } - - switch (err) { - case noErr: - if (!async) { - statePtr->flags |= TCP_CONNECTED; - } - return statePtr; - case duplicateSocket: - Tcl_SetErrno(EADDRINUSE); - break; - case openFailed: - case connectionTerminated: - Tcl_SetErrno(ECONNREFUSED); - break; - case invalidStreamPtr: - case connectionExists: - default: - /* - * These cases should never occur. However, we will fail - * gracefully and hope Tcl can resume. The alternative is to panic - * which is probably a bit drastic. - */ - - Debugger(); - Tcl_SetErrno(err); - } - - /* - * We had error during the connection. Release the stream - * and file handle. Also report to the interp. - */ - - pb.ioCRefNum = driverRefNum; - pb.csCode = TCPRelease; - pb.tcpStream = tcpStream; - pb.ioCompletion = NULL; - err = PBControlSync((ParmBlkPtr) &pb); - - if (interp != (Tcl_Interp *) NULL) { - Tcl_AppendResult(interp, "couldn't open socket: ", - Tcl_PosixError(interp), (char *) NULL); - } - - ckfree(buffer); - FreeSocketInfo(statePtr); - return (TcpState *) NULL; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_OpenTcpClient -- - * - * Opens a TCP client socket and creates a channel around it. - * - * Results: - * The channel or NULL if failed. On failure, the routine also - * sets the output argument errorCodePtr to the error code. - * - * 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. */ - char *host, /* Host on which to open port. */ - 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. - * - currently ignored */ -{ - TcpState *statePtr; - char channelName[20]; - - if (TclpHasSockets(interp) != TCL_OK) { - return NULL; - } - - /* - * Create a new client socket and wrap it in a channel. - */ - - statePtr = CreateSocket(interp, port, host, myaddr, myport, 0, async); - if (statePtr == NULL) { - return NULL; - } - - sprintf(channelName, "sock%d", socketNumber++); - - statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, - (ClientData) statePtr, (TCL_READABLE | TCL_WRITABLE)); - Tcl_SetChannelBufferSize(statePtr->channel, socketBufferSize); - Tcl_SetChannelOption(NULL, statePtr->channel, "-translation", "auto crlf"); - return statePtr->channel; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_OpenTcpServer -- - * - * Opens a TCP server socket and creates a channel around it. - * - * Results: - * The channel or NULL if failed. - * - * Side effects: - * Opens a server socket and creates a new channel. - * - *---------------------------------------------------------------------- - */ - -Tcl_Channel -Tcl_OpenTcpServer( - Tcl_Interp *interp, /* For error reporting - may be - * NULL. */ - int port, /* Port number to open. */ - char *host, /* Name of local host. */ - Tcl_TcpAcceptProc *acceptProc, /* Callback for accepting connections - * from new clients. */ - ClientData acceptProcData) /* Data for the callback. */ -{ - TcpState *statePtr; - char channelName[20]; - - if (TclpHasSockets(interp) != TCL_OK) { - return NULL; - } - - /* - * Create a new client socket and wrap it in a channel. - */ - - statePtr = CreateSocket(interp, port, host, NULL, 0, 1, 1); - if (statePtr == NULL) { - return NULL; - } - - statePtr->acceptProc = acceptProc; - statePtr->acceptProcData = acceptProcData; - - sprintf(channelName, "sock%d", socketNumber++); - - statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, - (ClientData) statePtr, 0); - Tcl_SetChannelBufferSize(statePtr->channel, socketBufferSize); - Tcl_SetChannelOption(NULL, statePtr->channel, "-translation", "auto crlf"); - return statePtr->channel; -} - -/* - *---------------------------------------------------------------------- - * - * SocketEventProc -- - * - * This procedure is called by Tcl_ServiceEvent when a socket event - * reaches the front of the event queue. This procedure 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 procedures 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; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - if (!(flags & TCL_FILE_EVENTS)) { - return 0; - } - - /* - * Find the specified socket on the socket list. - */ - - for (statePtr = tsdPtr->socketList; statePtr != NULL; - statePtr = statePtr->nextPtr) { - if ((statePtr == eventPtr->statePtr) && - (statePtr->tcpStream == eventPtr->tcpStream)) { - break; - } - } - - /* - * Discard events that have gone stale. - */ - - if (!statePtr) { - return 1; - } - statePtr->flags &= ~(TCP_PENDING); - if (statePtr->flags & TCP_RELEASE) { - SocketFreeProc(statePtr); - return 1; - } - - - /* - * Handle connection requests directly. - */ - - if (statePtr->flags & TCP_LISTEN_CONNECT) { - if (statePtr->checkMask & TCL_READABLE) { - TcpAccept(statePtr); - } - return 1; - } - - /* - * Mask off unwanted events then notify the channel. - */ - - mask = statePtr->checkMask & statePtr->watchMask; - if (mask) { - Tcl_NotifyChannel(statePtr->channel, mask); - } - return 1; -} - -/* - *---------------------------------------------------------------------- - * - * WaitForSocketEvent -- - * - * Waits until one of the specified events occurs on a socket. - * - * 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 mask, /* Events to look for. */ - int *errorCodePtr) /* Where to store errors? */ -{ - OSErr err; - TCPiopb statusPB; - EventRecord dummy; - - /* - * Loop until we get the specified condition, unless the socket is - * asynchronous. - */ - - do { - statusPB.ioCRefNum = driverRefNum; - statusPB.tcpStream = statePtr->tcpStream; - statusPB.csCode = TCPStatus; - err = PBControlSync((ParmBlkPtr) &statusPB); - if (err != noErr) { - statePtr->checkMask |= (TCL_READABLE | TCL_WRITABLE); - return 1; - } - statePtr->checkMask = 0; - if (statusPB.csParam.status.amtUnreadData > 0) { - statePtr->checkMask |= TCL_READABLE; - } - if (!(statePtr->flags & TCP_WRITING) - && (statusPB.csParam.status.sendWindow - - statusPB.csParam.status.amtUnackedData) > 0) { - statePtr->flags &= ~(TCP_ASYNC_CONNECT); - statePtr->checkMask |= TCL_WRITABLE; - } - if (mask & statePtr->checkMask) { - return 1; - } - - /* - * Call the system to let other applications run while we - * are waiting for this event to occur. - */ - - WaitNextEvent(0, &dummy, 1, NULL); - } while (!(statePtr->flags & TCP_ASYNC_SOCKET)); - *errorCodePtr = EWOULDBLOCK; - return 0; -} - -/* - *---------------------------------------------------------------------- - * - * TcpAccept -- - * Accept a TCP socket connection. This is called by the event - * loop, and it in turns calls any registered callbacks for this - * channel. - * - * Results: - * None. - * - * Side effects: - * Evals the Tcl script associated with the server socket. - * - *---------------------------------------------------------------------- - */ - -static void -TcpAccept( - TcpState *statePtr) -{ - TcpState *newStatePtr; - StreamPtr tcpStream; - char remoteHostname[255]; - OSErr err; - ip_addr remoteAddress; - long remotePort; - char channelName[20]; - - statePtr->flags &= ~TCP_LISTEN_CONNECT; - statePtr->checkMask &= ~TCL_READABLE; - - /* - * Transfer sever stream to new connection. - */ - - tcpStream = statePtr->tcpStream; - newStatePtr = NewSocketInfo(tcpStream); - newStatePtr->tcpStream = tcpStream; - sprintf(channelName, "sock%d", socketNumber++); - - - newStatePtr->flags |= TCP_CONNECTED; - newStatePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, - (ClientData) newStatePtr, (TCL_READABLE | TCL_WRITABLE)); - Tcl_SetChannelBufferSize(newStatePtr->channel, socketBufferSize); - Tcl_SetChannelOption(NULL, newStatePtr->channel, "-translation", - "auto crlf"); - - remoteAddress = statePtr->pb.csParam.open.remoteHost; - remotePort = statePtr->pb.csParam.open.remotePort; - - /* - * Reopen passive connect. Make new tcpStream the server. - */ - - ClearZombieSockets(); - InitMacTCPParamBlock(&statePtr->pb, TCPCreate); - statePtr->pb.csParam.create.rcvBuff = ckalloc(socketBufferSize); - statePtr->pb.csParam.create.rcvBuffLen = socketBufferSize; - err = PBControlSync((ParmBlkPtr) &statePtr->pb); - if (err != noErr) { - /* - * Hmmm... We can't reopen the server. We'll go ahead - * an continue - but we are kind of broken now... - */ - Debugger(); - statePtr->tcpStream = -1; - statePtr->flags |= TCP_SERVER_ZOMBIE; - } - - tcpStream = statePtr->tcpStream = statePtr->pb.tcpStream; - - InitMacTCPParamBlock(&statePtr->pb, TCPPassiveOpen); - statePtr->pb.tcpStream = tcpStream; - statePtr->pb.csParam.open.localHost = 0; - statePtr->pb.csParam.open.localPort = statePtr->port; - statePtr->pb.ioCompletion = completeUPP; - statePtr->pb.csParam.open.userDataPtr = (Ptr) statePtr; - statePtr->flags |= TCP_LISTENING; - err = PBControlAsync((ParmBlkPtr) &(statePtr->pb)); - /* - * TODO: deal with case where we can't recreate server socket... - */ - - /* - * Finally we run the accept procedure. We must do this last to make - * sure we are in a nice clean state. This Tcl code can do anything - * including closing the server or client sockets we've just delt with. - */ - - if (statePtr->acceptProc != NULL) { - sprintf(remoteHostname, "%d.%d.%d.%d", remoteAddress>>24, - remoteAddress>>16 & 0xff, remoteAddress>>8 & 0xff, - remoteAddress & 0xff); - - (statePtr->acceptProc)(statePtr->acceptProcData, newStatePtr->channel, - remoteHostname, remotePort); - } -} - -/* - *---------------------------------------------------------------------- - * - * 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: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -Tcl_GetHostName() -{ - static int hostnameInited = 0; - static char hostname[255]; - ip_addr ourAddress; - Tcl_DString dString; - OSErr err; - - if (hostnameInited) { - return hostname; - } - - if (TclpHasSockets(NULL) == TCL_OK) { - err = GetLocalAddress(&ourAddress); - if (err == noErr) { - /* - * Search for the doman name and return it if found. Otherwise, - * just print the IP number to a string and return that. - */ - - Tcl_DStringInit(&dString); - err = ResolveAddress(ourAddress, &dString); - if (err == noErr) { - strcpy(hostname, dString.string); - } else { - sprintf(hostname, "%d.%d.%d.%d", ourAddress>>24, ourAddress>>16 & 0xff, - ourAddress>>8 & 0xff, ourAddress & 0xff); - } - Tcl_DStringFree(&dString); - - hostnameInited = 1; - return hostname; - } - } - - hostname[0] = '\0'; - hostnameInited = 1; - return hostname; -} - -/* - *---------------------------------------------------------------------- - * - * ResolveAddress -- - * - * This function is used to resolve an ip address to it's full - * domain name address. - * - * Results: - * An os err value. - * - * Side effects: - * Treats client data as int we set to true. - * - *---------------------------------------------------------------------- - */ - -static OSErr -ResolveAddress( - ip_addr tcpAddress, /* Address to resolve. */ - Tcl_DString *dsPtr) /* Returned address in string. */ -{ - int i; - EventRecord dummy; - DNRState dnrState; - OSErr err; - - /* - * Call AddrToName to resolve our ip address to our domain name. - * The call is async, so we must wait for a callback to tell us - * when to continue. - */ - - for (i = 0; i < NUM_ALT_ADDRS; i++) { - dnrState.hostInfo.addr[i] = 0; - } - dnrState.done = 0; - GetCurrentProcess(&(dnrState.psn)); - err = AddrToName(tcpAddress, &dnrState.hostInfo, resultUPP, (Ptr) &dnrState); - if (err == cacheFault) { - while (!dnrState.done) { - WaitNextEvent(0, &dummy, 1, NULL); - } - } - - /* - * If there is no error in finding the domain name we set the - * result into the dynamic string. We also work around a bug in - * MacTcp where an extranious '.' may be found at the end of the name. - */ - - if (dnrState.hostInfo.rtnCode == noErr) { - i = strlen(dnrState.hostInfo.cname) - 1; - if (dnrState.hostInfo.cname[i] == '.') { - dnrState.hostInfo.cname[i] = '\0'; - } - Tcl_DStringAppend(dsPtr, dnrState.hostInfo.cname, -1); - } - - return dnrState.hostInfo.rtnCode; -} - -/* - *---------------------------------------------------------------------- - * - * DNRCompletionRoutine -- - * - * This function is called when the Domain Name Server is done - * seviceing our request. It just sets a flag that we can poll - * in functions like Tcl_GetHostName to let them know to continue. - * - * Results: - * None. - * - * Side effects: - * Treats client data as int we set to true. - * - *---------------------------------------------------------------------- - */ - -static pascal void -DNRCompletionRoutine( - struct hostInfo *hostinfoPtr, /* Host infor struct. */ - DNRState *dnrStatePtr) /* Completetion state. */ -{ - dnrStatePtr->done = true; - WakeUpProcess(&(dnrStatePtr->psn)); -} - -/* - *---------------------------------------------------------------------- - * - * CleanUpExitProc -- - * - * This procedure is invoked as an exit handler when ExitToShell - * is called. It aborts any lingering socket connections. This - * must be called or the Mac OS will more than likely crash. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static pascal void -CleanUpExitProc() -{ - TCPiopb exitPB; - TcpState *statePtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - while (tsdPtr->socketList != NULL) { - statePtr = tsdPtr->socketList; - tsdPtr->socketList = statePtr->nextPtr; - - /* - * Close and Release the connection. - */ - - exitPB.ioCRefNum = driverRefNum; - exitPB.csCode = TCPClose; - exitPB.tcpStream = statePtr->tcpStream; - exitPB.csParam.close.ulpTimeoutValue = 60 /* seconds */; - exitPB.csParam.close.ulpTimeoutAction = 1 /* 1:abort 0:report */; - exitPB.csParam.close.validityFlags = timeoutValue | timeoutAction; - exitPB.ioCompletion = NULL; - PBControlSync((ParmBlkPtr) &exitPB); - - exitPB.ioCRefNum = driverRefNum; - exitPB.csCode = TCPRelease; - exitPB.tcpStream = statePtr->tcpStream; - exitPB.ioCompletion = NULL; - PBControlSync((ParmBlkPtr) &exitPB); - } -} - -/* - *---------------------------------------------------------------------- - * - * GetHostFromString -- - * - * Looks up the passed in domain name in the domain resolver. It - * can accept strings of two types: 1) the ip number in string - * format, or 2) the domain name. - * - * Results: - * We return a ip address or 0 if there was an error or the - * domain does not exist. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static OSErr -GetHostFromString( - char *name, /* Host in string form. */ - ip_addr *address) /* Returned IP address. */ -{ - OSErr err; - int i; - EventRecord dummy; - DNRState dnrState; - - if (TclpHasSockets(NULL) != TCL_OK) { - return 0; - } - - /* - * Call StrToAddr to get the ip number for the passed in domain - * name. The call is async, so we must wait for a callback to - * tell us when to continue. - */ - - for (i = 0; i < NUM_ALT_ADDRS; i++) { - dnrState.hostInfo.addr[i] = 0; - } - dnrState.done = 0; - GetCurrentProcess(&(dnrState.psn)); - err = StrToAddr(name, &dnrState.hostInfo, resultUPP, (Ptr) &dnrState); - if (err == cacheFault) { - while (!dnrState.done) { - WaitNextEvent(0, &dummy, 1, NULL); - } - } - - /* - * For some reason MacTcp may return a cachFault a second time via - * the hostinfo block. This seems to be a bug in MacTcp. In this case - * we run StrToAddr again - which seems to then work just fine. - */ - - if (dnrState.hostInfo.rtnCode == cacheFault) { - dnrState.done = 0; - err = StrToAddr(name, &dnrState.hostInfo, resultUPP, (Ptr) &dnrState); - if (err == cacheFault) { - while (!dnrState.done) { - WaitNextEvent(0, &dummy, 1, NULL); - } - } - } - - if (dnrState.hostInfo.rtnCode == noErr) { - *address = dnrState.hostInfo.addr[0]; - } - - return dnrState.hostInfo.rtnCode; -} - -/* - *---------------------------------------------------------------------- - * - * IOCompletionRoutine -- - * - * This function is called when an asynchronous socket operation - * completes. Since this routine runs as an interrupt handler, - * it will simply set state to tell the notifier that this socket - * is now ready for action. Note that this function is running at - * interupt time and can't allocate memory or do much else except - * set state. - * - * Results: - * None. - * - * Side effects: - * Sets some state in the socket state. May also wake the process - * if we are not currently running. - * - *---------------------------------------------------------------------- - */ - -static void -IOCompletionRoutine( - TCPiopb *pbPtr) /* Tcp parameter block. */ -{ - TcpState *statePtr; - - if (pbPtr->csCode == TCPSend) { - statePtr = (TcpState *) pbPtr->csParam.send.userDataPtr; - } else { - statePtr = (TcpState *) pbPtr->csParam.open.userDataPtr; - } - - /* - * Always wake the process in case it's in WaitNextEvent. - * If an error has a occured - just return. We will deal - * with the problem later. - */ - - WakeUpProcess(&statePtr->psn); - if (pbPtr->ioResult != noErr) { - return; - } - - if (statePtr->flags & TCP_ASYNC_CONNECT) { - statePtr->flags &= ~TCP_ASYNC_CONNECT; - statePtr->flags |= TCP_CONNECTED; - statePtr->checkMask |= TCL_READABLE & TCL_WRITABLE; - } else if (statePtr->flags & TCP_LISTENING) { - if (statePtr->port == 0) { - Debugger(); - } - statePtr->flags &= ~TCP_LISTENING; - statePtr->flags |= TCP_LISTEN_CONNECT; - statePtr->checkMask |= TCL_READABLE; - } else if (statePtr->flags & TCP_WRITING) { - statePtr->flags &= ~TCP_WRITING; - statePtr->checkMask |= TCL_WRITABLE; - if (!(statePtr->flags & TCP_CONNECTED)) { - InitMacTCPParamBlock(&statePtr->pb, TCPClose); - statePtr->pb.tcpStream = statePtr->tcpStream; - statePtr->pb.ioCompletion = closeUPP; - statePtr->pb.csParam.close.userDataPtr = (Ptr) statePtr; - if (PBControlAsync((ParmBlkPtr) &statePtr->pb) != noErr) { - statePtr->flags |= TCP_RELEASE; - } - } - } -} - -/* - *---------------------------------------------------------------------- - * - * GetLocalAddress -- - * - * Get the IP address for this machine. The result is cached so - * the result is returned quickly after the first call. - * - * Results: - * Macintosh error code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static OSErr -GetLocalAddress( - unsigned long *addr) /* Returns host IP address. */ -{ - struct GetAddrParamBlock pBlock; - OSErr err = noErr; - static unsigned long localAddress = 0; - - if (localAddress == 0) { - memset(&pBlock, 0, sizeof(pBlock)); - pBlock.ioResult = 1; - pBlock.csCode = ipctlGetAddr; - pBlock.ioCRefNum = driverRefNum; - err = PBControlSync((ParmBlkPtr) &pBlock); - - if (err != noErr) { - return err; - } - localAddress = pBlock.ourAddress; - } - - *addr = localAddress; - return noErr; -} - -/* - *---------------------------------------------------------------------- - * - * GetBufferSize -- - * - * Get the appropiate buffer size for our machine & network. This - * value will be used by the rest of Tcl & the MacTcp driver for - * the size of its buffers. If out method for determining the - * optimal buffer size fails for any reason - we return a - * reasonable default. - * - * Results: - * Size of optimal buffer in bytes. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static long -GetBufferSize() -{ - UDPiopb iopb; - OSErr err = noErr; - long bufferSize; - - memset(&iopb, 0, sizeof(iopb)); - err = GetLocalAddress(&iopb.csParam.mtu.remoteHost); - if (err != noErr) { - return CHANNEL_BUF_SIZE; - } - iopb.ioCRefNum = driverRefNum; - iopb.csCode = UDPMaxMTUSize; - err = PBControlSync((ParmBlkPtr)&iopb); - if (err != noErr) { - return CHANNEL_BUF_SIZE; - } - bufferSize = (iopb.csParam.mtu.mtuSize * 4) + 1024; - if (bufferSize < CHANNEL_BUF_SIZE) { - bufferSize = CHANNEL_BUF_SIZE; - } - return bufferSize; -} - -/* - *---------------------------------------------------------------------- - * - * TclSockGetPort -- - * - * Maps from a string, which could be a service name, to a port. - * Used by socket creation code to get port numbers and resolve - * registered service names to port numbers. - * - * Results: - * A standard Tcl result. On success, the port number is - * returned in portPtr. On failure, an error message is left in - * the interp's result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclSockGetPort( - Tcl_Interp *interp, /* Interp for error messages. */ - char *string, /* Integer or service name */ - char *proto, /* "tcp" or "udp", typically - - * ignored on Mac - assumed to be tcp */ - int *portPtr) /* Return port number */ -{ - PortInfo *portInfoPtr = NULL; - - if (Tcl_GetInt(interp, string, portPtr) == TCL_OK) { - if (*portPtr > 0xFFFF) { - Tcl_AppendResult(interp, "couldn't open socket: port number too high", - (char *) NULL); - return TCL_ERROR; - } - if (*portPtr < 0) { - Tcl_AppendResult(interp, "couldn't open socket: negative port number", - (char *) NULL); - return TCL_ERROR; - } - return TCL_OK; - } - for (portInfoPtr = portServices; portInfoPtr->name != NULL; portInfoPtr++) { - if (!strcmp(portInfoPtr->name, string)) { - break; - } - } - if (portInfoPtr != NULL && portInfoPtr->name != NULL) { - *portPtr = portInfoPtr->port; - Tcl_ResetResult(interp); - return TCL_OK; - } - - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * ClearZombieSockets -- - * - * This procedure looks through the socket list and removes the - * first stream it finds that is ready for release. This procedure - * should be called before we ever try to create new Tcp streams - * to ensure we can least allocate one stream. - * - * Results: - * None. - * - * Side effects: - * Tcp streams may be released. - * - *---------------------------------------------------------------------- - */ - -static void -ClearZombieSockets() -{ - TcpState *statePtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - - for (statePtr = tsdPtr->socketList; statePtr != NULL; - statePtr = statePtr->nextPtr) { - if (statePtr->flags & TCP_RELEASE) { - SocketFreeProc(statePtr); - return; - } - } -} diff --git a/mac/tclMacTclCode.r b/mac/tclMacTclCode.r deleted file mode 100644 index 1a8f3ca..0000000 --- a/mac/tclMacTclCode.r +++ /dev/null @@ -1,36 +0,0 @@ -/* - * tclMacTclCode.r -- - * - * This file creates resources from the Tcl code that is - * usually stored in the TCL_LiBRARY - * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) tclMacTclCode.r 1.1 98/01/21 22:22:38 - */ - -#include -#include - -#define TCL_LIBRARY_RESOURCES 2000 - -/* - * The mechanisim below loads Tcl source into the resource fork of the - * application. The example below creates a TEXT resource named - * "Init" from the file "init.tcl". This allows applications to use - * Tcl to define the behavior of the application without having to - * require some predetermined file structure - all needed Tcl "files" - * are located within the application. To source a file for the - * resource fork the source command has been modified to support - * sourcing from resources. In the below case "source -rsrc {Init}" - * will load the TEXT resource named "Init". - */ - -read 'TEXT' (TCL_LIBRARY_RESOURCES, "Init", purgeable) "::library:init.tcl"; -read 'TEXT' (TCL_LIBRARY_RESOURCES + 1, "Auto", purgeable) "::library:auto.tcl"; -read 'TEXT' (TCL_LIBRARY_RESOURCES + 2, "Package", purgeable,preload) "::library:package.tcl"; -read 'TEXT' (TCL_LIBRARY_RESOURCES + 3, "History", purgeable) "::library:history.tcl"; -read 'TEXT' (TCL_LIBRARY_RESOURCES + 4, "Word", purgeable,preload) "::library:word.tcl"; diff --git a/mac/tclMacTest.c b/mac/tclMacTest.c deleted file mode 100644 index 3c982c5..0000000 --- a/mac/tclMacTest.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - * tclMacTest.c -- - * - * Contains commands for platform specific tests for - * the Macintosh platform. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacTest.c,v 1.3 1998/11/10 06:49:51 jingham Exp $ - */ - -#define TCL_TEST - -#include "tclInt.h" -#include "tclMacInt.h" -#include "tclMacPort.h" -#include "Files.h" -#include -#include -#include -#include -#include - -/* - * Forward declarations of procedures defined later in this file: - */ - -int TclplatformtestInit _ANSI_ARGS_((Tcl_Interp *interp)); -static int DebuggerCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); -static int WriteTextResource _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int argc, char **argv)); - - -/* - *---------------------------------------------------------------------- - * - * 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. */ -{ - /* - * Add commands for platform specific tests on MacOS here. - */ - - Tcl_CreateCommand(interp, "debugger", DebuggerCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "testWriteTextResource", WriteTextResource, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * DebuggerCmd -- - * - * This procedure simply calls the low level debugger. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -DebuggerCmd( - ClientData clientData, /* Not used. */ - Tcl_Interp *interp, /* Not used. */ - int argc, /* Not used. */ - char **argv) /* Not used. */ -{ - Debugger(); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * WriteTextResource -- - * - * This procedure will write a text resource out to the - * application or a given file. The format for this command is - * textwriteresource - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -WriteTextResource( - ClientData clientData, /* Not used. */ - Tcl_Interp *interp, /* Current interpreter. */ - int argc, /* Number of arguments. */ - char **argv) /* Argument strings. */ -{ - char *errNum = "wrong # args: "; - char *errBad = "bad argument: "; - char *errStr; - char *fileName = NULL, *rsrcName = NULL; - char *data = NULL; - int rsrcID = -1, i, protectIt = 0; - short fileRef = -1; - OSErr err; - Handle dataHandle; - Str255 resourceName; - FSSpec fileSpec; - - /* - * Process the arguments. - */ - for (i = 1 ; i < argc ; i++) { - if (!strcmp(argv[i], "-rsrc")) { - rsrcName = argv[i + 1]; - i++; - } else if (!strcmp(argv[i], "-rsrcid")) { - rsrcID = atoi(argv[i + 1]); - i++; - } else if (!strcmp(argv[i], "-file")) { - fileName = argv[i + 1]; - i++; - } else if (!strcmp(argv[i], "-protected")) { - protectIt = 1; - } else { - data = argv[i]; - } - } - - if ((rsrcName == NULL && rsrcID < 0) || - (fileName == NULL) || (data == NULL)) { - errStr = errBad; - goto sourceFmtErr; - } - - /* - * Open the resource file. - */ - err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); - if (!(err == noErr || err == fnfErr)) { - Tcl_AppendResult(interp, "couldn't validate file name", (char *) NULL); - return TCL_ERROR; - } - - if (err == fnfErr) { - FSpCreateResFile(&fileSpec, 'WIsH', 'rsrc', smSystemScript); - } - fileRef = FSpOpenResFile(&fileSpec, fsRdWrPerm); - if (fileRef == -1) { - Tcl_AppendResult(interp, "couldn't open resource file", (char *) NULL); - return TCL_ERROR; - } - - UseResFile(fileRef); - - /* - * Prepare data needed to create resource. - */ - if (rsrcID < 0) { - rsrcID = UniqueID('TEXT'); - } - - strcpy((char *) resourceName, rsrcName); - c2pstr((char *) resourceName); - - dataHandle = NewHandle(strlen(data)); - HLock(dataHandle); - strcpy(*dataHandle, data); - HUnlock(dataHandle); - - /* - * Add the resource to the file and close it. - */ - AddResource(dataHandle, 'TEXT', rsrcID, resourceName); - - UpdateResFile(fileRef); - if (protectIt) { - SetResAttrs(Get1Resource('TEXT', rsrcID), resProtected); - } - - CloseResFile(fileRef); - return TCL_OK; - - sourceFmtErr: - Tcl_AppendResult(interp, errStr, "error in \"", argv[0], "\"", - (char *) NULL); - return TCL_ERROR; -} - -int -TclMacChmod( - char *path, - int mode) -{ - HParamBlockRec hpb; - OSErr err; - - c2pstr(path); - hpb.fileParam.ioNamePtr = (unsigned char *) path; - hpb.fileParam.ioVRefNum = 0; - hpb.fileParam.ioDirID = 0; - - if (mode & 0200) { - err = PBHRstFLockSync(&hpb); - } else { - err = PBHSetFLockSync(&hpb); - } - p2cstr((unsigned char *) path); - - if (err != noErr) { - errno = TclMacOSErrorToPosixError(err); - return -1; - } - - return 0; -} - diff --git a/mac/tclMacThrd.c b/mac/tclMacThrd.c deleted file mode 100644 index 7790e5f..0000000 --- a/mac/tclMacThrd.c +++ /dev/null @@ -1,795 +0,0 @@ -/* - * tclMacThrd.c -- - * - * This file implements the Mac-specific thread support. - * - * Copyright (c) 1991-1994 The Regents of the University of California. - * Copyright (c) 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. - * - * SCCS: @(#) tclMacThrd.c 1.2 98/02/23 16:48:07 - */ - -#include "tclInt.h" -#include "tclPort.h" -#include "tclMacInt.h" -#include -#include - -#define TCL_MAC_THRD_DEFAULT_STACK (256*1024) - - -typedef struct TclMacThrdData { - ThreadID threadID; - VOID *data; - struct TclMacThrdData *next; -} TclMacThrdData; - -/* - * This is an array of the Thread Data Keys. It is a process-wide table. - * Its size is originally set to 32, but it can grow if needed. - */ - -static TclMacThrdData **tclMacDataKeyArray; -#define TCL_MAC_INITIAL_KEYSIZE 32 - -/* - * These two bits of data store the current maximum number of keys - * and the keyCounter (which is the number of occupied slots in the - * KeyData array. - * - */ - -static int maxNumKeys = 0; -static int keyCounter = 0; - -/* - * Prototypes for functions used only in this file - */ - -TclMacThrdData *GetThreadDataStruct(Tcl_ThreadDataKey keyVal); -TclMacThrdData *RemoveThreadDataStruct(Tcl_ThreadDataKey keyVal); - -/* - *---------------------------------------------------------------------- - * - * TclMacHaveThreads -- - * - * Do we have the Thread Manager? - * - * Results: - * 1 if the ThreadManager is present, 0 otherwise. - * - * Side effects: - * If this is the first time this is called, the return is cached. - * - *---------------------------------------------------------------------- - */ - -int -TclMacHaveThreads(void) -{ - static initialized = false; - static int tclMacHaveThreads = false; - long response = 0; - OSErr err = noErr; - - if (!initialized) { - err = Gestalt(gestaltThreadMgrAttr, &response); - if (err == noErr) { - tclMacHaveThreads = response | (1 << gestaltThreadMgrPresent); - } - } - - return tclMacHaveThreads; -} - -/* - *---------------------------------------------------------------------- - * - * 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(idPtr, proc, clientData) - Tcl_ThreadId *idPtr; /* Return, the ID of the thread */ - Tcl_ThreadCreateProc proc; /* Main() function of the thread */ - ClientData clientData; /* The one argument to Main() */ -{ - - if (!TclMacHaveThreads()) { - return TCL_ERROR; - } - -#if TARGET_CPU_68K && TARGET_RT_MAC_CFM - { - ThreadEntryProcPtr entryProc; - entryProc = NewThreadEntryProc(proc); - - NewThread(kCooperativeThread, entryProc, (void *) clientData, - TCL_MAC_THRD_DEFAULT_STACK, kCreateIfNeeded, NULL, (ThreadID *) idPtr); - } -#else - NewThread(kCooperativeThread, proc, (void *) clientData, - TCL_MAC_THRD_DEFAULT_STACK, kCreateIfNeeded, NULL, (ThreadID *) idPtr); -#endif - if ((ThreadID) *idPtr == kNoThreadID) { - return TCL_ERROR; - } else { - return TCL_OK; - } - -} - -/* - *---------------------------------------------------------------------- - * - * TclpThreadExit -- - * - * This procedure terminates the current thread. - * - * Results: - * None. - * - * Side effects: - * This procedure terminates the current thread. - * - *---------------------------------------------------------------------- - */ - -void -TclpThreadExit(status) - int status; -{ - ThreadID curThread; - - if (!TclMacHaveThreads()) { - return; - } - - GetCurrentThread(&curThread); - DisposeThread(curThread, NULL, false); -} - - -/* - *---------------------------------------------------------------------- - * - * Tcl_GetCurrentThread -- - * - * This procedure returns the ID of the currently running thread. - * - * Results: - * A thread ID. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Tcl_ThreadId -Tcl_GetCurrentThread() -{ -#ifdef TCL_THREADS - ThreadID curThread; - - if (!TclMacHaveThreads()) { - return (Tcl_ThreadId) 0; - } else { - GetCurrentThread(&curThread); - return (Tcl_ThreadId) curThread; - } -#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() -{ -#ifdef TCL_THREADS - /* There is nothing to do on the Mac. */; -#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() -{ -#ifdef TCL_THREADS - /* There is nothing to do on the Mac */; -#endif -} - -/* - *---------------------------------------------------------------------- - * - * TclpMasterLock - * - * 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 syncronization objects. - * - * Results: - * None. - * - * Side effects: - * Acquire the master mutex. - * - *---------------------------------------------------------------------- - */ - -void -TclpMasterLock() -{ -#ifdef TCL_THREADS - /* There is nothing to do on the Mac */; -#endif -} - - -/* - *---------------------------------------------------------------------- - * - * TclpMasterUnlock - * - * This procedure is used to release a lock that serializes creation - * and finalization of synchronization objects. - * - * Results: - * None. - * - * Side effects: - * Release the master mutex. - * - *---------------------------------------------------------------------- - */ - -void -TclpMasterUnlock() -{ -#ifdef TCL_THREADS - /* There is nothing to do on the Mac */ -#endif -} - -#ifdef 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 aquired 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(mutexPtr) - Tcl_Mutex *mutexPtr; /* Really (pthread_mutex_t **) */ -{ -/* There is nothing to do on the Mac */ -} - - -/* - *---------------------------------------------------------------------- - * - * TclpMutexUnlock -- - * - * 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(mutexPtr) - Tcl_Mutex *mutexPtr; /* Really (pthread_mutex_t **) */ -{ -/* There is nothing to do on the Mac */ -} - - -/* - *---------------------------------------------------------------------- - * - * TclpFinalizeMutex -- - * - * This procedure is invoked to clean up one mutex. This is only - * safe to call at the end of time. - * - * This assumes the Master Lock is held. - * - * Results: - * None. - * - * Side effects: - * The mutex list is deallocated. - * - *---------------------------------------------------------------------- - */ - -void -TclpFinalizeMutex(mutexPtr) - Tcl_Mutex *mutexPtr; -{ -/* There is nothing to do on the Mac */ -} - - -/* - *---------------------------------------------------------------------- - * - * TclpThreadDataKeyInit -- - * - * This procedure initializes a thread specific data block key. - * Each thread has table of pointers to thread specific data. - * all threads agree on which table entry is used by each module. - * this is remembered in a "data key", that is just an index into - * this table. To allow self initialization, the interface - * passes a pointer to this key and the first thread to use - * the key fills in the pointer to the key. The key should be - * a process-wide static. - * - * There is no system-wide support for thread specific data on the - * Mac. So we implement this as an array of pointers. The keys are - * allocated sequentially, and each key maps to a slot in the table. - * The table element points to a linked list of the instances of - * the data for each thread. - * - * Results: - * None. - * - * Side effects: - * Will bump the key counter if this is the first time this key - * has been initialized. May grow the DataKeyArray if that is - * necessary. - * - *---------------------------------------------------------------------- - */ - -void -TclpThreadDataKeyInit(keyPtr) - Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, - * really (pthread_key_t **) */ -{ - - if (*keyPtr == NULL) { - keyCounter += 1; - *keyPtr = (Tcl_ThreadDataKey) keyCounter; - if (keyCounter > maxNumKeys) { - TclMacThrdData **newArray; - int i, oldMax = maxNumKeys; - - maxNumKeys = maxNumKeys + TCL_MAC_INITIAL_KEYSIZE; - - newArray = (TclMacThrdData **) - ckalloc(maxNumKeys * sizeof(TclMacThrdData *)); - - for (i = 0; i < oldMax; i++) { - newArray[i] = tclMacDataKeyArray[i]; - } - for (i = oldMax; i < maxNumKeys; i++) { - newArray[i] = NULL; - } - - if (tclMacDataKeyArray != NULL) { - ckfree((char *) tclMacDataKeyArray); - } - tclMacDataKeyArray = newArray; - - } - /* TclRememberDataKey(keyPtr); */ - } -} - -/* - *---------------------------------------------------------------------- - * - * TclpThreadDataKeyGet -- - * - * This procedure returns a pointer to a block of thread local storage. - * - * Results: - * A thread-specific pointer to the data structure, or NULL - * if the memory has not been assigned to this key for this thread. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -VOID * -TclpThreadDataKeyGet(keyPtr) - Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, - * really (pthread_key_t **) */ -{ - TclMacThrdData *dataPtr; - - dataPtr = GetThreadDataStruct(*keyPtr); - - if (dataPtr == NULL) { - return NULL; - } else { - return dataPtr->data; - } -} - - -/* - *---------------------------------------------------------------------- - * - * TclpThreadDataKeySet -- - * - * This procedure sets the pointer to a block of thread local storage. - * - * Results: - * None. - * - * Side effects: - * Sets up the thread so future calls to TclpThreadDataKeyGet with - * this key will return the data pointer. - * - *---------------------------------------------------------------------- - */ - -void -TclpThreadDataKeySet(keyPtr, data) - Tcl_ThreadDataKey *keyPtr; /* Identifier for the data chunk, - * really (pthread_key_t **) */ - VOID *data; /* Thread local storage */ -{ - TclMacThrdData *dataPtr; - ThreadID curThread; - - dataPtr = GetThreadDataStruct(*keyPtr); - - /* - * Is it legal to reset the thread data like this? - * And if so, who owns the memory? - */ - - if (dataPtr != NULL) { - dataPtr->data = data; - } else { - dataPtr = (TclMacThrdData *) ckalloc(sizeof(TclMacThrdData)); - GetCurrentThread(&curThread); - dataPtr->threadID = curThread; - dataPtr->data = data; - dataPtr->next = tclMacDataKeyArray[(int) *keyPtr - 1]; - tclMacDataKeyArray[(int) *keyPtr - 1] = dataPtr; - } -} - -/* - *---------------------------------------------------------------------- - * - * TclpFinalizeThreadData -- - * - * This procedure cleans up the thread-local storage. This is - * called once for each thread. - * - * Results: - * None. - * - * Side effects: - * Frees up all thread local storage. - * - *---------------------------------------------------------------------- - */ - -void -TclpFinalizeThreadData(keyPtr) - Tcl_ThreadDataKey *keyPtr; -{ - TclMacThrdData *dataPtr; - - if (*keyPtr != NULL) { - dataPtr = RemoveThreadDataStruct(*keyPtr); - - if ((dataPtr != NULL) && (dataPtr->data != NULL)) { - ckfree((char *) dataPtr->data); - ckfree((char *) dataPtr); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * TclpFinalizeThreadDataKey -- - * - * This procedure is invoked to clean up one key. This is a - * process-wide storage identifier. The thread finalization code - * cleans up the thread local storage itself. - * - * On the Mac, there is really nothing to do here, since the key - * is just an array index. But we set the key to 0 just in case - * someone else is relying on that. - * - * Results: - * None. - * - * Side effects: - * The keyPtr value is set to 0. - * - *---------------------------------------------------------------------- - */ - -void -TclpFinalizeThreadDataKey(keyPtr) - Tcl_ThreadDataKey *keyPtr; -{ - ckfree((char *) tclMacDataKeyArray[(int) *keyPtr - 1]); - tclMacDataKeyArray[(int) *keyPtr - 1] = NULL; - *keyPtr = NULL; -} - - -/* - *---------------------------------------------------------------------- - * - * GetThreadDataStruct -- - * - * This procedure gets the data structure corresponding to - * keyVal for the current process. - * - * Results: - * The requested key data. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -TclMacThrdData * -GetThreadDataStruct(keyVal) - Tcl_ThreadDataKey keyVal; -{ - ThreadID curThread; - TclMacThrdData *dataPtr; - - /* - * The keyPtr will only be greater than keyCounter is someone - * has passed us a key without getting the value from - * TclpInitDataKey. - */ - - if ((int) keyVal <= 0) { - return NULL; - } else if ((int) keyVal > keyCounter) { - panic("illegal data key value"); - } - - GetCurrentThread(&curThread); - - for (dataPtr = tclMacDataKeyArray[(int) keyVal - 1]; dataPtr != NULL; - dataPtr = dataPtr->next) { - if (dataPtr->threadID == curThread) { - break; - } - } - - return dataPtr; -} - - -/* - *---------------------------------------------------------------------- - * - * RemoveThreadDataStruct -- - * - * This procedure removes the data structure corresponding to - * keyVal for the current process from the list kept for keyVal. - * - * Results: - * The requested key data is removed from the list, and a pointer - * to it is returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -TclMacThrdData * -RemoveThreadDataStruct(keyVal) - Tcl_ThreadDataKey keyVal; -{ - ThreadID curThread; - TclMacThrdData *dataPtr, *prevPtr; - - - if ((int) keyVal <= 0) { - return NULL; - } else if ((int) keyVal > keyCounter) { - panic("illegal data key value"); - } - - GetCurrentThread(&curThread); - - for (dataPtr = tclMacDataKeyArray[(int) keyVal - 1], prevPtr = NULL; - dataPtr != NULL; - prevPtr = dataPtr, dataPtr = dataPtr->next) { - if (dataPtr->threadID == curThread) { - break; - } - } - - if (dataPtr == NULL) { - /* No body */ - } else if ( prevPtr == NULL) { - tclMacDataKeyArray[(int) keyVal - 1] = dataPtr->next; - } else { - prevPtr->next = dataPtr->next; - } - - return dataPtr; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_ConditionWait -- - * - * This procedure is invoked to wait on a condition variable. - * On the Mac, mutexes are no-ops, and we just yield. After - * all, it is the application's job to loop till the condition - * variable is changed... - * - * - * Results: - * None. - * - * Side effects: - * Will block the current thread till someone else yields. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_ConditionWait(condPtr, mutexPtr, timePtr) - Tcl_Condition *condPtr; /* Really (pthread_cond_t **) */ - Tcl_Mutex *mutexPtr; /* Really (pthread_mutex_t **) */ - Tcl_Time *timePtr; /* Timeout on waiting period */ -{ - if (TclMacHaveThreads()) { - YieldToAnyThread(); - } -} - -/* - *---------------------------------------------------------------------- - * - * 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(condPtr) - Tcl_Condition *condPtr; -{ - if (TclMacHaveThreads()) { - YieldToAnyThread(); - } -} - - -/* - *---------------------------------------------------------------------- - * - * 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 Master Lock is held. - * - * Results: - * None. - * - * Side effects: - * The condition variable is deallocated. - * - *---------------------------------------------------------------------- - */ - -void -TclpFinalizeCondition(condPtr) - Tcl_Condition *condPtr; -{ - /* Nothing to do on the Mac */ -} - - - -#endif /* TCL_THREADS */ - diff --git a/mac/tclMacThrd.h b/mac/tclMacThrd.h deleted file mode 100644 index 22f2c83..0000000 --- a/mac/tclMacThrd.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * tclUnixThrd.h -- - * - * This header file defines things for thread support. - * - * Copyright (c) 1998 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) - */ - -#ifndef _TCLMACTHRD -#define _TCLMACTHRD - -#ifdef TCL_THREADS - -#endif /* TCL_THREADS */ -#endif /* _TCLMACTHRD */ diff --git a/mac/tclMacTime.c b/mac/tclMacTime.c deleted file mode 100644 index 1a2d1ed..0000000 --- a/mac/tclMacTime.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - * tclMacTime.c -- - * - * Contains Macintosh specific versions of Tcl functions that - * obtain time values from the operating system. - * - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacTime.c,v 1.3 1999/03/10 05:52:51 stanton Exp $ - */ - -#include "tclInt.h" -#include "tclPort.h" -#include -#include -#include - -/* - * Static variables used by the TclpGetTime function. - */ - -static int initalized = false; -static unsigned long baseSeconds; -static UnsignedWide microOffset; - -/* - * Prototypes for procedures that are private to this file: - */ - -static void SubtractUnsignedWide _ANSI_ARGS_((UnsignedWide *x, - UnsignedWide *y, UnsignedWide *result)); - -/* - *----------------------------------------------------------------------------- - * - * TclpGetSeconds -- - * - * This procedure returns the number of seconds from the epoch. On - * the Macintosh the epoch is Midnight Jan 1, 1904. Unfortunatly, - * the Macintosh doesn't tie the epoch to a particular time zone. For - * Tcl we tie the epoch to GMT. This makes the time zone date parsing - * code work. The epoch for Mac-Tcl is: Midnight Jan 1, 1904 GMT. - * - * Results: - * Number of seconds from the epoch in GMT. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -unsigned long -TclpGetSeconds() -{ - unsigned long seconds; - MachineLocation loc; - long int offset; - - ReadLocation(&loc); - offset = loc.u.gmtDelta & 0x00ffffff; - if (offset & 0x00800000) { - offset = offset | 0xff000000; - } - - if (ReadDateTime(&seconds) == noErr) { - return (seconds - offset); - } else { - panic("Can't get time."); - return 0; - } -} - -/* - *----------------------------------------------------------------------------- - * - * TclpGetClicks -- - * - * This procedure returns a value that represents the highest resolution - * clock available on the system. There are no garantees on what the - * resolution will be. In Tcl we will call this value a "click". The - * start time is also system dependant. - * - * Results: - * Number of clicks from some start time. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -unsigned long -TclpGetClicks() -{ - UnsignedWide micros; - - Microseconds(µs); - return micros.lo; -} - -/* - *---------------------------------------------------------------------- - * - * TclpGetTimeZone -- - * - * Get the current time zone. - * - * Results: - * The return value is the local time zone, measured in - * minutes away from GMT (-ve for east, +ve for west). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclpGetTimeZone ( - unsigned long currentTime) /* Ignored on Mac. */ -{ - MachineLocation loc; - long int offset; - - ReadLocation(&loc); - offset = loc.u.gmtDelta & 0x00ffffff; - if (offset & 0x00700000) { - offset |= 0xff000000; - } - - /* - * Convert the Mac offset from seconds to minutes and - * add an hour if we have daylight savings time. - */ - offset = -offset; - offset /= 60; - if (loc.u.dlsDelta < 0) { - offset += 60; - } - - return offset; -} - -/* - *---------------------------------------------------------------------- - * - * TclpGetTime -- - * - * 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 the local timezone) in timePtr. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -TclpGetTime( - Tcl_Time *timePtr) /* Location to store time information. */ -{ - UnsignedWide micro; -#ifndef NO_LONG_LONG - long long *microPtr; -#endif - - if (initalized == false) { - MachineLocation loc; - long int offset; - - ReadLocation(&loc); - offset = loc.u.gmtDelta & 0x00ffffff; - if (offset & 0x00800000) { - offset = offset | 0xff000000; - } - if (ReadDateTime(&baseSeconds) != noErr) { - /* - * This should never happen! - */ - return; - } - /* - * Remove the local offset that ReadDateTime() adds. - */ - baseSeconds -= offset; - Microseconds(µOffset); - initalized = true; - } - - Microseconds(µ); - -#ifndef NO_LONG_LONG - microPtr = (long long *) µ - *microPtr -= *((long long *) µOffset); - timePtr->sec = baseSeconds + (*microPtr / 1000000); - timePtr->usec = *microPtr % 1000000; -#else - SubtractUnsignedWide(µ, µOffset, µ); - - /* - * This lovely computation is equal to: base + (micro / 1000000) - * For the .hi part the ratio of 0x100000000 / 1000000 has been - * reduced to avoid overflow. This computation certainly has - * problems as the .hi part gets large. However, your application - * would have to run for a long time to make that happen. - */ - - timePtr->sec = baseSeconds + (micro.lo / 1000000) + - (long) (micro.hi * ((double) 33554432.0 / 15625.0)); - timePtr->usec = micro.lo % 1000000; -#endif -} - -/* - *---------------------------------------------------------------------- - * - * TclpGetDate -- - * - * Converts raw seconds to a struct tm data structure. The - * returned time will be for Greenwich Mean Time if the useGMT flag - * is set. Otherwise, the returned time will be for the local - * time zone. This function is meant to be used as a replacement - * for localtime and gmtime which is broken on most ANSI libs - * on the Macintosh. - * - * Results: - * None. - * - * Side effects: - * The passed in struct tm data structure is modified. - * - *---------------------------------------------------------------------- - */ - -struct tm * -TclpGetDate( - TclpTime_t time, /* Time struct to fill. */ - int useGMT) /* True if date should reflect GNT time. */ -{ - const time_t *tp = (const time_t *)time; - DateTimeRec dtr; - MachineLocation loc; - long int offset; - static struct tm statictime; - static const short monthday[12] = - {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; - - ReadLocation(&loc); - - if (useGMT) { - SecondsToDate(*tp, &dtr); - } else { - offset = loc.u.gmtDelta & 0x00ffffff; - if (offset & 0x00700000) { - offset |= 0xff000000; - } - - SecondsToDate(*tp + offset, &dtr); - } - - statictime.tm_sec = dtr.second; - statictime.tm_min = dtr.minute; - statictime.tm_hour = dtr.hour; - statictime.tm_mday = dtr.day; - statictime.tm_mon = dtr.month - 1; - statictime.tm_year = dtr.year - 1900; - statictime.tm_wday = dtr.dayOfWeek - 1; - statictime.tm_yday = monthday[statictime.tm_mon] - + statictime.tm_mday - 1; - if (1 < statictime.tm_mon && !(statictime.tm_year & 3)) { - ++statictime.tm_yday; - } - statictime.tm_isdst = loc.u.dlsDelta; - return(&statictime); -} - -#ifdef NO_LONG_LONG -/* - *---------------------------------------------------------------------- - * - * SubtractUnsignedWide -- - * - * Subtracts one UnsignedWide value from another. - * - * Results: - * The subtracted value. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -SubtractUnsignedWide( - UnsignedWide *x, /* Ptr to wide int. */ - UnsignedWide *y, /* Ptr to wide int. */ - UnsignedWide *result) /* Ptr to result. */ -{ - result->hi = x->hi - y->hi; - if (x->lo < y->lo) { - result->hi--; - } - result->lo = x->lo - y->lo; -} -#endif diff --git a/mac/tclMacUnix.c b/mac/tclMacUnix.c deleted file mode 100644 index 483780c..0000000 --- a/mac/tclMacUnix.c +++ /dev/null @@ -1,425 +0,0 @@ -/* - * tclMacUnix.c -- - * - * This file contains routines to implement several features - * available to the Unix implementation, but that require - * extra work to do on a Macintosh. These include routines - * Unix Tcl normally hands off to the Unix OS. - * - * Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center - * 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. - * - * RCS: @(#) $Id: tclMacUnix.c,v 1.3 1999/04/16 00:47:22 stanton Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "tclInt.h" -#include "tclMacInt.h" - -/* - * The following two Includes are from the More Files package - */ -#include "FileCopy.h" -#include "MoreFiles.h" -#include "MoreFilesExtras.h" - -/* - * The following may not be defined in some versions of - * MPW header files. - */ -#ifndef kIsInvisible -#define kIsInvisible 0x4000 -#endif -#ifndef kIsAlias -#define kIsAlias 0x8000 -#endif - -/* - * Missing error codes - */ -#define usageErr 500 -#define noSourceErr 501 -#define isDirErr 502 - - -/* - *---------------------------------------------------------------------- - * - * Tcl_EchoCmd -- - * - * Implements the TCL echo command: - * echo ?str ...? - * - * Results: - * Always returns TCL_OK. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_EchoCmd( - ClientData dummy, /* Not used. */ - Tcl_Interp *interp, /* Current interpreter. */ - int argc, /* Number of arguments. */ - char **argv) /* Argument strings. */ -{ - Tcl_Channel chan; - int mode, result, i; - - chan = Tcl_GetChannel(interp, "stdout", &mode); - if (chan == (Tcl_Channel) NULL) { - return TCL_ERROR; - } - for (i = 1; i < argc; i++) { - result = Tcl_WriteChars(chan, argv[i], -1); - if (result < 0) { - Tcl_AppendResult(interp, "echo: ", Tcl_GetChannelName(chan), - ": ", Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; - } - if (i < (argc - 1)) { - Tcl_WriteChars(chan, " ", -1); - } - } - Tcl_WriteChars(chan, "\n", -1); - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_LsObjCmd -- - * - * This procedure is invoked to process the "ls" 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_LsObjCmd( - ClientData dummy, /* Not used. */ - Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ -{ -#define STRING_LENGTH 80 -#define CR '\n' - int i, j; - int fieldLength, len = 0, maxLen = 0, perLine; - OSErr err; - CInfoPBRec paramBlock; - HFileInfo *hpb = (HFileInfo *)¶mBlock; - DirInfo *dpb = (DirInfo *)¶mBlock; - char theFile[256]; - char theLine[STRING_LENGTH + 2]; - int fFlag = false, pFlag = false, aFlag = false, lFlag = false, - cFlag = false, hFlag = false; - char *argv; - Tcl_Obj *newObjv[2], *resultObjPtr; - - /* - * Process command flags. End if argument doesn't start - * with a dash or is a dash by itself. The remaining arguments - * should be files. - */ - for (i = 1; i < objc; i++) { - argv = Tcl_GetString(objv[i]); - if (argv[0] != '-') { - break; - } - - if (!strcmp(argv, "-")) { - i++; - break; - } - - for (j = 1 ; argv[j] ; ++j) { - switch(argv[j]) { - case 'a': - case 'A': - aFlag = true; - break; - case '1': - cFlag = false; - break; - case 'C': - cFlag = true; - break; - case 'F': - fFlag = true; - break; - case 'H': - hFlag = true; - break; - case 'p': - pFlag = true; - break; - case 'l': - pFlag = false; - lFlag = true; - break; - default: - Tcl_AppendResult(interp, "error - unknown flag ", - "usage: ls -apCFHl1 ?files? ", NULL); - return TCL_ERROR; - } - } - } - - objv += i; - objc -= i; - - /* - * No file specifications means we search for all files. - * Glob will be doing most of the work. - */ - if (!objc) { - objc = 1; - newObjv[0] = Tcl_NewStringObj("*", -1); - newObjv[1] = NULL; - objv = newObjv; - } - - if (Tcl_GlobObjCmd(NULL, interp, objc + 1, objv - 1) != TCL_OK) { - Tcl_ResetResult(interp); - return TCL_ERROR; - } - - resultObjPtr = Tcl_GetObjResult(interp); - Tcl_IncrRefCount(resultObjPtr); - if (Tcl_ListObjGetElements(interp, resultObjPtr, &objc, &objv) != TCL_OK) { - Tcl_DecrRefCount(resultObjPtr); - return TCL_ERROR; - } - - Tcl_ResetResult(interp); - - /* - * There are two major methods for listing files: the long - * method and the normal method. - */ - if (lFlag) { - char creator[5], type[5], time[16], date[16]; - char lineTag; - long size; - unsigned short flags; - Tcl_Obj *objPtr; - char *string; - int length; - - /* - * Print the header for long listing. - */ - if (hFlag) { - sprintf(theLine, "T %7s %8s %8s %4s %4s %6s %s", - "Size", "ModTime", "ModDate", - "CRTR", "TYPE", "Flags", "Name"); - Tcl_AppendResult(interp, theLine, "\n", NULL); - Tcl_AppendResult(interp, - "-------------------------------------------------------------\n", - NULL); - } - - for (i = 0; i < objc; i++) { - strcpy(theFile, Tcl_GetString(objv[i])); - - c2pstr(theFile); - hpb->ioCompletion = NULL; - hpb->ioVRefNum = 0; - hpb->ioFDirIndex = 0; - hpb->ioNamePtr = (StringPtr) theFile; - hpb->ioDirID = 0L; - err = PBGetCatInfoSync(¶mBlock); - p2cstr((StringPtr) theFile); - - if (hpb->ioFlAttrib & 16) { - /* - * For directories use zero as the size, use no Creator - * type, and use 'DIR ' as the file type. - */ - if ((aFlag == false) && (dpb->ioDrUsrWds.frFlags & 0x1000)) { - continue; - } - lineTag = 'D'; - size = 0; - IUTimeString(dpb->ioDrMdDat, false, (unsigned char *)time); - p2cstr((StringPtr)time); - IUDateString(dpb->ioDrMdDat, shortDate, (unsigned char *)date); - p2cstr((StringPtr)date); - strcpy(creator, " "); - strcpy(type, "DIR "); - flags = dpb->ioDrUsrWds.frFlags; - if (fFlag || pFlag) { - strcat(theFile, ":"); - } - } else { - /* - * All information for files should be printed. This - * includes size, modtime, moddate, creator type, file - * type, flags, anf file name. - */ - if ((aFlag == false) && - (hpb->ioFlFndrInfo.fdFlags & kIsInvisible)) { - continue; - } - lineTag = 'F'; - size = hpb->ioFlLgLen + hpb->ioFlRLgLen; - IUTimeString(hpb->ioFlMdDat, false, (unsigned char *)time); - p2cstr((StringPtr)time); - IUDateString(hpb->ioFlMdDat, shortDate, (unsigned char *)date); - p2cstr((StringPtr)date); - strncpy(creator, (char *) &hpb->ioFlFndrInfo.fdCreator, 4); - creator[4] = 0; - strncpy(type, (char *) &hpb->ioFlFndrInfo.fdType, 4); - type[4] = 0; - flags = hpb->ioFlFndrInfo.fdFlags; - if (fFlag) { - if (hpb->ioFlFndrInfo.fdFlags & kIsAlias) { - strcat(theFile, "@"); - } else if (hpb->ioFlFndrInfo.fdType == 'APPL') { - strcat(theFile, "*"); - } - } - } - - sprintf(theLine, "%c %7ld %8s %8s %-4.4s %-4.4s 0x%4.4X %s", - lineTag, size, time, date, creator, type, flags, theFile); - - Tcl_AppendResult(interp, theLine, "\n", NULL); - - } - - objPtr = Tcl_GetObjResult(interp); - string = Tcl_GetStringFromObj(objPtr, &length); - if ((length > 0) && (string[length - 1] == '\n')) { - Tcl_SetObjLength(objPtr, length - 1); - } - } else { - /* - * Not in long format. We only print files names. If the - * -C flag is set we need to print in multiple coloumns. - */ - int argCount, linePos; - Boolean needNewLine = false; - - /* - * Fiend the field length: the length each string printed - * to the terminal will be. - */ - if (!cFlag) { - perLine = 1; - fieldLength = STRING_LENGTH; - } else { - for (i = 0; i < objc; i++) { - argv = Tcl_GetString(objv[i]); - len = strlen(argv); - if (len > maxLen) { - maxLen = len; - } - } - fieldLength = maxLen + 3; - perLine = STRING_LENGTH / fieldLength; - } - - argCount = 0; - linePos = 0; - memset(theLine, ' ', STRING_LENGTH); - while (argCount < objc) { - strcpy(theFile, Tcl_GetString(objv[argCount])); - - c2pstr(theFile); - hpb->ioCompletion = NULL; - hpb->ioVRefNum = 0; - hpb->ioFDirIndex = 0; - hpb->ioNamePtr = (StringPtr) theFile; - hpb->ioDirID = 0L; - err = PBGetCatInfoSync(¶mBlock); - p2cstr((StringPtr) theFile); - - if (hpb->ioFlAttrib & 16) { - /* - * Directory. If -a show hidden files. If -f or -p - * denote that this is a directory. - */ - if ((aFlag == false) && (dpb->ioDrUsrWds.frFlags & 0x1000)) { - argCount++; - continue; - } - if (fFlag || pFlag) { - strcat(theFile, ":"); - } - } else { - /* - * File: If -a show hidden files, if -f show links - * (aliases) and executables (APPLs). - */ - if ((aFlag == false) && - (hpb->ioFlFndrInfo.fdFlags & kIsInvisible)) { - argCount++; - continue; - } - if (fFlag) { - if (hpb->ioFlFndrInfo.fdFlags & kIsAlias) { - strcat(theFile, "@"); - } else if (hpb->ioFlFndrInfo.fdType == 'APPL') { - strcat(theFile, "*"); - } - } - } - - /* - * Print the item, taking into account multi- - * coloum output. - */ - strncpy(theLine + (linePos * fieldLength), theFile, - strlen(theFile)); - linePos++; - - if (linePos == perLine) { - theLine[STRING_LENGTH] = '\0'; - if (needNewLine) { - Tcl_AppendResult(interp, "\n", theLine, NULL); - } else { - Tcl_AppendResult(interp, theLine, NULL); - needNewLine = true; - } - linePos = 0; - memset(theLine, ' ', STRING_LENGTH); - } - - argCount++; - } - - if (linePos != 0) { - theLine[STRING_LENGTH] = '\0'; - if (needNewLine) { - Tcl_AppendResult(interp, "\n", theLine, NULL); - } else { - Tcl_AppendResult(interp, theLine, NULL); - } - } - } - - Tcl_DecrRefCount(resultObjPtr); - - return TCL_OK; -} diff --git a/mac/tclMacUtil.c b/mac/tclMacUtil.c deleted file mode 100644 index fd981c9..0000000 --- a/mac/tclMacUtil.c +++ /dev/null @@ -1,441 +0,0 @@ -/* - * tclMacUtil.c -- - * - * This contains utility functions used to help with - * implementing Macintosh specific portions of the Tcl port. - * - * Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center - * Copyright (c) 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. - * - * RCS: @(#) $Id: tclMacUtil.c,v 1.3 1998/11/10 06:49:55 jingham Exp $ - */ - -#include "tcl.h" -#include "tclInt.h" -#include "tclMacInt.h" -#include "tclMath.h" -#include "tclMacPort.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * The following two Includes are from the More Files package. - */ -#include -#include - -/* - *---------------------------------------------------------------------- - * - * hypotd -- - * - * The standard math function hypot is not supported by Think C. - * It is included here so everything works. It is supported by - * CodeWarrior Pro 1, but the 68K version does not support doubles. - * So we hack it in. - * - * Results: - * Result of computation. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#if defined(THINK_C) || defined(__MWERKS__) -double hypotd(double x, double y); - -double -hypotd( - double x, /* X value */ - double y) /* Y value */ -{ - double sum; - - sum = x*x + y*y; - return sqrt(sum); -} -#endif - -/* - *---------------------------------------------------------------------- - * - * FSpGetDefaultDir -- - * - * This function gets the current default directory. - * - * Results: - * The provided FSSpec is changed to point to the "default" - * directory. The function returns what ever errors - * FSMakeFSSpecCompat may encounter. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -FSpGetDefaultDir( - FSSpecPtr dirSpec) /* On return the default directory. */ -{ - OSErr err; - short vRefNum = 0; - long int dirID = 0; - - err = HGetVol(NULL, &vRefNum, &dirID); - - if (err == noErr) { - err = FSMakeFSSpecCompat(vRefNum, dirID, (ConstStr255Param) NULL, - dirSpec); - } - - return err; -} - -/* - *---------------------------------------------------------------------- - * - * FSpSetDefaultDir -- - * - * This function sets the default directory to the directory - * pointed to by the provided FSSpec. - * - * Results: - * The function returns what ever errors HSetVol may encounter. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -FSpSetDefaultDir( - FSSpecPtr dirSpec) /* The new default directory. */ -{ - OSErr err; - - /* - * The following special case is needed to work around a bug - * in the Macintosh OS. (Acutally PC Exchange.) - */ - - if (dirSpec->parID == fsRtParID) { - err = HSetVol(NULL, dirSpec->vRefNum, fsRtDirID); - } else { - err = HSetVol(dirSpec->name, dirSpec->vRefNum, dirSpec->parID); - } - - return err; -} - -/* - *---------------------------------------------------------------------- - * - * FSpFindFolder -- - * - * This function is a version of the FindFolder function that - * returns the result as a FSSpec rather than a vRefNum and dirID. - * - * Results: - * Results will be simaler to that of the FindFolder function. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -OSErr -FSpFindFolder( - short vRefNum, /* Volume reference number. */ - OSType folderType, /* Folder type taken by FindFolder. */ - Boolean createFolder, /* Should we create it if non-existant. */ - FSSpec *spec) /* Pointer to resulting directory. */ -{ - short foundVRefNum; - long foundDirID; - OSErr err; - - err = FindFolder(vRefNum, folderType, createFolder, - &foundVRefNum, &foundDirID); - if (err != noErr) { - return err; - } - - err = FSMakeFSSpecCompat(foundVRefNum, foundDirID, "\p", spec); - return err; -} - -/* - *---------------------------------------------------------------------- - * - * FSpLocationFromPath -- - * - * This function obtains an FSSpec for a given macintosh path. - * Unlike the More Files function FSpLocationFromFullPath, this - * function will also accept partial paths and resolve any aliases - * along the path. - * - * Results: - * OSErr code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -FSpLocationFromPath( - int length, /* Length of path. */ - CONST char *path, /* The path to convert. */ - FSSpecPtr fileSpecPtr) /* On return the spec for the path. */ -{ - Str255 fileName; - OSErr err; - short vRefNum; - long dirID; - int pos, cur; - Boolean isDirectory; - Boolean wasAlias; - - /* - * Check to see if this is a full path. If partial - * we assume that path starts with the current working - * directory. (Ie. volume & dir = 0) - */ - vRefNum = 0; - dirID = 0; - cur = 0; - if (length == 0) { - return fnfErr; - } - if (path[cur] == ':') { - cur++; - if (cur >= length) { - /* - * If path = ":", just return current directory. - */ - FSMakeFSSpecCompat(0, 0, NULL, fileSpecPtr); - return noErr; - } - } else { - while (path[cur] != ':' && cur < length) { - cur++; - } - if (cur > 255) { - return bdNamErr; - } - if (cur < length) { - /* - * This is a full path - */ - cur++; - strncpy((char *) fileName + 1, path, cur); - fileName[0] = cur; - err = FSMakeFSSpecCompat(0, 0, fileName, fileSpecPtr); - if (err != noErr) return err; - FSpGetDirectoryID(fileSpecPtr, &dirID, &isDirectory); - vRefNum = fileSpecPtr->vRefNum; - } else { - cur = 0; - } - } - - isDirectory = 1; - while (cur < length) { - if (!isDirectory) { - return dirNFErr; - } - pos = cur; - while (path[pos] != ':' && pos < length) { - pos++; - } - if (pos == cur) { - /* Move up one dir */ - /* cur++; */ - strcpy((char *) fileName + 1, "::"); - fileName[0] = 2; - } else if (pos - cur > 255) { - return bdNamErr; - } else { - strncpy((char *) fileName + 1, &path[cur], pos - cur); - fileName[0] = pos - cur; - } - err = FSMakeFSSpecCompat(vRefNum, dirID, fileName, fileSpecPtr); - if (err != noErr) return err; - err = ResolveAliasFile(fileSpecPtr, true, &isDirectory, &wasAlias); - if (err != noErr) return err; - FSpGetDirectoryID(fileSpecPtr, &dirID, &isDirectory); - vRefNum = fileSpecPtr->vRefNum; - cur = pos; - if (path[cur] == ':') { - cur++; - } - } - - return noErr; -} - -/* - *---------------------------------------------------------------------- - * - * FSpPathFromLocation -- - * - * This function obtains a full path name for a given macintosh - * FSSpec. Unlike the More Files function FSpGetFullPath, this - * function will return a C string in the Handle. It also will - * create paths for FSSpec that do not yet exist. - * - * Results: - * OSErr code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -OSErr -FSpPathFromLocation( - FSSpec *spec, /* The location we want a path for. */ - int *length, /* Length of the resulting path. */ - Handle *fullPath) /* Handle to path. */ -{ - OSErr err; - FSSpec tempSpec; - CInfoPBRec pb; - - *fullPath = NULL; - - /* - * Make a copy of the input FSSpec that can be modified. - */ - BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); - - if (tempSpec.parID == fsRtParID) { - /* - * The object is a volume. Add a colon to make it a full - * pathname. Allocate a handle for it and we are done. - */ - tempSpec.name[0] += 2; - tempSpec.name[tempSpec.name[0] - 1] = ':'; - tempSpec.name[tempSpec.name[0]] = '\0'; - - err = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - } else { - /* - * The object isn't a volume. Is the object a file or a directory? - */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrDirID = tempSpec.parID; - pb.dirInfo.ioFDirIndex = 0; - err = PBGetCatInfoSync(&pb); - - if ((err == noErr) || (err == fnfErr)) { - /* - * If the file doesn't currently exist we start over. If the - * directory exists everything will work just fine. Otherwise we - * will just fail later. If the object is a directory, append a - * colon so full pathname ends with colon. - */ - if (err == fnfErr) { - BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); - } else if ( (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) { - tempSpec.name[0] += 1; - tempSpec.name[tempSpec.name[0]] = ':'; - } - - /* - * Create a new Handle for the object - make it a C string. - */ - tempSpec.name[0] += 1; - tempSpec.name[tempSpec.name[0]] = '\0'; - err = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - if (err == noErr) { - /* - * Get the ancestor directory names - loop until we have an - * error or find the root directory. - */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrParID = tempSpec.parID; - do { - pb.dirInfo.ioFDirIndex = -1; - pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID; - err = PBGetCatInfoSync(&pb); - if (err == noErr) { - /* - * Append colon to directory name and add - * directory name to beginning of fullPath. - */ - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - - (void) Munger(*fullPath, 0, NULL, 0, &tempSpec.name[1], - tempSpec.name[0]); - err = MemError(); - } - } while ( (err == noErr) && - (pb.dirInfo.ioDrDirID != fsRtDirID) ); - } - } - } - - /* - * On error Dispose the handle, set it to NULL & return the err. - * Otherwise, set the length & return. - */ - if (err == noErr) { - *length = GetHandleSize(*fullPath) - 1; - } else { - if ( *fullPath != NULL ) { - DisposeHandle(*fullPath); - } - *fullPath = NULL; - *length = 0; - } - - return err; -} - -/* - *---------------------------------------------------------------------- - * - * GetGlobalMouse -- - * - * This procedure obtains the current mouse position in global - * coordinates. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -GetGlobalMouse( - Point *mouse) /* Mouse position. */ -{ - EventRecord event; - - OSEventAvail(0, &event); - *mouse = event.where; -} diff --git a/tests/README b/tests/README deleted file mode 100644 index fe4bb30..0000000 --- a/tests/README +++ /dev/null @@ -1,423 +0,0 @@ -README -- Tcl test suite design document. - -RCS: @(#) $Id: README,v 1.3 1999/04/16 00:47:22 stanton Exp $ - -Contents: ---------- - - 1. Introduction - 2. Definitions file - 3. Writing a new test - 4. Constraints - 5. Adding a New Test File - 6. Test output - 7. Selecting tests for execution within a file - 8. Selecting files to be sourced by all.tcl - 9. 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. - -You can run the tests in three ways: - - (a) type "make test" in ../unix; this will run all of the tests. - - (b) type "tcltest ?