summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2023-12-31 17:29:19 -0500
committerAndrew Opalach <andrew@akon.city> 2023-12-31 17:29:19 -0500
commit842fed76fdb6762e10d1571255229a80c8505b04 (patch)
treea2d46bc3ba63a91cf6ca00d285716a084cd4da8b /test
parentb0f53d634813af0a038d4faf6fa71d90d9aa0845 (diff)
downloadlibnaunet-842fed76fdb6762e10d1571255229a80c8505b04.tar.gz
libnaunet-842fed76fdb6762e10d1571255229a80c8505b04.tar.bz2
libnaunet-842fed76fdb6762e10d1571255229a80c8505b04.zip
Update
- Add aki_poll and aki_fs_event - Various aki_file improvments - Add grow mode to aki_packet_pool - aki_packet_stream_pause/resume -> cork - Misc fixes and improvments Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'test')
-rw-r--r--test/test.c29
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();