Merge branch 'master' of git://factorcode.org/git/factor

db4
Bruno Deferrari 2008-06-09 17:41:15 -03:00
commit 95f4184741
2 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@ TUPLE: linux-monitor < monitor wd inotify watches disposed ;
: <inotify> ( -- port/f )
inotify_init dup 0 < [ drop f ] [ <fd> <input-port> ] if ;
: inotify-fd inotify get handle>> handle-fd ;
: inotify-fd ( -- fd ) inotify get handle>> handle-fd ;
: check-existing ( wd -- )
watches get key? [
@ -41,7 +41,7 @@ TUPLE: linux-monitor < monitor wd inotify watches disposed ;
[ (add-watch) ] [ drop ] 2bi r>
<linux-monitor> [ ] [ ] [ wd>> ] tri watches get set-at ;
: check-inotify
: check-inotify ( -- )
inotify get [
"Calling <monitor> outside with-monitors" throw
] unless ;

View File

@ -28,8 +28,8 @@ C-STRUCT: inotify-event
: IN_Q_OVERFLOW HEX: 4000 ; inline ! Event queued overflowed
: IN_IGNORED HEX: 8000 ; inline ! File was ignored
: IN_CLOSE IN_CLOSE_WRITE IN_CLOSE_NOWRITE bitor ; inline ! close
: IN_MOVE IN_MOVED_FROM IN_MOVED_TO bitor ; inline ! moves
: IN_CLOSE ( -- n ) IN_CLOSE_WRITE IN_CLOSE_NOWRITE bitor ; inline ! close
: IN_MOVE ( -- n ) IN_MOVED_FROM IN_MOVED_TO bitor ; inline ! moves
: IN_ONLYDIR HEX: 1000000 ; inline ! only watch the path if it is a directory
: IN_DONT_FOLLOW HEX: 2000000 ; inline ! don't follow a sym link
@ -37,14 +37,14 @@ C-STRUCT: inotify-event
: IN_ISDIR HEX: 40000000 ; inline ! event occurred against dir
: IN_ONESHOT HEX: 80000000 ; inline ! only send event once
: IN_CHANGE_EVENTS
: IN_CHANGE_EVENTS ( -- n )
{
IN_MODIFY IN_ATTRIB IN_MOVED_FROM
IN_MOVED_TO IN_DELETE IN_CREATE IN_DELETE_SELF
IN_MOVE_SELF
} flags ; foldable
: IN_ALL_EVENTS
: IN_ALL_EVENTS ( -- n )
{
IN_ACCESS IN_MODIFY IN_ATTRIB IN_CLOSE_WRITE
IN_CLOSE_NOWRITE IN_OPEN IN_MOVED_FROM