00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(_WIN32)
00022 # include <strings.h>
00023 #endif
00024
00025 #include <time.h>
00026
00027 #include "scrTime.h"
00028
00029
00030 typedef struct _tag_screen_time
00031 {
00032 int dummy;
00033
00034
00035
00036 } SCREEN_TIME, * LPSCREEN_TIME;
00037
00038
00039 int ModuleCreate(int handle, void ** context, LPMODULE_FN_ARRAY pFnArray)
00040 {
00041
00042 pFnArray->version = 1;
00043
00044
00045 pFnArray->pfnTextData = GetDisplayData;
00046
00047 return 0;
00048 }
00049
00050
00051 int ModuleDestroy(void * context)
00052 {
00053 printf("In ModuleDestroy\n");
00054
00055 return 0;
00056 }
00057
00058
00059 int GetDisplayData(void * context, int row, int nWidth, char * buf)
00060 {
00061 char * lfChar = NULL;
00062 char localBuf[1024];
00063 time_t now;
00064
00065
00066 time(&now);
00067
00068
00069 ctime_r(&now, localBuf);
00070
00071
00072 lfChar = index(localBuf, '\n');
00073 if (lfChar != NULL) {
00074 *lfChar = '\0';
00075 }
00076
00077 sprintf(buf, "%s", localBuf);
00078
00079 return 0;
00080 }