1 /* 2 * http_date - HTTP date manipulation 3 * 4 * Copyright(c) 2015 Glenn Strauss gstrauss()gluelogic.com All rights reserved 5 * License: BSD 3-clause (same as lighttpd) 6 */ 7 #ifndef INCLUDED_HTTP_DATE_H 8 #define INCLUDED_HTTP_DATE_H 9 #include "first.h" 10 11 #include "sys-time.h" 12 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif 17 18 19 #define HTTP_DATE_SZ 30 /* (IMF-fixdate is 29 chars + '\0') */ 20 21 uint32_t http_date_time_to_str (char *s, size_t sz, time_t t); 22 23 int http_date_if_modified_since (const char *ifmod, uint32_t ifmodlen, time_t lmtime); 24 25 #ifdef HAVE_TIMEGM 26 #define http_date_timegm(tm) timegm(tm) 27 #elif defined(_WIN32) 28 #define http_date_timegm(tm) _mkgmtime(tm) 29 #else 30 time_t http_date_timegm (const struct tm *tm); 31 #endif 32 33 34 #ifdef __cplusplus 35 } 36 #endif 37 38 39 #endif 40