Skip to content
Tcl Source Code Artifact [15d2b67bd6]
Login

Artifact [15d2b67bd6]

Artifact 15d2b67bd6acfb6917f7c2117ab7c3ed0156b274:

Ticket change [15d2b67bd6] - New ticket [540378ffffffffff|540378ffff] <i>init stubs from PkgRequire, not interp</i>. by dgp on 2002-04-06 23:45:57.
D 2002-04-06T23:45:57
J assignee dgp
J cmimetype text/plain
J comment >From\s"Paul\sDuffin"\s<[email protected]>\n\n\nOne\sthing\sthat\syou\scan\sdo\sin\sthe\smeantime\sis\smake\sa\nslight\smodification\nto\sthe\sTcl_InitStubs\sfunction\sin\stclStubLib.c\swhich\nwill\sallow\syou\sa\nlot\sof\sflexibility\sin\show\syou\sdo\sthis.\n\nAs\syou\sknow\sTcl_InitStubs\sinitialises\sthe\sglobal\npointer\stclStubPtr\nso\sthat\sit\spoints\sto\sTcl's\sstub\stable.\sAt\sthe\smoment\sit\nuses\sthe\sstub\ntable\spointer\swhich\sis\sstored\sin\sthe\sInterp\sstructure,\nthis\sshould\sbe\nchanged\sto\suse\sthe\sstub\stable\spointer\swhich\sis\sreturned\nfrom\nTcl_PkgRequireEx\sinstead.\n\nThis\sminor\sand\stotally\scompatible\schange\sneeds\sto\sbe\ndone\simmediately\nas\sthe\sTcl_InitStubs\sfunction\sis\sembedded\sinside\nextensions\sso\nextensions\swill\sneed\sto\sbe\srebuilt\sfor\sthe\schange\sto\ntake\seffect.\n\nThe\sbenefit\sof\sdoing\sthis\sis\sthat\sit\swould\sbe\spossible\nto\shave\smultiple\nversions\sof\sthe\sTcl\sstub\stable\sin\suse\sat\sthe\ssame\stime,\nyou\scould\shave\nan\s8.1\sversion\s(because\s8.0\sdoes\snot\shave\sa\sstub\stable,\n:-(\s),\sa\s9.0\nversion\sand\sa\s10.0\sversion\sall\sat\sthe\ssame\stime.\n\nThe\sonly\srestriction\son\sthe\stable\sstructure\sis\sthat\nthose\sfunctions\nwhich\sare\sused\sby\sTcl_InitStubs\s(Tcl_PkgRequireEx)\sneed\nto\sbe\sin\sthe\nsame\splace\sin\sall\sthe\sstructures.\sYou\scan\stotally\nrestructure\sthe\nrest\sof\sthe\stable(s)\sto\ssuit\syour\sneeds.\sThe\sbackward\ncompatible\nstub\stables\scan\sbe\sprovided\sby\sdynamically\sloadable\nextensions.\n\nTo\senable\sthis\swould\sobviously\sneed\ssome\smodifications\nto\sthe\npackage\smechanism\sas\sit\sstands\sto\sallow\smultiple\nversions\sof\sa\npackage\sto\sbe\sloaded\sat\sone\stime,\sor\sat\sleast\sallow\ncompatability\nversions\sof\sa\spackage\sto\sbe\sloaded\sas\swell\sas\sthe\ncurrent\sversion.\nThese\sissues\scan\sbe\sresolved\sat\syour\sleisure\sbut\sthe\nchange\sto\nTcl_InitStubs\s(and\sall\sthe\sother\s_InitStubs\sfunctions)\nneeds\sto\nbe\sdone\snow,\sotherwise\syou\swill\snot\shave\sthe\schoice.\n\nInstead\sof\n\nchar\s*\nTcl_InitStubs\s(interp,\sversion,\sexact)\n\s\s\s\sTcl_Interp\s*interp;\n\s\s\s\schar\s*version;\n\s\s\s\sint\sexact;\n{\n\s\s\s\schar\s*actualVersion;\n\s\s\s\sTclStubs\s*tmp;\n\n\s\s\s\sif\s(!tclStubsPtr)\s{\ntclStubsPtr\s=\sHasStubSupport(interp);\nif\s(!tclStubsPtr)\s{\n\s\s\s\s\s\s\s\s\s\s\s\sreturn\sNULL;\n\s\s\s\s\s\s\s\s}\n\s\s\s\s}\n\n\s\s\s\sactualVersion\s=\sTcl_PkgRequireEx(interp,\s"Tcl",\nversion,\sexact,\n\s\s\s\s(ClientData\s*)\s&tmp);\n\s\s\s\sif\s(actualVersion\s==\sNULL)\s{\ntclStubsPtr\s=\sNULL;\nreturn\sNULL;\n\s\s\s\s}\n\n\s\s\s\sif\s(tclStubsPtr->hooks)\s{\ntclPlatStubsPtr\s=\stclStubsPtr->hooks->tclPlatStubs;\ntclIntStubsPtr\s=\stclStubsPtr->hooks->tclIntStubs;\ntclIntPlatStubsPtr\s=\stclStubsPtr->hooks->tclIntPlatStubs;\n\s\s\s\s}\selse\s{\ntclPlatStubsPtr\s=\sNULL;\ntclIntStubsPtr\s=\sNULL;\ntclIntPlatStubsPtr\s=\sNULL;\n\s\s\s\s}\n\n\s\s\s\sreturn\sactualVersion;\n}\n\nyou\sneed\n\nchar\s*\nTcl_InitStubs\s(interp,\sversion,\sexact)\n\s\s\s\sTcl_Interp\s*interp;\n\s\s\s\schar\s*version;\n\s\s\s\sint\sexact;\n{\n\s\s\s\schar\s*actualVersion;\n\n\s\s\s\sif\s(!tclStubsPtr)\s{\ntclStubsPtr\s=\sHasStubSupport(interp);\nif\s(!tclStubsPtr)\s{\n\s\s\s\s\s\s\s\s\s\s\s\sreturn\sNULL;\n\s\s\s\s\s\s\s\s}\n\s\s\s\s}\n\n\s\s\s\sactualVersion\s=\sTcl_PkgRequireEx(interp,\s"Tcl",\nversion,\sexact,\n\s\s\s\s(ClientData\s*)\s&tclStubsPtr);\n\s\s\s\sif\s(actualVersion\s==\sNULL)\s{\ntclStubsPtr\s=\sNULL;\nreturn\sNULL;\n\s\s\s\s}\n\n\s\s\s\sif\s(tclStubsPtr->hooks)\s{\ntclPlatStubsPtr\s=\stclStubsPtr->hooks->tclPlatStubs;\ntclIntStubsPtr\s=\stclStubsPtr->hooks->tclIntStubs;\ntclIntPlatStubsPtr\s=\stclStubsPtr->hooks->tclIntPlatStubs;\n\s\s\s\s}\selse\s{\ntclPlatStubsPtr\s=\sNULL;\ntclIntStubsPtr\s=\sNULL;\ntclIntPlatStubsPtr\s=\sNULL;\n\s\s\s\s}\n\n\s\s\s\sreturn\sactualVersion;\n}\n\n
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 39.\sPackage\sManager
J title init\sstubs\sfrom\sPkgRequire,\snot\sinterp
J type RFE
K 540378ffffffffffffffffffffffffffffffffff
U dgp
Z 424de7bf61237cc3b7d4dc4f45474bed