ReactOS 0.4.16-dev-252-g9ccafe8
alive.c
Go to the documentation of this file.
1#include <windows.h>
2#include <stdlib.h>
3
8INT d = 0, h = 0, m = 0, s = 0;
9
10int
11main (int argc, char * argv [])
12{
15 {
16 return (EXIT_FAILURE);
17 }
18 while (TRUE)
19 {
20 /* Prepare the message and update it */
22 wsprintf (
23 Message,
24 "Alive for %dd %dh %d' %d\" \r",
25 d, h, m, s
26 );
29 Message,
32 NULL
33 );
34 /* suspend the execution for 1s */
35 Sleep (1000);
36 /* increment seconds */
37 ++ s;
38 if (60 == s) { s = 0; ++ m; }
39 if (60 == m) { m = 0; ++ h; }
40 if (24 == h) { h = 0; ++ d; }
41 }
42 return (EXIT_SUCCESS);
43}
44
45/* EOF */
static int argc
Definition: ServiceArgs.c:12
INT s
Definition: alive.c:8
DWORD CharactersToWrite
Definition: alive.c:6
INT m
Definition: alive.c:8
INT d
Definition: alive.c:8
DWORD WrittenCharacters
Definition: alive.c:7
INT h
Definition: alive.c:8
HANDLE StandardOutput
Definition: alive.c:4
CHAR Message[80]
Definition: alive.c:5
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:203
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
int main()
Definition: test.c:6
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble s
Definition: gl.h:2039
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define EXIT_FAILURE
Definition: jerror.c:33
#define argv
Definition: mplay32.c:18
#define EXIT_SUCCESS
Definition: rdjpgcom.c:55
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
int32_t INT
Definition: typedefs.h:58
#define STD_OUTPUT_HANDLE
Definition: winbase.h:294
#define WriteConsole
Definition: wincon.h:784
#define wsprintf
Definition: winuser.h:5877
char CHAR
Definition: xmlstorage.h:175