diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-01-18 10:25:33 -0800 |
---|---|---|
committer | Kaz Kyheku <kaz@kylheku.com> | 2020-01-18 10:25:33 -0800 |
commit | 72eff372aefb86ca8ae5ad2e95f01d4cc9e0ec78 (patch) | |
tree | 0f94bdf96c28c0f9daafd168348230bc81e6cc56 /lib.c | |
parent | 7a6a9a21090a36ae094b3a4746a6dd371bd653cb (diff) | |
download | txr-72eff372aefb86ca8ae5ad2e95f01d4cc9e0ec78.tar.gz txr-72eff372aefb86ca8ae5ad2e95f01d4cc9e0ec78.tar.bz2 txr-72eff372aefb86ca8ae5ad2e95f01d4cc9e0ec78.zip |
New function: coded-length.
* eval.c (eval_init): Register coded-length intrinsic.
* lib.c (coded_length): New function.
* lib.h (coded_length): Declared.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3648,6 +3648,11 @@ val length_str(val str) } } +val coded_length(val str) +{ + return unum(utf8_to_buf(0, c_str(str), 0)); +} + const wchar_t *c_str(val obj) { switch (type(obj)) { |