summaryrefslogtreecommitdiffstats
path: root/doc/StringObj.3
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-18 23:34:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-18 23:34:07 (GMT)
commit984fc40963c8de57bef4a2d8d4317b692df59067 (patch)
tree63718e2958235b2a74fd353ca5b6ee5d5c2a142a /doc/StringObj.3
parentfe2b8e7edafb72ea246c46d10a3f154ae89b69ee (diff)
parentd0b286927306af8bde7031529ad180eaa07dcc73 (diff)
downloadtcl-984fc40963c8de57bef4a2d8d4317b692df59067.zip
tcl-984fc40963c8de57bef4a2d8d4317b692df59067.tar.gz
tcl-984fc40963c8de57bef4a2d8d4317b692df59067.tar.bz2
Merge 8.7
Diffstat (limited to 'doc/StringObj.3')
-rw-r--r--doc/StringObj.318
1 files changed, 10 insertions, 8 deletions
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index 5eee429..156618b 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -87,31 +87,33 @@ Tcl_Obj *
Points to the first byte of an array of UTF-8-encoded bytes
used to set or append to a string value.
This byte array may contain embedded null characters
-unless \fInumChars\fR is TCL_INDEX_NONE. (Applications needing null bytes
+unless \fInumChars\fR is \fBTCL_INDEX_NONE\fR. (Applications needing null bytes
should represent them as the two-byte sequence \fI\e300\e200\fR, use
\fBTcl_ExternalToUtf\fR to convert, or \fBTcl_NewByteArrayObj\fR if
the string is a collection of uninterpreted bytes.)
.AP size_t length in
The number of bytes to copy from \fIbytes\fR when
initializing, setting, or appending to a string value.
-If TCL_INDEX_NONE, all bytes up to the first null are used.
+If \fBTCL_INDEX_NONE\fR, all bytes up to the first null are used.
.AP "const Tcl_UniChar" *unicode in
Points to the first byte of an array of Unicode characters
used to set or append to a string value.
This byte array may contain embedded null characters
-unless \fInumChars\fR is negative.
+unless \fInumChars\fR is \fBTCL_INDEX_NONE\fR.
.AP size_t numChars in
The number of Unicode characters to copy from \fIunicode\fR when
initializing, setting, or appending to a string value.
-If TCL_INDEX_NONE, all characters up to the first null character are used.
+If \fBTCL_INDEX_NONE\fR, all characters up to the first null character are used.
.AP size_t index in
The index of the Unicode character to return.
.AP size_t first in
The index of the first Unicode character in the Unicode range to be
-returned as a new value.
+returned as a new value. If \fBTCL_INDEX_NONE\fR, behave the same as if the
+value was 0.
.AP size_t last in
The index of the last Unicode character in the Unicode range to be
-returned as a new value.
+returned as a new value. If \fBTCL_INDEX_NONE\fR, take all characters up to
+the last one available.
.AP Tcl_Obj *objPtr in/out
Points to a value to manipulate.
.AP Tcl_Obj *appendObjPtr in
@@ -256,7 +258,7 @@ all \fIlength\fR bytes that are available from being appended, then the
appending is done so that the last bytes appended are from the
string \fIellipsis\fR. This allows for an indication of the truncation
to be left in the string.
-When \fIlength\fR is \fB-1\fR, all bytes up to the first zero byte are appended,
+When \fIlength\fR is \fBTCL_INDEX_NONE\fR, all bytes up to the first zero byte are appended,
subject to the limit. When \fIellipsis\fR is NULL, the default
string \fB...\fR is used. When \fIellipsis\fR is non-NULL, it must point
to a zero-byte-terminated string in Tcl's internal UTF encoding.
@@ -299,7 +301,7 @@ functionality is needed.
.CS
char buf[SOME_SUITABLE_LENGTH];
sprintf(buf, format, ...);
-\fBTcl_NewStringObj\fR(buf, -1);
+\fBTcl_NewStringObj\fR(buf, \fBTCL_INDEX_NONE\fR);
.CE
.PP
but with greater convenience and no need to