write.c
来自「异步通讯C语言例行子程序」· C语言 代码 · 共 27 行
C
27 行
/* A module of ASYNCx.LIB version 1.02 */
#include "asyncdef.h"
/*******************************************************
Send n objects of size s to the port associated with p
starting with the one pointed to by buf. Return the
number of objects transmitted. If there is an error
during this process, return a short count.
*******************************************************/
int a_write(void *buf,int s,int n,ASYNC *p)
{byte *bp;
int i;
if (p)
{bp=(byte *)buf;
n*=s;
i=0;
while(i<n)
if (a_putc(*bp,p)==*bp)
{bp++;
i++;
}
return(n/s);
}
return 0;
} /* end of a_write(buf,s,n,p) */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?