diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-06-29 08:49:46 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-06-29 08:49:46 (GMT) |
commit | 9a554c2e3729fc93bfa5b18c83860db4943f20dc (patch) | |
tree | 9e7f0fae370f25e98884efb0c5370b460a410bec | |
parent | 3ddcfe976b2d00fb28ad55af607078ac9f008ca5 (diff) | |
parent | 18e116ab4e97129f7b4d4e36792035acf039a3ff (diff) | |
download | tcl-9a554c2e3729fc93bfa5b18c83860db4943f20dc.zip tcl-9a554c2e3729fc93bfa5b18c83860db4943f20dc.tar.gz tcl-9a554c2e3729fc93bfa5b18c83860db4943f20dc.tar.bz2 |
Reinforced the description of the requirement for the tables of names for Tcl_GetIndexFromObj to index over to be static, following posting to tcl-core by Brian Griffin about a bug caused by not obeying this rule correctly.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | doc/GetIndex.3 | 10 |
2 files changed, 17 insertions, 3 deletions
@@ -1,3 +1,11 @@ +2012-06-29 Donal K. Fellows <dkf@users.sf.net> + + * doc/GetIndex.3: Reinforced the description of the requirement for + the tables of names to index over to be static, following posting to + tcl-core by Brian Griffin about a bug caused by Tktreectrl not obeying + this rule correctly. This does not represent a functionality change, + merely a clearer documentation of a long-standing constraint. + 2012-06-26 Jan Nijtmans <nijtmans@users.sf.net> * unix/tcl.m4: Let Cygwin shared build link with @@ -9,7 +17,7 @@ * generic/tclIOSock.c: Use EAI_SYSTEM only if it exists. * unix/tclUnixSock.c: - + 2012-06-25 Don Porter <dgp@users.sourceforge.net> * generic/tclFileSystem.h: [Bug 3024359] Make sure that the diff --git a/doc/GetIndex.3 b/doc/GetIndex.3 index f60feb5..50607ae 100644 --- a/doc/GetIndex.3 +++ b/doc/GetIndex.3 @@ -32,10 +32,16 @@ table entry. .AP "const char *const" *tablePtr in An array of null-terminated strings. The end of the array is marked by a NULL string pointer. +Note that references to the \fItablePtr\fR may be retained in the +internal representation of \fIobjPtr\fR, so this should represent the +address of a statically-allocated array. .AP "const void" *structTablePtr in An array of arbitrary type, typically some \fBstruct\fR type. The first member of the structure must be a null-terminated string. The size of the structure is given by \fIoffset\fR. +Note that references to the \fIstructTablePtr\fR may be retained in the +internal representation of \fIobjPtr\fR, so this should represent the +address of a statically-allocated array of structures. .AP int offset in The offset to add to structTablePtr to get to the next entry. The end of the array is marked by a NULL string pointer. @@ -51,10 +57,10 @@ The index of the string in \fItablePtr\fR that matches the value of .BE .SH DESCRIPTION .PP -This procedure provides an efficient way for looking up keywords, +These procedures provide 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 +\fBTcl_GetIndexFromObj\fR compares \fIobjPtr\fR 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 non-empty unique abbreviation |