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);
36 my_time=gmtime(timep);
37 if (my_time != (
struct tm *) NULL)
38 (void) memcpy(result,my_time,
sizeof(*my_time));
43static inline void GetMagickLocaltime(
const time_t *timep,
struct tm *result)
45#if defined(MAGICKCORE_HAVE_GMTIME_R)
46 (void) localtime_r(timep,result);
52 my_time=localtime(timep);
53 if (my_time != (
struct tm *) NULL)
54 (void) memcpy(result,my_time,
sizeof(*my_time));
59extern MagickExport time_t
62static inline MagickBooleanType IsImageTTLExpired(
const Image* image)
64 if (image->ttl == (time_t) 0)
66 return(image->ttl < GetMagickTime() ? MagickTrue : MagickFalse);
69static inline time_t ParseMagickTimeToLive(
const char *time_to_live)
80 ttl=(time_t) InterpretLocaleValue(time_to_live,&q);
81 if (q != time_to_live)
83 while (isspace((
int) ((
unsigned char) *q)) != 0)
85 if (LocaleNCompare(q,
"second",6) == 0)
87 if (LocaleNCompare(q,
"minute",6) == 0)
89 if (LocaleNCompare(q,
"hour",4) == 0)
91 if (LocaleNCompare(q,
"day",3) == 0)
93 if (LocaleNCompare(q,
"week",4) == 0)
95 if (LocaleNCompare(q,
"month",5) == 0)
97 if (LocaleNCompare(q,
"year",4) == 0)
103extern MagickPrivate
void
104 SetMagickDatePrecision(
const unsigned long);
106#if defined(__cplusplus) || defined(c_plusplus)