NetSurf
cache-control.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 John-Mark Bell <jmb@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef NETSURF_UTILS_HTTP_CACHE_CONTROL_H_
20#define NETSURF_UTILS_HTTP_CACHE_CONTROL_H_
21
22#include <libwapcaplet/libwapcaplet.h>
23
25
26/**
27 * Parse an HTTP Cache-Control header value
28 *
29 * \param header_value Header value to parse
30 * \param result Pointer to location to receive result
31 * \return NSERROR_OK on success,
32 * NSERROR_NOMEM on memory exhaustion,
33 * appropriate error otherwise
34 */
35nserror http_parse_cache_control(const char *header_value,
37
38/**
39 * Destroy a cache_control object
40 *
41 * \param victim Object to destroy
42 */
44
45/**
46 * Determine if a valid max-age directive is present
47 *
48 * \param cc Object to inspect
49 * \return Whether max-age is valid
50 */
52
53/**
54 * Get the value of a cache control's max-age
55 *
56 * \param cc Object to inspect
57 * \return Max age, in delta-seconds
58 */
60
61/**
62 * Get the value of a cache control's no-cache flag
63 *
64 * \param cc Object to inspect
65 * \return Whether caching is forbidden
66 */
68
69/**
70 * Get the value of a cache control's no-store flag
71 *
72 * \param cc Object to inspect
73 * \return Whether persistent caching is forbidden
74 */
76
77#endif
STATIC char result[100]
Definition: arexx.c:77
uint32_t http_cache_control_max_age(http_cache_control *cc)
Get the value of a cache control's max-age.
bool http_cache_control_has_max_age(http_cache_control *cc)
Determine if a valid max-age directive is present.
nserror http_parse_cache_control(const char *header_value, http_cache_control **result)
Parse an HTTP Cache-Control header value.
void http_cache_control_destroy(http_cache_control *victim)
Destroy a cache_control object.
bool http_cache_control_no_cache(http_cache_control *cc)
Get the value of a cache control's no-cache flag.
bool http_cache_control_no_store(http_cache_control *cc)
Get the value of a cache control's no-store flag.
nserror
Enumeration of error codes.
Definition: errors.h:29
Representation of a Cache-Control.
Definition: cache-control.c:31