home *** CD-ROM | disk | FTP | other *** search
- /*================================================*/
- /* TVBREAD.C */
- /* */
- /* (c) Copyright 1988 Ralf Brown */
- /* All Rights Reserved */
- /* May be freely copied for noncommercial use, */
- /* provided that this copyright notice remains */
- /* intact and any changes are indicated in the */
- /* comment blocks preceding functions */
- /*================================================*/
-
- #include "tvapi.h"
-
- /*================================================*/
- /* TVreadmail wait for next message */
- /* Ralf Brown 4/22/88 */
- /*================================================*/
-
- int pascal TVreadmail(OBJECT mbx,char *buffer,int maxsize)
- {
- PARMLIST2 p ;
- int count ;
-
- p.num_args = 0 ;
- TVsendmsg(READ_MSG, mbx?TOS:MAILME, mbx, (PARMLIST *)&p) ;
- count = (int) p.arg[1] ;
- maxsize-- ; /* reserve space for null to terminate string */
- if (count > maxsize)
- count = maxsize ;
- while (count-- > 0)
- *buffer++ = *((char far *)p.arg[0])++ ;
- *buffer = '\0' ;
- return (int) p.arg[1] ;
- }
-
- /* End of TVBREAD.C */
-