From 0f3c90d8c67c7150feed36a1e620a6aa68f987a7 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 28 May 2026 21:07:55 -0700 Subject: moved pack-raw-string into core.e Force-Push: yes Change-Id: I0940c0c21580e810716a5f61b95fd520c464ab9e --- core.e | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'core.e') diff --git a/core.e b/core.e index 62e2301..e49c2f9 100644 --- a/core.e +++ b/core.e @@ -1197,6 +1197,20 @@ here ! ~ (output point, source, destination, length) memcopy ; +~ This also works on C-style strings, relying on the null terminator, but +~ the packed data does not include it. +~ +~ (output point, string pointer -- output point) +: pack-raw-string + dup stringlen dup + ~ (output point, source, length, length) + 4 roll dup 4 unroll + + ~ (source, destination, length, length, output point) + + 4 unroll + ~ (output point, source, destination, length) + memcopy ; + ~ (output point, alignment byte count -- output point) : packalign { 2dup /% drop { drop exit } unless -- cgit 1.4.1