comparison src/event-msw.c @ 280:7df0dd720c89 r21-0b38

Import from CVS: tag r21-0b38
author cvs
date Mon, 13 Aug 2007 10:32:22 +0200
parents 90d73dddcdc4
children c42ec1d1cded
comparison
equal deleted inserted replaced
279:c20b2fb5bb0a 280:7df0dd720c89
572 struct ntpipe_shove_stream* s = NTPIPE_SHOVE_STREAM_DATA(stream); 572 struct ntpipe_shove_stream* s = NTPIPE_SHOVE_STREAM_DATA(stream);
573 return s->blocking_p; 573 return s->blocking_p;
574 } 574 }
575 575
576 static int 576 static int
577 ntpipe_shove_flusher (Lstream *stream)
578 {
579 struct ntpipe_shove_stream* s = NTPIPE_SHOVE_STREAM_DATA(stream);
580 int i;
581
582 if (s->error_p)
583 return -1;
584
585 /* We do not want to be blocked forever. Instead, we wait
586 about 0.5 second for output to finish. If this does
587 not help, we just return flush failure. */
588 for (i = 0; i < MAX_FLUSH_TIME / 50; ++i)
589 {
590 if (s->idle_p)
591 return 0;
592 Sleep (50);
593 }
594 return -1;
595 }
596
597 static int
598 ntpipe_shove_closer (Lstream *stream) 577 ntpipe_shove_closer (Lstream *stream)
599 { 578 {
600 struct ntpipe_shove_stream* s = NTPIPE_SHOVE_STREAM_DATA(stream); 579 struct ntpipe_shove_stream* s = NTPIPE_SHOVE_STREAM_DATA(stream);
601 580
602 /* Force thread stop */ 581 /* Force thread stop */
620 599
621 static void 600 static void
622 init_shove_stream (void) 601 init_shove_stream (void)
623 { 602 {
624 LSTREAM_HAS_METHOD (ntpipe_shove, writer); 603 LSTREAM_HAS_METHOD (ntpipe_shove, writer);
625 LSTREAM_HAS_METHOD (ntpipe_shove, flusher);
626 LSTREAM_HAS_METHOD (ntpipe_shove, was_blocked_p); 604 LSTREAM_HAS_METHOD (ntpipe_shove, was_blocked_p);
627 LSTREAM_HAS_METHOD (ntpipe_shove, closer); 605 LSTREAM_HAS_METHOD (ntpipe_shove, closer);
628 } 606 }
629 607
630 /************************************************************************/ 608 /************************************************************************/
1611 tttext->lpszText = NULL; 1589 tttext->lpszText = NULL;
1612 tttext->hinst = NULL; 1590 tttext->hinst = NULL;
1613 1591
1614 if (!NILP(btext)) 1592 if (!NILP(btext))
1615 { 1593 {
1616 strncpy (tttext->szText, XSTRING_DATA (btext), 80); 1594 strncpy (tttext->szText, XSTRING_DATA (btext), XSTRING_LENGTH(btext)+1);
1617 tttext->lpszText=tttext->szText; 1595 tttext->lpszText=tttext->szText;
1618 } 1596 }
1619 #if 0 1597 #if 0
1620 tttext->uFlags |= TTF_DI_SETITEM; 1598 tttext->uFlags |= TTF_DI_SETITEM;
1621 #endif 1599 #endif