⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tm.c

📁 使用于OS/2下的小工具的C源程序,使用于OS/2下的小工具的C源程序
💻 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(&params, &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(&ltime) ;
   today = localtime(&ltime) ;

   
   fprintf(stdout,"%54.54s%s", " ", asctime(today) ) ;

   return( 0 ) ;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -