summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2022-10-09 18:11:44 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2022-10-09 18:11:44 (GMT)
commit6def8b0f5838db2823d34a3210e018e1a59faee7 (patch)
treeca35065b368092b5e5fb50a9a13ec59a864a7c31 /generic/tclEncoding.c
parentbff6ed619c256ef90256f67fc53f7b566b58c368 (diff)
downloadtcl-6def8b0f5838db2823d34a3210e018e1a59faee7.zip
tcl-6def8b0f5838db2823d34a3210e018e1a59faee7.tar.gz
tcl-6def8b0f5838db2823d34a3210e018e1a59faee7.tar.bz2
TIP 643 code. Docs, tests pending
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 52b02fc..efe4b43 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -983,6 +983,33 @@ Tcl_GetEncodingNames(
}
/*
+ *-------------------------------------------------------------------------
+ *
+ * Tcl_GetEncodingNulLength --
+ *
+ * Given an encoding, return the number of nul bytes used for the
+ * string termination.
+ *
+ * Results:
+ * The name of the encoding.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+int
+Tcl_GetEncodingNulLength(
+ Tcl_Encoding encoding)
+{
+ if (encoding == NULL) {
+ encoding = systemEncoding;
+ }
+
+ return ((Encoding *) encoding)->nullSize;
+}
+
+/*
*------------------------------------------------------------------------
*
* Tcl_SetSystemEncoding --