-- GENERATED by C->Haskell Compiler, version 0.20.1 The shapeless maps, 31 Oct 2014 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/Data/ABC/Internal/Orphan.chs" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{- |
Module      : Data.ABC.Internal.Orphan
Copyright   : Galois, Inc. 2010
License     : BSD3
Maintainer  : jhendrix@galois.com
Stability   : experimental
Portability : non-portable (language extensions)

/Incomplete./ Binding of various orphan functions in ABC:
functions that are frequently extern'ed into scope but are not
defined in any header; we've created a new header file @orphan.h@
to accomodate these.

-}

module Data.ABC.Internal.Orphan
    ( abcNtkFromAigPhase
    -- * base\/abci\/abcDar.c
    , abcNtkToDar
    ) where

import Foreign (fromBool)
import Foreign.C

import Data.ABC.Internal.ABC
{-# LINE 26 "src/Data/ABC/Internal/Orphan.chs" #-}

import Data.ABC.Internal.AIG
{-# LINE 27 "src/Data/ABC/Internal/Orphan.chs" #-}






abcNtkToDar :: Abc_Ntk_t -> Bool -> Bool -> IO Aig_Man_t
abcNtkToDar ntk exors rl =
  abcNtkToDar' ntk (fromBool exors) (fromBool rl)

foreign import ccall unsafe "Abc_NtkToDar"
  abcNtkToDar' :: Abc_Ntk_t -> CInt -> CInt -> IO Aig_Man_t

abcNtkFromAigPhase :: (Aig_Man_t) -> IO ((Abc_Ntk_t))
abcNtkFromAigPhase a1 =
  let {a1' = id a1} in 
  abcNtkFromAigPhase'_ a1' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 40 "src/Data/ABC/Internal/Orphan.chs" #-}


foreign import ccall safe "Data/ABC/Internal/Orphan.chs.h Abc_NtkFromAigPhase"
  abcNtkFromAigPhase'_ :: ((Aig_Man_t) -> (IO (Abc_Ntk_t)))