PageRenderTime 14ms CodeModel.GetById 7ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/ftk_test.c

http://ftk.googlecode.com/
C | 41 lines | 30 code | 11 blank | 0 comment | 0 complexity | 67a386224549e4b3f50ab57f096c4765 MD5 | raw file
 1#include "ftk.h"
 2
 3Ret timeout_quit(void* user_data)
 4{
 5	ftk_quit();
 6
 7	printf("%s:%d\n", __func__, __LINE__);
 8	return RET_REMOVE;
 9}
10
11Ret timeout_repeat(void* user_data)
12{
13	printf("%s:%d\n", __func__, __LINE__);
14	return RET_OK;
15}
16
17Ret idle(void* user_data)
18{
19	printf("%s:%d\n", __func__, __LINE__);
20	return RET_REMOVE;
21}
22
23int main(int argc, char* argv[])
24{
25	FtkSource* source = NULL;
26	
27	ftk_init(argc, argv);
28
29	source = ftk_source_idle_create(idle, NULL);
30	ftk_main_loop_add_source(ftk_default_main_loop(), source);
31
32	source = ftk_source_timer_create(1000, timeout_repeat, NULL);
33	ftk_main_loop_add_source(ftk_default_main_loop(), source);
34
35	source = ftk_source_timer_create(10000, timeout_quit, NULL);
36	ftk_main_loop_add_source(ftk_default_main_loop(), source);
37
38	ftk_run();
39
40	return 0;
41}