( ) - 2


3.1. TEXTATTR.C

#include <stdio.h>

#include <conio.h>

#include <dos.h>


// FP_MAKE

#include "sysp.h"


// VIDEOBUF

#include "sysgraph.h"


//

void SetVideoMode( unsigned char vmode );

void SetBlinkIntensity( unsigned char mode );

int GetColumn(void);

int GetVideoBuf(int);

void Hello(void);

int main( int, char ** );


//======================================================

//

//======================================================

int main( int argc, char * argv[] )

{

union REGS inregs, outregs;

VIDEOBUF _far *vbuf, _far *ptr_vbuf;


unsigned char background, foreground;

unsigned char char_attr;


int vmode, bl_in_mode;

char szText[4];


//

if( argc != 3 )

{

Hello();

return -1;

}


//

sscanf(argv[1],"%d",&vmode);

sscanf(argv[2],"%d",&bl_in_mode);


// ,

if(vmode > 3 && vmode != 7)

return(-2);


// <>,

//

if((bl_in_mode != 0)&&(bl_in_mode != 1))

return(-3);


// ,

// <>

SetVideoMode((unsigned char) vmode );


//

// . <> 0

// ,

// 1

//

SetBlinkIntensity((unsigned char) bl_in_mode );


//

//