expose strlen from Foreign.C.String

George Wilson george at wils.online
Wed Jan 20 22:38:48 UTC 2021


Seems reasonable to me.

On Thu, 21 Jan 2021 at 03:55, chessai <chessai1996 at gmail.com> wrote:
>
> I've wanted the following before:
>
> foreign import ccall unsafe "strlen"
>   cstringLength# :: Addr# -> Int#
>
> cstringLength :: CString -> Int
> cstringLength (Ptr s) = I# (cstringLength# s)
>
> A natural place for this seems to be Foreign.C.String.
>
> Thoughts?
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


More information about the Libraries mailing list