SASC-NG
DVBSoftCAM

msg_passing.h

Go to the documentation of this file.
00001 #ifndef _MSG_PASSING_H_
00002 #define _MSG_PASSING_H_
00003 #include "list.h"
00004 
00005 #define MSG_PROCESSED -1
00006 #define MSG_TERMINATE -2
00007 #define MSG_LOW_PRIORITY 0
00008 #define MSG_HIGH_PRIORITY 1
00009 
00010 #define MSG_REPLACE   0x01
00011 #define MSG_RECURRING 0x02
00012 
00013 struct msg {
00014   struct list_head list;
00015   int type;
00016   int id;
00017   int recurring;
00018   time_t next_run;
00019   void *data;
00020 };
00021 
00022 extern void msg_loop_init();
00023 extern void *msg_loop(void *arg);
00024 extern void msg_remove_type_from_list(unsigned int priority, int type, int id,
00025                                void (*cmd)(void *msg));
00026 extern void msg_send_replace(unsigned int priority, int type, int id,
00027                        void *data, int delay, unsigned int flags);
00028 extern void msg_terminate(unsigned int priority);
00029 #define msg_send(a,b,c,d) msg_send_replace(a,b,c,d,0,0)
00030 #define msg_replace(a,b,c,d) msg_send_replace(a,b,c,d,0,MSG_REPLACE)
00031 #define msg_delayed(a,b,c,d,e,f) msg_send_replace(a,b,c,d,e, \
00032                                                   ((f)? MSG_RECURRING : 0)
00033 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines