Skip to content

Commit 7d11003

Browse files
author
jan.nijtmans
committed
Deprecate Tcl_GetAlias()
2 parents 06b2415 + c6dcb38 commit 7d11003

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

doc/CrtAlias.3

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,17 @@ restrictions on how they are related.
168168
that it takes a vector of values to pass as additional arguments instead
169169
of a vector of strings.
170170
.PP
171-
\fBTcl_GetAlias\fR returns information about an alias \fIaliasName\fR
171+
\fBTcl_GetAliasObj\fR returns information in the form of a pointer to
172+
a vector of Tcl_Obj structures about an alias \fIaliasName\fR
172173
in \fIinterp\fR. Any of the result fields can be \fBNULL\fR, in
173174
which case the corresponding datum is not returned. If a result field is
174175
non\-\fBNULL\fR, the address indicated is set to the corresponding datum.
175176
For example, if \fItargetNamePtr\fR is non\-\fBNULL\fR it is set to a
176177
pointer to the string containing the name of the target command.
177178
.PP
178-
\fBTcl_GetAliasObj\fR is similar to \fBTcl_GetAlias\fR except that it
179-
returns a pointer to a vector of Tcl_Obj structures instead of a vector of
180-
strings.
179+
\fBTcl_GetAlias\fR is similar to \fBTcl_GetAliasObj\fR except that it
180+
returns a pointer to a vector of string instead of a vector of
181+
Tcl_Obj structures. \fBTcl_GetAlias\fR is deprecated.
181182
.PP
182183
\fBTcl_ExposeCommand\fR moves the command named \fIhiddenCmdName\fR from
183184
the set of hidden commands to the set of exposed commands, putting

generic/tcl.decls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ declare 145 {
470470
declare 146 {
471471
int Tcl_Flush(Tcl_Channel chan)
472472
}
473-
declare 148 {
473+
declare 148 {deprecated {Use Tcl_GetAliasObj}} {
474474
int Tcl_GetAlias(Tcl_Interp *interp, const char *childCmd,
475475
Tcl_Interp **targetInterpPtr, const char **targetCmdPtr,
476476
int *argcPtr, const char ***argvPtr)

generic/tclDecls.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ EXTERN Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr,
428428
EXTERN int Tcl_Flush(Tcl_Channel chan);
429429
/* Slot 147 is reserved */
430430
/* 148 */
431-
EXTERN int Tcl_GetAlias(Tcl_Interp *interp,
431+
TCL_DEPRECATED("Use Tcl_GetAliasObj")
432+
int Tcl_GetAlias(Tcl_Interp *interp,
432433
const char *childCmd,
433434
Tcl_Interp **targetInterpPtr,
434435
const char **targetCmdPtr, int *argcPtr,
@@ -2027,7 +2028,7 @@ typedef struct TclStubs {
20272028
Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
20282029
int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
20292030
void (*reserved147)(void);
2030-
int (*tcl_GetAlias) (Tcl_Interp *interp, const char *childCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
2031+
TCL_DEPRECATED_API("Use Tcl_GetAliasObj") int (*tcl_GetAlias) (Tcl_Interp *interp, const char *childCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
20312032
int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *childCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
20322033
void * (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */
20332034
Tcl_Channel (*tcl_GetChannel) (Tcl_Interp *interp, const char *chanName, int *modePtr); /* 151 */

generic/tclInterp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ Tcl_CreateAliasObj(
12881288
*
12891289
*----------------------------------------------------------------------
12901290
*/
1291-
1291+
#ifndef TCL_NO_DEPRECATED
12921292
int
12931293
Tcl_GetAlias(
12941294
Tcl_Interp *interp, /* Interp to start search from. */
@@ -1334,6 +1334,7 @@ Tcl_GetAlias(
13341334
}
13351335
return TCL_OK;
13361336
}
1337+
#endif /* TCL_NO_DEPRECATED */
13371338

13381339
/*
13391340
*----------------------------------------------------------------------

generic/tclStubInit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
# define TclGetStringFromObj 0
7575
# define TclGetBytesFromObj 0
7676
# define TclGetUnicodeFromObj 0
77+
# define Tcl_GetAlias 0
7778
#endif
7879
#undef Tcl_Close
7980
#define Tcl_Close 0

0 commit comments

Comments
 (0)