diff options
Diffstat (limited to 'core.e')
| -rw-r--r-- | core.e | 14 |
1 files changed, 14 insertions, 0 deletions
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 |