Financial Helper
Bob Nebert
bobn at bmcg.UUCP
Fri Apr 26 05:51:22 AEST 1985
>
> This is a program which you may find useful for calculating different
> financial formulas. Probably the most interesting of the calculations
> is the amortization schedule.
>
> Compile as follows:
>
> cc -O -ltermcap -lm -o <outfile> <infile>
>
> where:
>
> <infile> is the name you have chosen for this source file
>
> <outfile> is the name of the executable file
>
> P.S. Any fixes should be posted to the net.
>>We have System V here and just a couple of changes had to be made
>>On compile inst. use cc -O -lm <out> <in> -lcurses
>
> #include <stdio.h>
> #include <sgtty.h>
> #include <math.h>
>
>> change #include <sgtty.h> to #include <termio.h> /*10 lines past cut*/
> struct sgttyb otsgb;
>>change to struct termio otsgb; /* 13 lines past cut*/
> iniline()
> {
> struct sgttyb ntsgb;
>
> if(isatty(fileno(stdin)))
> {
> ioctl(fileno(stdin), TIOCGETP, &otsgb);
> ntsgb = otsgb;
> ntsgb.sg_flags |= CBREAK;
> ioctl(fileno(stdin), TIOCSETP, &ntsgb);
> }
> }
>>On line 362 from cut change sgttyb to termio
>>On line 366 change TIOCGETP to TCGETA
>>On line 368 change sg_flags to c_lflag
>>On line 368 change |= CBREAK; to &= ~ICANON;
>>Add a line between 368 and 369
ntsgb.c_cc[VMIN]=1; ntsgb.c_cc[VTIME]=2;
>>On line 369(old 369) change TIOCSETP to TCSETAF
>
> resetline()
> {
> if(isatty(fileno(stdin)))
> {
> ioctl(fileno(stdin), TIOCSETP, &otsgb);
>>On line 377(old) change TIOCSETP to TCSETAF
> ospeed = otsgb.sg_ospeed; /* was set in iniline routine */
>>On line 406 change sg_ospeed; to c_cflag & CBAUD;
>>I dont personally know what all that junk means, all I do know is
somebody here did it and the program works good.
********IS ANYBODY OUT THERE**********
More information about the Comp.sources.unix
mailing list