#DOCUMENTATION by cg
class: ExternalBytes
changed:
#copyCStringFromHeap
#copyUnicodeStringFromHeap
--- a/ExternalBytes.st Thu Apr 11 08:54:15 2019 +0200
+++ b/ExternalBytes.st Thu Apr 11 08:55:36 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
@@ -935,26 +937,30 @@
|idx byte s|
idx := 1.
- s := WriteStream on:''.
+ s := WriteStream on:(String new:10).
[(byte := self at:idx) ~~ 0] whileTrue:[
- s nextPut:(Character value:byte).
- idx := idx + 1.
+ s nextPut:(Character value:byte).
+ idx := idx + 1.
].
^ s contents
+
+ "Modified: / 11-04-2019 / 08:49:50 / Claus Gittinger"
!
copyUnicodeStringFromHeap
- "fetch a 0-terminated wide-string from my pointed-to address"
+ "fetch a 0-terminated wide-string (16bit) from my pointed-to address"
|idx word s|
idx := 1.
- s := WriteStream on:Unicode16String new.
+ s := WriteStream on:(Unicode16String new:10).
[(word := self unsignedInt16At:idx) ~~ 0] whileTrue:[
- s nextPut:(Character value:word).
- idx := idx + 2.
+ s nextPut:(Character value:word).
+ idx := idx + 2.
].
^ s contents
+
+ "Modified (comment): / 11-04-2019 / 08:55:29 / Claus Gittinger"
!
instVarAt:index