|
|
|
@ -10,13 +10,7 @@ module Linux.TXML |
|
|
|
, LogLevel(..) |
|
|
|
, LogLevel(..) |
|
|
|
) where |
|
|
|
) where |
|
|
|
|
|
|
|
|
|
|
|
import qualified Data.ByteString.Char8 as BS |
|
|
|
import qualified Data.Text as T |
|
|
|
import qualified Data.Text as T |
|
|
|
|
|
|
|
import Data.Text.Encoding |
|
|
|
|
|
|
|
import Data.Text.Encoding.Error |
|
|
|
|
|
|
|
import Foreign.C.String |
|
|
|
|
|
|
|
import Foreign.C.Types |
|
|
|
|
|
|
|
import Foreign.Ptr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data LogLevel = |
|
|
|
data LogLevel = |
|
|
|
Debug |
|
|
|
Debug |
|
|
|
@ -24,20 +18,20 @@ data LogLevel = |
|
|
|
| Warning |
|
|
|
| Warning |
|
|
|
deriving (Show, Eq, Ord) |
|
|
|
deriving (Show, Eq, Ord) |
|
|
|
|
|
|
|
|
|
|
|
newtype Callback = Callback { unCallback :: FunPtr (CString -> IO CBool)} |
|
|
|
data Callback = Callback |
|
|
|
|
|
|
|
|
|
|
|
initialize :: FilePath -> LogLevel -> IO (Either T.Text ()) |
|
|
|
initialize :: FilePath -> LogLevel -> IO (Either T.Text ()) |
|
|
|
initialize fp loglevel = return (Right ()) |
|
|
|
initialize _ _ = return (Right ()) |
|
|
|
|
|
|
|
|
|
|
|
uninitialize :: IO (Either T.Text ()) |
|
|
|
uninitialize :: IO (Either T.Text ()) |
|
|
|
uninitialize = return (Right ()) |
|
|
|
uninitialize = return (Right ()) |
|
|
|
|
|
|
|
|
|
|
|
sendCommand :: T.Text -> IO (Either T.Text ()) |
|
|
|
sendCommand :: T.Text -> IO (Either T.Text ()) |
|
|
|
sendCommand cmdData = return (Right ()) |
|
|
|
sendCommand _ = return (Right ()) |
|
|
|
|
|
|
|
|
|
|
|
setCallback :: (T.Text -> IO Bool) -> IO (Maybe Callback) |
|
|
|
setCallback :: (T.Text -> IO Bool) -> IO (Maybe Callback) |
|
|
|
setCallback callback = return Nothing |
|
|
|
setCallback _ = return . Just $ Callback |
|
|
|
|
|
|
|
|
|
|
|
freeCallback :: Callback -> IO () |
|
|
|
freeCallback :: Callback -> IO () |
|
|
|
freeCallback = freeHaskellFunPtr . unCallback |
|
|
|
freeCallback _ = return () |
|
|
|
|
|
|
|
|
|
|
|
|