summaryrefslogtreecommitdiff
path: root/source/luametatex/source/tex/texstringpool.c
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-10-21 21:37:10 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-10-21 21:37:10 +0200
commit5d31142615a7efaf833be860e412995b42bf9c3c (patch)
treef2c6470f09089ef3005659783b834989ee7e1989 /source/luametatex/source/tex/texstringpool.c
parentc0c1dea1daf21f2c21f6d8094f54f67138998baf (diff)
downloadcontext-5d31142615a7efaf833be860e412995b42bf9c3c.tar.gz
2022-10-21 21:13:00
Diffstat (limited to 'source/luametatex/source/tex/texstringpool.c')
-rw-r--r--source/luametatex/source/tex/texstringpool.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/luametatex/source/tex/texstringpool.c b/source/luametatex/source/tex/texstringpool.c
index 8367447da..fd93758b5 100644
--- a/source/luametatex/source/tex/texstringpool.c
+++ b/source/luametatex/source/tex/texstringpool.c
@@ -435,6 +435,7 @@ char *tex_makeclstring(int s, size_t *len)
}
}
+/*
char *tex_makecstring(int s)
{
if (s < cs_offset_value) {
@@ -443,6 +444,23 @@ char *tex_makecstring(int s)
return lmt_memory_strdup((str_length(s) > 0) ? (const char *) str_string(s) : "");
}
}
+*/
+
+/*tex
+ I might eventually replace this because in qite some calls we know that we knwo that we have
+ a pointer in string space. We can kin dof predict in what cases we are below |cs_offset_value|
+ anyway.
+*/
+
+char *tex_makecstring(int s, int *allocated)
+{
+ *allocated = s < cs_offset_value;
+ if (*allocated) {
+ return (char *) aux_uni2str((unsigned) s);
+ } else {
+ return str_length(s) > 0 ? (char *) str_string(s) : "";
+ }
+}
/*tex