--- os2sdk/demos/apps/bigben/bigben.c 2018/08/09 12:25:13 1.1.1.1 +++ os2sdk/demos/apps/bigben/bigben.c 2018/08/09 12:25:57 1.1.1.2 @@ -2,11 +2,17 @@ * This example uses a few of the many VIO calls. * * This example puts the time on the screen in large numbers. + * + * Created by Microsoft Corp. 1986 */ +#include +#define INCL_DOSPROCESS +#define INCL_DOSDATETIME +#include +#define INCL_SUB +#include #include -#include -#include #define CHAR_WIDTH 8 #define CHAR_HEIGHT 7 @@ -116,39 +122,39 @@ main(argc, argv) char *argv[]; { unsigned rc; /* return code */ - struct DateTime Now; /* time struct for DOSGETSETTIME */ + DATETIME Now; /* time struct for DosGetDateTime */ /* clear the screen */ - VIOWRTNCELL( (char far *) " \07", TOTAL_ROWS * TOTAL_COLMS, 0, 0, 0 ); + VioWrtNCell( " \07", TOTAL_ROWS * TOTAL_COLMS, 0, 0, 0 ); - /* paint separaters between hours and minutes, and minutes and seconds*/ + /* paint separators between hours and minutes, and minutes and seconds*/ - VIOWRTNCELL( (char far *) "|\07", 1, (CLOCK_ROW + 2), 27, 0 ); - VIOWRTNCELL( (char far *) "|\07", 1, (CLOCK_ROW + 5), 27, 0 ); - VIOWRTNCELL( (char far *) "|\07", 1, (CLOCK_ROW + 2), 52, 0 ); - VIOWRTNCELL( (char far *) "|\07", 1, (CLOCK_ROW + 5), 52, 0 ); + VioWrtNCell( "|\07", 1, (CLOCK_ROW + 2), 27, 0 ); + VioWrtNCell( "|\07", 1, (CLOCK_ROW + 5), 27, 0 ); + VioWrtNCell( "|\07", 1, (CLOCK_ROW + 2), 52, 0 ); + VioWrtNCell( "|\07", 1, (CLOCK_ROW + 5), 52, 0 ); for (;;) { /* get the system time */ - if (rc = DOSGETDATETIME( (struct DateTime far *) &Now)) { + if (rc = DosGetDateTime( &Now)) { - printf("DOSGETDATETIME failed, error: %d\n", rc); - DOSEXIT(1, 0); + printf("DosGetDateTime failed, error: %d\n", rc); + DosExit(EXIT_PROCESS, 0); } /* write the digits out to the screen */ - LoadNumber(Now.hour / 10, 5, CLOCK_ROW); - LoadNumber(Now.hour % 10, 15, CLOCK_ROW); + LoadNumber(Now.hours / 10, 5, CLOCK_ROW); + LoadNumber(Now.hours % 10, 15, CLOCK_ROW); LoadNumber(Now.minutes / 10, 30, CLOCK_ROW); LoadNumber(Now.minutes % 10, 40, CLOCK_ROW); LoadNumber(Now.seconds / 10, 55, CLOCK_ROW); LoadNumber(Now.seconds % 10, 65, CLOCK_ROW); - DOSSLEEP((long) 900); + DosSleep(900L); } } @@ -168,5 +174,5 @@ LoadNumber( dig, x, y ) /* write a character string starting from the coordinates */ - VIOWRTCHARSTR( BigChars[dig][i], CHAR_WIDTH, y++, x, 0); + VioWrtCharStr( BigChars[dig][i], CHAR_WIDTH, y++, x, 0); }