⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 puts.c

📁 异步通讯C语言例行子程序
💻 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) */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -