pgetl.txt

来自「[随书类]Dos6.0源代码」· 文本 代码 · 共 42 行

TXT
42
字号

SUMMARY  pgetl - do fgetl() from a pipe without blocking. 

#include <tools.h>

pgetl ( buf, max, fh )
char *buf;
int max;
int fh;

DESCRIPTION

  
  	    If ( Buffer is empty )
  		Fill Buffer
  	    If ( 0 length request ) return ( there is more data )?
  	    { - 1 allows for '\0' byte in target }
  	    set max to min(max - 1, count of valid bytes);
  	    If ( "full line" is buffered )
  		Transfer Full line.
  		Clean up and go
  	    Move partial line to base of buffer
  	    Fill rest of buffer
  	    If ( we have a "full line" now ) transfer it
  	    Else
  		return	FALSE
  
  	A "full line" is either LF terminated or len bytes long, whichever
  	comes first.
  

RETURN VALUE

IMPLEMENTATION

SEE ALSO   

NOTE

EXAMPLE

⌨️ 快捷键说明

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