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

📄 iflush.c

📁 异步通讯C语言例行子程序
💻 C
字号:
/* A module of ASYNCx.LIB version 1.20 */

#include <dos.h>
#include "asyncdef.h"

/*
** Discard any data that may be in p's input buffer buffer. If an XOFF
** character has been sent, send an XON character to let the other party
** know that we can accept characters. If an XON character should be
** sent and the output buffer is full and we have received an XOFF
** character, return -1. If all goes well, return 0.
*/
int a_iflush(register ASYNC *p)
{byte *bp;
 if (p)
  {if (p->sentxoff) /* send an XON character */
    {bp=p->obufhead;
     *bp++=XON;
     if (bp==p->obufend)
       bp=p->obuf;
     while(bp==p->obuftail)
       if (p->recvxoff)
         return -1;
     p->obufhead=bp;
     p->ocount++;
    }
   disable();
   p->ibufhead=p->ibuftail=p->ibuf;
   enable();
   return 0;
  }
 else
   return -1;
} /* end of a_iflush(p) */

⌨️ 快捷键说明

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