 import Foreign
 import Foreign.C.Types
 import System.GPU.OpenCL.Types( 
-  CLEvent, CLint, CLuint, CLulong, CLEventInfo_, CLProfilingInfo_, ErrorCode(..),
-  CLCommandQueue, CLCommandType(..), CLCommandType_, CLCommandExecutionStatus(..), 
-  CLProfilingInfo(..), clSuccess, getCommandType, getCommandExecutionStatus, 
-  getCLValue )
+  CLEvent, CLint, CLuint, CLulong, CLEventInfo_, CLProfilingInfo_, CLError(..),
+  CLCommandQueue, CLCommandType(..), CLCommandType_, 
+  CLCommandExecutionStatus(..), CLProfilingInfo(..), getCommandExecutionStatus, 
+  getCLValue, getEnumCL, wrapCheckSuccess, wrapGetInfo )
 
 #include <CL/cl.h>
 

-- Returns 'True' if the function is executed successfully. It returns 'False' 
-- if event is not a valid event object.
clReleaseEvent :: CLEvent -> IO Bool
clReleaseEvent ev = raw_clReleaseEvent ev
                    >>= return . (==clSuccess) . ErrorCode

#c
enum CLEventInfo {

clWaitForEvents [] = return False
clWaitForEvents xs = allocaArray nevents $ \pevents -> do
  pokeArray pevents xs
  wrapCheckSuccess $ raw_clWaitForEvents (fromIntegral nevents) pevents
    where
      nevents = length xs
  
