18#ifndef MAGICKCORE_TIMER_PRIVATE_H
19#define MAGICKCORE_TIMER_PRIVATE_H
21#if defined(__cplusplus) || defined(c_plusplus)
25#include "MagickCore/locale_.h"
27static inline void GetMagickUTCTime(
const time_t *timep,
struct tm *result)
29#if defined(MAGICKCORE_HAVE_GMTIME_R)
30 (void) gmtime_r(timep,result);
31#elif defined(_MSC_VER)
32 (void) gmtime_s(result,timep);
38 my_time=gmtime(timep);
39 if (my_time != (
struct tm *) NULL)
40 (void) memcpy(result,my_time,
sizeof(*my_time));
45static inline void GetMagickLocaltime(
const time_t *timep,
struct tm *result)
47#if defined(MAGICKCORE_HAVE_GMTIME_R)
48 (void) localtime_r(timep,result);
49#elif defined(_MSC_VER)
50 (void) localtime_s(result,timep);
56 my_time=localtime(timep);
57 if (my_time != (
struct tm *) NULL)
58 (void) memcpy(result,my_time,
sizeof(*my_time));
63extern MagickExport MagickBooleanType
64 IsSourceDataEpochSet(
void);
66extern MagickExport time_t
69static inline MagickBooleanType IsImageTTLExpired(
const Image* image)
71 if (image->ttl == (time_t) 0)
73 return(image->ttl < GetMagickTime() ? MagickTrue : MagickFalse);
76static inline time_t ParseMagickTimeToLive(
const char *time_to_live)
87 ttl=(time_t) InterpretLocaleValue(time_to_live,&q);
88 if (q != time_to_live)
90 while (isspace((
int) ((
unsigned char) *q)) != 0)
92 if (LocaleNCompare(q,
"second",6) == 0)
94 if (LocaleNCompare(q,
"minute",6) == 0)
96 if (LocaleNCompare(q,
"hour",4) == 0)
98 if (LocaleNCompare(q,
"day",3) == 0)
100 if (LocaleNCompare(q,
"week",4) == 0)
102 if (LocaleNCompare(q,
"month",5) == 0)
104 if (LocaleNCompare(q,
"year",4) == 0)
110extern MagickPrivate
void
111 SetMagickDatePrecision(
const unsigned long);
113#if defined(__cplusplus) || defined(c_plusplus)