Signal handler messages moved to help_mp, so they can be translated
[mplayer/greg.git] / fifo.c
blobc37a1d278306c4258a71a2904ac94a08f04da58d
2 // keyboard:
3 static int keyb_fifo_put=-1;
4 static int keyb_fifo_get=-1;
6 static void make_pipe(int* pr,int* pw){
7 int temp[2];
8 if(pipe(temp)!=0) printf("Cannot make PIPE!\n");
9 *pr=temp[0];
10 *pw=temp[1];
13 void mplayer_put_key(int code){
14 fd_set rfds;
15 struct timeval tv;
17 /* Watch stdin (fd 0) to see when it has input. */
18 FD_ZERO(&rfds);
19 FD_SET(keyb_fifo_put, &rfds);
20 tv.tv_sec = 0;
21 tv.tv_usec = 0;
23 //retval = select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv);
24 if(select(keyb_fifo_put+1, NULL, &rfds, NULL, &tv)>0){
25 write(keyb_fifo_put,&code,4);
26 // printf("*** key event %d sent ***\n",code);
27 } else {
28 // printf("*** key event dropped (FIFO is full) ***\n");