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

📄 pprintf.c

📁 At can be given its arguments in a file. You can comment out lines by preceding them with either #
💻 C
字号:
/*
* PPRINF.C - Pageprintf routine enables us to handle the /P option in each
*	    command. It gives the printf interface out and prints the text
*	    'Press any key' and requires a key each time the screen is full of text.
*
* PROGRAMMER:	    Martti Ylikoski
* CREATED:	    2.11.1991
* VERSION:	    1.0
*
*/
#undef MSDOS
#include <stdio.h>
#include <stdarg.h>
#include "pprintf.h"
#ifndef MSDOS
#define INCL_KBD
#include <os2.h>
#endif
#include <param.h>
#include <paramstd.h>
extern unsigned long pflags ;
int Pageprintf(int rows, char *fmt, ...)
{
va_list marker ;
char buf[512] ;
int ret ;
static int outlines = 0 ;
#ifndef MSDOS
KBDKEYINFO kbci ;
#endif
   va_start(marker, fmt) ;
   ret = vsprintf(buf, fmt, marker) ;
   va_end( marker ) ;
   fputs(buf, stdout) ;
   outlines ++ ;
   if ((pflags & PA_PAUSE) && (outlines >= rows) )
   {
#ifdef MSDOS
      fputs("Press ENTER key when ready ...", stdout) ;
      getchar() ;
#endif
#ifndef MSDOS
      fputs("Press any key when ready ...", stdout) ;
      KbdCharIn(&kbci, IO_WAIT, 0) ;
      puts("") ;
#endif
      outlines = 0 ;
   }
}

⌨️ 快捷键说明

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