aboutsummaryrefslogtreecommitdiff
path: root/Inotify.icl
diff options
context:
space:
mode:
Diffstat (limited to 'Inotify.icl')
-rw-r--r--Inotify.icl11
1 files changed, 7 insertions, 4 deletions
diff --git a/Inotify.icl b/Inotify.icl
index cd927fe..20ce3e9 100644
--- a/Inotify.icl
+++ b/Inotify.icl
@@ -26,7 +26,7 @@ import code from "inotify_c.o"
inotify_init :: st -> Maybe *(Inotify st)
inotify_init st
- = let fd = c_init 0 in if (fd < 0) Nothing (Just {fd=fd, watches=[], state=st})
+ = let fd=c_init 0 in if (fd<0) Nothing (Just {fd=fd, watches=[], state=st})
where
c_init :: !Int -> *Int
c_init i = code {
@@ -41,7 +41,8 @@ where
ccall close "I:V:A"
}
-inotify_add_watch :: (INCallback st) !Int !String !*(Inotify st) -> *(Either Int INWatch, *Inotify st)
+inotify_add_watch :: (INCallback st) !Int !String !*(Inotify st)
+ -> *(Either Int INWatch, *Inotify st)
inotify_add_watch f mask fname inot=:{fd,watches}
= let (w, fd`) = c_add_watch fd fname mask in
( if (w == -1) (Left errno) (Right w)
@@ -83,9 +84,11 @@ inotify_check inot=:{fd,watches,state} w
# (fd,st,w`) = seq (map (check wdsmasks) watches) (inot.fd, state, w)
= ({ inot & fd=fd, state=st }, w`)
where
- check :: [(Int,Int)] (INWatch, INCallback st) *(*Int, st, *World) -> *(*Int, st, *World)
+ check :: [(Int,Int)] (INWatch, INCallback st) *(*Int, st, *World)
+ -> *(*Int, st, *World)
check wdsmasks (watch,f) (fd,st,w)
- # (st,w) = seq [\(st,w) -> f mask st w \\ (wd,mask) <- wdsmasks | wd == watch] (st,w)
+ # (st,w) = seq [\(st,w) -> f mask st w
+ \\ (wd,mask) <- wdsmasks | wd == watch] (st,w)
= (fd,st,w)
bytesToInt :: {#Char} -> Int