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

/src/backend/qt/ftk_source_qt.cpp

http://ftk.googlecode.com/
C++ | 41 lines | 34 code | 7 blank | 0 comment | 4 complexity | ed5572f761fdc3c5adbadd6b57d6b5d7 MD5 | raw file
 1
 2#include "ftk_source_qt.h"
 3
 4static int ftk_source_qt_get_fd(FtkSource* thiz)
 5{
 6	return -1;
 7}
 8
 9static int ftk_source_qt_check(FtkSource* thiz)
10{
11	return 0;
12}
13
14static Ret ftk_source_qt_dispatch(FtkSource* thiz)
15{
16	usleep(20000);
17	return RET_OK;
18}
19
20static void ftk_source_qt_destroy(FtkSource* thiz)
21{
22	if(thiz != NULL)
23	{
24		FTK_ZFREE(thiz, sizeof(thiz));
25	}
26}
27
28FtkSource* ftk_source_qt_create(void)
29{
30	FtkSource* thiz = (FtkSource*)FTK_ZALLOC(sizeof(FtkSource));
31	if(thiz != NULL)
32	{
33		thiz->get_fd = ftk_source_qt_get_fd;
34		thiz->check = ftk_source_qt_check;
35		thiz->dispatch = ftk_source_qt_dispatch;
36		thiz->destroy = ftk_source_qt_destroy;
37		thiz->ref = 1;
38	}
39
40	return thiz;
41}