W3cubDocs

/Haskell 8

System.Win32.String

Copyright 2013 shelarcy
License BSD-style
Maintainer [email protected]
Stability Provisional
Portability Non-portable (Win32 API)
Safe Haskell Safe
Language Haskell2010

Description

Utilities for primitive marshalling of Windows' C strings.

type LPSTR = Ptr CChar Source

type LPCSTR = LPSTR Source

type LPWSTR = Ptr CWchar Source

type LPCWSTR = LPWSTR Source

type TCHAR = CWchar Source

type LPTSTR = Ptr TCHAR Source

type LPCTSTR = LPTSTR Source

type LPCTSTR_ = LPCTSTR Source

withTString :: String -> (LPTSTR -> IO a) -> IO a Source

withTStringLen :: String -> ((LPTSTR, Int) -> IO a) -> IO a Source

peekTString :: LPCTSTR -> IO String Source

peekTStringLen :: (LPCTSTR, Int) -> IO String Source

newTString :: String -> IO LPCTSTR Source

withTStringBuffer :: Int -> (LPTSTR -> IO a) -> IO a Source

Marshal a dummy Haskell string into a NUL terminated C wide string using temporary storage.

  • the Haskell string is created by length parameter. And the Haskell string contains only NUL characters.
  • the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.

withTStringBufferLen :: Int -> ((LPTSTR, Int) -> IO a) -> IO a Source

Marshal a dummy Haskell string into a C wide string (i.e. wide character array) in temporary storage, with explicit length information.

  • the Haskell string is created by length parameter. And the Haskell string contains only NUL characters.
  • the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.6.1/docs/html/libraries/Win32-2.6.1.0/System-Win32-String.html