#define __LIBRARY__ #include #include #include _syscall1(void,get_message,struct message *,msg); _syscall2(int,timercreate,long,ms,int,type); struct message msg; int main() { timercreate(1000,TYPE_USER_TIMER_INFTY); while(1) { get_message(&msg); /* printf("msg.mid:%d\n", msg.mid); */ if (msg.mid > 0) { switch(msg.mid) { case MSG_USER_TIMER: printf("MSG_USER_TIMER\n"); break; case MSG_MOUSE_LEFT_DOWN: printf("MSG_MOUSE_LEFT_DOWN\n"); break; case MSG_MOUSE_RIGHT_DOWN: printf("MSG_MOUSE_RIGHT_DOWN\n"); break; } } } }