diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/eina/src/lib/eina_hamster.c | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to 'libraries/eina/src/lib/eina_hamster.c')
-rw-r--r-- | libraries/eina/src/lib/eina_hamster.c | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/libraries/eina/src/lib/eina_hamster.c b/libraries/eina/src/lib/eina_hamster.c deleted file mode 100644 index cebc10b..0000000 --- a/libraries/eina/src/lib/eina_hamster.c +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | /* EINA - EFL data type library | ||
2 | * Copyright (C) 2008 Cedric Bail | ||
3 | * | ||
4 | * This library is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2.1 of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This library is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library; | ||
16 | * if not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifdef HAVE_CONFIG_H | ||
20 | # include "config.h" | ||
21 | #endif | ||
22 | |||
23 | #include <stdio.h> | ||
24 | #include <string.h> | ||
25 | |||
26 | #include "eina_config.h" | ||
27 | #include "eina_types.h" | ||
28 | #include "eina_hamster.h" | ||
29 | |||
30 | /*============================================================================* | ||
31 | * Local * | ||
32 | *============================================================================*/ | ||
33 | |||
34 | /** | ||
35 | * @cond LOCAL | ||
36 | */ | ||
37 | |||
38 | const char *_eina_hamster_time = __TIME__; | ||
39 | const char *_eina_hamster_date = __DATE__; | ||
40 | static int _eina_hamsters = -1; | ||
41 | |||
42 | /** | ||
43 | * @endcond | ||
44 | */ | ||
45 | |||
46 | /*============================================================================* | ||
47 | * Global * | ||
48 | *============================================================================*/ | ||
49 | |||
50 | /*============================================================================* | ||
51 | * API * | ||
52 | *============================================================================*/ | ||
53 | |||
54 | EAPI int | ||
55 | eina_hamster_count(void) | ||
56 | { | ||
57 | if (_eina_hamsters < 0) | ||
58 | { | ||
59 | int hrs = 0, min = 0, sec = 0; | ||
60 | char mon[8] = ""; | ||
61 | int monnum = 0, day = 0, year = 0; | ||
62 | int fields; | ||
63 | |||
64 | fields = sscanf(_eina_hamster_time, "%02d:%02d:%02d", &hrs, &min, &sec); | ||
65 | if (fields == 3) | ||
66 | { | ||
67 | _eina_hamsters = (hrs * 60) + min; | ||
68 | fields = sscanf(_eina_hamster_date, "%s %d %d", mon, &day, &year); | ||
69 | if (fields == 3) | ||
70 | { | ||
71 | int i; | ||
72 | const char *mons[] = | ||
73 | { | ||
74 | "Jan", | ||
75 | "Feb", | ||
76 | "Mar", | ||
77 | "Apr", | ||
78 | "May", | ||
79 | "Jun", | ||
80 | "Jul", | ||
81 | "Aug", | ||
82 | "Sep", | ||
83 | "Oct", | ||
84 | "Nov", | ||
85 | "Dec" | ||
86 | }; | ||
87 | |||
88 | for (i = 0; i < 12; i++) | ||
89 | { | ||
90 | if (!strcmp(mon, mons[i])) | ||
91 | { | ||
92 | monnum = i + 1; | ||
93 | break; | ||
94 | } | ||
95 | } | ||
96 | // alloc 60 for mins, 24 for hrs | ||
97 | // alloc 1-31 (32) for days, 1-12 (13) for months | ||
98 | // use year as-is, for 31 bits (signed) this gives us up to | ||
99 | // 3584 years, which is good enough imho. - 1500 years from | ||
100 | // now or so. :) | ||
101 | _eina_hamsters += | ||
102 | (day + (monnum * 32) + (13 * 32 * year)) * (24 * 60); | ||
103 | } | ||
104 | } | ||
105 | } | ||
106 | |||
107 | // format: [rest - year][0-12 - month][0-31 - day][0-23 - hrs][0-59 - sec] | ||
108 | return _eina_hamsters; | ||
109 | } | ||
110 | |||
111 | /** | ||
112 | * @} | ||
113 | */ | ||