File: GArray.hs

package info (click to toggle)
haskell-haskell-gi-base 0.26.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 428 kB
  • sloc: haskell: 1,885; ansic: 324; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 488 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- | Utilities for dealing with `GArray` types.
module Data.GI.Base.GArray
  ( allocGArray
  ) where

import Foreign.C (CInt(..), CUInt(..))
import Foreign.Ptr (Ptr)

import Data.GI.Base.BasicTypes (GArray(..))

-- | Args are zero_terminated, clear_, element_size
foreign import ccall g_array_new :: CInt -> CInt -> CUInt -> IO (Ptr (GArray a))

-- | Allocate a `GArray` with elements of the given size.
allocGArray :: CUInt -> IO (Ptr (GArray a))
allocGArray size = g_array_new 0 1 size