b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

log4cpp_log4qt_log4j与log4cp区别(10)

电脑杂谈  发布时间:2016-12-26 03:02:23  来源:网络整理

#endif

localtime_r(&timep, &tm);

#else

/* xxx Need a CreateMutex/ReleaseMutex or something here

*/

{

struct tm *tmp = NULL;

tmp = localtime(&timep);

tm = *tmp; /* struct copy */

}

#endif

swup->sw_flags = 0;

switch (swup->sw_conf.swc_file_time_type)

{

case TIME_TYPE_YEAR:

sprintf(buf,"%04d", tm.tm_year + 1900);

break;

case TIME_TYPE_MONTH:

sprintf(buf,"%04d%02d", tm.tm_year + 1900, tm.tm_mon + 1);

break;

case TIME_TYPE_DAY:

sprintf(buf,"%04d%02d%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);

break;

case TIME_TYPE_HOUR:

sprintf(buf,"%04d%02d%02d%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour);

break;

default:

sprintf(buf,"%04d%02d%02d%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour);

break;

}

if (swup->sw_curfileflag == NULL)

{

timewin_copy_string(&swup->sw_curfileflag, buf);

swup->sw_flags = 1;

}

else if (strcmp(swup->sw_curfileflag, buf) != 0)

{

timewin_copy_string(&swup->sw_prefileflag, swup->sw_curfileflag);

timewin_copy_string(&swup->sw_curfileflag, buf);

swup->sw_flags = 1;

}

return swup->sw_flags;

}

/******************************************************************************/

static int timewin_copy_string(char** szDest, const char* src)

{

int len = 0;

if (src == 0)

{

return -1;

}

len = strlen(src) + 1;

if (*szDest == NULL)

{

* szDest = (char *)malloc(len);

}

else if (strlen(*szDest) < len)

{

free(*szDest);

* szDest = (char *)malloc(len);

memset(*szDest, 0, len);


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-23402-10.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 曾涵
      曾涵

      给观众带来更多更好的作品

    • 房千里
      房千里

      赤裸裸千里万里挑衅和侵犯别国做出愚蠢行为是要付出代价的

    热点图片
    拼命载入中...