/*------------------------------------------------------------------------------
version life cycle control
------------------------------------------------------------------------------*/
int expiry(void)
{
#define EXPIRY_DATE (u32)0xFFFFFFFF

time_t sysTime;
struct tm *tm;
u8 tmBuf[7];
u32 tmp;
int retval = 0;
/* check expiry date */
time(&sysTime);
tm = localtime(&sysTime);
strftime(tmBuf, sizeof(tmBuf), "%y%m%d", tm);
tmp = 1000000 + atoi(tmBuf);
if (tmp > (EXPIRY_DATE) && (EXPIRY_DATE) > 1){
fprintf(stderr, "EVALUATION PERIOD EXPIRED.\n" "Please contact Sales.\n");
retval = -1;
}
return retval;
}

BB 發表在 痞客邦 PIXNET 留言(0) 人氣()