{-# LINE 1 "Magic/TypesLL.hsc" #-} {- -*- Mode: haskell; -*- Haskell magic Interface Copyright (C) 2005 John Goerzen <jgoerzen@complete.org> This code is under a 3-clause BSD license; see COPYING for details. -} {- | Module : Magic.TypesLL Copyright : Copyright (C) 2005 John Goerzen License : BSD Maintainer : Joey Hess, Maintainer : id\@joeyh.name Stability : provisional Portability: portable Low-Types for magic programs. Written by John Goerzen, jgoerzen\@complete.org -} module Magic.TypesLL(CMagic, Magic(..)) where import Foreign.ForeignPtr import Control.Concurrent.MVar data CMagic {- | Main Magic handle. Magic handles are automatically closed (and memory freed) when they are garbage-collected by Haskell. There is no need to explicitly close them. Access to the C library is serialized, so multiple threads may safely use the same Magic handle. -} newtype Magic = Magic (MVar (ForeignPtr CMagic))