Copyright | (c) Sergey Vinokurov 2018 |
---|---|
License | Apache-2.0 (see LICENSE) |
Maintainer | serg.foo@gmail.com |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data Env
- data FuncallExit a
- funcallExitToNum :: Num a => FuncallExit b -> a
- funcallExitFromNum :: (Eq a, Num a) => a -> Maybe (FuncallExit ())
- newtype EnumFuncallExit = EnumFuncallExit {}
- isValidEnv :: MonadIO m => Env -> m Bool
- makeGlobalRef :: forall m p. MonadIO m => Env -> RawValue p -> m (RawValue 'Pinned)
- freeGlobalRef :: forall m. MonadIO m => Env -> RawValue 'Pinned -> m ()
- nonLocalExitCheck :: MonadIO m => Env -> m EnumFuncallExit
- nonLocalExitGet :: MonadIO m => Env -> NonNullPtr (RawValue 'Regular) -> NonNullPtr (RawValue 'Regular) -> m EnumFuncallExit
- nonLocalExitSignal :: MonadIO m => Env -> RawValue p1 -> RawValue p2 -> m ()
- nonLocalExitThrow :: MonadIO m => Env -> RawValue p1 -> RawValue p2 -> m ()
- nonLocalExitClear :: MonadIO m => Env -> m ()
- variadicFunctionArgs :: CPtrdiff
- makeFunction :: forall m o a. MonadIO m => Env -> CPtrdiff -> CPtrdiff -> RawFunction o a -> CString -> Ptr a -> m (RawValue 'Regular)
- funcall :: MonadIO m => Env -> RawValue p1 -> CPtrdiff -> NonNullPtr (RawValue p2) -> m (RawValue 'Regular)
- funcallPrimitive :: MonadIO m => Env -> RawValue p1 -> CPtrdiff -> NonNullPtr (RawValue p2) -> m (RawValue 'Regular)
- intern :: MonadIO m => Env -> CString -> m (RawValue 'Regular)
- typeOf :: MonadIO m => Env -> RawValue p -> m (RawValue 'Regular)
- isNotNil :: MonadIO m => Env -> RawValue p -> m CBoolean
- eq :: MonadIO m => Env -> RawValue p1 -> RawValue p2 -> m CBoolean
- extractInteger :: MonadIO m => Env -> RawValue p -> m CIntMax
- makeInteger :: MonadIO m => Env -> CIntMax -> m (RawValue 'Regular)
- extractFloat :: MonadIO m => Env -> RawValue p -> m CDouble
- makeFloat :: MonadIO m => Env -> CDouble -> m (RawValue 'Regular)
- copyStringContents :: MonadIO m => Env -> RawValue p -> CString -> NonNullPtr CPtrdiff -> m CBoolean
- makeString :: MonadIO m => Env -> CString -> CPtrdiff -> m (RawValue 'Regular)
- makeUserPtr :: forall m a. MonadIO m => Env -> FinalizerPtr a -> Ptr a -> m (RawValue 'Regular)
- getUserPtr :: MonadIO m => Env -> RawValue p -> m (Ptr a)
- setUserPtr :: MonadIO m => Env -> RawValue p -> Ptr a -> m ()
- getUserFinaliser :: MonadIO m => Env -> RawValue p -> m (FinalizerPtr a)
- setUserFinaliser :: MonadIO m => Env -> RawValue p -> FinalizerPtr a -> m ()
- vecGet :: MonadIO m => Env -> RawValue p -> CPtrdiff -> m (RawValue 'Regular)
- vecSet :: MonadIO m => Env -> RawValue p1 -> CPtrdiff -> RawValue p2 -> m ()
- vecSize :: MonadIO m => Env -> RawValue p -> m CPtrdiff
- exportToEmacs :: RawFunctionType o a -> IO (RawFunction o a)
- type RawFunctionType o a = Ptr Environment -> CPtrdiff -> Ptr (RawValue 'Regular) -> Ptr a -> IO (RawValue o)
- data RawFunction o a
- freeStablePtrFinaliser :: FinalizerPtr a
Documentation
enum emacs_funcall_exit
data FuncallExit a Source #
Possible Emacs function call outcomes. This is Haskell's version of
FuncallExitReturn | Function has returned normally. |
FuncallExitSignal a | Function has signaled an error using |
FuncallExitThrow a | Function has exit using |
Instances
funcallExitToNum :: Num a => FuncallExit b -> a Source #
funcallExitFromNum :: (Eq a, Num a) => a -> Maybe (FuncallExit ()) Source #
Wrappers around struct emacs_env fields
newtype EnumFuncallExit Source #
Instances
Pretty EnumFuncallExit Source # | |
Defined in Data.Emacs.Module.Raw.Env pretty :: EnumFuncallExit -> Doc ann # prettyList :: [EnumFuncallExit] -> Doc ann # |
isValidEnv :: MonadIO m => Env -> m Bool Source #
Check wheter passed emacs_env
structure has expected size so that
we will be able to access all of its fields.
makeGlobalRef :: forall m p. MonadIO m => Env -> RawValue p -> m (RawValue 'Pinned) Source #
freeGlobalRef :: forall m. MonadIO m => Env -> RawValue 'Pinned -> m () Source #
nonLocalExitCheck :: MonadIO m => Env -> m EnumFuncallExit Source #
:: MonadIO m | |
=> Env | |
-> NonNullPtr (RawValue 'Regular) | Symbol output |
-> NonNullPtr (RawValue 'Regular) | Data output |
-> m EnumFuncallExit |
nonLocalExitClear :: MonadIO m => Env -> m () Source #
:: MonadIO m | |
=> Env | |
-> RawValue p1 | Function |
-> CPtrdiff | Number of arguments |
-> NonNullPtr (RawValue p2) | Actual arguments |
-> m (RawValue 'Regular) |
:: MonadIO m | |
=> Env | |
-> RawValue p1 | Function |
-> CPtrdiff | Number of arguments |
-> NonNullPtr (RawValue p2) | Actual arguments |
-> m (RawValue 'Regular) |
:: MonadIO m | |
=> Env | |
-> RawValue p | Emacs value that holds a string |
-> CString | Destination, may be NULL |
-> NonNullPtr CPtrdiff | SIZE pointer |
-> m CBoolean |
Copy the content of the Lisp string VALUE to BUFFER as an utf8 null-terminated string.
SIZE must point to the total size of the buffer. If BUFFER is NULL or if SIZE is not big enough, write the required buffer size to SIZE and return true.
Note that SIZE must include the last null byte (e.g. "abc" needs a buffer of size 4).
Return true if the string was successfully copied.
makeUserPtr :: forall m a. MonadIO m => Env -> FinalizerPtr a -> Ptr a -> m (RawValue 'Regular) Source #
getUserFinaliser :: MonadIO m => Env -> RawValue p -> m (FinalizerPtr a) Source #
setUserFinaliser :: MonadIO m => Env -> RawValue p -> FinalizerPtr a -> m () Source #
Expose functions to Emacs
exportToEmacs :: RawFunctionType o a -> IO (RawFunction o a) Source #
Take Haskell function and return C pointer to function (which
ideally needs to be cleaned up later by freeHaskellFunPtrWrapped
).
type RawFunctionType o a = Ptr Environment -> CPtrdiff -> Ptr (RawValue 'Regular) -> Ptr a -> IO (RawValue o) Source #
data RawFunction o a Source #
Pointer to a function that may later be called by by Emacs.
Instances
Show (RawFunction o a) Source # | |
Defined in Data.Emacs.Module.Raw.Env.Internal showsPrec :: Int -> RawFunction o a -> ShowS # show :: RawFunction o a -> String # showList :: [RawFunction o a] -> ShowS # | |
Eq (RawFunction o a) Source # | |
Defined in Data.Emacs.Module.Raw.Env.Internal (==) :: RawFunction o a -> RawFunction o a -> Bool # (/=) :: RawFunction o a -> RawFunction o a -> Bool # | |
Ord (RawFunction o a) Source # | |
Defined in Data.Emacs.Module.Raw.Env.Internal compare :: RawFunction o a -> RawFunction o a -> Ordering # (<) :: RawFunction o a -> RawFunction o a -> Bool # (<=) :: RawFunction o a -> RawFunction o a -> Bool # (>) :: RawFunction o a -> RawFunction o a -> Bool # (>=) :: RawFunction o a -> RawFunction o a -> Bool # max :: RawFunction o a -> RawFunction o a -> RawFunction o a # min :: RawFunction o a -> RawFunction o a -> RawFunction o a # |
Expose Haskell data to Emacs
freeStablePtrFinaliser :: FinalizerPtr a Source #
Pass to makeUserPtr
so that Emacs will free the Haskell's stable
pointer when the corresponding elisp value goes out of scope.