#include <conio.h>
#include <stdlib.h>
#include <ctype.h>

#include "extern.h"

rswait()         /* Ü¯Á µÖËÞ ºÈ¸Ä Ö³·­³ ¹Ý¼­Â */        
       { int ix = 0,iy = 0,j,ch;
         short itime;
         int wcnt = 0;

         dspjyo();
         while(1)
         {
         wcnt++;
         if ( wcnt > 200 )
            {
             dspjyo();
             nwdate();   /* ¼Þº¸ ÊÝÀÞÝ ¼ bbs stop */
             itime = td[3] * 100 + td[4];

             if ( itime > *(resttime) && itime < *(resttime + 1) )
                return(9);
             if ( itime > *(resttime + 2) && itime < *(resttime + 3) )
                return(9);
             wcnt = 0;
         /*  if ( chkcd() )  longjmp(env,-1); */
                                            /* con ¼Þ®³À² ÃÞ ±ÚÊÞ abend */

            }   
         
         while (rshit())
            { ch = rsbread();
              if ( moniflg ) 
                 { if (! iscntrl(ch) ) putchar(ch);
                   if ( ch == 0x0d  )  { putchar(ch);
					 addlf(ch);
				       }                   
                 }
                 
              if ( ix == 7 ) 
                 {
				break;
                  }
             else
               { if ( *(cneted + ix) == ch) { ix++; iy = 0;}
                  else ix = 0; }                /* ºÈ¸Ä Î³º¸ ¹Ý¼­Â */
            }
                
      }
         
       return(1);
       }
        
