Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
实施",;“更多过滤器”;在C中_C_Shell_Unix - Fatal编程技术网

实施",;“更多过滤器”;在C中

实施",;“更多过滤器”;在C中,c,shell,unix,C,Shell,Unix,我想知道如何实现更多的过滤器-就像在显示文本中一样,直到它填满屏幕并用“回车”移动每一行(就像在UNIX中一样)。我知道网络课程很有用,但找不到合适的方法 谢谢 实现两个缓冲区 这可以是一个大纲: Read from file into the 1st buffer. offset=0 while `offset != total_lines_in_file` [1] show `max_lines_in_a_page` number of lines starting from line

我想知道如何实现更多的过滤器-就像在显示文本中一样,直到它填满屏幕并用“回车”移动每一行(就像在UNIX中一样)。我知道网络课程很有用,但找不到合适的方法


谢谢

实现两个缓冲区

这可以是一个大纲:

Read from file into the 1st buffer.
offset=0

while `offset != total_lines_in_file`
  [1] show `max_lines_in_a_page` number of lines starting from line number `offset`
  [2] when showing the lines if a buffer end is detected, load the other buffer and switch buffer, and print remaining lines.
  [3] if the specific scroll keypress is detected make `offset = offset + x` (x = 1, 2 etc.)

最好查看
more
实现的源代码。

查看源代码了解更多信息如何?您可以阅读简单
more
变体的实际源代码,例如。对于
,不需要更多的
完整课程;仅获取屏幕大小(这也是可选的)。