MagickCore  7.0.3
timer-private.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License. You may
6  obtain a copy of the License at
7 
8  https://imagemagick.org/script/license.php
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  MagickCore private timer methods.
17 */
18 #ifndef MAGICKCORE_TIMER_PRIVATE_H
19 #define MAGICKCORE_TIMER_PRIVATE_H
20 
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24 
25 static inline void GetMagickUTCtime(const time_t *timep,struct tm *result)
26 {
27 #if defined(MAGICKCORE_HAVE_GMTIME_R)
28  (void) gmtime_r(timep,result);
29 #else
30  {
31  struct tm
32  *my_time;
33 
34  my_time=gmtime(timep);
35  if (my_time != (struct tm *) NULL)
36  (void) memcpy(result,my_time,sizeof(*my_time));
37  }
38 #endif
39 }
40 
41 static inline void GetMagickLocaltime(const time_t *timep,struct tm *result)
42 {
43 #if defined(MAGICKCORE_HAVE_GMTIME_R)
44  (void) localtime_r(timep,result);
45 #else
46  {
47  struct tm
48  *my_time;
49 
50  my_time=localtime(timep);
51  if (my_time != (struct tm *) NULL)
52  (void) memcpy(result,my_time,sizeof(*my_time));
53  }
54 #endif
55 }
56 
57 extern MagickExport time_t
58  GetMagickTime(void);
59 
60 #if defined(__cplusplus) || defined(c_plusplus)
61 }
62 #endif
63 
64 #endif
MagickExport time_t GetMagickTime(void)
Definition: timer.c:326
static void GetMagickUTCtime(const time_t *timep, struct tm *result)
Definition: timer-private.h:25
static void GetMagickLocaltime(const time_t *timep, struct tm *result)
Definition: timer-private.h:41
#define MagickExport