* src/lib/Evil.h: * src/lib/evil_time.c: * src/lib/evil_time.h: add locatime_r() for calendar in Elementary. SVN revision: 52263devs/devilhorns/wayland_egl
parent
2216c53641
commit
70622ee748
5 changed files with 86 additions and 0 deletions
@ -0,0 +1,32 @@ |
||||
#ifdef HAVE_CONFIG_H |
||||
# include "config.h" |
||||
#endif /* HAVE_CONFIG_H */ |
||||
|
||||
#include "Evil.h" |
||||
#include "evil_private.h" |
||||
|
||||
|
||||
struct tm * |
||||
localtime_r(const time_t *timep, struct tm *result) |
||||
{ |
||||
#ifndef _MSC_VER |
||||
struct tm *tmp; |
||||
#endif /* ! _MSC_VER */ |
||||
|
||||
if (!timep || !result) |
||||
return NULL; |
||||
|
||||
#ifdef _MSC_VER |
||||
if (localtime_s(result, timep) != 0) |
||||
return NULL; |
||||
#else |
||||
tmp = localtime(timep); |
||||
if (!tmp) |
||||
return NULL; |
||||
|
||||
memcpy(result, tmp, sizeof(struct tm)); |
||||
|
||||
#endif /* ! _MSC_VER */ |
||||
|
||||
return result; |
||||
} |
@ -0,0 +1,42 @@ |
||||
#ifndef __EVIL_TIME_H__ |
||||
#define __EVIL_TIME_H__ |
||||
|
||||
|
||||
/**
|
||||
* @file evil_time.h |
||||
* @brief The file that provides functions ported from Unix in time.h. |
||||
* @defgroup Evil_Time_Group Time.h functions |
||||
* |
||||
* This header provides functions ported from Unix in time.h. |
||||
* |
||||
* @{ |
||||
*/ |
||||
|
||||
|
||||
/**
|
||||
* @brief Convert the calendar time to broken-time representation in a |
||||
* user supplied data. |
||||
* |
||||
* @param timep The calender time. |
||||
* @param result The broken-down time representation. |
||||
* @return The broken-down time representation. |
||||
* |
||||
* This function converts the calendar time @p timep to a broken-time |
||||
* representation. The result is stored in the buffer @p result |
||||
* supplied by the user. If @p timep or @p result are @c NULL, or if |
||||
* an error occurred, this function returns @c NULL and the values in |
||||
* @p result might be undefined. Otherwise it returns @p result.
|
||||
* |
||||
* Conformity: Non applicable. |
||||
* |
||||
* Supported OS: Windows XP. |
||||
*/ |
||||
EAPI struct tm *localtime_r(const time_t *timep, struct tm *result); |
||||
|
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
|
||||
#endif /* __EVIL_TIME_H__ */ |
Loading…
Reference in new issue