<div dir="auto"><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"> <<a href="mailto:commits@source.squeak.org" target="_blank" rel="noreferrer">commits@source.squeak.org</a>> schrieb am Di., 20. Apr. 2021</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Item was changed:<br>
+ ----- Method: ExternalData>>fromCStrings (in category 'converting - support') -----<br>
- ----- Method: ExternalData>>fromCStrings (in category 'converting') -----<br>
fromCStrings<br>
"Assume that the receiver represents a set of C strings and is teerminated by a empty string and convert it to a Smalltalk ordered collection of strings"<br>
<br>
| stream index char strings str |<br>
type isPointerType ifFalse: [self error: 'External object is not a pointer type.'].<br>
+ self flag: #bogus. "mt: This format seems to be rather specific to some library. There would normally be pointers to pointers for such a structure. Or does the C standard mention such a format somehow? 'abcd\0efg\0hijklmnopq\0rstuvwxyz\0\0' ??? "<br>
strings := OrderedCollection new.<br>
index := 1.<br>
[<br>
stream := WriteStream on: String new.<br>
[(char := handle unsignedCharAt: index) = 0 asCharacter]<br>
whileFalse: [<br>
stream nextPut: char.<br>
index := index + 1<br>
].<br>
str := stream contents.<br>
strings addLast: str.<br>
str size = 0<br>
] whileFalse.<br>
^strings!<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Seems to be an API specific thing:</div><div dir="auto"><a href="https://devblogs.microsoft.com/oldnewthing/20110511-00/?p=10693" target="_blank" rel="noreferrer">https://devblogs.microsoft.com/oldnewthing/20110511-00/?p=10693</a><br></div><div dir="auto"><br></div><div dir="auto"><a href="https://devblogs.microsoft.com/oldnewthing/20091008-00/?p=16443">https://devblogs.microsoft.com/oldnewthing/20091008-00/?p=16443</a><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>