home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
MNO100.ZIP
/
MNOFILT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-05-17
|
5KB
|
184 lines
/*------------------------------------------------------------*/
/* mnofilt.c ( OS/2 ) */
/* */
/* This filter will write the stdin input file to the stdout */
/* output and display the contents on the monochrome display. */
/* */
/*------------------------------------------------------------*/
#include <stdio.h> /* Library I/O routines. */
#include <stdlib.h> /* Library common routines. */
#include <string.h> /* Library string routines. */
#define INCL_BASE
#include <os2.h>
#include "SYMTYPES.H"
#include "MNOCALLS.H"
VIOPHYSBUF viopbBuffer ;
USHORT usStatus ;
USHORT fLockStatus ;
#define BOTTOM_MSG_LINE 21
CHAR szText [ 200 ] = "" ;
CHAR * pszText ;
PCH pchText ;
BYTE bCell [ 2 ] = { 0 } ;
USHORT i ;
USHORT usTextLen = 0 ;
VIOCURSORINFO vioci ;
BOOL fSkipLine = FALSE ;
/*------------------------------------------------------------*/
/* Main function. */
/*------------------------------------------------------------*/
main ()
{
/*---------------------------------------------*/
/* Hide the cursor on the monohrome display. */
/*---------------------------------------------*/
usStatus = MnoGetCurType ( &vioci, 0 ) ;
if ( usStatus )
fprintf (
stderr,
"Error - accessing MnoCalls DLL, status: %u\n",
usStatus ) ;
vioci.attr = 0xFFFF ;
usStatus = MnoSetCurType ( &vioci, 0 ) ;
/*---------------------------------------------*/
/* Set the previous screen to Normal intensity.*/
/*---------------------------------------------*/
bCell [ 0 ] = 0x07 ;
for ( i = 1 ; i <= BOTTOM_MSG_LINE ; i++ )
usStatus = MnoWrtNAttr (
bCell,
67,
i,
1,
0 ) ;
/*---------------------------------------------*/
/* Set the default attribute to bright. */
/*---------------------------------------------*/
strcpy ( szText, "
" ) ;
usStatus = MnoWrtTTY (
szText,
strlen ( szText ),
0 ) ;
/*---------------------------------------------*/
/* Copy the file. */
/*---------------------------------------------*/
pszText = gets ( szText ) ;
while ( pszText )
{
usTextLen = strlen ( szText ) ;
pchText = pszText ;
if ( usTextLen > 0 )
puts ( szText ) ;
if ( strncmp ( szText, "Microsoft (R) Segm", 18 ) == 0 )
fSkipLine = TRUE ;
else
if ( strncmp ( szText, "Copyright (C) Micr", 18 ) == 0 )
fSkipLine = TRUE ;
else
fSkipLine = FALSE ;
if (( usTextLen > 0 ) &&
( ! fSkipLine ))
{
/*---------------------------------------------*/
/* Scroll up by one line. */
/*---------------------------------------------*/
bCell [ 0 ] = ' ' ;
bCell [ 1 ] = 0x07 ;
usStatus = MnoScrollUp (
1,
1,
BOTTOM_MSG_LINE,
67,
1,
bCell,
0 ) ;
/*---------------------------------------------*/
/* Display the text on the bottom line. */
/*---------------------------------------------*/
usStatus = MnoSetCurPos (
BOTTOM_MSG_LINE,
1,
0 ) ;
if ( usTextLen > 67 )
usStatus = MnoWrtTTY (
szText,
67,
0 ) ;
else
if ( usTextLen > 0 )
usStatus = MnoWrtTTY (
szText,
usTextLen,
0 ) ;
}
else
{
/*---------------------------------------------*/
/* Set the bottom line back to bright. */
/*---------------------------------------------*/
bCell [ 0 ] = 0x0F ;
usStatus = MnoWrtNAttr (
bCell,
67,
BOTTOM_MSG_LINE,
1,
0 ) ;
}
pszText = gets ( szText ) ;
}
exit ( 0 ) ;
return ( 0 ) ;
} /* End of main function. */