changes to disable dmon

This commit is contained in:
George Sokianos 2022-02-05 15:54:58 +00:00
parent b5831ace20
commit decd5deeae
2 changed files with 10 additions and 7 deletions

View File

@ -14,6 +14,8 @@
#include <fileapi.h> #include <fileapi.h>
#elif __linux__ #elif __linux__
#include <sys/vfs.h> #include <sys/vfs.h>
#elif __amigaos4__
#include "platform/amigaos4.h"
#endif #endif
extern SDL_Window *window; extern SDL_Window *window;
@ -798,7 +800,6 @@ static int f_watch_dir(lua_State *L) {
const char *path = luaL_checkstring(L, 1); const char *path = luaL_checkstring(L, 1);
const int recursive = lua_toboolean(L, 2); const int recursive = lua_toboolean(L, 2);
// uint32_t dmon_flags = (recursive ? DMON_WATCHFLAGS_RECURSIVE : 0); // uint32_t dmon_flags = (recursive ? DMON_WATCHFLAGS_RECURSIVE : 0);
uint32_t dmon_flags = 0;
// dmon_watch_id watch_id = dmon_watch(path, dirmonitor_watch_callback, dmon_flags, NULL); // dmon_watch_id watch_id = dmon_watch(path, dirmonitor_watch_callback, dmon_flags, NULL);
// if (watch_id.id == 0) { luaL_error(L, "directory monitoring watch failed"); } // if (watch_id.id == 0) { luaL_error(L, "directory monitoring watch failed"); }
// lua_pushnumber(L, watch_id.id); // lua_pushnumber(L, watch_id.id);

View File

@ -3,9 +3,11 @@
#include <SDL.h> #include <SDL.h>
#ifndef __amigaos4__
#define DMON_IMPL #define DMON_IMPL
#include "dmon.h" #include "dmon.h"
#include "dmon_extra.h" #include "dmon_extra.h"
#endif
#include "dirmonitor.h" #include "dirmonitor.h"
@ -32,14 +34,14 @@ static void send_sdl_event(dmon_watch_id watch_id, dmon_action action, const cha
} }
void dirmonitor_init() { void dirmonitor_init() {
dmon_init(); //dmon_init();
/* In theory we should register our user event but since we /* In theory we should register our user event but since we
have just one type of user event this is not really needed. */ have just one type of user event this is not really needed. */
/* sdl_dmon_event_type = SDL_RegisterEvents(1); */ /* sdl_dmon_event_type = SDL_RegisterEvents(1); */
} }
void dirmonitor_deinit() { void dirmonitor_deinit() {
dmon_deinit(); //dmon_deinit();
} }
void dirmonitor_watch_callback(dmon_watch_id watch_id, dmon_action action, const char *rootdir, void dirmonitor_watch_callback(dmon_watch_id watch_id, dmon_action action, const char *rootdir,
@ -49,11 +51,11 @@ void dirmonitor_watch_callback(dmon_watch_id watch_id, dmon_action action, const
(void) user; (void) user;
switch (action) { switch (action) {
case DMON_ACTION_MOVE: case DMON_ACTION_MOVE:
send_sdl_event(watch_id, DMON_ACTION_DELETE, oldfilepath); //send_sdl_event(watch_id, DMON_ACTION_DELETE, oldfilepath);
send_sdl_event(watch_id, DMON_ACTION_CREATE, filepath); //send_sdl_event(watch_id, DMON_ACTION_CREATE, filepath);
break; break;
default: //default:
send_sdl_event(watch_id, action, filepath); //send_sdl_event(watch_id, action, filepath);
} }
} }