Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type RValue = Ptr CULong
- type RID = CULong
- data ShimDispatch = ShimDispatch RValue RID [RValue]
- data RBuiltin
- data RType
- type Registered0 = IO RValue
- type Registered1 = RValue -> IO RValue
- type Registered2 = RValue -> RValue -> IO RValue
- mkRegistered0 :: Registered0 -> IO (FunPtr Registered0)
- mkRegistered1 :: Registered1 -> IO (FunPtr Registered1)
- mkRegistered2 :: Registered2 -> IO (FunPtr Registered2)
- type RegisteredCB3 = RValue -> RValue -> RValue -> IO Int
- mkRegisteredCB3 :: RegisteredCB3 -> IO (FunPtr RegisteredCB3)
- ruby_finalize :: IO ()
- ruby_initialization :: IO ()
- c_rb_str_new2 :: CString -> IO RValue
- rb_ary_new2 :: CLong -> IO RValue
- rb_ary_new4 :: CLong -> Ptr RValue -> IO RValue
- c_rb_load_protect :: RValue -> Int -> Ptr Int -> IO ()
- c_rb_funcall_0 :: RValue -> RID -> Int -> IO RValue
- c_rb_funcall_1 :: RValue -> RID -> Int -> RValue -> IO RValue
- c_rb_funcall_2 :: RValue -> RID -> Int -> RValue -> RValue -> IO RValue
- c_rb_funcall_3 :: RValue -> RID -> Int -> RValue -> RValue -> RValue -> IO RValue
- c_rb_funcall_4 :: RValue -> RID -> Int -> RValue -> RValue -> RValue -> RValue -> IO RValue
- c_rb_funcall_5 :: RValue -> RID -> Int -> RValue -> RValue -> RValue -> RValue -> RValue -> IO RValue
- c_rb_funcall_with_block :: RValue -> RID -> Int -> Ptr RValue -> RValue -> IO RValue
- c_rb_gv_get :: CString -> IO RValue
- c_rb_intern :: CString -> IO RID
- rb_id2name :: RID -> IO CString
- c_rb_string_value_ptr :: Ptr RValue -> IO CString
- rb_cObject :: Ptr RValue
- c_rb_iv_set :: RValue -> CString -> RValue -> IO RValue
- c_rb_define_class :: CString -> RValue -> IO RValue
- c_rb_define_method :: RValue -> CString -> FunPtr a -> Int -> IO ()
- c_rb_define_singleton_method :: RValue -> CString -> FunPtr a -> Int -> IO ()
- c_rb_define_module_function :: RValue -> CString -> FunPtr a -> Int -> IO ()
- c_rb_define_global_function :: CString -> FunPtr a -> Int -> IO ()
- rb_const_get :: RValue -> RID -> IO RValue
- safeCallback :: FunPtr (RValue -> IO RValue)
- getRubyCObjectCallback :: FunPtr (RValue -> IO RValue)
- c_rb_protect :: FunPtr (RValue -> IO RValue) -> RValue -> Ptr Int -> IO RValue
- c_rb_string_value_cstr :: Ptr RValue -> IO CString
- rb_ary_new :: IO RValue
- rb_ary_push :: RValue -> RValue -> IO RValue
- rb_ary_entry :: RValue -> CLong -> IO RValue
- rb_hash_foreach :: RValue -> FunPtr a -> RValue -> IO ()
- rb_big2str :: RValue -> CInt -> IO RValue
- rb_cstr_to_inum :: CString -> CInt -> CInt -> IO RValue
- newFloat :: Double -> IO RValue
- rb_hash_new :: IO RValue
- rb_hash_aset :: RValue -> RValue -> RValue -> IO RValue
- c_rb_define_module :: CString -> IO ()
- arrayLength :: RValue -> IO CLong
- rubyType :: RValue -> IO CInt
- num2dbl :: RValue -> IO Double
- int2num :: CLong -> IO RValue
- num2long :: RValue -> IO CLong
- id2sym :: RID -> RValue
- sym2id :: RValue -> RID
- rbFalse :: RValue
- rbTrue :: RValue
- rbNil :: RValue
- rbUndef :: RValue
- rtype :: RValue -> IO RType
- rb_string_value_cstr :: RValue -> IO String
- rb_define_global_function :: String -> FunPtr a -> Int -> IO ()
- rb_define_method :: RValue -> String -> FunPtr a -> Int -> IO ()
- rb_define_singleton_method :: RValue -> String -> FunPtr a -> Int -> IO ()
- rb_define_module_function :: RValue -> String -> FunPtr a -> Int -> IO ()
- rb_define_class :: String -> RValue -> IO RValue
- rb_str_new2 :: String -> IO RValue
- rb_define_module :: String -> IO ()
- rb_iv_set :: RValue -> String -> RValue -> IO RValue
- rb_load_protect :: String -> Int -> IO Int
- rb_funcall :: RValue -> RID -> [RValue] -> IO RValue
- rbMethodCall :: String -> String -> [RValue] -> IO RValue
- getClass :: String -> IO RValue
- rb_gv_get :: String -> IO RValue
- rb_intern :: String -> IO RID
- rb_string_value_ptr :: RValue -> IO String
Documentation
type RValue = Ptr CULong Source #
This is the type of Ruby values. It is defined as a pointer to some unsigned long, just like Ruby does. The actual value is either pointed to, or encoded in the pointer.
data ShimDispatch Source #
Instances
Storable ShimDispatch Source # | |
Defined in Foreign.Ruby.Bindings sizeOf :: ShimDispatch -> Int # alignment :: ShimDispatch -> Int # peekElemOff :: Ptr ShimDispatch -> Int -> IO ShimDispatch # pokeElemOff :: Ptr ShimDispatch -> Int -> ShimDispatch -> IO () # peekByteOff :: Ptr b -> Int -> IO ShimDispatch # pokeByteOff :: Ptr b -> Int -> ShimDispatch -> IO () # peek :: Ptr ShimDispatch -> IO ShimDispatch # poke :: Ptr ShimDispatch -> ShimDispatch -> IO () # |
The ruby built-in types
Ruby native types, as encoded in the Value type.
type Registered0 = IO RValue Source #
mkRegistered0 :: Registered0 -> IO (FunPtr Registered0) Source #
Creates a function pointer suitable for usage with rb_define_global_function
of type Registered0
(with 0 arguments).
mkRegistered1 :: Registered1 -> IO (FunPtr Registered1) Source #
Creates a function pointer suitable for usage with rb_define_global_function
of type Registered1
(with 1 RValue
arguments).
mkRegistered2 :: Registered2 -> IO (FunPtr Registered2) Source #
Creates a function pointer suitable for usage with rb_define_global_function
of type Registered2
(with 2 RValue
arguments).
mkRegisteredCB3 :: RegisteredCB3 -> IO (FunPtr RegisteredCB3) Source #
ruby_finalize :: IO () Source #
ruby_initialization :: IO () Source #
c_rb_funcall_4 :: RValue -> RID -> Int -> RValue -> RValue -> RValue -> RValue -> IO RValue Source #
c_rb_funcall_5 :: RValue -> RID -> Int -> RValue -> RValue -> RValue -> RValue -> RValue -> IO RValue Source #
rb_cObject :: Ptr RValue Source #
rb_ary_new :: IO RValue Source #
rb_hash_new :: IO RValue Source #
c_rb_define_module :: CString -> IO () Source #
rb_define_global_function Source #
:: String | Name of the function |
-> FunPtr a | Pointer to the function (created with something like |
-> Int | Number of arguments the function accepts. |
-> IO () |
Defines a global function that can be called from the Ruby world. This function must only accept RValue
s as arguments.
:: RValue | Object to which a method is added |
-> String | Name of the method |
-> FunPtr a | Pointer to the Haskell function (created with something like |
-> Int |
|
-> IO () |
Defines an instance method.
The Haskell function must accept the receiver as the first argument.
If argc >= 0
, the type of the arguments of the function must be RValue
.
rb_define_singleton_method :: RValue -> String -> FunPtr a -> Int -> IO () Source #
Defines a singleton method.
Arguments are the same as rb_define_method
.
rb_define_module_function :: RValue -> String -> FunPtr a -> Int -> IO () Source #
Defines a module function (module_function
) to a module.
Arguments are the same as rb_define_method
.
rb_define_module :: String -> IO () Source #
:: RValue | The object |
-> String | The variable name (without the @) |
-> RValue | The value to set |
-> IO RValue | The value you just set |
Sets an instance variable