ReactOS  0.4.12-dev-945-g5a2911d
alive.c File Reference
#include <windows.h>
#include <stdlib.h>
Include dependency graph for alive.c:

Go to the source code of this file.

Functions

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

Variables

HANDLE StandardOutput = INVALID_HANDLE_VALUE
 
CHAR Message [80]
 
DWORD CharactersToWrite = 0
 
DWORD WrittenCharacters = 0
 
INT d = 0
 
INT h = 0
 
INT m = 0
 
INT s = 0
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

Definition at line 11 of file alive.c.

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  );
27  WriteConsole (
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 }
INT h
Definition: alive.c:8
#define TRUE
Definition: types.h:120
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:736
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
DWORD CharactersToWrite
Definition: alive.c:6
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
INT m
Definition: alive.c:8
#define EXIT_SUCCESS
Definition: rdjpgcom.c:55
HANDLE StandardOutput
Definition: alive.c:4
smooth NULL
Definition: ftsmooth.c:416
INT d
Definition: alive.c:8
#define EXIT_FAILURE
Definition: jerror.c:33
CHAR Message[80]
Definition: alive.c:5
INT s
Definition: alive.c:8
GLdouble s
Definition: gl.h:2039
#define STD_OUTPUT_HANDLE
Definition: winbase.h:265
#define WriteConsole
Definition: wincon.h:772
#define wsprintf
Definition: winuser.h:5731
DWORD WrittenCharacters
Definition: alive.c:7

Variable Documentation

◆ CharactersToWrite

DWORD CharactersToWrite = 0

Definition at line 6 of file alive.c.

Referenced by main().

◆ d

INT d = 0

Definition at line 8 of file alive.c.

Referenced by main().

◆ h

INT h = 0

Definition at line 8 of file alive.c.

Referenced by main().

◆ m

INT m = 0

Definition at line 8 of file alive.c.

Referenced by main().

◆ Message

CHAR Message[80]

Definition at line 5 of file alive.c.

Referenced by AcpiNsPrintNodePathname(), AcpiUtMethodError(), AcpiUtPrefixedNamespaceError(), AcpiUtUpdateRefCount(), AllocateUserMessage(), ApplyDisplaySettings(), auxMessage(), BaseSrvFillCommandInfo(), BlResourceFindMessage(), BrowseDlgProc(), CharMapDlgProc(), ClientThread(), co_IntCallWindowProc(), co_IntSendMessageWithCallBack(), co_IntShellHookNotify(), co_MsqDispatchOneSentMessage(), co_MsqReplyMessage(), co_MsqSendMessage(), co_MsqSendMessageAsync(), CryptExtOpenCERW(), CsrSbApiHandleConnectionRequest(), CustomizeClassicProc(), CustomizeNotifyIconsProc(), DbgkpQueueMessage(), DbgkpSendApiMessageLpc(), DisplayStatus(), DlgProc(), DriverDialogProc(), DriverProc(), ExpRaiseHardError(), FindRemoveEventMsg(), FloatToolbarWndProc(), FreeUserMessage(), GuiConsoleHandleKey(), I_RpcWindowProc(), ImageView_DispWndProc(), ImageView_WndProc(), implicit_handle(), InitializeDeviceData(), InitiateSystemShutdownExW(), InitiateSystemShutdownW(), IntGetPaintMessage(), IntSendSyncPaint(), IopLogWorker(), KdpBochsDebugPrint(), KdpScreenPrint(), KdpSerialDebugPrint(), KiDisplayBlueScreen(), KiDumpParameterImages(), KmtFltSendBufferToDriver(), KmtFltSendStringToDriver(), KmtFltSendToDriver(), KmtFltSendUlongToDriver(), KmtFltSendWStringToDriver(), LoadAndPrintString(), LpcExitThread(), LpcpAllocateFromPortZone(), LpcpCopyRequestData(), LpcpDeletePort(), LpcpDestroyPortQueue(), LpcpFindDataInfoMessage(), LpcpFreeConMsg(), LpcpFreeDataInfoMessage(), LpcpFreeToPortZone(), LpcpGetDataInfoFromMessage(), LpcpSaveDataInfoMessage(), LpcpVerifyMessageDataInfo(), LpcRequestPort(), LpcRequestWaitReplyPort(), LsapRmServerThread(), main(), MainDialogProc(), MainDlgProc(), MainWndProc(), midMessage(), MmeCloseDevice(), MmeGetLineInfo(), MmeOpenDevice(), modMessage(), MountDialogProc(), MsfsClose(), MsfsQueryMailslotInformation(), MsfsRead(), MsfsWrite(), MsqCreateMessage(), MsqDestroyMessage(), MsqPeekMessage(), MsqPostMessage(), MsqPostMouseMove(), mxdMessage(), MyErrExit(), COpenWithDialog::NoOpenDlgProc(), NotifyMmeClient(), NtAcceptConnectPort(), NtReadRequestData(), NtReplyPort(), NtReplyWaitReceivePortEx(), NtRequestPort(), NtRequestWaitReplyPort(), NtSecureConnectPort(), NtUserGetThreadState(), NtUserTranslateAccelerator(), NtWriteRequestData(), OnKey(), OptionsDlgProc(), OutputError(), PciGetDeviceDescriptionMessage(), PopupMenuWndProc(), PopupMenuWndProcA(), PopupMenuWndProcW(), PrintWin32Error(), ProcessPortMessage(), ProgressDialogProc(), PspCatchCriticalBreak(), RemoveStartMenuItemsProc(), RtlApplicationVerifierStop(), RtlAssert(), RtlFormatMessage(), RtlFormatMessageEx(), RxAssert(), SepRmCommandServerThread(), SepRmCommandServerThreadInit(), SepRmSetAuditEvent(), ServerThread(), ShowOpenError(), ShowWriteError(), StartWithDesktop(), StopDependsDialogProc(), sys_arch_mbox_fetch(), USBPORT_AssertFailure(), UserpCaptureStringParameters(), UserpFormatMessages(), UserpFreeStringParameters(), UserPostMessage(), UserPostThreadMessage(), UserpShowInformationBalloon(), UserServerHardError(), widMessage(), WndProc(), wodMessage(), WshShell3_LogEvent(), and WsThreadDefaultBlockingHook().

◆ s

INT s = 0

Definition at line 8 of file alive.c.

Referenced by main().

◆ StandardOutput

HANDLE StandardOutput = INVALID_HANDLE_VALUE

Definition at line 4 of file alive.c.

Referenced by main().

◆ WrittenCharacters

DWORD WrittenCharacters = 0

Definition at line 7 of file alive.c.

Referenced by main().