📄 sleep.c
字号:
/*
* SLEEP.C - Sleep a specified number of seconds.
*
* PROGRAMMER: Martti Ylikoski
* CREATED: 6.12.1990
*/
static char *VERSION = "Version 1.1. Copyright (c) Martti Ylikoski, 1990, 1991." ;
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <param.h>
#include <paramstd.h>
#define INCL_DOS
#include <os2.h>
static char *progname, *fname ;
extern unsigned long pflags ;
ParamEntry pentry[12] = {
"P", &ParamSetPause, 0,
"F", &ParamSetFold, 0,
"V", &ParamSetVerbose, 0,
"R", &ParamSetReport, 0,
"S", &ParamSetSubDirs, 0,
"?", &ParamSetHelp, 1,
"H", &ParamSetHelp, 1,
"NOD", &ParamSetNoDefault, 0,
"TEST", &ParamSetTest, 0,
"Y", &ParamSetYes, 0,
"N", &ParamSetTest, 0,
"\0", NULL, 0
} ;
ParamBlock params = {
"/-", IGNORECASE | NOPRIORITY | NOTRIGGERSALLOWED ,
pentry
} ;
int main(int argc, char *argv[])
{
int secs ;
progname = argv[0] ;
ParamHandle(¶ms, &argc, argv) ;
if (pflags & PA_HELP)
{
printf("%s - sleep a specified number of seconds.\n", progname) ;
puts(VERSION) ;
puts("Usage: sleep [/H | /?] [seconds]") ;
return( 1 ) ;
}
if (argc == 2)
secs = atoi( argv[1] );
else
{
fprintf(stderr, "SLEEP: stdin assumed\n") ;
scanf("%d", &secs) ;
}
DosSleep( (ULONG) secs*1000 ) ;
return( 0 ) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -