www.pudn.com > ASYNC13.rar > PUTS.C


/* A module of ASYNCx.LIB version 1.20 */ 
 
#include "asyncdef.h" 
 
/* 
** Send the null-terminated string of characters pointed to by s to the 
** port associated with p. If port p is not open, return -1. Otherwise, 
** return the number of characters that were sucessfully transmitted. 
** (If XON/XOFF is turned on and an XOFF character is received during 
** the transmission of the string, a_puts will return the number of 
** character that were successfully placed into the output buffer so 
** that the calling application will be able to pick up where it was cut 
** off.) This function does NOT append a '\n' or '\r' character to the 
** string. 
*/ 
int a_puts(register char *s,register ASYNC *p) 
{unsigned count; 
 if (p) 
  {count=0; 
   while(*s) 
     if (a_putc(*s,p)==*s) 
      {s++; 
       count++; 
      } 
   return(count); 
  } 
 else 
   return -1; 
} /* end of a_puts(s,p) */