summaryrefslogtreecommitdiff
path: root/src/http_date.h
blob: 62f8d3d4582d72474069dbe40086a325294d29f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * http_date - HTTP date manipulation
 *
 * Copyright(c) 2015 Glenn Strauss gstrauss()gluelogic.com  All rights reserved
 * License: BSD 3-clause (same as lighttpd)
 */
#ifndef INCLUDED_HTTP_DATE_H
#define INCLUDED_HTTP_DATE_H
#include "first.h"

#include "sys-time.h"


#ifdef __cplusplus
extern "C" {
#endif


#define HTTP_DATE_SZ 30  /* (IMF-fixdate is 29 chars + '\0') */

uint32_t http_date_time_to_str (char *s, size_t sz, time_t t);

int http_date_if_modified_since (const char *ifmod, uint32_t ifmodlen, time_t lmtime);

#ifdef HAVE_TIMEGM
#define http_date_timegm(tm) timegm(tm)
#elif defined(_WIN32)
#define http_date_timegm(tm) _mkgmtime(tm)
#else
time_t http_date_timegm (const struct tm *tm);
#endif


#ifdef __cplusplus
}
#endif


#endif