📄 tm.c
字号:
/*
* TM.C - Time mark - show the current time.
*
* PROGRAMMER: Martti Ylikoski
* CREATED: 24.8.1992
*/
static char *VERSION = "Version 1.1, Copyright(c) Martti Ylikoski, 1990-1992" ;
/*
*/
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <errno.h>
#include <param.h>
#include <paramstd.h>
#define INCL_VIO
#include <os2.h>
static char *progname ;
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
} ;
/* local prototypes */
int main(int argc, char *argv[])
{
time_t ltime ;
struct tm *today ;
progname = argv[0] ;
ParamHandle(¶ms, &argc, argv) ;
if (pflags & PA_HELP)
{
fputs("TM - Time mark. Show the current time.\n", stderr) ;
fputs(VERSION, stderr) ;
fputs("\nUsage: tm [/H | /?]\n", stderr) ;
return( 0 ) ;
}
time(<ime) ;
today = localtime(<ime) ;
fprintf(stdout,"%54.54s%s", " ", asctime(today) ) ;
return( 0 ) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -