From 815e177beb1aef02db950e315f8b90cc5412c370 Mon Sep 17 00:00:00 2001 From: janwas Date: Mon, 7 Jun 2004 00:04:02 +0000 Subject: [PATCH] now responsible for watching mountings for changes via FAM This was SVN commit r406. --- source/lib/res/res.cpp | 13 +++++++++++-- source/lib/res/res.h | 6 +++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/source/lib/res/res.cpp b/source/lib/res/res.cpp index bac36a189a..5dc3bcbb07 100755 --- a/source/lib/res/res.cpp +++ b/source/lib/res/res.cpp @@ -19,7 +19,7 @@ static FAMConnection fc; static bool initialized; -int res_watch_dir(const char* const dir) +int res_mount(const char* const mount_point, const char* const name, const uint pri) { if(!initialized) { @@ -28,7 +28,16 @@ int res_watch_dir(const char* const dir) initialized = true; } - // + CHECK_ERR(vfs_mount(mount_point, name, pri)); + + // if is directory + // get full path + // convert to native + + static FAMRequest req; + FAMMonitorDirectory(&fc, "d:\\projects\\0ad\\cvs\\binaries\\data\\mods\\official\\", &req, 0); +//FAMCancelMonitor(&fc, &req); + // add request somewhere - have to be able to cancel watch return 0; } diff --git a/source/lib/res/res.h b/source/lib/res/res.h index c7b3e765c9..304dd74d08 100755 --- a/source/lib/res/res.h +++ b/source/lib/res/res.h @@ -7,6 +7,10 @@ extern int res_reload(const char* fn); -extern int res_watch_dir(const char* dir); + +// the following functions must be called from the same thread! +// (wfam limitation) + +extern int res_mount(const char* mount_point, const char* name, uint pri); extern int res_reload_changed_files(); \ No newline at end of file