{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module Cachix.Client.Store.Context where
import qualified Data.Map as M
import qualified Language.C.Inline.Context as C
import qualified Language.C.Inline.Cpp as C
import qualified Language.C.Types as C
import Protolude hiding (Set)
data Ref a
type PathSet = Set CxxString
data NixStore
data ValidPathInfo
data Set a
data Iterator a
data CxxString
context :: C.Context
context :: Context
context =
Context
C.cppCtx Context -> Context -> Context
forall a. Semigroup a => a -> a -> a
<> Context
C.fptrCtx Context -> Context -> Context
forall a. Semigroup a => a -> a -> a
<> Context
C.bsCtx
Context -> Context -> Context
forall a. Semigroup a => a -> a -> a
<> Context
forall a. Monoid a => a
mempty
{ ctxTypesTable :: TypesTable
C.ctxTypesTable =
TypeSpecifier -> TypeQ -> TypesTable
forall k a. k -> a -> Map k a
M.singleton (CIdentifier -> TypeSpecifier
C.TypeName "refStore") [t|Ref NixStore|]
TypesTable -> TypesTable -> TypesTable
forall a. Semigroup a => a -> a -> a
<> TypeSpecifier -> TypeQ -> TypesTable
forall k a. k -> a -> Map k a
M.singleton
(CIdentifier -> TypeSpecifier
C.TypeName "refValidPathInfo")
[t|Ref ValidPathInfo|]
TypesTable -> TypesTable -> TypesTable
forall a. Semigroup a => a -> a -> a
<> TypeSpecifier -> TypeQ -> TypesTable
forall k a. k -> a -> Map k a
M.singleton (CIdentifier -> TypeSpecifier
C.TypeName "PathSet") [t|PathSet|]
TypesTable -> TypesTable -> TypesTable
forall a. Semigroup a => a -> a -> a
<> TypeSpecifier -> TypeQ -> TypesTable
forall k a. k -> a -> Map k a
M.singleton (CIdentifier -> TypeSpecifier
C.TypeName "PathSetIterator") [t|Iterator PathSet|]
}