write.c

来自「ULTRACTR的源码」· C语言 代码 · 共 29 行

C
29
字号
/* write.c -- write bytes to an output device. */extern int  outbyte(char);/* * write -- write bytes to the serial port. Ignore fd, since *          stdout and stderr are the same. Since we have no filesystem, *          open will only return an error. */intwrite (int fd, char* buf, int nbytes)	/*       int fd;       char *buf;       int nbytes;       */{  int i;  for (i = 0; i < nbytes; i++) {    if (*(buf + i) == '\n') {      outbyte ('\r');    }    outbyte (*(buf + i));  }  return (nbytes);}

⌨️ 快捷键说明

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