home *** CD-ROM | disk | FTP | other *** search
- /*================================================*/
- /* TVWREAD.C */
- /* */
- /* (c) Copyright 1988 Ralf Brown */
- /* All Rights Reserved */
- /* May be freely copied for noncommercial use as */
- /* long as this copyright notice is kept intact */
- /* and any changes are indicated in the comment */
- /* blocks for the functions */
- /*================================================*/
-
- #include <stdio.h>
- #include "tvapi.h"
-
- /*================================================*/
- /* TVwin_read read rest of current line from win */
- /* Ralf Brown 4/3/88 */
- /*================================================*/
-
- int pascal TVwin_read(OBJECT win,void *buffer,int maxsize)
- {
- PARMLIST2 p ;
- register int count ;
-
- if (buffer == NULL)
- return 0 ;
- p.num_args = 0 ;
- TVsendmsg(READ_MSG, win?TOS:ME, win, (PARMLIST *)&p) ;
- count = (int) p.arg[1] ;
- maxsize-- ; /* reserve space for null to terminate string */
- if (count > maxsize)
- count = maxsize ;
- while (count--)
- *((char *)buffer)++ = *((char far *)p.arg[0])++ ;
- *((char *)buffer) = '\0' ;
- return (int) p.arg[1] ;
- }
-
- /* End of TVWREAD.C */
-