/src/test/ftk_test.c
http://ftk.googlecode.com/ · C · 41 lines · 30 code · 11 blank · 0 comment · 0 complexity · 67a386224549e4b3f50ab57f096c4765 MD5 · raw file
- #include "ftk.h"
- Ret timeout_quit(void* user_data)
- {
- ftk_quit();
- printf("%s:%d\n", __func__, __LINE__);
- return RET_REMOVE;
- }
- Ret timeout_repeat(void* user_data)
- {
- printf("%s:%d\n", __func__, __LINE__);
- return RET_OK;
- }
- Ret idle(void* user_data)
- {
- printf("%s:%d\n", __func__, __LINE__);
- return RET_REMOVE;
- }
- int main(int argc, char* argv[])
- {
- FtkSource* source = NULL;
-
- ftk_init(argc, argv);
- source = ftk_source_idle_create(idle, NULL);
- ftk_main_loop_add_source(ftk_default_main_loop(), source);
- source = ftk_source_timer_create(1000, timeout_repeat, NULL);
- ftk_main_loop_add_source(ftk_default_main_loop(), source);
- source = ftk_source_timer_create(10000, timeout_quit, NULL);
- ftk_main_loop_add_source(ftk_default_main_loop(), source);
- ftk_run();
- return 0;
- }