[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WITH-TEXT?



>I'm trying to write a WITH-TEXT macro similar to WITH-PSTRS that would allo-
>cate a stack block and stuff a string into it, but without the 255 chars limi-
>tations (I don't care about a length byte). Is there a way to do that effi-
>ciently? Copying the characters one by one will take ages. I have found an
>undocumented function %STR-TO-HANDLE, but I don't want a handle, but a stack
>block.

Have you considered just using the WITH-CSTRS macro? It's the same as
WITH-PSTRS, but it allocates zero-terminated strings instead of length
prefixed strings and has no length limitation. It expands into
a call to the function CCL::%CSTR-POINTER, which is responsible for
stuffing the string into the stack block.

>
>By the way, what happens with WITH-PSTRS when the string is over 255? Crash?
>Truncation? Error?

Truncation.