aboutsummaryrefslogtreecommitdiff
path: root/hsm-cam/Hsm/Cam/Lib.hsc
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-03-17 01:01:51 +0000
committerPaul Oliver <contact@pauloliver.dev>2025-03-17 01:39:21 +0000
commit234d21167e5ca45b8a2665df52dcf0cdb48f3dc0 (patch)
tree9884e1706763fc70db9480472ba87a75da9cd9b8 /hsm-cam/Hsm/Cam/Lib.hsc
parent0be7f1274e0cb8406bd4262b86d5e2e9dda77d7a (diff)
(WIP) Camera serviceHEADmaster
Diffstat (limited to 'hsm-cam/Hsm/Cam/Lib.hsc')
-rw-r--r--hsm-cam/Hsm/Cam/Lib.hsc20
1 files changed, 20 insertions, 0 deletions
diff --git a/hsm-cam/Hsm/Cam/Lib.hsc b/hsm-cam/Hsm/Cam/Lib.hsc
new file mode 100644
index 0000000..4f6dadf
--- /dev/null
+++ b/hsm-cam/Hsm/Cam/Lib.hsc
@@ -0,0 +1,20 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE OverloadedStrings #-}
+
+module Hsm.Cam.Lib
+ ( someCWrapper
+ ) where
+
+import Control.Monad ((>=>))
+import Data.Text (pack)
+import Foreign.C.String (CString, peekCString)
+import Hsm.Log qualified as L
+
+foreign export ccall logMsg :: CString -> IO ()
+
+logMsg :: CString -> IO ()
+logMsg = peekCString >=> L.logMsg ["cam", "lib"] . pack
+
+foreign import ccall safe "Test.h some_c_wrapper"
+ someCWrapper :: IO ()