From f18aaf8da0756674f04a7f77f2bf8e87d82eac19 Mon Sep 17 00:00:00 2001 From: welch Date: Mon, 13 Jul 1998 13:43:24 +0000 Subject: Merged changes between child workspace "/home/welch/ws/tcl8.0.3i" and parent workspace "/home/welch/ws/tcl8.0.3". --- generic/tclInt.h | 72 +++++++++++++++++++++++++++++++++++++++++++++++++- unix/Makefile.in | 80 +++++++++++++++++++++++++++++++------------------------- 2 files changed, 115 insertions(+), 37 deletions(-) diff --git a/generic/tclInt.h b/generic/tclInt.h index c951567..006f895 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: %Z% $Id: tclInt.h,v 1.8 1998/07/09 13:41:38 suresh Exp $ + * SCCS: %Z% $Id: tclInt.h,v 1.9 1998/07/13 13:43:24 welch Exp $ */ #ifndef _TCLINT @@ -129,6 +129,31 @@ typedef struct Namespace { * 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; /* @@ -455,6 +480,13 @@ typedef struct CompiledLocal { 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 @@ -791,6 +823,38 @@ typedef struct 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 @@ -935,6 +999,12 @@ typedef struct Interp { * 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_AddInterpResolver 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 diff --git a/unix/Makefile.in b/unix/Makefile.in index 0365ebb..180ce03 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -229,7 +229,8 @@ GENERIC_OBJS = panic.o regexp.o tclAsync.o tclBasic.o tclBinary.o tclCkalloc.o \ tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o tclIOSock.o \ tclIOUtil.o tclLink.o tclListObj.o tclLoad.o tclMain.o tclNamesp.o \ tclNotify.o tclObj.o tclParse.o tclPipe.o tclPkg.o tclPosixStr.o \ - tclPreserve.o tclProc.o tclStringObj.o tclTimer.o tclUtil.o tclVar.o + tclPreserve.o tclProc.o tclStringObj.o tclTimer.o tclUtil.o tclVar.o \ + tclResolve.o OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${NOTIFY_OBJS} ${COMPAT_OBJS} @DL_OBJS@ @@ -280,6 +281,7 @@ GENERIC_SRCS = \ $(GENERIC_DIR)/tclPosixStr.c \ $(GENERIC_DIR)/tclPreserve.c \ $(GENERIC_DIR)/tclProc.c \ + $(GENERIC_DIR)/tclResolve.c \ $(GENERIC_DIR)/tclStringObj.c \ $(GENERIC_DIR)/tclTest.c \ $(GENERIC_DIR)/tclTestObj.c \ @@ -525,7 +527,7 @@ clean: distclean: clean rm -rf Makefile config.status config.cache config.log tclConfig.sh \ - SUNWtcl.* prototype + $(PACKAGE).* prototype if test -f dltest/Makefile; then cd dltest; $(MAKE) distclean; fi depend: @@ -716,6 +718,9 @@ tclPreserve.o: $(GENERIC_DIR)/tclPreserve.c tclProc.o: $(GENERIC_DIR)/tclProc.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclProc.c +tclResolve.o: $(GENERIC_DIR)/tclResolve.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclResolve.c + tclStringObj.o: $(GENERIC_DIR)/tclStringObj.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStringObj.c @@ -822,9 +827,10 @@ checkexports: $(TCL_LIB_FILE) # to put the distribution. # +DISTROOT = /tmp/dist DISTNAME = tcl@TCL_VERSION@@TCL_PATCH_LEVEL@ ZIPNAME = tcl@TCL_MAJOR_VERSION@@TCL_MINOR_VERSION@@TCL_PATCH_LEVEL@.zip -DISTDIR = /proj/tcl/dist/$(DISTNAME) +DISTDIR = $(DISTROOT)/$(DISTNAME) $(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in autoconf $(UNIX_DIR)/configure.in > $(UNIX_DIR)/configure dist: $(UNIX_DIR)/configure @@ -850,7 +856,7 @@ dist: $(UNIX_DIR)/configure cp -p $(GENERIC_DIR)/*.c $(GENERIC_DIR)/*.h $(DISTDIR)/generic cp -p $(GENERIC_DIR)/README $(DISTDIR)/generic cp -p $(GENERIC_DIR)/tclGetDate.y $(DISTDIR)/generic - cp -p $(TOP_DIR)/changes $(TOP_DIR)/README $(TOP_DIR)/license.terms \ + cp -p $(TOP_DIR)/changes $(TOP_DIR)/README* $(TOP_DIR)/license.terms \ $(DISTDIR) mkdir $(DISTDIR)/library cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/library/*.tcl \ @@ -904,10 +910,10 @@ dist: $(UNIX_DIR)/configure # alldist: dist - rm -f /proj/tcl/dist/$(DISTNAME).tar.Z \ - /proj/tcl/dist/$(DISTNAME).tar.gz \ - /proj/tcl/dist/$(ZIPNAME) - cd /proj/tcl/dist; tar cf $(DISTNAME).tar $(DISTNAME); \ + rm -f $(DISTROOT)/$(DISTNAME).tar.Z \ + $(DISTROOT)/$(DISTNAME).tar.gz \ + $(DISTROOT)/$(ZIPNAME) + cd $(DISTROOT); tar cf $(DISTNAME).tar $(DISTNAME); \ gzip -9 -c $(DISTNAME).tar > $(DISTNAME).tar.gz; \ compress $(DISTNAME).tar; zip -r8 $(ZIPNAME) $(DISTNAME) @@ -920,16 +926,16 @@ alldist: dist # allpatch: dist - rm -f /proj/tcl/dist/$(DISTNAME).tar.Z \ - /proj/tcl/dist/$(DISTNAME).tar.gz \ - /proj/tcl/dist/$(ZIPNAME) - mv /proj/tcl/dist/tcl${VERSION} /proj/tcl/dist/old - mv /proj/tcl/dist/$(DISTNAME) /proj/tcl/dist/tcl${VERSION} - cd /proj/tcl/dist; tar cf $(DISTNAME).tar tcl${VERSION}; \ + rm -f $(DISTROOT)/$(DISTNAME).tar.Z \ + $(DISTROOT)/$(DISTNAME).tar.gz \ + $(DISTROOT)/$(ZIPNAME) + mv $(DISTROOT)/tcl${VERSION} $(DISTROOT)/old + mv $(DISTROOT)/$(DISTNAME) $(DISTROOT)/tcl${VERSION} + cd $(DISTROOT); tar cf $(DISTNAME).tar tcl${VERSION}; \ gzip -9 -c $(DISTNAME).tar > $(DISTNAME).tar.gz; \ compress $(DISTNAME).tar; zip -r8 $(ZIPNAME) tcl${VERSION} - mv /proj/tcl/dist/tcl${VERSION} /proj/tcl/dist/$(DISTNAME) - mv /proj/tcl/dist/old /proj/tcl/dist/tcl${VERSION} + mv $(DISTROOT)/tcl${VERSION} $(DISTROOT)/$(DISTNAME) + mv $(DISTROOT)/old $(DISTROOT)/tcl${VERSION} # # Target to create a Macintosh version of the distribution. This will @@ -960,13 +966,15 @@ macdist: dist # make DISTDIR= package-quick # # is the absolute path to a directory where the build should -# take place. These steps will generate the SUNWtcl.sun4 and -# SUNWtcl.i86pc stream packages. It is important that the packages be +# take place. These steps will generate the $(PACKAGE).sun4 and +# $(PACKAGE).i86pc stream packages. It is important that the packages be # built in this fashion in order to ensure that the architecture # independent files are exactly the same, including timestamps, in # both packages. # +PACKAGE=SCRPtcl + package: dist package-config package-common package-binaries package-generate package-quick: package-config package-binaries package-generate @@ -976,11 +984,11 @@ package-quick: package-config package-binaries package-generate package-config: mkdir -p $(DISTDIR)/unix/`arch` cd $(DISTDIR)/unix/`arch`; \ - ../configure --prefix=/opt/SUNWtcl/$(VERSION) \ - --exec_prefix=/opt/SUNWtcl/$(VERSION)/`arch` \ + ../configure --prefix=/opt/$(PACKAGE)/$(VERSION) \ + --exec_prefix=/opt/$(PACKAGE)/$(VERSION)/`arch` \ --enable-shared - mkdir -p $(DISTDIR)/SUNWtcl/$(VERSION) - mkdir -p $(DISTDIR)/SUNWtcl/$(VERSION)/`arch` + mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION) + mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch` # # Build and install the architecture independent files in the dist directory. @@ -989,13 +997,13 @@ package-config: package-common: cd $(DISTDIR)/unix/`arch`;\ $(MAKE); \ - $(MAKE) prefix=$(DISTDIR)/SUNWtcl/$(VERSION) \ - exec_prefix=$(DISTDIR)/SUNWtcl/$(VERSION)/`arch` \ + $(MAKE) prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION) \ + exec_prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch` \ install-libraries install-man - mkdir -p $(DISTDIR)/SUNWtcl/$(VERSION)/bin + mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin sed -e "s/TCLVERSION/$(VERSION)/g" < $(UNIX_DIR)/tclsh.sh \ - > $(DISTDIR)/SUNWtcl/$(VERSION)/bin/tclsh$(VERSION) - chmod 755 $(DISTDIR)/SUNWtcl/$(VERSION)/bin/tclsh$(VERSION) + > $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin/tclsh$(VERSION) + chmod 755 $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin/tclsh$(VERSION) # # Build and install the architecture specific files in the dist directory. @@ -1004,8 +1012,8 @@ package-common: package-binaries: cd $(DISTDIR)/unix/`arch`; \ $(MAKE); \ - $(MAKE) install-binaries prefix=$(DISTDIR)/SUNWtcl/$(VERSION) \ - exec_prefix=$(DISTDIR)/SUNWtcl/$(VERSION)/`arch` + $(MAKE) install-binaries prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION) \ + exec_prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch` # # Generate a package from the installed files in the dist directory for the @@ -1013,15 +1021,15 @@ package-binaries: # package-generate: - pkgproto $(DISTDIR)/SUNWtcl/$(VERSION)/bin=bin \ - $(DISTDIR)/SUNWtcl/$(VERSION)/include=include \ - $(DISTDIR)/SUNWtcl/$(VERSION)/lib=lib \ - $(DISTDIR)/SUNWtcl/$(VERSION)/man=man \ - $(DISTDIR)/SUNWtcl/$(VERSION)/`arch`=`arch` \ + pkgproto $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin=bin \ + $(DISTDIR)/$(PACKAGE)/$(VERSION)/include=include \ + $(DISTDIR)/$(PACKAGE)/$(VERSION)/lib=lib \ + $(DISTDIR)/$(PACKAGE)/$(VERSION)/man=man \ + $(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch`=`arch` \ | tclsh $(UNIX_DIR)/mkProto.tcl \ $(VERSION) $(UNIX_DIR) > prototype pkgmk -o -d . -f prototype -a `arch` - pkgtrans -s . SUNWtcl.`arch` SUNWtcl - rm -rf SUNWtcl + pkgtrans -s . $(PACKAGE).`arch` $(PACKAGE) + rm -rf $(PACKAGE) # DO NOT DELETE THIS LINE -- make depend depends on it. -- cgit v0.12