diff options
author | dgp <dgp@users.sourceforge.net> | 2002-01-25 22:01:31 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2002-01-25 22:01:31 (GMT) |
commit | fc040221576dad87475a85d33aba99c043e39c36 (patch) | |
tree | 32c26ed603d296c79d882b996758ea3cdd0caacb | |
parent | fd92b8826ad83d09e08d67e70a6deae1deb9a06f (diff) | |
download | tcl-fc040221576dad87475a85d33aba99c043e39c36.zip tcl-fc040221576dad87475a85d33aba99c043e39c36.tar.gz tcl-fc040221576dad87475a85d33aba99c043e39c36.tar.bz2 |
* [Patch 501006] Updated APIs in generic/tclResolve.c
and generic/tclNamesp.c according to the guidelines of TIP 27.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | generic/tclInt.decls | 18 | ||||
-rw-r--r-- | generic/tclIntDecls.h | 32 | ||||
-rw-r--r-- | generic/tclNamesp.c | 10 | ||||
-rw-r--r-- | generic/tclResolve.c | 14 |
5 files changed, 48 insertions, 37 deletions
@@ -1,5 +1,16 @@ 2002-01-25 Don Porter <dgp@users.sourceforge.net> + * Following is [Patch 501006] + * generic/tclInt.decls (Tcl_AddInterpResolvers, Tcl_Export, + Tcl_FindNamespace, Tcl_GetInterpResolvers, Tcl_ForgetImport, + Tcl_Import, Tcl_RemoveInterpResolvers): + * generic/tclNamesp.c (Tcl_Export, Tcl_Import, Tcl_ForgetImport, + Tcl_FindNamespace): + * generic/tclResolve.c (Tcl_AddInterpResolvers,Tcl_GetInterpResolvers, + Tcl_RemoveInterpResolvers): Updated APIs in generic/tclResolve.c + and generic/tclNamesp.c according to the guidelines of TIP 27. + * generic/tclIntDecls.h: make genstubs + * Following is [Patch 505630] * doc/AddErrorInfo.3: * generic/tcl.decls (Tcl_LogCommandInfo): diff --git a/generic/tclInt.decls b/generic/tclInt.decls index e8613f2..008b1d3 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -12,7 +12,7 @@ # 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.43 2002/01/25 20:40:55 dgp Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.44 2002/01/25 22:01:31 dgp Exp $ library tcl @@ -431,7 +431,7 @@ declare 109 generic { # defined here instead of in tcl.decls since they are not stable yet. declare 111 generic { - void Tcl_AddInterpResolvers(Tcl_Interp *interp, char *name, \ + void Tcl_AddInterpResolvers(Tcl_Interp *interp, CONST char *name, \ Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, \ Tcl_ResolveCompiledVarProc *compiledVarProc) } @@ -447,19 +447,19 @@ 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) + int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \ + CONST char *pattern, int resetListFirst) } declare 116 generic { Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, CONST char *name, \ Tcl_Namespace *contextNsPtr, int flags) } declare 117 generic { - Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, char *name, \ + Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, CONST char *name, \ Tcl_Namespace *contextNsPtr, int flags) } declare 118 generic { - int Tcl_GetInterpResolvers(Tcl_Interp *interp, char *name, \ + int Tcl_GetInterpResolvers(Tcl_Interp *interp, CONST char *name, \ Tcl_ResolverInfo *resInfo) } declare 119 generic { @@ -472,7 +472,7 @@ declare 120 generic { } declare 121 generic { int Tcl_ForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \ - char *pattern) + CONST char *pattern) } declare 122 generic { Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr) @@ -493,7 +493,7 @@ declare 126 generic { } declare 127 generic { int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \ - char *pattern, int allowOverwrite) + CONST char *pattern, int allowOverwrite) } declare 128 generic { void Tcl_PopCallFrame(Tcl_Interp* interp) @@ -503,7 +503,7 @@ declare 129 generic { Tcl_Namespace *nsPtr, int isProcCallFrame) } declare 130 generic { - int Tcl_RemoveInterpResolvers(Tcl_Interp *interp, char *name) + int Tcl_RemoveInterpResolvers(Tcl_Interp *interp, CONST char *name) } declare 131 generic { void Tcl_SetNamespaceResolvers(Tcl_Namespace *namespacePtr, \ diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 3cf96e5..0b39602 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -11,7 +11,7 @@ * 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.36 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.37 2002/01/25 22:01:31 dgp Exp $ */ #ifndef _TCLINTDECLS @@ -336,7 +336,7 @@ EXTERN int TclUpdateReturnInfo _ANSI_ARGS_((Interp * iPtr)); /* Slot 110 is reserved */ /* 111 */ EXTERN void Tcl_AddInterpResolvers _ANSI_ARGS_(( - Tcl_Interp * interp, char * name, + Tcl_Interp * interp, CONST char * name, Tcl_ResolveCmdProc * cmdProc, Tcl_ResolveVarProc * varProc, Tcl_ResolveCompiledVarProc * compiledVarProc)); @@ -353,7 +353,7 @@ EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_(( Tcl_Namespace * nsPtr)); /* 115 */ EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Namespace * nsPtr, char * pattern, + Tcl_Namespace * nsPtr, CONST char * pattern, int resetListFirst)); /* 116 */ EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp * interp, @@ -361,11 +361,11 @@ EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Namespace * contextNsPtr, int flags)); /* 117 */ EXTERN Tcl_Namespace * Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp * interp, - char * name, Tcl_Namespace * contextNsPtr, - int flags)); + CONST char * name, + Tcl_Namespace * contextNsPtr, int flags)); /* 118 */ EXTERN int Tcl_GetInterpResolvers _ANSI_ARGS_(( - Tcl_Interp * interp, char * name, + Tcl_Interp * interp, CONST char * name, Tcl_ResolverInfo * resInfo)); /* 119 */ EXTERN int Tcl_GetNamespaceResolvers _ANSI_ARGS_(( @@ -377,7 +377,7 @@ EXTERN Tcl_Var Tcl_FindNamespaceVar _ANSI_ARGS_(( Tcl_Namespace * contextNsPtr, int flags)); /* 121 */ EXTERN int Tcl_ForgetImport _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Namespace * nsPtr, char * pattern)); + Tcl_Namespace * nsPtr, CONST char * pattern)); /* 122 */ EXTERN Tcl_Command Tcl_GetCommandFromObj _ANSI_ARGS_(( Tcl_Interp * interp, Tcl_Obj * objPtr)); @@ -397,7 +397,7 @@ EXTERN void Tcl_GetVariableFullName _ANSI_ARGS_(( Tcl_Obj * objPtr)); /* 127 */ EXTERN int Tcl_Import _ANSI_ARGS_((Tcl_Interp * interp, - Tcl_Namespace * nsPtr, char * pattern, + Tcl_Namespace * nsPtr, CONST char * pattern, int allowOverwrite)); /* 128 */ EXTERN void Tcl_PopCallFrame _ANSI_ARGS_((Tcl_Interp* interp)); @@ -407,7 +407,7 @@ EXTERN int Tcl_PushCallFrame _ANSI_ARGS_((Tcl_Interp* interp, Tcl_Namespace * nsPtr, int isProcCallFrame)); /* 130 */ EXTERN int Tcl_RemoveInterpResolvers _ANSI_ARGS_(( - Tcl_Interp * interp, char * name)); + Tcl_Interp * interp, CONST char * name)); /* 131 */ EXTERN void Tcl_SetNamespaceResolvers _ANSI_ARGS_(( Tcl_Namespace * namespacePtr, @@ -650,26 +650,26 @@ typedef struct TclIntStubs { 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 */ + void (*tcl_AddInterpResolvers) _ANSI_ARGS_((Tcl_Interp * interp, CONST 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, CONST 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 */ + int (*tcl_Export) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Namespace * nsPtr, CONST char * pattern, int resetListFirst)); /* 115 */ Tcl_Command (*tcl_FindCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST 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 */ + Tcl_Namespace * (*tcl_FindNamespace) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_Namespace * contextNsPtr, int flags)); /* 117 */ + int (*tcl_GetInterpResolvers) _ANSI_ARGS_((Tcl_Interp * interp, CONST 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 */ + int (*tcl_ForgetImport) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Namespace * nsPtr, CONST 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 */ + int (*tcl_Import) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Namespace * nsPtr, CONST 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 */ + int (*tcl_RemoveInterpResolvers) _ANSI_ARGS_((Tcl_Interp * interp, CONST 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 */ diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 56dac90..3e4d889 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -19,7 +19,7 @@ * 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.27 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.28 2002/01/25 22:01:32 dgp Exp $ */ #include "tclInt.h" @@ -902,7 +902,7 @@ Tcl_Export(interp, namespacePtr, pattern, resetListFirst) 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 + CONST 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 @@ -1103,7 +1103,7 @@ Tcl_Import(interp, namespacePtr, pattern, allowOverwrite) 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 + CONST 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). */ @@ -1338,7 +1338,7 @@ Tcl_ForgetImport(interp, namespacePtr, pattern) 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 + CONST 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 @@ -1881,7 +1881,7 @@ 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 "::", + CONST 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 diff --git a/generic/tclResolve.c b/generic/tclResolve.c index 0a5b7c1..4386c3d 100644 --- a/generic/tclResolve.c +++ b/generic/tclResolve.c @@ -12,7 +12,7 @@ * 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 $ + * RCS: @(#) $Id: tclResolve.c,v 1.4 2002/01/25 22:01:32 dgp Exp $ */ #include "tclInt.h" @@ -63,7 +63,7 @@ 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. */ + CONST char *name; /* Name of this resolution scheme. */ Tcl_ResolveCmdProc *cmdProc; /* New procedure for command * resolution */ Tcl_ResolveVarProc *varProc; /* Procedure for variable resolution @@ -142,7 +142,7 @@ 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. */ + CONST char *name; /* Look for a scheme with this name. */ Tcl_ResolverInfo *resInfoPtr; /* Returns pointers to the procedures, * if found */ { @@ -194,7 +194,7 @@ Tcl_RemoveInterpResolvers(interp, name) Tcl_Interp *interp; /* Interpreter whose name resolution * rules are being modified. */ - char *name; /* Name of the scheme to be removed. */ + CONST char *name; /* Name of the scheme to be removed. */ { Interp *iPtr = (Interp*)interp; ResolverScheme **prevPtrPtr, *resPtr; @@ -291,7 +291,7 @@ BumpCmdRefEpochs(nsPtr) * type: * * typedef int (Tcl_ResolveCmdProc) _ANSI_ARGS_(( - * Tcl_Interp* interp, char* name, Tcl_Namespace *context, + * Tcl_Interp* interp, CONST char* name, Tcl_Namespace *context, * int flags, Tcl_Command *rPtr)); * * Whenever a command is executed or Tcl_FindCommand is invoked @@ -308,7 +308,7 @@ BumpCmdRefEpochs(nsPtr) * time: * * typedef int (Tcl_ResolveCompiledVarProc) _ANSI_ARGS_(( - * Tcl_Interp* interp, char* name, Tcl_Namespace *context, + * Tcl_Interp* interp, CONST char* name, Tcl_Namespace *context, * Tcl_ResolvedVarInfo *rPtr)); * * If this procedure is able to resolve the name, it should return @@ -325,7 +325,7 @@ BumpCmdRefEpochs(nsPtr) * Tcl_FindNamespaceVar.) This procedure has the following type: * * typedef int (Tcl_ResolveVarProc) _ANSI_ARGS_(( - * Tcl_Interp* interp, char* name, Tcl_Namespace *context, + * Tcl_Interp* interp, CONST char* name, Tcl_Namespace *context, * int flags, Tcl_Var *rPtr)); * * This procedure is quite similar to the compile-time version. |