summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/evil/ChangeLog8
-rw-r--r--legacy/evil/src/lib/Evil.h2
-rw-r--r--legacy/evil/src/lib/Makefile.am2
-rw-r--r--legacy/evil/src/lib/evil_time.c32
-rw-r--r--legacy/evil/src/lib/evil_time.h42
5 files changed, 86 insertions, 0 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog
index fbaadda9dd..5514b0c0af 100644
--- a/legacy/evil/ChangeLog
+++ b/legacy/evil/ChangeLog
@@ -1,3 +1,11 @@
12010-09-14 Vincent Torri <doursse at users dot sf dot net>
2
3 * src/lib/Makefile.am:
4 * src/lib/Evil.h:
5 * src/lib/evil_time.c:
6 * src/lib/evil_time.h:
7 add locatime_r() for calendar in Elementary.
8
12010-05-29 Vincent Torri <doursse at users dot sf dot net> 92010-05-29 Vincent Torri <doursse at users dot sf dot net>
2 10
3 * doc/Doxyfile: 11 * doc/Doxyfile:
diff --git a/legacy/evil/src/lib/Evil.h b/legacy/evil/src/lib/Evil.h
index eb655ce029..cdbaa77400 100644
--- a/legacy/evil/src/lib/Evil.h
+++ b/legacy/evil/src/lib/Evil.h
@@ -65,6 +65,7 @@ extern "C" {
65#include <stdlib.h> 65#include <stdlib.h>
66#include <stdio.h> 66#include <stdio.h>
67#include <sys/time.h> 67#include <sys/time.h>
68#include <time.h>
68#include <limits.h> 69#include <limits.h>
69#include <sys/stat.h> 70#include <sys/stat.h>
70#include <fcntl.h> 71#include <fcntl.h>
@@ -117,6 +118,7 @@ typedef unsigned long gid_t;
117#include "evil_stdlib.h" 118#include "evil_stdlib.h"
118#include "evil_stdio.h" 119#include "evil_stdio.h"
119#include "evil_string.h" 120#include "evil_string.h"
121#include "evil_time.h"
120#include "evil_unistd.h" 122#include "evil_unistd.h"
121#include "evil_util.h" 123#include "evil_util.h"
122 124
diff --git a/legacy/evil/src/lib/Makefile.am b/legacy/evil/src/lib/Makefile.am
index edc0258cb2..9666fb2e92 100644
--- a/legacy/evil/src/lib/Makefile.am
+++ b/legacy/evil/src/lib/Makefile.am
@@ -14,6 +14,7 @@ evil_main.h \
14evil_stdlib.h \ 14evil_stdlib.h \
15evil_stdio.h \ 15evil_stdio.h \
16evil_string.h \ 16evil_string.h \
17evil_time.h \
17evil_unistd.h \ 18evil_unistd.h \
18evil_util.h 19evil_util.h
19 20
@@ -38,6 +39,7 @@ evil_pwd.c \
38evil_stdlib.c \ 39evil_stdlib.c \
39evil_stdio.c \ 40evil_stdio.c \
40evil_string.c \ 41evil_string.c \
42evil_time.c \
41evil_unistd.c \ 43evil_unistd.c \
42evil_util.c \ 44evil_util.c \
43evil_uuid.c 45evil_uuid.c
diff --git a/legacy/evil/src/lib/evil_time.c b/legacy/evil/src/lib/evil_time.c
new file mode 100644
index 0000000000..80fbae1569
--- /dev/null
+++ b/legacy/evil/src/lib/evil_time.c
@@ -0,0 +1,32 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif /* HAVE_CONFIG_H */
4
5#include "Evil.h"
6#include "evil_private.h"
7
8
9struct tm *
10localtime_r(const time_t *timep, struct tm *result)
11{
12#ifndef _MSC_VER
13 struct tm *tmp;
14#endif /* ! _MSC_VER */
15
16 if (!timep || !result)
17 return NULL;
18
19#ifdef _MSC_VER
20 if (localtime_s(result, timep) != 0)
21 return NULL;
22#else
23 tmp = localtime(timep);
24 if (!tmp)
25 return NULL;
26
27 memcpy(result, tmp, sizeof(struct tm));
28
29#endif /* ! _MSC_VER */
30
31 return result;
32}
diff --git a/legacy/evil/src/lib/evil_time.h b/legacy/evil/src/lib/evil_time.h
new file mode 100644
index 0000000000..1594c77ef6
--- /dev/null
+++ b/legacy/evil/src/lib/evil_time.h
@@ -0,0 +1,42 @@
1#ifndef __EVIL_TIME_H__
2#define __EVIL_TIME_H__
3
4
5/**
6 * @file evil_time.h
7 * @brief The file that provides functions ported from Unix in time.h.
8 * @defgroup Evil_Time_Group Time.h functions
9 *
10 * This header provides functions ported from Unix in time.h.
11 *
12 * @{
13 */
14
15
16/**
17 * @brief Convert the calendar time to broken-time representation in a
18 * user supplied data.
19 *
20 * @param timep The calender time.
21 * @param result The broken-down time representation.
22 * @return The broken-down time representation.
23 *
24 * This function converts the calendar time @p timep to a broken-time
25 * representation. The result is stored in the buffer @p result
26 * supplied by the user. If @p timep or @p result are @c NULL, or if
27 * an error occurred, this function returns @c NULL and the values in
28 * @p result might be undefined. Otherwise it returns @p result.
29 *
30 * Conformity: Non applicable.
31 *
32 * Supported OS: Windows XP.
33 */
34EAPI struct tm *localtime_r(const time_t *timep, struct tm *result);
35
36
37/**
38 * @}
39 */
40
41
42#endif /* __EVIL_TIME_H__ */