diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/test.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/test/test.c b/test/test.c index 0b2f680..60799e6 100644 --- a/test/test.c +++ b/test/test.c @@ -1,7 +1,9 @@ #include <aki/common.h> #include <aki/thread.h> -#include <aki/line_processor.h> -#include <aki/timer.h> +#include <aki/event_loop.h> +#include <aki/fs_event.h> +//#include <aki/line_processor.h> +//#include <aki/timer.h> aki_thread_result AKI_THREADCALL test_thread(void *userdata) { @@ -15,6 +17,7 @@ aki_thread_result AKI_THREADCALL test_thread(void *userdata) static struct aki_event_loop loop; +/* static u8 line_callback(void *userdata, str *line) { (void)userdata; @@ -28,6 +31,12 @@ static void timer_callback(void *userdata, struct aki_timer *timer) printf("Yo\n"); aki_timer_again(timer); } +*/ + +static void fs_event_callback(void *userdata, struct inotify_event *event) +{ + al_printf("%i\n", event->mask); +} s32 main(void) { @@ -35,18 +44,22 @@ s32 main(void) aki_event_loop_init(&loop); + struct aki_fs_event fs_event; + aki_fs_event_init(&fs_event, al_str_c("/home/andrew/.config/taro/DP-3/selection"), IN_CLOSE_WRITE, + fs_event_callback, NULL); + aki_fs_event_start(&fs_event, &loop); + /* struct aki_timer timer; aki_timer_init(&timer, &loop, 1.0, timer_callback, NULL); aki_timer_again(&timer); */ - /* - struct aki_thread thread; - aki_thread_create(&thread, test_thread, NULL); - aki_thread_join(&thread); - */ + //struct aki_thread thread; + //aki_thread_create(&thread, test_thread, NULL); + //aki_thread_join(&thread); +/* #ifndef _WIN32 struct aki_line_processor pro; pro.callback = line_callback; @@ -55,8 +68,10 @@ s32 main(void) aki_line_processor_open_fd(&pro, STDIN_FILENO); aki_line_processor_run(&pro, &loop); #endif +*/ aki_event_loop_run(&loop); + aki_event_loop_destroy(&loop); aki_common_close(); |