{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE NoImplicitPrelude #-} -- | SDL\'s C-library replacements: memory, strings, math, and conversions; this module aliases the allocator and SDL\'s own API. -- -- == FFI conventions -- -- Unsuffixed aliases are __unsafe__ foreign imports; aliases suffixed @Safe@ are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under @SDL3.Sys.Bindgen.Stdinc.Unsafe@); functions curated unsafe-only export only the unsuffixed one. Each alias\'s documentation records its flavor and rationale. -- -- This module aliases only the functions of @SDL_stdinc.h@ that the registry allowlists. The header\'s other functions are raw-only: "SDL3.Sys.Bindgen.Stdinc.Unsafe" and "SDL3.Sys.Bindgen.Stdinc.Safe" export them. -- -- The C shims are functions this package defines in C over what the FFI cannot call directly (variadic functions, function-like macros), each named after what it wraps; the same flavor rules apply. Their raw imports live under "SDL3.Sys.Bindgen.StdincShims". -- -- Full conventions: "SDL3.Sys". -- -- == Allowlist -- -- The aliases are SDL\'s own API in this header (environments, the memory-function hooks and allocation count, UTF-8 stepping) and the allocator family, since memory SDL frees, or hands you to free, must come from SDL\'s allocator: 'malloc', 'free', 'strdup', and their kin. The rest of the header serves C programs without a portable C library: strings, character classes, math, sorting, random numbers, checksums, @iconv@, @memcpy@. Haskell has its own, so they stay raw-only. module SDL3.Sys.Stdinc ( module SDL3.Sys.Bindgen.Stdinc, -- * Typed constants pattern SDL3.Sys.Stdinc.SDL_MAX_TIME, pattern SDL3.Sys.Stdinc.SDL_MIN_TIME, pattern SDL3.Sys.Stdinc.SDL_MAX_SINT16, pattern SDL3.Sys.Stdinc.SDL_MIN_SINT16, pattern SDL3.Sys.Stdinc.SDL_MAX_SINT32, pattern SDL3.Sys.Stdinc.SDL_MIN_SINT32, pattern SDL3.Sys.Stdinc.SDL_MAX_SINT64, pattern SDL3.Sys.Stdinc.SDL_MIN_SINT64, pattern SDL3.Sys.Stdinc.SDL_MAX_SINT8, pattern SDL3.Sys.Stdinc.SDL_MIN_SINT8, pattern SDL3.Sys.Stdinc.SDL_MAX_UINT16, pattern SDL3.Sys.Stdinc.SDL_MIN_UINT16, pattern SDL3.Sys.Stdinc.SDL_MAX_UINT32, pattern SDL3.Sys.Stdinc.SDL_MIN_UINT32, pattern SDL3.Sys.Stdinc.SDL_MAX_UINT64, pattern SDL3.Sys.Stdinc.SDL_MIN_UINT64, pattern SDL3.Sys.Stdinc.SDL_MAX_UINT8, pattern SDL3.Sys.Stdinc.SDL_MIN_UINT8, pattern SDL3.Sys.Stdinc.SDL_SIZE_MAX, pattern SDL3.Sys.Stdinc.SDL_ICONV_ERROR, pattern SDL3.Sys.Stdinc.SDL_ICONV_E2BIG, pattern SDL3.Sys.Stdinc.SDL_ICONV_EILSEQ, pattern SDL3.Sys.Stdinc.SDL_ICONV_EINVAL, -- * Function aliases SDL3.Sys.Stdinc.malloc, SDL3.Sys.Stdinc.mallocSafe, SDL3.Sys.Stdinc.calloc, SDL3.Sys.Stdinc.callocSafe, SDL3.Sys.Stdinc.realloc, SDL3.Sys.Stdinc.reallocSafe, SDL3.Sys.Stdinc.free, SDL3.Sys.Stdinc.freeSafe, SDL3.Sys.Stdinc.getOriginalMemoryFunctions, SDL3.Sys.Stdinc.getOriginalMemoryFunctionsSafe, SDL3.Sys.Stdinc.getMemoryFunctions, SDL3.Sys.Stdinc.getMemoryFunctionsSafe, SDL3.Sys.Stdinc.setMemoryFunctions, SDL3.Sys.Stdinc.setMemoryFunctionsSafe, SDL3.Sys.Stdinc.alignedAlloc, SDL3.Sys.Stdinc.alignedAllocSafe, SDL3.Sys.Stdinc.alignedFree, SDL3.Sys.Stdinc.alignedFreeSafe, SDL3.Sys.Stdinc.getNumAllocations, SDL3.Sys.Stdinc.getNumAllocationsSafe, SDL3.Sys.Stdinc.getEnvironment, SDL3.Sys.Stdinc.getEnvironmentSafe, SDL3.Sys.Stdinc.createEnvironment, SDL3.Sys.Stdinc.createEnvironmentSafe, SDL3.Sys.Stdinc.getEnvironmentVariable, SDL3.Sys.Stdinc.getEnvironmentVariableSafe, SDL3.Sys.Stdinc.getEnvironmentVariables, SDL3.Sys.Stdinc.getEnvironmentVariablesSafe, SDL3.Sys.Stdinc.setEnvironmentVariable, SDL3.Sys.Stdinc.setEnvironmentVariableSafe, SDL3.Sys.Stdinc.unsetEnvironmentVariable, SDL3.Sys.Stdinc.unsetEnvironmentVariableSafe, SDL3.Sys.Stdinc.destroyEnvironment, SDL3.Sys.Stdinc.destroyEnvironmentSafe, SDL3.Sys.Stdinc.strdup, SDL3.Sys.Stdinc.strdupSafe, SDL3.Sys.Stdinc.strndup, SDL3.Sys.Stdinc.strndupSafe, SDL3.Sys.Stdinc.stepUTF8, SDL3.Sys.Stdinc.stepBackUTF8, SDL3.Sys.Stdinc.ucs4ToUTF8, -- * C shims SDL3.Sys.Stdinc.fourCC, ) where import Data.Coerce qualified as Coerce import Prelude (Bool, IO, fmap) import HsBindgen.Runtime.CBool qualified as CBool import HsBindgen.Runtime.LibC qualified import HsBindgen.Runtime.PtrConst qualified as PtrConst import HsBindgen.Runtime.Support qualified as BG import SDL3.Sys.Bindgen.Stdinc import SDL3.Sys.Bindgen.Stdinc qualified import SDL3.Sys.Bindgen.Stdinc.Safe qualified as Safe import SDL3.Sys.Bindgen.Stdinc.Unsafe qualified as Unsafe import SDL3.Sys.Bindgen.StdincShims.Unsafe qualified as Unsafe -- | Allocate uninitialized memory. -- -- The allocated memory returned by this function must be freed with @'free'@. -- -- If @size@ is 0, it will be set to 1. -- -- If the allocation is successful, the returned pointer is guaranteed to be aligned to either the /fundamental alignment/ (@alignof(max_align_t)@ in C11 and later) or @2 * sizeof(void *)@, whichever is smaller. Use @'alignedAlloc'@ if you need to allocate memory aligned to an alignment greater than this guarantee. -- -- [Returns]: a pointer to the allocated memory, or NULL if allocation failed. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'free', 'calloc', 'realloc', 'alignedAlloc' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_malloc@. -- The safe flavor is 'mallocSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_malloc@, defined at @SDL3\/SDL_stdinc.h 1342:47@ malloc :: BG.Word64 -- ^ -- -- [@size@]: the size to allocate. -> IO (BG.Ptr BG.Void) malloc :: Word64 -> IO (Ptr Void) malloc = \Word64 x00 -> CSize -> IO (Ptr Void) Unsafe.sDL_malloc (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x00) -- | Allocate uninitialized memory. -- -- The allocated memory returned by this function must be freed with @'free'@. -- -- If @size@ is 0, it will be set to 1. -- -- If the allocation is successful, the returned pointer is guaranteed to be aligned to either the /fundamental alignment/ (@alignof(max_align_t)@ in C11 and later) or @2 * sizeof(void *)@, whichever is smaller. Use @'alignedAlloc'@ if you need to allocate memory aligned to an alignment greater than this guarantee. -- -- [Returns]: a pointer to the allocated memory, or NULL if allocation failed. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'free', 'calloc', 'realloc', 'alignedAlloc' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_malloc@. -- The unsafe flavor is 'malloc' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_malloc@, defined at @SDL3\/SDL_stdinc.h 1342:47@ mallocSafe :: BG.Word64 -- ^ -- -- [@size@]: the size to allocate. -> IO (BG.Ptr BG.Void) mallocSafe :: Word64 -> IO (Ptr Void) mallocSafe = \Word64 x00 -> CSize -> IO (Ptr Void) Safe.sDL_malloc (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x00) -- | -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_calloc@. -- The safe flavor is 'callocSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_calloc@, defined at @SDL3\/SDL_stdinc.h 1367:69@ calloc :: BG.Word64 -- ^ [C declaration]: @nmemb@ -> BG.Word64 -- ^ [C declaration]: @size@ -> IO (BG.Ptr BG.Void) calloc :: Word64 -> Word64 -> IO (Ptr Void) calloc = \Word64 x00 -> \Word64 x11 -> CSize -> CSize -> IO (Ptr Void) Unsafe.sDL_calloc (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x00) (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x11) -- | -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_calloc@. -- The unsafe flavor is 'calloc' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_calloc@, defined at @SDL3\/SDL_stdinc.h 1367:69@ callocSafe :: BG.Word64 -- ^ [C declaration]: @nmemb@ -> BG.Word64 -- ^ [C declaration]: @size@ -> IO (BG.Ptr BG.Void) callocSafe :: Word64 -> Word64 -> IO (Ptr Void) callocSafe = \Word64 x00 -> \Word64 x11 -> CSize -> CSize -> IO (Ptr Void) Safe.sDL_calloc (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x00) (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x11) -- | -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_realloc@. -- The safe flavor is 'reallocSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_realloc@, defined at @SDL3\/SDL_stdinc.h 1407:54@ realloc :: BG.Ptr BG.Void -- ^ [C declaration]: @mem@ -> BG.Word64 -- ^ [C declaration]: @size@ -> IO (BG.Ptr BG.Void) realloc :: Ptr Void -> Word64 -> IO (Ptr Void) realloc = \Ptr Void x00 -> \Word64 x11 -> Ptr Void -> CSize -> IO (Ptr Void) Unsafe.sDL_realloc Ptr Void x00 (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x11) -- | -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_realloc@. -- The unsafe flavor is 'realloc' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_realloc@, defined at @SDL3\/SDL_stdinc.h 1407:54@ reallocSafe :: BG.Ptr BG.Void -- ^ [C declaration]: @mem@ -> BG.Word64 -- ^ [C declaration]: @size@ -> IO (BG.Ptr BG.Void) reallocSafe :: Ptr Void -> Word64 -> IO (Ptr Void) reallocSafe = \Ptr Void x00 -> \Word64 x11 -> Ptr Void -> CSize -> IO (Ptr Void) Safe.sDL_realloc Ptr Void x00 (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x11) -- | Free allocated memory. -- -- The pointer is no longer valid after this call and cannot be dereferenced anymore. -- -- If @mem@ is NULL, this function does nothing. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'malloc', 'calloc', 'realloc' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_free@. -- The safe flavor is 'freeSafe' -- . -- -- [C declaration]: @SDL_free@, defined at @SDL3\/SDL_stdinc.h 1427:34@ free :: BG.Ptr BG.Void -- ^ -- -- [@mem@]: a pointer to allocated memory, or NULL. -> IO () free :: Ptr Void -> IO () free = Ptr Void -> IO () Unsafe.sDL_free -- | Free allocated memory. -- -- The pointer is no longer valid after this call and cannot be dereferenced anymore. -- -- If @mem@ is NULL, this function does nothing. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'malloc', 'calloc', 'realloc' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_free@. -- The unsafe flavor is 'free' -- . -- -- [C declaration]: @SDL_free@, defined at @SDL3\/SDL_stdinc.h 1427:34@ freeSafe :: BG.Ptr BG.Void -- ^ -- -- [@mem@]: a pointer to allocated memory, or NULL. -> IO () freeSafe :: Ptr Void -> IO () freeSafe = Ptr Void -> IO () Safe.sDL_free -- | Get the original set of SDL memory functions. -- -- This is what 'malloc' and friends will use by default, if there has been no call to 'setMemoryFunctions'. This is not necessarily using the C runtime\'s @malloc@ functions behind the scenes! Different platforms and build configurations might do any number of unexpected things. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetOriginalMemoryFunctions@. -- The safe flavor is 'getOriginalMemoryFunctionsSafe' -- . -- -- [C declaration]: @SDL_GetOriginalMemoryFunctions@, defined at @SDL3\/SDL_stdinc.h 1525:34@ getOriginalMemoryFunctions :: BG.Ptr SDL_malloc_func -- ^ -- -- [@malloc_func@]: filled with malloc function. -> BG.Ptr SDL_calloc_func -- ^ -- -- [@calloc_func@]: filled with calloc function. -> BG.Ptr SDL_realloc_func -- ^ -- -- [@realloc_func@]: filled with realloc function. -> BG.Ptr SDL_free_func -- ^ -- -- [@free_func@]: filled with free function. -> IO () getOriginalMemoryFunctions :: Ptr SDL_malloc_func -> Ptr SDL_calloc_func -> Ptr SDL_realloc_func -> Ptr SDL_free_func -> IO () getOriginalMemoryFunctions = Ptr SDL_malloc_func -> Ptr SDL_calloc_func -> Ptr SDL_realloc_func -> Ptr SDL_free_func -> IO () Unsafe.sDL_GetOriginalMemoryFunctions -- | Get the original set of SDL memory functions. -- -- This is what 'malloc' and friends will use by default, if there has been no call to 'setMemoryFunctions'. This is not necessarily using the C runtime\'s @malloc@ functions behind the scenes! Different platforms and build configurations might do any number of unexpected things. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetOriginalMemoryFunctions@. -- The unsafe flavor is 'getOriginalMemoryFunctions' -- . -- -- [C declaration]: @SDL_GetOriginalMemoryFunctions@, defined at @SDL3\/SDL_stdinc.h 1525:34@ getOriginalMemoryFunctionsSafe :: BG.Ptr SDL_malloc_func -- ^ -- -- [@malloc_func@]: filled with malloc function. -> BG.Ptr SDL_calloc_func -- ^ -- -- [@calloc_func@]: filled with calloc function. -> BG.Ptr SDL_realloc_func -- ^ -- -- [@realloc_func@]: filled with realloc function. -> BG.Ptr SDL_free_func -- ^ -- -- [@free_func@]: filled with free function. -> IO () getOriginalMemoryFunctionsSafe :: Ptr SDL_malloc_func -> Ptr SDL_calloc_func -> Ptr SDL_realloc_func -> Ptr SDL_free_func -> IO () getOriginalMemoryFunctionsSafe = Ptr SDL_malloc_func -> Ptr SDL_calloc_func -> Ptr SDL_realloc_func -> Ptr SDL_free_func -> IO () Safe.sDL_GetOriginalMemoryFunctions -- | Get the current set of SDL memory functions. -- -- [Thread safety]: This does not hold a lock, so do not call this in the unlikely event of a background thread calling 'setMemoryFunctions' simultaneously. -- -- @since 3.2.0 -- -- [See also]: 'setMemoryFunctions', 'getOriginalMemoryFunctions' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetMemoryFunctions@. -- The safe flavor is 'getMemoryFunctionsSafe' -- . -- -- [C declaration]: @SDL_GetMemoryFunctions@, defined at @SDL3\/SDL_stdinc.h 1547:34@ getMemoryFunctions :: BG.Ptr SDL_malloc_func -- ^ -- -- [@malloc_func@]: filled with malloc function. -> BG.Ptr SDL_calloc_func -- ^ -- -- [@calloc_func@]: filled with calloc function. -> BG.Ptr SDL_realloc_func -- ^ -- -- [@realloc_func@]: filled with realloc function. -> BG.Ptr SDL_free_func -- ^ -- -- [@free_func@]: filled with free function. -> IO () getMemoryFunctions :: Ptr SDL_malloc_func -> Ptr SDL_calloc_func -> Ptr SDL_realloc_func -> Ptr SDL_free_func -> IO () getMemoryFunctions = Ptr SDL_malloc_func -> Ptr SDL_calloc_func -> Ptr SDL_realloc_func -> Ptr SDL_free_func -> IO () Unsafe.sDL_GetMemoryFunctions -- | Get the current set of SDL memory functions. -- -- [Thread safety]: This does not hold a lock, so do not call this in the unlikely event of a background thread calling 'setMemoryFunctions' simultaneously. -- -- @since 3.2.0 -- -- [See also]: 'setMemoryFunctions', 'getOriginalMemoryFunctions' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetMemoryFunctions@. -- The unsafe flavor is 'getMemoryFunctions' -- . -- -- [C declaration]: @SDL_GetMemoryFunctions@, defined at @SDL3\/SDL_stdinc.h 1547:34@ getMemoryFunctionsSafe :: BG.Ptr SDL_malloc_func -- ^ -- -- [@malloc_func@]: filled with malloc function. -> BG.Ptr SDL_calloc_func -- ^ -- -- [@calloc_func@]: filled with calloc function. -> BG.Ptr SDL_realloc_func -- ^ -- -- [@realloc_func@]: filled with realloc function. -> BG.Ptr SDL_free_func -- ^ -- -- [@free_func@]: filled with free function. -> IO () getMemoryFunctionsSafe :: Ptr SDL_malloc_func -> Ptr SDL_calloc_func -> Ptr SDL_realloc_func -> Ptr SDL_free_func -> IO () getMemoryFunctionsSafe = Ptr SDL_malloc_func -> Ptr SDL_calloc_func -> Ptr SDL_realloc_func -> Ptr SDL_free_func -> IO () Safe.sDL_GetMemoryFunctions -- | Replace SDL\'s memory allocation functions with a custom set. -- -- It is not safe to call this function once any allocations have been made, as future calls to 'free' will use the new allocator, even if they came from an 'malloc' made with the old one! -- -- If used, usually this needs to be the first call made into the SDL library, if not the very first thing done at program startup time. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: It is safe to call this function from any thread, but one should not replace the memory functions once any allocations are made! -- -- @since 3.2.0 -- -- [See also]: 'getMemoryFunctions', 'getOriginalMemoryFunctions' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_SetMemoryFunctions@. -- The safe flavor is 'setMemoryFunctionsSafe' -- : registration; replacement allocators run inside every later SDL call. -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_SetMemoryFunctions@, defined at @SDL3\/SDL_stdinc.h 1578:34@ setMemoryFunctions :: SDL_malloc_func -- ^ -- -- [@malloc_func@]: custom malloc function. -> SDL_calloc_func -- ^ -- -- [@calloc_func@]: custom calloc function. -> SDL_realloc_func -- ^ -- -- [@realloc_func@]: custom realloc function. -> SDL_free_func -- ^ -- -- [@free_func@]: custom free function. -> IO Bool setMemoryFunctions :: SDL_malloc_func -> SDL_calloc_func -> SDL_realloc_func -> SDL_free_func -> IO Bool setMemoryFunctions = \SDL_malloc_func x00 -> \SDL_calloc_func x11 -> \SDL_realloc_func x22 -> \SDL_free_func x33 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (SDL_malloc_func -> SDL_calloc_func -> SDL_realloc_func -> SDL_free_func -> IO CBool Unsafe.sDL_SetMemoryFunctions SDL_malloc_func x00 SDL_calloc_func x11 SDL_realloc_func x22 SDL_free_func x33) -- | Replace SDL\'s memory allocation functions with a custom set. -- -- It is not safe to call this function once any allocations have been made, as future calls to 'free' will use the new allocator, even if they came from an 'malloc' made with the old one! -- -- If used, usually this needs to be the first call made into the SDL library, if not the very first thing done at program startup time. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: It is safe to call this function from any thread, but one should not replace the memory functions once any allocations are made! -- -- @since 3.2.0 -- -- [See also]: 'getMemoryFunctions', 'getOriginalMemoryFunctions' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_SetMemoryFunctions@. -- The unsafe flavor is 'setMemoryFunctions' -- : registration; replacement allocators run inside every later SDL call. -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_SetMemoryFunctions@, defined at @SDL3\/SDL_stdinc.h 1578:34@ setMemoryFunctionsSafe :: SDL_malloc_func -- ^ -- -- [@malloc_func@]: custom malloc function. -> SDL_calloc_func -- ^ -- -- [@calloc_func@]: custom calloc function. -> SDL_realloc_func -- ^ -- -- [@realloc_func@]: custom realloc function. -> SDL_free_func -- ^ -- -- [@free_func@]: custom free function. -> IO Bool setMemoryFunctionsSafe :: SDL_malloc_func -> SDL_calloc_func -> SDL_realloc_func -> SDL_free_func -> IO Bool setMemoryFunctionsSafe = \SDL_malloc_func x00 -> \SDL_calloc_func x11 -> \SDL_realloc_func x22 -> \SDL_free_func x33 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (SDL_malloc_func -> SDL_calloc_func -> SDL_realloc_func -> SDL_free_func -> IO CBool Safe.sDL_SetMemoryFunctions SDL_malloc_func x00 SDL_calloc_func x11 SDL_realloc_func x22 SDL_free_func x33) -- | Allocate memory aligned to a specific alignment. -- -- The memory returned by this function must be freed with @'alignedFree'@, /not/ @'free'@. -- -- If @alignment@ is less than the size of @void *@, it will be increased to match that. -- -- The returned memory address will be a multiple of the alignment value, and the size of the memory allocated will be a multiple of the alignment value. -- -- [Returns]: a pointer to the aligned memory, or NULL if allocation failed. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'alignedFree' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_aligned_alloc@. -- The safe flavor is 'alignedAllocSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_aligned_alloc@, defined at @SDL3\/SDL_stdinc.h 1605:47@ alignedAlloc :: BG.Word64 -- ^ -- -- [@alignment@]: the alignment of the memory. -> BG.Word64 -- ^ -- -- [@size@]: the size to allocate. -> IO (BG.Ptr BG.Void) alignedAlloc :: Word64 -> Word64 -> IO (Ptr Void) alignedAlloc = \Word64 x00 -> \Word64 x11 -> CSize -> CSize -> IO (Ptr Void) Unsafe.sDL_aligned_alloc (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x00) (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x11) -- | Allocate memory aligned to a specific alignment. -- -- The memory returned by this function must be freed with @'alignedFree'@, /not/ @'free'@. -- -- If @alignment@ is less than the size of @void *@, it will be increased to match that. -- -- The returned memory address will be a multiple of the alignment value, and the size of the memory allocated will be a multiple of the alignment value. -- -- [Returns]: a pointer to the aligned memory, or NULL if allocation failed. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'alignedFree' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_aligned_alloc@. -- The unsafe flavor is 'alignedAlloc' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_aligned_alloc@, defined at @SDL3\/SDL_stdinc.h 1605:47@ alignedAllocSafe :: BG.Word64 -- ^ -- -- [@alignment@]: the alignment of the memory. -> BG.Word64 -- ^ -- -- [@size@]: the size to allocate. -> IO (BG.Ptr BG.Void) alignedAllocSafe :: Word64 -> Word64 -> IO (Ptr Void) alignedAllocSafe = \Word64 x00 -> \Word64 x11 -> CSize -> CSize -> IO (Ptr Void) Safe.sDL_aligned_alloc (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x00) (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x11) -- | Free memory allocated by @'alignedAlloc'@. -- -- The pointer is no longer valid after this call and cannot be dereferenced anymore. -- -- If @mem@ is NULL, this function does nothing. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'alignedAlloc' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_aligned_free@. -- The safe flavor is 'alignedFreeSafe' -- . -- -- [C declaration]: @SDL_aligned_free@, defined at @SDL3\/SDL_stdinc.h 1623:34@ alignedFree :: BG.Ptr BG.Void -- ^ -- -- [@mem@]: a pointer previously returned by @'alignedAlloc'@, or NULL. -> IO () alignedFree :: Ptr Void -> IO () alignedFree = Ptr Void -> IO () Unsafe.sDL_aligned_free -- | Free memory allocated by @'alignedAlloc'@. -- -- The pointer is no longer valid after this call and cannot be dereferenced anymore. -- -- If @mem@ is NULL, this function does nothing. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'alignedAlloc' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_aligned_free@. -- The unsafe flavor is 'alignedFree' -- . -- -- [C declaration]: @SDL_aligned_free@, defined at @SDL3\/SDL_stdinc.h 1623:34@ alignedFreeSafe :: BG.Ptr BG.Void -- ^ -- -- [@mem@]: a pointer previously returned by @'alignedAlloc'@, or NULL. -> IO () alignedFreeSafe :: Ptr Void -> IO () alignedFreeSafe = Ptr Void -> IO () Safe.sDL_aligned_free -- | Get the number of outstanding (unfreed) allocations. -- -- [Returns]: the number of allocations or -1 if allocation counting is disabled. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetNumAllocations@. -- The safe flavor is 'getNumAllocationsSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetNumAllocations@, defined at @SDL3\/SDL_stdinc.h 1635:33@ getNumAllocations :: IO BG.Int32 getNumAllocations :: IO Int32 getNumAllocations = (CInt -> Int32) -> IO CInt -> IO Int32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CInt -> Int32 forall a b. Coercible a b => a -> b Coerce.coerce IO CInt Unsafe.sDL_GetNumAllocations -- | Get the number of outstanding (unfreed) allocations. -- -- [Returns]: the number of allocations or -1 if allocation counting is disabled. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetNumAllocations@. -- The unsafe flavor is 'getNumAllocations' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetNumAllocations@, defined at @SDL3\/SDL_stdinc.h 1635:33@ getNumAllocationsSafe :: IO BG.Int32 getNumAllocationsSafe :: IO Int32 getNumAllocationsSafe = (CInt -> Int32) -> IO CInt -> IO Int32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CInt -> Int32 forall a b. Coercible a b => a -> b Coerce.coerce IO CInt Safe.sDL_GetNumAllocations -- | Get the process environment. -- -- This is initialized at application start and is not affected by setenv() and unsetenv() calls after that point. Use @'setEnvironmentVariable'@ and @'unsetEnvironmentVariable'@ if you want to modify this environment, or @'SDL3.Sys.Bindgen.Stdinc.Unsafe.sDL_setenv_unsafe'@ or @'SDL3.Sys.Bindgen.Stdinc.Unsafe.sDL_unsetenv_unsafe'@ if you want changes to persist in the C runtime environment after 'SDL3.Sys.Init.quit'. -- -- [Returns]: a pointer to the environment for the process or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironmentVariable', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetEnvironment@. -- The safe flavor is 'getEnvironmentSafe' -- . -- -- [C declaration]: @SDL_GetEnvironment@, defined at @SDL3\/SDL_stdinc.h 1673:47@ getEnvironment :: IO (BG.Ptr SDL_Environment) getEnvironment :: IO (Ptr SDL_Environment) getEnvironment = IO (Ptr SDL_Environment) Unsafe.sDL_GetEnvironment -- | Get the process environment. -- -- This is initialized at application start and is not affected by setenv() and unsetenv() calls after that point. Use @'setEnvironmentVariable'@ and @'unsetEnvironmentVariable'@ if you want to modify this environment, or @'SDL3.Sys.Bindgen.Stdinc.Unsafe.sDL_setenv_unsafe'@ or @'SDL3.Sys.Bindgen.Stdinc.Unsafe.sDL_unsetenv_unsafe'@ if you want changes to persist in the C runtime environment after 'SDL3.Sys.Init.quit'. -- -- [Returns]: a pointer to the environment for the process or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironmentVariable', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetEnvironment@. -- The unsafe flavor is 'getEnvironment' -- . -- -- [C declaration]: @SDL_GetEnvironment@, defined at @SDL3\/SDL_stdinc.h 1673:47@ getEnvironmentSafe :: IO (BG.Ptr SDL_Environment) getEnvironmentSafe :: IO (Ptr SDL_Environment) getEnvironmentSafe = IO (Ptr SDL_Environment) Safe.sDL_GetEnvironment -- | Create a set of environment variables -- -- [Returns]: a pointer to the new environment or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: If @populated@ is false, it is safe to call this function from any thread, otherwise it is safe if no other threads are calling setenv() or unsetenv() -- -- @since 3.2.0 -- -- [See also]: 'getEnvironmentVariable', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable', 'destroyEnvironment' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_CreateEnvironment@. -- The safe flavor is 'createEnvironmentSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_CreateEnvironment@, defined at @SDL3\/SDL_stdinc.h 1695:47@ createEnvironment :: Bool -- ^ -- -- [@populated@]: true to initialize it from the C runtime environment, false to create an empty environment. -> IO (BG.Ptr SDL_Environment) createEnvironment :: Bool -> IO (Ptr SDL_Environment) createEnvironment = \Bool x00 -> CBool -> IO (Ptr SDL_Environment) Unsafe.sDL_CreateEnvironment (Bool -> CBool forall b. Num b => Bool -> b CBool.fromBool Bool x00) -- | Create a set of environment variables -- -- [Returns]: a pointer to the new environment or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: If @populated@ is false, it is safe to call this function from any thread, otherwise it is safe if no other threads are calling setenv() or unsetenv() -- -- @since 3.2.0 -- -- [See also]: 'getEnvironmentVariable', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable', 'destroyEnvironment' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_CreateEnvironment@. -- The unsafe flavor is 'createEnvironment' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_CreateEnvironment@, defined at @SDL3\/SDL_stdinc.h 1695:47@ createEnvironmentSafe :: Bool -- ^ -- -- [@populated@]: true to initialize it from the C runtime environment, false to create an empty environment. -> IO (BG.Ptr SDL_Environment) createEnvironmentSafe :: Bool -> IO (Ptr SDL_Environment) createEnvironmentSafe = \Bool x00 -> CBool -> IO (Ptr SDL_Environment) Safe.sDL_CreateEnvironment (Bool -> CBool forall b. Num b => Bool -> b CBool.fromBool Bool x00) -- | Get the value of a variable in the environment. -- -- [Returns]: a pointer to the value of the variable or NULL if it can\'t be found. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironment', 'createEnvironment', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetEnvironmentVariable@. -- The safe flavor is 'getEnvironmentVariableSafe' -- . -- -- [C declaration]: @SDL_GetEnvironmentVariable@, defined at @SDL3\/SDL_stdinc.h 1715:42@ getEnvironmentVariable :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to query. -> PtrConst.PtrConst BG.CChar -- ^ -- -- [@name@]: the name of the variable to get. -> IO (PtrConst.PtrConst BG.CChar) getEnvironmentVariable :: Ptr SDL_Environment -> PtrConst CChar -> IO (PtrConst CChar) getEnvironmentVariable = Ptr SDL_Environment -> PtrConst CChar -> IO (PtrConst CChar) Unsafe.sDL_GetEnvironmentVariable -- | Get the value of a variable in the environment. -- -- [Returns]: a pointer to the value of the variable or NULL if it can\'t be found. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironment', 'createEnvironment', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetEnvironmentVariable@. -- The unsafe flavor is 'getEnvironmentVariable' -- . -- -- [C declaration]: @SDL_GetEnvironmentVariable@, defined at @SDL3\/SDL_stdinc.h 1715:42@ getEnvironmentVariableSafe :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to query. -> PtrConst.PtrConst BG.CChar -- ^ -- -- [@name@]: the name of the variable to get. -> IO (PtrConst.PtrConst BG.CChar) getEnvironmentVariableSafe :: Ptr SDL_Environment -> PtrConst CChar -> IO (PtrConst CChar) getEnvironmentVariableSafe = Ptr SDL_Environment -> PtrConst CChar -> IO (PtrConst CChar) Safe.sDL_GetEnvironmentVariable -- | Get all variables in the environment. -- -- [Returns]: a NULL terminated array of pointers to environment variables in the form \"variable=value\" or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. This is a single allocation that should be freed with @'free'@ when it is no longer needed. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironment', 'createEnvironment', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetEnvironmentVariables@. -- The safe flavor is 'getEnvironmentVariablesSafe' -- . -- -- [C declaration]: @SDL_GetEnvironmentVariables@, defined at @SDL3\/SDL_stdinc.h 1736:37@ getEnvironmentVariables :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to query. -> IO (BG.Ptr (BG.Ptr BG.CChar)) getEnvironmentVariables :: Ptr SDL_Environment -> IO (Ptr (Ptr CChar)) getEnvironmentVariables = Ptr SDL_Environment -> IO (Ptr (Ptr CChar)) Unsafe.sDL_GetEnvironmentVariables -- | Get all variables in the environment. -- -- [Returns]: a NULL terminated array of pointers to environment variables in the form \"variable=value\" or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. This is a single allocation that should be freed with @'free'@ when it is no longer needed. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironment', 'createEnvironment', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetEnvironmentVariables@. -- The unsafe flavor is 'getEnvironmentVariables' -- . -- -- [C declaration]: @SDL_GetEnvironmentVariables@, defined at @SDL3\/SDL_stdinc.h 1736:37@ getEnvironmentVariablesSafe :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to query. -> IO (BG.Ptr (BG.Ptr BG.CChar)) getEnvironmentVariablesSafe :: Ptr SDL_Environment -> IO (Ptr (Ptr CChar)) getEnvironmentVariablesSafe = Ptr SDL_Environment -> IO (Ptr (Ptr CChar)) Safe.sDL_GetEnvironmentVariables -- | Set the value of a variable in the environment. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironment', 'createEnvironment', 'getEnvironmentVariable', 'getEnvironmentVariables', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_SetEnvironmentVariable@. -- The safe flavor is 'setEnvironmentVariableSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_SetEnvironmentVariable@, defined at @SDL3\/SDL_stdinc.h 1760:34@ setEnvironmentVariable :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to modify. -> PtrConst.PtrConst BG.CChar -- ^ -- -- [@name@]: the name of the variable to set. -> PtrConst.PtrConst BG.CChar -- ^ -- -- [@value@]: the value of the variable to set. -> Bool -- ^ -- -- [@overwrite@]: true to overwrite the variable if it exists, false to return success without setting the variable if it already exists. -> IO Bool setEnvironmentVariable :: Ptr SDL_Environment -> PtrConst CChar -> PtrConst CChar -> Bool -> IO Bool setEnvironmentVariable = \Ptr SDL_Environment x00 -> \PtrConst CChar x11 -> \PtrConst CChar x22 -> \Bool x33 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Environment -> PtrConst CChar -> PtrConst CChar -> CBool -> IO CBool Unsafe.sDL_SetEnvironmentVariable Ptr SDL_Environment x00 PtrConst CChar x11 PtrConst CChar x22 (Bool -> CBool forall b. Num b => Bool -> b CBool.fromBool Bool x33)) -- | Set the value of a variable in the environment. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironment', 'createEnvironment', 'getEnvironmentVariable', 'getEnvironmentVariables', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_SetEnvironmentVariable@. -- The unsafe flavor is 'setEnvironmentVariable' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_SetEnvironmentVariable@, defined at @SDL3\/SDL_stdinc.h 1760:34@ setEnvironmentVariableSafe :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to modify. -> PtrConst.PtrConst BG.CChar -- ^ -- -- [@name@]: the name of the variable to set. -> PtrConst.PtrConst BG.CChar -- ^ -- -- [@value@]: the value of the variable to set. -> Bool -- ^ -- -- [@overwrite@]: true to overwrite the variable if it exists, false to return success without setting the variable if it already exists. -> IO Bool setEnvironmentVariableSafe :: Ptr SDL_Environment -> PtrConst CChar -> PtrConst CChar -> Bool -> IO Bool setEnvironmentVariableSafe = \Ptr SDL_Environment x00 -> \PtrConst CChar x11 -> \PtrConst CChar x22 -> \Bool x33 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Environment -> PtrConst CChar -> PtrConst CChar -> CBool -> IO CBool Safe.sDL_SetEnvironmentVariable Ptr SDL_Environment x00 PtrConst CChar x11 PtrConst CChar x22 (Bool -> CBool forall b. Num b => Bool -> b CBool.fromBool Bool x33)) -- | Clear a variable from the environment. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironment', 'createEnvironment', 'getEnvironmentVariable', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_UnsetEnvironmentVariable@. -- The safe flavor is 'unsetEnvironmentVariableSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_UnsetEnvironmentVariable@, defined at @SDL3\/SDL_stdinc.h 1781:34@ unsetEnvironmentVariable :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to modify. -> PtrConst.PtrConst BG.CChar -- ^ -- -- [@name@]: the name of the variable to unset. -> IO Bool unsetEnvironmentVariable :: Ptr SDL_Environment -> PtrConst CChar -> IO Bool unsetEnvironmentVariable = \Ptr SDL_Environment x00 -> \PtrConst CChar x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Environment -> PtrConst CChar -> IO CBool Unsafe.sDL_UnsetEnvironmentVariable Ptr SDL_Environment x00 PtrConst CChar x11) -- | Clear a variable from the environment. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- [See also]: 'getEnvironment', 'createEnvironment', 'getEnvironmentVariable', 'getEnvironmentVariables', 'setEnvironmentVariable', 'unsetEnvironmentVariable' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_UnsetEnvironmentVariable@. -- The unsafe flavor is 'unsetEnvironmentVariable' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_UnsetEnvironmentVariable@, defined at @SDL3\/SDL_stdinc.h 1781:34@ unsetEnvironmentVariableSafe :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to modify. -> PtrConst.PtrConst BG.CChar -- ^ -- -- [@name@]: the name of the variable to unset. -> IO Bool unsetEnvironmentVariableSafe :: Ptr SDL_Environment -> PtrConst CChar -> IO Bool unsetEnvironmentVariableSafe = \Ptr SDL_Environment x00 -> \PtrConst CChar x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Environment -> PtrConst CChar -> IO CBool Safe.sDL_UnsetEnvironmentVariable Ptr SDL_Environment x00 PtrConst CChar x11) -- | Destroy a set of environment variables. -- -- [Thread safety]: It is safe to call this function from any thread, as long as the environment is no longer in use. -- -- @since 3.2.0 -- -- [See also]: 'createEnvironment' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_DestroyEnvironment@. -- The safe flavor is 'destroyEnvironmentSafe' -- . -- -- [C declaration]: @SDL_DestroyEnvironment@, defined at @SDL3\/SDL_stdinc.h 1795:34@ destroyEnvironment :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to destroy. -> IO () destroyEnvironment :: Ptr SDL_Environment -> IO () destroyEnvironment = Ptr SDL_Environment -> IO () Unsafe.sDL_DestroyEnvironment -- | Destroy a set of environment variables. -- -- [Thread safety]: It is safe to call this function from any thread, as long as the environment is no longer in use. -- -- @since 3.2.0 -- -- [See also]: 'createEnvironment' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_DestroyEnvironment@. -- The unsafe flavor is 'destroyEnvironment' -- . -- -- [C declaration]: @SDL_DestroyEnvironment@, defined at @SDL3\/SDL_stdinc.h 1795:34@ destroyEnvironmentSafe :: BG.Ptr SDL_Environment -- ^ -- -- [@env@]: the environment to destroy. -> IO () destroyEnvironmentSafe :: Ptr SDL_Environment -> IO () destroyEnvironmentSafe = Ptr SDL_Environment -> IO () Safe.sDL_DestroyEnvironment -- | Allocate a copy of a string. -- -- This allocates enough space for a null-terminated copy of @str@, using 'malloc', and then makes a copy of the string into this space. -- -- The returned string is owned by the caller, and should be passed to 'free' when no longer needed. -- -- [Returns]: a pointer to the newly-allocated string. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_strdup@. -- The safe flavor is 'strdupSafe' -- . -- -- [C declaration]: @SDL_strdup@, defined at @SDL3\/SDL_stdinc.h 3164:47@ strdup :: PtrConst.PtrConst BG.CChar -- ^ -- -- [@str@]: the string to copy. -> IO (BG.Ptr BG.CChar) strdup :: PtrConst CChar -> IO (Ptr CChar) strdup = PtrConst CChar -> IO (Ptr CChar) Unsafe.sDL_strdup -- | Allocate a copy of a string. -- -- This allocates enough space for a null-terminated copy of @str@, using 'malloc', and then makes a copy of the string into this space. -- -- The returned string is owned by the caller, and should be passed to 'free' when no longer needed. -- -- [Returns]: a pointer to the newly-allocated string. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_strdup@. -- The unsafe flavor is 'strdup' -- . -- -- [C declaration]: @SDL_strdup@, defined at @SDL3\/SDL_stdinc.h 3164:47@ strdupSafe :: PtrConst.PtrConst BG.CChar -- ^ -- -- [@str@]: the string to copy. -> IO (BG.Ptr BG.CChar) strdupSafe :: PtrConst CChar -> IO (Ptr CChar) strdupSafe = PtrConst CChar -> IO (Ptr CChar) Safe.sDL_strdup -- | Allocate a copy of a string, up to n characters. -- -- This allocates enough space for a null-terminated copy of @str@, up to @maxlen@ bytes, using 'malloc', and then makes a copy of the string into this space. -- -- If the string is longer than @maxlen@ bytes, the returned string will be @maxlen@ bytes long, plus a null-terminator character that isn\'t included in the count. -- -- The returned string is owned by the caller, and should be passed to 'free' when no longer needed. -- -- [Returns]: a pointer to the newly-allocated string. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_strndup@. -- The safe flavor is 'strndupSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_strndup@, defined at @SDL3\/SDL_stdinc.h 3189:47@ strndup :: PtrConst.PtrConst BG.CChar -- ^ -- -- [@str@]: the string to copy. -> BG.Word64 -- ^ -- -- [@maxlen@]: the maximum length of the copied string, not counting the null-terminator character. -> IO (BG.Ptr BG.CChar) strndup :: PtrConst CChar -> Word64 -> IO (Ptr CChar) strndup = \PtrConst CChar x00 -> \Word64 x11 -> PtrConst CChar -> CSize -> IO (Ptr CChar) Unsafe.sDL_strndup PtrConst CChar x00 (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x11) -- | Allocate a copy of a string, up to n characters. -- -- This allocates enough space for a null-terminated copy of @str@, up to @maxlen@ bytes, using 'malloc', and then makes a copy of the string into this space. -- -- If the string is longer than @maxlen@ bytes, the returned string will be @maxlen@ bytes long, plus a null-terminator character that isn\'t included in the count. -- -- The returned string is owned by the caller, and should be passed to 'free' when no longer needed. -- -- [Returns]: a pointer to the newly-allocated string. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_strndup@. -- The unsafe flavor is 'strndup' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_strndup@, defined at @SDL3\/SDL_stdinc.h 3189:47@ strndupSafe :: PtrConst.PtrConst BG.CChar -- ^ -- -- [@str@]: the string to copy. -> BG.Word64 -- ^ -- -- [@maxlen@]: the maximum length of the copied string, not counting the null-terminator character. -> IO (BG.Ptr BG.CChar) strndupSafe :: PtrConst CChar -> Word64 -> IO (Ptr CChar) strndupSafe = \PtrConst CChar x00 -> \Word64 x11 -> PtrConst CChar -> CSize -> IO (Ptr CChar) Safe.sDL_strndup PtrConst CChar x00 (Word64 -> CSize forall a b. Coercible a b => a -> b Coerce.coerce Word64 x11) -- | Decode a UTF-8 string, one Unicode codepoint at a time. -- -- This will return the first Unicode codepoint in the UTF-8 encoded string in @*pstr@, and then advance @*pstr@ past any consumed bytes before returning. -- -- It will not access more than @*pslen@ bytes from the string. @*pslen@ will be adjusted, as well, subtracting the number of bytes consumed. -- -- @pslen@ is allowed to be NULL, in which case the string /must/ be NULL-terminated, as the function will blindly read until it sees the NULL char. -- -- if @*pslen@ is zero, it assumes the end of string is reached and returns a zero codepoint regardless of the contents of the string buffer. -- -- If the resulting codepoint is zero (a NULL terminator), or @*pslen@ is zero, it will not advance @*pstr@ or @*pslen@ at all. -- -- Generally this function is called in a loop until it returns zero, adjusting its parameters each iteration. -- -- If an invalid UTF-8 sequence is encountered, this function returns SDL_INVALID_UNICODE_CODEPOINT and advances the string\/length by one byte (which is to say, a multibyte sequence might produce several SDL_INVALID_UNICODE_CODEPOINT returns before it syncs to the next valid UTF-8 sequence). -- -- Several things can generate invalid UTF-8 sequences, including overlong encodings, the use of UTF-16 surrogate values, and truncated data. Please refer to [RFC3629](https://www.ietf.org/rfc/rfc3629.txt) for details. -- -- [Returns]: the first Unicode codepoint in the string. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_StepUTF8@. -- The safe import is not exported -- : string computation over caller memory with no allocation; cannot block, lock, or call back. -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_StepUTF8@, defined at @SDL3\/SDL_stdinc.h 4030:36@ stepUTF8 :: BG.Ptr (PtrConst.PtrConst BG.CChar) -- ^ -- -- [@pstr@]: a pointer to a UTF-8 string pointer to be read and adjusted. -> BG.Ptr HsBindgen.Runtime.LibC.CSize -- ^ -- -- [@pslen@]: a pointer to the number of bytes in the string, to be read and adjusted. NULL is allowed. -> IO BG.Word32 stepUTF8 :: Ptr (PtrConst CChar) -> Ptr CSize -> IO Word32 stepUTF8 = \Ptr (PtrConst CChar) x00 -> \Ptr CSize x11 -> (Uint32 -> Word32) -> IO Uint32 -> IO Word32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap Uint32 -> Word32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr (PtrConst CChar) -> Ptr CSize -> IO Uint32 Unsafe.sDL_StepUTF8 Ptr (PtrConst CChar) x00 Ptr CSize x11) -- | Decode a UTF-8 string in reverse, one Unicode codepoint at a time. -- -- This will go to the start of the previous Unicode codepoint in the string, move @*pstr@ to that location and return that codepoint. -- -- If @*pstr@ is already at the start of the string), it will not advance @*pstr@ at all. -- -- Generally this function is called in a loop until it returns zero, adjusting its parameter each iteration. -- -- If an invalid UTF-8 sequence is encountered, this function returns SDL_INVALID_UNICODE_CODEPOINT. -- -- Several things can generate invalid UTF-8 sequences, including overlong encodings, the use of UTF-16 surrogate values, and truncated data. Please refer to [RFC3629](https://www.ietf.org/rfc/rfc3629.txt) for details. -- -- [Returns]: the previous Unicode codepoint in the string. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_StepBackUTF8@. -- The safe import is not exported -- : string computation over caller memory with no allocation; cannot block, lock, or call back. -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_StepBackUTF8@, defined at @SDL3\/SDL_stdinc.h 4061:36@ stepBackUTF8 :: PtrConst.PtrConst BG.CChar -- ^ -- -- [@start@]: a pointer to the beginning of the UTF-8 string. -> BG.Ptr (PtrConst.PtrConst BG.CChar) -- ^ -- -- [@pstr@]: a pointer to a UTF-8 string pointer to be read and adjusted. -> IO BG.Word32 stepBackUTF8 :: PtrConst CChar -> Ptr (PtrConst CChar) -> IO Word32 stepBackUTF8 = \PtrConst CChar x00 -> \Ptr (PtrConst CChar) x11 -> (Uint32 -> Word32) -> IO Uint32 -> IO Word32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap Uint32 -> Word32 forall a b. Coercible a b => a -> b Coerce.coerce (PtrConst CChar -> Ptr (PtrConst CChar) -> IO Uint32 Unsafe.sDL_StepBackUTF8 PtrConst CChar x00 Ptr (PtrConst CChar) x11) -- | Convert a single Unicode codepoint to UTF-8. -- -- The buffer pointed to by @dst@ must be at least 4 bytes long, as this function may generate between 1 and 4 bytes of output. -- -- This function returns the first byte /after/ the newly-written UTF-8 sequence, which is useful for encoding multiple codepoints in a loop, or knowing where to write a NULL-terminator character to end the string (in either case, plan to have a buffer of /more/ than 4 bytes!). -- -- If @codepoint@ is an invalid value (outside the Unicode range, or a UTF-16 surrogate value, etc), this will use U+FFFD (REPLACEMENT CHARACTER) for the codepoint instead, and not set an error. -- -- If @dst@ is NULL, this returns NULL immediately without writing to the pointer and without setting an error. -- -- [Returns]: the first byte past the newly-written UTF-8 sequence. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_UCS4ToUTF8@. -- The safe import is not exported -- : string computation over caller memory with no allocation; cannot block, lock, or call back. -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_UCS4ToUTF8@, defined at @SDL3\/SDL_stdinc.h 4090:36@ ucs4ToUTF8 :: BG.Word32 -- ^ -- -- [@codepoint@]: a Unicode codepoint to convert to UTF-8. -> BG.Ptr BG.CChar -- ^ -- -- [@dst@]: the location to write the encoded UTF-8. Must point to at least 4 bytes! -> IO (BG.Ptr BG.CChar) ucs4ToUTF8 :: Word32 -> Ptr CChar -> IO (Ptr CChar) ucs4ToUTF8 = \Word32 x00 -> \Ptr CChar x11 -> Uint32 -> Ptr CChar -> IO (Ptr CChar) Unsafe.sDL_UCS4ToUTF8 (Word32 -> Uint32 forall a b. Coercible a b => a -> b Coerce.coerce Word32 x00) Ptr CChar x11 -- | Define a four character code as a Uint32. -- -- The SDL_FOURCC macro as a function. -- -- [Returns]: the four characters converted into a Uint32, one character per-byte. -- -- [Thread safety]: It is safe to call this function from any thread. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @lithon_SDL_FOURCC@. -- The safe import is not exported -- : pure bit manipulation on immediate values; cannot block, lock, or call back. -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @lithon_SDL_FOURCC@, defined at @sdl3-bindgen-sys\/SDL_stdinc_shims.h 40:26@ fourCC :: BG.Word8 -- ^ -- -- [@a@]: the first ASCII character. -> BG.Word8 -- ^ -- -- [@b@]: the second ASCII character. -> BG.Word8 -- ^ -- -- [@c@]: the third ASCII character. -> BG.Word8 -- ^ -- -- [@d@]: the fourth ASCII character. -> IO BG.Word32 fourCC :: Word8 -> Word8 -> Word8 -> Word8 -> IO Word32 fourCC = \Word8 x00 -> \Word8 x11 -> \Word8 x22 -> \Word8 x33 -> (Uint32 -> Word32) -> IO Uint32 -> IO Word32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap Uint32 -> Word32 forall a b. Coercible a b => a -> b Coerce.coerce ( Uint8 -> Uint8 -> Uint8 -> Uint8 -> IO Uint32 Unsafe.lithon_SDL_FOURCC (Word8 -> Uint8 forall a b. Coercible a b => a -> b Coerce.coerce Word8 x00) (Word8 -> Uint8 forall a b. Coercible a b => a -> b Coerce.coerce Word8 x11) (Word8 -> Uint8 forall a b. Coercible a b => a -> b Coerce.coerce Word8 x22) (Word8 -> Uint8 forall a b. Coercible a b => a -> b Coerce.coerce Word8 x33) ) -- | Typed constant for macro @SDL_MAX_TIME@. pattern SDL_MAX_TIME :: SDL_Time pattern $mSDL_MAX_TIME :: forall {r}. SDL_Time -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_TIME :: SDL_Time SDL_MAX_TIME = SDL_Time 9223372036854775807 -- | Typed constant for macro @SDL_MIN_TIME@. pattern SDL_MIN_TIME :: SDL_Time pattern $mSDL_MIN_TIME :: forall {r}. SDL_Time -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_TIME :: SDL_Time SDL_MIN_TIME <- SDL_Time (-9223372036854775808) where SDL_MIN_TIME = Sint64 -> SDL_Time SDL_Time (-Sint64 9223372036854775808) -- | Typed constant for macro @SDL_MAX_SINT16@. pattern SDL_MAX_SINT16 :: Sint16 pattern $mSDL_MAX_SINT16 :: forall {r}. Sint16 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_SINT16 :: Sint16 SDL_MAX_SINT16 = Sint16 32767 -- | Typed constant for macro @SDL_MIN_SINT16@. pattern SDL_MIN_SINT16 :: Sint16 pattern $mSDL_MIN_SINT16 :: forall {r}. Sint16 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_SINT16 :: Sint16 SDL_MIN_SINT16 <- Sint16 (-32768) where SDL_MIN_SINT16 = Int16 -> Sint16 Sint16 (-Int16 32768) -- | Typed constant for macro @SDL_MAX_SINT32@. pattern SDL_MAX_SINT32 :: Sint32 pattern $mSDL_MAX_SINT32 :: forall {r}. Sint32 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_SINT32 :: Sint32 SDL_MAX_SINT32 = Sint32 2147483647 -- | Typed constant for macro @SDL_MIN_SINT32@. pattern SDL_MIN_SINT32 :: Sint32 pattern $mSDL_MIN_SINT32 :: forall {r}. Sint32 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_SINT32 :: Sint32 SDL_MIN_SINT32 <- Sint32 (-2147483648) where SDL_MIN_SINT32 = Int32 -> Sint32 Sint32 (-Int32 2147483648) -- | Typed constant for macro @SDL_MAX_SINT64@. pattern SDL_MAX_SINT64 :: Sint64 pattern $mSDL_MAX_SINT64 :: forall {r}. Sint64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_SINT64 :: Sint64 SDL_MAX_SINT64 = Sint64 9223372036854775807 -- | Typed constant for macro @SDL_MIN_SINT64@. pattern SDL_MIN_SINT64 :: Sint64 pattern $mSDL_MIN_SINT64 :: forall {r}. Sint64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_SINT64 :: Sint64 SDL_MIN_SINT64 <- Sint64 (-9223372036854775808) where SDL_MIN_SINT64 = Int64 -> Sint64 Sint64 (-Int64 9223372036854775808) -- | Typed constant for macro @SDL_MAX_SINT8@. pattern SDL_MAX_SINT8 :: Sint8 pattern $mSDL_MAX_SINT8 :: forall {r}. Sint8 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_SINT8 :: Sint8 SDL_MAX_SINT8 = Sint8 127 -- | Typed constant for macro @SDL_MIN_SINT8@. pattern SDL_MIN_SINT8 :: Sint8 pattern $mSDL_MIN_SINT8 :: forall {r}. Sint8 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_SINT8 :: Sint8 SDL_MIN_SINT8 <- Sint8 (-128) where SDL_MIN_SINT8 = Int8 -> Sint8 Sint8 (-Int8 128) -- | Typed constant for macro @SDL_MAX_UINT16@. pattern SDL_MAX_UINT16 :: Uint16 pattern $mSDL_MAX_UINT16 :: forall {r}. Uint16 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_UINT16 :: Uint16 SDL_MAX_UINT16 = Uint16 65535 -- | Typed constant for macro @SDL_MIN_UINT16@. pattern SDL_MIN_UINT16 :: Uint16 pattern $mSDL_MIN_UINT16 :: forall {r}. Uint16 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_UINT16 :: Uint16 SDL_MIN_UINT16 = Uint16 0 -- | Typed constant for macro @SDL_MAX_UINT32@. pattern SDL_MAX_UINT32 :: Uint32 pattern $mSDL_MAX_UINT32 :: forall {r}. Uint32 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_UINT32 :: Uint32 SDL_MAX_UINT32 = Uint32 4294967295 -- | Typed constant for macro @SDL_MIN_UINT32@. pattern SDL_MIN_UINT32 :: Uint32 pattern $mSDL_MIN_UINT32 :: forall {r}. Uint32 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_UINT32 :: Uint32 SDL_MIN_UINT32 = Uint32 0 -- | Typed constant for macro @SDL_MAX_UINT64@. pattern SDL_MAX_UINT64 :: Uint64 pattern $mSDL_MAX_UINT64 :: forall {r}. Uint64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_UINT64 :: Uint64 SDL_MAX_UINT64 = Uint64 18446744073709551615 -- | Typed constant for macro @SDL_MIN_UINT64@. pattern SDL_MIN_UINT64 :: Uint64 pattern $mSDL_MIN_UINT64 :: forall {r}. Uint64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_UINT64 :: Uint64 SDL_MIN_UINT64 = Uint64 0 -- | Typed constant for macro @SDL_MAX_UINT8@. pattern SDL_MAX_UINT8 :: Uint8 pattern $mSDL_MAX_UINT8 :: forall {r}. Uint8 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MAX_UINT8 :: Uint8 SDL_MAX_UINT8 = Uint8 255 -- | Typed constant for macro @SDL_MIN_UINT8@. pattern SDL_MIN_UINT8 :: Uint8 pattern $mSDL_MIN_UINT8 :: forall {r}. Uint8 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_MIN_UINT8 :: Uint8 SDL_MIN_UINT8 = Uint8 0 -- | Typed constant for macro @SDL_SIZE_MAX@ (C type @size_t@). pattern SDL_SIZE_MAX :: BG.Word64 pattern $mSDL_SIZE_MAX :: forall {r}. Word64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_SIZE_MAX :: Word64 SDL_SIZE_MAX = 18446744073709551615 -- | Typed constant for macro @SDL_ICONV_ERROR@ (C type @size_t@). pattern SDL_ICONV_ERROR :: BG.Word64 pattern $mSDL_ICONV_ERROR :: forall {r}. Word64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_ICONV_ERROR :: Word64 SDL_ICONV_ERROR = 18446744073709551615 -- | Typed constant for macro @SDL_ICONV_E2BIG@ (C type @size_t@). pattern SDL_ICONV_E2BIG :: BG.Word64 pattern $mSDL_ICONV_E2BIG :: forall {r}. Word64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_ICONV_E2BIG :: Word64 SDL_ICONV_E2BIG = 18446744073709551614 -- | Typed constant for macro @SDL_ICONV_EILSEQ@ (C type @size_t@). pattern SDL_ICONV_EILSEQ :: BG.Word64 pattern $mSDL_ICONV_EILSEQ :: forall {r}. Word64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_ICONV_EILSEQ :: Word64 SDL_ICONV_EILSEQ = 18446744073709551613 -- | Typed constant for macro @SDL_ICONV_EINVAL@ (C type @size_t@). pattern SDL_ICONV_EINVAL :: BG.Word64 pattern $mSDL_ICONV_EINVAL :: forall {r}. Word64 -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_ICONV_EINVAL :: Word64 SDL_ICONV_EINVAL = 18446744073709551612