summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test.c b/test/test.c
index bf1654b..0b2f680 100644
--- a/test/test.c
+++ b/test/test.c
@@ -15,11 +15,12 @@ aki_thread_result AKI_THREADCALL test_thread(void *userdata)
static struct aki_event_loop loop;
-static void line_callback(void *userdata, str *line)
+static u8 line_callback(void *userdata, str *line)
{
(void)userdata;
al_printf("%.*s\n", AL_STR_PRINTF(line));
- if (al_str_eq(line, al_str_c("quit"))) aki_event_loop_break(&loop);
+ if (al_str_eq(line, al_str_c("quit"))) return AKI_LINE_PROCESSOR_STOP;
+ return AKI_LINE_PROCESSOR_CONTINUE;
}
static void timer_callback(void *userdata, struct aki_timer *timer)
@@ -34,9 +35,11 @@ s32 main(void)
aki_event_loop_init(&loop);
+ /*
struct aki_timer timer;
aki_timer_init(&timer, &loop, 1.0, timer_callback, NULL);
aki_timer_again(&timer);
+ */
/*
struct aki_thread thread;
@@ -45,14 +48,12 @@ s32 main(void)
*/
#ifndef _WIN32
- /*
struct aki_line_processor pro;
pro.callback = line_callback;
pro.userdata = NULL;
aki_line_processor_init(&pro, al_str_c("\n"));
aki_line_processor_open_fd(&pro, STDIN_FILENO);
aki_line_processor_run(&pro, &loop);
- */
#endif
aki_event_loop_run(&loop);