--- os2sdk/demos/apps/wakeup/wakeup.c 2018/08/09 12:25:13 1.1.1.1 +++ os2sdk/demos/apps/wakeup/wakeup.c 2018/08/09 12:26:06 1.1.1.2 @@ -5,13 +5,13 @@ WAKEUP ------ This program takes a time parameter. It goes into a -DOSSLEEP and uses VIOPOPUP to wakeup you up. It will interrupt -any protected mode or real mode screen group. The VIOPOPUP call +DosSleep and uses VioPopUp to wakeup you up. It will interrupt +any protected mode or real mode screen group. The VioPopUp call always causes an automatic save of the existing screen and turns -over the screen to the program doing VIOPOPUP. After a VIOENDPOPUP, +over the screen to the program doing VioPopUp. After a VioEndPopUp, the original screen is restored. - Even after it's in the DOSSLEEP, you can abort the program + Even after it's in the DosSleep, you can abort the program with a Ctrl-Break. You can devote a whole screen group to WAKEUP by executing @@ -23,25 +23,27 @@ or you can run it in the background of a DETACH WAKEUP time + Created by Microsoft Corp. 1986 + */ +#define INCL_DOSDATETIME +#define INCL_DOSPROCESS +#define INCL_SUB -#include /* Part of 286DOS Development Kit */ -#include +#include +#include /* Part of MS OS/2 Development Kit */ #include -#define BYTE unsigned char -#define WORD unsigned int -#define DWORD unsigned long - main (argc, argv) int argc ; char *argv [] ; { - struct DateTime datetime ; + DATETIME datetime ; static char delim [] = ":" ; - int hour, min, col, len, i ; - long wakeup, current ; - WORD waitflags ; + int hour, min; + USHORT col, len, i ; + ULONG wakeup, current ; + USHORT waitflags ; static char msg [] = "\xBA WAKE UP! WAKE UP! WAKE UP! \xBA" ; if (argc < 2 || 23 < (hour = atoi (strtok (argv [1], delim))) || @@ -51,10 +53,10 @@ main (argc, argv) exit (0) ; } - DOSGETDATETIME (&datetime) ; + DosGetDateTime (&datetime) ; wakeup = (hour * 60 + min) * 60000L ; - current = ((datetime.hour * 60 + + current = ((datetime.hours * 60 + datetime.minutes) * 60L + datetime.seconds) * 1000L ; @@ -65,22 +67,22 @@ main (argc, argv) puts ("\n\n\n\n\n\t\tWAKEUP scheduled ... \n\n\n\n") ; - DOSSLEEP (wakeup) ; + DosSleep (wakeup) ; waitflags = 1 ; - VIOPOPUP (&waitflags, 0) ; + VioPopUp (&waitflags, 0) ; col = (80 - sizeof (msg)) / 2 ; len = sizeof (msg) - 3 ; - VIOSETCURPOS (10, col, 0) ; + VioSetCurPos (10, col, 0) ; border (len, 201, 187) ; - VIOSETCURPOS (11, col, 0) ; - VIOWRTTTY (msg, sizeof (msg), 0) ; + VioSetCurPos (11, col, 0) ; + VioWrtTTy (msg, sizeof (msg), 0) ; - VIOSETCURPOS (12, col, 0) ; + VioSetCurPos (12, col, 0) ; border (len, 200, 188) ; while (kbhit ()) @@ -90,13 +92,13 @@ main (argc, argv) { for (i = 1 ; i < 10 ; i++) { - DOSBEEP (500, 50) ; - DOSBEEP (1000, 50) ; + DosBeep (500, 50) ; + DosBeep (1000, 50) ; } for (i = 1 ; i < 10 ; i++) { - DOSBEEP (1000, 50) ; - DOSBEEP (2000, 50) ; + DosBeep (1000, 50) ; + DosBeep (2000, 50) ; } } } @@ -108,10 +110,10 @@ border (len, left, right) char line = 205 ; int i ; - VIOWRTTTY (&left, 1, 0) ; + VioWrtTTy (&left, 1, 0) ; for (i = 0 ; i < len ; i++) - VIOWRTTTY (&line, 1, 0) ; + VioWrtTTy (&line, 1, 0) ; - VIOWRTTTY (&right, 1, 0) ; + VioWrtTTy (&right, 1, 0) ; }