30#include <libwapcaplet/libwapcaplet.h>
70 NSLOG(netsurf, INFO,
"html_css_fetcher_initialise called for %s",
71 lwc_string_data(scheme));
77 NSLOG(netsurf, INFO,
"html_css_fetcher_finalise called for %s",
78 lwc_string_data(scheme));
87 bool only_2xx,
bool downgrade_tls,
const char *post_urlenc,
107 key = strtoul(lwc_string_data(
path), NULL, 10);
109 lwc_string_unref(
path);
131 ctx = calloc(1,
sizeof(*ctx));
154 if (c->
item != NULL) {
188 if (
ring == NULL)
return;
207 assert(c->
locked ==
false);
208 }
else if (c->
item != NULL) {
217 snprintf(header,
sizeof header,
218 "Content-Type: text/css; charset=utf-8");
225 snprintf(header,
sizeof header,
227 dom_string_byte_length(c->
item->
data));
230 (
const uint8_t *) header;
236 snprintf(header,
sizeof header,
242 (
const uint8_t *) header;
253 dom_string_byte_length(c->
item->
data);
262 NSLOG(netsurf, INFO,
"Processing of %s failed!",
268 assert(c->
locked ==
false);
282 }
while ( (c = next) !=
ring &&
ring != NULL);
299 return fetcher_add(lwc_string_ref(corestring_lwc_x_ns_css),
300 &html_css_fetcher_ops);
314 item->
data = dom_string_ref(data);
void fetch_set_http_code(struct fetch *fetch, long http_code)
set the http code of a fetch
nserror fetcher_add(lwc_string *scheme, const struct fetcher_operation_table *ops)
Register a fetcher for a scheme.
void fetch_send_callback(const fetch_msg *msg, struct fetch *fetch)
send message to fetch
void fetch_free(struct fetch *f)
Free a fetch structure and associated resources.
void fetch_remove_from_queues(struct fetch *fetch)
remove a queued fetch
Fetching of data from a URL (interface).
Useful interned string pointers (interface).
static html_css_fetcher_item * items
struct html_css_fetcher_context html_css_fetcher_context
static uint32_t current_key
static bool html_css_fetcher_initialise(lwc_string *scheme)
static void html_css_fetcher_finalise(lwc_string *scheme)
static void html_css_fetcher_poll(lwc_string *scheme)
nserror html_css_fetcher_register(void)
Register the fetcher for the pseudo x-ns-css scheme.
static void * html_css_fetcher_setup(struct fetch *parent_fetch, nsurl *url, bool only_2xx, bool downgrade_tls, const char *post_urlenc, const struct fetch_multipart_data *post_multipart, const char **headers)
static void html_css_fetcher_free(void *ctx)
static bool html_css_fetcher_start(void *ctx)
static bool html_css_fetcher_can_fetch(const nsurl *url)
static void html_css_fetcher_send_callback(const fetch_msg *msg, html_css_fetcher_context *c)
struct html_css_fetcher_item html_css_fetcher_item
static html_css_fetcher_context * ring
static void html_css_fetcher_abort(void *ctx)
nserror html_css_fetcher_add_item(dom_string *data, nsurl *base_url, uint32_t *key)
nserror
Enumeration of error codes.
@ NSERROR_NOMEM
Memory exhaustion.
Interface for fetchers factory.
Netsurf additional integer type formatting macros.
#define PRIsizet
c99 standard printf formatting for size_t type
#define NSLOG(catname, level, logmsg, args...)
NetSurf URL handling (interface).
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
size_t nsurl_length(const nsurl *url)
Find the length of a NetSurf URL object's URL, as returned by nsurl_access.
nsurl * nsurl_ref(nsurl *url)
Increment the reference count to a NetSurf URL object.
lwc_string * nsurl_get_component(const nsurl *url, nsurl_component part)
Get part of a URL as a lwc_string, from a NetSurf URL object.
struct nsurl nsurl
NetSurf URL object.
Private data for text/html content.
#define RING_REMOVE(ring, element)
Remove the given element from the specified ring.
#define RING_INSERT(ring, element)
Insert the given item into the specified ring.
Interface to utility string handling.
struct fetch_msg::@118::@119 header_or_data
union fetch_msg::@118 data
Fetch POST multipart data.
Information for a single fetch.
bool(* initialise)(lwc_string *scheme)
The initialiser for the fetcher.
struct html_css_fetcher_context * r_prev
struct fetch * parent_fetch
html_css_fetcher_item * item
struct html_css_fetcher_context * r_next
struct html_css_fetcher_item * r_prev
struct html_css_fetcher_item * r_next
Interface to a number of general purpose functionality.
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.