
Remote Control
Users Guide
6-24
if ( l <= 0 )
return l;
#if 0
fprintf(stderr,"sio_fillbuf(): sio_read(): %d\n",l);
#endif
sio->buf.cnt = l;
sio->buf.ptr = sio->buf.base;
return l;
}
/****************************************************************************
**/
static int sio_getc(sio_t *sio,int *pchar)
{
int ret;
if ( !sio->buf.cnt && (ret = sio_fillbuf(sio)) <= 0 )
return ret;
sio->buf.cnt--;
*pchar = *sio->buf.ptr++;
return 1; /* OK */
}
/****************************************************************************
**/
static int sio_gets(sio_t *sio,char *str)
{
register int len;
int c, ret;
for(len = 0; ; )
{
if ( (ret = sio_getc(sio,&c)) < 0 )
return ret;
if ( ret == 0 )
Sleep(10); /* no data on input, don't hog CPU */
else
{
if ( c == '\r' )
continue;
str[len++] = (char)c;
if ( c == '\n' )
break;
}
}
str[len] = '\0'; /* terminate string */
return 0; /* OK */
}
Содержание NORMA 4000 Operators
Страница 6: ...Remote Control Users Guide iv ...
Страница 8: ...Remote Control Users Guide vi ...
Страница 10: ...Remote Control Users Guide viii ...
Страница 12: ...Remote Control Users Guide 1 2 Output Unit 1 13 Command Sequence and Command Synchronization 1 14 ...
Страница 26: ...Remote Control Users Guide 2 2 ...
Страница 38: ...Remote Control Users Guide 3 2 ...
Страница 50: ...Remote Control Users Guide 4 2 ...
Страница 150: ...Remote Control Users Guide 4 102 ...
Страница 152: ...Remote Control Users Guide 5 2 ...
Страница 160: ...Remote Control Users Guide 6 2 ...
Страница 184: ...Remote Control Users Guide 6 26 ...